优化滑条控件和列表框控件

This commit is contained in:
MrZ626
2021-12-26 02:38:25 +08:00
parent 6eeddba773
commit b07c4dc53a
12 changed files with 102 additions and 87 deletions

View File

@@ -529,7 +529,7 @@ function slider:isAbove(x,y)
return x>self.x-10 and x<self.x+self.w+10 and y>self.y-25 and y<self.y+25
end
function slider:getCenter()
return self.x+self.w*(self.pos/self.unit),self.y
return self.x+self.w*((self.pos-self.rangeL)/(self.rangeR-self.rangeL)),self.y
end
function slider:update(dt)
local ATV=self.ATV
@@ -556,8 +556,8 @@ function slider:draw()
--Units
if not self.smooth then
gc_setLineWidth(2)
for p=0,self.unit do
local X=x+(x2-x)*p/self.unit
for p=self.rangeL,self.rangeR,self.unit do
local X=x+(x2-x)*(p-self.rangeL)/(self.rangeR-self.rangeL)
gc_line(X,y+7,X,y-7)
end
end
@@ -567,7 +567,7 @@ function slider:draw()
gc_line(x,y,x2,y)
--Block
local cx=x+(x2-x)*self.pos/self.unit
local cx=x+(x2-x)*(self.pos-self.rangeL)/(self.rangeR-self.rangeL)
local bx,by,bw,bh=cx-10-ATV*.5,y-16-ATV,20+ATV,32+2*ATV
gc_setColor(.8,.8,.8)
gc_rectangle('fill',bx,by,bw,bh,3)
@@ -602,13 +602,16 @@ end
function slider:drag(x)
if not x then return end
x=x-self.x
local p=self.disp()
local P=x<0 and 0 or x>self.w and self.unit or x/self.w*self.unit
if not self.smooth then
P=int(P+.5)
local newPos=MATH.interval(x/self.w,0,1)
local newVal
if not self.unit then
newVal=(1-newPos)*self.rangeL+newPos*self.rangeR
else
newVal=newPos*(self.rangeR-self.rangeL)
newVal=self.rangeL+newVal-newVal%self.unit
end
if p~=P then
self.code(P)
if newVal~=self.disp()then
self.code(newVal)
end
if self.change and timer()-self.lastTime>.5 then
self.lastTime=timer()
@@ -621,8 +624,8 @@ function slider:release(x)
end
function slider:scroll(n)
local p=self.disp()
local u=self.smooth and .01 or 1
local P=n==-1 and max(p-u,0)or min(p+u,self.unit)
local u=self.unit or .01
local P=MATH.interval(p+u*n,self.rangeL,self.rangeR)
if p==P or not P then return end
self.code(P)
if self.change and timer()-self.lastTime>.18 then
@@ -633,7 +636,13 @@ end
function slider:arrowKey(k)
self:scroll((k=='left'or k=='up')and -1 or 1)
end
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,font=30][,fType][,change],disp[,show][,code],hide
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,axis][,smooth][,font=30][,fType][,change],disp[,show][,code],hide
if not D.axis then
D.axis={0,1,false}
D.smooth=true
elseif not D.axis[3]then
D.smooth=true
end
local _={
name= D.name or"_",
@@ -652,8 +661,10 @@ function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,
fText= D.fText,
color= D.color and(COLOR[D.color]or D.color)or COLOR.Z,
unit= D.unit or 1,
smooth=false,
rangeL=D.axis[1],
rangeR=D.axis[2],
unit= D.axis[3],
smooth=D.smooth,
font= D.font or 30,
fType= D.fType,
change=D.change,
@@ -663,22 +674,17 @@ function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,
hide= D.hide,
show= false,
}
if D.smooth~=nil then
_.smooth=D.smooth
else
_.smooth=_.unit<=1
end
if D.show then
if type(D.show)=='function'then
_.show=D.show
else
_.show=sliderShowFunc[D.show]
end
elseif D.show~=false then
if _.unit<=1 then
_.show=sliderShowFunc.percent
else
elseif D.show~=false then--Use default if nil
if _.unit and _.unit%1==0 then
_.show=sliderShowFunc.int
else
_.show=sliderShowFunc.percent
end
end
for k,v in next,slider do _[k]=v end
@@ -1227,6 +1233,14 @@ function listBox:arrowKey(dir)
end
end
end
function listBox:select(i)
self.selected=i
if self.selected<int(self.scrollPos/self.lineH)+2 then
self:drag(nil,nil,nil,1e99)
elseif self.selected>int(self.scrollPos/self.lineH)+self.capacity-1 then
self:drag(nil,nil,nil,-1e99)
end
end
function listBox:draw()
local x,y,w,h=self.x,self.y,self.w,self.h
local list=self.list

View File

@@ -543,6 +543,7 @@ do
if SETTING.cv then SETTING.vocPack,SETTING.cv=SETTING.cv end
if type(SETTING.bg)~='string'then SETTING.bg='on'end
if SETTING.skin[18]==10 then SETTING.skin[18]=4 end
if SETTING.reTime>3 or SETTING.reTime<.5 then SETTING.reTime=2 end
if RANKS.infinite then RANKS.infinite=0 end
if RANKS.infinite_dig then RANKS.infinite_dig=0 end
if not RANKS.sprint_10l then RANKS.sprint_10l=0 end

View File

@@ -594,7 +594,7 @@ do--Userdata tables
FTLock=true,
--System
reTime=4,
reTime=2,
allowTAS=false,
autoPause=true,
menuPos='middle',

View File

@@ -171,10 +171,10 @@ end
scene.widgetList={
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'space',hideF=function()return state==0 end},
WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,unit=3,show=false,font=40,disp=function()return rank-3 end,code=function(v)rank=v+3 end,hideF=function()return state>0 end},
WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function()return invis end, code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,axis={3,6,1},show=false,font=40,disp=function()return rank end,code=function(v)rank=v end,hideF=function()return state>0 end},
WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='disappear',x=240,y=420,lim=200,font=40,disp=function()return disappear end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function()return tapFX end, code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function()return tapFX end,code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -226,10 +226,10 @@ scene.widgetList={
--Next & Hold
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=180,unit=6,disp=CUSval('nextCount'),code=CUSsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=180,unit=6,disp=CUSval('holdCount'),code=CUSsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=180,axis={0,6,1},disp=CUSval('nextCount'),code=CUSsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=180,axis={0,6,1},disp=CUSval('holdCount'),code=CUSsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
--BG & BGM
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i)CUSTOMENV.bg=i BG.set(i)end},

View File

@@ -102,10 +102,10 @@ scene.widgetList={
--Next & Hold
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=ROOMval('holdMode'),code=ROOMval('holdMode'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=200,unit=6,disp=ROOMval('nextCount'),code=ROOMsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=200,unit=6,disp=ROOMval('holdCount'),code=ROOMsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=ROOMval('infHold'),code=ROOMrev('infHold'),hideF=function()return ROOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=ROOMval('phyHold'),code=ROOMrev('phyHold'),hideF=function()return ROOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=200,axis={0,6,1},disp=ROOMval('nextCount'),code=ROOMsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=200,axis={0,6,1},disp=ROOMval('holdCount'),code=ROOMsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=ROOMval('infHold'),code=ROOMrev('infHold'),hideF=function()return ROOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=ROOMval('phyHold'),code=ROOMrev('phyHold'),hideF=function()return ROOMENV.holdCount==0 end},
}
return scene

View File

@@ -89,15 +89,15 @@ scene.widgetList={
WIDGET.newText{name='title', x=100, y=50,lim=500,font=70,align='L'},
WIDGET.newText{name='preview', x=520, y=610,font=40,align='R'},
WIDGET.newSlider{name='das', x=250, y=190,lim=230,w=600,unit=20,disp=SETval('das'), show=_sliderShow,code=SETsto('das')},
WIDGET.newSlider{name='arr', x=250, y=260,lim=230,w=525,unit=15,disp=SETval('arr'), show=_sliderShow,code=SETsto('arr')},
WIDGET.newSlider{name='sddas', x=250, y=330,lim=230,w=350,unit=10,disp=SETval('sddas'), show=_sliderShow,code=SETsto('sddas')},
WIDGET.newSlider{name='sdarr', x=250, y=400,lim=230,w=140,unit=4, disp=SETval('sdarr'), show=_sliderShow,code=SETsto('sdarr')},
WIDGET.newSlider{name='dascut', x=250, y=470,lim=230,w=600,unit=20,disp=SETval('dascut'), show=_sliderShow,code=SETsto('dascut')},
WIDGET.newSlider{name='dropcut',x=250, y=540,lim=230,w=300,unit=10,disp=SETval('dropcut'),show=_sliderShow,code=SETsto('dropcut')},
WIDGET.newSwitch{name='ihs', x=1100, y=260,lim=300, disp=SETval('ihs'), code=SETrev('ihs')},
WIDGET.newSwitch{name='irs', x=1100, y=330,lim=300, disp=SETval('irs'), code=SETrev('irs')},
WIDGET.newSwitch{name='ims', x=1100, y=400,lim=300, disp=SETval('ims'), code=SETrev('ims')},
WIDGET.newSlider{name='das', x=250, y=190,lim=230,w=600,axis={0,20,1},disp=SETval('das'), show=_sliderShow,code=SETsto('das')},
WIDGET.newSlider{name='arr', x=250, y=260,lim=230,w=525,axis={0,15,1},disp=SETval('arr'), show=_sliderShow,code=SETsto('arr')},
WIDGET.newSlider{name='sddas', x=250, y=330,lim=230,w=350,axis={0,10,1},disp=SETval('sddas'), show=_sliderShow,code=SETsto('sddas')},
WIDGET.newSlider{name='sdarr', x=250, y=400,lim=230,w=140,axis={0,4,1}, disp=SETval('sdarr'), show=_sliderShow,code=SETsto('sdarr')},
WIDGET.newSlider{name='dascut', x=250, y=470,lim=230,w=600,axis={0,20,1},disp=SETval('dascut'), show=_sliderShow,code=SETsto('dascut')},
WIDGET.newSlider{name='dropcut',x=250, y=540,lim=230,w=300,axis={0,10,1},disp=SETval('dropcut'),show=_sliderShow,code=SETsto('dropcut')},
WIDGET.newSwitch{name='ihs', x=1100, y=260,lim=300, disp=SETval('ihs'), code=SETrev('ihs')},
WIDGET.newSwitch{name='irs', x=1100, y=330,lim=300, disp=SETval('irs'), code=SETrev('irs')},
WIDGET.newSwitch{name='ims', x=1100, y=400,lim=300, disp=SETval('ims'), code=SETrev('ims')},
WIDGET.newButton{name='reset', x=160, y=640,w=200,h=100,color='lR',font=40,
code=function()
local _=SETTING

View File

@@ -39,17 +39,17 @@ scene.widgetList={
WIDGET.newButton{name='style', x=250, y=540, w=200,h=70,font=35,code=goScene'setting_skin'},
WIDGET.newButton{name='ctrl', x=290, y=220, w=320,h=80,font=35,code=goScene'setting_control'},
WIDGET.newButton{name='key', x=640, y=220, w=320,h=80,color=MOBILE and'dH',font=35, code=goScene'setting_key'},
WIDGET.newButton{name='touch', x=990, y=220, w=320,h=80,color=not MOBILE and'dH',font=35, code=goScene'setting_touch',hideF=function()return not SETTING.VKSwitch end},
WIDGET.newSwitch{name='showVK', x=1100, y=150, lim=400, disp=SETval('VKSwitch'), code=SETrev('VKSwitch')},
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','DRS_weak','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=400, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applySettings()end},
WIDGET.newSwitch{name='autoPause',x=1060, y=470, lim=580, disp=SETval('autoPause'),code=SETrev('autoPause')},
WIDGET.newSwitch{name='autoSave', x=1060, y=540, lim=580, disp=SETval('autoSave'), code=SETrev('autoSave')},
WIDGET.newSwitch{name='autoLogin',x=960, y=610, lim=480, disp=SETval('autoLogin'),code=SETrev('autoLogin')},
WIDGET.newSwitch{name='simpMode', x=960, y=670, lim=480, disp=SETval('simpMode'),
WIDGET.newButton{name='key', x=640, y=220, w=320,h=80,color=MOBILE and'dH',font=35, code=goScene'setting_key'},
WIDGET.newButton{name='touch', x=990, y=220, w=320,h=80,color=not MOBILE and'dH',font=35, code=goScene'setting_touch',hideF=function()return not SETTING.VKSwitch end},
WIDGET.newSwitch{name='showVK', x=1100, y=150, lim=400, disp=SETval('VKSwitch'), code=SETrev('VKSwitch')},
WIDGET.newSlider{name='reTime', x=330, y=320, w=300,lim=180,axis={.5,3,.25},disp=SETval('reTime'), code=SETsto('reTime'),show=SETval('reTime')},
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','DRS_weak','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=400, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applySettings()end},
WIDGET.newSwitch{name='autoPause',x=1060, y=470, lim=580, disp=SETval('autoPause'),code=SETrev('autoPause')},
WIDGET.newSwitch{name='autoSave', x=1060, y=540, lim=580, disp=SETval('autoSave'), code=SETrev('autoSave')},
WIDGET.newSwitch{name='autoLogin',x=960, y=610, lim=480, disp=SETval('autoLogin'),code=SETrev('autoLogin')},
WIDGET.newSwitch{name='simpMode', x=960, y=670, lim=480, disp=SETval('simpMode'),
code=function()
SETTING.simpMode=not SETTING.simpMode
for i=1,#SCN.stack,2 do

View File

@@ -84,14 +84,14 @@ scene.widgetList={
WIDGET.newButton{name='game', x=200, y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_game','swipeR')},
WIDGET.newButton{name='graphic', x=1080,y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_video','swipeL')},
WIDGET.newSlider{name='mainVol', x=300, y=170,w=420,lim=220,color='lG',disp=SETval('mainVol'), code=function(v)SETTING.mainVol=v love.audio.setVolume(SETTING.mainVol)end},
WIDGET.newSlider{name='bgm', x=300, y=240,w=420,lim=220,color='lG',disp=SETval('bgm'), code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newSlider{name='sfx', x=300, y=310,w=420,lim=220,color='lC',disp=SETval('sfx'), code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end, change=function()SFX.play('warn_1')end},
WIDGET.newSlider{name='stereo', x=300, y=380,w=420,lim=220,color='lC',disp=SETval('stereo'), code=function(v)SETTING.stereo=v SFX.setStereo(SETTING.stereo)end,change=function()SFX.play('touch',1,-1)SFX.play('lock',1,1)end,hideF=function()return SETTING.sfx==0 end},
WIDGET.newSlider{name='spawn', x=300, y=450,w=420,lim=220,color='lC',disp=SETval('sfx_spawn'), code=function(v)SETTING.sfx_spawn=v end, change=function()SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn)end,},
WIDGET.newSlider{name='warn', x=300, y=520,w=420,lim=220,color='lC',disp=SETval('sfx_warn'), code=function(v)SETTING.sfx_warn=v end, change=function()SFX.fplay('warn_beep',SETTING.sfx_warn)end},
WIDGET.newSlider{name='vib', x=300, y=590,w=420,lim=220,color='lN',disp=SETval('vib'),unit=10,code=function(v)SETTING.vib=v end, change=function()if SETTING.vib>0 then VIB(SETTING.vib+2)end end},
WIDGET.newSlider{name='voc', x=300, y=660,w=420,lim=220,color='lN',disp=SETval('voc'), code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end, change=function()VOC.play('test')end},
WIDGET.newSlider{name='mainVol', x=300, y=170,w=420,lim=220,color='lG',disp=SETval('mainVol'), code=function(v)SETTING.mainVol=v love.audio.setVolume(SETTING.mainVol)end},
WIDGET.newSlider{name='bgm', x=300, y=240,w=420,lim=220,color='lG',disp=SETval('bgm'), code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newSlider{name='sfx', x=300, y=310,w=420,lim=220,color='lC',disp=SETval('sfx'), code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end, change=function()SFX.play('warn_1')end},
WIDGET.newSlider{name='stereo', x=300, y=380,w=420,lim=220,color='lC',disp=SETval('stereo'), code=function(v)SETTING.stereo=v SFX.setStereo(SETTING.stereo)end,change=function()SFX.play('touch',1,-1)SFX.play('lock',1,1)end,hideF=function()return SETTING.sfx==0 end},
WIDGET.newSlider{name='spawn', x=300, y=450,w=420,lim=220,color='lC',disp=SETval('sfx_spawn'), code=function(v)SETTING.sfx_spawn=v end, change=function()SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn)end,},
WIDGET.newSlider{name='warn', x=300, y=520,w=420,lim=220,color='lC',disp=SETval('sfx_warn'), code=function(v)SETTING.sfx_warn=v end, change=function()SFX.fplay('warn_beep',SETTING.sfx_warn)end},
WIDGET.newSlider{name='vib', x=300, y=590,w=420,lim=220,color='lN',disp=SETval('vib'),axis={0,10,1},code=function(v)SETTING.vib=v end, change=function()if SETTING.vib>0 then VIB(SETTING.vib+2)end end},
WIDGET.newSlider{name='voc', x=300, y=660,w=420,lim=220,color='lN',disp=SETval('voc'), code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end, change=function()VOC.play('test')end},
WIDGET.newSwitch{name='autoMute', x=1150,y=180,lim=380,disp=SETval('autoMute'),code=SETrev('autoMute')},
WIDGET.newSwitch{name='fine', x=1150,y=250,lim=380,disp=SETval('fine'),code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play('finesseError',.6)end end},

View File

@@ -120,7 +120,7 @@ scene.widgetList={
WIDGET.newKey{name='load1', x=585,y=290,w=90,h=70,code=_load1,font=45,fText=CHAR.icon.loadOne},
WIDGET.newKey{name='save2', x=695,y=290,w=90,h=70,code=_save2,font=45,fText=CHAR.icon.saveTwo},
WIDGET.newKey{name='load2', x=805,y=290,w=90,h=70,code=_load2,font=45,fText=CHAR.icon.loadTwo},
WIDGET.newSlider{name='size', x=440,y=370,w=460,unit=19,font=40,show="vkSize",
WIDGET.newSlider{name='size', x=440,y=370,w=460,axis={0,19,1},font=40,show="vkSize",
disp=function()
return VK_ORG[selected].r/10-1
end,

View File

@@ -50,17 +50,17 @@ scene.widgetList={
WIDGET.newSwitch{name='b19', x=580, y=560, lim=230,disp=_VKAdisp(19),code=_VKAcode(19)},
WIDGET.newSwitch{name='b20', x=580, y=620, lim=230,disp=_VKAdisp(20),code=_VKAcode(20)},
WIDGET.newButton{name='norm', x=840, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=i<11 end end},
WIDGET.newButton{name='pro', x=1120, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=true end end},
WIDGET.newSwitch{name='icon', x=1150, y=240, lim=400, font=35,disp=SETval('VKIcon'),code=SETrev('VKIcon')},
WIDGET.newSlider{name='sfx', x=830, y=320, lim=160,w=400, font=35,change=function()SFX.play('virtualKey',SETTING.VKSFX)end,disp=SETval('VKSFX'),code=SETsto('VKSFX')},
WIDGET.newSlider{name='vib', x=830, y=390, lim=160,w=400,unit=6, font=35,change=function()if SETTING.vib>0 then VIB(SETTING.vib+SETTING.VKVIB)end end,disp=SETval('VKVIB'),code=SETsto('VKVIB')},
WIDGET.newSlider{name='alpha', x=830, y=460, lim=160,w=400, font=35,disp=SETval('VKAlpha'),code=SETsto('VKAlpha')},
WIDGET.newButton{name='norm', x=840, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=i<11 end end},
WIDGET.newButton{name='pro', x=1120, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=true end end},
WIDGET.newSwitch{name='icon', x=1150, y=240, lim=400, font=35,disp=SETval('VKIcon'),code=SETrev('VKIcon')},
WIDGET.newSlider{name='sfx', x=830, y=320, lim=160,w=400, font=35,change=function()SFX.play('virtualKey',SETTING.VKSFX)end,disp=SETval('VKSFX'),code=SETsto('VKSFX')},
WIDGET.newSlider{name='vib', x=830, y=390, lim=160,w=400,axis={0,6,1},font=35,change=function()if SETTING.vib>0 then VIB(SETTING.vib+SETTING.VKVIB)end end,disp=SETval('VKVIB'),code=SETsto('VKVIB')},
WIDGET.newSlider{name='alpha', x=830, y=460, lim=160,w=400, font=35,disp=SETval('VKAlpha'),code=SETsto('VKAlpha')},
WIDGET.newSwitch{name='track', x=360, y=720, lim=250, font=35,disp=SETval('VKTrack'),code=SETrev('VKTrack')},
WIDGET.newSwitch{name='dodge', x=800, y=720, lim=250, font=35,disp=SETval('VKDodge'),code=SETrev('VKDodge'),hideF=_notTrack},
WIDGET.newSlider{name='tchW', x=140, y=860, w=1000, font=35,disp=SETval('VKTchW'),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end,hideF=_notTrack},
WIDGET.newSlider{name='curW', x=140, y=930, w=1000, font=35,disp=SETval('VKCurW'),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end,hideF=_notTrack},
WIDGET.newSwitch{name='track', x=360, y=720, lim=250, font=35,disp=SETval('VKTrack'),code=SETrev('VKTrack')},
WIDGET.newSwitch{name='dodge', x=800, y=720, lim=250, font=35,disp=SETval('VKDodge'),code=SETrev('VKDodge'),hideF=_notTrack},
WIDGET.newSlider{name='tchW', x=140, y=860, w=1000, font=35,disp=SETval('VKTchW'),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end,hideF=_notTrack},
WIDGET.newSlider{name='curW', x=140, y=930, w=1000, font=35,disp=SETval('VKCurW'),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end,hideF=_notTrack},
WIDGET.newButton{name='back', x=1140, y=640, w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -55,18 +55,18 @@ scene.widgetList={
WIDGET.newSwitch{name='bagLine', x=380,y=390,lim=300,disp=SETval('bagLine'),code=SETrev('bagLine')},
WIDGET.newSelector{name='ghostType', x=915,y=180, w=350,list={'color','gray','colorCell','grayCell','colorLine','grayLine'},disp=SETval('ghostType'),code=SETsto('ghostType')},
WIDGET.newSlider{name='ghost', x=740,y=240,lim=280,w=350,unit=1,disp=SETval('ghost'), show="percent",code=SETsto('ghost')},
WIDGET.newSlider{name='center', x=740,y=300,lim=280,w=350,unit=1,disp=SETval('center'), show="percent",code=SETsto('center')},
WIDGET.newSlider{name='grid', x=740,y=360,lim=280,w=350,unit=.4,disp=SETval('grid'), show="percent",code=SETsto('grid')},
WIDGET.newSlider{name='lineNum', x=740,y=420,lim=280,w=350,unit=1,disp=SETval('lineNum'), show="percent",code=SETsto('lineNum')},
WIDGET.newSlider{name='ghost', x=740,y=240,lim=280,w=350,axis={0,1},disp=SETval('ghost'), show="percent",code=SETsto('ghost')},
WIDGET.newSlider{name='center', x=740,y=300,lim=280,w=350,axis={0,1},disp=SETval('center'), show="percent",code=SETsto('center')},
WIDGET.newSlider{name='grid', x=740,y=360,lim=280,w=350,axis={0,.4},disp=SETval('grid'), show="percent",code=SETsto('grid')},
WIDGET.newSlider{name='lineNum', x=740,y=420,lim=280,w=350,axis={0,1},disp=SETval('lineNum'), show="percent",code=SETsto('lineNum')},
WIDGET.newSlider{name='lockFX', x=330,y=460,lim=280,w=540,unit=5,disp=SETval('lockFX'), code=SETsto('lockFX')},
WIDGET.newSlider{name='dropFX', x=330,y=520,lim=280,w=540,unit=5,disp=SETval('dropFX'), code=SETsto('dropFX')},
WIDGET.newSlider{name='moveFX', x=330,y=580,lim=280,w=540,unit=5,disp=SETval('moveFX'), code=SETsto('moveFX')},
WIDGET.newSlider{name='clearFX', x=330,y=640,lim=280,w=540,unit=5,disp=SETval('clearFX'), code=SETsto('clearFX')},
WIDGET.newSlider{name='splashFX', x=330,y=700,lim=280,w=540,unit=5,disp=SETval('splashFX'), code=SETsto('splashFX')},
WIDGET.newSlider{name='shakeFX', x=330,y=760,lim=280,w=540,unit=5,disp=SETval('shakeFX'), code=SETsto('shakeFX')},
WIDGET.newSlider{name='atkFX', x=330,y=820,lim=280,w=540,unit=5,disp=SETval('atkFX'), code=SETsto('atkFX')},
WIDGET.newSlider{name='lockFX', x=330,y=460,lim=280,w=540,axis={0,5,1},disp=SETval('lockFX'), code=SETsto('lockFX')},
WIDGET.newSlider{name='dropFX', x=330,y=520,lim=280,w=540,axis={0,5,1},disp=SETval('dropFX'), code=SETsto('dropFX')},
WIDGET.newSlider{name='moveFX', x=330,y=580,lim=280,w=540,axis={0,5,1},disp=SETval('moveFX'), code=SETsto('moveFX')},
WIDGET.newSlider{name='clearFX', x=330,y=640,lim=280,w=540,axis={0,5,1},disp=SETval('clearFX'), code=SETsto('clearFX')},
WIDGET.newSlider{name='splashFX', x=330,y=700,lim=280,w=540,axis={0,5,1},disp=SETval('splashFX'),code=SETsto('splashFX')},
WIDGET.newSlider{name='shakeFX', x=330,y=760,lim=280,w=540,axis={0,5,1},disp=SETval('shakeFX'), code=SETsto('shakeFX')},
WIDGET.newSlider{name='atkFX', x=330,y=820,lim=280,w=540,axis={0,5,1},disp=SETval('atkFX'), code=SETsto('atkFX')},
WIDGET.newSelector{name='frame', x=400,y=890,lim=280,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval('frameMul'),code=function(v)SETTING.frameMul=v;Z.setFrameMul(SETTING.frameMul)end},
WIDGET.newSwitch{name='FTlock', x=950,y=890,lim=290,disp=SETval('FTLock'), code=SETrev('FTLock')},
@@ -97,7 +97,7 @@ scene.widgetList={
end
},
WIDGET.newSlider{name='bgAlpha', x=1020,y=1430,w=200,
unit=.8,disp=SETval('bgAlpha'),
axis={0,.8},disp=SETval('bgAlpha'),
code=function(v)SETTING.bgAlpha=v BG.send(v)end,
hideF=function()return SETTING.bg=='on'end
},