mirror of
https://github.com/OldManAlpha/Puppeteer.git
synced 2025-11-28 23:48:35 +00:00
Change profile names & add very small profiles
This commit is contained in:
parent
0f90fa9e3d
commit
b69d04e644
@ -498,7 +498,7 @@ function GetAuraInfo(unit, type, index)
|
||||
end
|
||||
|
||||
function ApplySpellsTooltip(attachTo, unit)
|
||||
if not HMOptions.ShowSpellsTooltip then
|
||||
if not HMOptions.SpellsTooltip.Enabled then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@ -11,7 +11,8 @@ setfenv(1, HMProfileManager)
|
||||
local util = getglobal("HMUtil")
|
||||
|
||||
DefaultProfileOrder = {
|
||||
"Compact", "Compact (Short Bar)", "Compact (Small)", "Long", "Long (Small)", "Long (Integrated)", "Legacy"
|
||||
"Default", "Default (Short Bar)", "Small", "Very Small", "Very Small (Horizontal)", "Long", "Long (Small)",
|
||||
"Long (Integrated)", "Legacy"
|
||||
}
|
||||
DefaultProfileOrder = util.ToSet(DefaultProfileOrder, true)
|
||||
|
||||
@ -20,7 +21,7 @@ function GetProfile(name)
|
||||
end
|
||||
|
||||
function CreateProfile(name, baseName)
|
||||
HMDefaultProfiles[name] = HMUIProfile:New(GetProfile(baseName or "Compact"))
|
||||
HMDefaultProfiles[name] = HMUIProfile:New(GetProfile(baseName or "Default"))
|
||||
return HMDefaultProfiles[name]
|
||||
end
|
||||
|
||||
@ -30,10 +31,8 @@ function InitializeDefaultProfiles()
|
||||
-- Master base profile
|
||||
HMDefaultProfiles["Base"] = HMUIProfile:New()
|
||||
|
||||
HMDefaultProfiles["Long"] = HMUIProfile:New(GetProfile("Base"))
|
||||
|
||||
do
|
||||
local profile = GetProfile("Long")
|
||||
local profile = CreateProfile("Long", "Base")
|
||||
profile.RaidMarkIcon.AlignmentH = "CENTER"
|
||||
profile.RaidMarkIcon.PaddingV = 0
|
||||
profile.RaidMarkIcon.OffsetY = 5
|
||||
@ -43,12 +42,13 @@ function InitializeDefaultProfiles()
|
||||
profile.RoleIcon.AlignmentH = "LEFT"
|
||||
profile.RoleIcon.PaddingV = 0
|
||||
profile.RoleIcon.OffsetY = 5
|
||||
profile.RoleIcon.OffsetX = 5
|
||||
profile.RoleIcon.OffsetX = -5
|
||||
end
|
||||
|
||||
|
||||
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Long (Small)"] = profile
|
||||
local profile = CreateProfile("Long (Small)", "Base")
|
||||
|
||||
profile.Width = 120
|
||||
profile.HealthBarHeight = 16
|
||||
@ -74,12 +74,12 @@ function InitializeDefaultProfiles()
|
||||
profile.RoleIcon.AlignmentH = "LEFT"
|
||||
profile.RoleIcon.PaddingV = 0
|
||||
profile.RoleIcon.OffsetY = 5
|
||||
profile.RoleIcon.OffsetX = 4
|
||||
profile.RoleIcon.OffsetX = -4
|
||||
end
|
||||
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Long (Integrated)"] = profile
|
||||
local profile = CreateProfile("Long (Integrated)", "Base")
|
||||
|
||||
profile.HealthBarHeight = 35
|
||||
profile.PaddingBottom = 0
|
||||
profile.AuraTracker.Height = 17
|
||||
@ -103,12 +103,11 @@ function InitializeDefaultProfiles()
|
||||
profile.RoleIcon.AlignmentH = "LEFT"
|
||||
profile.RoleIcon.PaddingV = 0
|
||||
profile.RoleIcon.OffsetY = 6
|
||||
profile.RoleIcon.OffsetX = 5
|
||||
profile.RoleIcon.OffsetX = -5
|
||||
end
|
||||
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Compact (Small)"] = profile
|
||||
local profile = CreateProfile("Small", "Base")
|
||||
|
||||
profile.Width = 67
|
||||
profile.HealthBarHeight = 36
|
||||
@ -165,8 +164,66 @@ function InitializeDefaultProfiles()
|
||||
end
|
||||
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Compact"] = profile
|
||||
local profile = CreateProfile("Very Small", "Base")
|
||||
|
||||
profile.Width = 50
|
||||
profile.HealthBarHeight = 29
|
||||
profile.NameText.FontSize = 9
|
||||
profile.NameText.AlignmentH = "LEFT"
|
||||
profile.NameText.AlignmentV = "TOP"
|
||||
profile.NameText.PaddingV = 1
|
||||
profile.NameText.OffsetX = 6
|
||||
profile.NameText.MaxWidth = 34
|
||||
profile.NameText.Color = "Class"
|
||||
profile.PowerBarHeight = 5
|
||||
profile.PaddingBottom = 0
|
||||
profile.AuraTracker.Height = 11
|
||||
profile.AuraTracker.Anchor = "Health Bar"
|
||||
profile.AuraTracker.AlignmentH = "LEFT"
|
||||
profile.TrackedAurasAlignment = "BOTTOM"
|
||||
profile.TrackedAurasSpacing = 1
|
||||
|
||||
local healthTexts = profile.HealthTexts
|
||||
healthTexts.Normal.FontSize = 8
|
||||
healthTexts.Normal.AlignmentH = "CENTER"
|
||||
healthTexts.Normal.AlignmentV = "CENTER"
|
||||
healthTexts.Normal.OffsetY = 1
|
||||
|
||||
profile.IncomingHealDisplay = "Hidden"
|
||||
profile.IncomingHealText.AlignmentH = "RIGHT"
|
||||
profile.IncomingHealText.AlignmentV = "CENTER"
|
||||
profile.IncomingHealText.OffsetY = -6
|
||||
profile.IncomingHealText.PaddingH = 2
|
||||
profile.IncomingHealText.FontSize = 7
|
||||
|
||||
profile.RangeText.AlignmentV = "CENTER"
|
||||
profile.RangeText.OffsetY = -6
|
||||
profile.RangeText.FontSize = 7
|
||||
profile.LineOfSightIcon.Width = 16
|
||||
profile.LineOfSightIcon.Height = 16
|
||||
profile.LineOfSightIcon.Anchor = "Health Bar"
|
||||
profile.LineOfSightIcon.Opacity = 70
|
||||
profile.RoleIcon.Width = 10
|
||||
profile.RoleIcon.Height = 10
|
||||
profile.RaidMarkIcon.AlignmentH = "CENTER"
|
||||
profile.RaidMarkIcon.PaddingV = 0
|
||||
profile.RaidMarkIcon.OffsetY = 4
|
||||
profile.RaidMarkIcon.Width = 10
|
||||
profile.RaidMarkIcon.Height = 10
|
||||
profile.HealthDisplay = "Health"
|
||||
profile.MissingHealthDisplay = "Hidden"
|
||||
profile.PowerDisplay = "Hidden"
|
||||
profile.PowerText.FontSize = 8
|
||||
profile.Orientation = "Vertical"
|
||||
end
|
||||
|
||||
do
|
||||
local profile = CreateProfile("Very Small (Horizontal)", "Very Small")
|
||||
profile.Orientation = "Horizontal"
|
||||
end
|
||||
|
||||
do
|
||||
local profile = CreateProfile("Default", "Base")
|
||||
|
||||
profile.Width = 100
|
||||
profile.HealthBarHeight = 36
|
||||
@ -219,8 +276,7 @@ function InitializeDefaultProfiles()
|
||||
end
|
||||
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Compact (Short Bar)"] = profile
|
||||
local profile = CreateProfile("Default (Short Bar)", "Base")
|
||||
|
||||
profile.Width = 100
|
||||
profile.HealthBarHeight = 24
|
||||
@ -233,7 +289,7 @@ function InitializeDefaultProfiles()
|
||||
profile.NameText.Anchor = "Container"
|
||||
profile.PaddingTop = 12
|
||||
profile.PaddingBottom = 0
|
||||
profile.AuraTracker.Height = 12
|
||||
profile.AuraTracker.Height = 13
|
||||
profile.AuraTracker.Anchor = "Health Bar"
|
||||
profile.AuraTracker.AlignmentH = "LEFT"
|
||||
profile.TrackedAurasAlignment = "BOTTOM"
|
||||
@ -278,8 +334,7 @@ function InitializeDefaultProfiles()
|
||||
|
||||
-- Legacy profile - Meant to look as close as possible to HealersMate 1.3.0
|
||||
do
|
||||
local profile = HMUIProfile:New(GetProfile("Base"))
|
||||
HMDefaultProfiles["Legacy"] = profile
|
||||
local profile = CreateProfile("Legacy", "Base")
|
||||
|
||||
profile.Width = 200
|
||||
|
||||
|
||||
67
Settings.lua
67
Settings.lua
@ -63,6 +63,7 @@ function HealersMateSettings.SetDefaults()
|
||||
HMOptions = {}
|
||||
end
|
||||
|
||||
local OPTIONS_VERSION = 2
|
||||
local isHealer = util.IsHealerClass("player")
|
||||
local isManaUser = util.ClassPowerTypes[util.GetClass("player")]
|
||||
do
|
||||
@ -82,6 +83,7 @@ function HealersMateSettings.SetDefaults()
|
||||
["InRaid"] = false
|
||||
},
|
||||
["SpellsTooltip"] = {
|
||||
["Enabled"] = isHealer,
|
||||
["ShowManaCost"] = false,
|
||||
["ShowManaPercentCost"] = true,
|
||||
["HideCastsAbove"] = 3,
|
||||
@ -97,25 +99,70 @@ function HealersMateSettings.SetDefaults()
|
||||
["Long"] = 60 * 2 -- >2 min
|
||||
},
|
||||
["CastWhen"] = "Mouse Up", -- Mouse Up, Mouse Down
|
||||
["ShowSpellsTooltip"] = isHealer,
|
||||
["UseHealPredictions"] = true,
|
||||
["SetMouseover"] = true,
|
||||
["TestUI"] = false,
|
||||
["Hidden"] = false,
|
||||
["ChosenProfiles"] = {
|
||||
["Party"] = "Compact",
|
||||
["Pets"] = "Compact",
|
||||
["Raid"] = "Compact (Small)",
|
||||
["Raid Pets"] = "Compact (Small)",
|
||||
["Party"] = "Default",
|
||||
["Pets"] = "Default",
|
||||
["Raid"] = "Small",
|
||||
["Raid Pets"] = "Small",
|
||||
["Target"] = "Long",
|
||||
["Focus"] = "Compact"
|
||||
["Focus"] = "Default"
|
||||
},
|
||||
["Scripts"] = {
|
||||
["OnLoad"] = "",
|
||||
["OnPostLoad"] = ""
|
||||
},
|
||||
["OptionsVersion"] = 1
|
||||
["OptionsVersion"] = OPTIONS_VERSION
|
||||
}
|
||||
|
||||
local optionsUpgrades = {
|
||||
{
|
||||
version = 2,
|
||||
upgrade = function(self, options)
|
||||
local upgraded = util.CloneTable(options, true)
|
||||
if options["ShowSpellsTooltip"] ~= nil then
|
||||
if not options["SpellsTooltip"] then
|
||||
upgraded["SpellsTooltip"] = {}
|
||||
end
|
||||
upgraded["SpellsTooltip"]["Enabled"] = options["ShowSpellsTooltip"]
|
||||
upgraded["ShowSpellsTooltip"] = nil
|
||||
end
|
||||
if options["ChosenProfiles"] ~= nil then
|
||||
local groupNames = {"Party", "Pets", "Raid", "Raid Pets", "Target"}
|
||||
local changedProfileNames = {
|
||||
["Compact"] = "Default",
|
||||
["Compact (Small)"] = "Small",
|
||||
["Compact (Short Bar)"] = "Default (Short Bar)"
|
||||
}
|
||||
for _, name in ipairs(groupNames) do
|
||||
local currentlySelected = options["ChosenProfiles"][name]
|
||||
if changedProfileNames[currentlySelected] then
|
||||
upgraded["ChosenProfiles"][name] = changedProfileNames[currentlySelected]
|
||||
end
|
||||
end
|
||||
end
|
||||
upgraded["OptionsVersion"] = self.version
|
||||
return upgraded
|
||||
end,
|
||||
shouldUpgrade = function(self, options)
|
||||
return options.OptionsVersion < self.version
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
if HMOptions.OptionsVersion < OPTIONS_VERSION then
|
||||
for _, upgrade in ipairs(optionsUpgrades) do
|
||||
if upgrade:shouldUpgrade(HMOptions) then
|
||||
local prevVersion = HMOptions.OptionsVersion
|
||||
HMOptions = upgrade:upgrade(HMOptions)
|
||||
DEFAULT_CHAT_FRAME:AddMessage("[HealersMate] Upgraded options from version "..
|
||||
prevVersion.." to "..upgrade.version)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for field, value in pairs(defaults) do
|
||||
if HMOptions[field] == nil then
|
||||
@ -246,7 +293,7 @@ SpellsContext = {}
|
||||
function GetSelectedProfileName(frame)
|
||||
local selected = HMOptions.ChosenProfiles[frame]
|
||||
if not HMDefaultProfiles[selected] then
|
||||
selected = "Compact"
|
||||
selected = "Default"
|
||||
end
|
||||
return selected
|
||||
end
|
||||
@ -527,9 +574,9 @@ function InitSettings()
|
||||
CheckboxShowSpellsTooltip:SetPoint("LEFT", CheckboxShowSpellsTooltipLabel, "RIGHT", 5, yCheckboxOffset)
|
||||
CheckboxShowSpellsTooltip:SetWidth(20) -- width
|
||||
CheckboxShowSpellsTooltip:SetHeight(20) -- height
|
||||
CheckboxShowSpellsTooltip:SetChecked(HMOptions.ShowSpellsTooltip)
|
||||
CheckboxShowSpellsTooltip:SetChecked(HMOptions.SpellsTooltip.Enabled)
|
||||
CheckboxShowSpellsTooltip:SetScript("OnClick", function()
|
||||
HMOptions.ShowSpellsTooltip = CheckboxShowSpellsTooltip:GetChecked() == 1
|
||||
HMOptions.SpellsTooltip.Enabled = CheckboxShowSpellsTooltip:GetChecked() == 1
|
||||
end)
|
||||
ApplyTooltip(CheckboxShowSpellsTooltip, "Show the spells tooltip when hovering over frames")
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user