Skip to content

Commit

Permalink
修gela和arcy的键位设置页面测试按钮还是进brik的测试
Browse files Browse the repository at this point in the history
修acry无法显示
  • Loading branch information
MrZ626 committed Jul 27, 2024
1 parent 3d6356d commit 3f82f2a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 20 deletions.
27 changes: 19 additions & 8 deletions assets/game/acryPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -729,19 +729,30 @@ function AP:render()
GC.stc_rect(0,0,720,-720)
gc_scale(16/SET.fieldSize)

self:triggerEvent('drawBelowField') -- From frame's bottom-left, 40px a cell
self:triggerEvent('drawBelowField') -- From frame's bottom-left, 45px a cell

-- Grid & Cells
skin.drawFieldBackground(SET.fieldSize)
local F=self.field
for y=1,#F do for x=1,#F[1] do
local C=F[y][x]
if C then
skin.drawFieldCell(C,F,(x-1)*40+2,-y*40+2)

do -- Field
local matrix=self.field
gc_push('transform')

local width=SET.fieldSize
for y=1,#matrix do
for x=1,#matrix[1] do
local C=matrix[y][x]
if C then
skin.drawFieldCell(C,matrix,x,y)
end
gc_translate(45,0)
end
gc_translate(-45*width,-45) -- \r\n (Return + Newline)
end
end end
gc_pop()
end

self:triggerEvent('drawInField') -- From frame's bottom-left, 40px a cell
self:triggerEvent('drawInField') -- From frame's bottom-left, 45px a cell

-- Stop field stencil
GC.stc_stop()
Expand Down
7 changes: 3 additions & 4 deletions assets/game/gelaPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,9 @@ function GP:freshDelay(reason)
end
end
function GP:setSequenceGen(seqData,args)
if assert(type(args)=='string',"setSequenceGen: 'args' need string") then
if args:sArg('-clearData') then self.seqData={} end
if args:sArg('-clearNext') then TABLE.clear(self.nextQueue) end
end
if type(args)~='string' then args='' end
if args:sArg('-clearData') then self.seqData={} end
if args:sArg('-clearNext') then TABLE.clear(self.nextQueue) end

self.seqGen=mechLib.gela.sequence[seqData] or seqData
assert(self:seqGen(self.seqData,true)==nil,"First call of sequence generator must return nil")
Expand Down
3 changes: 3 additions & 0 deletions assets/scene/game_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function scene.keyUp(key)
end

function scene.touchDown(x,y,id)
x,y=SCR.xOy_m:inverseTransformPoint(SCR.xOy:transformPoint(x,y))
if GAME.mainPlayer then
if GAME.mainPlayer.gameMode=='brik' or GAME.mainPlayer.gameMode=='gela' then
if SETTINGS.system.touchControl then VCTRL.press(x,y,id) end
Expand All @@ -93,6 +94,7 @@ function scene.touchDown(x,y,id)
end
end
function scene.touchMove(x,y,dx,dy,id)
x,y=SCR.xOy_m:inverseTransformPoint(SCR.xOy:transformPoint(x,y))
if GAME.mainPlayer then
if GAME.mainPlayer.gameMode=='brik' or GAME.mainPlayer.gameMode=='gela' then
if SETTINGS.system.touchControl then VCTRL.move(x,y,id) end
Expand All @@ -102,6 +104,7 @@ function scene.touchMove(x,y,dx,dy,id)
end
end
function scene.touchUp(x,y,id)
x,y=SCR.xOy_m:inverseTransformPoint(SCR.xOy:transformPoint(x,y))
if GAME.mainPlayer then
if GAME.mainPlayer.gameMode=='brik' or GAME.mainPlayer.gameMode=='gela' then
if SETTINGS.system.touchControl then VCTRL.release(id) end
Expand Down
14 changes: 10 additions & 4 deletions assets/scene/keyset_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ scene.widgetList={
{type='button',name='sys', x=900,y=390,w=200,h=60,text=LANG"keyset_sys_down", fontSize=20, color='lC',code=selAct('sys', 'down' )},
{type='button',name='sys', x=900,y=460,w=200,h=60,text=LANG"keyset_sys_select", fontSize=20, color='lC',code=selAct('sys', 'select' )},

{type='button_invis',name='Sacry',pos={1,0},x=-800,y=60,w=150,h=100,cornerR=20,fontSize=60,text="G",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='acry' then keyMode='acry'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('acry') end},
{type='button_invis',name='Sgela',pos={1,0},x=-600,y=60,w=150,h=100,cornerR=20,fontSize=60,text="P",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='gela' then keyMode='gela'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('gela') end},
{type='button_invis',name='Sbrik',pos={1,0},x=-400,y=60,w=150,h=100,cornerR=20,fontSize=60,text="M",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='brik' then keyMode='brik'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('brik') end},
{type='button_invis',name='Sacry',pos={1,0},x=-800,y=60,w=150,h=100,cornerR=20,fontSize=60,text="A",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='acry' then keyMode='acry'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('acry') end},
{type='button_invis',name='Sgela',pos={1,0},x=-600,y=60,w=150,h=100,cornerR=20,fontSize=60,text="G",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='gela' then keyMode='gela'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('gela') end},
{type='button_invis',name='Sbrik',pos={1,0},x=-400,y=60,w=150,h=100,cornerR=20,fontSize=60,text="B",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='brik' then keyMode='brik'; scene.load() end end,visibleFunc=function() return PROGRESS.getStyleUnlock('brik') end},
{type='button_invis',name='Ssys', pos={1,0},x=-200,y=60,w=150,h=100,cornerR=20,fontSize=60,text="S",fontType='bold',sound_trigger='button_soft',code=function() if keyMode~='sys' then keyMode='sys'; scene.load() end end},

{type='button',pos={1,1},x=-300,y=-80,w=160,h=80,text=LANG"setting_test",fontSize=40,code=playExterior('brik/exterior/test'),visibleFunc=function() return not GAME.mode end},
{type='button',pos={1,1},x=-300,y=-80,w=160,h=80,text=LANG"setting_test",fontSize=40,code=function()
if GAME.mode then return MSG.new('warn',Text.setting_tryTestInGame) end
playExterior(
keyMode=='brik' and 'brik/exterior/test' or
keyMode..'/test'
)()
end,visibleFunc=function() return keyMode~='sys' end},
{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'settings_title'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,color='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
}
Expand Down
1 change: 1 addition & 0 deletions assets/scene/main_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ local function sysAction(action)
end
end
function scene.keyDown(key,isRep)
if key=='t' then playExterior('acry/test')() return true end
if isRep then return true end
sysAction(KEYMAP.sys:getAction(key))
return true
Expand Down
7 changes: 3 additions & 4 deletions assets/skin/acry_template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,18 @@ local function drawAcry(g)
gc_rectangle('line',-12,-12,24,24)
end
end
function S.drawFieldCell(G,_,x,y)
function S.drawFieldCell(G,_,_,_)
gc_setLineWidth(2)
gc_push('transform')
gc_translate(22.5,-22.5)
if G.moveTimer then
local d=G.moveTimer/G.moveDelay
if G.fall then
d=-d*(d-2)
else
d=-math.cos(d*math.pi)/2+.5
end
gc_translate(45*(x+d*G.dx)-22.5,-45*(y+d*G.dy)+22.5)
else
gc_translate(45*x-22.5,-45*y+22.5)
gc_translate(45*(d*G.dx),-45*(d*G.dy))
end
if G.clearTimer and not G.generate then
local t=G.clearTimer/G.clearDelay
Expand Down

0 comments on commit 3f82f2a

Please sign in to comment.