From f48a9c6a33bb20bdeecf215962b2c5999b6d0e0e Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 28 Apr 2021 21:29:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9C=81=E6=B5=81=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=86=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=B8=80=E6=AC=A1=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/setting_game.lua | 2 +- parts/users.lua | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/parts/scenes/setting_game.lua b/parts/scenes/setting_game.lua index 1b0ba33b..becbf569 100644 --- a/parts/scenes/setting_game.lua +++ b/parts/scenes/setting_game.lua @@ -30,7 +30,7 @@ scene.widgetList={ WIDGET.newSlider{name="reTime", x=350, y=340, w=300,unit=10,disp=SETval("reTime"),code=SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end}, WIDGET.newSelector{name="RS", x=500, y=420, w=300,color="S",list={"TRS","SRS","C2","C2sym","Classic","None"},disp=SETval("RS"),code=SETsto("RS")}, WIDGET.newButton{name="layout", x=250, y=540, w=200,h=70,font=35, code=goScene"setting_skin"}, - WIDGET.newSwitch{name="dataSaving", x=750, y=550, font=20,disp=SETval("dataSaving"), code=SETrev("dataSaving")}, + WIDGET.newSwitch{name="dataSaving", x=750, y=550, font=20,disp=SETval("dataSaving"), code=function()SETTING.dataSaving=not SETTING.dataSaving if not SETTING.dataSaving then USERS.forceFreshAvatar()end end}, WIDGET.newSwitch{name="autoPause", x=1060, y=310, font=20,disp=SETval("autoPause"), code=SETrev("autoPause")}, WIDGET.newSwitch{name="swap", x=1060, y=370, font=20,disp=SETval("swap"), code=SETrev("swap")}, WIDGET.newSwitch{name="fine", x=1060, y=430, font=20,disp=SETval("fine"), code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play("finesseError",.6)end end}, diff --git a/parts/users.lua b/parts/users.lua index 80b0d798..178ef565 100644 --- a/parts/users.lua +++ b/parts/users.lua @@ -71,5 +71,10 @@ function USERS.getAvatar(uid) end return db_img[uid] end +function USERS.forceFreshAvatar() + for _,U in next,db do + U.new=false + end +end return USERS \ No newline at end of file