diff --git a/assets/game/acryPlayer.lua b/assets/game/acryPlayer.lua index 6a75e0f3..6e429bad 100644 --- a/assets/game/acryPlayer.lua +++ b/assets/game/acryPlayer.lua @@ -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() diff --git a/assets/game/gelaPlayer.lua b/assets/game/gelaPlayer.lua index bb30d2c0..f0cd5b79 100644 --- a/assets/game/gelaPlayer.lua +++ b/assets/game/gelaPlayer.lua @@ -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") diff --git a/assets/scene/game_out.lua b/assets/scene/game_out.lua index e58cabab..fc2835bb 100644 --- a/assets/scene/game_out.lua +++ b/assets/scene/game_out.lua @@ -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 @@ -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 @@ -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 diff --git a/assets/scene/keyset_out.lua b/assets/scene/keyset_out.lua index 73669206..d29da122 100644 --- a/assets/scene/keyset_out.lua +++ b/assets/scene/keyset_out.lua @@ -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'}, } diff --git a/assets/scene/main_out.lua b/assets/scene/main_out.lua index 4c00607e..47b7d2a1 100644 --- a/assets/scene/main_out.lua +++ b/assets/scene/main_out.lua @@ -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 diff --git a/assets/skin/acry_template.lua b/assets/skin/acry_template.lua index efcc7959..8b89f46b 100644 --- a/assets/skin/acry_template.lua +++ b/assets/skin/acry_template.lua @@ -157,9 +157,10 @@ 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 @@ -167,9 +168,7 @@ function S.drawFieldCell(G,_,x,y) 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