[TWEAK] Edit FlavorText and Rules#2661
[TWEAK] Edit FlavorText and Rules#2661CrimeMoot wants to merge 2 commits intoAdventureTimeSS14:masterfrom
Conversation
WalkthroughДанное изменение удаляет функциональность OOC Notes из системы описания персонажей и добавляет новую систему правил описания. Удалены поле Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Интеграцию в БД не убирал, но по сути она не используется больше. Ибо боюсь сломать что. |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs (1)
18-18:⚠️ Potential issue | 🟡 MinorДублирующийся импорт.
Content.Client.Corvax.Sponsorsуже импортирован в строке 5. Дубликат следует удалить.-using Content.Client.Corvax.Sponsors;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs` at line 18, Remove the duplicate using directive "using Content.Client.Corvax.Sponsors;" from HumanoidProfileEditor.xaml.cs — keep only the single import declared earlier (the one at the top of the file) so there are no repeated using statements; simply delete the redundant line referencing Content.Client.Corvax.Sponsors.
🧹 Nitpick comments (2)
Content.Client/FlavorText/FlavorText.xaml.cs (1)
53-56: Рассмотрите вынесение значения таймера в константу.Значение
Timer = 5fявляется магическим числом. Для улучшения читаемости и упрощения изменений в будущем можно вынести его в константу.♻️ Предлагаемое исправление
+ private const float RulesAcceptTimerSeconds = 5f; + private void OpenRulesPopup() { if (_rulesPopup != null) return; _rulesPopup = new FlavorTextRulesPopup { - Timer = 5f + Timer = RulesAcceptTimerSeconds };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/FlavorText/FlavorText.xaml.cs` around lines 53 - 56, Вынесите "магическое" число таймера в константу: объявите приватную константу (например private const float RulesPopupTimer = 5f) в классе и используйте её при инициализации _rulesPopup вместо прямого литерала Timer = 5f; измените ссылку на константу в конструкторе/инициализаторе и убедитесь, что имя константы понятно (ссылаясь на FlavorTextRulesPopup, _rulesPopup и свойство Timer).Content.Client/ADT/FlavorText/Rules/FlavorTextRulesControl.xaml.cs (1)
30-30: Возвращаемое значениеTryAddMarkupне проверяется.Метод
TryAddMarkupвозвращаетbool—falseпри ошибке парсинга (см.Content.Client/Guidebook/DocumentParsingManager.cs:54-88). Игнорирование этого значения может привести к тихому отказу без уведомления пользователя.♻️ Предлагаемое исправление
- _parsingMan.TryAddMarkup(RulesContainer, entry.Value); + if (!_parsingMan.TryAddMarkup(RulesContainer, entry.Value)) + { + // Markup добавит GuidebookError при ошибке, дополнительная обработка опциональна + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/ADT/FlavorText/Rules/FlavorTextRulesControl.xaml.cs` at line 30, Вызов _parsingMan.TryAddMarkup(RulesContainer, entry.Value) игнорирует возвращаемое bool и может проглотить ошибки парсинга; оберните вызов проверкой результата и обработайте false — например, записать подробный лог/сообщение об ошибке с контекстом (какой entry/значение пытались распарсить) и/или показать пользователю предупреждение/фоллбек, чтобы парсинг не падал молча; реализуйте это прямо там, где вызывается TryAddMarkup, чтобы при false выполнить логирование/уведомление и/или альтернативную обработку.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Client/ADT/FlavorText/Rules/FlavorTextRulesPopup.xaml`:
- Around line 10-11: PanelContainer is currently self-closed so BoxContainer is
a sibling and does not inherit the windowPanel style; change PanelContainer from
a self-closing tag to an opening tag and move BoxContainer (and the rest of the
window content) inside it, then add the corresponding closing </PanelContainer>
so that StyleClasses="windowPanel" wraps the BoxContainer content; reference the
PanelContainer and BoxContainer elements and the StyleClasses="windowPanel"
attribute when making this change.
In `@Content.Client/FlavorText/FlavorText.xaml`:
- Line 66: The PlaceHolder="Вставьте сюда ссылку" in FlavorText.xaml is
hardcoded Russian text; add a localization key
flavor-interface-headshot-placeholder to the FTL files (e.g.,
Resources/Locale/ru-RU/... and en-US/...) with the corresponding translations,
then replace the inline PlaceHolder value in FlavorText.xaml with the
localization reference {Loc 'flavor-interface-headshot-placeholder'} so the XAML
uses the localized string instead of hardcoded text.
In `@Resources/Locale/en-US/ADT/preferences/ui/flavor-text.ftl`:
- Line 7: The message flavor-rules-wait currently uses a fixed "seconds" and
fails for singular; update the Fluent string for flavor-rules-wait to use a
plural/select expression based on $time (e.g., a Fluent plural variant with
[one] and [other]) so it emits "1 second" for one and "{ $time } seconds" for
other values; locate flavor-rules-wait in the FTL and replace the simple
interpolation with a pluralized expression using $time.
In `@Resources/Locale/ru-RU/ADT/Preferences/ui/flavor-text.ftl`:
- Line 7: The message key flavor-rules-wait uses a fixed genitive plural
"секунд" which is grammatically wrong for 1–4; update flavor-rules-wait to use a
Fluent plural/select expression over {$time} (or a selector) to provide correct
Russian forms (e.g., "1 секунду", "2/3/4 секунды", "5+ секунд") so the string
chooses the right case based on $time.
---
Outside diff comments:
In `@Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs`:
- Line 18: Remove the duplicate using directive "using
Content.Client.Corvax.Sponsors;" from HumanoidProfileEditor.xaml.cs — keep only
the single import declared earlier (the one at the top of the file) so there are
no repeated using statements; simply delete the redundant line referencing
Content.Client.Corvax.Sponsors.
---
Nitpick comments:
In `@Content.Client/ADT/FlavorText/Rules/FlavorTextRulesControl.xaml.cs`:
- Line 30: Вызов _parsingMan.TryAddMarkup(RulesContainer, entry.Value)
игнорирует возвращаемое bool и может проглотить ошибки парсинга; оберните вызов
проверкой результата и обработайте false — например, записать подробный
лог/сообщение об ошибке с контекстом (какой entry/значение пытались распарсить)
и/или показать пользователю предупреждение/фоллбек, чтобы парсинг не падал
молча; реализуйте это прямо там, где вызывается TryAddMarkup, чтобы при false
выполнить логирование/уведомление и/или альтернативную обработку.
In `@Content.Client/FlavorText/FlavorText.xaml.cs`:
- Around line 53-56: Вынесите "магическое" число таймера в константу: объявите
приватную константу (например private const float RulesPopupTimer = 5f) в классе
и используйте её при инициализации _rulesPopup вместо прямого литерала Timer =
5f; измените ссылку на константу в конструкторе/инициализаторе и убедитесь, что
имя константы понятно (ссылаясь на FlavorTextRulesPopup, _rulesPopup и свойство
Timer).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ae8b3459-84d2-4f59-a082-c4a18bbbac25
📒 Files selected for processing (16)
Content.Client/ADT/CharecterFlavor/CharacterFlavorWindow.xamlContent.Client/ADT/CharecterFlavor/CharacterFlavorWindow.xaml.csContent.Client/ADT/FlavorText/Rules/FlavorTextRulesControl.xamlContent.Client/ADT/FlavorText/Rules/FlavorTextRulesControl.xaml.csContent.Client/ADT/FlavorText/Rules/FlavorTextRulesPopup.xamlContent.Client/ADT/FlavorText/Rules/FlavorTextRulesPopup.xaml.csContent.Client/FlavorText/FlavorText.xamlContent.Client/FlavorText/FlavorText.xaml.csContent.Client/Lobby/UI/HumanoidProfileEditor.xaml.csContent.Server/Polymorph/Systems/PolymorphSystem.csContent.Server/Station/Systems/StationSpawningSystem.csContent.Shared/ADT/CharecterFlavor/CharacterFlavorComponent.csResources/Locale/en-US/ADT/preferences/ui/flavor-text.ftlResources/Locale/ru-RU/ADT/Preferences/ui/flavor-text.ftlResources/Prototypes/ADT/Guidebook/rules.ymlResources/ServerInfo/ADT/Guidebook/ServerRules/FlavorTextRules.xml
💤 Files with no reviewable changes (4)
- Content.Client/ADT/CharecterFlavor/CharacterFlavorWindow.xaml.cs
- Content.Server/Station/Systems/StationSpawningSystem.cs
- Content.Server/Polymorph/Systems/PolymorphSystem.cs
- Content.Shared/ADT/CharecterFlavor/CharacterFlavorComponent.cs
Описание PR
Убрано OOC описание, добавлены Правила в самом редакторе. Без их подтверждение, редактировать своё описание нельзя - придётся ознакомиться.
Техническая информация
Чейнджлог
🆑 CrimeMoot