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 Content.Shared.PDA;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Shared.Configuration;
|
|
||||||
|
|
||||||
namespace Content.Client.PDA
|
namespace Content.Client.PDA
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class PdaBoundUserInterface : CartridgeLoaderBoundUserInterface
|
public sealed class PdaBoundUserInterface : CartridgeLoaderBoundUserInterface
|
||||||
{
|
{
|
||||||
|
private readonly PdaSystem _pdaSystem;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private PdaMenu? _menu;
|
private PdaMenu? _menu;
|
||||||
|
|
||||||
public PdaBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
public PdaBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||||
{
|
{
|
||||||
|
_pdaSystem = EntMan.System<PdaSystem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Open()
|
protected override void Open()
|
||||||
@@ -92,7 +94,13 @@ namespace Content.Client.PDA
|
|||||||
if (state is not PdaUpdateState updateState)
|
if (state is not PdaUpdateState updateState)
|
||||||
return;
|
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)
|
protected override void AttachCartridgeUI(Control cartridgeUIFragment, string? title)
|
||||||
|
|||||||
@@ -67,14 +67,17 @@
|
|||||||
Description="{Loc 'comp-pda-ui-ringtone-button-description'}"/>
|
Description="{Loc 'comp-pda-ui-ringtone-button-description'}"/>
|
||||||
<pda:PdaSettingsButton Name="ActivateMusicButton"
|
<pda:PdaSettingsButton Name="ActivateMusicButton"
|
||||||
Access="Public"
|
Access="Public"
|
||||||
|
Visible="False"
|
||||||
Text="{Loc 'pda-bound-user-interface-music-button'}"
|
Text="{Loc 'pda-bound-user-interface-music-button'}"
|
||||||
Description="{Loc 'pda-bound-user-interface-music-button-description'}"/>
|
Description="{Loc 'pda-bound-user-interface-music-button-description'}"/>
|
||||||
<pda:PdaSettingsButton Name="ShowUplinkButton"
|
<pda:PdaSettingsButton Name="ShowUplinkButton"
|
||||||
Access="Public"
|
Access="Public"
|
||||||
|
Visible="False"
|
||||||
Text="{Loc 'pda-bound-user-interface-show-uplink-title'}"
|
Text="{Loc 'pda-bound-user-interface-show-uplink-title'}"
|
||||||
Description="{Loc 'pda-bound-user-interface-show-uplink-description'}"/>
|
Description="{Loc 'pda-bound-user-interface-show-uplink-description'}"/>
|
||||||
<pda:PdaSettingsButton Name="LockUplinkButton"
|
<pda:PdaSettingsButton Name="LockUplinkButton"
|
||||||
Access="Public"
|
Access="Public"
|
||||||
|
Visible="False"
|
||||||
Text="{Loc 'pda-bound-user-interface-lock-uplink-title'}"
|
Text="{Loc 'pda-bound-user-interface-lock-uplink-title'}"
|
||||||
Description="{Loc 'pda-bound-user-interface-lock-uplink-description'}"/>
|
Description="{Loc 'pda-bound-user-interface-lock-uplink-description'}"/>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user