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
2 changes: 1 addition & 1 deletion OpenDreamClient/DreamClientSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public override void Initialize() {
private void OnPlayerAttached(LocalPlayerAttachedEvent e) {
// The active input context gets reset to "common" when a new player is attached
// So we have to set it again
_interfaceManager.DefaultWindow?.Macro.SetActive();
_interfaceManager.DefaultWindow?.Macro?.SetActive();
}
}
4 changes: 2 additions & 2 deletions OpenDreamClient/Interface/Controls/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed class ControlWindow : InterfaceControl {
public readonly List<InterfaceControl> ChildControls = new();

public string Title => WindowDescriptor.Title.Value;
public InterfaceMacroSet Macro => _interfaceManager.MacroSets[WindowDescriptor.Macro.AsRaw()];
public InterfaceMacroSet? Macro => _interfaceManager.MacroSets.GetValueOrDefault(WindowDescriptor.Macro.AsRaw());

private WindowDescriptor WindowDescriptor => (WindowDescriptor)ElementDescriptor;

Expand Down Expand Up @@ -54,7 +54,7 @@ protected override void UpdateElementDescriptor() {
UpdateWindowAttributes(_myWindow);

if (WindowDescriptor.IsDefault.Value) {
Macro.SetActive();
Macro?.SetActive();
}
}

Expand Down
Loading