Drive-by Add-on Modification
Try the following...
In WhiteCounter.xml, add this to the OnLoad section
|
Source code
|
1
2
|
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("SAVE_VARIABLES");
|
then in the OnEvent part, add
|
Source code
|
1
2
3
4
5
6
7
8
9
10
|
if (event == "SAVE_VARIABLES") then
SaveVariables("WhiteCounter_Position");
end
if (event == "VARIABLES_LOADED") then
if (WhiteCounter_Position.x == nil or WhiteCounter_Position.y == nil) then
WhiteCounter_Position = WhiteCounter_DefaultPos;
end
this:SetPos(WhiteCounter_Position.x,WhiteCounter_Position.y);
end
|
Finally, in WhiteCounter.lua add this after the variable definitions
|
Source code
|
1
2
3
|
WhiteCounter_DefaultPos = {x = 110, y = 25}
WhiteCounter_Position = {}
SaveVariables("WhiteCounter_Position");
|
Note, the above has not been tested, nor even compiled.