Skip to content

Commit

Permalink
框架跟进,补充控件样式细节
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Dec 17, 2024
1 parent 343b37e commit 8582026
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 5 files
+2 −2 font.lua
+5 −2 gcExtend.lua
+1 −1 scene.lua
+1 −1 scene/console.lua
+110 −101 widget.lua
2 changes: 1 addition & 1 deletion assets/scene/about_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function scene.draw()
end

scene.widgetList={
{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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'about_title'},
}
return scene
2 changes: 1 addition & 1 deletion assets/scene/dictionary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ do -- Widgets
scrollBarWidth=5,
scrollBarDist=12,
scrollBarColor=COLOR.lY,
activeColor={0,0,0,0},idleColor={0,0,0,0},
activeColor={0,0,0,0},
stencilMode='single',
}
function listBox.drawFunc(obj,_,sel)
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/keyset_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ scene.widgetList={
)()
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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
}
return scene
24 changes: 12 additions & 12 deletions assets/scene/lang_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ end
scene.widgetList={
{type='button',pos={0,.5},x=210,y=-360,w=200,h=80,lineWidth=4,cornerR=0,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn('none')},

{type='button', x=350,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.en, color='R', sound_trigger='check_on',code=function() _setLang('en') end},
{type='button', x=350,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.eo, color='F', sound_trigger='check_on',code=function() _setLang('eo') end},
{type='button_fill', x=350,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=35, text='', color='K'},
{type='button_fill', x=350,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=35, text='', color='G'},
{type='button_fill', x=350,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.en, fillColor='R', sound_trigger='check_on',code=function() _setLang('en') end},
{type='button_fill', x=350,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.eo, fillColor='F', sound_trigger='check_on',code=function() _setLang('eo') end},
{type='button', x=350,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=35, text='', fillColor='K'},
{type='button', x=350,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=35, text='', fillColor='G'},

{type='button', x=800,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.it, color='O', sound_trigger='check_on',code=function() _setLang('it') end},
{type='button_fill', x=800,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', color='A'},
{type='button_fill', x=800,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', color='J'},
{type='button_fill', x=800,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', color='P'},
{type='button_fill', x=800,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text=langList.it, fillColor='O', sound_trigger='check_on',code=function() _setLang('it') end},
{type='button', x=800,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', fillColor='A'},
{type='button', x=800,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', fillColor='J'},
{type='button', x=800,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40, text='', fillColor='P'},

{type='button', x=1250,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text=langList.zh, color='Y', sound_trigger='check_on',code=function() _setLang('zh') end},
{type='button_fill', x=1250,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', color='I'},
{type='button_fill', x=1250,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', color='B'},
{type='button_fill', x=1250,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', color='V'},
{type='button_fill', x=1250,y=310,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text=langList.zh, fillColor='Y', sound_trigger='check_on',code=function() _setLang('zh') end},
{type='button', x=1250,y=460,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', fillColor='I'},
{type='button', x=1250,y=610,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', fillColor='B'},
{type='button', x=1250,y=760,w=390,h=100,lineWidth=4,cornerR=0,fontSize=40,text='', fillColor='V'},
}

return scene
2 changes: 1 addition & 1 deletion assets/scene/lang_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ local function _setLang(lid)
end

scene.widgetList={
{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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
{type='text',x=800,y=900,fontSize=30,text=LANG'lang_note'},

{type='button', name='dial_1',x=350 ,y=310,w=390,h=100,cornerR=26,fontSize=40,text='',fontType='bold',color='LV',sound_trigger=false,code=function() if dialMode then dial('1') else _setLang('en') end end},
Expand Down
29 changes: 17 additions & 12 deletions assets/scene/main_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ function scene.load()
settingHint=PROGRESS.get('main')<2 and PROGRESS.get('launchCount')<=3
PROGRESS.applyEnv('interior')
local visibleButtonName=PROGRESS.get('main')==1 and '1' or '2'
local s2=PROGRESS.get('main')<=2
for _,v in next,scene.widgetList do
if v.name=='1' or v.name=='2' then
v:setVisible(v.name==visibleButtonName)
elseif v.name=='GameSet' then
v.color=PROGRESS.get('main')<=2 and COLOR.L or COLOR.lD
v.frameColor=s2 and COLOR.L or COLOR.lD
v.fillColor=s2 and COLOR.L or COLOR.LD
v.textColor=s2 and COLOR.L or COLOR.LD
elseif v.name=='quit' then
v.fillColor=s2 and COLOR.R or COLOR.B
end
end
if PROGRESS.get('main')<=2 and (PROGRESS.getInteriorScore('sprint')>=200 or PROGRESS.getTotalInteriorScore()>=350) then
if s2 and (PROGRESS.getInteriorScore('sprint')>=200 or PROGRESS.getTotalInteriorScore()>=350) then
PROGRESS.transcendTo(3)
elseif PROGRESS.get('main')==1 and (PROGRESS.getTotalInteriorScore()>=150 or PROGRESS.getTutorialPassed()) then
PROGRESS.transcendTo(2)
Expand All @@ -27,7 +32,7 @@ local function sysAction(action)
if PROGRESS.get('main')<=2 then
if sureCheck('quit') then PROGRESS.quit() end
else
SCN.back('none')
SCN.back('blackStun')
end
end
end
Expand Down Expand Up @@ -104,18 +109,18 @@ function scene.overDraw()
end

scene.widgetList={
{type='button_fill',pos={0,0},x=60,y=60,w=80,color='R',cornerR=0,sound_trigger='button_back',fontSize=70,text=CHAR.icon.back_chevron,code=function() sysAction('back') end},
{name='quit',type='button_fill',pos={0,0},x=60,y=60,w=80,fillColor='R',cornerR=0,sound_trigger='button_back',fontSize=70,text=CHAR.icon.back_chevron,code=function() sysAction('back') end},

{name='1',type='button_fill',pos={.5,.5},x=-270,y=-40,w=500,h=140, color='F',text=LANG'main_in_sprint', fontSize=40,cornerR=0,code=playInterior'brik/interior/sprint'},
{name='1',type='button_fill',pos={.5,.5},x=270, y=-40,w=500,h=140, color='F',text=LANG'main_in_marathon',fontSize=40,cornerR=0,code=playInterior'brik/interior/marathon'},
{name='1',type='button_fill',pos={.5,.5},x=-270,y=-40,w=500,h=140, fillColor='F',text=LANG'main_in_sprint', fontSize=40,cornerR=0,code=playInterior'brik/interior/sprint'},
{name='1',type='button_fill',pos={.5,.5},x=270, y=-40,w=500,h=140, fillColor='F',text=LANG'main_in_marathon',fontSize=40,cornerR=0,code=playInterior'brik/interior/marathon'},

{name='2',type='button_fill',pos={.5,.5},x=-360,y=-40,w=320,h=140, color='R',text=LANG'main_in_dig', fontSize=40,cornerR=0,code=playInterior'brik/interior/dig'},
{name='2',type='button_fill',pos={.5,.5},x=0, y=-40,w=320,h=140, color='R',text=LANG'main_in_sprint', fontSize=40,cornerR=0,code=playInterior'brik/interior/sprint'},
{name='2',type='button_fill',pos={.5,.5},x=360, y=-40,w=320,h=140, color='R',text=LANG'main_in_marathon',fontSize=40,cornerR=0,code=playInterior'brik/interior/marathon'},
{name='2',type='button_fill',pos={.5,.5},x=-360,y=-40,w=320,h=140, fillColor='R',text=LANG'main_in_dig', fontSize=40,cornerR=0,code=playInterior'brik/interior/dig'},
{name='2',type='button_fill',pos={.5,.5},x=0, y=-40,w=320,h=140, fillColor='R',text=LANG'main_in_sprint', fontSize=40,cornerR=0,code=playInterior'brik/interior/sprint'},
{name='2',type='button_fill',pos={.5,.5},x=360, y=-40,w=320,h=140, fillColor='R',text=LANG'main_in_marathon',fontSize=40,cornerR=0,code=playInterior'brik/interior/marathon'},

{name='1',type='button_fill',pos={.5,.5},x=0, y=140,w=500,h=140, color='B',text=LANG'main_in_tutorial',fontSize=40,cornerR=0,code=WIDGET.c_goScn('tutorial_in','none')},
{name='2',type='button_fill',pos={.5,.5},x=-270,y=140,w=500,h=140, color='B',text=LANG'main_in_tutorial',fontSize=40,cornerR=0,code=WIDGET.c_goScn('tutorial_in','none')},
{name='2',type='button_fill',pos={.5,.5},x=270, y=140,w=500,h=140, color='Y',text=LANG'main_in_sandbox', fontSize=40,cornerR=0,code=playInterior'brik/interior/train'},
{name='1',type='button_fill',pos={.5,.5},x=0, y=140,w=500,h=140, fillColor='B',text=LANG'main_in_tutorial',fontSize=40,cornerR=0,code=WIDGET.c_goScn('tutorial_in','none')},
{name='2',type='button_fill',pos={.5,.5},x=-270,y=140,w=500,h=140, fillColor='B',text=LANG'main_in_tutorial',fontSize=40,cornerR=0,code=WIDGET.c_goScn('tutorial_in','none')},
{name='2',type='button_fill',pos={.5,.5},x=270, y=140,w=500,h=140, fillColor='Y',text=LANG'main_in_sandbox', fontSize=40,cornerR=0,code=playInterior'brik/interior/train'},

{name='LangSel',type='button', pos={.5,.5},x=-270,y=320,w=400,h=100,text=CHAR.icon.language, fontSize=70,lineWidth=4,cornerR=0,code=WIDGET.c_goScn('lang_in','none')},
{name='GameSet',type='button', pos={.5,.5},x=270, y=320,w=400,h=100,text=LANG'main_in_settings', fontSize=40,lineWidth=4,cornerR=0,sound_trigger=false,code=function()
Expand Down
4 changes: 2 additions & 2 deletions assets/scene/main_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ function scene.draw()
end

scene.widgetList={
{type='button_fill',pos={0,0},x=60,y=60,w=80,color='R',cornerR=15,sound_trigger='button_back',fontSize=70,text=CHAR.icon.power,code=function() sysAction('back') end,visibleFunc=function() return SYSTEM~='iOS' end},
{type='button_fill',pos={0,0},x=60,y=60,w=80,fillColor='R',cornerR=15,sound_trigger='button_back',fontSize=70,text=CHAR.icon.power,code=function() sysAction('back') end,visibleFunc=function() return SYSTEM~='iOS' end},

{type='button_invis',pos={1,0},x=-200,y=60,w=80,cornerR=20,fontSize=70,text=CHAR.icon.video, sound_trigger='button_soft',code=WIDGET.c_goScn('main_in','none')},
{type='button_invis',pos={1,0},x=-200,y=60,w=80,cornerR=20,fontSize=70,text=CHAR.icon.video, sound_trigger='button_soft',code=WIDGET.c_goScn('main_in','blackStun')},
{type='button_invis',pos={1,0},x=-400,y=60,w=80,cornerR=20,fontSize=70,text=CHAR.icon.info_circ, sound_trigger='button_soft',code=WIDGET.c_goScn('about_out','fadeHeader')},
{type='button_invis',pos={1,0},x=-600,y=60,w=80,cornerR=20,fontSize=70,text=CHAR.icon.music, sound_trigger='button_soft',code=WIDGET.c_goScn('musicroom','fadeHeader')},
{type='button_invis',pos={1,0},x=-800,y=60,w=80,cornerR=20,fontSize=70,text=CHAR.icon.language, sound_trigger='button_soft',code=WIDGET.c_goScn('lang_out','fadeHeader')},
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/mode_exterior.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function scene.draw()
end

scene.widgetList={
{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=function() sysAction('back') end},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=function() sysAction('back') end},
{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'graph_brik_title'},
}
return scene
4 changes: 2 additions & 2 deletions assets/scene/musicroom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local musicListBox do
scrollBarWidth=5,
scrollBarDist=4,
scrollBarColor='dL',
activeColor='L',idleColor='L',
activeColor='L',
}
function musicListBox.drawFunc(name,_,sel)
if sel then
Expand Down Expand Up @@ -357,7 +357,7 @@ function scene.overDraw()
end

scene.widgetList={
{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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'musicroom_title'},

musicListBox,
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/setting_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ local function sliderShow_fps(S) return S.disp().." FPS" end
local function sliderShow_mul(S) return S.disp().."%" end

scene.widgetList={
{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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},

{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'settings_title'},
{name='S1',type='button_invis',pos={1,0},x=-800,y=60,w=150,h=100,cornerR=20,fontSize=70,text=CHAR.icon.settings, sound_trigger='button_soft',code=function() if page~='1' then SCN.swapTo('setting_out','none',1) end end},
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/simulation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function scene.draw()
end

scene.widgetList={
{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'},
{type='button_fill',pos={0,0},x=120,y=60,w=180,h=70,fillColor='B',cornerR=15,sound_trigger='button_back',fontSize=40,text=backText,code=WIDGET.c_backScn'fadeHeader'},
{type='text',pos={0,0},x=240,y=60,alignX='left',fontType='bold',fontSize=60,text=LANG'simulation_title'},
}
return scene
2 changes: 1 addition & 1 deletion assets/scene/tutorial_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local function B(t)
type='button_fill',
pos={.5,.52},
w=620,h=140,
color='B',
fillColor='B',
fontSize=50,
cornerR=0,
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scene_app/15puzzle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function scene.draw()
end

scene.widgetList={
WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'space'},
WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,fillColor='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'space'},
colorSelector,
WIDGET.new{type='checkBox', pos={0,.5},x=240, y=-150,text="Invis",widthLimit=200,fontSize=40,disp=function() return invis end, code=WIDGET.c_pressKey'w',visibleTick=notGaming},
WIDGET.new{type='checkBox', pos={0,.5},x=240, y=-50, text="Slide",widthLimit=200,fontSize=40,disp=function() return slide end, code=WIDGET.c_pressKey'e',visibleTick=notGaming},
Expand Down
2 changes: 1 addition & 1 deletion assets/scene_app/mahjong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function scene.draw()
end

scene.widgetList={
WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,color='lR',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'},
WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,fillColor='lR',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'},
WIDGET.new{type='button_fill',pos={1,1},x=-120,y=-180,w=160,h=80,fontSize=45,sound_trigger=false,text='自摸',code=WIDGET.c_pressKey'return'},
WIDGET.new{type='button_fill',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()},
}
Expand Down
5 changes: 5 additions & 0 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,11 @@ SCN.addSwapStyle('fastFadeHeader',{
GC.rectangle('fill',0,h+1,SCR.w,SCR.h-h)
end,
})
SCN.addSwapStyle('blackStun',{
duration=.42,
timeChange=.1,
draw=function() GC.clear() end,
})
local _oldLoad=SCN.scenes._console.load
function SCN.scenes._console.load(...)
_oldLoad(...)
Expand Down

0 comments on commit 8582026

Please sign in to comment.