添加游戏中菜单按钮位置设定

This commit is contained in:
MrZ626
2021-08-09 01:39:18 +08:00
parent 78b15b78fa
commit 2ad336b13a
9 changed files with 30 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ local GAME=GAME
local noTouch,noKey=false,false
local touchMoveLastFrame=false
local floatRepRate,replayRate
local modeTextPos
local replaying
local repRateStrings={[0]="pause",[.125]="0.125x",[.5]="0.5x",[1]="1x",[2]="2x",[5]="5x"}
@@ -69,6 +70,9 @@ local function _step()floatRepRate=floatRepRate+1 end
function scene.sceneInit(org)
noKey=replaying
noTouch=not SETTING.VKSwitch or noKey
if GAME.init then
resetGameData()
GAME.init=false
@@ -79,10 +83,20 @@ function scene.sceneInit(org)
floatRepRate,replayRate=0,1
end
updateRepButtons()
noKey=replaying
noTouch=not SETTING.VKSwitch or noKey
WIDGET.active.restart.hide=replaying
if SETTING.menuPos=='right'then
WIDGET.active.restart.x=1125
WIDGET.active.pause.x=1195
modeTextPos=1100-drawableText.modeName:getWidth()
elseif SETTING.menuPos=='middle'then
WIDGET.active.restart.x=360
WIDGET.active.pause.x=860
modeTextPos=940
elseif SETTING.menuPos=='left'then
WIDGET.active.restart.x=120
WIDGET.active.pause.x=190
modeTextPos=1200-drawableText.modeName:getWidth()
end
end
function scene.sceneBack()
destroyPlayers()
@@ -303,7 +317,7 @@ function scene.draw()
--Mode info
gc.setColor(1,1,1,.8)
gc.draw(drawableText.modeName,1120-drawableText.modeName:getWidth(),10)
gc.draw(drawableText.modeName,modeTextPos,10)
--Replaying
if replaying then
@@ -326,8 +340,8 @@ scene.widgetList={
WIDGET.newKey{name="rep2", x=300,y=50,w=60,code=_rep2,fText=TEXTURE.rep.rep2},
WIDGET.newKey{name="rep5", x=365,y=50,w=60,code=_rep5,fText=TEXTURE.rep.rep5},
WIDGET.newKey{name="step", x=430,y=50,w=60,code=_step,fText=TEXTURE.rep.step},
WIDGET.newKey{name="restart", x=1165,y=45,w=60,code=restart,fText=TEXTURE.game.restart},
WIDGET.newKey{name="pause", x=1235,y=45,w=60,code=pauseGame,fText=TEXTURE.game.pause},
WIDGET.newKey{name="restart", x=0,y=45,w=60,code=restart,fText=TEXTURE.game.restart},
WIDGET.newKey{name="pause", x=0,y=45,w=60,code=pauseGame,fText=TEXTURE.game.pause},
}
return scene

View File

@@ -31,8 +31,9 @@ scene.widgetList={
WIDGET.newSlider{name="reTime", x=330, y=320, w=300,unit=10,disp=SETval("reTime"),code=SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end},
WIDGET.newSelector{name="RS", x=300, y=420, w=300,color='S',list={'TRS','SRS','BiRS','ASC','ASC_plus','C2','C2_sym','Classic','Classic_plus','None','None_plus'},disp=SETval("RS"),code=SETsto("RS")},
WIDGET.newButton{name="layout", x=250, y=540, w=200,h=70,font=35, code=goScene'setting_skin'},
WIDGET.newSwitch{name="autoPause", x=1060, y=350, disp=SETval("autoPause"), code=SETrev("autoPause")},
WIDGET.newSwitch{name="swap", x=1060, y=460, disp=SETval("swap"), code=SETrev("swap")},
WIDGET.newSwitch{name="autoPause", x=1060, y=320, disp=SETval("autoPause"), code=SETrev("autoPause")},
WIDGET.newSelector{name="menuPos", x=980, y=420, w=300,color='O',list={'left','middle','right'},disp=SETval("menuPos"),code=SETsto("menuPos")},
WIDGET.newSwitch{name="swap", x=1060, y=520, disp=SETval("swap"), code=SETrev("swap")},
WIDGET.newSwitch{name="simpMode", x=1060, y=800, disp=SETval("simpMode"),
code=function()
SETTING.simpMode=not SETTING.simpMode