Quantcast
WoWInterface - View Single Post - Frame temporary properties (frame.86c52870)
View Single Post
01-02-21, 11:15 AM   #11
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 397
Translated with Google:
Lua Code:
  1. local objectiveSpecials = {
  2.     ClickComplete = function(fontString)
  3.         fontString:SetText("(kliknij, aby zakończyć)")    -- (click to complete)
  4.     end,
  5.  
  6.     Failed = function(fontString)
  7.         fontString:SetText("Niepowodzenie")             -- Failed
  8.     end,
  9.  
  10.     QuestComplete = function(fontString)
  11.         if fontString:GetText() == QUEST_WATCH_QUEST_READY then
  12.             fontString:SetText("Gotowy do oddania")     -- Ready for turn-in
  13.         else
  14.             fontString:SetText("Zadanie zakończone")   -- Quest Complete
  15.         end
  16.     end,
  17.  
  18.     Waypoint = function(fontString, questID)
  19.         local waypointText = C_QuestLog.GetNextWaypointText(questID)
  20.         fontString:SetText(("0/1 %s (Opcjonalny)"):format(waypointText))    -- 0/1 %s (Optional)
  21.     end
  22. }
  23.  
  24. hooksecurefunc(QUEST_TRACKER_MODULE, "EnumQuestWatchData", function()
  25.     for questID, block in pairs(QUEST_TRACKER_MODULE.usedBlocks.ObjectiveTrackerBlockTemplate) do
  26.         block.HeaderText:SetText("Translated Header")
  27.         local objectives = block.lines
  28.         for index = 1, #objectives do
  29.             objectives[index].Text:SetText("My translation")
  30.         end
  31.         for special, func in pairs(objectiveSpecials) do
  32.             if objectives[special] then
  33.                 func(objectives[special].Text, questID)
  34.             end
  35.         end
  36.     end
  37. end)
  Reply With Quote