diff --git a/assets/gamefunc.lua b/assets/gamefunc.lua index bd2f1a9c..e458de63 100644 --- a/assets/gamefunc.lua +++ b/assets/gamefunc.lua @@ -158,14 +158,21 @@ function autoQuitInterior(disable) end end -function saveSettings() +local function _saveSettings() + DEBUG.yieldT(.626) FILE.save({ system=SETTINGS._system, game_brik=SETTINGS.game_brik, game_gela=SETTINGS.game_gela, game_acry=SETTINGS.game_acry, },'conf/settings','-json') - showSaveIcon(CHAR.icon.settings..CHAR.icon.save) + if PROGRESS.get('main')>=3 then + showSaveIcon(CHAR.icon.settings..CHAR.icon.save) + end +end +function saveSettings() + TASK.removeTask_code(_saveSettings) + TASK.new(_saveSettings) end function saveKey() FILE.save({ diff --git a/assets/language/lang_en.lua b/assets/language/lang_en.lua index 9bb8f352..ce75fdc2 100644 --- a/assets/language/lang_en.lua +++ b/assets/language/lang_en.lua @@ -225,6 +225,24 @@ local L={ action= {"Action","Use both keyboard & mouse"}, }, + -- Mode Task Texts + exteriorModeTasks={ + sequence_mph_title="MPH", + sequence_mph_desc="Any clear in 4 pieces", + sequence_flood_title="Flood", + sequence_flood_desc="Clear with S or Z", + sequence_drought_title="Drought", + sequence_drought_desc="Clear with J or L", + sequence_saw_title="Saw", + sequence_saw_desc="Clear with T", + sequence_rect_title="Rect", + sequence_rect_desc="Clear with O", + sequence_rain_title="Rain", + sequence_rain_desc="Clear with I", + sequence_pento_title="Pento", + sequence_pento_desc="Clear with a Pento", + }, + -- Achievement ---@enum (key) Techmino.Text.Achievement achievementMessage={ diff --git a/assets/language/lang_zh.lua b/assets/language/lang_zh.lua index 6aab6d21..e4851089 100644 --- a/assets/language/lang_zh.lua +++ b/assets/language/lang_zh.lua @@ -225,6 +225,24 @@ local L={ action= {"动作","键鼠搭配更佳"}, }, + -- Mode Task Texts + exteriorModeTasks={ + sequence_mph_title="MPH", + sequence_mph_desc="4块内消除", + sequence_flood_title="Flood", + sequence_flood_desc="用S/Z消除", + sequence_drought_title="Drought", + sequence_drought_desc="用J/L消除", + sequence_saw_title="Saw", + sequence_saw_desc="用T消除", + sequence_rect_title="Rect", + sequence_rect_desc="用O消除", + sequence_rain_title="Rain", + sequence_rain_desc="用I消除", + sequence_pento_title="Pento", + sequence_pento_desc="用五连块消除", + }, + -- Achievement achievementMessage={ dict_shortcut="快捷键高手", diff --git a/assets/scene/game_in.lua b/assets/scene/game_in.lua index 48fef284..936557b0 100644 --- a/assets/scene/game_in.lua +++ b/assets/scene/game_in.lua @@ -17,7 +17,7 @@ function scene.load() WIDGET._reset() end function scene.unload() - if SCN.state.target~='pause_in' then + if SCN.stackChange<0 then GAME.unload() end end diff --git a/assets/scene/game_out.lua b/assets/scene/game_out.lua index f716afaf..15c22bb2 100644 --- a/assets/scene/game_out.lua +++ b/assets/scene/game_out.lua @@ -21,7 +21,7 @@ function scene.load() WIDGET._reset() end function scene.unload() - if SCN.state.target~='pause_out' then + if SCN.stackChange<0 then GAME.unload() end end diff --git a/assets/scene/keyset_in.lua b/assets/scene/keyset_in.lua index 1dc198fe..af474e2c 100644 --- a/assets/scene/keyset_in.lua +++ b/assets/scene/keyset_in.lua @@ -32,7 +32,9 @@ function scene.load() end end function scene.unload() - saveKey() + if SCN.stackChange<0 then + saveKey() + end end function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end diff --git a/assets/scene/keyset_out.lua b/assets/scene/keyset_out.lua index a2f136c1..73669206 100644 --- a/assets/scene/keyset_out.lua +++ b/assets/scene/keyset_out.lua @@ -30,7 +30,9 @@ function scene.load() WIDGET._reset() end function scene.unload() - saveKey() + if SCN.stackChange<0 then + saveKey() + end end function scene.mouseDown(_,_,k) if k==2 then SCN.back('fadeHeader') end end diff --git a/assets/scene/keyset_touch_in.lua b/assets/scene/keyset_touch_in.lua index fb373b7e..7ceea4c3 100644 --- a/assets/scene/keyset_touch_in.lua +++ b/assets/scene/keyset_touch_in.lua @@ -7,7 +7,9 @@ function scene.load() end function scene.unload() - saveTouch() + if SCN.stackChange<0 then + saveTouch() + end end function scene.keyDown(key,isRep) diff --git a/assets/scene/lang_in.lua b/assets/scene/lang_in.lua index cd65a634..5831bdf5 100644 --- a/assets/scene/lang_in.lua +++ b/assets/scene/lang_in.lua @@ -25,7 +25,7 @@ function scene.load() end function scene.unload() - if changed then + if changed and SCN.stackChange<0 then saveSettings() end end diff --git a/assets/scene/lang_out.lua b/assets/scene/lang_out.lua index 64aba91f..f8e94493 100644 --- a/assets/scene/lang_out.lua +++ b/assets/scene/lang_out.lua @@ -25,7 +25,7 @@ function scene.load() changed=false end function scene.unload() - if changed then + if changed and SCN.stackChange<0 then saveSettings() end end diff --git a/assets/scene/pause_in.lua b/assets/scene/pause_in.lua index a1d3d27c..26123e9a 100644 --- a/assets/scene/pause_in.lua +++ b/assets/scene/pause_in.lua @@ -16,7 +16,7 @@ function scene.load() end function scene.unload() FMOD.effect.keyOff('music_pause') - if not (SCN.state.target=='setting_in' or SCN.state.target=='game_in') then + if SCN.stackChange<0 then GAME.unload() end end diff --git a/assets/scene/pause_out.lua b/assets/scene/pause_out.lua index 6638e74e..af68bb23 100644 --- a/assets/scene/pause_out.lua +++ b/assets/scene/pause_out.lua @@ -20,7 +20,7 @@ function scene.load() end function scene.unload() FMOD.effect.keyOff('music_pause') - if not (SCN.state.target=='setting_out' or SCN.state.target=='game_out') then + if SCN.stackChange<0 then GAME.unload() end end diff --git a/assets/scene/setting_in.lua b/assets/scene/setting_in.lua index 3452168d..1c113311 100644 --- a/assets/scene/setting_in.lua +++ b/assets/scene/setting_in.lua @@ -7,7 +7,9 @@ function scene.load() settingHint=PROGRESS.get('main')<2 and PROGRESS.get('launchCount')<=3 end function scene.unload() - saveSettings() + if SCN.stackChange<0 then + saveSettings() + end end function scene.mouseDown(_,_,k) if k==2 then SCN.back('none') end end diff --git a/assets/scene/setting_out.lua b/assets/scene/setting_out.lua index 27d4de5e..4b752701 100644 --- a/assets/scene/setting_out.lua +++ b/assets/scene/setting_out.lua @@ -27,7 +27,9 @@ function scene.load() BG.set('none') end function scene.unload() - saveSettings() + if SCN.stackChange<0 then + saveSettings() + end end function scene.mouseDown(_,_,k) if k==2 then SCN.back('fadeHeader') end end diff --git a/assets/scene/zeta_input_method.lua b/assets/scene/zeta_input_method.lua index 175dc49a..488b4d4b 100644 --- a/assets/scene/zeta_input_method.lua +++ b/assets/scene/zeta_input_method.lua @@ -177,6 +177,11 @@ function scene.load() freshWidgetPos() freshResult() end +function scene.unload() + inputs=nil + results=nil + charQueue=nil +end function scene.mouseDown(x,y,k) if k==1 and not writing then