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

Scenario Additions (Planetary Cond. / Dialog skip) #2775

Merged
merged 6 commits into from
Apr 29, 2021

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Apr 11, 2021

  • Adds complete planetary conditions settings to .mms scenarios
  • Allows settings planetary conditions as fixed, skipping the respective dialog when the scenario starts
  • Also allows setting the game options as fixed, skipping that dialog
  • Also allows setting player assignment as fixed ("SinglePlayer"), skipping the player assignment/camo dialog and the host game dialog. In this case the first player of the scenario is the local player and the others are connected as Princess. When all is fixed, the game proceeds directly from scenario selection to in-game deployment/first round.
  • Updated the example.mms with the new settings and missing settings (camo examples)

Resolves #2133

Copy link
Contributor

@Windchild292 Windchild292 left a comment

Choose a reason for hiding this comment

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

Few things first

@@ -409,6 +446,69 @@ public IGame createGame() throws Exception {
return g;
}

private void parsePlanetaryConditions(Game g, StringMultiMap p) {
if (p.containsKey(PARAM_PLANETCOND_TEMP)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we separate these if statements so that there is a whitespace between the close } and the next if statement?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if we are just going to use a setter immediately after can we just use the same line and combine them. Not much point to separate them out.

Copy link
Member Author

Choose a reason for hiding this comment

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

a) You mean an empty line after }? parsePlanetaryConditions is so uninteresting that I wanted it to be short. No complexity here.
b) What? You mean like g.getPlanetaryConditions().setTemperature(Integer.parseInt(p.getString(PARAM_PLANETCOND_TEMP)));?
I can do that but it makes lines very long and Id rather have them like this than with a break in the middle.

Copy link
Member Author

Choose a reason for hiding this comment

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

Arlith used to run a code formatter that would cut the lines very short iirc and (I think) sometimes result in awful line breaks. I'd rather break manually. But if no one does this, I can sure use long code lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly like this. The extra space is an accessibility bit that assists in separating out the statements to a reader. Otherwise, it can come off as being a single giant chained if statement even though it is not the case

@Windchild292 Windchild292 merged commit dae67ab into MegaMek:master Apr 29, 2021
@SJuliez SJuliez deleted the ScenarioAdditions branch May 26, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Weather conditions settings in scenario (MMS) files
2 participants