Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Vortalex on November 09, 2013, 07:33:36 am
-
Yeah so, I'd like to re-position some strings on my item displays (e.g. moving "Item Level %d" or "Requires Level %s" to be above the "Soulbound" text). I can't seem to find it anywhere in the luas or xmls, so I'm assuming it's hardcoded. In which case, how exactly would I go about modifying it?
-
The full Interface is in Lua/XML.
And texts come from DBCs and server.
I don´t think that there is anythig hardcoded of that in wow.exe
-
I couldn't seem to find any lua or xml files that make references to "ITEM_MOD" besides the GlobalStrings.lua ofc. I'm not even sure which one determines the structure of the item hover-overlay.
-
Anyone know?
-
Assembling the tooltips is hardcoded iirc.
-
Assembling the tooltips is hardcoded iirc.
Figures. Any tips on how I would go about making the changes I want?
-
You'd need to find the function, then find where the different parts of it are added, possibly needing to move quite a lot of assembly. Without experience in reverse engineering and assembly, this'd most possibly not feasible.
-
You'd need to find the function, then find where the different parts of it are added, possibly needing to move quite a lot of assembly. Without experience in reverse engineering and assembly, this'd most possibly not feasible.
I've hacked such a system together using Lua/XML. I did it for the talent tooltips such required talent points is hardcoded in the client, so instead I overwrote the display with my own value. :)
I believe it was this function? Code is a mess, was a while ago:
function PlayerTalentFrameTalent_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetTalent(PanelTemplates_GetSelectedTab(PlayerTalentFrame), self:GetID(),
PlayerTalentFrame.inspect, PlayerTalentFrame.pet, PlayerTalentFrame.talentGroup, GetCVarBool("previewTalents"));
local canLearn = nil;
local wrapRest = false;
local l = GameTooltip:NumLines();
if (_G["GameTooltipTextLeft"..l]:GetText() == "Click to learn") then
canLearn = true;
wrapRest = true;
l = l - 1;
end
local tmp = {};
local r = true;
local i = 1;
for c=1, l do
r = true;
local n = {};
local left = _G["GameTooltipTextLeft"..c];
local right = _G["GameTooltipTextRight"..c];
if ( left ) then
n.w = true;
n.r1, n.g1, n.b1 = left:GetTextColor();
local t = left:GetText();
if ( strsub(t, 1, 8) == "Requires" ) then
n.w = wrapRest;
if ( strsub(t, -7) == "Talents" ) then
local d = tonumber(strmatch(t, "%d+")) / 5;
t = gsub(t, "%d+", d);
wrapRest = true;
if ( d <= PlayerTalentFrame.pointsSpent + PlayerTalentFrame.previewPointsSpent ) then
n.r1 = 1.0; n.g1 = 1.0; n.b1 = 1.0;
r = false;
if ( canLearn == nil ) then
canLearn = true;
end
end
elseif ( not wrapRest ) then
canLearn = false;
end
end
n.t1 = t;
end
if ( right ) then
n.r2, n.g2, n.b2 = right:GetTextColor();
n.t2 = right:GetText();
end
if ( r ) then
tmp[i] = n;
i = i + 1;
end
end
i = nil;
GameTooltip:ClearLines();
for i=1, #tmp do
if ( tmp[i].t1 and tmp[i].t2 ) then
GameTooltip:AddDoubleLine(tmp[i].t1, tmp[i].t2, tmp[i].r1, tmp[i].g1, tmp[i].b1, tmp[i].r2, tmp[i].g2, tmp[i].b2);
elseif ( tmp[i].t1 ) then
GameTooltip:AddLine(tmp[i].t1, tmp[i].r1, tmp[i].g1, tmp[i].b1, tmp[i].w);
elseif ( tmp[i].t2 ) then
GameTooltip:AddDoubleLine("", tmp[i].t2, 0, 0, 0, tmp[i].r2, tmp[i].g2, tmp[i].b2);
end
end
if ( canLearn ) then
GameTooltip:AddLine("Click to learn", 0, 1, 0, true);
end
GameTooltip:Show();
end