Add mapping editor (#23427)

* Add mapping editor (#757)

* Remove mapping actions, never again

* Cleanup actions system

* Jarvis, remove all references to CM14

* Fix InventoryUIController crashing when an InventoryGui is not found

* Rename mapping1 to mapping

* Clean up context calls

* Add doc comments

* Add delegate for hiding decals in the mapping screen

* Jarvis mission failed

* a

* Add test

* Fix not flushing save stream in mapping manager

* change

* Fix verbs

* fixes

* localise

---------

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
DrSmugleaf
2024-08-03 20:31:45 -07:00
committed by GitHub
parent 6e8f8d706a
commit 54d5bd266c
37 changed files with 2024 additions and 47 deletions

View File

@@ -3,6 +3,7 @@ using System.Numerics;
using Content.Client.CombatMode;
using Content.Client.ContextMenu.UI;
using Content.Client.Gameplay;
using Content.Client.Mapping;
using Content.Shared.Input;
using Content.Shared.Verbs;
using Robust.Client.Player;
@@ -22,7 +23,9 @@ namespace Content.Client.Verbs.UI
/// open a verb menu for a given entity, add verbs to it, and add server-verbs when the server response is
/// received.
/// </remarks>
public sealed class VerbMenuUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>
public sealed class VerbMenuUIController : UIController,
IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>,
IOnStateEntered<MappingState>, IOnStateExited<MappingState>
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly ContextMenuUIController _context = default!;
@@ -44,7 +47,6 @@ namespace Content.Client.Verbs.UI
{
_context.OnContextKeyEvent += OnKeyBindDown;
_context.OnContextClosed += Close;
_verbSystem.OnVerbsResponse += HandleVerbsResponse;
}
public void OnStateExited(GameplayState state)
@@ -56,6 +58,17 @@ namespace Content.Client.Verbs.UI
Close();
}
public void OnStateEntered(MappingState state)
{
_verbSystem.OnVerbsResponse += HandleVerbsResponse;
}
public void OnStateExited(MappingState state)
{
if (_verbSystem != null)
_verbSystem.OnVerbsResponse -= HandleVerbsResponse;
}
/// <summary>
/// Open a verb menu and fill it with verbs applicable to the given target entity.
/// </summary>