Merge pull request #2 from OldManAlpha/dev

Version 1.0.1
This commit is contained in:
OldManAlpha 2025-08-12 12:18:41 -07:00 committed by GitHub
commit 58270464c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 44 additions and 13 deletions

View File

@ -29,7 +29,6 @@ ContextMenu:SetDynamicOptions(function(addOption, level, args)
addOption("text", "Lock Position",
"func", function(self, gui)
PuppeteerSettings.SetFrameLocked(gui.FrameGroup.name, not self.checked)
gui.FrameGroup:UpdateHeaderColor()
end,
"initFunc", function(self, gui)
self.checked = PuppeteerSettings.IsFrameLocked(gui.FrameGroup.name)

View File

@ -634,10 +634,13 @@ end
local emptySpell = {}
function UnitFrame_OnClick(button, unit, unitFrame)
local binding = GetBindingFor(unit, GetKeyModifier(), button)
if not UnitExists(unit) then
if binding and binding.Type == "ACTION" then
RunBinding(binding, unit, unitFrame)
end
return
end
local binding = GetBindingFor(unit, GetKeyModifier(), button)
local targetCastable = UnitIsConnected(unit) and UnitIsVisible(unit)
local wantToRes = PTOptions.AutoResurrect and util.IsDeadFriend(unit) and ResurrectionSpells[GetClass("player")]
if not binding then

View File

@ -1,5 +1,5 @@
## Interface: 11200
## Version: 1.0.0
## Version: 1.0.1
## Title: Puppeteer
## Notes: Unit frames addon tailored for healers
## Author: OldManAlpha, Richard Truax(i2ichardt)

View File

@ -465,6 +465,7 @@ function SetFrameHidden(frameName, hidden)
PTOptions.FrameOptions[frameName] = {}
end
PTOptions.FrameOptions[frameName].Hidden = hidden
PTSettingsGui.UpdateFrameOptions()
end
function IsFrameLocked(frameName)
@ -476,4 +477,9 @@ function SetFrameLocked(frameName, locked)
PTOptions.FrameOptions[frameName] = {}
end
PTOptions.FrameOptions[frameName].Locked = locked
local group = Puppeteer.UnitFrameGroups[frameName]
if group then
group:UpdateHeaderColor()
end
PTSettingsGui.UpdateFrameOptions()
end

View File

@ -649,10 +649,20 @@ end
function CreateTab_Customize()
local container = TabFrame:CreateTab("Customize")
local layout = NewLabeledColumnLayout(container, {100, 340}, -40, 10)
local frameStyleContainer = PTGuiLib.Get("container", container)
:SetSimpleBackground()
:SetPoint("TOPLEFT", container, "TOPLEFT", 5, -26)
:SetPoint("BOTTOMRIGHT", container, "TOPRIGHT", -5, -120)
local layout = NewLabeledColumnLayout(frameStyleContainer, {100, 340}, -35, 10)
local frameSettingsText = CreateLabel(frameStyleContainer, "Frame Group Settings")
:SetPoint("TOP", frameStyleContainer, "TOP", 0, -5)
:SetFontSize(14)
local preferredFrameOrder = {"Party", "Pets", "Raid", "Raid Pets", "Target", "Focus"}
local frameDropdown = CreateLabeledDropdown(container, "Select Frame", "The frame to edit the style of")
local frameDropdown = CreateLabeledDropdown(frameStyleContainer, "Select Frame", "The frame to edit the attributes of")
:SetWidth(150)
:SetDynamicOptions(function(addOption, level, args)
for _, name in ipairs(preferredFrameOrder) do
@ -677,14 +687,14 @@ function CreateTab_Customize()
end,
func = function(self, gui)
StyleDropdown:UpdateText()
HideFrameCheckbox:SetChecked(PuppeteerSettings.IsFrameHidden(self.text))
UpdateFrameOptions()
end
})
:SetText("Party")
FrameDropdown = frameDropdown
layout:layoutComponent(frameDropdown)
local GetSelectedProfileName = PuppeteerSettings.GetSelectedProfileName
local styleDropdown = CreateLabeledDropdown(container, "Choose Style", "The style of the frame")
local styleDropdown = CreateLabeledDropdown(frameStyleContainer, "Choose Style", "The style of the frame")
:SetWidth(150)
:SetDynamicOptions(function(addOption, level, args)
local profiles = PTProfileManager.GetProfileNames()
@ -738,20 +748,28 @@ function CreateTab_Customize()
StyleDropdown = styleDropdown
layout:offset(0, 10):layoutComponent(styleDropdown)
local hideFrameCheckbox = CreateLabeledCheckbox(container, "Hide Frame", "If checked, this frame will not be visible")
local lockFrameCheckbox = CreateLabeledCheckbox(frameStyleContainer, "Lock Frame", {"If checked, this frame will not be movable",
"Note: This setting is also accessible by right-clicking the group title bar"})
:OnClick(function(self)
local frameName = frameDropdown:GetText()
PuppeteerSettings.SetFrameLocked(frameName, self:GetChecked() == 1)
end)
layout:column(2):layoutComponent(lockFrameCheckbox)
LockFrameCheckbox = lockFrameCheckbox
local hideFrameCheckbox = CreateLabeledCheckbox(frameStyleContainer, "Hide Frame", "If checked, this frame will not be visible")
:OnClick(function(self)
local frameName = frameDropdown:GetText()
if not PTOptions.FrameOptions[frameName] then
PTOptions.FrameOptions[frameName] = {}
end
PuppeteerSettings.SetFrameHidden(frameName, self:GetChecked() == 1)
Puppeteer.CheckGroup()
end)
layout:column(2):levelAt(1):layoutComponent(hideFrameCheckbox)
layout:layoutComponent(hideFrameCheckbox)
HideFrameCheckbox = hideFrameCheckbox
UpdateFrameOptions()
local overrideContainer = PTGuiLib.Get("scroll_frame", container)
:SetPoint("TOPLEFT", container, "TOPLEFT", 5, -100)
:SetPoint("TOPLEFT", frameStyleContainer, "BOTTOMLEFT", 0, -5)
:SetPoint("BOTTOMRIGHT", container, "BOTTOMRIGHT", -5, 5)
:SetSimpleBackground()
StyleOverrideContainer = overrideContainer
@ -825,6 +843,11 @@ function CreateTab_Customize()
add(createDropdown("Vertical Spacing", "The number of pixels between units", "VerticalSpacing", {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))
end
function UpdateFrameOptions()
LockFrameCheckbox:SetChecked(PuppeteerSettings.IsFrameLocked(FrameDropdown:GetText()))
HideFrameCheckbox:SetChecked(PuppeteerSettings.IsFrameHidden(FrameDropdown:GetText()))
end
StyleOverrideComponents = {}
CurrentStyleOverride = nil