Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruzihm committed Feb 23, 2025
1 parent b3b1b0e commit b4a31f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DMCompiler/DMCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private List<DreamMapJson> ConvertMaps(DMCompiler compiler, List<string> mapPath
return maps;
}

private string SaveJson(List<DreamMapJson> maps, string interfaceFile, string outputFile, IOpcodeVerifier verifier) {
private string SaveJson(List<DreamMapJson> maps, string? interfaceFile, string outputFile, IOpcodeVerifier verifier) {
var jsonRep = DMObjectTree.CreateJsonRepresentation();
var compiledDream = new DreamCompiledJson {
Metadata = new DreamCompiledJsonMetadata { Version = verifier.GetOpcodesHash() },
Expand Down
3 changes: 2 additions & 1 deletion OpenDreamClient/Interface/Prompts/ListPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public ListPrompt(string title, string message, string defaultValue, bool canCan
private void ItemList_KeyBindDown(GUIBoundKeyEventArgs e) {
if (e.Function == EngineKeyFunctions.TextSubmit) {
e.Handle();
ButtonClicked(DefaultButton);
if (DefaultButton != null)
ButtonClicked(DefaultButton);
}
}
}
4 changes: 2 additions & 2 deletions OpenDreamClient/Interface/Prompts/PromptWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OpenDreamClient.Interface.Prompts;

public abstract class PromptWindow : OSWindow {
protected readonly Control InputControl;
protected string DefaultButton;
protected string? DefaultButton;

private readonly BoxContainer _buttonPanel;
private bool _promptFinished;
Expand Down Expand Up @@ -57,7 +57,7 @@ protected void CreateButton(string text, bool isDefault) {
Children = { new Label { Text = text, Margin = new Thickness(5, 2, 5, 2) } }
};

if (isDefault)
if (isDefault || DefaultButton == null)
DefaultButton = text;

button.OnPressed += _ => ButtonClicked(text);
Expand Down

0 comments on commit b4a31f7

Please sign in to comment.