Content update for UI prediction (#27214)

* Content update for UI refactor

* Big update

* Sharing

* Remaining content updates

* First big update

* Prototype updates

* AUGH

* Fix UI comp ref

* Cleanup

- Fix predicted message, fix item slots, fix interaction range check.

* Fix regressions

* Make this predictive

idk why it wasn't.

* Fix slime merge

* Merge conflict

* Fix merge
This commit is contained in:
metalgearsloth
2024-04-26 18:16:24 +10:00
committed by GitHub
parent 32b81de8c5
commit 5896e68752
279 changed files with 1308 additions and 1582 deletions

View File

@@ -41,17 +41,14 @@ public sealed partial class VoiceMaskSystem : EntitySystem
{
if (message.Name.Length > HumanoidCharacterProfile.MaxNameLength || message.Name.Length <= 0)
{
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-failure"), uid, message.Session, PopupType.SmallCaution);
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-failure"), uid, message.Actor, PopupType.SmallCaution);
return;
}
component.VoiceName = message.Name;
if (message.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} set voice of {ToPrettyString(uid):mask}: {component.VoiceName}");
else
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"Voice of {ToPrettyString(uid):mask} set: {component.VoiceName}");
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(message.Actor):player} set voice of {ToPrettyString(uid):mask}: {component.VoiceName}");
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), uid, message.Session);
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), uid, message.Actor);
TrySetLastKnownName(uid, message.Name);
@@ -66,7 +63,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
ent.Comp.SpeechVerb = msg.Verb;
// verb is only important to metagamers so no need to log as opposed to name
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), ent, msg.Session);
_popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), ent, msg.Actor);
TrySetLastSpeechVerb(ent, msg.Verb);
@@ -94,14 +91,12 @@ public sealed partial class VoiceMaskSystem : EntitySystem
ent.Comp.Enabled = !args.IsToggled;
}
private void OpenUI(EntityUid player, ActorComponent? actor = null)
private void OpenUI(EntityUid player)
{
if (!Resolve(player, ref actor))
return;
if (!_uiSystem.TryGetUi(player, VoiceMaskUIKey.Key, out var bui))
if (!_uiSystem.HasUi(player, VoiceMaskUIKey.Key))
return;
_uiSystem.OpenUi(bui, actor.PlayerSession);
_uiSystem.OpenUi(player, VoiceMaskUIKey.Key, player);
UpdateUI(player);
}
@@ -112,7 +107,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
return;
}
if (_uiSystem.TryGetUi(owner, VoiceMaskUIKey.Key, out var bui))
_uiSystem.SetUiState(bui, new VoiceMaskBuiState(component.VoiceName, component.SpeechVerb));
if (_uiSystem.HasUi(owner, VoiceMaskUIKey.Key))
_uiSystem.SetUiState(owner, VoiceMaskUIKey.Key, new VoiceMaskBuiState(component.VoiceName, component.SpeechVerb));
}
}