mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 05:30:00 +00:00
eqcompare: add equip compare tooltips
This commit is contained in:
Vendored
+9
@@ -16,6 +16,15 @@ pfLocaleBagtypes["deDE"] = {
|
||||
["Behälter"] = "DEFAULT",
|
||||
}
|
||||
|
||||
pfLocaleInvtypes["deDE"] = {
|
||||
["INVTYPE_WAND"] = "Zauberstab",
|
||||
["INVTYPE_GUN"] = "Schusswaffe",
|
||||
["INVTYPE_GUNPROJECTILE"] = "Projektil",
|
||||
["INVTYPE_BOWPROJECTILE"] = "Projektil",
|
||||
["INVTYPE_CROSSBOW"] = "Armbrust",
|
||||
["INVTYPE_THROWN"] = "Wurfwaffe",
|
||||
}
|
||||
|
||||
pfLocaleShift["deDE"] = {
|
||||
['BattleStance'] = "Kampfhaltung",
|
||||
['DefensiveStance'] = "Verteidigungshaltung",
|
||||
|
||||
Vendored
+9
@@ -16,6 +16,15 @@ pfLocaleBagtypes["enUS"] = {
|
||||
["Bag"] = "DEFAULT"
|
||||
}
|
||||
|
||||
pfLocaleInvtypes["enUS"] = {
|
||||
["INVTYPE_WAND"] = "Wand",
|
||||
["INVTYPE_GUN"] = "Gun",
|
||||
["INVTYPE_GUNPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_BOWPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_CROSSBOW"] = "Crossbow",
|
||||
["INVTYPE_THROWN"] = "Thrown",
|
||||
}
|
||||
|
||||
pfLocaleShift["enUS"] = {
|
||||
['BattleStance'] = "Battle Stance",
|
||||
['DefensiveStance'] = "Defensive Stance",
|
||||
|
||||
Vendored
+9
@@ -16,6 +16,15 @@ pfLocaleBagtypes["frFR"] = {
|
||||
["Conteneur"] = "DEFAULT"
|
||||
}
|
||||
|
||||
pfLocaleInvtypes["frFR"] = {
|
||||
["INVTYPE_WAND"] = "Baguette",
|
||||
["INVTYPE_GUN"] = "Arme \195\160 feu",
|
||||
["INVTYPE_GUNPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_BOWPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_CROSSBOW"] = "Arbal\195\168te",
|
||||
["INVTYPE_THROWN"] = "Armes de jet",
|
||||
}
|
||||
|
||||
pfLocaleShift["frFR"] = { -- TODO
|
||||
['BattleStance'] = "Battle Stance",
|
||||
['DefensiveStance'] = "Defensive Stance",
|
||||
|
||||
Vendored
+9
@@ -16,6 +16,15 @@ pfLocaleBagtypes["ruRU"] = {
|
||||
["Сумка"] = "DEFAULT"
|
||||
}
|
||||
|
||||
pfLocaleInvtypes["ruRU"] = { -- TODO
|
||||
["INVTYPE_WAND"] = "Wand",
|
||||
["INVTYPE_GUN"] = "Gun",
|
||||
["INVTYPE_GUNPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_BOWPROJECTILE"] = "Projectile",
|
||||
["INVTYPE_CROSSBOW"] = "Crossbow",
|
||||
["INVTYPE_THROWN"] = "Thrown",
|
||||
}
|
||||
|
||||
pfLocaleShift["ruRU"] = { -- TODO
|
||||
['BattleStance'] = "Battle Stance",
|
||||
['DefensiveStance'] = "Defensive Stance",
|
||||
|
||||
Vendored
+9
@@ -16,6 +16,15 @@ pfLocaleBagtypes["zhCN"] = {
|
||||
["包裹"] = "DEFAULT"
|
||||
}
|
||||
|
||||
pfLocaleInvtypes["zhCN"] = {
|
||||
["INVTYPE_WAND"] = "魔杖",
|
||||
["INVTYPE_GUN"] = "枪械",
|
||||
["INVTYPE_GUNPROJECTILE"] = "弹药",
|
||||
["INVTYPE_BOWPROJECTILE"] = "弹药",
|
||||
["INVTYPE_CROSSBOW"] = "弩",
|
||||
["INVTYPE_THROWN"] = "投掷武器",
|
||||
}
|
||||
|
||||
pfLocaleShift["zhCN"] = { -- TODO
|
||||
['BattleStance'] = "Battle Stance",
|
||||
['DefensiveStance'] = "Defensive Stance",
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
pfUI:RegisterModule("eqcompare", function ()
|
||||
local loc = pfUI.cache["locale"]
|
||||
for key, value in pairs(pfLocaleInvtypes[loc]) do setglobal(key, value) end
|
||||
INVTYPE_WEAPON_OTHER = INVTYPE_WEAPON.."_other";
|
||||
INVTYPE_FINGER_OTHER = INVTYPE_FINGER.."_other";
|
||||
INVTYPE_TRINKET_OTHER = INVTYPE_TRINKET.."_other";
|
||||
|
||||
pfUI.slotTable = {
|
||||
[INVTYPE_2HWEAPON] = "MainHandSlot",
|
||||
[INVTYPE_BODY] = "ShirtSlot",
|
||||
[INVTYPE_CHEST] = "ChestSlot",
|
||||
[INVTYPE_CLOAK] = "BackSlot",
|
||||
[INVTYPE_FEET] = "FeetSlot",
|
||||
[INVTYPE_FINGER] = "Finger0Slot",
|
||||
[INVTYPE_FINGER_OTHER] = "Finger1Slot",
|
||||
[INVTYPE_HAND] = "HandsSlot",
|
||||
[INVTYPE_HEAD] = "HeadSlot",
|
||||
[INVTYPE_HOLDABLE] = "SecondaryHandSlot",
|
||||
[INVTYPE_LEGS] = "LegsSlot",
|
||||
[INVTYPE_NECK] = "NeckSlot",
|
||||
[INVTYPE_RANGED] = "RangedSlot",
|
||||
[INVTYPE_RELIC] = "RangedSlot",
|
||||
[INVTYPE_ROBE] = "ChestSlot",
|
||||
[INVTYPE_SHIELD] = "SecondaryHandSlot",
|
||||
[INVTYPE_SHOULDER] = "ShoulderSlot",
|
||||
[INVTYPE_TABARD] = "TabardSlot",
|
||||
[INVTYPE_TRINKET] = "Trinket0Slot",
|
||||
[INVTYPE_TRINKET_OTHER] = "Trinket1Slot",
|
||||
[INVTYPE_WAIST] = "WaistSlot",
|
||||
[INVTYPE_WEAPON] = "MainHandSlot",
|
||||
[INVTYPE_WEAPON_OTHER] = "SecondaryHandSlot",
|
||||
[INVTYPE_WEAPONMAINHAND] = "MainHandSlot",
|
||||
[INVTYPE_WEAPONOFFHAND] = "SecondaryHandSlot",
|
||||
[INVTYPE_WRIST] = "WristSlot",
|
||||
|
||||
[INVTYPE_WAND] = "RangedSlot",
|
||||
[INVTYPE_GUN] = "RangedSlot",
|
||||
[INVTYPE_GUNPROJECTILE] = "AmmoSlot",
|
||||
[INVTYPE_BOWPROJECTILE] = "AmmoSlot",
|
||||
[INVTYPE_CROSSBOW] = "RangedSlot",
|
||||
[INVTYPE_THROWN] = "RangedSlot",
|
||||
}
|
||||
|
||||
pfUI.eqcompare = CreateFrame( "Frame" , "pfEQCompare", GameTooltip )
|
||||
pfUI.eqcompare:SetScript("OnShow", function()
|
||||
if not IsShiftKeyDown() then return end
|
||||
local border = tonumber(pfUI_config.appearance.border.default)
|
||||
|
||||
for i=1,GameTooltip:NumLines() do
|
||||
local tmpText = getglobal("GameTooltipTextLeft"..i)
|
||||
|
||||
for slotType, slotName in pairs(pfUI.slotTable) do
|
||||
if tmpText:GetText() == slotType then
|
||||
local slotID = GetInventorySlotInfo(pfUI.slotTable[slotType])
|
||||
|
||||
-- determine screen part
|
||||
local ltrigger = GetScreenWidth() / 2
|
||||
local x = GetCursorPosition()
|
||||
x = x / UIParent:GetEffectiveScale()
|
||||
if x > ltrigger then ltrigger = nil end
|
||||
|
||||
-- first tooltip
|
||||
ShoppingTooltip1:SetOwner(GameTooltip, "ANCHOR_NONE");
|
||||
ShoppingTooltip1:ClearAllPoints();
|
||||
|
||||
if ltrigger then
|
||||
ShoppingTooltip1:SetPoint("BOTTOMLEFT", GameTooltip, "BOTTOMRIGHT", 0, 0);
|
||||
else
|
||||
ShoppingTooltip1:SetPoint("BOTTOMRIGHT", GameTooltip, "BOTTOMLEFT", -border*2-1, 0);
|
||||
end
|
||||
|
||||
ShoppingTooltip1:SetInventoryItem("player", slotID)
|
||||
ShoppingTooltip1:Show();
|
||||
|
||||
-- second tooltip
|
||||
if pfUI.slotTable[slotType .. "_other"] then
|
||||
local slotID_other = GetInventorySlotInfo(pfUI.slotTable[slotType .. "_other"])
|
||||
|
||||
ShoppingTooltip2:SetOwner(GameTooltip, "ANCHOR_NONE");
|
||||
ShoppingTooltip2:ClearAllPoints();
|
||||
|
||||
if ltrigger then
|
||||
ShoppingTooltip2:SetPoint("BOTTOMLEFT", ShoppingTooltip1, "BOTTOMRIGHT", 0, 0);
|
||||
else
|
||||
ShoppingTooltip2:SetPoint("BOTTOMRIGHT", ShoppingTooltip1, "BOTTOMLEFT", -border*2-1, 0);
|
||||
end
|
||||
|
||||
ShoppingTooltip2:SetInventoryItem("player", slotID_other)
|
||||
ShoppingTooltip2:Show();
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
+6
-4
@@ -79,15 +79,17 @@ pfUI.utils:CreateBackdrop(ShoppingTooltip1)
|
||||
pfUI.utils:CreateBackdrop(ShoppingTooltip2)
|
||||
|
||||
ShoppingTooltip1:SetScript("OnShow", function()
|
||||
local a, b, c, _, _ = this:GetPoint()
|
||||
local a, b, c, d, e = this:GetPoint()
|
||||
local border = tonumber(pfUI_config.appearance.border.default)
|
||||
this:SetPoint(a, b, c, border*2+1, 0)
|
||||
if not d or d == 0 then d = (border*2)+d+1 end
|
||||
this:SetPoint(a, b, c, d, e)
|
||||
end)
|
||||
|
||||
ShoppingTooltip2:SetScript("OnShow", function()
|
||||
local a, b, c, _, _ = this:GetPoint()
|
||||
local a, b, c, d, e = this:GetPoint()
|
||||
local border = tonumber(pfUI_config.appearance.border.default)
|
||||
this:SetPoint(a, b, c, border*2+1, 0)
|
||||
if not d or d == 0 then d = (border*2)+d+1 end
|
||||
this:SetPoint(a, b, c, d, e)
|
||||
end)
|
||||
|
||||
pfUI.utils:CreateBackdrop(TicketStatusFrame)
|
||||
|
||||
@@ -29,6 +29,7 @@ pfUI.movables = {}
|
||||
|
||||
pfLocaleClass = {}
|
||||
pfLocaleBagtypes = {}
|
||||
pfLocaleInvtypes = {}
|
||||
pfLocaleShift = {}
|
||||
pfLocaleSpells = {}
|
||||
pfLocaleSpellEvents = {}
|
||||
|
||||
Reference in New Issue
Block a user