version: 1.6.4
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
## Title: Guda
|
## Title: Guda
|
||||||
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
||||||
## Author: Vati
|
## Author: Vati
|
||||||
## Version: 1.6.3
|
## Version: 1.6.4
|
||||||
## SavedVariables: Guda_DB
|
## SavedVariables: Guda_DB
|
||||||
## SavedVariablesPerCharacter: Guda_CharDB
|
## SavedVariablesPerCharacter: Guda_CharDB
|
||||||
|
|
||||||
|
|||||||
+34
-11
@@ -1479,7 +1479,7 @@ local editorMatchMode = "any"
|
|||||||
local editorRules = {}
|
local editorRules = {}
|
||||||
local editorRuleFrames = {}
|
local editorRuleFrames = {}
|
||||||
local RULE_ROW_HEIGHT = 28
|
local RULE_ROW_HEIGHT = 28
|
||||||
local MAX_RULES = 6
|
local MAX_RULES = 22
|
||||||
|
|
||||||
-- Rule type options for dropdown
|
-- Rule type options for dropdown
|
||||||
local RULE_TYPE_OPTIONS = {
|
local RULE_TYPE_OPTIONS = {
|
||||||
@@ -1622,7 +1622,7 @@ local function GetRuleRowFrame(index)
|
|||||||
local rowName = "Guda_CategoryEditor_RuleRow" .. index
|
local rowName = "Guda_CategoryEditor_RuleRow" .. index
|
||||||
local row = CreateFrame("Frame", rowName, container)
|
local row = CreateFrame("Frame", rowName, container)
|
||||||
row:SetHeight(RULE_ROW_HEIGHT)
|
row:SetHeight(RULE_ROW_HEIGHT)
|
||||||
row:SetWidth(360)
|
row:SetWidth(310)
|
||||||
row:SetPoint("TOPLEFT", container, "TOPLEFT", 0, -((index - 1) * RULE_ROW_HEIGHT))
|
row:SetPoint("TOPLEFT", container, "TOPLEFT", 0, -((index - 1) * RULE_ROW_HEIGHT))
|
||||||
|
|
||||||
-- Rule type dropdown button
|
-- Rule type dropdown button
|
||||||
@@ -1682,20 +1682,43 @@ local function GetRuleRowFrame(index)
|
|||||||
return row
|
return row
|
||||||
end
|
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()
|
function Guda_CategoryEditor_UpdateRulesDisplay()
|
||||||
local numRules = table.getn(editorRules)
|
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 row = GetRuleRowFrame(i)
|
||||||
|
local ruleIndex = i + offset
|
||||||
|
|
||||||
if row then
|
if row then
|
||||||
if i <= numRules then
|
if ruleIndex <= numRules then
|
||||||
local rule = editorRules[i]
|
local rule = editorRules[ruleIndex]
|
||||||
row.ruleIndex = i
|
row.ruleIndex = ruleIndex
|
||||||
row.typeBtn.ruleIndex = i
|
row.typeBtn.ruleIndex = ruleIndex
|
||||||
row.valueBox.ruleIndex = i
|
row.valueBox.ruleIndex = ruleIndex
|
||||||
row.valueBtn.ruleIndex = i
|
row.valueBtn.ruleIndex = ruleIndex
|
||||||
row.deleteBtn.ruleIndex = i
|
row.deleteBtn.ruleIndex = ruleIndex
|
||||||
|
|
||||||
-- Set type button text
|
-- Set type button text
|
||||||
local typeName = "Select Type"
|
local typeName = "Select Type"
|
||||||
|
|||||||
+19
-4
@@ -786,7 +786,7 @@
|
|||||||
<!-- Category Editor Popup -->
|
<!-- Category Editor Popup -->
|
||||||
<Frame name="Guda_CategoryEditor" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
|
<Frame name="Guda_CategoryEditor" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="400" y="380"/>
|
<AbsDimension x="400" y="480"/>
|
||||||
</Size>
|
</Size>
|
||||||
|
|
||||||
<Anchors>
|
<Anchors>
|
||||||
@@ -935,10 +935,10 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
|
|
||||||
<!-- Rules Container -->
|
<!-- Rules ScrollFrame -->
|
||||||
<Frame name="Guda_CategoryEditor_RulesContainer">
|
<ScrollFrame name="Guda_CategoryEditor_RulesScrollFrame" inherits="FauxScrollFrameTemplate">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="360" y="180"/>
|
<AbsDimension x="335" y="280"/>
|
||||||
</Size>
|
</Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT">
|
<Anchor point="TOPLEFT">
|
||||||
@@ -947,6 +947,21 @@
|
|||||||
</Offset>
|
</Offset>
|
||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnVerticalScroll>
|
||||||
|
FauxScrollFrame_OnVerticalScroll(28, Guda_CategoryEditor_UpdateRulesDisplay)
|
||||||
|
</OnVerticalScroll>
|
||||||
|
</Scripts>
|
||||||
|
</ScrollFrame>
|
||||||
|
|
||||||
|
<!-- Rules Container (child of scroll frame) -->
|
||||||
|
<Frame name="Guda_CategoryEditor_RulesContainer">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="310" y="280"/>
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="TOPLEFT" relativeTo="Guda_CategoryEditor_RulesScrollFrame" relativePoint="TOPLEFT"/>
|
||||||
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<!-- Add Rule Button -->
|
<!-- Add Rule Button -->
|
||||||
|
|||||||
Reference in New Issue
Block a user