From ddb73b266f144989a2d0aad11f92dacd848eb92a Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Sun, 4 Aug 2024 13:43:55 +0000 Subject: [PATCH] Tweaks (#559) * - tweak: Less bee health. * - add: Uplink krait ammo. * - add: ContextMenuInteractionBlockerComponent. * - tweak: Update development config. * - fix: Folder naming. * - add: More logic. --- .../ContextMenu/UI/EntityMenuUIController.cs | 51 ++++++++++++++++-- .../ContextMenuInteractionBlockerComponent.cs | 6 +++ .../ConfigPresets/Build/development.toml | 6 +++ Resources/Locale/ru-RU/_white/white-shit.ftl | 2 +- .../Locale/ru-RU/store/uplink-catalog.ftl | 6 +++ .../Prototypes/Entities/Mobs/NPCs/animals.yml | 2 +- .../Objects/Specific/Medical/hypospray.yml | 5 ++ .../Prototypes/_White/Catalog/uplink.yml | 20 +++++++ .../_White/Entities/Cult/Items/hands.yml | 1 + .../bike_horn.rsi/equipped-BELT.png | Bin .../bike_horn.rsi/icon.png | Bin .../bike_horn.rsi/inhand-left.png | Bin .../bike_horn.rsi/inhand-right.png | Bin .../bike_horn.rsi/meta.json | 0 .../otherinstruments.rsi/banana_phone.png | Bin .../otherinstruments.rsi/bike_horn.png | Bin .../otherinstruments.rsi/birdtoy.png | Bin .../otherinstruments.rsi/cannedapplause.png | Bin .../otherinstruments.rsi/drum.png | Bin .../otherinstruments.rsi/drum_bongo.png | Bin .../otherinstruments.rsi/drum_makeshift.png | Bin .../otherinstruments.rsi/helicopter.png | Bin .../otherinstruments.rsi/meta.json | 0 .../otherinstruments.rsi/red_phone.png | Bin .../otherinstruments.rsi/seashell.png | Bin 25 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 Content.Shared/_White/Item/ContextMenuInteractionBlockerComponent.cs rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/bike_horn.rsi/equipped-BELT.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/bike_horn.rsi/icon.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/bike_horn.rsi/inhand-left.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/bike_horn.rsi/inhand-right.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/bike_horn.rsi/meta.json (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/banana_phone.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/bike_horn.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/birdtoy.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/cannedapplause.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/drum.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/drum_bongo.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/drum_makeshift.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/helicopter.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/meta.json (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/red_phone.png (100%) rename Resources/Textures/White/Objects/Fun/{instruments => Instruments}/otherinstruments.rsi/seashell.png (100%) diff --git a/Content.Client/ContextMenu/UI/EntityMenuUIController.cs b/Content.Client/ContextMenu/UI/EntityMenuUIController.cs index 227d9b05ae..6fbb14bac0 100644 --- a/Content.Client/ContextMenu/UI/EntityMenuUIController.cs +++ b/Content.Client/ContextMenu/UI/EntityMenuUIController.cs @@ -1,16 +1,22 @@ using System.Linq; using System.Numerics; +using Content.Client.Actions; using Content.Client.CombatMode; using Content.Client.Examine; using Content.Client.Gameplay; using Content.Client.Popups; +using Content.Client.UserInterface.Systems.Actions; using Content.Client.Verbs; using Content.Client.Verbs.UI; +using Content.Shared._White.Item; +using Content.Shared.Actions; using Content.Shared.CCVar; using Content.Shared.Examine; +using Content.Shared.Hands.Components; using Content.Shared.IdentityManagement; using Content.Shared.Input; using Content.Shared.Mobs.Components; +using Content.Shared.Ninja.Components; using Content.Shared.Popups; using Robust.Client.GameObjects; using Robust.Client.Graphics; @@ -48,12 +54,14 @@ namespace Content.Client.ContextMenu.UI [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly ContextMenuUIController _context = default!; [Dependency] private readonly VerbMenuUIController _verb = default!; + [Dependency] private readonly ActionUIController _controller = default!; // WD EDIT [UISystemDependency] private readonly VerbSystem _verbSystem = default!; [UISystemDependency] private readonly ExamineSystem _examineSystem = default!; [UISystemDependency] private readonly TransformSystem _xform = default!; [UISystemDependency] private readonly CombatModeSystem _combatMode = default!; [UISystemDependency] private readonly PopupSystem _popup = default!; // WD EDIT + [UISystemDependency] private readonly ActionsSystem _actions = default!; // WD EDIT private bool _updating; @@ -129,12 +137,8 @@ namespace Content.Client.ContextMenu.UI } // WD START - var localEntity = _playerManager.LocalEntity; - if (args.Function == EngineKeyFunctions.Use && - EntityManager.HasComponent(entity.Value) && entity.Value != localEntity) + if (args.Function == EngineKeyFunctions.Use && !CheckForUseBlocker(entity.Value)) { - _popup.PopupClient(Loc.GetString("context-menu-cant-interact"), - entity.Value, localEntity, PopupType.MediumCaution); _context.Close(); args.Handle(); return; @@ -176,6 +180,43 @@ namespace Content.Client.ContextMenu.UI } } + // WD START + private bool CheckForUseBlocker(EntityUid entity) + { + var localEntity = _playerManager.LocalEntity; + if (!EntityManager.TryGetComponent(localEntity, out HandsComponent? hands)) + return true; + + if (!EntityManager.HasComponent(entity) || entity == localEntity.Value) + return true; + + if (_controller.SelectingTargetFor is { } actionId && + _actions.TryGetActionData(actionId, out var baseAction) && baseAction is EntityTargetActionComponent) + { + InteractFailPopup(entity, localEntity.Value); + return false; + } + + var held = hands.ActiveHandEntity; + if (held != null) + { + if (!EntityManager.HasComponent(held.Value)) + return true; + } + else if (!EntityManager.HasComponent(localEntity.Value)) + return true; + + InteractFailPopup(entity, localEntity.Value); + return false; + } + + private void InteractFailPopup(EntityUid entity, EntityUid localEntity) + { + _popup.PopupClient(Loc.GetString("context-menu-cant-interact"), entity, localEntity, + PopupType.MediumCaution); + } + // WD END + private bool HandleOpenEntityMenu(in PointerInputCmdHandler.PointerInputCmdArgs args) { if (args.State != BoundKeyState.Down) diff --git a/Content.Shared/_White/Item/ContextMenuInteractionBlockerComponent.cs b/Content.Shared/_White/Item/ContextMenuInteractionBlockerComponent.cs new file mode 100644 index 0000000000..816c9f0411 --- /dev/null +++ b/Content.Shared/_White/Item/ContextMenuInteractionBlockerComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Shared._White.Item; + +[RegisterComponent] +public sealed partial class ContextMenuInteractionBlockerComponent : Component +{ +} diff --git a/Resources/ConfigPresets/Build/development.toml b/Resources/ConfigPresets/Build/development.toml index 2d2ee4a5a9..cadc8ef877 100644 --- a/Resources/ConfigPresets/Build/development.toml +++ b/Resources/ConfigPresets/Build/development.toml @@ -32,3 +32,9 @@ enabled = false [white] ert_load = false + +[stalin] +enabled = false + +[aspects] +enabled = false diff --git a/Resources/Locale/ru-RU/_white/white-shit.ftl b/Resources/Locale/ru-RU/_white/white-shit.ftl index 03839476dc..ca6ee2457e 100644 --- a/Resources/Locale/ru-RU/_white/white-shit.ftl +++ b/Resources/Locale/ru-RU/_white/white-shit.ftl @@ -23,4 +23,4 @@ alerts-blocked-name = Атака заблокирована alerts-blocked-desc = Невозможно блокировать некоторое время. melee-block-component-delay = Может блокировать атаку ближнего боя каждые {$delay} секунд. -context-menu-cant-interact = Невозможно взаимодействовать через контекстное меню! +context-menu-cant-interact = Невозможно взаимодействовать этим через контекстное меню! diff --git a/Resources/Locale/ru-RU/store/uplink-catalog.ftl b/Resources/Locale/ru-RU/store/uplink-catalog.ftl index d04c337310..46f173f9db 100644 --- a/Resources/Locale/ru-RU/store/uplink-catalog.ftl +++ b/Resources/Locale/ru-RU/store/uplink-catalog.ftl @@ -118,6 +118,12 @@ uplink-pistol-box-desc = Содержит 3 магазина на 10 патро uplink-pistol-box-caseless-name = Коробка с пистолетными магазинами (.25 безгильзовые) uplink-pistol-box-caseless-desc = Содержит 3 магазина на 10 патронов. Совместимо с Коброй. +uplink-grenade-blast-name = Фугасная граната +uplink-grenade-blast-desc = Маленький радиус поражения, большая мощность взрыва. Совместимо с Крайтом. + +uplink-grenade-frag-name = Осколочная граната +uplink-grenade-frag-desc = Большой радиус поражения, маленькая мощность взрыва. Совместимо с Крайтом. + # Utility uplink-holopara-kit-name = Набор Голопаразита uplink-holopara-kit-desc = diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 87c0800201..ec6160531b 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -98,7 +98,7 @@ - type: MobThresholds thresholds: 0: Alive - 10: Dead + 5: Dead - type: Stamina critThreshold: 10 - type: DamageStateVisuals diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml index 928f23a541..fe4b9cf0ca 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml @@ -28,6 +28,7 @@ - HighRiskItem - type: StealTarget stealGroup: Hypospray + - type: ContextMenuInteractionBlocker - type: entity name: gorlex hypospray @@ -52,6 +53,7 @@ onlyAffectsMobs: false - type: UseDelay delay: 0.5 + - type: ContextMenuInteractionBlocker - type: entity name: borghypo @@ -76,6 +78,7 @@ onlyAffectsMobs: false - type: UseDelay delay: 0.5 + - type: ContextMenuInteractionBlocker - type: entity name: experimental hypospray @@ -132,6 +135,7 @@ price: 75 # These are limited supply items. - type: TrashOnSolutionEmpty solution: pen + - type: ContextMenuInteractionBlocker - type: entity name: emergency medipen @@ -465,6 +469,7 @@ delay: 0.5 - type: StaticPrice # A new shitcurity meta price: 75 + - type: ContextMenuInteractionBlocker - type: entity parent: BaseItem diff --git a/Resources/Prototypes/_White/Catalog/uplink.yml b/Resources/Prototypes/_White/Catalog/uplink.yml index fbf1470776..2cdad02829 100644 --- a/Resources/Prototypes/_White/Catalog/uplink.yml +++ b/Resources/Prototypes/_White/Catalog/uplink.yml @@ -252,6 +252,26 @@ categories: - UplinkAmmo +- type: listing + id: UplinkGrendeBlast + name: uplink-grenade-blast-name + description: uplink-grenade-blast-desc + productEntity: GrenadeBlast + cost: + Telecrystal: 2 + categories: + - UplinkAmmo + +- type: listing + id: UplinkGrendeFrag + name: uplink-grenade-frag-name + description: uplink-grenade-frag-desc + productEntity: GrenadeFrag + cost: + Telecrystal: 2 + categories: + - UplinkAmmo + - type: listing id: UplinkMindSlaveImplanter name: uplink-mind-slave diff --git a/Resources/Prototypes/_White/Entities/Cult/Items/hands.yml b/Resources/Prototypes/_White/Entities/Cult/Items/hands.yml index 1d217d0ed3..90788bfca5 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Items/hands.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Items/hands.yml @@ -14,6 +14,7 @@ deleteOnDrop: true - type: CultItem canPickUp: false + - type: ContextMenuInteractionBlocker - type: entity parent: BaseCultHand diff --git a/Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/equipped-BELT.png b/Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/equipped-BELT.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/equipped-BELT.png rename to Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/equipped-BELT.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/icon.png b/Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/icon.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/icon.png rename to Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/icon.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/inhand-left.png b/Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/inhand-left.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/inhand-left.png rename to Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/inhand-left.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/inhand-right.png b/Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/inhand-right.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/inhand-right.png rename to Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/inhand-right.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/meta.json b/Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/meta.json similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/bike_horn.rsi/meta.json rename to Resources/Textures/White/Objects/Fun/Instruments/bike_horn.rsi/meta.json diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/banana_phone.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/banana_phone.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/banana_phone.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/banana_phone.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/bike_horn.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/bike_horn.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/bike_horn.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/bike_horn.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/birdtoy.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/birdtoy.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/birdtoy.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/birdtoy.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/cannedapplause.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/cannedapplause.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/cannedapplause.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/cannedapplause.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum_bongo.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum_bongo.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum_bongo.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum_bongo.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum_makeshift.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum_makeshift.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/drum_makeshift.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/drum_makeshift.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/helicopter.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/helicopter.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/helicopter.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/helicopter.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/meta.json b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/meta.json similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/meta.json rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/meta.json diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/red_phone.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/red_phone.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/red_phone.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/red_phone.png diff --git a/Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/seashell.png b/Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/seashell.png similarity index 100% rename from Resources/Textures/White/Objects/Fun/instruments/otherinstruments.rsi/seashell.png rename to Resources/Textures/White/Objects/Fun/Instruments/otherinstruments.rsi/seashell.png