diff --git a/env/locales_deDE.lua b/env/locales_deDE.lua index 6bf375a1..b8be198c 100644 --- a/env/locales_deDE.lua +++ b/env/locales_deDE.lua @@ -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", diff --git a/env/locales_enUS.lua b/env/locales_enUS.lua index 08bb4d43..67e0a58f 100644 --- a/env/locales_enUS.lua +++ b/env/locales_enUS.lua @@ -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", diff --git a/env/locales_frFR.lua b/env/locales_frFR.lua index 617d17c5..c938c729 100644 --- a/env/locales_frFR.lua +++ b/env/locales_frFR.lua @@ -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", diff --git a/env/locales_ruRU.lua b/env/locales_ruRU.lua index 3dfc5867..ff95f120 100644 --- a/env/locales_ruRU.lua +++ b/env/locales_ruRU.lua @@ -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", diff --git a/env/locales_zhCN.lua b/env/locales_zhCN.lua index eeb62f17..1b749e63 100644 --- a/env/locales_zhCN.lua +++ b/env/locales_zhCN.lua @@ -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", diff --git a/modules/eqcompare.lua b/modules/eqcompare.lua new file mode 100644 index 00000000..dca5a6d9 --- /dev/null +++ b/modules/eqcompare.lua @@ -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) diff --git a/modules/skin.lua b/modules/skin.lua index 4ed4313c..d9e2a99c 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -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) diff --git a/pfUI.lua b/pfUI.lua index e31769d9..ad08eecf 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -29,6 +29,7 @@ pfUI.movables = {} pfLocaleClass = {} pfLocaleBagtypes = {} +pfLocaleInvtypes = {} pfLocaleShift = {} pfLocaleSpells = {} pfLocaleSpellEvents = {} diff --git a/pfUI.toc b/pfUI.toc index bab31368..a038b16c 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -54,3 +54,4 @@ modules\nameplates.lua modules\loot.lua modules\infight.lua modules\sellvalue.lua +modules\eqcompare.lua