Quantcast
Frame temporary properties (frame.86c52870) - WoWInterface
 
Thread Tools Display Modes
12-29-20, 04:40 AM   #1
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Frame temporary properties (frame.86c52870)

In the QuestInfo frame, text sometimes appears in the element:
QuestInfoRewardsFrame.86c52870
but the number 86c52870 changes randomly.



In the picture, this element contains the text "The following will be cast on you",
which I would like to change in my addon. How to identify this changing element?

Last edited by Platine : 12-29-20 at 05:17 AM.
  Reply With Quote
12-29-20, 12:58 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,820
It is an unnamed fontstring. Since it doesn't have a name, the reference you see to it (86c52870) is its address in memory.

You can try calling QuestInfoRewardsFrame:GetChildren()
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-29-20, 01:34 PM   #3
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
10 children, nothing special:

nil
QuestInfoRewardsFrameQuestInfoItem1
QuestInfoMoneyFrame
QuestInfoSkillPointFrame
QuestInfoXPFrame
nil
nil
QuestInfoPlayerTitleFrame
QuestInfoItemHighlight
nil
  Reply With Quote
12-29-20, 02:10 PM   #4
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
QuestInfoRewardsFrame uses CreateFontStringPool for those. You will need to do something like:
Lua Code:
  1. for fontString in QuestInfoRewardsFrame.spellHeaderPool:EnumerateActive() do
  2.     if fontString:GetText() == REWARD_AURA then
  3.         fontString:SetText("My custom aura header:")
  4.     end
  5. end
  Reply With Quote
12-29-20, 02:25 PM   #5
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Super, Vrul, this work perfectly.
Thanks.

And this element what method uses?
QuestMapFrame.DetailsFrame.RewardsFrame.4501dab0


Last edited by Platine : 12-29-20 at 03:48 PM.
  Reply With Quote
12-29-20, 05:21 PM   #6
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
Lua Code:
  1. local regions = { QuestMapFrame.DetailsFrame.RewardsFrame:GetRegions() }
  2. for index = 1, #regions do
  3.     local region = regions[index]
  4.     if region:GetObjectType() == "FontString" and region:GetText() == REWARDS then
  5.         region:SetText("My custom header")
  6.     end
  7. end
  Reply With Quote
12-30-20, 04:43 AM   #7
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Excellent, thank you very much, Vrul.
  Reply With Quote
01-01-21, 09:49 AM   #8
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Vrul, and how to get objective text from block of ObjectiveTrackerBlocksFrame?

Code:
hooksecurefunc(QUEST_TRACKER_MODULE, "SetBlockHeader", MY_ObjectiveTracker_Reader);

function MY_ObjectiveTracker_Reader(self, block)
   print(block.id);
   print(block.HeaderText:GetText());
   print(block.lines[1]:GetText());        -- error: index field : nil
   -- I need to change the objective text for this block
end

Last edited by Platine : 01-03-21 at 10:28 AM.
  Reply With Quote
01-01-21, 10:33 PM   #9
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
Lua Code:
  1. hooksecurefunc(QUEST_TRACKER_MODULE, "SetBlockHeader", function(self, block)
  2.     print("QuestID:", block.id)
  3.     print("QuestHeader:", block.HeaderText:GetText())
  4.     print("QuestObjectives:")
  5.     local objectives = block.lines
  6.     if objectives.QuestComplete then
  7.         print(("[?] %s"):format(objectives.QuestComplete.Text:GetText()))
  8.     else
  9.         for index = 1, #objectives do
  10.             print(("[%s] %s"):format(index, objectives[index].Text:GetText()))
  11.         end
  12.     end
  13. end)
  Reply With Quote
01-02-21, 08:12 AM   #10
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Thanks Vrul, this is a good way, but not quite it working.

Lua Code:
  1. hooksecurefunc(QUEST_TRACKER_MODULE, "SetBlockHeader", function(self, block)
  2.     local objectives = block.lines
  3.     if objectives.QuestComplete then
  4.          objectives.QuestComplete.Text:SetText("Gotowy do oddania");    -- Ready for turn-in
  5.     else
  6.         for index = 1, #objectives do
  7.              objectives[index].Text:SetText("My translation");
  8.         end
  9.     end
  10. end)

Line 4. and 7. - does not change the text in ObjectiveTracker on the game.



Blizzard does not support the Polish language in the game, so I developed some addons that display translated texts in key places in the game (quests, gossip, bubbles, cinematic subtitles, tutarials).

Last edited by Platine : 01-03-21 at 10:27 AM.
  Reply With Quote
01-02-21, 11:15 AM   #11
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
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
01-02-21, 02:24 PM   #12
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Yes, yes, Vrul, now it's working perfectly.
I'll write a special thank for you inside the addon body.

Finally, I need a similar code to frame: Map & Quest Log.


Last edited by Platine : 01-03-21 at 10:27 AM.
  Reply With Quote
01-02-21, 05:56 PM   #13
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
Lua Code:
  1. hooksecurefunc("QuestLogQuests_Update", function()
  2.     for button in QuestScrollFrame.headerFramePool:EnumerateActive() do
  3.         button.ButtonText:SetText("My translated header")
  4.     end
  5.     for button in QuestScrollFrame.titleFramePool:EnumerateActive() do
  6.         button.Text:SetText("My translated title")
  7.     end
  8.     for frame in QuestScrollFrame.objectiveFramePool:EnumerateActive() do
  9.         frame.Text:SetText("My translated objective")
  10.     end
  11. end)
  Reply With Quote
01-03-21, 07:26 AM   #14
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
And how to get questID for specific quests?
  Reply With Quote
01-03-21, 08:09 AM   #15
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 402
Lua Code:
  1. hooksecurefunc("QuestLogQuests_Update", function()
  2.     for button in QuestScrollFrame.headerFramePool:EnumerateActive() do
  3. --      button.questLogIndex
  4.         button.ButtonText:SetText("My translated header")
  5.     end
  6.     for button in QuestScrollFrame.titleFramePool:EnumerateActive() do
  7. --      button.questLogIndex
  8. --      button.questID
  9.         button.Text:SetText("My translated title")
  10.     end
  11.     for frame in QuestScrollFrame.objectiveFramePool:EnumerateActive() do
  12. --      frame.questID
  13.         frame.Text:SetText("My translated objective")
  14.     end
  15. end)
  Reply With Quote
01-03-21, 10:26 AM   #16
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
Well done. Addon is complete.
Thanks again, Vrul, for you help.

  Reply With Quote
01-06-21, 06:48 AM   #17
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
There is one more point where the objectives text does not update.
If I collect 5/5 items, the text changes to the next task within the same quest.







Objective: "0/1 Cook the meat on the campfire" don't fired on QUEST_TRACKER_MODULE:EnumQuestWatchData or isn't in block.lines

EDIT - OK, I already know - I should check the properties: block.currentLine.Text
.

Last edited by Platine : 01-08-21 at 06:22 AM.
  Reply With Quote
01-15-21, 07:38 AM   #18
Platine
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 36
And the last problem in this objects:



Section: Bonus Objectives - how to get to them?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Frame temporary properties (frame.86c52870)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off