Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow saving game with an empty name field #20273

Merged
merged 1 commit into from Sep 9, 2022

Conversation

The-Zen-Cat
Copy link
Contributor

@The-Zen-Cat The-Zen-Cat commented Sep 8, 2022

Fixes #20233

Disallow game save with empty name field by disabling save button until text input is present.

@PunkPun PunkPun changed the title Disallow save button if empty name field Disallow saving game with an empty name field Sep 8, 2022
PunkPun
PunkPun previously approved these changes Sep 8, 2022
@@ -112,6 +112,7 @@ public GameSaveBrowserLogic(Widget widget, ModData modData, Action onExit, Actio
}

var saveButton = panel.Get<ButtonWidget>("SAVE_BUTTON");
saveButton.IsDisabled = () => string.IsNullOrEmpty(saveTextField.Text);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest

Suggested change
saveButton.IsDisabled = () => string.IsNullOrEmpty(saveTextField.Text);
saveButton.IsDisabled = () => string.IsNullOrWhiteSpace(saveTextField.Text);

since we don't want to allow spaces as file names either.

dragunoff
dragunoff previously approved these changes Sep 9, 2022
Copy link
Contributor

@dragunoff dragunoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and LGTM 👍 Thanks for the contribution!

@PunkPun PunkPun merged commit 9a5d352 into OpenRA:bleed Sep 9, 2022
@PunkPun
Copy link
Member

PunkPun commented Sep 9, 2022

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving a game with an empty name
4 participants