Quantcast

Testing some pawn button movement.

Repooc [11-03-16 - 03:52]
Testing some pawn button movement.
Filename
ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
ElvUI_SLE/skins/addons/load_addons.xml
ElvUI_SLE/skins/addons/pawn.lua
diff --git a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
index a0e487c..508dccd 100644
--- a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
+++ b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
@@ -486,9 +486,11 @@ function CA:Setup_CharacterArmory()
 	self.ScanTT = CreateFrame('GameTooltip', 'Knight_CharacterArmory_ScanTT', nil, 'GameTooltipTemplate')
 	self.ScanTT:SetOwner(UIParent, 'ANCHOR_NONE')

-	if _G["PawnUI_InventoryPawnButton"] then
-		_G["PawnUI_InventoryPawnButton"]:SetFrameLevel(_G["CharacterModelFrame"]:GetFrameLevel() + 1)
-	end
+	-- if _G["PawnUI_InventoryPawnButton"] then
+	-- 	_G["PawnUI_InventoryPawnButton"]:ClearAllPoints()
+	-- 	_G["PawnUI_InventoryPawnButton"]:SetFrameLevel(_G["CharacterModelFrame"]:GetFrameLevel() + 1)
+	-- 	_G["PawnUI_InventoryPawnButton"]:SetPoint('BOTTOMRIGHT', _G["PaperDollFrame"], 'BOTTOMRIGHT', 0, 0)
+	-- end

 	do -- Legion : Artifact Weapon Monitor
 		self.ArtifactMonitor = CreateFrame('Frame', nil, self)
diff --git a/ElvUI_SLE/skins/addons/load_addons.xml b/ElvUI_SLE/skins/addons/load_addons.xml
index 7a0615c..1b6d357 100644
--- a/ElvUI_SLE/skins/addons/load_addons.xml
+++ b/ElvUI_SLE/skins/addons/load_addons.xml
@@ -1,3 +1,4 @@
-<Ui xmlns="http://www.blizzard.com/wow/ui/">
+<Ui xmlns="http://www.blizzard.com/wow/ui/">
+	<Script file="pawn.lua"/>
 	<Script file="questguru.lua"/>
 </Ui>
\ No newline at end of file
diff --git a/ElvUI_SLE/skins/addons/pawn.lua b/ElvUI_SLE/skins/addons/pawn.lua
new file mode 100644
index 0000000..83bcf6d
--- /dev/null
+++ b/ElvUI_SLE/skins/addons/pawn.lua
@@ -0,0 +1,22 @@
+local SLE, T, E, L, V, P, G = unpack(select(2, ...))
+local S = E:GetModule('Skins');
+local Sk = SLE:GetModule("Skins")
+local _G = _G
+
+local function LoadSkin()
+	hooksecurefunc('PawnUI_InventoryPawnButton_Move', function()
+		if _G["PawnUI_InventoryPawnButton"] then
+			if PawnCommon.ButtonPosition == PawnButtonPositionRight then
+				--print("1")
+				_G["PawnUI_InventoryPawnButton"]:ClearAllPoints()
+				_G["PawnUI_InventoryPawnButton"]:SetPoint('BOTTOMRIGHT', _G["PaperDollFrame"], 'BOTTOMRIGHT', 0, 0)
+			elseif PawnCommon.ButtonPosition == PawnButtonPositionLeft then
+				--print("2")
+				_G["PawnUI_InventoryPawnButton"]:ClearAllPoints()
+				_G["PawnUI_InventoryPawnButton"]:SetPoint('BOTTOMLEFT', _G["PaperDollFrame"], 'BOTTOMLEFT', 0, 0)
+			end
+		end
+	end)
+end
+
+S:RegisterSkin('Pawn', LoadSkin)
\ No newline at end of file