From b3e6e42790c1d0bd68f79c6e1e5acb9209e27bc6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 31 Aug 2021 05:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=81=94=E7=BD=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=8F=AF=E4=BB=A5F8+F4=20=E6=95=B4=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E6=B8=B8=E6=88=8F=E5=9C=BA=E6=99=AF=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E6=9C=89=E8=87=AA=E5=B7=B1=E7=9A=84tasUsed=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 12 +++++++----- parts/scenes/game.lua | 18 ++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index dd756007..e00c3a51 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -234,11 +234,13 @@ local function noDevkeyPressed(key) elseif key=="f3"then MES.new('error',"挂了") elseif key=="f4"then - for _=1,8 do - local P=PLY_ALIVE[rnd(#PLY_ALIVE)] - if P and P~=PLAYERS[1]then - P.lastRecv=PLAYERS[1] - P:lose() + if GAME.playing and not GAME.net then + for _=1,8 do + local P=PLY_ALIVE[rnd(#PLY_ALIVE)] + if P and P~=PLAYERS[1]then + P.lastRecv=PLAYERS[1] + P:lose() + end end end elseif key=="f5"then diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index 9bb52145..ecf3e2a2 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -8,7 +8,6 @@ local touchMoveLastFrame=false local floatGameRate,gameRate local modeTextPos -local tasMode local replaying local repRateStrings={[0]="pause",[.125]="0.125x",[.5]="0.5x",[1]="1x",[2]="2x",[5]="5x"} @@ -17,7 +16,7 @@ local scene={} local function _updateMenuButtons() WIDGET.active.restart.hide=replaying - local pos=(tasMode or replaying)and'right'or SETTING.menuPos + local pos=(GAME.tasUsed or replaying)and'right'or SETTING.menuPos if GAME.replaying or pos=='right'then WIDGET.active.restart.x=1125 WIDGET.active.pause.x=1195 @@ -34,7 +33,7 @@ local function _updateMenuButtons() end local function _updateRepButtons() local L=scene.widgetList - if replaying or tasMode then + if replaying or GAME.tasUsed then for i=1,6 do L[i].hide=false end L[7].hide=true if gameRate==0 then L[1].hide=true @@ -107,7 +106,6 @@ local function _restart() resetGameData(PLAYERS[1].frameRun<240 and'q') noKey=replaying noTouch=replaying - tasMode=false floatGameRate,gameRate=0,1 _updateRepButtons() end @@ -133,7 +131,6 @@ function scene.sceneInit(org) GAME.init=false end - tasMode=GAME.tasUsed replaying=GAME.replaying noKey=replaying noTouch=not SETTING.VKSwitch or replaying @@ -141,7 +138,7 @@ function scene.sceneInit(org) if org~='depause'and org~='pause'then floatGameRate,gameRate=0,1 elseif not replaying then - if tasMode then + if GAME.tasUsed then floatGameRate,gameRate=0,0 else floatGameRate,gameRate=0,1 @@ -216,7 +213,7 @@ function scene.keyDown(key,isRep) if isRep then return elseif _checkGameKeyDown(key)then - if tasMode then + if GAME.tasUsed then if key=="f1"then if not isRep then gameRate=gameRate==0 and .125 or 0 end _updateRepButtons() @@ -328,13 +325,14 @@ local function _drawAtkPointer(x,y) gc.circle('line',x,y,30*(1+a),6) end function scene.draw() - if tasMode then + local tas=GAME.tasUsed + if tas then setFont(100) gc.setColor(.4,.4,.4,.5) mDraw(tasText,640,360,nil,5) end - local repMode=GAME.replaying or tasMode + local repMode=GAME.replaying or tas --Players for p=1,#PLAYERS do @@ -370,7 +368,7 @@ function scene.draw() gc.draw(drawableText.modeName,modeTextPos,10) --Replaying - if replaying or tasMode then + if replaying or tas then setFont(20) gc.setColor(1,1,TIME()%.8>.4 and 1 or 0) mStr(text[replaying and'replaying'or'tasUsing'],770,6)