The xml code is below
Code:
<Button parentKey="TrackButton" inherits="MagicButtonTemplate" text="TRACK_QUEST_ABBREV">
<Size x="80" y="22"/>
<Anchors>
<Anchor point="LEFT" relativeKey="$parent.push" relativePoint="RIGHT"/>
</Anchors>
<Scripts>
<OnClick>
QuestGuru:ToggleWatch()
</OnClick>
<OnEnter>
GameTooltip_AddNewbieTip(self, TRACK_QUEST, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_TRACKQUEST, 1)
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Button>
and the Lus is
lua Code:
function qgc:ToggleWatch(index)
if not index then
index = GetQuestLogSelection()
end
if index>0 then
if IsQuestWatched(index) then -- already watched, remove from watch
RemoveQuestWatch(index)
TrackButton:SetText(TRACK_QUEST_ABBREV)
else -- not watched, see if there's room to add, add if so
if GetNumQuestWatches() >= MAX_WATCHABLE_QUESTS then
UIErrorsFrame:AddMessage(format(QUEST_WATCH_TOO_MANY,MAX_WATCHABLE_QUESTS),1,0.1,0.1,1)
else
AddQuestWatch(index)
TrackButton:SetText(UNTRACK_QUEST_ABBREV)
end
end
end
end
Blizzards coding from the Map/Quest is:
lua Code:
if ( IsQuestWatched(questLogSelection) ) then
QuestMapFrame.DetailsFrame.TrackButton:SetText(UNTRACK_QUEST_ABBREV);
QuestLogPopupDetailFrame.TrackButton:SetText(UNTRACK_QUEST_ABBREV);
else
QuestMapFrame.DetailsFrame.TrackButton:SetText(TRACK_QUEST_ABBREV);
QuestLogPopupDetailFrame.TrackButton:SetText(TRACK_QUEST_ABBREV);
end
Which corresponds to the TrackButton sections of my code.Thank you for your help.
Cheers