View Single Post
10-06-16, 04:58 AM   #4
Lazare
An Aku'mai Servant
 
Lazare's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 36
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:
  1. function qgc:ToggleWatch(index)
  2.     if not index then
  3.         index = GetQuestLogSelection()
  4.     end
  5.     if index>0 then
  6.         if IsQuestWatched(index) then -- already watched, remove from watch
  7.             RemoveQuestWatch(index)
  8.             TrackButton:SetText(TRACK_QUEST_ABBREV)
  9.         else -- not watched, see if there's room to add, add if so
  10.             if GetNumQuestWatches() >= MAX_WATCHABLE_QUESTS then
  11.                 UIErrorsFrame:AddMessage(format(QUEST_WATCH_TOO_MANY,MAX_WATCHABLE_QUESTS),1,0.1,0.1,1)
  12.             else
  13.                 AddQuestWatch(index)
  14.                 TrackButton:SetText(UNTRACK_QUEST_ABBREV)
  15.             end
  16.         end
  17.     end
  18. end


Blizzards coding from the Map/Quest is:
lua Code:
  1. if ( IsQuestWatched(questLogSelection) ) then
  2.         QuestMapFrame.DetailsFrame.TrackButton:SetText(UNTRACK_QUEST_ABBREV);
  3.         QuestLogPopupDetailFrame.TrackButton:SetText(UNTRACK_QUEST_ABBREV);
  4.     else
  5.         QuestMapFrame.DetailsFrame.TrackButton:SetText(TRACK_QUEST_ABBREV);
  6.         QuestLogPopupDetailFrame.TrackButton:SetText(TRACK_QUEST_ABBREV);
  7.     end
Which corresponds to the TrackButton sections of my code.Thank you for your help.
Cheers
__________________
"There's no such thing as too many addons."
Lothaer

My Authored Addons
HOME OF THE FREE, BECAUSE OF THE BRAVE
  Reply With Quote