Im trying to hook this function:
Code:
function DEFAULT_OBJECTIVE_TRACKER_MODULE:SetStringText(fontString, text, useFullHeight, colorStyle, useHighlight)
fontString:SetHeight(0);
fontString:SetText(text);
local stringHeight = fontString:GetHeight();
if ( stringHeight > OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT and not useFullHeight ) then
fontString:SetHeight(OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT);
stringHeight = OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT;
end
colorStyle = colorStyle or OBJECTIVE_TRACKER_COLOR["Normal"];
if ( useHighlight and colorStyle.reverse ) then
colorStyle = colorStyle.reverse;
end
if ( fontString.colorStyle ~= colorStyle ) then
fontString:SetTextColor(colorStyle.r, colorStyle.g, colorStyle.b);
fontString.colorStyle = colorStyle;
end
return stringHeight;
end
I tried using
Code:
hooksecurefunc(DEFAULT_OBJECTIVE_TRACKER_MODULE,"SetStringText",function(fontString, text, useFullHeight, colorStyle, useHighlight)
fontString:SetHeight(0);
fontString:SetText(text);
local stringHeight = fontString:GetHeight();
if ( stringHeight > OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT and not useFullHeight ) then
fontString:SetHeight(OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT);
stringHeight = OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT;
end
colorStyle = colorStyle or OBJECTIVE_TRACKER_COLOR["Normal"];
if ( useHighlight and colorStyle.reverse ) then
colorStyle = colorStyle.reverse;
end
if ( fontString.colorStyle ~= colorStyle ) then
fontString:SetTextColor(colorStyle.r, colorStyle.g, colorStyle.b);
fontString.colorStyle = colorStyle;
end
return stringHeight;
end)
I want to alter the fontstrings, but it kept trowing errors at me. What am i doing wrong?