(Classic) Modifying the Quest Watch Frame
Hi everyone!
I've recently begun exploring writing my own simple addons. I have a decent beginner's understanding of how to create new functions with an addon, but I'm having a difficult time understanding how to best modify/override existing Blizzard frames. As an example, I'd like to make some minor changes the Quest Watch frame in Classic. Simple cosmetic modifications like adjusting the fonts, text alignment, etc. I've found the Blizzard function that I believe controls the things I want to modify, which is QuestWatch_Update(). Here's a segment of code from that function: Code:
for j=1, numObjectives do I'm looking for some help with understanding the correct way to reference/alias/override this code to, for example, get rid of the hyphen in front of a tracked objective: Code:
-- original Thanks! |
I would innately follow what the original function did, cutting out everything else that's irrelevant to what you want to change.
In response to your example, this would hook the original function to run afterward and change the text of the objectives to remove the prepended dash. Lua Code:
|
Thank you for this! I'm going to work on this the next time I have the chance, but I didn't want to delay in thanking you. I appreciate it.
|
Okay, thanks again for that head start, SDPhantom. I used your demo as a guide and put together a hook that covers just about everything I wanted to do:
lua Code:
And the result: One question—the :SetJustifyH("RIGHT") parameter (not included in the above code) doesn't affect the quest titles or objectives. I'm thinking this could be due to the existing :SetPoint parameters that are used to position the text. Is it possible to use :SetJustifyH or another method to right-align the titles and objectives without breaking the layout? Thanks! Edit: I had some success with getting right-aligned titles and objectives by adjusting the SetPoint parameters: Lua Code:
Thanks again for setting me on the right path. |
:SetJustifyH() aligns text within the object's boundaries. Since no width or opposing points (left and right) are defined, it's automatically cropped to the size of the text contained. One issue I see is the width of the entire frame derives off calculations that depend on this behavior. The original function also calls UIParent's frame position manager, which means it may be susceptible to taint.
This series of setbacks may be why many UI addons opt to disable Blizzard's built-in tracker and build their own from scratch. |
Thanks for the additional info. I was able to knock out everything I wanted to accomplish thanks to your guidance. I appreciate the pointers!
|
All times are GMT -6. The time now is 04:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI