mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-19 12:19:29 +08:00
add: pause lua state when setting fast stage move duration
This commit is contained in:
@@ -608,16 +608,18 @@ void Cracker::disable_remove_hard_mode_ship_properties_limit() {
|
||||
DISABLE(REMOVE_HARD_MODE_SHIP_PROPERTIES_LIMIT);
|
||||
}
|
||||
|
||||
void Cracker::fast_stage_move_pause(bool need_pause) {
|
||||
m_fast_stage_move_need_pause.store(need_pause);
|
||||
}
|
||||
|
||||
void Cracker::enable_fast_stage_move() {
|
||||
m_state["ChapterConst"]["ShipStepDuration"] = 0.0;
|
||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = 0.0;
|
||||
ENABLE(FAST_STAGE_MOVE_CRACK);
|
||||
fast_stage_move_set_duration(0.0);
|
||||
}
|
||||
|
||||
void Cracker::disable_fast_stage_move() {
|
||||
m_state["ChapterConst"]["ShipStepDuration"] = 0.5;
|
||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = 0.5;
|
||||
DISABLE(FAST_STAGE_MOVE_CRACK);
|
||||
fast_stage_move_set_duration(0.5);
|
||||
}
|
||||
|
||||
void Cracker::update_global_ship_properties(const ShipProperties& properties) {
|
||||
@@ -632,6 +634,25 @@ void Cracker::disable_global_ship_properties_crack() {
|
||||
DISABLE(GLOBAL_SHIP_PROPERTIES_CRACK);
|
||||
}
|
||||
|
||||
void Cracker::fast_stage_move_set_duration(double duration) {
|
||||
if (m_fast_stage_move_need_pause.load()) {
|
||||
fast_stage_move_set_duration_with_pause(duration);
|
||||
} else {
|
||||
fast_stage_move_set_duration_without_pause(duration);
|
||||
}
|
||||
}
|
||||
|
||||
void Cracker::fast_stage_move_set_duration_with_pause(double duration) {
|
||||
LUA_STATUS_PAUSER_GUARD();
|
||||
m_state["ChapterConst"]["ShipStepDuration"] = duration;
|
||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = duration;
|
||||
}
|
||||
|
||||
void Cracker::fast_stage_move_set_duration_without_pause(double duration) {
|
||||
m_state["ChapterConst"]["ShipStepDuration"] = duration;
|
||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = duration;
|
||||
}
|
||||
|
||||
void Cracker::skip_battle_celebrate_set_duration(double duration) {
|
||||
if (m_skip_battle_celebrate_need_pause.load()) {
|
||||
skip_battle_celebrate_set_duration_with_pause(duration);
|
||||
|
||||
Reference in New Issue
Block a user