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

Move two dialogs to a separate class #2095

Merged
merged 9 commits into from
Mar 16, 2019
Merged

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Mar 16, 2019

No description provided.

[KSPField(isPersistant = true)]
private String revelation_ = "";
// Whether we have encountered an apocalypse already.
[KSPField(isPersistant = true)]
private bool is_post_apocalyptic_ = false;
Copy link
Member

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.

Copy link
Member Author

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();
Copy link
Member

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.

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a TODO.

Sorry, something went wrong.

get {
return UnityEngine.Screen.width / 2;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

  1. Why is this a property and not a field?
  2. If it is a property, it could at least be auto-implemented.
public static int XCentre { get; } = UnityEngine.Screen.width / 2;

Copy link
Member Author

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;
Copy link
Member

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.

Copy link
Member Author

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.

@eggrobin eggrobin added the LGTM label Mar 16, 2019
@pleroy pleroy merged commit 688453a into mockingbirdnest:master Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants