Skip to content

Commit

Permalink
interior设置菜单能正确地在进场景时刷新两个滑条颜色了
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Aug 5, 2024
1 parent 65d26f7 commit f5f9c9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/scene/setting_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ local settingHint
---@type Zenitha.Scene
local scene={}

local function updateSlidercolor()
scene.widgetList.asd.fillColor={COLOR.HSL(0,1,.5+.5*MATH.icLerp(20,100,SETTINGS.game_brik.asd))}
scene.widgetList.asp.fillColor={COLOR.HSL(0,1,.5+.5*MATH.icLerp(-10,5,SETTINGS.game_brik.asp))}
end

function scene.load()
updateSlidercolor()
settingHint=PROGRESS.get('main')<2 and PROGRESS.get('launchCount')<=3
end
function scene.unload()
Expand Down Expand Up @@ -48,14 +54,14 @@ scene.widgetList={
{type='slider', pos={1,.5},x=-550, y=-130,w=400,fontSize=40,text=LANG'setting_vib', widthLimit=260,disp=TABLE.func_getVal(SETTINGS.system,'vibVol'), code=TABLE.func_setVal(SETTINGS.system,'vibVol')},

{type='slider', name='asd', pos={1,.5},x=-852.3,y=250,w=702.3,text=LANG'setting_asd', widthLimit=260,axis={20,260,10},disp=TABLE.func_getVal(SETTINGS.game_brik,'asd'), valueShow=sliderShow_time, code=function(v)
scene.widgetList.asd.fillColor={COLOR.HSL(0,1,.5+.5*MATH.icLerp(20,100,v))}
SETTINGS.game_brik.asd=v
SETTINGS.game_brik.asp=math.min(SETTINGS.game_brik.asp,SETTINGS.game_brik.asd)
updateSlidercolor()
end},
{type='slider', name='asp', pos={1,.5},x=-852.3,y=350,w=702.3,text=LANG'setting_asp', widthLimit=260,axis={0,120,10}, disp=TABLE.func_getVal(SETTINGS.game_brik,'asp'), valueShow=sliderShow_time, code=function(v)
scene.widgetList.asp.fillColor={COLOR.HSL(0,1,.5+.5*MATH.icLerp(-10,5,v))}
SETTINGS.game_brik.asp=v
SETTINGS.game_brik.asd=math.max(SETTINGS.game_brik.asd,SETTINGS.game_brik.asp)
updateSlidercolor()
end},
}
return scene

0 comments on commit f5f9c9f

Please sign in to comment.