Page 1 of 1

GUI reset to default by Game and CaWE

Posted: 2010-08-18, 23:52
by .red
I was playing around with the GUI editor part of CaWE and started creating an alternative main menu layout. So i backed up the original one and started from scratch. When i then closed CaWE and wanted to load it again later, CaWe reset all values to default, except for the objects names (Origin, Dimensions, Colors, Fonts, Texts.... everything is gone). When starting the game it also just showed a black screen because of the same reason... had to quit via console.
However, when i open the file in a text editor, everything is fine. I never edited the menu with anything but CaWE, so why the heck is this happening?
I set the menu window to 800x600, but that cannot be the reason since i tried to reproduce the problem like that. No success. Neither is the new font.

Ill attach the init cgui file. the other one is empty except for the includes, the font is called "Generis", so if anyone needs it just copy/paste default arial and rename it.
(1.41 KiB) Downloaded 192 times

Would be glad about a solution, i could rebuild the menu, but its been some work already, and i especially dont want the same thing to happen again and again. Thank you.

Re: GUI reset to default by Game and CaWE

Posted: 2010-08-19, 01:21
by Carsten
Hi .red,

the problem is in line 81, which is a duplicate of line 80.
You can just delete or comment-out one of these lines, and the GUI loads properly again.

I'll look into better error reporting for this, CaWE should at least clearly state when a GUI script could only be half-loaded. If you don't mind, could you file a ticket please?
(I'd also be interested in learning where the second line came from in the first place... did you edit the file by hand?)

Also please note that the coordinates are "virtual": 640*480 is always the bottom right corner of the screen: no matter what the actual physical resolution is later, the Cafu engine handles the scaling automatically. (Try the "Live Preview" button in the toolbar for a preview!)

Re: GUI reset to default by Game and CaWE

Posted: 2010-08-19, 08:52
by .red
I didnt edit the file by hand, so CaWe seems to have done that by itself. Strange.

EDIT: I just submitted a ticket. Please tell me if i forgot anything ;)

EDIT 2: I guess i know why this happened. I probably copy/pasted a window i created, but forgot to rename it before i closed CaWe. So the file contained 2 identical objects and caused the engine to abort loading it. It suggest to let the engine ignore the duplicated object and reporting it when loaded, offering the creator in CaWe to automatically drop that code when saving next time (or letting him close it without saving so he can edit manually).

Re: GUI reset to default by Game and CaWE

Posted: 2010-08-19, 23:41
by Carsten
Ok, I just committed the fix for this, see ticket 37 for details.
(And please make sure to update to latest SVN head, I just committed another fix for the GUI editor as well.)

Thanks for having reported this bug! :cheesy: