-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Add] Better Character Examine #269
[Add] Better Character Examine #269
Conversation
Warning Rate limit exceeded@Vaaankas has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughВ пул-реквесте внесены изменения в несколько подсистем. Добавлен новый публичный метод в Changes
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Resources/Locale/ru-RU/_white/examine/examine.ftl (1)
13-13
: Возможная опечатка в фразе
В строке 13 передPOSS-ADJ($ent)
присутствует буква «н», которая выглядит лишней и может сбивать с толку при чтении. Рекомендуется убрать её для улучшения читаемости.- jumpsuit-examine = - [bold]{$item}[/bold], надетый на н{POSS-ADJ($ent)}. + jumpsuit-examine = - [bold]{$item}[/bold], надетый на {POSS-ADJ($ent)}.Resources/Locale/en-US/_white/examine/examine.ftl (1)
47-47
: Потенциальная неточность при использовании INDEFINITE($age)
Фраза «You are { INDEFINITE($age) } { $age } { $species }» может создавать некорректные сочетания артикля и числа, например «You are an 25 Human». Рекомендуется заменить на более предсказуемую форму, например «You are { $age } year(s) old { $species }» или другую локализацию по контексту.- humanoid-appearance-component-examine-selfaware = You are { INDEFINITE($age) } { $age } { $species }. + humanoid-appearance-component-examine-selfaware = You are { $age } year(s) old { $species }.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
Content.Server/IdentityManagement/IdentitySystem.cs
(1 hunks)Content.Server/_White/Examine/ExaminableCharacterComponent.cs
(1 hunks)Content.Server/_White/Examine/ExaminableCharacterSystem.cs
(1 hunks)Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs
(1 hunks)Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs
(1 hunks)Resources/Locale/en-US/_white/examine/examine.ftl
(1 hunks)Resources/Locale/ru-RU/_white/examine/examine.ftl
(1 hunks)Resources/Prototypes/Entities/Mobs/Species/base.yml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- Content.Server/_White/Examine/ExaminableCharacterComponent.cs
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: build (ubuntu-latest)
- GitHub Check: Test Packaging
- GitHub Check: YAML Linter
- GitHub Check: build (ubuntu-latest)
- GitHub Check: YAML map schema validator
🔇 Additional comments (7)
Content.Server/IdentityManagement/IdentitySystem.cs (1)
85-93
: Хороший подход к API для получения личности сущностиМетод хорошо инкапсулирует получение имени идентичности через существующие методы системы.
Resources/Prototypes/Entities/Mobs/Species/base.yml (1)
248-248
: Компонент ExaminableCharacter добавлен успешноКомпонент правильно добавлен в прототип BaseMobSpecies, что позволит всем видам мобов иметь функционал осмотра персонажа.
Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs (1)
214-222
: Хорошая реализация адаптивных локализационных ключейКод корректно определяет случай самоосмотра и изменяет ключ локализации для показа правильного сообщения. Установка высокого приоритета (99) обеспечивает правильный порядок вывода сообщений при осмотре.
Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs (1)
128-135
: Корректная обработка локализации с учётом самоосмотраКод выбирает соответствующий ключ локализации в зависимости от того, осматривает ли персонаж сам себя или другое существо. Установка приоритета 100 для текста осмотра обеспечивает его первостепенное отображение.
Обратите внимание на то, что приоритет здесь (100) выше, чем в системе осмотра рук (99). Это правильно, если необходимо всегда отображать информацию о расе перед списком предметов.
Resources/Locale/ru-RU/_white/examine/examine.ftl (1)
1-5
: Начальные строки выглядят корректно
Проблем с форматированием или смыслом здесь не обнаружено.Content.Server/_White/Examine/ExaminableCharacterSystem.cs (1)
28-112
: Общая реализация системы осмотра
Логика при сравненииargs.Examiner
иargs.Examined
для определения selfaware-состояния выглядит корректной. Система учитывает наличие предметов в экипированных слотах, динамически формируя вывод. Приоритет и условие вывода информации, если слотах что-то есть, кажутся разумными. В целом реализация масштабируема и хорошо читается.Resources/Locale/en-US/_white/examine/examine.ftl (1)
1-5
: Начальный набор строк
Начальные фразы выглядят достаточно ясно, оформление и placeholders кажутся корректными.
Пиздец меню раздувает, а там снизу кнопочки так-то важные есть. |
потом их уберу тоже |
canseenothingloc += "-selfaware"; | ||
|
||
var canseenothing = Loc.GetString(canseenothingloc, ("ent", uid)); | ||
logLines.Add($"[color=DarkGray][font size=10]{canseenothing}[/font][/color]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
цвет и размер шрифта отсюда убери и перенеси в локализацию
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ладно
{ | ||
args.PushMarkup(Loc.GetString(locKey, locUser, locItems)); | ||
args.PushMarkup("- " + Loc.GetString(locKey, locUser, locItems)); // "-" for better formatting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В файлах локализации уже проставлены чёрточки в начале, может быть, эта уже лишняя?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не лишняя, для удобства чтения, но мб уберу
if (selfaware) | ||
{ | ||
canseeloc += "-selfaware"; | ||
nameloc += "-selfaware"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
slotLabel += "examine"; | ||
|
||
if (selfaware) | ||
slotLabel += "-selfaware"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
string canseenothingloc = "examine-can-see-nothing"; | ||
|
||
if (selfaware) | ||
canseenothingloc += "-selfaware"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
|
||
if (priority < 13) // If nothing is worn dont show | ||
{ | ||
args.PushMarkup($"[font size=10]{cansee}[/font]", 14); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
теги в локализацию
{ | ||
var item = Loc.GetString(slotLabel, ("item", metaData.EntityName), ("ent", uid)); | ||
args.PushMarkup($"[font size=10]{item}[/font]", priority); | ||
logLines.Add($"[color=DarkGray][font size=10]{item}[/font][/color]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
теги в локализацию
logLines.Add($"[color=DarkGray][font size=10]{name}[/font][/color]"); | ||
|
||
var cansee = Loc.GetString(canseeloc, ("ent", uid)); | ||
logLines.Add($"[color=DarkGray][font size=10]{cansee}[/font][/color]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
теги в локализацию
using (args.PushGroup(nameof(HandsComponent))) | ||
// WWDP examine | ||
if (args.Examiner == args.Examined) // Use the selfaware locale when inspecting yourself | ||
locKey += "-selfaware"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
if (args.Examiner == args.Examined) // Use the selfaware locale when examining yourself | ||
locale += "-selfaware"; | ||
|
||
args.PushText(Loc.GetString(locale, ("user", identity), ("age", age), ("species", species)), 100); // priority for examine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const string locale = "humanoid-appearance-component-examine";
const string localeself = locale+"-selfaware";
Loc.GetString(args.SelfExamine ? locale : localeself, ...
и так во всех остальных таких местах
в ивент добавь public bool SelfExamine => Examiner == Examined;
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
аээээ чё так усложнять ладно
:( |
Описание PR
Меняет описание в меню осмотра, добавляет список надетых вещей.
Логирует список в чат игроку при включённой настройке.
Медиа
Изменения
🆑 vanx