Add files via upload

This commit is contained in:
totalllyswede
2026-06-06 21:58:47 -07:00
committed by GitHub
parent 585ce6c5b7
commit a4c8c78f42
3 changed files with 93 additions and 36 deletions
+58 -7
View File
@@ -2,7 +2,7 @@
-- Author: Travis -- Author: Travis
local IGW = {} local IGW = {}
IGW.VERSION = "3.2" IGW.VERSION = "3.3"
-- Global function for keybind (must be defined early) -- Global function for keybind (must be defined early)
function ImprovedGuildWindow_Toggle() function ImprovedGuildWindow_Toggle()
@@ -481,7 +481,8 @@ function IGW:InitializeSavedVariables()
showOffline = true, showOffline = true,
opacity = 1.0, 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) officerRankCount = 3, -- Default: Guild Master + top 2 officer ranks (threshold = 2)
showRaceFaction = true
} }
end end
@@ -495,6 +496,11 @@ function IGW:InitializeSavedVariables()
ImprovedGuildWindowDB.officerRankCount = 3 ImprovedGuildWindowDB.officerRankCount = 3
end end
-- Ensure showRaceFaction exists (for existing saved variables)
if ImprovedGuildWindowDB.showRaceFaction == nil then
ImprovedGuildWindowDB.showRaceFaction = true
end
-- Apply saved officer rank count: rankCount includes the GM (rank 0), -- 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) -- so threshold = rankCount - 1 (e.g. 3 ranks → threshold 2 → indices 0,1,2)
OFFICER_RANK_THRESHOLD = ImprovedGuildWindowDB.officerRankCount - 1 OFFICER_RANK_THRESHOLD = ImprovedGuildWindowDB.officerRankCount - 1
@@ -1361,6 +1367,8 @@ headers = {
{text = "Time Zone", width = 190, column = "timezone"} {text = "Time Zone", width = 190, column = "timezone"}
} }
else else
local showRF = not (ImprovedGuildWindowDB and ImprovedGuildWindowDB.showRaceFaction == false)
if showRF then
headers = { headers = {
{text = "Name", width = 110, column = "name"}, {text = "Name", width = 110, column = "name"},
{text = "Level", width = 60, column = "level"}, {text = "Level", width = 60, column = "level"},
@@ -1370,6 +1378,15 @@ headers = {
{text = "Location", width = 145, column = "zone"}, {text = "Location", width = 145, column = "zone"},
{text = "Rank", width = 85, column = "rank"} {text = "Rank", width = 85, column = "rank"}
} }
else
headers = {
{text = "Name", width = 175, column = "name"},
{text = "Level", width = 60, column = "level"},
{text = "Class", width = 75, column = "class"},
{text = "Location", width = 210, column = "zone"},
{text = "Rank", width = 80, column = "rank"}
}
end
end end
local headerFrame = frame.headerFrame local headerFrame = frame.headerFrame
@@ -1499,7 +1516,9 @@ function IGW:ApplyRowLayout(tabName, headers)
row.race:SetText("") row.race:SetText("")
row.faction:SetText("") row.faction:SetText("")
else else
-- Guild Members tab uses: name, level, class, race, faction, (location -> row.rank), (rank -> row.note) -- Guild Members tab uses: name, level, class, [race, faction,] location, rank
local showRF = not (ImprovedGuildWindowDB and ImprovedGuildWindowDB.showRaceFaction == false)
row.name:ClearAllPoints() row.name:ClearAllPoints()
row.name:SetPoint("LEFT", row, "LEFT", colX["name"] + 5, 0) row.name:SetPoint("LEFT", row, "LEFT", colX["name"] + 5, 0)
row.name:SetWidth(colW["name"] - 10) row.name:SetWidth(colW["name"] - 10)
@@ -1512,6 +1531,7 @@ function IGW:ApplyRowLayout(tabName, headers)
row.class:SetPoint("LEFT", row, "LEFT", colX["class"] + 5, 0) row.class:SetPoint("LEFT", row, "LEFT", colX["class"] + 5, 0)
row.class:SetWidth(colW["class"] - 10) row.class:SetWidth(colW["class"] - 10)
if showRF then
row.race:ClearAllPoints() row.race:ClearAllPoints()
row.race:SetPoint("LEFT", row, "LEFT", colX["race"] + 5, 0) row.race:SetPoint("LEFT", row, "LEFT", colX["race"] + 5, 0)
row.race:SetWidth(colW["race"] - 10) row.race:SetWidth(colW["race"] - 10)
@@ -1519,6 +1539,10 @@ function IGW:ApplyRowLayout(tabName, headers)
row.faction:ClearAllPoints() row.faction:ClearAllPoints()
row.faction:SetPoint("LEFT", row, "LEFT", colX["faction"] + 5, 0) row.faction:SetPoint("LEFT", row, "LEFT", colX["faction"] + 5, 0)
row.faction:SetWidth(colW["faction"] - 10) row.faction:SetWidth(colW["faction"] - 10)
else
row.race:SetText("")
row.faction:SetText("")
end
row.rank:ClearAllPoints() row.rank:ClearAllPoints()
row.rank:SetPoint("LEFT", row, "LEFT", colX["zone"] + 5, 0) row.rank:SetPoint("LEFT", row, "LEFT", colX["zone"] + 5, 0)
@@ -2588,12 +2612,13 @@ function IGW:UpdateRosterDisplay()
row.class:SetTextColor(color.r, color.g, color.b) row.class:SetTextColor(color.r, color.g, color.b)
row.class:SetText(member.class or "") row.class:SetText(member.class or "")
-- Race -- Race & Faction (only if setting is enabled)
local showRF = not (ImprovedGuildWindowDB and ImprovedGuildWindowDB.showRaceFaction == false)
if showRF then
local race = IGW_GetRace(member.officernote or "") local race = IGW_GetRace(member.officernote or "")
row.race:SetText(race) row.race:SetText(race)
row.race:SetTextColor(1, 1, 1) row.race:SetTextColor(1, 1, 1)
-- Faction
local faction = IGW_GetFaction(race) local faction = IGW_GetFaction(race)
if faction == "Alliance" then if faction == "Alliance" then
row.faction:SetTextColor(0.2, 0.5, 1) -- Blue row.faction:SetTextColor(0.2, 0.5, 1) -- Blue
@@ -2604,6 +2629,10 @@ function IGW:UpdateRosterDisplay()
else else
row.faction:SetText("") -- Blank for unknown row.faction:SetText("") -- Blank for unknown
end end
else
row.race:SetText("")
row.faction:SetText("")
end
-- Location (use rank field for display) -- Location (use rank field for display)
if member.online then if member.online then
@@ -4070,7 +4099,7 @@ function IGW:ToggleOptionsWindow()
divider1:SetPoint("TOP", content, "TOP", 103, yOffset) divider1:SetPoint("TOP", content, "TOP", 103, yOffset)
divider1:SetWidth(830) divider1:SetWidth(830)
divider1:SetHeight(16) divider1:SetHeight(16)
yOffset = yOffset - 30 yOffset = yOffset - 20
-- Window Behavior Section -- Window Behavior Section
local behaviorHeader = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") local behaviorHeader = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
@@ -4170,6 +4199,20 @@ function IGW:ToggleOptionsWindow()
of.officerRankCount = savedOfficerRankCount of.officerRankCount = savedOfficerRankCount
of.officerRankDropdown = officerRankDropdown of.officerRankDropdown = officerRankDropdown
yOffset = yOffset - 35
-- Show Race/Faction columns checkbox
local showRaceFactionCheck = CreateFrame("CheckButton", "IGW_ShowRaceFactionCheck", content, "UICheckButtonTemplate")
showRaceFactionCheck:SetPoint("TOPLEFT", content, "TOPLEFT", 10, yOffset)
showRaceFactionCheck:SetWidth(24)
showRaceFactionCheck:SetHeight(24)
local savedShowRF = (ImprovedGuildWindowDB and ImprovedGuildWindowDB.showRaceFaction ~= false)
showRaceFactionCheck:SetChecked(savedShowRF and 1 or 0)
local showRaceFactionLabel = content:CreateFontString(nil, "OVERLAY", "GameFontNormal")
showRaceFactionLabel:SetPoint("LEFT", showRaceFactionCheck, "RIGHT", 5, 0)
showRaceFactionLabel:SetText("Show Race & Faction columns (Guild Members tab)")
of.showRaceFactionCheck = showRaceFactionCheck
yOffset = yOffset - 30 yOffset = yOffset - 30
-- Divider -- Divider
@@ -4178,7 +4221,7 @@ function IGW:ToggleOptionsWindow()
divider2:SetPoint("TOP", content, "TOP", 103, yOffset) divider2:SetPoint("TOP", content, "TOP", 103, yOffset)
divider2:SetWidth(830) divider2:SetWidth(830)
divider2:SetHeight(16) divider2:SetHeight(16)
yOffset = yOffset - 25 yOffset = yOffset - 15
-- Default View Section -- Default View Section
local defaultViewHeader = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") local defaultViewHeader = content:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
@@ -4346,6 +4389,14 @@ function IGW:SaveOptions()
OFFICER_RANK_THRESHOLD = of.officerRankCount - 1 OFFICER_RANK_THRESHOLD = of.officerRankCount - 1
end end
-- Save show race/faction setting and refresh immediately
if of.showRaceFactionCheck then
ImprovedGuildWindowDB.showRaceFaction = of.showRaceFactionCheck:GetChecked() == 1
-- Rebuild column headers and repopulate so change takes effect without reload
IGW:UpdateColumnHeaders(currentTab)
IGW:UpdateRosterDisplay()
end
-- Save which windows are currently open (if remember is enabled) -- Save which windows are currently open (if remember is enabled)
if ImprovedGuildWindowDB.rememberWindows then if ImprovedGuildWindowDB.rememberWindows then
ImprovedGuildWindowDB.windowStates = { ImprovedGuildWindowDB.windowStates = {
+1 -1
View File
@@ -2,7 +2,7 @@
## Title: Improved Guild Window ## Title: Improved Guild Window
## Notes: Enhanced guild management for World of Warcraft 1.12.1 (Octo) ## Notes: Enhanced guild management for World of Warcraft 1.12.1 (Octo)
## Author: Olzon ## Author: Olzon
## Version: 3.2 ## Version: 3.3
## SavedVariables: ImprovedGuildWindowDB ## SavedVariables: ImprovedGuildWindowDB
Bindings.xml Bindings.xml
+7 -1
View File
@@ -78,6 +78,7 @@ Click the "Options" button to customize:
- **Show Offline by Default** - Member Details tab offline visibility - **Show Offline by Default** - Member Details tab offline visibility
- **Remember Sorting** - Persist column and direction across sessions - **Remember Sorting** - Persist column and direction across sessions
- **# of Officer Ranks in Guild** - Choose how many top ranks count as officers (2, 3, or 4) - **# of Officer Ranks in Guild** - Choose how many top ranks count as officers (2, 3, or 4)
- **Show Race & Faction Columns** - Toggle Race and A/H columns in the Guild Members tab
### Sorting & Filtering ### Sorting & Filtering
- Click column headers to sort - Click column headers to sort
@@ -255,10 +256,15 @@ Works bidirectionally - view any character to see their alts and main.
## Version ## Version
**3.2** - Latest stable release **3.3** - Latest stable release
### Changelog ### Changelog
**3.3**
- Added option to hide Race and Faction (A/H) columns in the Guild Members tab
- When hidden, Name and Location columns expand to use the freed space
- Setting saved between sessions and applied immediately on save
**3.2** **3.2**
- Added configurable officer rank count setting in Options menu - Added configurable officer rank count setting in Options menu
- New dropdown (2, 3, or 4 ranks) replaces the previous hardcoded value - New dropdown (2, 3, or 4 ranks) replaces the previous hardcoded value