-
Notifications
You must be signed in to change notification settings - Fork 69
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
Move two dialogs to a separate class #2095
Conversation
[KSPField(isPersistant = true)] | ||
private String revelation_ = ""; | ||
// Whether we have encountered an apocalypse already. | ||
[KSPField(isPersistant = true)] | ||
private bool is_post_apocalyptic_ = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the comments that document the semantics of the string and bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
private int bad_installation_dialog_x_ = Dialog.XCentre; | ||
[KSPField(isPersistant = true)] | ||
private int bad_installation_dialog_y_ = Dialog.YCentre; | ||
private Dialog bad_installation_dialog_ = new Dialog(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have utilities in Dialog
to save/load the coordinates from a ConfigNode, which we would call from OnLoad and OnSave here, I don't think the KSPField
attribute is improving readability at this point.
OK to do this in another CL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO.
ksp_plugin_adapter/dialog.cs
Outdated
get { | ||
return UnityEngine.Screen.width / 2; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why is this a property and not a field?
- If it is a property, it could at least be auto-implemented.
public static int XCentre { get; } = UnityEngine.Screen.width / 2;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
[KSPField(isPersistant = true)] | ||
private String bad_installation_message_ = ""; | ||
[KSPField(isPersistant = true)] | ||
private bool is_bad_installation_ = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you want to persist this bit?
If the user is missing the redistributable framework, sees the message, installs it, restarts KSP (now with a good Principia installation), and reloads the save, the now-outdated error message will be shown; the save will forever be doomed, whereas there never was a problem with the save itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to not persist the message and the bit.
No description provided.