Add files via upload
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
-- Author: Travis
|
||||
|
||||
local IGW = {}
|
||||
IGW.VERSION = "3.1"
|
||||
IGW.VERSION = "3.2"
|
||||
|
||||
-- Global function for keybind (must be defined early)
|
||||
function ImprovedGuildWindow_Toggle()
|
||||
@@ -480,7 +480,8 @@ function IGW:InitializeSavedVariables()
|
||||
sortAscending = true,
|
||||
showOffline = true,
|
||||
opacity = 1.0,
|
||||
bgColor = {r = 0.15, g = 0.15, b = 0.15} -- Default dark grey
|
||||
bgColor = {r = 0.15, g = 0.15, b = 0.15}, -- Default dark grey
|
||||
officerRankCount = 3 -- Default: Guild Master + top 2 officer ranks (threshold = 2)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -488,7 +489,16 @@ function IGW:InitializeSavedVariables()
|
||||
if not ImprovedGuildWindowDB.bgColor then
|
||||
ImprovedGuildWindowDB.bgColor = {r = 0.15, g = 0.15, b = 0.15}
|
||||
end
|
||||
|
||||
|
||||
-- Ensure officerRankCount exists (for existing saved variables)
|
||||
if not ImprovedGuildWindowDB.officerRankCount then
|
||||
ImprovedGuildWindowDB.officerRankCount = 3
|
||||
end
|
||||
|
||||
-- Apply saved officer rank count: rankCount includes the GM (rank 0),
|
||||
-- so threshold = rankCount - 1 (e.g. 3 ranks → threshold 2 → indices 0,1,2)
|
||||
OFFICER_RANK_THRESHOLD = ImprovedGuildWindowDB.officerRankCount - 1
|
||||
|
||||
-- Load saved opacity or use default
|
||||
IGW_BG_OPACITY = ImprovedGuildWindowDB.opacity or 0.95
|
||||
|
||||
@@ -3866,7 +3876,7 @@ function IGW:ToggleOptionsWindow()
|
||||
if not IGW.optionsFrame then
|
||||
local of = CreateFrame("Frame", "IGW_OptionsFrame", UIParent)
|
||||
of:SetWidth(650) -- Same width as main window
|
||||
of:SetHeight(500) -- Same height as main window
|
||||
of:SetHeight(580) -- Increased to accommodate officer rank setting
|
||||
of:SetFrameStrata("DIALOG")
|
||||
of:SetFrameLevel(50)
|
||||
of:SetMovable(true)
|
||||
@@ -4122,8 +4132,46 @@ function IGW:ToggleOptionsWindow()
|
||||
rememberSortingLabel:SetText("Remember sorting (column and direction)")
|
||||
|
||||
of.rememberSortingCheck = rememberSortingCheck
|
||||
yOffset = yOffset - 35
|
||||
|
||||
-- # of Officer Ranks in Guild Section
|
||||
local officerRankHeader = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
|
||||
officerRankHeader:SetPoint("TOPLEFT", content, "TOPLEFT", 0, yOffset)
|
||||
officerRankHeader:SetText("# of Officer Ranks in Guild")
|
||||
yOffset = yOffset - 28
|
||||
|
||||
local officerRankLabel = content:CreateFontString(nil, "OVERLAY", "GameFontNormal")
|
||||
officerRankLabel:SetPoint("TOPLEFT", content, "TOPLEFT", 10, yOffset)
|
||||
officerRankLabel:SetText("Officer ranks (including Guild Master):")
|
||||
|
||||
local officerRankDropdown = CreateFrame("Button", "IGW_OfficerRankDropdown", content, "UIDropDownMenuTemplate")
|
||||
officerRankDropdown:SetPoint("LEFT", officerRankLabel, "RIGHT", -10, -2)
|
||||
UIDropDownMenu_SetWidth(60, officerRankDropdown)
|
||||
|
||||
local savedOfficerRankCount = (ImprovedGuildWindowDB and ImprovedGuildWindowDB.officerRankCount) or 3
|
||||
UIDropDownMenu_SetText(savedOfficerRankCount, officerRankDropdown)
|
||||
|
||||
UIDropDownMenu_Initialize(officerRankDropdown, function()
|
||||
local counts = {2, 3, 4}
|
||||
for i = 1, table.getn(counts) do
|
||||
local info = {}
|
||||
info.text = counts[i]
|
||||
info.value = counts[i]
|
||||
info.func = function()
|
||||
local val = this.value
|
||||
UIDropDownMenu_SetText(val, officerRankDropdown)
|
||||
of.officerRankCount = val
|
||||
end
|
||||
UIDropDownMenu_AddButton(info)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Store current value on the frame for SaveOptions to read
|
||||
of.officerRankCount = savedOfficerRankCount
|
||||
of.officerRankDropdown = officerRankDropdown
|
||||
|
||||
yOffset = yOffset - 30
|
||||
|
||||
|
||||
-- Divider
|
||||
local divider2 = content:CreateTexture(nil, "ARTWORK")
|
||||
divider2:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Divider")
|
||||
@@ -4291,7 +4339,13 @@ function IGW:SaveOptions()
|
||||
|
||||
-- Save remember sorting setting
|
||||
ImprovedGuildWindowDB.rememberSorting = of.rememberSortingCheck:GetChecked() == 1
|
||||
|
||||
|
||||
-- Save officer rank count and apply immediately
|
||||
if of.officerRankCount then
|
||||
ImprovedGuildWindowDB.officerRankCount = of.officerRankCount
|
||||
OFFICER_RANK_THRESHOLD = of.officerRankCount - 1
|
||||
end
|
||||
|
||||
-- Save which windows are currently open (if remember is enabled)
|
||||
if ImprovedGuildWindowDB.rememberWindows then
|
||||
ImprovedGuildWindowDB.windowStates = {
|
||||
|
||||
Reference in New Issue
Block a user