Originally Posted by Choonstertwo
Define your buttons in XML like this:
Code:
<Button name="LeiShenCoordinator_BlueMarker" inherits="UIPanelButtonTemplate,SecureActionButtonTemplate" text="Blue">
<Size>
<AbsDimension x="50" y="23" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="25" y="-75" />
</Anchor>
</Anchors>
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0" g="0" b="1" />
<Scripts>
<OnLoad>
LeiShenCoordinator_MarkerOnLoad(self, "bluesquare")
</OnLoad>
</Scripts>
</Button>
And your initialisation code in Lua like this:
lua Code:
local markerIndexes = { bluesquare = 1, greentriangle = 2, purplediamond = 3, redcross = 4, yellowstar = 5, } function LeiShenCoordinator_MarkerOnLoad(self, marker) local index = markerIndexes[marker] -- Set world marker on left-click: self:SetAttribute("type1", "worldmarker") self:SetAttribute("marker1", index) self:SetAttribute("action1", "set") -- Clear world marker on right-click: self:SetAttribute("type2", "worldmarker") self:SetAttribute("marker2", index) self:SetAttribute("action2", "clear") end
|
Thanks again for this. I have it placed in my Lua just fine and placing markers works great. Using the right click to try to clear a marker does not work though. I have spent the last few hours trying find another way of clearing them all (including macrotext) but am getting stumped again sadly. I have made the changed to a better naming as was said by Phanx (TY!). But other than that it is bugging me.
Thanks