HeroEngine Forums

HeroEngine Support => GUI Creation => Topic started by: FI-ScottZ on Mar 04, 17, 09:55:44 PM

Title: Bug Found in GUI Editor Save Code
Post by: FI-ScottZ on Mar 04, 17, 09:55:44 PM
I have noticed that when I use the GUI Editor, if I try to set a texture name into the material field of a control's alphamask AND set that alphamask size or position to anything non-zero, there is an error in the Console panel when I try to save the GUI:

Quote
ERROR:HeroScript::HeroMachine::ScriptError:Bad XML: Missing starting <

If I only set the position/size OR only the material, it saves fine.

For instance, setting only material will result in a line like this:
Quote
<alphamask material="SomeTexture.png"/>

Setting only size will result in lines like this:
Quote
<alphamask>
  <size x="213" y="257"/>
</alphamask>

But if I set both size and material and try to save, it attempts to write lines like this:
Quote
<alphamask>
  <size x="213" y="257"/> material="SomeTexture.png"
</alphamask>

You can see that the material setting is being placed after the size setting instead of immediately after the keyword "alphamask".  That results in the error since there is no "<" before "material".

I tried to read through the code to understand where it is going wrong, but could not track it down.  Anyways, it can be bypassed by manually writing the code properly in the xml file so that it looks like this:
Quote
<alphamask material="SomeTexture.png">
  <size x="213" y="257"/>
</alphamask>

Just thought I should pass this along so it can be corrected in-engine at some point.
Title: Re: Bug Found in GUI Editor Save Code
Post by: HE-CHRISTOPHER on Mar 04, 17, 10:26:18 PM
That does indeed seem like bad xml. 

I've added it to our issue tracking system, but since there is a workaround editing the guixml directly the priority is lower than other issues without a workaround.

Thanks for letting us know with a good reproduction.

Best,

Christopher