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

47.13 Certain awards cause personnel information to blank #2220

Closed
servo01 opened this issue Nov 10, 2020 · 4 comments · Fixed by #2221
Closed

47.13 Certain awards cause personnel information to blank #2220

servo01 opened this issue Nov 10, 2020 · 4 comments · Fixed by #2221
Assignees
Labels
Awards Bug Data Hammertime Personnel Personnel-related Issues

Comments

@servo01
Copy link

servo01 commented Nov 10, 2020

47.13
Linux
Java 11.0.8

Clean install with no modifications or customization, there appear to be some awards which cause information (Mechwarrior, Status, Origin, Age, Skill Names, etc.) to disappear from within the personnel display on the upper right side of the screen.

I noticed this issue when attempting to import my custom award set to 47.12 and, in addition to the blank personnel screen detailed above, some of the ribbons from my custom set also failed to display. (log and custom awards file from that attempt have not been included here)

The issue can be recreated using various awards from the 'standard' set as demonstrated here using the 'Medal of Honor' award featured in the attached screenshots.

mekhqlog.txt

AwardScreen1

AwardScreen2

@Windchild292 Windchild292 added Awards Bug Data Hammertime Personnel Personnel-related Issues labels Nov 10, 2020
@Windchild292
Copy link
Contributor

Caused by #2161, namely that Image::getWidth and Image::getHeight are returning -1 for an unknown reason.

10:48:55,864 ERROR [mekhq.gui.view.PersonViewPanel] {AWT-EventQueue-0} 
drawRibbons(), line 322 : Width (-1) and height (-1) cannot be <= 0
java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.GraphicsConfiguration.createCompatibleImage(GraphicsConfiguration.java:186)
	at megamek.common.util.ImageUtil.createAcceleratedImage(ImageUtil.java:77)
	at megamek.common.util.ImageUtil$AWTImageLoader.loadImage(ImageUtil.java:218)
	at megamek.common.util.ImageUtil.loadImageFromFile(ImageUtil.java:176)
	at megamek.common.util.fileUtils.ImageFileFactory$1.getItem(ImageFileFactory.java:75)
	at megamek.common.util.fileUtils.AbstractDirectory.getItem(AbstractDirectory.java:154)
	at megamek.common.util.fileUtils.AbstractDirectory.getItem(AbstractDirectory.java:147)
	at megamek.common.util.fileUtils.AbstractDirectory.getItem(AbstractDirectory.java:147)
	at mekhq.gui.view.PersonViewPanel.drawRibbons(PersonViewPanel.java:314)
	at mekhq.gui.view.PersonViewPanel.initComponents(PersonViewPanel.java:162)
	at mekhq.gui.view.PersonViewPanel.<init>(PersonViewPanel.java:92)
	at mekhq.gui.PersonnelTab.refreshPersonnelView(PersonnelTab.java:822)
	at mekhq.gui.PersonnelTab.lambda$initTab$3(PersonnelTab.java:222)

@Windchild292
Copy link
Contributor

There is a chance this is because the files in question are erroneous, however I believe it to be because they are using currently unsupported png formats. I've got a temporary fix that will hold for now, but will need to be revisited once we upgrade to Java 11. This has been noted in the file in question.

@BullseyeSmith
Copy link
Contributor

@Windchild292, if I saved the award images in the wrong format, please let me know how to do it properly and I will convert them all.

@Windchild292
Copy link
Contributor

Windchild292 commented Feb 20, 2021

It is pre-existing, this was just found because of a few underlying changes I made to standardize and simplify the backend for icons in general. If it persists after the Java version swapover I'll let you know and we can try to figure out why awards are being parsed differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awards Bug Data Hammertime Personnel Personnel-related Issues
Projects
None yet
3 participants