-
Notifications
You must be signed in to change notification settings - Fork 148
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
[PORT] Smooth Light #977
[PORT] Smooth Light #977
Conversation
WalkthroughВ классе Changes
Poem
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
🧹 Outside diff range and nitpick comments (1)
Content.Shared/CombatMode/SharedCombatModeSystem.cs (1)
109-113
: Улучшите обработку значений и проверки
- Значение
1
дляAngleTolerance
является магическим числом. Рекомендуется вынести его в константу с понятным названием.- Комментарий о проверке на null можно заменить более явным утверждением в коде.
+private const float SmoothRotationAngleTolerance = 1f; -if (TryComp<CombatModeComponent>(uid, out var comp) && comp.SmoothRotation) +if (TryComp<CombatModeComponent>(uid, out var comp) && comp is { SmoothRotation: true }) { - rot.AngleTolerance = Angle.FromDegrees(1); + rot.AngleTolerance = Angle.FromDegrees(SmoothRotationAngleTolerance); rot.Simple4DirMode = false; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
Content.Shared/CombatMode/CombatModeComponent.cs
(1 hunks)Content.Shared/CombatMode/SharedCombatModeSystem.cs
(1 hunks)
🔇 Additional comments (1)
Content.Shared/CombatMode/SharedCombatModeSystem.cs (1)
107-114
: Проверьте удаление механизма обратной связи
Был удален код всплывающих сообщений без явной замены. Пользователю может быть неочевидно, включен ли боевой режим.
Запустим проверку наличия альтернативного механизма обратной связи:
Рассмотрите альтернативные способы информирования пользователя о состоянии боевого режима:
- Визуальный индикатор в UI
- Звуковой сигнал
- Анимация персонажа
✅ Verification successful
Let's check the content of these files to see if there are alternative feedback mechanisms.
Let's check for UI-related files and combat mode indicators more broadly.
Let's check the content of the CombatModeSystem.cs to understand the status indicator implementation.
Based on the code analysis, I can now provide a final response:
Механизм обратной связи присутствует через визуальные индикаторы
В коде реализован визуальный индикатор боевого режима через:
- Статусную иконку, которая отображается при включенном боевом режиме
- Спрайт-индикатор из "Backmen/Effects/combat_mode.rsi"
- Системный компонент CombatModeIndicatorsOverlay
Удаление всплывающих сообщений не влияет на информирование пользователя, так как основной механизм обратной связи реализован через визуальные индикаторы.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Поиск других механизмов обратной связи при переключении режима
rg -l "combat.*mode.*enabled|combat.*mode.*disabled" --type cs
Length of output: 168
Script:
#!/bin/bash
# Check content of the found files
echo "=== Content.Shared/Interaction/SharedInteractionSystem.cs ==="
rg "combat.*mode.*(enabled|disabled)" -A 5 -B 5 Content.Shared/Interaction/SharedInteractionSystem.cs
echo -e "\n=== Content.Client/Weapons/Melee/MeleeWeaponSystem.cs ==="
rg "combat.*mode.*(enabled|disabled)" -A 5 -B 5 Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
# Let's also check for UI indicators
echo -e "\n=== Checking for UI indicators ==="
rg "CombatMode.*UI" --type cs -A 5 -B 5
Length of output: 1836
Script:
#!/bin/bash
# Поиск UI-компонентов, связанных с боевым режимом
echo "=== Checking UI components ==="
rg -l "CombatMode" Content.Client/UserInterface --type cs
# Поиск визуальных индикаторов
echo -e "\n=== Checking visual indicators ==="
rg "CombatMode.*\.(Sprite|Icon|Indicator|Visual)" --type cs
# Поиск звуковых эффектов
echo -e "\n=== Checking sound effects ==="
rg "CombatMode.*\.(Sound|Audio|Play)" --type cs
# Поиск любых других индикаторов состояния
echo -e "\n=== Checking status indicators ==="
rg "CombatMode.*Status" --type cs
Length of output: 836
Script:
#!/bin/bash
# Проверим реализацию индикатора статуса
echo "=== Content.Client/CombatMode/CombatModeSystem.cs ==="
cat Content.Client/CombatMode/CombatModeSystem.cs
# Проверим связанные события
echo -e "\n=== Checking GetStatusIconsEvent usage ==="
rg "GetStatusIconsEvent" --type cs -A 5 -B 5
Length of output: 30227
|
||
// BACKMEN START | ||
/// <summary> | ||
/// If true, sets <see cref="MouseRotatorComponent.AngleTolerance"/> to 1 degree and <see cref="MouseRotatorComponent.Simple4DirMode"/> | ||
/// to false when the owner enters combatmode. This is currently being tested as of 06.12.24, | ||
/// so a simple bool switch should suffice. | ||
/// Leaving AutoNetworking just in case shitmins need to disable it for someone. Will only take effect when re-enabling combat mode. | ||
/// </summary> | ||
/// <remarks> | ||
/// No effect if <see cref="ToggleMouseRotator"/> is false. | ||
/// </remarks> | ||
[DataField, AutoNetworkedField] | ||
public bool SmoothRotation = true; | ||
// BACKMEN END |
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.
🛠️ Refactor suggestion
Рассмотрите значение по умолчанию для SmoothRotation
Установка SmoothRotation = true
по умолчанию может неожиданно изменить поведение для существующих сущностей. Рекомендуется:
- Установить значение по умолчанию в
false
для обратной совместимости - Включать новое поведение только для новых сущностей или через явную конфигурацию
-public bool SmoothRotation = true;
+public bool SmoothRotation = false;
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// BACKMEN START | |
/// <summary> | |
/// If true, sets <see cref="MouseRotatorComponent.AngleTolerance"/> to 1 degree and <see cref="MouseRotatorComponent.Simple4DirMode"/> | |
/// to false when the owner enters combatmode. This is currently being tested as of 06.12.24, | |
/// so a simple bool switch should suffice. | |
/// Leaving AutoNetworking just in case shitmins need to disable it for someone. Will only take effect when re-enabling combat mode. | |
/// </summary> | |
/// <remarks> | |
/// No effect if <see cref="ToggleMouseRotator"/> is false. | |
/// </remarks> | |
[DataField, AutoNetworkedField] | |
public bool SmoothRotation = true; | |
// BACKMEN END | |
// BACKMEN START | |
/// <summary> | |
/// If true, sets <see cref="MouseRotatorComponent.AngleTolerance"/> to 1 degree and <see cref="MouseRotatorComponent.Simple4DirMode"/> | |
/// to false when the owner enters combatmode. This is currently being tested as of 06.12.24, | |
/// so a simple bool switch should suffice. | |
/// Leaving AutoNetworking just in case shitmins need to disable it for someone. Will only take effect when re-enabling combat mode. | |
/// </summary> | |
/// <remarks> | |
/// No effect if <see cref="ToggleMouseRotator"/> is false. | |
/// </remarks> | |
[DataField, AutoNetworkedField] | |
public bool SmoothRotation = false; | |
// BACKMEN END |
Описание PR
теперь свет фонарика следует за вашей мышкой
Медиа
Тип PR
Original PR:
WWhiteDreamProject/wwdpublic#141
🆑 Trest100
Summary by CodeRabbit
SmoothRotation
для улучшения поведения компонента вращения мыши в боевом режиме.SmoothRotation
.