I guess I really did learn something about lua and xml. I actually figured out how to fix the problem with restoring the settings saved in SavedVarialbles. It looked like the changes made with Xolpass Options were being written to SavedVariables, but it was only restoring compass frame lock and position settings, not alpha, width, or the arrow setting.
To fix this problem, I changed some code in Xolpass.lua. In the function declaration for Xolpass_CheckVariables(), replace the block of code below, starting with line 84 in my listing:
Code:
if XolpassOptions.GetWidth and XolpassOptions.GetAlpha and XolpassOptions.Arrow then
XolpassOptionsFormSliderWidth:SetValue(XolpassOptions.GetWidth);
XolpassOptionsFormSliderWidthText:SetText("Width: "..XolpassOptions.GetWidth)
XolpassForm:SetWidth(XolpassOptions.GetWidth);
XolpassOptionsFormSliderAlpha:SetValue(XolpassOptions.GetAlpha);
XolpassOptionsFormSliderAlphaText:SetText("Alpha: "..floor(XolpassOptions.GetAlpha*100))
XolpassForm:SetAlpha(XolpassOptions.GetAlpha);
if XolpassOptions.Arrow == "N" then XolpassOptionsSetArrow = "North" else XolpassOptionsSetArrow = "South" end
XolpassOptionsFormArrow:SetChecked(XolpassOptions.Arrow);
XolpassOptionsFormArrowText:SetText("Pointing "..XolpassOptionsSetArrow);
else
XolpassOptionsFormSliderWidth:SetValue(360);
XolpassOptionsFormSliderWidthText:SetText("Width: "..360)
XolpassForm:SetWidth(360);
XolpassOptionsFormSliderAlpha:SetValue(360);
XolpassOptionsFormSliderAlphaText:SetText("Alpha: "..100)
XolpassForm:SetAlpha(1);
end
with this:
Code:
if XolpassOptions.GetWidth then
XolpassOptionsFormSliderWidth:SetValue(XolpassOptions.GetWidth);
XolpassOptionsFormSliderWidthText:SetText("Width: "..XolpassOptions.GetWidth)
XolpassForm:SetWidth(XolpassOptions.GetWidth);
else
XolpassOptionsFormSliderWidth:SetValue(360);
XolpassOptionsFormSliderWidthText:SetText("Width: "..360)
XolpassForm:SetWidth(360);
end
if XolpassOptions.GetAlpha then
XolpassOptionsFormSliderAlpha:SetValue(XolpassOptions.GetAlpha);
XolpassOptionsFormSliderAlphaText:SetText("Alpha: "..floor(XolpassOptions.GetAlpha*100))
XolpassForm:SetAlpha(XolpassOptions.GetAlpha);
else
XolpassOptionsFormSliderAlpha:SetValue(360);
XolpassOptionsFormSliderAlphaText:SetText("Alpha: "..100)
XolpassForm:SetAlpha(1);
end
if XolpassOptions.Arrow then
if XolpassOptions.Arrow == "N" then XolpassOptionsSetArrow = "North" else XolpassOptionsSetArrow = "South" end
XolpassOptionsFormArrow:SetChecked(XolpassOptions.Arrow);
XolpassOptionsFormArrowText:SetText("Pointing "..XolpassOptionsSetArrow);
end
As I said, I have just started to learn this stuff. Maybe there's a better way to fix it, but this seems to work for me.
Last edited by Jaim Sandar : 09-18-2007 at 06:46 PM.
I tried to learn a little about LUA and XML, and I have come up with a "Close" button so at least I don't have to type "/xp toggle" just to close the options window any more. This code is added to the xolpass.xml file near the end after the last "</Checkbutton>" tag:
I understand, but that doesn't help my dissapointment.
I still use this AddOn as is, and enjoy the function it provides even without the convenience thtat could be added. I wish I knew enough to make the changes myself, but I barely know how to put a frame onscreen, let alone things like we're asking for.
Sorry for not doing as I promised, but I have come up with some new plans for this mod now.
Firstly I need to work out some bugs to get the variables persistant. Also, adding a close button etc :P
Secondly, instead of manually feeding the mod with destinations it will be a addon to TomTom, getting the coords from it and displaying them in a similar manner to previous versions. I will probably also rename the mod.
I've given myself a couple of weeks to accomplish this.
Hm, haven't really thought of that before (since I haven't really gotten the chance to try TBC out yet), but it definately sounds useful and I'll look into it
Again sorry for not uploading the most current build yet, but I'm working out a few bugs and making it easily theme-/skinable.
Great work, keep it up. I still have a soft spot for the look and feel of 420compass, but since it doesn't seem to updating anymore, oh well.
Has anyone managed to figure out a way to get a read on your Z coordinates/heading? The whole reason I found 420 and now this mod was I was looking for a sort of artificial horizon... so I can set myself to fly somewhere and go, make a cup of tea, come back, and not be banging my gryph's nose against a purple atmospheric limit. :P I can't see how it would be possible but then there's a reason I don't write mods.
Originally posted by mematematica Awesome mod, just what i have been looking for since i got my flying mount. Thank you a ton.
A sugestion: An easier way to set up the coords im going to, /xp xx,xx would be easy enought but Xpearl use the same command and /xolpass isnt that easy to remember. It occurs to me that maybe clicking the bar an imput box could open to enter the desired coords maybe? Anyway, thank you so much, excelent work.
Working on a way to click the map for adding a destination, but I probably won't get it done untill I'm less busy at work.
I have a day off tomorrow so I'll fix that bug and add that close button (should've been done long ago - slipped my mind).
I'm still too busy to work on new features/rewrite the mod though, but I will try to keep the current version bug-free at least I hope to start working on the rewrite within 4 weeks.
Awesome mod, just what i have been looking for since i got my flying mount. Thank you a ton.
A sugestion: An easier way to set up the coords im going to, /xp xx,xx would be easy enought but Xpearl use the same command and /xolpass isnt that easy to remember. It occurs to me that maybe clicking the bar an imput box could open to enter the desired coords maybe? Anyway, thank you so much, excelent work.
I really like this. I hope the rewrite goes well, and ends up even better than it is now.
The only complaint I currently have with .42 is that the alpha setting is not persistant. What I mean is, no matter what I set the alpha to, the next time I log on it is back at 100.
Oh, wait, I have one more gripe. I would prefer not to have to type "xp toggle" a second time to close the configuration frame. A close or OK button, or a close "x" in the corner, or something, would be nice.