From 89ef1b79fb081a9d320eaadd2030c2cdc222b2ea Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Mon, 19 Jan 2026 22:24:09 +0400 Subject: [PATCH] version: 1.6.4 --- Guda.toc | 2 +- UI/SettingsPopup.lua | 45 +++++++++++++++++++++++++++++++++----------- UI/SettingsPopup.xml | 23 ++++++++++++++++++---- 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/Guda.toc b/Guda.toc index 0f95302..014b607 100644 --- a/Guda.toc +++ b/Guda.toc @@ -2,7 +2,7 @@ ## Title: Guda ## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW) ## Author: Vati -## Version: 1.6.3 +## Version: 1.6.4 ## SavedVariables: Guda_DB ## SavedVariablesPerCharacter: Guda_CharDB diff --git a/UI/SettingsPopup.lua b/UI/SettingsPopup.lua index 854dc3d..9304b71 100644 --- a/UI/SettingsPopup.lua +++ b/UI/SettingsPopup.lua @@ -1479,7 +1479,7 @@ local editorMatchMode = "any" local editorRules = {} local editorRuleFrames = {} local RULE_ROW_HEIGHT = 28 -local MAX_RULES = 6 +local MAX_RULES = 22 -- Rule type options for dropdown local RULE_TYPE_OPTIONS = { @@ -1622,7 +1622,7 @@ local function GetRuleRowFrame(index) local rowName = "Guda_CategoryEditor_RuleRow" .. index local row = CreateFrame("Frame", rowName, container) row:SetHeight(RULE_ROW_HEIGHT) - row:SetWidth(360) + row:SetWidth(310) row:SetPoint("TOPLEFT", container, "TOPLEFT", 0, -((index - 1) * RULE_ROW_HEIGHT)) -- Rule type dropdown button @@ -1682,20 +1682,43 @@ local function GetRuleRowFrame(index) return row end --- Update rules display +-- Number of visible rule rows in the scroll frame +local VISIBLE_RULES = 10 + +-- Update rules display with scroll support function Guda_CategoryEditor_UpdateRulesDisplay() local numRules = table.getn(editorRules) + local scrollFrame = getglobal("Guda_CategoryEditor_RulesScrollFrame") - for i = 1, MAX_RULES do + -- Update rules count label + local rulesLabel = getglobal("Guda_CategoryEditor_RulesLabel") + if rulesLabel then + rulesLabel:SetText("Rules (" .. numRules .. "/" .. MAX_RULES .. "):") + end + + -- Update scroll frame + if scrollFrame then + FauxScrollFrame_Update(scrollFrame, numRules, VISIBLE_RULES, RULE_ROW_HEIGHT) + end + + -- Get scroll offset + local offset = 0 + if scrollFrame then + offset = FauxScrollFrame_GetOffset(scrollFrame) or 0 + end + + for i = 1, VISIBLE_RULES do local row = GetRuleRowFrame(i) + local ruleIndex = i + offset + if row then - if i <= numRules then - local rule = editorRules[i] - row.ruleIndex = i - row.typeBtn.ruleIndex = i - row.valueBox.ruleIndex = i - row.valueBtn.ruleIndex = i - row.deleteBtn.ruleIndex = i + if ruleIndex <= numRules then + local rule = editorRules[ruleIndex] + row.ruleIndex = ruleIndex + row.typeBtn.ruleIndex = ruleIndex + row.valueBox.ruleIndex = ruleIndex + row.valueBtn.ruleIndex = ruleIndex + row.deleteBtn.ruleIndex = ruleIndex -- Set type button text local typeName = "Select Type" diff --git a/UI/SettingsPopup.xml b/UI/SettingsPopup.xml index 84af32c..7866654 100644 --- a/UI/SettingsPopup.xml +++ b/UI/SettingsPopup.xml @@ -786,7 +786,7 @@ - + @@ -935,10 +935,10 @@ - - + + - + @@ -947,6 +947,21 @@ + + + FauxScrollFrame_OnVerticalScroll(28, Guda_CategoryEditor_UpdateRulesDisplay) + + + + + + + + + + + +