From 03347ed416c3859ba05d15e9e3ddf5ab110625cc Mon Sep 17 00:00:00 2001 From: Coryn Date: Thu, 27 Aug 2026 21:26:07 +0200 Subject: [PATCH] Inverse Labels and Handlabeler menu (#6432) Merge pull request #1120 from oooielp/label-invert (#783) Co-authored-by: Khaomi <46065349+Khaomi@users.noreply.github.com> Co-authored-by: Superlagg --- .../UI/HandLabelerBoundUserInterface.cs | 14 ++- .../Labels/UI/HandLabelerWindow.xaml | 18 +++- .../Labels/UI/HandLabelerWindow.xaml.cs | 101 +++++++++++++++++- .../Labels/EntitySystems/LabelSystem.cs | 2 +- .../_Starlight/CCVar/StarlightCCVar.cs | 10 ++ .../CCVar/StarlightCCVars.Interface.cs | 13 +++ .../_Starlight/hand-labeler/hand-labeler.ftl | 12 +++ .../Locale/en-US/label/label-component.ftl | 3 +- 8 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 Content.Shared/_Starlight/CCVar/StarlightCCVar.cs create mode 100644 Content.Shared/_Starlight/CCVar/StarlightCCVars.Interface.cs create mode 100644 Resources/Locale/en-US/_Starlight/hand-labeler/hand-labeler.ftl diff --git a/Content.Client/Labels/UI/HandLabelerBoundUserInterface.cs b/Content.Client/Labels/UI/HandLabelerBoundUserInterface.cs index 95d5cc7ab32..8cab1a42664 100644 --- a/Content.Client/Labels/UI/HandLabelerBoundUserInterface.cs +++ b/Content.Client/Labels/UI/HandLabelerBoundUserInterface.cs @@ -32,10 +32,10 @@ namespace Content.Client.Labels.UI } _window.OnLabelChanged += OnLabelChanged; + _window.OnLabelSelected += OnLabelSelected; // Starlight Reload(); _window.SetInitialLabelState(); // Must be after Reload() has set the label text } - private void OnLabelChanged(string newLabel) { // Focus moment @@ -45,7 +45,17 @@ namespace Content.Client.Labels.UI SendPredictedMessage(new HandLabelerLabelChangedMessage(newLabel)); } - + // Starlight start + private void OnLabelSelected(string label) + { + // Update UI and send message to sync with server + if (_window != null) + { + _window.SetCurrentLabel(label); + } + SendPredictedMessage(new HandLabelerLabelChangedMessage(label)); + } + // Starlight End public void Reload() { if (_window == null || !_entManager.TryGetComponent(Owner, out HandLabelerComponent? component)) diff --git a/Content.Client/Labels/UI/HandLabelerWindow.xaml b/Content.Client/Labels/UI/HandLabelerWindow.xaml index 7bbadb843d6..4a00420aeef 100644 --- a/Content.Client/Labels/UI/HandLabelerWindow.xaml +++ b/Content.Client/Labels/UI/HandLabelerWindow.xaml @@ -1,8 +1,10 @@ + MinWidth="150" + SetHeight="400">