Skip to content

Commit 178ae30

Browse files
committed
- 修复 **instant_draw_setting.py与pumping_people_setting.py之间颜色设置同步问题**,添加颜色映射和同步逻辑,确保两个模块颜色设置保持一致
1 parent 41aa94f commit 178ae30

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/common/instant_draw_setting.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ def sync_settings_from_pumping_people(self):
440440
"max_draw_count": "max_draw_count"
441441
}
442442

443+
# 定义需要同步的颜色设置键值映射
444+
color_sync_mapping = {
445+
"_animation_color": "_animation_color",
446+
"_result_color": "_result_color"
447+
}
448+
443449
# 从pumping_people同步设置到instant_draw
444450
updated = False
445451
for pumping_key, instant_key in sync_mapping.items():
@@ -462,6 +468,16 @@ def sync_settings_from_pumping_people(self):
462468
instant_draw_settings[instant_key] = new_value
463469
updated = True
464470

471+
# 同步颜色设置
472+
for pumping_key, instant_key in color_sync_mapping.items():
473+
if pumping_key in pumping_people_settings:
474+
old_value = instant_draw_settings.get(instant_key)
475+
new_value = pumping_people_settings[pumping_key]
476+
477+
if old_value != new_value:
478+
instant_draw_settings[instant_key] = new_value
479+
updated = True
480+
465481
# 如果有更新,保存设置并刷新UI
466482
if updated:
467483
settings["instant_draw"] = instant_draw_settings

0 commit comments

Comments
 (0)