For a while now I have been using the following script, which I have assigned to a macro:
/script BattlefieldMinimap_LoadUI() if(BattlefieldMinimap:IsVisible()) then BattlefieldMinimap:Hide(); else BattlefieldMinimap:Show(); end
|
This opens the battleground minimap, which I prefer to keep open as a part of my interface (in addition to the regular minimap). Here's a screenshot of an outdated version of my interface, showing it in action:
http://treelo.50megs.com/CuteMAP1.htm
I would like to turn this script into an addon, so that it can be launched automatically on startup. I have no experience with XML or LUA, but I have been trying to teach myself. So far, no success. I've come up with the following, which isn't working. Can anyone show me where I'm going wrong?
The .toc:
## Interface: 11100
## Title: treelobattlemap
## Notes: Displays the Battlefield Minimap anytime, anywhere.
treelobattlemap.xml
|
The .xml:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
<!-- Load Script file -->
<Script file="treelobattlemap.lua"/>
<Frame name="treelobattlemap">
<Scripts>
<OnLoad>
treelobattlemap_OnLoad();
</OnLoad>
</Scripts>
</Frame>
</Ui>
|
The .lua:
function treelobattlemap_OnLoad()
BattlefieldMinimap_LoadUI() if(BattlefieldMinimap:IsVisible()) then BattlefieldMinimap:Hide(); else BattlefieldMinimap:Show(); end
|
Any help would be very much appreciated.