Skip to content

Commit

Permalink
exterior主菜单添加打字app彩蛋
Browse files Browse the repository at this point in the history
框架跟进
  • Loading branch information
MrZ626 committed Aug 3, 2024
1 parent 93192ce commit e0b08b6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 1 files
+3 −3 widget.lua
1 change: 1 addition & 0 deletions assets/language/lang_en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ local L={
musicroom_recollection="Recollection is not a song",
dial_enter="Instrument?",
dial_password="Password correct",
menu_fastype="You seems enjoy typing",
},

-- Level
Expand Down
1 change: 1 addition & 0 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ local L={
musicroom_recollection="Recollection不是一首曲子",
dial_enter="乐器?",
dial_password="密码正确",
menu_fastype="看起来你很喜欢打字",
},

-- Level
Expand Down
24 changes: 23 additions & 1 deletion assets/scene/main_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ local terminalName=GC.newText(FONT.get(35))
versionText:set(VERSION.appVer)
terminalName:set(("TERM[%s]"):format(SYSTEM:sub(1,3):upper()))

local secretString="techmino"
local secretInput=0

function scene.load()
PROGRESS.applyEnv('exterior')
secretInput=0
end

local function sysAction(action)
Expand All @@ -30,7 +34,25 @@ function scene.keyDown(key,isRep)
-- elseif key=='a' then playExterior('acry/test')() return true
-- end
if isRep then return true end
sysAction(KEYMAP.sys:getAction(key))
if secretInput==0 then
if key==secretString:sub(1,1) then
secretInput=1
elseif KEYMAP.sys:getAction(key) then
sysAction(KEYMAP.sys:getAction(key))
end
else
if key==secretString:sub(secretInput+1,secretInput+1) then
secretInput=secretInput+1
if secretInput>=#secretString then
PROGRESS.setSecret('menu_fastype')
SCN.go('fastype')
end
else
sysAction(KEYMAP.sys:getAction(key))
secretInput=0
end
end
print(secretInput)
return true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ local levels={
Z_A="ZYXWVUTSRQPONMLKJIHGFEDCBA",
Tech1="TECHMINOHAOWAN",
Tech2="TECHMINOISFUN",
TG1="TECHMINOGALAXYHAOWAN",
TG2="TECHMINOGALAXYISFUN",
KeyTest1="THEQUICKBROWNFOXJUMPSOVERALAZYDOG",
KeyTest2="THEFIVEBOXINGWIZARDSJUMPQUICKLY",
Hello="HELLOWORLD",
Expand Down Expand Up @@ -125,7 +127,7 @@ function scene.draw()
end

scene.widgetList={
WIDGET.new{type='selector',name='level',text='Text',x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function() return levelName end,code=function(i) levelName=i; targetString=levels[i] end,visibleTick=function() return state==0 end},
WIDGET.new{type='selector',name='level',text="",x=220,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','TG1','TG2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function() return levelName end,code=function(i) levelName=i; targetString=levels[i] end,visibleTick=function() return state==0 end},
WIDGET.new{type='button', 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', name='keyboard',x=160,y=210,w=180,h=100,fontSize=60,text=CHAR.icon.keyboard,code=function() love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1) end},
WIDGET.new{type='button', 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

0 comments on commit e0b08b6

Please sign in to comment.