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:
@@ -96,7 +96,7 @@ public sealed class GasCanisterSystem : EntitySystem
|
||||
tankPressure = tankComponent.Air.Pressure;
|
||||
}
|
||||
|
||||
_ui.TrySetUiState(uid, GasCanisterUiKey.Key,
|
||||
_ui.SetUiState(uid, GasCanisterUiKey.Key,
|
||||
new GasCanisterBoundUserInterfaceState(Name(uid),
|
||||
canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure,
|
||||
canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure));
|
||||
@@ -104,19 +104,19 @@ public sealed class GasCanisterSystem : EntitySystem
|
||||
|
||||
private void OnHoldingTankEjectMessage(EntityUid uid, GasCanisterComponent canister, GasCanisterHoldingTankEjectMessage args)
|
||||
{
|
||||
if (canister.GasTankSlot.Item == null || args.Session.AttachedEntity == null)
|
||||
if (canister.GasTankSlot.Item == null)
|
||||
return;
|
||||
|
||||
var item = canister.GasTankSlot.Item;
|
||||
_slots.TryEjectToHands(uid, canister.GasTankSlot, args.Session.AttachedEntity);
|
||||
_adminLogger.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} ejected tank {ToPrettyString(item):tank} from {ToPrettyString(uid):canister}");
|
||||
_slots.TryEjectToHands(uid, canister.GasTankSlot, args.Actor);
|
||||
_adminLogger.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Actor):player} ejected tank {ToPrettyString(item):tank} from {ToPrettyString(uid):canister}");
|
||||
}
|
||||
|
||||
private void OnCanisterChangeReleasePressure(EntityUid uid, GasCanisterComponent canister, GasCanisterChangeReleasePressureMessage args)
|
||||
{
|
||||
var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure);
|
||||
|
||||
_adminLogger.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
|
||||
_adminLogger.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Actor):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
|
||||
|
||||
canister.ReleasePressure = pressure;
|
||||
DirtyUI(uid, canister);
|
||||
@@ -129,14 +129,14 @@ public sealed class GasCanisterSystem : EntitySystem
|
||||
impact = canister.GasTankSlot.HasItem ? LogImpact.Medium : LogImpact.High;
|
||||
|
||||
var containedGasDict = new Dictionary<Gas, float>();
|
||||
var containedGasArray = Gas.GetValues(typeof(Gas));
|
||||
var containedGasArray = Enum.GetValues(typeof(Gas));
|
||||
|
||||
for (int i = 0; i < containedGasArray.Length; i++)
|
||||
{
|
||||
containedGasDict.Add((Gas)i, canister.Air[i]);
|
||||
}
|
||||
|
||||
_adminLogger.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState} while it contained [{string.Join(", ", containedGasDict)}]");
|
||||
_adminLogger.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Actor):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState} while it contained [{string.Join(", ", containedGasDict)}]");
|
||||
|
||||
canister.ReleaseValve = args.Valve;
|
||||
DirtyUI(uid, canister);
|
||||
@@ -212,7 +212,7 @@ public sealed class GasCanisterSystem : EntitySystem
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
_ui.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
|
||||
_ui.OpenUi(uid, GasCanisterUiKey.Key, actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public sealed class GasCanisterSystem : EntitySystem
|
||||
if (CheckLocked(uid, component, args.User))
|
||||
return;
|
||||
|
||||
_ui.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
|
||||
_ui.OpenUi(uid, GasCanisterUiKey.Key, actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user