-
Notifications
You must be signed in to change notification settings - Fork 69
Кастомка для Бульбы #100
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
base: master
Are you sure you want to change the base?
Кастомка для Бульбы #100
Changes from all commits
769f899
73dbd0d
a6e484d
f0b0522
8b30cf5
ba94aed
c10a07f
a2c737b
eee81b0
d64c38c
66e57c8
f5e7b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,10 @@ | |
| using Robust.Shared.Prototypes; | ||
| using Robust.Shared.Utility; | ||
| using static Robust.Client.UserInterface.Controls.BoxContainer; | ||
| // Arcane - Start | ||
| using Content.Shared._Arcane.SpecialWhitelist; | ||
| using Robust.Client.Player; | ||
| // Arcane - End | ||
|
|
||
| namespace Content.Client.Humanoid; | ||
|
|
||
|
|
@@ -31,6 +35,7 @@ public sealed partial class MarkingPicker : Control | |
| [Dependency] private readonly MarkingManager _markingManager = default!; | ||
| [Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
| [Dependency] private readonly IEntityManager _entityManager = default!; | ||
| [Dependency] private readonly IPlayerManager _playerManager = default!; // Arcane | ||
|
|
||
| private readonly SpriteSystem _sprite; | ||
|
|
||
|
|
@@ -239,8 +244,13 @@ public void Populate(string filter) | |
| continue; | ||
| } | ||
|
|
||
| // Arcane - Start | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Пробелы между '-' и Arcane со стартом бы убрать. |
||
| if (!MarkingWhitelistManager.IsMarkingAllowed(marking, _playerManager.LocalSession)) | ||
| continue; | ||
| // Arcane - End | ||
|
|
||
| var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", _sprite.Frame0(marking.Sprites[0])); | ||
| item.Metadata = marking; | ||
| item.Metadata = marking; | ||
| } | ||
|
|
||
| CMarkingPoints.Visible = _currentMarkings.PointsLeft(_selectedMarkingCategory) != -1; | ||
|
|
@@ -561,4 +571,4 @@ private void MarkingRemove() | |
| CMarkingColors.Visible = false; | ||
| OnMarkingRemoved?.Invoke(_currentMarkings); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| using Robust.Shared.Prototypes; | ||||||||||||||||||
| using Robust.Shared.Utility; | ||||||||||||||||||
| using Content.Shared._Arcane.SpecialWhitelist; | ||||||||||||||||||
|
|
||||||||||||||||||
| namespace Content.Shared.Humanoid.Markings | ||||||||||||||||||
| { | ||||||||||||||||||
|
|
@@ -69,5 +70,9 @@ public Marking AsMarking() | |||||||||||||||||
| { | ||||||||||||||||||
| return new Marking(ID, Sprites.Count); | ||||||||||||||||||
| } | ||||||||||||||||||
| // Arcane - Start | ||||||||||||||||||
| [DataField("whitelist")] | ||||||||||||||||||
| public MarkingWhitelistData? Whitelist { get; private set; } | ||||||||||||||||||
| // Arcane - End | ||||||||||||||||||
|
Comment on lines
+73
to
+76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value Явное имя Совпадает с дефолтным именем от ♻️ Предложение- // Arcane - Start
- [DataField("whitelist")]
+ // Arcane - Start
+ [DataField]
public MarkingWhitelistData? Whitelist { get; private set; }
// Arcane - EndМаркировка As per coding guidelines, "Prefer 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,10 @@ | |
| using Robust.Shared.Random; | ||
| using Robust.Shared.Serialization; | ||
| using Robust.Shared.Utility; | ||
| // Arcane - Start | ||
| using Content.Shared.Humanoid.Markings; | ||
| using Content.Shared._Arcane.SpecialWhitelist; | ||
| // Arcane - End | ||
|
Comment on lines
+72
to
+75
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Сноси пометки. |
||
|
|
||
| namespace Content.Shared.Preferences | ||
| { | ||
|
|
@@ -1106,6 +1110,16 @@ public void EnsureValid(ICommonSession session, IDependencyCollection collection | |
| { | ||
| _loadouts.Remove(value); | ||
| } | ||
| // Arcane - Start | ||
| foreach (var markingId in Appearance.Markings.ToList()) | ||
| { | ||
| if (!prototypeManager.TryIndex<MarkingPrototype>(markingId.MarkingId, out var proto)) | ||
| continue; | ||
|
|
||
| if (!MarkingWhitelistManager.IsMarkingAllowed(proto, session)) | ||
| Appearance.Markings.Remove(markingId); | ||
| } | ||
| // Arcane - End | ||
| } | ||
|
|
||
| // Art-TTS Start | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||||
| using Robust.Shared.Serialization; | ||||||||||
|
|
||||||||||
| namespace Content.Shared._Arcane.SpecialWhitelist; | ||||||||||
|
|
||||||||||
| [DataDefinition] | ||||||||||
| public sealed partial class MarkingWhitelistData | ||||||||||
| { | ||||||||||
| [DataField("allowed")] | ||||||||||
| public List<string> Allowed { get; private set; } = new(); | ||||||||||
|
Comment on lines
+8
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value Явное имя Строковое имя совпадает с дефолтным (camelCase от ♻️ Предложение- [DataField("allowed")]
+ [DataField]
public List<string> Allowed { get; private set; } = new();As per coding guidelines, "Prefer 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using Content.Shared.Humanoid.Markings; | ||
| using Robust.Shared.Player; | ||
|
|
||
| namespace Content.Shared._Arcane.SpecialWhitelist; | ||
|
|
||
| public static class MarkingWhitelistManager | ||
| { | ||
| public static bool IsMarkingAllowed(MarkingPrototype marking, ICommonSession? session) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win Наименование check-метода не соответствует конвенции.
As per coding guidelines, "Check methods should prefer 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| { | ||
| // Если вайтлиста нет — разметка доступна всем | ||
| if (marking.Whitelist == null || marking.Whitelist.Allowed.Count == 0) | ||
| return true; | ||
|
|
||
| // Если сессии нет (например, локальный просмотр без игрока), скрываем на всякий случай | ||
| if (session == null) | ||
| return false; | ||
|
|
||
| // Для привязки к аккаунту используем login username, а не отображаемое имя персонажа. | ||
|
Comment on lines
+10
to
+18
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Почему пометки на русском? |
||
| var ckey = session.Data.UserName; | ||
|
|
||
| foreach (var allowedCkey in marking.Whitelist.Allowed) | ||
| { | ||
| if (string.Equals(allowedCkey, ckey, StringComparison.OrdinalIgnoreCase)) | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,20 @@ | |
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/tail.rsi | ||
| state: neomorph_tail | ||
|
|
||
| - type: marking | ||
| id: HumanoidXenoTailRen | ||
| bodyPart: Tail | ||
| markingCategory: Tail | ||
| speciesRestriction: [HumanoidXeno] | ||
| sprites: | ||
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/tail.rsi | ||
| state: ren_tail | ||
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/tail.rsi | ||
| state: ren_tail_grad | ||
| whitelist: | ||
| allowed: | ||
| - Bulbo44key | ||
|
|
||
|
Comment on lines
+120
to
+133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift Whitelist только на клиенте — фильтр обходится напрямую. Три новых маркинга ( Нужна серверная валидация профиля персонажа (при применении/сохранении), а не только фильтрация в UI-пикере. Also applies to: 298-309, 440-451 🤖 Prompt for AI Agents |
||
| # Head | ||
|
|
||
| - type: marking | ||
|
|
@@ -281,6 +295,18 @@ | |
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/head.rsi | ||
| state: worker_shine | ||
|
|
||
| - type: marking | ||
| id: HumanoidXenoHeadRen | ||
| bodyPart: Head | ||
| markingCategory: Head | ||
| speciesRestriction: [HumanoidXeno] | ||
| sprites: | ||
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/head.rsi | ||
| state: ren_head | ||
| whitelist: | ||
| allowed: | ||
| - Bulbo44key | ||
|
|
||
| # Chest | ||
|
|
||
| - type: marking | ||
|
|
@@ -411,6 +437,18 @@ | |
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/long_tracheas.rsi | ||
| state: carrier_tubes | ||
|
|
||
| - type: marking | ||
| id: HumanoidXenoTracheasRen | ||
| bodyPart: Chest | ||
| markingCategory: Tracheas | ||
| speciesRestriction: [HumanoidXeno] | ||
| sprites: | ||
| - sprite: _Arcane/Mobs/Customization/HumanoidXeno/tracheas.rsi | ||
| state: ren_tubes | ||
| whitelist: | ||
| allowed: | ||
| - Bulbo44key | ||
|
|
||
| # Legs | ||
|
|
||
| - type: marking | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,6 +138,10 @@ | |
| { | ||
| "name": "worker_teeth", | ||
| "directions": 4 | ||
| }, | ||
| { | ||
| "name": "ren_head", | ||
| "directions": 4 | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,10 @@ | |
| { | ||
| "name": "neomorph_tubes", | ||
| "directions": 4 | ||
| }, | ||
| { | ||
| "name": "ren_tubes", | ||
| "directions": 4 | ||
| } | ||
| ] | ||
| } | ||
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.
Usings НИКОГДА не помечают пометками об изменениях в виде // Arcane...