I would like to SetJustifyH "CENTER" all ObjectiveTrackerBlocks and remove all "Dashes" as well. I'm talking about Blocks that contains information about Quests you currently track:
(Sorry for different language on screenshot)
![](https://cvws.icloud-content.com/CAEQARoQ343bdobvZJW6nLDxg6sTSA/0117d66283cac567925593fbd197b8ac1863dd5f89/IMG_0008.jpg?v=0&p=25&x=1&a=BaPBtc3z4pK9A0o1Lg%3D%3D&e=1444001856000&r=c7a1e614-ee74-33ac-2364-0005537e1cd1-9&u=1443918756117&c=CqsECocECqkDCih1cy1zdGQtMDAwMDEuczMtZXh0ZXJuYWwtMS5hbWF6b25hd3MuY29tEFAaA0dFVCLdAS9wZ3FpU0dNQlVEQVFPVkVBdnI0WD94LWNsaWVudC1yZXF1ZXN0LWlkPWM3YTFlNjE0LWVlNzQtMzNhYy0yMzY0LTAwMDU1MzdlMWNkMSZFeHBpcmVzPTE0NDM5MTg3NTYmYnl0ZS1yYW5nZT0xNDIzMzMyLTM4NTA1NDkmQVdTQWNjZXNzS2V5SWQ9QUtJQUlXV1IzM0VDSEtQQzJMVUEmYmluPTIwMTAwMDAwMSZTaWduYXR1cmU9U1MlMkZJWHpSJTJGcEwlMkZTR2cxTVl6ZGpEMXNNQzU4JTNEKgRIVFRQMgMxLjE6BGh0dHBCKwoKeC1hbXotZGF0ZRIdU2F0LCAwMyBPY3QgMjAxNSAyMzozNzozNiBHTVRCHgoFUmFuZ2USFWJ5dGVzPTE0MjMzMzItMzg1MDU0OUINCgZBY2NlcHQSAyovKkoJczNfdXNfc3RkUhdjdndzLmljbG91ZC1jb250ZW50LmNvbViV8o6CgyoSMQoVgVY_CaecDmtEKb9dZfmNz6fPCsrPEhEBNzWlYgn6rnOXswTnpVlCMBjSkpQBIAAaFHBncWlTR01CVURBUU9WRUF2cjRYIhBBL3pNVUZlY1ViRUhJakF1Eh8KFQEX1mKDysVnklWT-9GXuKwYY91fiRIECAAQACgAIAI&s=7ZtP-AsLcSie-PsVO6UtHPh-7E4)
Files that respond to this frames locates in Interface\AddOns\Blizzard_ObjectiveTracker\ folder.
There are lots of files in this folder, but I think most relevant is this:
Blizzard_ObjectiveTracker.lua (link to wowprogramming.com)
There are lot's of complex functions that I had never worked before. For example:
Lua Code:
function DEFAULT_OBJECTIVE_TRACKER_MODULE:SetHeader(block, text, animateReason)
block.module = self;
block.isHeader = true;
block.Text:SetText(text);
block.animateReason = animateReason or 0;
self.Header = block;
end
I tried to investigate more information about this functions and how they works, and for me (person who never programmed before, it's pretty hard to instantly understand them, but i would like).
On
Hooking Functions Guide I read that it's possible to hook this strange functions. This Guide gives this example:
Lua Code:
--[[Functions called using the object calling syntax, object:method(...), can also be hooked; one simply has to remember that the construct is merely syntactic sugar for objec*****thod(object, ...);. To hook a function that was originally declared as:]]
function AnAddon.Module:FuncName(arg1)
-- Things happen here...
end
--[[We store the original function and replace it with a hook:]]
local original_AnAddon_Module_FuncName = AnAddon.Module.FuncName;
function AnAddon.Module:FuncName(...)
local arg1 = ...; -- Use the vararg expression in case the function signature changes
if type(arg1) == "number" and arg1 > 0 then
-- Call the original function; because of object calling syntax,
-- pass self as the first argument.
return original_AnAddon_Module_FuncName(self, ...);
end
end
--[[The example hook above will only allow the original function to be called if the first argument is a strictly positive number.]]
According to this example, i tryed to hook Blizzards function "
DEFAULT_OBJECTIVE_TRACKER_MODULE:SetHeader" with this code:
Lua Code:
local DEFAULT_OBJECTIVE_TRACKER_MODULE_SET_HEADER = DEFAULT_OBJECTIVE_TRACKER_MODULE.SetHeader
function DEFAULT_OBJECTIVE_TRACKER_MODULE:SetHeader(...)
print("TEST")
return DEFAULT_OBJECTIVE_TRACKER_MODULE_SET_HEADER(self, ...);
end
But it looks like that i'm doing something wrong. I don't get any lua errors, but no print("TEST") as well, so it's not hooked.
I will very appreciate if you could help me with example of how can i hook this complex functions or with advice or ideas how can i SetJustifyH("CENTER") and remove Dash without hooking this crazy functions (Names of ObjectiveTrackerBlocks are dynamic: example on screenshot)
![Smile](//cdn-wow.mmoui.com/images/style_mmoi_wowi2/smilies/smile.gif)