Skip to content
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

fix loadout #1002

Merged
merged 1 commit into from
Jan 12, 2025
Merged

fix loadout #1002

merged 1 commit into from
Jan 12, 2025

Conversation

KayzelW
Copy link
Collaborator

@KayzelW KayzelW commented Jan 12, 2025

Описание PR

Починен лодаут нижнего белья.

Тип PR

  • Feature
  • Fix
  • Tweak
  • Balance
  • Refactor
  • Port
  • Translate
  • Resprite

Изменения

🆑

  • fix: Исправлен лодаут нижнего белья.

Summary by CodeRabbit

  • Новые функции

    • Обновлена система управления снаряжением для различных профессий.
  • Исправления

    • Улучшена логика фильтрации снаряжения в пользовательском интерфейсе.
  • Изменения в конфигурации

    • Обновлены группы снаряжения для нескольких должностей.
    • Удалены стандартные инвентарные записи для большого количества профессий.

Эти изменения направлены на оптимизацию системы снаряжения и улучшение пользовательского опыта.

@KayzelW KayzelW requested a review from Rxup as a code owner January 12, 2025 14:05
Copy link
Contributor

coderabbitai bot commented Jan 12, 2025

Walkthrough

Изменения затрагивают систему загрузки профилей и настройки ролевых нагрузок в игре. В контроллере лобби была обновлена логика фильтрации выбранных нагрузок, а в файлах прототипов произведены модификации групп для различных профессиональных ролей. Изменения коснулись добавления новых групп "Werx", "Niz" и "Socks" для некоторых ролей и удаления определенных инвентарных записей.

Changes

Файл Изменения
Content.Client/Lobby/LobbyUIController.cs Изменена логика фильтрации loadout.SelectedLoadouts в методе LoadProfileEntity
Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml Добавлены группы "Werx", "Niz", "Socks" для ролей JobIAA и JobPilot
Resources/Prototypes/Loadouts/role_loadouts.yml Удалена запись Inventory # Corvax-Loadouts для множества профессиональных ролей
Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml Добавлены группы для JobBKCCCargo и JobBlueShield, удалены группы с JobBlueShield

Poem

🐰 В мире кодов, где логика течёт,
Загрузки профилей танцуют вальсет.
Группы "Werx", "Niz" и "Socks" пляшут вокруг,
Меняя правила игровых услуг.
Кролик-программист смеётся: "Вот так штука!" 🎲


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d6e22 and 8e78ee7.

📒 Files selected for processing (4)
  • Content.Client/Lobby/LobbyUIController.cs (1 hunks)
  • Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (2 hunks)
  • Resources/Prototypes/Loadouts/role_loadouts.yml (0 hunks)
  • Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • Resources/Prototypes/Loadouts/role_loadouts.yml
🔇 Additional comments (4)
Content.Client/Lobby/LobbyUIController.cs (1)

497-505: Проверьте изменение логики фильтрации loadout'ов

Новая логика инвертирует условие фильтрации - теперь элементы удаляются при jobClothes == false. Убедитесь, что это соответствует ожидаемому поведению для групп "Werx", "Niz" и "Socks".

✅ Verification successful

Логика фильтрации loadout'ов корректна

Группы "Werx", "Niz" и "Socks" представляют собой настройки нижнего белья и являются опциональными персональными элементами одежды. Их удаление при jobClothes == false соответствует ожидаемому поведению - когда не отображается рабочая одежда, персональные элементы одежды также должны быть скрыты.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Проверка использования групп в других файлах
rg -l "Werx|Niz|Socks" Resources/Prototypes/

Length of output: 1375


Script:

#!/bin/bash
# Проверяем содержимое файлов role_loadout.yml
echo "=== Base role_loadout.yml ==="
cat Resources/Prototypes/Loadouts/role_loadouts.yml
echo -e "\n=== Backmen role_loadout.yml ==="
cat Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml
echo -e "\n=== Under clothing definitions ==="
cat Resources/Prototypes/_Backmen/Loadouts/Miscellaneous/clothingUnder.yml

Length of output: 21947

Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (1)

4-6: Добавление новых групп в JobIAA и JobPilot

Группы Werx, Niz и Socks добавлены в оба профиля. Убедитесь, что эти группы правильно определены в системе и имеют соответствующие предметы.

Also applies to: 19-21

✅ Verification successful

Группы корректно определены в системе

Группы Werx, Niz и Socks определены в файле Resources/Prototypes/_Backmen/Loadouts/Miscellaneous/clothingUnder.yml и правильно используются в конфигурациях JobIAA и JobPilot.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск определений групп
ast-grep --pattern 'type: loadoutGroup
  id: $_
  $$$'

Length of output: 56


Script:

#!/bin/bash
# Поиск определений и использования групп
echo "=== Поиск определений групп ==="
rg -i "id:\s*(Werx|Niz|Socks)" --type yaml

echo -e "\n=== Поиск использования групп в конфигурациях работ ==="
rg -i "JobIAA|JobPilot" --type yaml -C 2

Length of output: 3407

Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (2)

4-6: Проверьте согласованность групп между ролями

Группы Werx, Niz и Socks добавлены в JobBKCCCargo и JobBlueShield, что согласуется с изменениями в других файлах. Рекомендуется проверить, что все роли используют одинаковый набор групп там, где это необходимо.

Also applies to: 34-36

✅ Verification successful

Группы корректно согласованы между всеми ролями

Проверка показала, что группы Werx, Niz и Socks последовательно и единообразно используются во всех профессиональных ролях, включая как основные, так и пользовательские роли в директориях _Backmen и Corvax. Исключения составляют только специальные наборы RoleSurvival*, которые по своему назначению используют другие группы для снаряжения выживания.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Проверка согласованности групп между ролями
rg -A 5 "type: roleLoadout" Resources/Prototypes/

Length of output: 21222


Line range hint 495-509: Необходимо тестирование изменений

Рекомендуется провести тестирование следующих сценариев:

  1. Создание персонажа с разными ролями
  2. Проверка отображения одежды при jobClothes = true и false
  3. Проверка правильности применения групп Werx, Niz и Socks
✅ Verification successful

Существующее тестовое покрытие подтверждено

В кодовой базе обнаружены интеграционные тесты для системы loadout:

  • LoadoutTests.cs
  • StartingGearStorageTests.cs

Рекомендуемые сценарии тестирования:

  1. Создание персонажа с разными ролями
  2. Проверка отображения одежды при jobClothes = true и false
  3. Проверка правильности применения групп Werx, Niz и Socks
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск тестов для loadout системы
rg -l "test.*loadout" Content.Tests/

Length of output: 38


Script:

#!/bin/bash
# Расширенный поиск тестов
echo "=== Поиск тестов по разным паттернам ==="
rg -l "test.*(?i)(role|cloth|outfit|dress|wear)" -t cs
echo "=== Поиск файлов с тестами ==="
fd -e cs ".*[Tt]est.*" 
echo "=== Поиск упоминаний loadout в yaml файлах ==="
rg -l "loadout" -g "*.yml"

Length of output: 16136


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@KayzelW KayzelW added Fix Я хочу исправить то что работает не так. Ready2Merge PR готов к внесению в репозиторий. labels Jan 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Content.Client/Lobby/LobbyUIController.cs (1)

495-509: Логика обработки групп одежды улучшена!

Изменения корректно решают проблему с загрузкой нижней одежды. Хорошее решение использовать константный список для групп.

Предложение по улучшению: Рассмотрите возможность вынести список groupsToShow в отдельную константу на уровне класса, так как эти группы могут использоваться в других методах.

+ private static readonly IReadOnlyList<string> ClothingGroups = ["Werx", "Niz", "Socks"];
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d6e22 and 8e78ee7.

📒 Files selected for processing (4)
  • Content.Client/Lobby/LobbyUIController.cs (1 hunks)
  • Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (2 hunks)
  • Resources/Prototypes/Loadouts/role_loadouts.yml (0 hunks)
  • Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • Resources/Prototypes/Loadouts/role_loadouts.yml
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (3)
Content.Client/Lobby/LobbyUIController.cs (1)

511-511: Корректное применение загрузки экипировки

Вызов GiveDummyLoadout правильно использует отфильтрованный набор экипировки.

Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (1)

4-6: Группы одежды добавлены корректно

Добавление групп Werx, Niz и Socks для ролей IAA и Pilot соответствует изменениям в контроллере лобби. Группы правильно помечены как #backmen.

Also applies to: 19-21

Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (1)

4-6: Унифицированы группы одежды для всех ролей

Добавление групп Werx, Niz и Socks для ролей BKCCCargo и BlueShield обеспечивает единообразие в конфигурации одежды. Изменения согласуются с существующей конфигурацией Brigmedic.

Also applies to: 34-36

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Content.Client/Lobby/LobbyUIController.cs (1)

497-498: Вынести группы в константы

Жёстко закодированные строки лучше вынести в константы уровня класса для улучшения поддерживаемости кода.

+ private static readonly IReadOnlyList<string> ClothingGroupsToFilter = new[] { "Werx", "Niz", "Socks" };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d6e22 and 8e78ee7.

📒 Files selected for processing (4)
  • Content.Client/Lobby/LobbyUIController.cs (1 hunks)
  • Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (2 hunks)
  • Resources/Prototypes/Loadouts/role_loadouts.yml (0 hunks)
  • Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • Resources/Prototypes/Loadouts/role_loadouts.yml
🔇 Additional comments (3)
Content.Client/Lobby/LobbyUIController.cs (1)

498-505: Проверить корректность инвертированной логики фильтрации

Изменение логики фильтрации групп одежды может повлиять на другие части системы. Убедитесь, что:

  1. Инвертированная логика работает корректно для всех сценариев
  2. Удаление групп не вызывает побочных эффектов
✅ Verification successful

Логика фильтрации подтверждена как корректная

Инвертированная логика фильтрации работает правильно:

  • Когда jobClothes = false, код удаляет группы из groupsToShow
  • Это соответствует ожидаемому поведению, где отключение рабочей одежды должно убрать специфичные для профессии предметы
  • Базовая одежда (Werx, Niz, Socks) остается нетронутой, так как управляется отдельно
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск других мест использования этих групп
rg -l "Werx|Niz|Socks" --type yaml

Length of output: 2310


Script:

#!/bin/bash
# Search for loadout group definitions and usage
ast-grep --pattern 'LoadoutGroup'

# Search for files containing loadout-related code
rg -l "SelectedLoadouts|LoadoutGroup" --type cs

# Check role loadout definitions
cat Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml
cat Resources/Prototypes/Loadouts/role_loadouts.yml

Length of output: 18561

Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (1)

4-6: Проверить необходимость добавления групп

Группы одежды добавлены к ролям JobIAA и JobPilot. Убедитесь, что:

  1. Эти роли действительно должны иметь доступ к данным группам одежды
  2. Добавление групп соответствует игровому балансу

Also applies to: 19-21

Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (1)

4-6: Подтвердить согласованность изменений

Группы одежды последовательно добавлены к ролям JobBKCCCargo и JobBlueShield. Убедитесь, что:

  1. Все необходимые роли получили обновленные группы
  2. Нет пропущенных ролей, которым также нужны эти группы

Also applies to: 34-36

✅ Verification successful

Изменения согласованы во всех файлах

Проверка показала, что все роли, связанные с охраной и грузовым отделом (JobBKCCCargo, JobBlueShield, JobCargoTechnician, JobSecurityOfficer, JobSecurityCadet), имеют одинаковый набор групп одежды с тегом #backmen. Дополнительных ролей, требующих обновления, не обнаружено.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск других ролей, которые могут требовать обновления
rg "type: roleLoadout" --type yaml

Length of output: 3678


Script:

#!/bin/bash
# Поиск ролей, связанных с охраной и грузчиками
rg "id: Job(BKCC|Blue|Security|Cargo|Guard)" --type yaml -A 5

Length of output: 3494

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Content.Client/Lobby/LobbyUIController.cs (1)

495-509: Предложение по улучшению логики фильтрации экипировки

Текущая реализация имеет несколько потенциальных проблем:

  1. Жестко закодированные группы усложняют поддержку кода
  2. Инвертированная логика может быть неочевидной для других разработчиков

Предлагаю следующие улучшения:

- IReadOnlyList<string> groupsToShow = ["Werx", "Niz", "Socks"]; //consts
+ private static readonly IReadOnlyList<string> ClothingGroups = ["Werx", "Niz", "Socks"];

- if (!jobClothes)
- {
-     foreach (var loadoutsKey in loadout.SelectedLoadouts.Keys)
-     {
-         if (groupsToShow.Contains(loadoutsKey.Id))
-         {
-             loadout.SelectedLoadouts.Remove(loadoutsKey);
-         }
-     }
- }
+ // Фильтруем группы одежды если не требуется рабочая форма
+ if (!jobClothes)
+ {
+     loadout.SelectedLoadouts = loadout.SelectedLoadouts
+         .Where(kvp => !ClothingGroups.Contains(kvp.Key.Id))
+         .ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
+ }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d6e22 and 8e78ee7.

📒 Files selected for processing (4)
  • Content.Client/Lobby/LobbyUIController.cs (1 hunks)
  • Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (2 hunks)
  • Resources/Prototypes/Loadouts/role_loadouts.yml (0 hunks)
  • Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • Resources/Prototypes/Loadouts/role_loadouts.yml
🔇 Additional comments (2)
Resources/Prototypes/Corvax/Loadouts/role_loadouts.yml (1)

4-6: Корректное добавление базовых групп одежды

Добавление групп Werx, Niz и Socks для ролей IAA и Pilot выглядит правильным, так как это базовая одежда, необходимая для всех персонажей.

Also applies to: 19-21

Resources/Prototypes/_Backmen/Loadouts/role_loadout.yml (1)

4-6: Согласованное обновление групп одежды

Добавление базовых групп одежды для ролей BKCCCargo и BlueShield соответствует общей структуре изменений и обеспечивает единообразие в системе экипировки.

Also applies to: 34-36

@KayzelW KayzelW merged commit a6369f9 into master Jan 12, 2025
19 checks passed
@KayzelW KayzelW deleted the fix-loadout branch January 12, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Я хочу исправить то что работает не так. Ready2Merge PR готов к внесению в репозиторий. S: Untriaged size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants