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

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

@@ -250,6 +250,7 @@ SETTING={--Settings
--System
reTime=4,
autoPause=true,
menuPos='right',
fine=false,
simpMode=false,
lang=1,

View File

@@ -312,6 +312,7 @@ return{
RS="Rotation System",
layout="Layout",
autoPause="Pause while unfocused",
menuPos="Menu button pos.",
swap="Key Combination (Change Atk. Mode)",
simpMode="Simplistic Style",
},

View File

@@ -278,6 +278,7 @@ return{
RS="Sistema de Rotación",
layout="Diseño",
autoPause="Pausar cuando la ventana no está enfocada",
-- menuPos="Menu button pos.",
swap="Combinación de Teclas (Cambiar Modo de Ataque)",
simpMode="Modo Sencillo",
},

View File

@@ -275,6 +275,7 @@ return{
RS="Système de rotation",
layout="Disposition",
autoPause="Mettre en pause en cas de perte de focus",
-- menuPos="Menu button pos.",
swap="Combinaison de touches (changer le mode d'attaque)",
-- simpMode="Simple mode",
},

View File

@@ -302,6 +302,7 @@ return{
RS="Sistema de rotação",
layout="Layout",
autoPause="Pausar quando foco for perco",
-- menuPos="Menu button pos.",
swap="Combinação de tecla(Mudar modo de atk)",
-- simpMode="Simple mode",
},

View File

@@ -135,6 +135,7 @@ return{
RS="''?",
layout="=-=-=",
autoPause="A||",
menuPos="←M→?",
swap="=+=+=",
simpMode=".",
},

View File

@@ -312,6 +312,7 @@ return{
RS="旋转系统",
layout="外观",
autoPause="失去焦点自动暂停",
menuPos="菜单按钮位置",
swap="组合键切换攻击模式",
simpMode="简洁模式",
},

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