From 60039c89c8c92aaa4eb0d8bdaf4f73fcfcfa7676 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 9 Jul 2017 19:44:48 +0200 Subject: [PATCH] loot: add option to manually set position --- api/config.lua | 1 + modules/gui.lua | 1 + modules/loot.lua | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/api/config.lua b/api/config.lua index b96b99b9..a7bbeab3 100644 --- a/api/config.lua +++ b/api/config.lua @@ -67,6 +67,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("loot", nil, "autoresize", "1") pfUI:UpdateConfig("loot", nil, "autopickup", "1") + pfUI:UpdateConfig("loot", nil, "mousecursor", "1") pfUI:UpdateConfig("unitframes", nil, "disable", "0") pfUI:UpdateConfig("unitframes", nil, "pastel", "1") diff --git a/modules/gui.lua b/modules/gui.lua index 515d8a6c..7af200d9 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1291,6 +1291,7 @@ pfUI:RegisterModule("gui", function () if not this.setup then CreateConfig(this, T["Enable Auto-Resize Loot Frame"], C.loot, "autoresize", "checkbox") CreateConfig(this, T["Disable Loot Confirmation Dialog (Without Group)"], C.loot, "autopickup", "checkbox") + CreateConfig(this, T["Enable Loot Window On MouseCursor"], C.loot, "mousecursor", "checkbox") this.setup = true end end) diff --git a/modules/loot.lua b/modules/loot.lua index 025cbdf3..18137b05 100644 --- a/modules/loot.lua +++ b/modules/loot.lua @@ -10,6 +10,13 @@ pfUI:RegisterModule("loot", function () pfUI.loot:RegisterEvent("LOOT_BIND_CONFIRM") pfUI.loot:SetWidth(160+C.appearance.border.default*2) + + if C.loot.mousecursor == "0" then + pfUI.loot:SetHeight(160+C.appearance.border.default*2) + pfUI.loot:SetPoint("TOP", UIParent, "CENTER", 0, 0) + UpdateMovable(pfUI.loot) + end + pfUI.loot.slots = {} function pfUI.loot:UpdateLootFrame() local maxrarity, maxwidth = 0, 0 @@ -198,12 +205,14 @@ pfUI:RegisterModule("loot", function () CloseLoot(not autoLoot) end - local x, y = GetCursorPosition() - x = x / this:GetEffectiveScale() - y = y / this:GetEffectiveScale() + if C.loot.mousecursor == "1" then + local x, y = GetCursorPosition() + x = x / this:GetEffectiveScale() + y = y / this:GetEffectiveScale() - this:ClearAllPoints() - this:SetPoint("TOPLEFT", nil, "BOTTOMLEFT", x-40, y+20) + this:ClearAllPoints() + this:SetPoint("TOPLEFT", nil, "BOTTOMLEFT", x-40, y+20) + end pfUI.loot:UpdateLootFrame() end