Skip to content

Commit

Permalink
重做崩溃/关注页面
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Jan 10, 2025
1 parent 37030d7 commit 910e740
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
1 change: 1 addition & 0 deletions assets/data.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local DATA={
regTime=os.time(),
fumoDmg=0,
fumoDieTime=false,
skin={},
Expand Down
7 changes: 2 additions & 5 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ local L={
menu_local="自己玩",
menu_network="联机玩",

crash_texts={
"没关注还想跑?","虽然也许你已经关注了……但我们走个流程!","点一次关注按钮就放你走喵","点一次关注按钮就放你走喵","点一次关注按钮就放你走喵","干什么!","这么坚决的吗…","不错,那么考验一下你,再点一百次,快速点不算哦",
"","","","四 tetr.io","","","","","","","11","12","13","14","15","16","10+7","10+8","10+9","20F","21F","22F","23F","24F","25F","studio26f.org",
"嚯,不选择逃跑,反而坚持到了这里吗,感受到你的坚定了……","估计你其实早就关注过了,所以奖励先给你啦!\n虽然我也不知道你有没有关注…如果确实还没的话记得补个票喔!",
},
crash_sure="真的不关注一下嘛…?\n如果已经关注了的话也可以点一下关注让我知道喔",
crash_thanks="感谢!",

quit_title_quit="退出?",
quit_title_back="离开?",
Expand Down
35 changes: 16 additions & 19 deletions assets/scene/crash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,34 @@ local scene={}

local aboveScene

local textProgress
local finished
local subscribed

function scene.load(prev)
aboveScene=SCN.scenes[prev] or NONE
textProgress=1
finished=TABLE.find(DATA.skin,'关注娘')
scene.widgetList.sub:setVisible(not finished)
if SCN.stackChange>0 then
aboveScene=SCN.scenes[prev] or NONE
end
subscribed=TABLE.find(DATA.skin,'关注娘')
scene.widgetList.sub:setVisible(not subscribed)
end

local function subscribe()
if not finished and TASK.lock('sub',2.6) then
if not subscribed and TASK.lock('subscribe_go',2.6) then
love.system.openURL(ChessData['一只略'].link)
TASK.new(function()
TASK.yieldT(1.26)
finished=true
subscribed=true
scene.widgetList.sub:setVisible(false)
DATA.getSkin('关注娘')
end)
end
end
local function leave()
if finished then
if subscribed then
SCN.back('none')
elseif TASK.lock('subscribe_lock',6.2) then
MSG('info',Texts.crash_sure,6.2)
else
SCN.back('none')
elseif TASK.lock('subscribe_lock',2.6) then
MSG('info',Texts.crash_texts[textProgress],6.2)
textProgress=textProgress+1
if not Texts.crash_texts[textProgress] then
DATA.getSkin('关注娘')
finished=true
scene.widgetList.sub:setVisible(false)
end
end
end

Expand Down Expand Up @@ -65,7 +62,7 @@ function scene.draw()
GC.setColor(1,1,1)
GC.mDraw(TEX.crash,500,300,nil,2)

if finished then
if subscribed then
GC.polygon('fill',
263,306,
533,299,
Expand All @@ -74,7 +71,7 @@ function scene.draw()
)
GC.setColor(COLOR.D)
FONT.set(60)
GC.print("感谢!",300,384-Jump.smooth()*20)
GC.print(Texts.crash_thanks,300,384-Jump.smooth()*20)
end
end

Expand Down
4 changes: 3 additions & 1 deletion assets/scene/get_new_skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ local function quit()
end

function scene.load(prev)
aboveScene=SCN.scenes[prev] or NONE
if SCN.stackChange>0 then
aboveScene=SCN.scenes[prev] or NONE
end

animIn=true
timer=1
Expand Down
4 changes: 3 additions & 1 deletion assets/scene/quit_sure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ local function animTimer() return timer^2 end
local quitText=GC.newText(FONT.get(60))

function scene.load(prev)
aboveScene=SCN.scenes[prev] or NONE
if SCN.stackChange>0 then
aboveScene=SCN.scenes[prev] or NONE
end

animIn=true
timer=1
Expand Down
4 changes: 2 additions & 2 deletions assets/scene/title.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end

function scene.overDraw()
GC.origin()
GC.setColor(0,0,0,TASK.getLock('subscribe_lock') or 0)
GC.setColor(0,0,0,TASK.getLock('title_subscribePress') or 0)
GC.rectangle('fill',0,0,SCR.w,SCR.h)
end

Expand All @@ -91,7 +91,7 @@ scene.widgetList={
WIDGET.new{type='button_simp', pos={1,0},x=-50,y=50+95*3,w=85,frameColor='X',fillColor='L',cornerR=30,image=TEX.ui,quad=QUAD.ui.title.settings, code=WIDGET.c_goScn'settings'},
WIDGET.new{type='button_simp', pos={1,0},x=-50,y=50+95*4,w=85,frameColor='X',fillColor='L',cornerR=30,image=TEX.ui,quad=QUAD.ui.title.subscribe,
onPress=function ()
if TASK.lock('subscribe_lock',.42) then
if TASK.lock('title_subscribePress',.42) then
love.timer.sleep(0.26)
subButtonClick=subButtonClick+1
if subButtonClick==3 then
Expand Down

0 comments on commit 910e740

Please sign in to comment.