[Fixed][Graphics set tool] Cannot load style that has no objects or no terrain

Started by nin10doadict, July 24, 2018, 08:20:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nin10doadict

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.

Nepster

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.

Simon

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

-- Simon