Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Eustacia Green

Plan for Eustacia Green
Name:Eustacia Green 
Date Posted:Aug 11, 2004
Rating:Not Rated
Public:NO
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Eustacia Green

Blog post
Theme Editor delayed because of delusional SimSets
Well I was trucking right along on the Theme Editor (see previous plan). I extended the guiInspector for use in the Theme Editor. Basically I needed a function that would return me all the profiles. And I needed a function to write the theme file. I originally tried to create the write function without modifying core TGE, but I couldn't figure out how to get at the Hashtable and Hashtablesize for the fielddictionary items. I ended up modifying the SimObject and SimDictionary write and writefields functions. This worked great!.... Until I tried to save a gui from the Gui Editor. My Gui's no longer recognised that they were simsets, they just thought they were simobjects, so the subobjects were never written out. Bah! The only thing I can guess is that the SimSet::write parameter list must match the SimObject::write. I'm going to try that tonight. If this doesn't work I'm not sure what to try next. Wish Me Luck!

Recent Blog Posts
List:08/14/04 - Plan for Eustacia Green
08/11/04 - Plan for Eustacia Green
08/05/04 - Plan for Eustacia Green

Submit ResourceSubmit your own resources!

Ben Garney   (Aug 11, 2004 at 15:41 GMT)
What exactly are you trying to do? It sounds like you might have overlooked an easy solution to your problem...

Eustacia Green   (Aug 11, 2004 at 16:40 GMT)
For the profiles/themes to work I need to write out a file like this:


if (!isObject(GuiDefaultProfile)) new GuiControlProfile(GuiDefaultProfile); 
GuiDefaultProfile.tab = "0";
GuiDefaultProfile.canKeyFocus = "0";
GuiDefaultProfile.mouseOverSelected = "0";
GuiDefaultProfile.modal = "1";
GuiDefaultProfile.opaque = "0";
...


Because the profiles will already exist, and are associated with gui's.

The default object.save would write it out as

if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
{
tab = false;
canKeyFocus = false;
hasBitmapArray = false;
mouseOverSelected = false;

...


I've got this working with my code, BUT now when I try to save a gui, only the top control is written out, because the SimObject write is called not the SimSet write when the ConsoleMethod calls object->write.


I could get the behaviour I wanted without changing SimBase.cc but I couldn't figure out how to write out the dynamic fields of the profile.

So I changed the SimObject to below

virtual void write(Stream &stream, U32 tabStop, U32 flags = 0, bool objExits = false);
void writeFields(Stream &stream, U32 tabStop, bool objExits = false);

SimFieldDictionary:
void writeFields(SimObject *obj, Stream &stream, U32 tabStop, bool objExits = false); // eag objExits added for Theme Editor

These are the only 3 functions I changed. I didn't change the ConsoleMethod for save. Does the SimObject and SimSet write functions need to have the exact same parameter list?

Is there an easier way to do all this than I've gone??
Edited on Aug 11, 2004 17:10 GMT

Eustacia Green   (Aug 12, 2004 at 01:28 GMT)
Well I fixed my issue. A little more bug testing and I should be able to release this.

Josh Williams   (Aug 12, 2004 at 09:53 GMT)
Sweet :) Looking forward to it.

You must be a member and be logged in to either append comments or rate this resource.