mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-03 09:37:27 +00:00
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
(cherry picked from commit 5896e68752)
This commit is contained in:
@@ -219,7 +219,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
#region UI Handlers
|
||||
private void OnUiButtonPressed(EntityUid uid, SharedDisposalUnitComponent component, SharedDisposalUnitComponent.UiButtonPressedMessage args)
|
||||
{
|
||||
if (args.Session.AttachedEntity is not { Valid: true } player)
|
||||
if (args.Actor is not { Valid: true } player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} hit flush button on {ToPrettyString(uid)}, it's now {(component.Engaged ? "on" : "off")}");
|
||||
break;
|
||||
case SharedDisposalUnitComponent.UiButton.Power:
|
||||
_power.TogglePower(uid, user: args.Session.AttachedEntity);
|
||||
_power.TogglePower(uid, user: args.Actor);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException($"{ToPrettyString(player):player} attempted to hit a nonexistant button on {ToPrettyString(uid)}");
|
||||
@@ -268,7 +268,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
_ui.TryOpen(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
|
||||
_ui.OpenUi(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
|
||||
}
|
||||
|
||||
private void OnAfterInteractUsing(EntityUid uid, SharedDisposalUnitComponent component, AfterInteractUsingEvent args)
|
||||
@@ -597,7 +597,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
var compState = GetState(uid, component);
|
||||
var stateString = Loc.GetString($"disposal-unit-state-{compState}");
|
||||
var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(Name(uid), stateString, EstimatedFullPressure(uid, component), powered, component.Engaged);
|
||||
_ui.TrySetUiState(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, state);
|
||||
_ui.SetUiState(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, state);
|
||||
|
||||
var stateUpdatedEvent = new DisposalUnitUIStateUpdatedEvent(state);
|
||||
RaiseLocalEvent(uid, stateUpdatedEvent);
|
||||
@@ -802,10 +802,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
|
||||
QueueAutomaticEngage(uid, component);
|
||||
|
||||
if (TryComp(inserted, out ActorComponent? actor))
|
||||
{
|
||||
_ui.TryClose(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
|
||||
}
|
||||
_ui.CloseUi(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, inserted);
|
||||
|
||||
// Maybe do pullable instead? Eh still fine.
|
||||
Joints.RecursiveClearJoints(inserted);
|
||||
|
||||
Reference in New Issue
Block a user