diff --git a/EndlessClient/Controllers/NPCInteractionController.cs b/EndlessClient/Controllers/NPCInteractionController.cs index 9f1c30be3..5d5a4e27d 100644 --- a/EndlessClient/Controllers/NPCInteractionController.cs +++ b/EndlessClient/Controllers/NPCInteractionController.cs @@ -1,10 +1,12 @@ using AutomaticTypeMapper; using EndlessClient.Dialogs; using EndlessClient.Dialogs.Actions; +using EndlessClient.HUD; using EndlessClient.Input; using EOLib.Domain.Interact; using EOLib.Domain.NPC; using EOLib.IO.Repositories; +using EOLib.Localization; using System.Linq; namespace EndlessClient.Controllers @@ -14,18 +16,21 @@ public class NPCInteractionController : INPCInteractionController { private readonly IMapNPCActions _mapNpcActions; private readonly IInGameDialogActions _inGameDialogActions; + private readonly IStatusLabelSetter _statusLabelSetter; private readonly IENFFileProvider _enfFileProvider; private readonly IActiveDialogProvider _activeDialogProvider; private readonly IUserInputRepository _userInputRepository; public NPCInteractionController(IMapNPCActions mapNpcActions, IInGameDialogActions inGameDialogActions, + IStatusLabelSetter statusLabelSetter, IENFFileProvider enfFileProvider, IActiveDialogProvider activeDialogProvider, IUserInputRepository userInputRepository) { _mapNpcActions = mapNpcActions; _inGameDialogActions = inGameDialogActions; + _statusLabelSetter = statusLabelSetter; _enfFileProvider = enfFileProvider; _activeDialogProvider = activeDialogProvider; _userInputRepository = userInputRepository; @@ -38,6 +43,9 @@ public void ShowNPCDialog(INPC npc) var data = _enfFileProvider.ENFFile[npc.ID]; + // there is no "NPC" text in the localized files + _statusLabelSetter.SetStatusLabel($"[ NPC ] {data.Name}"); + switch(data.Type) { case EOLib.IO.NPCType.Shop: diff --git a/EndlessClient/HUD/IStatusLabelSetter.cs b/EndlessClient/HUD/IStatusLabelSetter.cs index bae49c721..424789e7b 100644 --- a/EndlessClient/HUD/IStatusLabelSetter.cs +++ b/EndlessClient/HUD/IStatusLabelSetter.cs @@ -1,13 +1,16 @@ -using EOLib.Localization; +using EOLib.Domain.Interact.Quest; +using EOLib.Localization; namespace EndlessClient.HUD { - public interface IStatusLabelSetter + public interface IStatusLabelSetter : IStatusLabelNotifier { void SetStatusLabel(EOResourceID type, EOResourceID text, string appended = ""); void SetStatusLabel(EOResourceID type, string prepended, EOResourceID text); void SetStatusLabel(EOResourceID type, string text); + + void SetStatusLabel(string text); } } diff --git a/EndlessClient/HUD/StatusLabelSetter.cs b/EndlessClient/HUD/StatusLabelSetter.cs index 8627bc17a..c36de056a 100644 --- a/EndlessClient/HUD/StatusLabelSetter.cs +++ b/EndlessClient/HUD/StatusLabelSetter.cs @@ -1,12 +1,11 @@ using System; using AutomaticTypeMapper; -using EOLib.Domain.Interact.Quest; using EOLib.Localization; namespace EndlessClient.HUD { [AutoMappedType] - public class StatusLabelSetter : IStatusLabelSetter, IStatusLabelNotifier + public class StatusLabelSetter : IStatusLabelSetter { private readonly IStatusLabelTextRepository _statusLabelTextRepository; private readonly ILocalizedStringFinder _localizedStringFinder; @@ -41,6 +40,12 @@ public void SetStatusLabel(EOResourceID type, string text) SetStatusLabelText(_localizedStringFinder.GetString(type), text); } + public void SetStatusLabel(string text) + { + _statusLabelTextRepository.StatusText = text; + _statusLabelTextRepository.SetTime = DateTime.Now; + } + public void ShowWarning(string message) { SetStatusLabel(EOResourceID.STATUS_LABEL_TYPE_WARNING, message);