-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert `Storage UI V2` Storage UI v2 has been a buggy and infuriating mess to use. This idea needs additional polish before it is ready. I think we should go ahead and remove it until that point, to alleviate further aggrevation. Signed-off-by: Michael Shaw <michaelsshaw44@gmail.com> * storage: remove unused cvars --------- Signed-off-by: Michael Shaw <michaelsshaw44@gmail.com>
- Loading branch information
1 parent
26c9688
commit 94dcefd
Showing
13 changed files
with
396 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,37 @@ | ||
using Content.Client.UserInterface.Systems.Storage; | ||
using Content.Client.UserInterface.Systems.Storage.Controls; | ||
using Content.Client.Storage.Systems; | ||
using Content.Shared.Storage; | ||
using JetBrains.Annotations; | ||
using Robust.Client.UserInterface; | ||
|
||
namespace Content.Client.Storage; | ||
|
||
[UsedImplicitly] | ||
public sealed class StorageBoundUserInterface : BoundUserInterface | ||
{ | ||
private StorageWindow? _window; | ||
[Dependency] private readonly IEntityManager _entManager = default!; | ||
|
||
private readonly StorageSystem _storage; | ||
|
||
public StorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_storage = _entManager.System<StorageSystem>(); | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
_window = IoCManager.Resolve<IUserInterfaceManager>() | ||
.GetUIController<StorageUIController>() | ||
.CreateStorageWindow(Owner); | ||
|
||
if (EntMan.TryGetComponent(Owner, out StorageComponent? storage)) | ||
{ | ||
_window.UpdateContainer((Owner, storage)); | ||
} | ||
|
||
_window.OnClose += Close; | ||
_window.FlagDirty(); | ||
} | ||
|
||
public void Refresh() | ||
{ | ||
_window?.FlagDirty(); | ||
} | ||
|
||
public void Reclaim() | ||
{ | ||
if (_window == null) | ||
return; | ||
|
||
_window.OnClose -= Close; | ||
_window.Orphan(); | ||
_window = null; | ||
if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp)) | ||
_storage.OpenStorageWindow((Owner, comp)); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
|
||
Reclaim(); | ||
} | ||
|
||
public void Hide() | ||
{ | ||
if (_window == null) | ||
if (!disposing) | ||
return; | ||
|
||
_window.Visible = false; | ||
} | ||
|
||
public void Show() | ||
{ | ||
if (_window == null) | ||
return; | ||
|
||
_window.Visible = true; | ||
} | ||
|
||
public void ReOpen() | ||
{ | ||
_window?.Orphan(); | ||
_window = null; | ||
Open(); | ||
_storage.CloseStorageWindow(Owner); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.