Repository navigation
feat: 适配新语明霄卷轴主题及共用阴阳寮入口掩码 - #1998
Conversation
There was a problem hiding this comment.
嘿——我发现了 2 个问题
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tasks/Component/Costume/costume_base.py" line_range="121" />
<code_context>
class ThemeType(str, Enum):
COSTUME_THEME_DEFAULT = 'costume_theme_default' # 伊始之卷
+ COSTUME_THEME_XINYU_MINGXIAO = 'costume_theme_xinyu_mingxiao' # 新语明霄
# 幕间,就是式神录这里
class ShikigamiType(str, Enum):
</code_context>
<issue_to_address>
**Theme logs show raw key**
When the new theme is selected, `I18n.trans_zh_cn(theme_type)` looks up the new theme value in `module/config/i18n/zh-CN.json`, but this change adds its translation only to `assets/i18n/zh-CN.json`; selecting the theme therefore logs `costume_theme_xinyu_mingxiao` instead of `新语明霄`.
Add the new value to the translation source used by `I18n.trans_zh_cn`, or use the asset translation source for this log.
</issue_to_address>
### Comment 2
<location path="tests/tasks/Component/CostumeTheme/test_theme.py" line_range="77" />
<code_context>
+ rule = GameUiAssets.I_MAIN_GOTO_TEAM
+ original = deepcopy(rule.__dict__)
+ with self.assertRaises(KeyError):
+ apply_theme('not_a_theme')
+ self.assertEqual(rule.__dict__, original)
+
</code_context>
<issue_to_address>
**Partial theme mutation goes undetected**
When `apply_theme` partially mutates a different theme rule before rejecting an unknown theme, `test_invalid_theme_does_not_mutate_rules` compares only `I_MAIN_GOTO_TEAM` at `cy`; if `apply_theme` mutates `I_MAIN_SCROLL_CLOSE` before raising `KeyError`, this assertion still passes and the test misses the corrupted theme state.
Snapshot and compare every rule in `_THEME_NAMES` around the invalid-theme call.
</issue_to_address>Sourcery 评估
等待批准。 请先处理 1 项发现。
阻塞性发现:tests/tasks/Component/CostumeTheme/test_theme.py:77
Original comment in English
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tasks/Component/Costume/costume_base.py" line_range="121" />
<code_context>
class ThemeType(str, Enum):
COSTUME_THEME_DEFAULT = 'costume_theme_default' # 伊始之卷
+ COSTUME_THEME_XINYU_MINGXIAO = 'costume_theme_xinyu_mingxiao' # 新语明霄
# 幕间,就是式神录这里
class ShikigamiType(str, Enum):
</code_context>
<issue_to_address>
**Theme logs show raw key**
When the new theme is selected, `I18n.trans_zh_cn(theme_type)` looks up the new theme value in `module/config/i18n/zh-CN.json`, but this change adds its translation only to `assets/i18n/zh-CN.json`; selecting the theme therefore logs `costume_theme_xinyu_mingxiao` instead of `新语明霄`.
Add the new value to the translation source used by `I18n.trans_zh_cn`, or use the asset translation source for this log.
</issue_to_address>
### Comment 2
<location path="tests/tasks/Component/CostumeTheme/test_theme.py" line_range="77" />
<code_context>
+ rule = GameUiAssets.I_MAIN_GOTO_TEAM
+ original = deepcopy(rule.__dict__)
+ with self.assertRaises(KeyError):
+ apply_theme('not_a_theme')
+ self.assertEqual(rule.__dict__, original)
+
</code_context>
<issue_to_address>
**Partial theme mutation goes undetected**
When `apply_theme` partially mutates a different theme rule before rejecting an unknown theme, `test_invalid_theme_does_not_mutate_rules` compares only `I_MAIN_GOTO_TEAM` at `cy`; if `apply_theme` mutates `I_MAIN_SCROLL_CLOSE` before raising `KeyError`, this assertion still passes and the test misses the corrupted theme state.
Snapshot and compare every rule in `_THEME_NAMES` around the invalid-theme call.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: tests/tasks/Component/CostumeTheme/test_theme.py:77
|
No actionable comments were generated in the recent review.
|
|
这个卷轴按理来说都是通用的都能识别,除了阴阳寮部分主题要用mask才能匹配,还有啥匹配不上的吗 |
应该没有了,之前试的时候就是阴阳寮的对不上,卷轴那个我不太确定所以一起做了 |
|
test 不要放图片 |
修改内容
从 #1987 拆出的卷轴主题部分,不包含结界皮肤或悬赏封印改动。
costume_theme_xinyu_mingxiao。由于结界皮肤那边存在已有内部值分别为12345但实际未应用的选项,故两处皮肤改动都暂时用拼音命名,如需修改请告知。验证
Sourcery 摘要
新增「星宇明霄」卷轴主题,并增强共享公会入口检测,使其能够稳健应对主题切换。
新功能:
错误修复:
增强:
测试:
Original summary in English
Sourcery 总结
支持新语明霄庭院主题,并增强共享阴阳公会入口检测,使其能够适应主题切换。
新功能:
错误修复:
改进:
测试:
Original summary in English
Summary by Sourcery
Support the 新语明霄 courtyard theme and make the shared Yin-Yang Guild entrance detection robust across theme changes.
New Features:
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit