-
Notifications
You must be signed in to change notification settings - Fork 286
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
Faction Data: Add MUL ID #4344
Conversation
@@ -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
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. |
Right, corrected. |
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.
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> |
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.
?
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
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
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
@@ -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
@@ -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
Not happy with this |
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