Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Client.CartridgeLoader.Cartridges; // CorvaxGoob - fix-crew-manifest-open-refresh-v2
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -41,15 +42,26 @@ protected override void UpdateState(BoundUserInterfaceState state)

var activeUI = _entManager.GetEntity(loaderUiState.ActiveUI);

// CorvaxGoob Start - fix-crew-manifest-open-refresh-v2
// A reopened PDA can reuse its BUI, so refresh the attached manifest without recreating its controls.
if (_activeProgram == activeUI && _activeUiFragment is not null)
{
if (_activeCartridgeUI is CrewManifestUi && _activeProgram.HasValue)
SendCartridgeUiReadyEvent(_activeProgram.Value);

return;
}
// CorvaxGoob End

_activeProgram = activeUI;

var ui = RetrieveCartridgeUI(activeUI);
var comp = RetrieveCartridgeComponent(activeUI);
var control = ui?.GetUIFragmentRoot();

//Prevent the same UI fragment from getting disposed and attached multiple times
if (_activeUiFragment?.GetType() == control?.GetType())
return;
//if (_activeUiFragment?.GetType() == control?.GetType())
// return;

if (_activeUiFragment is not null)
DetachCartridgeUI(_activeUiFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void UpdateUiState(EntityUid uid, EntityUid loaderUid, CrewManifestCartr
if (!Resolve(uid, ref component))
return;

var owningStation = _stationSystem.GetOwningStation(uid);
var owningStation = _stationSystem.GetOwningStation(loaderUid); // CorvaxGoob Edit - fix-crew-manifest-open-refresh-v2

if (owningStation is null)
return;
Expand Down
Loading