Author Topic: [Fixed][Graphics set tool] Cannot load style that has no objects or no terrain  (Read 1383 times)

0 Members and 1 Guest are viewing this topic.

Offline nin10doadict

  • Posts: 329
  • Guy who constantly misses the obvious
    • View Profile
Steps to reproduce:
Create a new style. Add some terrain pieces, but no objects. Save the style and then close the set tool.
Upon reopening the set tool and trying to load this style, you will be greeted with an error message:

"Klopt niet: #lack is not a valid value for Int32. Try to continue working on the style? Selecting 'no' will quit the style editor."

Selecting no quits as advertised. Selecting yes allows you to continue, but the style fails to load and the terrain pieces you inserted do not appear and cannot be modified. Any other changes that you have made to the style also fail to load.

The same situation occurs if you insert objects but no terrain. The level editor is able to load the style with no issues, even if it lacks terrain or objects. Any objects (or terrain) that have been inserted load and function properly in the level editor.
« Last Edit: July 29, 2018, 08:21:09 AM by Nepster »

Offline Nepster

  • Posts: 1829
    • View Profile
Thanks a lot. The problem is the C# method to convert internal colors to their hex RGB representation. For 99% of all colors it worked fine, but for some of them it just returns the color's name!!! :devil::devil::devil: So the "#lack" you see in the error message is actually a mangled "Black"! And of course the code failed to convert it back to an actual color.
I fixed this and added a way to load styes that have been saved with that stupid color-to-hex method.

Online Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Beautiful. :8(): Thanks for the entertainment. Certainly, some program out there relies on this mess, and now they can't change the spec.

-- Simon