kayler-renslow / arma-dialog-creator

A dialog/GUI creation tool for Arma 3.
MIT License
76 stars 12 forks source link

Errors after importing dialogs. #8

Closed StickieBE closed 7 years ago

StickieBE commented 7 years ago

Screenshot: https://prnt.sc/g8yjtq More screenshots from the errors themselves, as I can't copy+paste them. https://prnt.sc/g8ylfl https://prnt.sc/g8ylj4 https://prnt.sc/g8ylon

Log: https://pastebin.com/Rtxump6E

Importing works, but spits out errors when opening a dialog. I think this could also be related to: https://prnt.sc/g8xvwt Note how when creating custom classes the alpha gets added as 1,0 (comma) where it should be 1.0 (dot) iirc. Faulty => { 1.0 , 1.0 , 1.0 , 0,1 }; Correct => { 1.0 , 1.0 , 1.0 , 0.1 };

kayler-renslow commented 7 years ago

It seems like one error in your description.ext is propagating to the rest of the import process. Can you include an example from your description.ext of where a color couldn't be imported correctly? Thanks.

StickieBE commented 7 years ago

@kayler-renslow Tried with the latest TFAR build and spits out the same errors. I included a bunch of screenshots. The color values are never filled in as the colors in all my files are as stated above, the correct format.

colorText[] = { 0.05 , 0.05 , 0.05 , 1.0 };

Above syntax is correct; your color picker however wrongly converts them to comma's. https://prnt.sc/g8xvwt

kayler-renslow commented 7 years ago

Are you outside the U.S. by chance? I know that in some countries, like Spain, they use periods instead of comma's to separate 1000's place (1,000 in U.S. is 1.000 in Spain for example)

kayler-renslow commented 7 years ago

I'm thinking Java's internal toString stuff is compensating for that.

StickieBE commented 7 years ago

Belgium, dot keyboard. You may remote control to debug if needed.

kayler-renslow commented 7 years ago

I just checked the code and I can confirm that it is implemented correctly. This must be Java's nativity stuff.

kayler-renslow commented 7 years ago

Wow this is a fascinating bug. lol

StickieBE commented 7 years ago

You're not alone :)

return String.format(Locale.ROOT, "%.2f", someDouble);

https://stackoverflow.com/questions/5236056/force-point-as-decimal-separator-in-java

kayler-renslow commented 7 years ago

Current Java code, for future reference (non developers can ignore):

DecimalFormat format = new DecimalFormat("#.####");

//this method, combined with DecimalFormat, is creating commas instead of periods
String toString(double red, double green, double blue, double alpha) {
    return "{" + format.format(red) + ","
            + format.format(green) + ","
            + format.format(blue) + ","
            + format.format(alpha) + "}";
}
kayler-renslow commented 7 years ago

This is the most beautiful bug. I'm surprised I figured this out so fast

kayler-renslow commented 7 years ago

Thanks for pointing this issue out.

StickieBE commented 7 years ago

Yup, good hunch there ;)

StickieBE commented 7 years ago

Hope u don't mind me even posting the smaller non-breaking issues. As the 'missing controls' one. Love the project, am here to help out where I can.

kayler-renslow commented 7 years ago

I really like the bug reports, including the trivial ones. A trivial bug report has helped me solve a major bug in the past before. Keep them coming.

This issue will take a while to fix. :O

StickieBE commented 7 years ago

Will do then! Good luck.

kayler-renslow commented 7 years ago

I have a workaround for this issue until it's resolved.

Steps:

  1. Create a new file called start_adc.bat
  2. Put the file in the same directory as adc.jar
  3. Write this code: java -jar -Duser.country=US -Duser.language=en adc.jar
  4. Double click/start start_adc.bat like it's a normal executable

What this is doing is telling Java to ignore the JVM's internal default locale and set it to the US. If you happen to be using linux, you could just create a sh file with the same code and run that.

This will also create a command window. It may print errors and stuff to the console. You can ignore anything in the console because the errors that matter are reported to the user.

StickieBE commented 7 years ago

Will do, thanks for letting me know. I shall ignore any issues popping up (in case they are related to changing locale?) until next release.

kayler-renslow commented 7 years ago

You can report issues, but I would appreciate it if they were only the errors that appear in the Dialog Creator's windows. Sometimes I print stuff to the console that isn't shown to the user.

kayler-renslow commented 7 years ago

https://github.com/kayler-renslow/arma-dialog-creator/commit/a7e43a24f137d0c69ca38ca964702f6663ec8b8e Includes a fix for the Notifications throwing IllegalStateException

kayler-renslow commented 7 years ago

Fixed the comma vs period issue in https://github.com/kayler-renslow/arma-dialog-creator/commit/d837f156221979cab42de58cb38d0d337a5549e8

kayler-renslow commented 7 years ago

fixed in release 1.0.2