整理代码
规范更多全局变量名 语音包/音效包列表声明放到main开头
This commit is contained in:
@@ -7,7 +7,7 @@ local setFont,mStr=FONT.set,GC.mStr
|
||||
|
||||
local ins=table.insert
|
||||
|
||||
local SCR,VK,NET,netPLY=SCR,VK,NET,netPLY
|
||||
local SCR,VK,NET,NETPLY=SCR,VK,NET,NETPLY
|
||||
local PLAYERS,GAME=PLAYERS,GAME
|
||||
|
||||
local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=560}
|
||||
@@ -89,9 +89,9 @@ function scene.sceneBack()
|
||||
end
|
||||
|
||||
scene.mouseDown=NULL
|
||||
function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end
|
||||
function scene.mouseMove(x,y)NETPLY.mouseMove(x,y)end
|
||||
function scene.touchDown(x,y)
|
||||
if not playing then netPLY.mouseMove(x,y)return end
|
||||
if not playing then NETPLY.mouseMove(x,y)return end
|
||||
if noTouch then return end
|
||||
|
||||
local t=VK.on(x,y)
|
||||
@@ -158,7 +158,7 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
elseif not _hideReadyUI()then
|
||||
if key=="space"then
|
||||
if netPLY.getSelfJoinMode()==0 then
|
||||
if NETPLY.getSelfJoinMode()==0 then
|
||||
(kb.isDown("lctrl","rctrl","lalt","ralt")and _setSpectate or _setReady)()
|
||||
else
|
||||
_setCancel()
|
||||
@@ -224,7 +224,7 @@ function scene.socketRead(cmd,d)
|
||||
lastUpstreamTime=0
|
||||
upstreamProgress=1
|
||||
resetGameData('n',NET.seed)
|
||||
netPLY.mouseMove(0,0)
|
||||
NETPLY.mouseMove(0,0)
|
||||
else
|
||||
MES.new('warn',"Redundant [Go]")
|
||||
end
|
||||
@@ -269,7 +269,7 @@ function scene.update(dt)
|
||||
lastUpstreamTime=PLAYERS[1].alive and P1.frameRun or 1e99
|
||||
end
|
||||
else
|
||||
netPLY.update()
|
||||
NETPLY.update()
|
||||
end
|
||||
if newMessageTimer>0 then
|
||||
newMessageTimer=newMessageTimer-1
|
||||
@@ -296,7 +296,7 @@ function scene.draw()
|
||||
end
|
||||
else
|
||||
--Users
|
||||
netPLY.draw()
|
||||
NETPLY.draw()
|
||||
|
||||
--Ready & Set mark
|
||||
setFont(50)
|
||||
@@ -316,7 +316,7 @@ function scene.draw()
|
||||
setFont(25)
|
||||
gc_printf(NET.roomState.roomInfo.name,0,685,1270,'right')
|
||||
setFont(40)
|
||||
gc_print(netPLY.getCount().."/"..NET.roomState.capacity,70,655)
|
||||
gc_print(NETPLY.getCount().."/"..NET.roomState.capacity,70,655)
|
||||
if NET.roomState.private then
|
||||
gc_draw(IMG.lock,30,668)
|
||||
end
|
||||
@@ -338,8 +338,8 @@ function scene.draw()
|
||||
gc_print("M",430,10)
|
||||
end
|
||||
end
|
||||
local function _hideF_ingame()return _hideReadyUI()or netPLY.getSelfReady()end
|
||||
local function _hideF_ingame2()return _hideReadyUI()or not netPLY.getSelfReady()end
|
||||
local function _hideF_ingame()return _hideReadyUI()or NETPLY.getSelfReady()end
|
||||
local function _hideF_ingame2()return _hideReadyUI()or not NETPLY.getSelfReady()end
|
||||
scene.widgetList={
|
||||
textBox,
|
||||
inputBox,
|
||||
|
||||
@@ -59,7 +59,7 @@ scene.widgetList={
|
||||
local D=_parseCB()
|
||||
if D then
|
||||
TABLE.update(D,SETTING)
|
||||
applySettings()
|
||||
applyAllSettings()
|
||||
saveSettings()
|
||||
MES.new('check',text.importSuccess)
|
||||
else
|
||||
|
||||
@@ -45,7 +45,7 @@ scene.widgetList={
|
||||
WIDGET.newSlider{name="reTime", x=330, y=320, w=300,lim=180,unit=10,disp=SETval('reTime'), code=SETsto('reTime'),show=function(S)return(.5+S.disp()*.25).."s"end},
|
||||
WIDGET.newSelector{name="RS", x=300, y=420, w=300,color='S', disp=SETval('RS'), code=SETsto('RS'),list={'TRS','SRS','SRS_plus','SRS_X','BiRS','ARS_Z','ASC','ASC_plus','C2','C2_sym','Classic','Classic_plus','None','None_plus'}},
|
||||
WIDGET.newSelector{name="menuPos", x=980, y=320, w=300,color='O', disp=SETval('menuPos'), code=SETsto('menuPos'),list={'left','middle','right'}},
|
||||
WIDGET.newSwitch{name="sysCursor" ,x=1060, y=390, lim=580, disp=SETval('sysCursor'),code=switchCursor},
|
||||
WIDGET.newSwitch{name="sysCursor" ,x=1060, y=390, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applyCursor()end},
|
||||
WIDGET.newSwitch{name="autoPause", x=1060, y=450, lim=580, disp=SETval('autoPause'),code=SETrev('autoPause')},
|
||||
WIDGET.newSwitch{name="autoSave", x=1060, y=500, lim=580, disp=SETval('autoSave'), code=SETrev('autoSave')},
|
||||
WIDGET.newSwitch{name="autoLogin", x=960, y=580, lim=480, disp=SETval('autoLogin'),code=SETrev('autoLogin')},
|
||||
|
||||
@@ -71,7 +71,7 @@ scene.widgetList={
|
||||
WIDGET.newSwitch{name="clickFX", x=950,y=980,lim=360,disp=SETval('clickFX'), code=SETrev('clickFX')},
|
||||
WIDGET.newSwitch{name="power", x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=SETrev('powerInfo')},
|
||||
WIDGET.newSwitch{name="clean", x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=SETrev('cleanCanvas')},
|
||||
WIDGET.newSwitch{name="fullscreen", x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=switchFullscreen},
|
||||
WIDGET.newSwitch{name="fullscreen", x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function()SETTING.fullscreen=not SETTING.fullscreen applyFullscreen()end},
|
||||
WIDGET.newSwitch{name="bg", x=950,y=1340,lim=360,disp=SETval('bg'),
|
||||
code=function()
|
||||
BG.set('none')
|
||||
|
||||
Reference in New Issue
Block a user