This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Re-positioning Strings  (Read 2801 times)

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
[QUESTION] Re-positioning Strings
« 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #1 on: November 09, 2013, 09:00:48 am »
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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #2 on: November 09, 2013, 09:41:46 am »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #3 on: November 10, 2013, 01:23:52 am »
Anyone know?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #4 on: November 10, 2013, 09:49:38 am »
Assembling the tooltips is hardcoded iirc.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #5 on: November 10, 2013, 10:32:24 am »
Quote from: "schlumpf"
Assembling the tooltips is hardcoded iirc.

Figures. Any tips on how I would go about making the changes I want?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #6 on: November 10, 2013, 12:28:22 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] Re-positioning Strings
« Reply #7 on: November 10, 2013, 04:45:39 pm »
Quote from: "schlumpf"
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:
Code: [Select]
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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »