Skip to content

Commit

Permalink
- fix for assignments not working on connected realms
Browse files Browse the repository at this point in the history
- possible fix for positioning of PallyPower frame getting reset to middle of the screen
- fix for the missing options button on the assignment screen due to anchoring to a hidden button
  • Loading branch information
AznamirWoW committed Jun 23, 2023
1 parent 5dba8d9 commit 86dbee3
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 65 deletions.
10 changes: 8 additions & 2 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ local WisdomPallys, MightPallys, KingsPallys, SalvPallys, LightPallys, SancPally
local classlist, classes = {}, {}

PallyPower.player = UnitName("player")
PallyPower.realm = GetRealmName()

PallyPower_Assignments = {}
PallyPower_NormalAssignments = {}
Expand Down Expand Up @@ -182,6 +181,10 @@ function PallyPower:OnInitialize()
PallyPower_SavedPresets["PallyPower_Assignments"] = {[0] = {}}
PallyPower_SavedPresets["PallyPower_NormalAssignments"] = {[0] = {}}
end
local h = _G["PallyPowerFrame"]
h:ClearAllPoints()
h:SetPoint("CENTER", "UIParent", "CENTER", self.opt.display.offsetX, self.opt.display.offsetY)

end

function PallyPower:OnEnable()
Expand Down Expand Up @@ -266,7 +269,7 @@ function PallyPower:Reset()

local h = _G["PallyPowerFrame"]
h:ClearAllPoints()
h:SetPoint("CENTER", "UIParent", "CENTER", 0, 0)
h:SetPoint("CENTER", "UIParent", "CENTER", self.opt.display.offsetX, self.opt.display.offsetY)
self.opt.buffscale = 0.9
self.opt.border = "Blizzard Tooltip"
self.opt.layout = "Layout 2"
Expand Down Expand Up @@ -1568,6 +1571,7 @@ end

function PallyPower:PLAYER_ENTERING_WORLD()
--self:Debug("EVENT: PLAYER_ENTERING_WORLD")
PallyPower.realm = GetNormalizedRealmName() --GetRealmName()
self:UpdateLayout()
self:UpdateRoster()
self:ReportChannels()
Expand Down Expand Up @@ -3479,6 +3483,8 @@ function PallyPower:ClickHandle(button, mousebutton)
if (self.opt.display.LockBuffBars) then
LOCK_ACTIONBAR = "1"
end
local h = _G["PallyPowerFrame"]
_, _, _, self.opt.display.offsetX, self.opt.display.offsetY = h:GetPoint()
else
if (self.opt.display.LockBuffBars) then
LOCK_ACTIONBAR = "0"
Expand Down
4 changes: 3 additions & 1 deletion PallyPowerValues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ PALLYPOWER_DEFAULT_VALUES = {
HideTimerText = false,
LockBuffBars = false,
showPlayerButtons = true,
showClassButtons = true
showClassButtons = true,
offsetX = 0,
offsetY = 0
},
enabled = true,
layout = "Layout 2",
Expand Down
42 changes: 21 additions & 21 deletions PallyPower_TBC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
</Size>
Expand All @@ -1866,17 +1866,12 @@
</Anchors>
<Scripts>
<OnClick>
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:LoadPreset()
end
PallyPower:OpenConfigWindow();
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1885,30 +1880,31 @@
GameTooltip:Hide(self, motion);
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
</Button>
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Size>
<AbsDimension x = "120" y = "20"/>
<AbsDimension x = "100" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentOptions" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:Report();
PallyPower:LoadPreset()
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1918,25 +1914,29 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
<AbsDimension x = "120" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentReport" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PallyPower:OpenConfigWindow();
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
else
PallyPower:Report();
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand Down
42 changes: 21 additions & 21 deletions PallyPower_Vanilla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
</Size>
Expand All @@ -1853,17 +1853,12 @@
</Anchors>
<Scripts>
<OnClick>
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:LoadPreset()
end
PallyPower:OpenConfigWindow();
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1872,30 +1867,31 @@
GameTooltip:Hide(self, motion);
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
</Button>
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Size>
<AbsDimension x = "120" y = "20"/>
<AbsDimension x = "100" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentOptions" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:Report();
PallyPower:LoadPreset()
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1905,25 +1901,29 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
<AbsDimension x = "120" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentReport" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PallyPower:OpenConfigWindow();
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
else
PallyPower:Report();
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand Down
40 changes: 20 additions & 20 deletions PallyPower_Wrath.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
</Size>
Expand All @@ -1848,17 +1848,12 @@
</Anchors>
<Scripts>
<OnClick>
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:LoadPreset()
end
PallyPower:OpenConfigWindow();
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1868,29 +1863,30 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
<Button name = "$parentPreset" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_PRESET" hidden = "false">
<Size>
<AbsDimension x = "120" y = "20"/>
<AbsDimension x = "100" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentOptions" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
if InCombatLockdown() then return end
if IsShiftKeyDown() then
PallyPower:StorePreset()
else
PallyPower:Report();
PallyPower:LoadPreset()
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:SetText(PALLYPOWER_PRESET_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand All @@ -1900,25 +1896,29 @@
</OnLeave>
</Scripts>
</Button>
<Button name = "$parentOptions" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_OPTIONS" hidden = "false">
<Button name = "$parentReport" inherits = "GameMenuButtonTemplate" text = "PALLYPOWER_REPORT" hidden = "false">
<Size>
<AbsDimension x = "100" y = "20"/>
<AbsDimension x = "120" y = "20"/>
</Size>
<Anchors>
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentReport" relativePoint = "BOTTOMLEFT">
<Anchor point = "BOTTOMRIGHT" relativeTo = "$parentPreset" relativePoint = "BOTTOMLEFT">
<Offset>
<AbsDimension x = "-7" y = "0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PallyPower:OpenConfigWindow();
if PallyPower.opt.ReportChannel >0 then
PallyPower:Report("CHANNEL", PallyPower.opt.ReportChannel);
else
PallyPower:Report();
end
</OnClick>
<OnEnter>
if PallyPower.opt.ShowTooltips then
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM");
GameTooltip:SetText(PALLYPOWER_OPTIONS_DESC);
GameTooltip:SetText(PALLYPOWER_REPORT_DESC);
GameTooltip:Show(self, motion);
CursorUpdate(self, motion);
end
Expand Down

0 comments on commit 86dbee3

Please sign in to comment.