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

Faction Data: Add MUL ID #4344

Closed
wants to merge 5 commits into from
Closed

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Apr 19, 2023

As the title says, this adds the faction ID from the MUL to the FactionRecord data, editable in the RATGeneratorEditor. I added faction IDs as far as I could match them.

Since the MUL is called from a few places, I unified the calling code. The whitespace changes in UIUtil weren't intentional.

Fixes #4286

@SJuliez SJuliez requested a review from HammerGS April 19, 2023 21:56
@@ -479,6 +488,7 @@
FactionRecord retVal = new FactionRecord();
retVal.key = node.getAttributes().getNamedItem("key").getTextContent();
retVal.name = node.getAttributes().getNamedItem("name").getTextContent();
retVal.mulId = Integer.parseInt(node.getAttributes().getNamedItem("mulid").getTextContent());

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@HammerGS
Copy link
Member

Did some testing and the bug is fixed...Thanks! But nothing exported seems to have a Faction MUL ID in the csv file it still reads TBD.

@SJuliez
Copy link
Member Author

SJuliez commented Apr 20, 2023

Right, corrected.

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

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

Looks fine code-wise, except for that random

tag in one of the comments for no reason

* of the parent dialog, not following the mouse.
/**
* A MMComboBox with a specialized tooltip display. Displays the tooltip to the right side
* <p>
Copy link
Member

Choose a reason for hiding this comment

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

?

@SJuliez SJuliez marked this pull request as draft April 22, 2023 07:34
@SJuliez
Copy link
Member Author

SJuliez commented Apr 22, 2023

Found out that I need to implement multiple MUL IDs that go with name changes within a single faction


public void setMulIds(String mulIds) {
String[] fields = mulIds.split(",");
mulId = Integer.parseInt(fields[0]);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
altMulIds.clear();
for (int i = 1; i < fields.length; i++) {
String[] entry = fields[i].split(":");
altMulIds.put(Integer.parseInt(entry[0]), Integer.parseInt(entry[1]));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
altMulIds.clear();
for (int i = 1; i < fields.length; i++) {
String[] entry = fields[i].split(":");
altMulIds.put(Integer.parseInt(entry[0]), Integer.parseInt(entry[1]));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@@ -502,6 +522,8 @@
if (wn.getNodeName().equalsIgnoreCase("nameChange")) {
retVal.altNames.put(Integer.parseInt(wn.getAttributes().getNamedItem("year").getTextContent()),
wn.getTextContent());
retVal.altMulIds.put(Integer.parseInt(wn.getAttributes().getNamedItem("year").getTextContent()),

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@@ -502,6 +522,8 @@
if (wn.getNodeName().equalsIgnoreCase("nameChange")) {
retVal.altNames.put(Integer.parseInt(wn.getAttributes().getNamedItem("year").getTextContent()),
wn.getTextContent());
retVal.altMulIds.put(Integer.parseInt(wn.getAttributes().getNamedItem("year").getTextContent()),
Integer.parseInt(wn.getAttributes().getNamedItem("mulid").getTextContent()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@HammerGS HammerGS added the In Development (Draft) An additional way to mark something as a draft. Make it stand out more. label May 20, 2023
@SJuliez
Copy link
Member Author

SJuliez commented Sep 10, 2023

Not happy with this

@SJuliez SJuliez closed this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Development (Draft) An additional way to mark something as a draft. Make it stand out more.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Labels in the RAT Editor
3 participants