kinda fixes
This commit is contained in:
@@ -452,7 +452,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
|
||||
if (backPack != null)
|
||||
{
|
||||
_storageSystem.Insert(backPack.Value, itemEntity);
|
||||
_storageSystem.Insert(backPack.Value, itemEntity, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,10 +462,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
|
||||
_chatManager.DispatchServerMessage(cultist, Loc.GetString("cult-role-greeting"));
|
||||
|
||||
if (_prototypeManager.TryIndex<ObjectivePrototype>("CultistKillObjective", out var cultistObjective))
|
||||
{
|
||||
_mindSystem.TryAddObjective(mind.Value, mindComponent,cultistObjective);
|
||||
}
|
||||
_mindSystem.TryAddObjective(mind.Value, mindComponent, "CultistKillObjective");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.White.Cult.Items.Components;
|
||||
public sealed partial class TorchCultistsProviderComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CultTeleporterUiKey.Key);
|
||||
public Enum UserInterfaceKey = CultTeleporterUiKey.Key;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public EntityUid? ItemSelected;
|
||||
|
||||
@@ -95,7 +95,9 @@ public sealed class TorchCultistsProviderSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (provider.UserInterface == null)
|
||||
var ui = _ui.GetUiOrNull(uid, comp.UserInterfaceKey);
|
||||
|
||||
if (ui == null)
|
||||
return;
|
||||
|
||||
provider.ItemSelected = args.Target;
|
||||
@@ -120,12 +122,12 @@ public sealed class TorchCultistsProviderSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
UserInterfaceSystem.SetUiState(provider.UserInterface, new TorchWindowBUIState(list));
|
||||
_ui.SetUiState(ui, new TorchWindowBUIState(list));
|
||||
|
||||
if (!TryComp<ActorComponent>(args.User, out var actorComponent))
|
||||
return;
|
||||
|
||||
_ui.ToggleUi(provider.UserInterface, actorComponent.PlayerSession);
|
||||
_ui.ToggleUi(ui, actorComponent.PlayerSession);
|
||||
}
|
||||
|
||||
private void OnCultistSelected(
|
||||
|
||||
@@ -135,7 +135,9 @@ public sealed class VoidTeleportSystem : EntitySystem
|
||||
private void CreatePulse(EntityUid uid, VoidTeleportComponent component)
|
||||
{
|
||||
if (TryComp<PointLightComponent>(uid, out var light))
|
||||
#pragma warning disable RA0002
|
||||
light.Energy = 5f;
|
||||
#pragma warning restore RA0002
|
||||
|
||||
Timer.Spawn(component.TimerDelay, () => TurnOffPulse(uid, component), component.Token.Token);
|
||||
}
|
||||
@@ -145,7 +147,9 @@ public sealed class VoidTeleportSystem : EntitySystem
|
||||
if (!TryComp<PointLightComponent>(uid, out var light))
|
||||
return;
|
||||
|
||||
#pragma warning disable RA0002
|
||||
light.Energy = 1f;
|
||||
#pragma warning restore RA0002
|
||||
|
||||
comp.Token = new CancellationTokenSource();
|
||||
|
||||
@@ -154,7 +158,9 @@ public sealed class VoidTeleportSystem : EntitySystem
|
||||
comp.Active = false;
|
||||
UpdateAppearance(uid, comp);
|
||||
|
||||
#pragma warning disable RA0002
|
||||
light.Enabled = false;
|
||||
#pragma warning restore RA0002
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,9 @@ public sealed class PylonSystem : EntitySystem
|
||||
if (!TryComp<PointLightComponent>(uid, out var light))
|
||||
return;
|
||||
|
||||
#pragma warning disable RA0002
|
||||
light.Enabled = comp.Activated;
|
||||
#pragma warning restore RA0002
|
||||
|
||||
var toggleMsg = Loc.GetString(comp.Activated ? "pylon-toggle-on" : "pylon-toggle-off");
|
||||
_popupSystem.PopupEntity(toggleMsg, uid);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Shared.White.Cult;
|
||||
public sealed partial class RuneDrawerProviderComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(ListViewSelectorUiKey.Key);
|
||||
public Enum UserInterfaceKey = ListViewSelectorUiKey.Key;
|
||||
|
||||
[DataField("runePrototypes")]
|
||||
public List<string> RunePrototypes = new();
|
||||
|
||||
@@ -25,14 +25,18 @@ public partial class CultSystem
|
||||
|
||||
private void OnShellSelected(EntityUid uid, ConstructShellComponent component, ConstructFormSelectedEvent args)
|
||||
{
|
||||
var construct = Spawn(args.SelectedForm, Transform(args.Entity).MapPosition);
|
||||
var mind = Comp<MindContainerComponent>(args.Session.AttachedEntity!.Value);
|
||||
if (args.Session.AttachedEntity != null)
|
||||
{
|
||||
var construct = Spawn(args.SelectedForm, Transform(args.Session.AttachedEntity.Value).MapPosition);
|
||||
var mind = Comp<MindContainerComponent>(args.Session.AttachedEntity!.Value);
|
||||
|
||||
if(!mind.HasMind)
|
||||
return;
|
||||
if(!mind.HasMind)
|
||||
return;
|
||||
|
||||
_mindSystem.TransferTo(mind.Mind.Value, construct);
|
||||
Del(args.Entity);
|
||||
_mindSystem.TransferTo(mind.Mind.Value, construct);
|
||||
}
|
||||
|
||||
Del(args.Session.AttachedEntity);
|
||||
}
|
||||
|
||||
private void OnShellInit(EntityUid uid, ConstructShellComponent component, ComponentInit args)
|
||||
|
||||
@@ -135,7 +135,7 @@ public sealed partial class CultSystem : EntitySystem
|
||||
|
||||
private void OnRuneDrawerUseInHand(EntityUid uid, RuneDrawerProviderComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (component.UserInterface == null)
|
||||
if (!_ui.TryGetUi(uid, component.UserInterfaceKey, out _))
|
||||
return;
|
||||
|
||||
if (!TryComp<ActorComponent>(args.User, out var actorComponent))
|
||||
|
||||
@@ -25,10 +25,10 @@ public sealed class CultStructureCraftSystem : EntitySystem
|
||||
if (!_playerManager.TryGetSessionByEntity(args.User, out var session) || session is not IPlayerSession playerSession)
|
||||
return;
|
||||
|
||||
if (component.UserInterface != null)
|
||||
if (_uiSystem.TryGetUi(uid, component.UserInterfaceKey, out var bui))
|
||||
{
|
||||
_uiSystem.CloseUi(component.UserInterface, playerSession);
|
||||
_uiSystem.OpenUi(component.UserInterface, playerSession);
|
||||
_uiSystem.CloseUi(bui, playerSession);
|
||||
_uiSystem.OpenUi(bui, playerSession);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.White.Cult.Structures;
|
||||
public sealed partial class RunicMetalComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CultStructureCraftUiKey.Key);
|
||||
public Enum UserInterfaceKey = CultStructureCraftUiKey.Key;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("delay")]
|
||||
public float Delay = 1;
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed partial class CultistFactoryComponent : Component
|
||||
[DataField("products", customTypeSerializer: typeof(PrototypeIdListSerializer<CultistFactoryProductionPrototype>))]
|
||||
public IReadOnlyCollection<string> Products = ArraySegment<string>.Empty;
|
||||
|
||||
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CultistAltarUiKey.Key);
|
||||
public Enum UserInterfaceKey = CultistAltarUiKey.Key;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public bool Active = true;
|
||||
|
||||
@@ -81,7 +81,7 @@ public sealed class CultistFactorySystem : EntitySystem
|
||||
|
||||
if (_ui.TryGetUi(uid, CultistAltarUiKey.Key, out var bui))
|
||||
{
|
||||
UserInterfaceSystem.SetUiState(bui, new CultistFactoryBUIState(component.Products));
|
||||
_ui.SetUiState(bui, new CultistFactoryBUIState(component.Products));
|
||||
_ui.OpenUi(bui, actor.PlayerSession);
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public sealed class CultistFactorySystem : EntitySystem
|
||||
|
||||
var xform = Transform(uid);
|
||||
var ev = new CultAnchorDoAfterEvent(xform.Anchored);
|
||||
var doArgs = new DoAfterArgs(user, time, ev, uid, uid);
|
||||
var doArgs = new DoAfterArgs(_entityManager, user, time, ev, uid, uid);
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doArgs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user