From c20e4ac8457829b536362df7599b0bb9312e4377 Mon Sep 17 00:00:00 2001 From: SweetSea-ButImNotSweet <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:49:24 +0700 Subject: [PATCH] Add short delay before showing nickname (again) --- parts/gameFuncs.lua | 20 +++++++++----------- parts/language/lang_zh_code.lua | 3 ++- parts/player/draw.lua | 8 +++++--- parts/player/init.lua | 5 ++++- parts/scenes/mod.lua | 8 -------- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua index 2f19f4f7..5fde6038 100644 --- a/parts/gameFuncs.lua +++ b/parts/gameFuncs.lua @@ -994,7 +994,7 @@ do-- function dumpBasicConfig() end end do-- function resetGameData(args) - local function task_showMods() -- TODO + local function task_showMods(P) -- TODO coroutine.yield() local counter=0 @@ -1002,22 +1002,20 @@ do-- function resetGameData(args) SFX.play('collect',.2) TEXT.show(GAME.modApplyAt,640,26,45,'spin') for _=1,90 do coroutine.yield() end - end - for number,sel in next,GAME.mod do - if sel>0 then - if counter==0 then - coroutine.yield() - else + for number,sel in next,GAME.mod do + if sel>0 then for _=1,20 do coroutine.yield() end + local M=MODOPT[number] + SFX.play('collect',.2) + TEXT.show(M.id,640+(counter%5-2)*80,26,45,'spin') + counter=counter+1 end - local M=MODOPT[number] - SFX.play('collect',.2) - TEXT.show(M.id,640+(counter%5-2)*80,26,45,'spin') - counter=counter+1 end + for _=1,(counter%5)*20+90 do coroutine.yield() end + if GAME.playing then PLAYERS[1].showUsername=true end end end local gameSetting={ diff --git a/parts/language/lang_zh_code.lua b/parts/language/lang_zh_code.lua index 3d03a1f7..902cfb69 100644 --- a/parts/language/lang_zh_code.lua +++ b/parts/language/lang_zh_code.lua @@ -157,7 +157,8 @@ return { tryAnotherBuild="Error.DecodeUTF8(); //如果你现在用的是Windows系统,请重新下载 Techmino-32/64位 (和现在运行的不一样的那个)。", modInstruction="Mod.Instruction();\n/*选择你要使用的Mod\n不同Mod会用不同的方式改变初始游戏规则(可能导致不能正常游玩)\n提醒:开启一些Mod会让成绩无效,你也可以用键盘开关Mod,按住shift反向*/", - -- modApplyAtInstruction="Mod.ApplyDuring='postInit' --[[\npreInit: Before loading the modes. The default option in V0.17.15 and earlier, but may cause problems with certain mods.\npostInit: After loading the game. This can fix some bugs in preInit, but some mods can still be disabled by modes in some situations.\nalways: Throughout the entire game. Keeps the effects of the mods in all situations.]]", + -- [[[NEED TRANSLATING!]]] + modApplyAtInstruction="Mod.ApplyDuring=PLAYERS[1].username=='shoucandanghehe' ? 'preInit' : 'postInit' --[[\npreInit: Before loading the modes. The default option in V0.17.15 and earlier, but may cause problems with certain mods.\npostInit: After loading the game. This can fix some bugs in preInit, but some mods can still be disabled by modes in some situations.\nalways: Throughout the entire game. Keeps the effects of the mods in all situations.]]", modInfo={ next="Mod.Next();\n//强制使用Next的个数", hold="Mod.Hold\n//强制使用Hold的个数", diff --git a/parts/player/draw.lua b/parts/player/draw.lua index f83feb01..c6c167c1 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -787,9 +787,11 @@ function draw.norm(P,repMode) gc_scale(P.size) -- Draw username - setFont(30) - gc_setColor(GROUP_COLORS[P.group]) - GC.mStr(P.username or USERS.getUsername(P.uid),300,-60) + if P.showUsername then + setFont(30) + gc_setColor(GROUP_COLORS[P.group]) + GC.mStr(P.username or USERS.getUsername(P.uid),300,-60) + end -- Draw HUD if ENV.nextCount>0 then _drawNext(P,repMode) end diff --git a/parts/player/init.lua b/parts/player/init.lua index 1a5cec89..7e606f50 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -498,6 +498,7 @@ function PLY.newAIPlayer(id,AIdata,mini,p) group=0, } if p then TABLE.coverR(p,pData) end P.username="BOT"..pData.uid + P.showUsername=true P.sid=NET.uid_sid[pData.uid] or pData.uid P.group=pData.group if not (P.group%1==0 and P.group>=1 and P.group<=6) then P.group=0 end @@ -522,7 +523,7 @@ function PLY.newPlayer(id,mini,p) else -- Default pid=1, and empty username pData.uid=1 - P.username="" + P.username="SWEETSEA" end P.uid=pData.uid P.sid=NET.uid_sid[pData.uid] or pData.uid @@ -531,6 +532,8 @@ function PLY.newPlayer(id,mini,p) _loadGameEnv(P) _applyGameEnv(P) + + P.showUsername=not (P.gameEnv.allowMod and usingMod()) end ---------------------------------------------------- return PLY \ No newline at end of file diff --git a/parts/scenes/mod.lua b/parts/scenes/mod.lua index 574d947d..afb1fde6 100644 --- a/parts/scenes/mod.lua +++ b/parts/scenes/mod.lua @@ -23,14 +23,6 @@ function scene.enter() scene.widgetList.unranked.hide=scoreValid() BG.set('tunnel') end -function scene.back() - local totalModUsed=0 - for i=1,#GAME.mod do - if GAME.mod[i]>0 then totalModUsed=totalModUsed+1 - end - end - GAME.modUsed=totalModUsed>0 and totalModUsed or false -end function scene.mouseMove(x,y) selected=false