ISXEQChatWnd not saving window positions

Moderator: MacroQuest Developers

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

ISXEQChatWnd not saving window positions

Post by iluvseq » Thu May 11, 2006 10:49 am

ISXEQChatWnd doesn't create it's XML settings file, or save it's window settings (position, etc) even if I create an empty ISXEQChatWnd.xml file myself.

This is using echoism's pre-compiled ISXEQ modules.

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

Post by iluvseq » Thu May 11, 2006 3:56 pm

Ok, I've semi-solved the problem.

First, the current code only saves the settings during shutdown, if the font is changed or during cleanup (when the window is being closed).

However, unless you explicitely ext -unload, by the time shutdown is called, the window no longer exists so the settings don't get saved.

So I added the following code to force a save every time the window is re-sized.

Code: Select all

78a79,87
>               else if (pWnd==(CXWnd*)OutputBox)
>               {
>                       if (Message==XWM_NEWVALUE)
>                       {
>                               SaveChatToXML((PCSIDLWND)MQChatWnd);
>                       }
>                       else
>                               DebugSpew("OutputBox message %Xh, value: %Xh", Message, unknown);
>               }
This works great. Whenever I resize the window, the settings get saved, and of course, they get properly restored whenever I re-load the module.

Now, I've uncovered an additional bug.

If you create an .iss to load your extensions, and you call it during the Startup Sequence, the directory for ISInterface->SaveSettings() seems to be undefined or at least not either of ISDIR or ISDIR/extensions/

In other words, if I have it load the extension during Startup Sequence, no XML files get saved/found/loaded by any of the extensions (at least, if I load them via an .iss file. I'll try loading them via individual ext commands in the startup sequence next.)

This may be resolved by the new ISInterface() API (all ISXEQ modules still use the deprecated API). I tried converting to the new API, but the documentation on the IS Wiki wasn't sufficient for me to figure it out. I couldn't find any sample code that covered the basic sequence, and the Wiki examples were simple one-line examples of the function calls, which, frankly, are essentially repeating the function decleration, and don't actually serve to demonstrate usage. :(

Anyway, my problem is solved as long as I am willing to RunScript loadisxeq whenever I am in-game. I'll keep plugging away at trying to get it to work if I auto-load the extensions.

Is anyone else having this problem? I am thinking that it probably used to work, and once a UI is setup, folks don't tend to move windows around much, so people probably just have an ISXEQChatWnd.xml from ages ago which puts the window where they want it, and so they've not noticed that it's no longer saving the settings. Or, it could just be me :)

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

Post by iluvseq » Thu May 11, 2006 4:08 pm

Ok, if I load each extension individually in the Session Startup sequence, instead of calling an .iss file to load them all, it sets the XML path to the InnerSpace directory and is able to save/load configuration files. (However, the patch above is still required since this is a seperate issue from the behaviour of ISXEQChatWnd)

So, I believe there is a bug in InnerSpace with regards to setting the XML path for extensions loaded from an .iss file during the Session Startup sequence. As I comment above, this may only be an issue with the deprecated settings interface. I have not tested it with the new interface.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu May 11, 2006 4:14 pm

If you create an .iss to load your extensions, and you call it during the Startup Sequence, the directory for ISInterface->SaveSettings() seems to be undefined or at least not either of ISDIR or ISDIR/extensions/

In other words, if I have it load the extension during Startup Sequence, no XML files get saved/found/loaded by any of the extensions (at least, if I load them via an .iss file. I'll try loading them via individual ext commands in the startup sequence next.)
Incorrect. The XML filename is set up before any of the ISXInterface Initialize function gets called, to use the containing folder of the extension. The issue is actually that you need to open the settings file before using it, which ISXEQTemplate.cpp doesn't do.
I couldn't find any sample code that covered the basic sequence, and the Wiki examples were simple one-line examples of the function calls, which, frankly, are essentially repeating the function decleration, and don't actually serve to demonstrate usage.
http://www.lavishsoft.com/wiki/index.ph ... ting_Files
The full documentation for the settings API will be found under the LavishSettings topic on the Lavish wiki, I just need to get around to filling it in.
First, the current code only saves the settings during shutdown, if the font is changed or during cleanup (when the window is being closed).

However, unless you explicitely ext -unload, by the time shutdown is called, the window no longer exists so the settings don't get saved.

So I added the following code to force a save every time the window is re-sized.
That is indeed a proper solution. The settings file does not need to be saved on unload at all, only when changes are made.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

Post by iluvseq » Thu May 11, 2006 6:10 pm

Lax wrote:Incorrect. The XML filename is set up before any of the ISXInterface Initialize function gets called, to use the containing folder of the extension. The issue is actually that you need to open the settings file before using it, which ISXEQTemplate.cpp doesn't do.
Just out of curiousity, why does it work when I setup a "Startup Sequence" item for each extension individually, but doesn't work when I have a single "Startup Sequence" item calling 'runscript loadisxeq.iss'? It also works if I don't have any startup sequence items setup, and then call runscript loadisxeq.iss from the console once in-game.

In other words, it only stops working if I try to load the extensions via a script during the startup sequence. Clearly I don't understand all the inner workings, but that seems odd to me.
http://www.lavishsoft.com/wiki/index.ph ... ting_Files
The full documentation for the settings API will be found under the LavishSettings topic on the Lavish wiki, I just need to get around to filling it in.
My bad! I scrolled too fast past the "Tutorials" part, didn't even see it, and went straight to the "Classes" -> "ISInterface" section. Thanks for pointing it out. When I've got time (assuming someone else doesn't beat me to it) I'll update the various ISXEQ modules to use the new XML Settings API instead of the deprecated one.
That is indeed a proper solution. The settings file does not need to be saved on unload at all, only when changes are made.
Does this mean you'll add my patch to .cvs ? :)

Thanks for your input!

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu May 11, 2006 6:24 pm

Just out of curiousity, why does it work when I setup a "Startup Sequence" item for each extension individually, but doesn't work when I have a single "Startup Sequence" item calling 'runscript loadisxeq.iss'? It also works if I don't have any startup sequence items setup, and then call runscript loadisxeq.iss from the console once in-game.

In other words, it only stops working if I try to load the extensions via a script during the startup sequence. Clearly I don't understand all the inner workings, but that seems odd to me.
Totally depends on the extensions and how they are designed. If extensions use the default layout for loading settings, and use character-specific settings, then you better be in game when they're loaded. If they use the gamestate to properly load character-specific settings once you actually have a character loaded, then no problem. ISXEQChatWnd SHOULD work properly, but might not.
Does this mean you'll add my patch to .cvs ? :)
Sure.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0