Page 1 of 1

How to properly unload more than one .scheme file

Posted: Wed May 19, 2010 01:07
by czuger
Hello,

I have the following:
Multiple scheme files that use Falagard. Below is an outtake of the relevant XML from two of my scheme files. The assumption here is that the correct looknfeel files etc exist.

Contents of "LookA.scheme"

Code: Select all

<?xml version="1.0" ?>
<GUIScheme Name="LookA">
...
<FalagardMapping WindowType="LookA/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="LookA/Button" />
...
</GUIScheme>


Contents of "LookB.scheme"

Code: Select all

<?xml version="1.0" ?>
<GUIScheme Name="LookB">
...
<FalagardMapping WindowType="LookB/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="LookB/Button" />
...
</GUIScheme>


The problem I have:
As soon as one of these two schemes are unloaded, it goes and destroys the WindowRendererFactory (In my case, "Falagard/Button"), even tho it is still used by another scheme.
Am I using the .schemes incorrectly, or is there some way to tell CEGUI to track references to the factory?

Thnx for any help.

Re: How to properly unload more than one .scheme file

Posted: Wed May 19, 2010 09:45
by CrazyEddie
This is an area where some weaknesses exist, and to be honest, I'm surprised this topic has not come up more often (if it had, we probably would have addressed it already ;)).

Basically none of the options open to you will be ideal. I think the best advice I can give is to suggest that you separate out the "common" parts into a third scheme so that unloading the others does not affect those common definitions.

Sorry not to have been able to give a 'good' solution to this :)

CE.

Re: How to properly unload more than one .scheme file

Posted: Wed May 19, 2010 13:11
by gring
One way of looking at the problem is that the lack of skins, hasn't really made the need for mechanics to change it.

Putting my vote on the looknfeel editor aka skineditor and it will bring indirect solutions to these issues too hopefully :wink:

/Gring

Re: How to properly unload more than one .scheme file

Posted: Thu May 20, 2010 08:44
by CrazyEddie
Yeah, this is so true. With any fortune when the editor becomes available later this year we will finally see a load more skins and can start to address the kinds of issues that will throw up :)

CE.