GUI reset to default by Game and CaWE

A forum about everything related to the Cafu World Editor CaWE: mapping, editing, scripting, making GUIs and fonts, using the BSP, PVS and Light compilers.
Post Reply
User avatar
.red
Posts:10
Joined:2010-08-06, 19:31
GUI reset to default by Game and CaWE

Post by .red » 2010-08-18, 23:52

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.
MainMenu_init.zip
(1.41KiB)Downloaded 324 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.
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: GUI reset to default by Game and CaWE

Post by Carsten » 2010-08-19, 01:21

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!)
Best regards,
Carsten
User avatar
.red
Posts:10
Joined:2010-08-06, 19:31

Re: GUI reset to default by Game and CaWE

Post by .red » 2010-08-19, 08:52

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).
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: GUI reset to default by Game and CaWE

Post by Carsten » 2010-08-19, 23:41

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:
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests