1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 14:29:26 +08:00

add: chapter auto clear step interval setting

This commit is contained in:
0O0o0oOoO00
2026-01-11 22:10:55 +08:00
parent a9adb23df3
commit 3c4728559c
15 changed files with 59 additions and 2 deletions

View File

@@ -347,6 +347,10 @@ void Cracker::disable_skip_story() {
DISABLE(SKIP_STORY);
}
void Cracker::set_chapter_auto_clear_step_interval(double interval) {
m_mover.interval.store(interval);
}
void Cracker::enable_chapter_auto_clear() {
ENABLE(CHAPTER_AUTO_CLEAR);
}
@@ -1567,6 +1571,7 @@ Cracker::Config Cracker::get_config() {
.gg_factor = m_gg_factor,
.exercise_more_power_rate = static_cast<int>(m_exercise_more_power_rate.load() * 100),
.better_global_speedup_rate = static_cast<int>(m_better_global_speedup_rate.load()),
.chapter_auto_clear_step_interval = m_mover.interval.load(),
};
return config;
}
@@ -1593,6 +1598,7 @@ void Cracker::apply_config(Config& config) {
}
if(IS_CONFIG_ENABLED(CHAPTER_AUTO_CLEAR)) {
set_chapter_auto_clear_step_interval(config.chapter_auto_clear_step_interval);
enable_chapter_auto_clear();
} else {
disable_chapter_auto_clear();
@@ -1895,7 +1901,7 @@ void Cracker::mover_step(sol::this_state& L) {
if (m_mover.idx <= m_mover.path.value().size()) {
Lua::Object tr = m_lua_res.Timer_New(L, [this](sol::this_state l, Lua::VariadicArgs args) {
mover_step(l);
}, m_mover.interval, 1);
}, m_mover.interval.load(), 1);
m_lua_res.Timer_Start(L, tr);
} else {
mover_stop(L);