Set default PDA uplink and music visibility to false (#28373)
* Set PDA uplink and music default visibility to false #27376 seems to be the PDA receiving state before first PDA UI open * Log error on PDA state received before first open * Fix logging * Fix error message --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -4,18 +4,20 @@ using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.PDA;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Client.PDA
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class PdaBoundUserInterface : CartridgeLoaderBoundUserInterface
|
||||
{
|
||||
private readonly PdaSystem _pdaSystem;
|
||||
|
||||
[ViewVariables]
|
||||
private PdaMenu? _menu;
|
||||
|
||||
public PdaBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
_pdaSystem = EntMan.System<PdaSystem>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -92,7 +94,13 @@ namespace Content.Client.PDA
|
||||
if (state is not PdaUpdateState updateState)
|
||||
return;
|
||||
|
||||
_menu?.UpdateState(updateState);
|
||||
if (_menu == null)
|
||||
{
|
||||
_pdaSystem.Log.Error("PDA state received before menu was created.");
|
||||
return;
|
||||
}
|
||||
|
||||
_menu.UpdateState(updateState);
|
||||
}
|
||||
|
||||
protected override void AttachCartridgeUI(Control cartridgeUIFragment, string? title)
|
||||
|
||||
@@ -67,14 +67,17 @@
|
||||
Description="{Loc 'comp-pda-ui-ringtone-button-description'}"/>
|
||||
<pda:PdaSettingsButton Name="ActivateMusicButton"
|
||||
Access="Public"
|
||||
Visible="False"
|
||||
Text="{Loc 'pda-bound-user-interface-music-button'}"
|
||||
Description="{Loc 'pda-bound-user-interface-music-button-description'}"/>
|
||||
<pda:PdaSettingsButton Name="ShowUplinkButton"
|
||||
Access="Public"
|
||||
Visible="False"
|
||||
Text="{Loc 'pda-bound-user-interface-show-uplink-title'}"
|
||||
Description="{Loc 'pda-bound-user-interface-show-uplink-description'}"/>
|
||||
<pda:PdaSettingsButton Name="LockUplinkButton"
|
||||
Access="Public"
|
||||
Visible="False"
|
||||
Text="{Loc 'pda-bound-user-interface-lock-uplink-title'}"
|
||||
Description="{Loc 'pda-bound-user-interface-lock-uplink-description'}"/>
|
||||
</BoxContainer>
|
||||
|
||||
Reference in New Issue
Block a user