|
|
|
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
|
|
|
|
..\..\FrameXML\UI.xsd">
|
|
|
|
|
|
|
|
|
|
<Frame name="SortedConfigBoxTemplate" virtual="true">
|
|
|
|
|
<Size x="256" y="64"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer level="BACKGROUND">
|
|
|
|
|
<Texture parentKey="bg">
|
|
|
|
|
<Color a="0.3" r="0" g="0" b="0" />
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<!-- Templates for subfilter options -->
|
|
|
|
|
<CheckButton name="SortedFilterOptionCheckBox" inherits="SortedCheckButtonTemplate" virtual="true">
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.clickable:RegisterForClicks("LeftButtonUp")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self.key1, self.key2, true)
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self.key1, self.key2, nil)
|
|
|
|
|
end
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
|
|
|
|
|
<Frame name="SortedFilterOptionRange" virtual="true">
|
|
|
|
|
<Frames>
|
|
|
|
|
<EditBox name="$parentMin" parentKey="min" inherits="InputBoxTemplate">
|
|
|
|
|
<Size x="64"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-88"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
self:SetNumeric(true)
|
|
|
|
|
self:SetMaxLetters(6)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnTextChanged>
|
|
|
|
|
if self:GetNumber() > 0 then
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self:GetParent().key1, self:GetParent().key2, self:GetNumber(), "min")
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self:GetParent().key1, self:GetParent().key2, nil, "min")
|
|
|
|
|
end
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
</OnTextChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
<EditBox name="$parentMax" parentKey="max" inherits="InputBoxTemplate">
|
|
|
|
|
<Size x="64"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativePoint="TOP"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
self:SetNumeric(true)
|
|
|
|
|
self:SetMaxLetters(6)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnTextChanged>
|
|
|
|
|
if self:GetNumber() > 0 then
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self:GetParent().key1, self:GetParent().key2, self:GetNumber(), "max")
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self:GetParent().key1, self:GetParent().key2, nil, "max")
|
|
|
|
|
end
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
</OnTextChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
</Frames>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedCheckboxFont">
|
|
|
|
|
<Anchors><Anchor point="LEFT"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentDash" inherits="SortedCheckboxFont" text="-" justifyH="CENTER">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentMin"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$parentMax"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<Frame name="SortedFilterOptionItem" virtual="true">
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
function self:Update(byName, userInput)
|
|
|
|
|
local id, name
|
|
|
|
|
if byName then
|
|
|
|
|
name = self.editBoxName:GetText()
|
|
|
|
|
local link = select(2, GetItemInfo(name))
|
|
|
|
|
if link then
|
|
|
|
|
id = string.match(link, ".-item:(%d+):.*")
|
|
|
|
|
self.editBoxID:SetText(id)
|
|
|
|
|
id = tonumber(id)
|
|
|
|
|
else
|
|
|
|
|
self.editBoxID:SetText("")
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
id = self.editBoxID:GetNumber()
|
|
|
|
|
if id > 0 then
|
|
|
|
|
name = select(1, GetItemInfo(id))
|
|
|
|
|
if name then
|
|
|
|
|
self.editBoxName:SetText(name)
|
|
|
|
|
else
|
|
|
|
|
self.editBoxName:SetText("")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if userInput then
|
|
|
|
|
if (not id or 1 > id) and (not name or name == "") then
|
|
|
|
|
table.remove(SortedConfigCategoryGroups:GetData().filters[SortedConfigCategoryFilters.selected].values[self.key1], self.key2)
|
|
|
|
|
Sorted_CleanTable(SortedConfigCategoryGroups:GetData())
|
|
|
|
|
self.editBoxID:ClearFocus()
|
|
|
|
|
self.editBoxName:ClearFocus()
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self.key1, self.key2, id, "id")
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self.key1, self.key2, name, "name")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if id and id > 0 then
|
|
|
|
|
local _, _, rarity, _, _, _, _, _, _, icon = GetItemInfo(self.editBoxID:GetNumber())
|
|
|
|
|
if rarity then
|
|
|
|
|
self.icon:SetTexture(icon)
|
|
|
|
|
local r,g,b = Sorted_GetItemQualityColor(rarity)
|
|
|
|
|
self.editBoxName:SetTextColor(r, g, b)
|
|
|
|
|
else
|
|
|
|
|
self.icon:SetTexture("")
|
|
|
|
|
self.editBoxName:SetTextColor(1,1,1)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
self.icon:SetTexture("")
|
|
|
|
|
self.editBoxName:SetTextColor(1,1,1)
|
|
|
|
|
end
|
|
|
|
|
if userInput then
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<Texture name="$parentIcon" parentKey="icon">
|
|
|
|
|
<Size x="22" y="22"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPRIGHT" x="-4" y="0"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
<FontString name="$parentTextID" parentKey="textID" inherits="SortedCheckboxFont">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="2" />
|
|
|
|
|
<Anchor point="BOTTOM" relativePoint="TOP" y="-22"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentTextName" parentKey="textName" inherits="SortedCheckboxFont">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="2" y="-22"/>
|
|
|
|
|
<Anchor point="BOTTOM" relativePoint="TOP" y="-44"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Frames>
|
|
|
|
|
<EditBox name="$parentID" parentKey="editBoxID" inherits="InputBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentTextID" x="6"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="112"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:GetParent().textID:SetText(Sorted.Localize("SUBFILTER_SPECIFIC_ITEMS_ID"))
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
self:SetNumeric(true)
|
|
|
|
|
self:SetMaxLetters(7)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnTextChanged>
|
|
|
|
|
if userInput then
|
|
|
|
|
self:GetParent():Update(false, true)
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
</OnTextChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
<EditBox name="$parentName" parentKey="editBoxName" inherits="InputBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentTextName" x="6"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-4" y="-22"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:GetParent().textName:SetText(Sorted.Localize("SUBFILTER_SPECIFIC_ITEMS_NAME"))
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnTextChanged>
|
|
|
|
|
if userInput then
|
|
|
|
|
self:GetParent():Update(true, true)
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
</OnTextChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<EditBox name="SortedFilterOptionText" virtual="true" inherits="InputBoxTemplate">
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnTextChanged>
|
|
|
|
|
if userInput then
|
|
|
|
|
if self:GetText() ~= "" then
|
|
|
|
|
SortedConfigCategorySubfilters.SetFilterOptionValue(self.key1, self.key2, self:GetText())
|
|
|
|
|
SortedConfigCategorySubfilters:Update(true)
|
|
|
|
|
else
|
|
|
|
|
table.remove(SortedConfigCategoryGroups:GetData().filters[SortedConfigCategoryFilters.selected].values[self.key1], self.key2)
|
|
|
|
|
Sorted_CleanTable(SortedConfigCategoryGroups:GetData())
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
SortedConfigCategorySubfilters:Update(false)
|
|
|
|
|
end
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
Sorted_UpdateBagContents()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
</OnTextChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Initial Profile Selection Frame -->
|
|
|
|
|
<Frame name="SortedProfileSelectFrame" parent="UIParent" inherits="SortedShadowedFrame" enableMouse="true" movable="true" hidden="true" clampedToScreen="true" frameLevel="10" frameStrata="DIALOG">
|
|
|
|
|
<Size x="384" y="256"/>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetScale(1.1)
|
|
|
|
|
self.backdrop = self:CreateTexture()
|
|
|
|
|
self.backdrop:SetAllPoints()
|
|
|
|
|
Sorted.RegisterBackdrop(self.backdrop)
|
|
|
|
|
|
|
|
|
|
function self:OnUpdateFunc(elapsed)
|
|
|
|
|
if self.animating then
|
|
|
|
|
self.animElapsed = self.animElapsed + elapsed * 4
|
|
|
|
|
if self.animElapsed > 1 then
|
|
|
|
|
self.animElapsed = 1
|
|
|
|
|
self.animating = false
|
|
|
|
|
end
|
|
|
|
|
local smooth = math.sin(self.animElapsed * math.pi / 2)
|
|
|
|
|
self:SetAlpha(smooth)
|
|
|
|
|
self:SetSize(384 * smooth, 256 * smooth)
|
|
|
|
|
else
|
|
|
|
|
self:SetScript("OnUpdate", nil)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:ClearAllPoints()
|
|
|
|
|
self:SetPoint("CENTER")
|
|
|
|
|
self.animating = true
|
|
|
|
|
self.animElapsed = 0
|
|
|
|
|
self:SetScript("OnUpdate", self.OnUpdateFunc)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentDropShadowFrame" inherits="SortedDropShadowTemplate" frameLevel="9"/>
|
|
|
|
|
<Frame name="$parentHeader">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" y="-46"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer level="BACKGROUND">
|
|
|
|
|
<Texture name="$parentTexBG" parentKey="bg">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Color r="0" g="0" b="0" a="0.5"/>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
<Layer>
|
|
|
|
|
<Texture file="Interface\Addons\Sorted\Textures\Title-No-BG">
|
|
|
|
|
<Size x="192" y="48"/>
|
|
|
|
|
<Anchors><Anchor point="TOPLEFT"/></Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnMouseDown>
|
|
|
|
|
if button == "LeftButton" and not self:GetParent().isMoving then
|
|
|
|
|
self:GetParent():StartMoving()
|
|
|
|
|
self:GetParent().isMoving = true
|
|
|
|
|
end
|
|
|
|
|
</OnMouseDown>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
if button == "LeftButton" and self:GetParent().isMoving then
|
|
|
|
|
self:GetParent():StopMovingOrSizing();
|
|
|
|
|
self:GetParent().isMoving = false;
|
|
|
|
|
end
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
<OnHide>
|
|
|
|
|
if (self:GetParent().isMoving) then
|
|
|
|
|
self:GetParent():StopMovingOrSizing()
|
|
|
|
|
self:GetParent().isMoving = false
|
|
|
|
|
end
|
|
|
|
|
</OnHide>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Button name="$parentCloseButton" inherits="UIPanelCloseButton" frameLevel="15">
|
|
|
|
|
<Anchors><Anchor point="TOPRIGHT"/></Anchors>
|
|
|
|
|
</Button>
|
|
|
|
|
<Frame name="$parentContents" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentHeader" relativePoint="BOTTOMLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString parentKey="text1" font="SortedTitleFont">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text1:SetScale(1.4)
|
|
|
|
|
self.text1:SetText(Sorted.Localize("PROFILE_SELECTION_HEADER", UnitName("player")))
|
|
|
|
|
</OnLoad>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="$parentDropdown" inherits="SortedDropdownTemplate">
|
|
|
|
|
<Size x="256" y="32"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-56"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:OnLoad()
|
|
|
|
|
|
|
|
|
|
function self:ValueFunc()
|
|
|
|
|
self:SetValue(" "..Sorted.Localize("PROFILE_SELECTION_CHOOSE_EXISTING"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function ButtonClick(self)
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = self.data
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedProfileSelectFrame:Hide()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
SortedConfigFrame:Show()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:InitFunc()
|
|
|
|
|
local sortedTable = {}
|
|
|
|
|
for k,v in pairs(Sorted_settingsProfiles) do
|
|
|
|
|
table.insert(sortedTable, {k, v.profileName})
|
|
|
|
|
end
|
|
|
|
|
table.sort(sortedTable, function(a,b) return b[2] > a[2] end)
|
|
|
|
|
for i,v in ipairs(sortedTable) do
|
|
|
|
|
local b = SortedDropdownMenu:AddButton(ButtonClick, v[2])
|
|
|
|
|
b.data = v[1]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:ValueFunc()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<EditBox name="$parentNewName" parentKey="nameEditBox" inherits="SortedLargeInputBoxTemplate">
|
|
|
|
|
<Size x="192" y="32"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-136" x="-32"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString parentKey="title" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.title:SetText(Sorted.Localize("PROFILE_SELECTION_CREATE_NEW"))
|
|
|
|
|
self:SetAutoFocus(false)
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
self.editBox:SetText(UnitName("player").." ("..GetRealmName()..")")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not Sorted_IsClassic() then
|
|
|
|
|
self:RegisterEvent("GLOBAL_MOUSE_DOWN")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.editBox:SetScript("OnEnterPressed", function(self)
|
|
|
|
|
self:ClearFocus()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnEvent>
|
|
|
|
|
if event == "GLOBAL_MOUSE_DOWN" and self:IsShown() then
|
|
|
|
|
if not self:IsMouseOver() then
|
|
|
|
|
self.editBox:ClearFocus()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnEvent>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</EditBox>
|
|
|
|
|
<Button name="$parentNewButton" inherits="SortedButtonTemplate">
|
|
|
|
|
<Size x="72" y="24"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentNewName" x="4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("PROFILE_SELECTION_CREATE"))
|
|
|
|
|
self.text:SetJustifyH("CENTER")
|
|
|
|
|
self.text:SetScale(1.25)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnClick>
|
|
|
|
|
local text = self:GetParent().nameEditBox.editBox:GetText()
|
|
|
|
|
if text and #text > 0 then
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = Sorted_CreateNewSettingsProfile(text)
|
|
|
|
|
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedProfileSelectFrame:Hide()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
SortedConfigFrame:Show()
|
|
|
|
|
end
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Main config frame -->
|
|
|
|
|
<Frame name="SortedConfigFrame" parent="UIParent" enableMouse="true" movable="true" clampedToScreen="true" hidden="true" frameLevel="10" frameStrata="DIALOG">
|
|
|
|
|
<Size x="640" y="520"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="CENTER"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.Bg = self:CreateTexture()
|
|
|
|
|
self.Bg:SetPoint("TOPLEFT")
|
|
|
|
|
self.Bg:SetPoint("BOTTOMRIGHT")
|
|
|
|
|
Sorted.RegisterBackdrop(self.Bg)
|
|
|
|
|
|
|
|
|
|
function self:OnUpdateFunc(elapsed)
|
|
|
|
|
if self.animating then
|
|
|
|
|
self.animElapsed = self.animElapsed + elapsed * 4
|
|
|
|
|
if self.animElapsed > 1 or Sorted_GetSetting("animations") == 1 then
|
|
|
|
|
self.animElapsed = 1
|
|
|
|
|
self.animating = false
|
|
|
|
|
if self.animation == "Hide" then
|
|
|
|
|
self:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if self.animation == "Show" then
|
|
|
|
|
local smooth = math.sin(self.animElapsed * math.pi / 2)
|
|
|
|
|
self:SetAlpha(smooth)
|
|
|
|
|
self:SetSize(640 * smooth, 520 * smooth)
|
|
|
|
|
self.dropShadowFrame:Show()
|
|
|
|
|
elseif self.animation == "Hide" then
|
|
|
|
|
local smooth = math.sin((1 - self.animElapsed) * math.pi / 2)
|
|
|
|
|
self:SetAlpha(smooth)
|
|
|
|
|
self.dropShadowFrame:Hide()
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
self:SetScript("OnUpdate", nil)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:Animate(animation)
|
|
|
|
|
self.animating = true
|
|
|
|
|
self.animation = animation
|
|
|
|
|
self.animElapsed = 0
|
|
|
|
|
self:SetScript("OnUpdate", self.OnUpdateFunc)
|
|
|
|
|
if animation == "Show" then
|
|
|
|
|
PlaySound(SOUNDKIT.IG_MAINMENU_OPEN)
|
|
|
|
|
elseif animation == "Hide" then
|
|
|
|
|
PlaySound(SOUNDKIT.IG_MAINMENU_CLOSE)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_IsDemo() then
|
|
|
|
|
self:SetFrameStrata("FULLSCREEN_DIALOG")
|
|
|
|
|
end
|
|
|
|
|
self:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
self:ClearAllPoints()
|
|
|
|
|
self:SetPoint("CENTER")
|
|
|
|
|
self:SetFrameLevel(3985)
|
|
|
|
|
self:Animate("Show")
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="$parentCloseButton" inherits="UIPanelCloseButton">
|
|
|
|
|
<Anchors><Anchor point="TOPRIGHT"/></Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame:Animate("Hide")
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Frame name="$parentDropShadowFrame" parentKey="dropShadowFrame" inherits="SortedDropShadowTemplate" frameLevel="9"/>
|
|
|
|
|
<Frame name="$parentHeader">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="-32" y="-64"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<Texture file="Interface\Addons\Sorted\Textures\Title-No-BG">
|
|
|
|
|
<Size x="192" y="48"/>
|
|
|
|
|
<Anchors><Anchor point="LEFT" y="8"/></Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnMouseDown>
|
|
|
|
|
if button == "LeftButton" and not self:GetParent().isMoving then
|
|
|
|
|
self:GetParent():StartMoving()
|
|
|
|
|
self:GetParent().isMoving = true
|
|
|
|
|
end
|
|
|
|
|
</OnMouseDown>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
if button == "LeftButton" and self:GetParent().isMoving then
|
|
|
|
|
self:GetParent():StopMovingOrSizing();
|
|
|
|
|
self:GetParent().isMoving = false;
|
|
|
|
|
end
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
<OnHide>
|
|
|
|
|
if (self:GetParent().isMoving) then
|
|
|
|
|
self:GetParent():StopMovingOrSizing()
|
|
|
|
|
self:GetParent().isMoving = false
|
|
|
|
|
end
|
|
|
|
|
</OnHide>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<!-- Tabs -->
|
|
|
|
|
<Frame name="$parentTabs">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="-44"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer level="BACKGROUND" textureSubLevel="1">
|
|
|
|
|
<Texture name="$parentTexBG" parentKey="bg">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigFrame"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.bg:SetColorTexture(0, 0, 0)
|
|
|
|
|
self.bg:SetAlpha(0.5)
|
|
|
|
|
|
|
|
|
|
SortedConfigFrame.tabs = {
|
|
|
|
|
_G[self:GetName().."1"],
|
|
|
|
|
_G[self:GetName().."2"] ,
|
|
|
|
|
--_G[self:GetName().."3"] ,
|
|
|
|
|
_G[self:GetName().."4"] ,
|
|
|
|
|
_G[self:GetName().."5"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local function SelectTab(tab)
|
|
|
|
|
tab.selected = true
|
|
|
|
|
_G[tab:GetName().."Left"]:Hide()
|
|
|
|
|
_G[tab:GetName().."Middle"]:Hide()
|
|
|
|
|
_G[tab:GetName().."Right"]:Hide()
|
|
|
|
|
_G[tab:GetName().."LeftDisabled"]:Show()
|
|
|
|
|
_G[tab:GetName().."MiddleDisabled"]:Show()
|
|
|
|
|
_G[tab:GetName().."RightDisabled"]:Show()
|
|
|
|
|
_G["SortedConfigFrameContents"..tab.content]:Show()
|
|
|
|
|
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function DeselectTab(tab)
|
|
|
|
|
tab.selected = false
|
|
|
|
|
_G[tab:GetName().."Left"]:Show()
|
|
|
|
|
_G[tab:GetName().."Middle"]:Show()
|
|
|
|
|
_G[tab:GetName().."Right"]:Show()
|
|
|
|
|
_G[tab:GetName().."LeftDisabled"]:Hide()
|
|
|
|
|
_G[tab:GetName().."MiddleDisabled"]:Hide()
|
|
|
|
|
_G[tab:GetName().."RightDisabled"]:Hide()
|
|
|
|
|
_G["SortedConfigFrameContents"..tab.content]:Hide()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function SortedConfigFrame_ToggleTab(tab)
|
|
|
|
|
if not tab.selected then
|
|
|
|
|
for _, tab2 in pairs(SortedConfigFrame.tabs) do
|
|
|
|
|
DeselectTab(tab2)
|
|
|
|
|
end
|
|
|
|
|
SelectTab(tab)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function SortedConfigFrame_UpdateTabWidths()
|
|
|
|
|
for _, tab in pairs(SortedConfigFrame.tabs) do
|
|
|
|
|
PanelTemplates_TabResize(tab, 0, nil, tab.minWidth)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
SortedConfigFrame_ToggleTab(SortedConfigFrame.tabs[1])
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="$parent1" inherits="SortedTabButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="BOTTOMLEFT" x="128" y="2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetText(Sorted.Localize("CONFIG_APPEARANCE"))
|
|
|
|
|
self.content = "Appearance"
|
|
|
|
|
self.selected = true
|
|
|
|
|
PanelTemplates_TabResize(self, 0, nil, self.minWidth)
|
|
|
|
|
_G[self:GetName().."Left"]:Hide()
|
|
|
|
|
_G[self:GetName().."Middle"]:Hide()
|
|
|
|
|
_G[self:GetName().."Right"]:Hide()
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame_ToggleTab(self)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button name="$parent2" inherits="SortedTabButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parent1"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetText(Sorted.Localize("CONFIG_BEHAVIOR"))
|
|
|
|
|
self.content = "Behavior"
|
|
|
|
|
self.selected = false
|
|
|
|
|
PanelTemplates_TabResize(self, 0, nil, self.minWidth)
|
|
|
|
|
_G[self:GetName().."LeftDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."MiddleDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."RightDisabled"]:Hide()
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame_ToggleTab(self)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<!--Button name="$parent3" inherits="SortedTabButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parent2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetText(Sorted.Localize("CONFIG_COLUMNS"))
|
|
|
|
|
self.content = "Columns"
|
|
|
|
|
self.selected = false
|
|
|
|
|
PanelTemplates_TabResize(self, 0, nil, self.minWidth)
|
|
|
|
|
_G[self:GetName().."LeftDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."MiddleDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."RightDisabled"]:Hide()
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame_ToggleTab(self)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button-->
|
|
|
|
|
<Button name="$parent4" inherits="SortedTabButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parent2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetText(Sorted.Localize("CONFIG_CATEGORIES"))
|
|
|
|
|
self.content = "Categories"
|
|
|
|
|
self.selected = false
|
|
|
|
|
PanelTemplates_TabResize(self, 0, nil, self.minWidth)
|
|
|
|
|
_G[self:GetName().."LeftDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."MiddleDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."RightDisabled"]:Hide()
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame_ToggleTab(self)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button name="$parent5" inherits="SortedTabButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parent4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:SetText(Sorted.Localize("CONFIG_PROFILES"))
|
|
|
|
|
self.content = "Profiles"
|
|
|
|
|
self.selected = false
|
|
|
|
|
PanelTemplates_TabResize(self, 0, nil, self.minWidth)
|
|
|
|
|
_G[self:GetName().."LeftDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."MiddleDisabled"]:Hide()
|
|
|
|
|
_G[self:GetName().."RightDisabled"]:Hide()
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
SortedConfigFrame_ToggleTab(self)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<Frame name="$parentContents" inherits="SortedShadowedFrame">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentTabs"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<!-- Appearance Tab Contents -->
|
|
|
|
|
<Frame name="$parentAppearance">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentBox1" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="224" y="240"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPRIGHT" relativePoint="TOP" x="-4" y="-32"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Slider name="SortedConfigScale" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-28"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
self.timeSinceLastUpdate = 0
|
|
|
|
|
self:SetMinMaxValues(0.5, 2)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_SCALE"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnUpdate>
|
|
|
|
|
self.timeSinceLastUpdate = self.timeSinceLastUpdate + elapsed
|
|
|
|
|
if self.timeSinceLastUpdate > 0.1 then
|
|
|
|
|
Sorted_SetScale(self:GetValue())
|
|
|
|
|
self.timeSinceLastUpdate = 0
|
|
|
|
|
end
|
|
|
|
|
</OnUpdate>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("scale"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100 + 0.5) / 100)
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
if self:GetValue() > 0.98 and 1.02 > self:GetValue() then
|
|
|
|
|
self:SetValue(1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_SetSetting("scale", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100 + 0.5) / 100)
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
Sorted_SetScale(self:GetValue())
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<Slider name="SortedConfigIconSize" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-72"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(18, 32)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_ICON_SIZE"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("iconSize"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 10) / 10)
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
--self:SetValue(math.floor(self:GetValue()))
|
|
|
|
|
Sorted_SetSetting("iconSize", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 10) / 10)
|
|
|
|
|
Sorted_PositionItemButtons()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
Sorted_GetSortButton(SORTED_SORTBUTTON_ICON).width = Sorted_GetSetting("iconSize") * 1.1
|
|
|
|
|
Sorted_GetSortButton(SORTED_SORTBUTTON_FAVORITES).width = Sorted_GetSetting("iconSize") * 1.1
|
|
|
|
|
Sorted_UpdateSortButtons()
|
|
|
|
|
Sorted_UpdateItemButtons()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<CheckButton name="SortedConfigIconBorder" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-96"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("iconBorders", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("iconBorders", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_UpdateIconBorders()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_ICON_BORDERS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("iconBorders") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<Slider name="SortedConfigIconBorderThickness" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-136"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:SetMinMaxValues(0, 8)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_ICON_BORDER_THICKNESS"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("iconBorderThickness"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 10) / 10)
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("iconBorderThickness", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100) / 100)
|
|
|
|
|
Sorted_PositionItemButtons()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<Slider name="SortedConfigPadding" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-176"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:SetMinMaxValues(0, 16)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_SPACING"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("padding"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 10) / 10)
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("padding", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 10) / 10)
|
|
|
|
|
Sorted_PositionItemButtons()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
Sorted_UpdateItemButtons()
|
|
|
|
|
Sorted_PositionItemButtons()
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<CheckButton name="SortedConfigAnimations" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-200"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("animations", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("animations", 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ANIMATIONS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("animations") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox5" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="224" y="128"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox1" relativePoint="BOTTOMLEFT" y="-8" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="SortedConfigBackdrop" inherits="SortedDropdownTemplate">
|
|
|
|
|
<Size x="192" y="24"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-32"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:OnLoad()
|
|
|
|
|
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_BACKDROP"))
|
|
|
|
|
|
|
|
|
|
local function ButtonClick(self)
|
|
|
|
|
Sorted_SetSetting("backdrop", self.data)
|
|
|
|
|
Sorted_UpdateBackdropTexture()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:ValueFunc()
|
|
|
|
|
self:SetValue(Sorted_GetSetting("backdrop"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:InitFunc()
|
|
|
|
|
local bgs = {}
|
|
|
|
|
for k,v in pairs(Sorted_GetBackgrounds()) do
|
|
|
|
|
table.insert(bgs, v)
|
|
|
|
|
end
|
|
|
|
|
table.sort(bgs, function(a,b)
|
|
|
|
|
local aSorted, bSorted = string.sub(a, 1, 6) == "Sorted", string.sub(b, 1, 6) == "Sorted"
|
|
|
|
|
if aSorted ~= bSorted then
|
|
|
|
|
return aSorted
|
|
|
|
|
end
|
|
|
|
|
return b > a
|
|
|
|
|
end)
|
|
|
|
|
for k,v in pairs(bgs) do
|
|
|
|
|
local b = SortedDropdownMenu:AddButton(ButtonClick, v)
|
|
|
|
|
b.data = v
|
|
|
|
|
b:HookScript("OnEnter", function(self)
|
|
|
|
|
local path = Sorted_GetBackgroundPath(self.data)
|
|
|
|
|
SortedDropdownMenuParent.backdrop:SetTexture(path, "MIRROR", "MIRROR")
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:ValueFunc()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<!--Slider name="SortedConfigBackdropAlpha" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-64"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:SetMinMaxValues(0, 1)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_BACKDROP_OPACITY"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("backdropAlpha"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100) / 100)
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("backdropAlpha", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100) / 100)
|
|
|
|
|
Sorted_UpdateBackdropAlpha()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider-->
|
|
|
|
|
<Button name="SortedConfigBackdropColor">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="16" y="-72"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="-16" y="-96"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<HighlightTexture file="Interface\WorldMap\UI-QuestPoi-HighlightBar" alphaMode="ADD"/>
|
|
|
|
|
<PushedTexture file="Interface\WorldMap\UI-QuestPoi-HighlightBar" alphaMode="ADD"/>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame parentKey="preview">
|
|
|
|
|
<Size x="24" y="16"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="LEFT" x="8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer level="ARTWORK">
|
|
|
|
|
<Texture parentKey="colorTexture">
|
|
|
|
|
<Anchors><Anchor point="TOPLEFT" x="1" y="-1"/><Anchor point="BOTTOMRIGHT" x="-1" y="1"/></Anchors>
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
<Layer level="ARTWORK">
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" x="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(COLOR)
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
local r,g,b,a = unpack(Sorted_GetSetting("backdropColor"))
|
|
|
|
|
self.colorTexture:SetColorTexture(r,g,b,a)
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.callbackFunc = function(restore)
|
|
|
|
|
local r,g,b,a
|
|
|
|
|
if restore then
|
|
|
|
|
r,g,b,a = unpack(restore)
|
|
|
|
|
else
|
|
|
|
|
a,r,g,b = 1 - OpacitySliderFrame:GetValue(), ColorPickerFrame:GetColorRGB()
|
|
|
|
|
end
|
|
|
|
|
Sorted_SetSetting("backdropColor", {r,g,b,a})
|
|
|
|
|
Sorted_UpdateBackdropTexture()
|
|
|
|
|
Sorted_UpdateBackdropColor()
|
|
|
|
|
self.preview:Update()
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
local r,g,b,a = unpack(Sorted_GetSetting("backdropColor"))
|
|
|
|
|
ColorPickerFrame:SetColorRGB(r,g,b)
|
|
|
|
|
ColorPickerFrame.hasOpacity, ColorPickerFrame.opacity = true, 1 - a
|
|
|
|
|
ColorPickerFrame.previousValues = {r,g,b,a}
|
|
|
|
|
ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc =
|
|
|
|
|
self.callbackFunc, self.callbackFunc, self.callbackFunc
|
|
|
|
|
ColorPickerFrame:Hide()
|
|
|
|
|
ColorPickerFrame:Show()
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox2" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="224" y="160"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox1" relativePoint="TOPRIGHT" x="8" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="SortedConfigFont" inherits="SortedDropdownTemplate">
|
|
|
|
|
<Size x="192" y="24"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-28"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:OnLoad()
|
|
|
|
|
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_FONT"))
|
|
|
|
|
|
|
|
|
|
local function ButtonClick(self)
|
|
|
|
|
Sorted_SetSetting("font", self.data)
|
|
|
|
|
Sorted_UpdateFonts()
|
|
|
|
|
SortedConfigFrame_UpdateTabWidths()
|
|
|
|
|
SortedMoneyText:UpdateMoneyText()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:InitFunc()
|
|
|
|
|
local fontObjects = {}
|
|
|
|
|
for k,v in pairs(Sorted_GetFonts()) do
|
|
|
|
|
local b = SortedDropdownMenu:AddButton(ButtonClick, v)
|
|
|
|
|
if not fontObjects[v] then
|
|
|
|
|
fontObjects[v] = CreateFont("SortedFont"..v)
|
|
|
|
|
fontObjects[v]:SetFont(Sorted_GetFontPath(v), 12)
|
|
|
|
|
end
|
|
|
|
|
b.leftText:SetFontObject(fontObjects[v])
|
|
|
|
|
b.data = v
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:ValueFunc()
|
|
|
|
|
self:SetValue(" "..Sorted_GetSetting("font"))
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:ValueFunc()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Slider name="SortedConfigFontSize" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-80"/>
|
|
|
|
|
<Anchor point="LEFT" x="32"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="128"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="10"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE"))
|
|
|
|
|
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.values = {
|
|
|
|
|
[-2] = Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE_1"),
|
|
|
|
|
[-1] = Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE_2"),
|
|
|
|
|
[0] = Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE_3"),
|
|
|
|
|
[1] = Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE_4"),
|
|
|
|
|
[2] = Sorted.Localize("CONFIG_APPEARANCE_FONT_SIZE_5")
|
|
|
|
|
}
|
|
|
|
|
function self:UpdateText()
|
|
|
|
|
local value = math.floor(self:GetValue() + 0.5)
|
|
|
|
|
self.valueString:SetText(self.values[value])
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(-2, 2)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("fontSize"))
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
self:SetValue(math.floor(self:GetValue()))
|
|
|
|
|
Sorted_SetSetting("fontSize", self:GetValue())
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
Sorted_UpdateFonts()
|
|
|
|
|
SortedConfigFrame_UpdateTabWidths()
|
|
|
|
|
|
|
|
|
|
SortedMoneyText:UpdateMoneyText()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
--Sorted_PositionItemButtons()
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<Slider name="SortedConfigFontOutline" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-116"/>
|
|
|
|
|
<Anchor point="LEFT" x="32"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="128"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="10"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_FONT_OUTLINE"))
|
|
|
|
|
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.values = {
|
|
|
|
|
[0] = Sorted.Localize("CONFIG_APPEARANCE_FONT_OUTLINE_1"),
|
|
|
|
|
[1] = Sorted.Localize("CONFIG_APPEARANCE_FONT_OUTLINE_2"),
|
|
|
|
|
[2] = Sorted.Localize("CONFIG_APPEARANCE_FONT_OUTLINE_3")
|
|
|
|
|
}
|
|
|
|
|
function self:UpdateText()
|
|
|
|
|
local value = math.floor(self:GetValue() + 0.5)
|
|
|
|
|
self.valueString:SetText(self.values[value])
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(0, 2)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("fontOutline"))
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
self:SetValue(math.floor(self:GetValue()))
|
|
|
|
|
Sorted_SetSetting("fontOutline", self:GetValue())
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
Sorted_UpdateFonts()
|
|
|
|
|
SortedConfigFrame_UpdateTabWidths()
|
|
|
|
|
|
|
|
|
|
SortedMoneyText:UpdateMoneyText()
|
|
|
|
|
SortedSortButtons_Update()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
<OnMouseUp>
|
|
|
|
|
--Sorted_PositionItemButtons()
|
|
|
|
|
</OnMouseUp>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox3" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="224" y="96"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox2" relativePoint="BOTTOMLEFT" y="-8" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Slider name="SortedConfigCategoriesWidth" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" x="-12" y="-28"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:SetMinMaxValues(60, 200)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText(Sorted.Localize("CONFIG_APPEARANCE_SIDE_PANE_WIDTH"))
|
|
|
|
|
_G[self:GetName().."Text"]:SetFontObject("SortedTitleFont")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("categoriesWidth"))
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue()))
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("categoriesWidth", self:GetValue())
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue()))
|
|
|
|
|
SortedFrame_UpdateMinSize()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<CheckButton name="SortedConfigCategoriesUseIcons" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-56"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("categoriesUseIcons", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("categoriesUseIcons", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_ALWAYS_USE_ICONS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), -16, 0)
|
|
|
|
|
|
|
|
|
|
self.clickable:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_ALWAYS_USE_ICONS")
|
|
|
|
|
end)
|
|
|
|
|
self.clickable:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("categoriesUseIcons") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox4" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="224" y="64"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentBox3" y="-8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<CheckButton name="SortedConfigSkinning" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-20"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("skinning", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("skinning", 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_APPEARANCE_ELVUI_SKIN"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), -16, 0)
|
|
|
|
|
|
|
|
|
|
self.clickable:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_ELVUI_SKIN")
|
|
|
|
|
end)
|
|
|
|
|
self.clickable:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("skinning") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
if not (--[[ElvUI and ]]AddOnSkins) then
|
|
|
|
|
self:Disable()
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<!-- Behavior Tab Contents -->
|
|
|
|
|
<Frame name="$parentBehavior" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentBox1" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="280" y="48"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPRIGHT" relativePoint="TOP" x="-8" y="-16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<CheckButton name="SortedConfigCombineStacks" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-12"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("combineStacks", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("combineStacks", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_UpdateItemButtons()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_COMBINE_STACKS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
|
|
|
|
|
self.clickable:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_COMBINE_STACKS")
|
|
|
|
|
end)
|
|
|
|
|
self.clickable:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("combineStacks") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<!--CheckButton name="SortedConfigAutoOpenClose" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-40"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("autoOpenClose", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("autoOpenClose", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_UpdateItemButtons()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_AUTO_OPEN_CLOSE"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
|
|
|
|
|
self.clickable:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_AUTO_OPEN_CLOSE")
|
|
|
|
|
end)
|
|
|
|
|
self.clickable:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("autoOpenClose") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton-->
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox2" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="280" y="90"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox1" relativePoint="BOTTOMLEFT" y="-8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_NEW_ITEMS_HEADER"))
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<CheckButton name="SortedConfigPinNewItems" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-22"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("newOnTop", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("newOnTop", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_UpdateItemButtons()
|
|
|
|
|
Sorted_FilterItems()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_PIN_NEW"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("newOnTop") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<CheckButton name="SortedConfigNewIndicators" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigPinNewItems" relativePoint="BOTTOM" y="-4"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("newItemIndicators", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("newItemIndicators", 1)
|
|
|
|
|
end
|
|
|
|
|
Sorted_UpdateNewItemsPerCategory()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_NEW_INDICATORS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("newItemIndicators") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox3" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="280" y="108"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox2" relativePoint="BOTTOMLEFT" y="-8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_SCROLLING_HEADER"))
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Slider name="SortedConfigScrollSpeed" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-44"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="192"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="10"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_SCROLL_WHEEL_SPEED"))
|
|
|
|
|
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:UpdateText()
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue()))
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(1, 10)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("")
|
|
|
|
|
self:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_SCROLL_WHEEL_SPEED")
|
|
|
|
|
end)
|
|
|
|
|
self:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("scrollSpeed"))
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("scrollSpeed", self:GetValue())
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<Slider name="SortedConfigScrollAnimSpeed" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-80"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="192"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="10"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_SMOOTH_SCROLLING_POWER"))
|
|
|
|
|
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:UpdateText()
|
|
|
|
|
if self:GetValue() == 0 then
|
|
|
|
|
self.valueString:SetText("Disabled")
|
|
|
|
|
else
|
|
|
|
|
self.valueString:SetText(math.floor(self:GetValue() * 100) / 50)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(0, 0.5)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("")
|
|
|
|
|
self:HookScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_SMOOTH_SCROLLING")
|
|
|
|
|
end)
|
|
|
|
|
self:HookScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("smoothingAmount"))
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
if 0.01 > self:GetValue() then self:SetValue(0) end
|
|
|
|
|
Sorted_SetSetting("smoothingAmount", self:GetValue())
|
|
|
|
|
if self:GetValue() > 0 then
|
|
|
|
|
Sorted_SetSetting("smoothScrolling", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("smoothScrolling", 1)
|
|
|
|
|
end
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox4" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="280" y="112"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOP" x="8" y="-16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_TOOLTIP_HEADER"))
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Slider name="SortedConfigTooltipDelay" inherits="OptionsSliderTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-48"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="192"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOM" relativePoint="TOP" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentText" parentKey="valueString" inherits="Sorted12Font">
|
|
|
|
|
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent" x="10"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_TOOLTIP_DELAY"))
|
|
|
|
|
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:UpdateText()
|
|
|
|
|
if self:GetValue() == 1 then
|
|
|
|
|
self.valueString:SetText("1 "..Sorted.Localize("SUBFILTER_TIME_SECOND_SHORT"))
|
|
|
|
|
else
|
|
|
|
|
self.valueString:SetText((math.floor(self:GetValue() * self:GetValue() * 100) / 100).." "..Sorted.Localize("SUBFILTER_TIME_SECONDS_SHORT"))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:SetMinMaxValues(0.1, 1)
|
|
|
|
|
_G[self:GetName().."High"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Low"]:SetText("")
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:SetValue(Sorted_GetSetting("tooltipDelay") ^ 0.5)
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnValueChanged>
|
|
|
|
|
Sorted_SetSetting("tooltipDelay", self:GetValue() * self:GetValue())
|
|
|
|
|
self:UpdateText()
|
|
|
|
|
</OnValueChanged>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Slider>
|
|
|
|
|
<CheckButton name="SortedConfigTooltipInfo" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigTooltipDelay" relativePoint="BOTTOM" y="-8"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("tooltipInfo", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("tooltipInfo", 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_TOOLTIP_INFO"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self.text, "RIGHT", 8, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("tooltipInfo") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox6" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentBox4" relativePoint="BOTTOMLEFT" y="-8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Size x="280" y="140"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOPLEFT" x="12" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentOpenText" parentKey="open" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" relativePoint="TOPRIGHT" x="-104" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
<FontString name="$parentCloseText" parentKey="close" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" relativePoint="TOPRIGHT" x="-48" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
if Sorted_IsShadowlands() or Sorted_IsTBC() then
|
|
|
|
|
BackdropTemplateMixin.OnBackdropLoaded(self)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_AUTO"))
|
|
|
|
|
self.open:SetText(Sorted.Localize("CONFIG_BEHAVIOR_AUTO_OPEN"))
|
|
|
|
|
self.close:SetText(Sorted.Localize("CONFIG_BEHAVIOR_AUTO_CLOSE"))
|
|
|
|
|
|
|
|
|
|
local t = {"merchant", "auction", "bank", "mail"}
|
|
|
|
|
local function OnClick(self)
|
|
|
|
|
local autoOpenClose = Sorted_GetSetting("autoOpenClose")
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
autoOpenClose = bit.bor(autoOpenClose, self:GetID())
|
|
|
|
|
elseif (bit.band(autoOpenClose, self:GetID())) ~= 0 then
|
|
|
|
|
autoOpenClose = autoOpenClose - self:GetID()
|
|
|
|
|
end
|
|
|
|
|
Sorted_SetSetting("autoOpenClose", autoOpenClose)
|
|
|
|
|
end
|
|
|
|
|
local function OnShow(self)
|
|
|
|
|
self:SetChecked(bit.band(Sorted_GetSetting("autoOpenClose"), self:GetID()) ~= 0)
|
|
|
|
|
end
|
|
|
|
|
for i, v in pairs(t) do
|
|
|
|
|
self[v.."Text"] = self:CreateFontString(nil, "OVERLAY", "Sorted12Font")
|
|
|
|
|
self[v.."Text"]:SetText(Sorted.Localize("CONFIG_BEHAVIOR_AUTO_"..string.upper(v)))
|
|
|
|
|
self[v.."Text"]:SetPoint("RIGHT", self, "TOPRIGHT", -144, -16 - i * 24)
|
|
|
|
|
self[v.."Open"] = CreateFrame("CheckButton", nil, self, "UICheckButtonTemplate")
|
|
|
|
|
self[v.."Open"]:SetSize(24, 25)
|
|
|
|
|
self[v.."Open"]:SetPoint("CENTER", self, "TOPRIGHT", -104, -16 - i * 24)
|
|
|
|
|
self[v.."Open"]:SetID(2^(i - 1))
|
|
|
|
|
self[v.."Open"]:SetScript("OnClick", OnClick)
|
|
|
|
|
self[v.."Open"]:SetScript("OnShow", OnShow)
|
|
|
|
|
self[v.."Close"] = CreateFrame("CheckButton", nil, self, "UICheckButtonTemplate")
|
|
|
|
|
self[v.."Close"]:SetSize(24, 25)
|
|
|
|
|
self[v.."Close"]:SetPoint("CENTER", self, "TOPRIGHT", -48, -16 - i * 24)
|
|
|
|
|
self[v.."Close"]:SetID(2^(i + 3))
|
|
|
|
|
self[v.."Close"]:SetScript("OnClick", OnClick)
|
|
|
|
|
self[v.."Close"]:SetScript("OnShow", OnShow)
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBox5" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="LEFT" relativeTo="$parentBox3" relativePoint="LEFT" y="-16"/>
|
|
|
|
|
<Anchor point="RIGHT" relativeTo="$parentBox4" relativePoint="RIGHT" y="-16"/>
|
|
|
|
|
<Anchor point="BOTTOM" y="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Size x="280" y="176"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_HEADER"))
|
|
|
|
|
self.text:SetScale(1.2)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentSorting" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="16" y="-32"/>
|
|
|
|
|
<Anchor point="BOTTOM" y="8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Size x="192"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_SORTING_HEADER"))
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenSortPrev" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-24"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenSortKeepPrev", 2)
|
|
|
|
|
SortedConfigOnOpenSortSpecific:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenSortSpecificDropdown)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenSortAscendingDropdown)
|
|
|
|
|
end
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_USE_PREVIOUS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenSortKeepPrev") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
self.clickable:SetWidth(self.text:GetWidth() + 48)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenSortSpecific" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigOnOpenSortPrev" relativePoint="BOTTOM"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenSortKeepPrev", 1)
|
|
|
|
|
SortedConfigOnOpenSortPrev:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenSortSpecificDropdown)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenSortAscendingDropdown)
|
|
|
|
|
end
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_USE_SPECIFIC"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenSortKeepPrev") == 1 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenSortSpecificDropdown)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenSortAscendingDropdown)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenSortSpecificDropdown)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenSortAscendingDropdown)
|
|
|
|
|
end
|
|
|
|
|
self.clickable:SetWidth(self.text:GetWidth() + 48)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<Frame name="SortedConfigOnOpenSortSpecificDropdown" inherits="UIDropDownMenuTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigOnOpenSortSpecific" relativePoint="BOTTOMLEFT" x="-24"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
function self:Update()
|
|
|
|
|
local value = Sorted_GetSetting("onOpenSortMethod")
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenSortSpecificDropdown, value)
|
|
|
|
|
local sortButton = Sorted_GetSortButton(math.floor(value / 10))
|
|
|
|
|
local sortMethod = sortButton.sortMethods[value % 10]
|
|
|
|
|
if sortMethod.title ~= "" then
|
|
|
|
|
UIDropDownMenu_SetText(SortedConfigOnOpenSortSpecificDropdown, sortButton.name.." ("..sortMethod.title..")")
|
|
|
|
|
else
|
|
|
|
|
UIDropDownMenu_SetText(SortedConfigOnOpenSortSpecificDropdown, sortButton.name)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function SortSpecificDropdown_OnClick(self)
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenSortSpecificDropdown, self.value)
|
|
|
|
|
Sorted_SetSetting("onOpenSortMethod", self.value)
|
|
|
|
|
SortedConfigOnOpenSortSpecificDropdown:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function SortSpecificDropdown_Init()
|
|
|
|
|
for i,v in ipairs(Sorted_sortButtons) do
|
|
|
|
|
if v:Enabled() and v.sortMethods then
|
|
|
|
|
for methodIndex, method in ipairs(v.sortMethods) do
|
|
|
|
|
local info = UIDropDownMenu_CreateInfo()
|
|
|
|
|
info.func = SortSpecificDropdown_OnClick
|
|
|
|
|
if method.title ~= "" then
|
|
|
|
|
info.text = v.name.." ("..method.title..")"
|
|
|
|
|
else
|
|
|
|
|
info.text = v.name
|
|
|
|
|
end
|
|
|
|
|
info.value = v.uniqueID * 10 + methodIndex
|
|
|
|
|
UIDropDownMenu_AddButton(info)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self.type = CONTROLTYPE_DROPDOWN
|
|
|
|
|
UIDropDownMenu_SetWidth(self, 160)
|
|
|
|
|
UIDropDownMenu_Initialize(self, SortSpecificDropdown_Init)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="SortedConfigOnOpenSortAscendingDropdown" inherits="UIDropDownMenuTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPRIGHT" relativeTo="SortedConfigOnOpenSortSpecificDropdown" relativePoint="BOTTOMRIGHT" y="4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
function self:Update()
|
|
|
|
|
local value = Sorted_GetSetting("onOpenSortAscending")
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenSortAscendingDropdown, value)
|
|
|
|
|
if value == 1 then
|
|
|
|
|
UIDropDownMenu_SetText(SortedConfigOnOpenSortAscendingDropdown, Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_SORT_DESCENDING"))
|
|
|
|
|
else
|
|
|
|
|
UIDropDownMenu_SetText(SortedConfigOnOpenSortAscendingDropdown, Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_SORT_ASCENDING"))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Dropdown_OnClick(self)
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenSortAscendingDropdown, self.value)
|
|
|
|
|
Sorted_SetSetting("onOpenSortAscending", self.value)
|
|
|
|
|
SortedConfigOnOpenSortAscendingDropdown:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Dropdown_Init()
|
|
|
|
|
local info = UIDropDownMenu_CreateInfo()
|
|
|
|
|
info.func = Dropdown_OnClick
|
|
|
|
|
info.text = Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_SORT_ASCENDING")
|
|
|
|
|
info.value = 2
|
|
|
|
|
UIDropDownMenu_AddButton(info)
|
|
|
|
|
local info = UIDropDownMenu_CreateInfo()
|
|
|
|
|
info.func = Dropdown_OnClick
|
|
|
|
|
info.text = Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_SORT_DESCENDING")
|
|
|
|
|
info.value = 1
|
|
|
|
|
UIDropDownMenu_AddButton(info)
|
|
|
|
|
end
|
|
|
|
|
self.type = CONTROLTYPE_DROPDOWN
|
|
|
|
|
UIDropDownMenu_SetWidth(self, 128)
|
|
|
|
|
UIDropDownMenu_Initialize(self, Dropdown_Init)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentFiltering" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentSorting" relativePoint="TOPRIGHT" x="8"/>
|
|
|
|
|
<Anchor point="BOTTOM" y="8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Size x="192"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-8"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_FILTERING_HEADER"))
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
<Frames>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenFilterNone" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-24"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenFilterKeepPrev", 0)
|
|
|
|
|
SortedConfigOnOpenFilterSpecific:SetChecked(false)
|
|
|
|
|
SortedConfigOnOpenFilterPrev:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenFilterSpecificDropdown)
|
|
|
|
|
end
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_NONE"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenFilterKeepPrev") == 0 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
self.clickable:SetWidth(self.text:GetWidth() + 48)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenFilterPrev" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigOnOpenFilterNone" relativePoint="BOTTOM"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenFilterKeepPrev", 2)
|
|
|
|
|
SortedConfigOnOpenFilterSpecific:SetChecked(false)
|
|
|
|
|
SortedConfigOnOpenFilterNone:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenFilterSpecificDropdown)
|
|
|
|
|
end
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_USE_PREVIOUS"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenFilterKeepPrev") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
self.clickable:SetWidth(self.text:GetWidth() + 48)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenFilterSpecific" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigOnOpenFilterPrev" relativePoint="BOTTOM"/>
|
|
|
|
|
<Anchor point="LEFT" x="16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenFilterKeepPrev", 1)
|
|
|
|
|
SortedConfigOnOpenFilterPrev:SetChecked(false)
|
|
|
|
|
SortedConfigOnOpenFilterNone:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenFilterSpecificDropdown)
|
|
|
|
|
end
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_USE_SPECIFIC"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self:GetParent(), "RIGHT", -16, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenFilterKeepPrev") == 1 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
UIDropDownMenu_EnableDropDown(SortedConfigOnOpenFilterSpecificDropdown)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
UIDropDownMenu_DisableDropDown(SortedConfigOnOpenFilterSpecificDropdown)
|
|
|
|
|
end
|
|
|
|
|
self.clickable:SetWidth(self.text:GetWidth() + 48)
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<Frame name="SortedConfigOnOpenFilterSpecificDropdown" inherits="UIDropDownMenuTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigOnOpenFilterSpecific" relativePoint="BOTTOMLEFT" x="-24"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
function self:Update()
|
|
|
|
|
local value = Sorted_GetSetting("onOpenFilterCategory")
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenFilterSpecificDropdown, value)
|
|
|
|
|
if Sorted_GetSetting("categories")[value] then
|
|
|
|
|
UIDropDownMenu_SetText(SortedConfigOnOpenFilterSpecificDropdown, Sorted_GetSetting("categories")[value].name)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Dropdown_OnClick(self)
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigOnOpenFilterSpecificDropdown, self.value)
|
|
|
|
|
Sorted_SetSetting("onOpenFilterCategory", self.value)
|
|
|
|
|
SortedConfigOnOpenFilterSpecificDropdown:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Dropdown_Init()
|
|
|
|
|
local categories = Sorted_GetSetting("categories")
|
|
|
|
|
if categories then
|
|
|
|
|
for i,v in ipairs(categories) do
|
|
|
|
|
local info = UIDropDownMenu_CreateInfo()
|
|
|
|
|
info.func = Dropdown_OnClick
|
|
|
|
|
info.value = i
|
|
|
|
|
info.text = v.name
|
|
|
|
|
UIDropDownMenu_AddButton(info)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self.type = CONTROLTYPE_DROPDOWN
|
|
|
|
|
UIDropDownMenu_SetWidth(self, 160)
|
|
|
|
|
UIDropDownMenu_Initialize(self, Dropdown_Init)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenSearch" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="$parentFiltering" relativePoint="TOPRIGHT" x="4" y="-8"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenKeepSearch", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("onOpenKeepSearch", 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_KEEP_SEARCH"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self.text, "RIGHT", 8, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenKeepSearch") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
<CheckButton name="SortedConfigOnOpenPinFavorites" inherits="SortedCheckButtonTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="SortedConfigOnOpenSearch" relativePoint="BOTTOM" y="-8"/>
|
|
|
|
|
<Anchor point="LEFT" relativeTo="$parentFiltering" relativePoint="RIGHT" x="4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
local function OnClick(self, button)
|
|
|
|
|
if self:GetChecked() then
|
|
|
|
|
Sorted_SetSetting("onOpenPinFavorites", 2)
|
|
|
|
|
else
|
|
|
|
|
Sorted_SetSetting("onOpenPinFavorites", 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:RegisterForClicks("LeftButtonDown")
|
|
|
|
|
self:HookScript("OnClick", OnClick)
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_BEHAVIOR_ON_OPEN_PIN_FAVORITES"))
|
|
|
|
|
self.text:SetFontObject(Sorted13Font)
|
|
|
|
|
self.text:SetTextColor(1,1,1)
|
|
|
|
|
|
|
|
|
|
self.text:ClearAllPoints()
|
|
|
|
|
self.text:SetPoint("LEFT", 28, 0)
|
|
|
|
|
self.clickable:SetPoint("RIGHT", self.text, "RIGHT", 8, 0)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
if Sorted_GetSetting("onOpenPinFavorites") == 2 then
|
|
|
|
|
self:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
self:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</CheckButton>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<!-- Columns Tab Contents -->
|
|
|
|
|
<Frame name="$parentColumns" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentBox1" inherits="SortedConfigBoxTemplate">
|
|
|
|
|
<Size x="448" y="128"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" y="-32"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<!-- Categories Tab Contents -->
|
|
|
|
|
<Frame name="$parentCategories" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="SortedConfigCategories" inherits="InsetFrameTemplate" frameLevel="10">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="-150"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer level="BORDER">
|
|
|
|
|
<Texture name="$parentTexBG" parentKey="bg" file="Interface\Addons\Sorted\Textures\Backgrounds">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="2" y="-1"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-1" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<TexCoords left="0" right="0.5" top="0" bottom="0.7928" />
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.selected = nil
|
|
|
|
|
|
|
|
|
|
function self:GetData()
|
|
|
|
|
if self.selected then
|
|
|
|
|
return Sorted_GetSetting("categories")[self.selected]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:UpdateButtons()
|
|
|
|
|
local categories = Sorted_GetSetting("categories")
|
|
|
|
|
local dragging, hovering = self.dragging, nil
|
|
|
|
|
if dragging then
|
|
|
|
|
for i, button in ipairs(self.buttons) do
|
|
|
|
|
if i~=dragging and button.invisibleButton:IsMouseOver() then
|
|
|
|
|
hovering = i
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i, button in ipairs(self.buttons) do
|
|
|
|
|
if categories[i] then
|
|
|
|
|
button:Show()
|
|
|
|
|
button:ClearAllPoints()
|
|
|
|
|
if hovering then
|
|
|
|
|
if button.dragging then
|
|
|
|
|
button:SetPoint("TOPLEFT", 4, 12 - hovering * 21)
|
|
|
|
|
elseif dragging > i and i >= hovering then
|
|
|
|
|
button:SetPoint("TOPLEFT", 4, 12 - i * 21 - 21)
|
|
|
|
|
elseif i > dragging and hovering >= i then
|
|
|
|
|
button:SetPoint("TOPLEFT", 4, 12 - i * 21 + 21)
|
|
|
|
|
else
|
|
|
|
|
button:SetPoint("TOPLEFT", 4, 12 - i * 21)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
button:SetPoint("TOPLEFT", 4, 12 - i * 21)
|
|
|
|
|
end
|
|
|
|
|
button:SetSize(124, 21)
|
|
|
|
|
|
|
|
|
|
button.invisibleButton:Show()
|
|
|
|
|
button.invisibleButton:ClearAllPoints()
|
|
|
|
|
button.invisibleButton:SetPoint("TOPLEFT", 4, 12 - i * 21)
|
|
|
|
|
button.invisibleButton:SetSize(124, 21)
|
|
|
|
|
|
|
|
|
|
button.text:SetText(categories[i].name)
|
|
|
|
|
if self.selected == i then
|
|
|
|
|
button.selectedTexture:Show()
|
|
|
|
|
else
|
|
|
|
|
button.selectedTexture:Hide()
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
button:Hide()
|
|
|
|
|
button.invisibleButton:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if #self.buttons > #categories then
|
|
|
|
|
self.addButton:SetPoint("TOPLEFT", 12, -6 - #categories * 21)
|
|
|
|
|
self.addButton:Show()
|
|
|
|
|
else
|
|
|
|
|
self.addButton:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:SelectButton(index)
|
|
|
|
|
if index == self.selected then
|
|
|
|
|
self.buttons[index].selectedTexture:Hide()
|
|
|
|
|
self.selected = nil
|
|
|
|
|
_G[self:GetParent():GetName().."Left"]:Hide()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i, button in ipairs(self.buttons) do
|
|
|
|
|
if index == i then
|
|
|
|
|
button.selectedTexture:Show()
|
|
|
|
|
else
|
|
|
|
|
button.selectedTexture:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self.selected = index
|
|
|
|
|
|
|
|
|
|
local category = Sorted_GetSetting("categories")[index]
|
|
|
|
|
SortedConfigCategoryName.editBox:SetText(category.name)
|
|
|
|
|
if category.icon then
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\"..category.icon)
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\inv_misc_questionmark")
|
|
|
|
|
end
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
--SortedConfigCategoryFilters:Deselect()
|
|
|
|
|
|
|
|
|
|
_G[self:GetParent():GetName().."Left"]:Show()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:PerformButtonDrag(i1)
|
|
|
|
|
local i2
|
|
|
|
|
local categories = Sorted_GetSetting("categories")
|
|
|
|
|
for i, v in pairs(self.buttons) do
|
|
|
|
|
if i ~= i1 and v.invisibleButton:IsMouseOver() then
|
|
|
|
|
i2 = i
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if self.selected then
|
|
|
|
|
categories[self.selected].selected = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not i2 then return false end
|
|
|
|
|
local data = categories[i1]
|
|
|
|
|
local temp = {}
|
|
|
|
|
Sorted_CopyTable(data, temp)
|
|
|
|
|
table.remove(categories, i1)
|
|
|
|
|
table.insert(categories, i2, temp)
|
|
|
|
|
|
|
|
|
|
if self.selected then
|
|
|
|
|
for k,v in pairs(categories) do
|
|
|
|
|
if v.selected then
|
|
|
|
|
v.selected = nil
|
|
|
|
|
self.selected = k
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local category = Sorted_GetSetting("categories")[self.selected]
|
|
|
|
|
SortedConfigCategoryName.editBox:SetText(category.name)
|
|
|
|
|
if category.icon then
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\"..category.icon)
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\inv_misc_questionmark")
|
|
|
|
|
end
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
end
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
self:UpdateButtons()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.buttons = {}
|
|
|
|
|
for i = 1, 22 do
|
|
|
|
|
local b = CreateFrame("Button", self:GetName()..i, self, "SortedButtonTemplate")
|
|
|
|
|
b:SetID(i)
|
|
|
|
|
b:SetMovable(true)
|
|
|
|
|
b:RegisterForDrag("LeftButton")
|
|
|
|
|
b:SetScript("OnClick", function(self)
|
|
|
|
|
self:GetParent():SelectButton(self:GetID())
|
|
|
|
|
PlaySound(SOUNDKIT.IG_CHAT_EMOTE_BUTTON )
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnDragStart", function(self)
|
|
|
|
|
self.dragging = true
|
|
|
|
|
SortedConfigCategories.dragging = self:GetID()
|
|
|
|
|
--self:StartMoving()
|
|
|
|
|
self:SetFrameStrata("FULLSCREEN")
|
|
|
|
|
--self:SetAlpha(0.7)
|
|
|
|
|
--self.deleteButton:Hide()
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnDragStop", function(self)
|
|
|
|
|
self.dragging = false
|
|
|
|
|
SortedConfigCategories.dragging = nil
|
|
|
|
|
SortedConfigCategories:PerformButtonDrag(self:GetID())
|
|
|
|
|
self:StopMovingOrSizing()
|
|
|
|
|
self:SetFrameStrata("DIALOG")
|
|
|
|
|
SortedConfigCategories:UpdateButtons()
|
|
|
|
|
--self:SetAlpha(1)
|
|
|
|
|
self.deleteButton:Show()
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnHide", function(self, button)
|
|
|
|
|
self.dragging = false
|
|
|
|
|
SortedConfigCategories.dragging = nil
|
|
|
|
|
self:StopMovingOrSizing()
|
|
|
|
|
--self:SetAlpha(1)
|
|
|
|
|
self.deleteButton:Show()
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnUpdate", function(self, button)
|
|
|
|
|
if self.dragging then
|
|
|
|
|
SortedConfigCategories:UpdateButtons()
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
local db = CreateFrame("Button", b:GetName().."DeleteButton", b, "SortedDeleteButtonTemplate")
|
|
|
|
|
db:SetPoint("LEFT", b, "RIGHT", -3, 0)
|
|
|
|
|
db:SetScript("OnClick", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
local data = Sorted_GetSetting("categories")
|
|
|
|
|
table.remove(data, self:GetParent():GetID())
|
|
|
|
|
if self:GetParent():GetID() == SortedConfigCategories.selected then
|
|
|
|
|
SortedConfigCategories:SelectButton(self:GetParent():GetID())
|
|
|
|
|
end
|
|
|
|
|
SortedConfigCategories:UpdateButtons()
|
|
|
|
|
Sorted_SelectCategoryButton(nil)
|
|
|
|
|
SortedFilterButtons_Update(SortedFrameFilterButtons)
|
|
|
|
|
SortedSubcategoryFrame_Update()
|
|
|
|
|
|
|
|
|
|
local category = SortedConfigCategories:GetData()
|
|
|
|
|
if category then
|
|
|
|
|
SortedConfigCategoryName.editBox:SetText(category.name)
|
|
|
|
|
if category.icon then
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\"..category.icon)
|
|
|
|
|
else
|
|
|
|
|
SortedConfigCategoryIcon:SetNormalTexture("Interface\\Icons\\inv_misc_questionmark")
|
|
|
|
|
end
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
else
|
|
|
|
|
_G[SortedConfigCategories:GetParent():GetName().."Left"]:Hide()
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
db:SetScript("OnEnter", function(self)
|
|
|
|
|
SortedTooltip.CreateLocalized(self, "ANCHOR_LEFT", "TOOLTIP_CONFIG_REMOVE_CATEGORY", Sorted_GetSetting("categories")[self:GetParent():GetID()].name)
|
|
|
|
|
end)
|
|
|
|
|
db:SetScript("OnLeave", function(self)
|
|
|
|
|
SortedTooltip.Cancel()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- Create an invisible button that never moves for IsMouseOver checks
|
|
|
|
|
local ib = CreateFrame("Button", self:GetName()..i.."InvisibleButton", self)
|
|
|
|
|
ib:SetID(i)
|
|
|
|
|
|
|
|
|
|
self.buttons[i] = b
|
|
|
|
|
b.deleteButton = db
|
|
|
|
|
b.invisibleButton = ib
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.addButton = CreateFrame("Button", self:GetName().."AddButton", self, "SortedPlusButtonTemplate")
|
|
|
|
|
self.addText = self.addButton:CreateFontString(self:GetName().."AddText", "OVERLAY", "SortedButtonFont")
|
|
|
|
|
self.addText:SetPoint("LEFT", self.addButton, "RIGHT")
|
|
|
|
|
self.addText:SetText(Sorted.Localize("CONFIG_CATEGORIES_ADD"))
|
|
|
|
|
|
|
|
|
|
self.addButton:SetScript("OnClick", function(self)
|
|
|
|
|
local data = Sorted_GetSetting("categories")
|
|
|
|
|
table.insert(data, {
|
|
|
|
|
["name"] = Sorted.Localize("CONFIG_CATEGORIES_DEFAULT_NAME"),
|
|
|
|
|
["filterGroups"] = {}
|
|
|
|
|
})
|
|
|
|
|
self:GetParent():UpdateButtons()
|
|
|
|
|
self:GetParent():SelectButton(#data)
|
|
|
|
|
SortedConfigCategoryName.editBox:SetFocus()
|
|
|
|
|
SortedFilterButtons_Update(SortedFrameFilterButtons)
|
|
|
|
|
Sorted_UpdateNewItemsPerCategory()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnHide>
|
|
|
|
|
self.selected = nil
|
|
|
|
|
</OnHide>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self.selected = nil
|
|
|
|
|
self:UpdateButtons()
|
|
|
|
|
_G[self:GetParent():GetName().."Left"]:Hide()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentLeft" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativeTo="SortedConfigCategories" relativePoint="BOTTOMLEFT" x="-4"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="$parentTop">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" y="-96"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="SortedConfigCategoryName" inherits="SortedLargeInputBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="32" y="-28"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="LEFT" x="224" y="28"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="title" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.title:SetText(Sorted.Localize("CONFIG_CATEGORIES_NAME"))
|
|
|
|
|
if not Sorted_IsClassic() then
|
|
|
|
|
self:RegisterEvent("GLOBAL_MOUSE_DOWN")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.editBox:SetScript("OnTextChanged", function(self)
|
|
|
|
|
local category = Sorted_GetSetting("categories")[SortedConfigCategories.selected]
|
|
|
|
|
category.name = self:GetText()
|
|
|
|
|
SortedConfigCategories:UpdateButtons()
|
|
|
|
|
SortedFilterButtons_Update(SortedFrameFilterButtons)
|
|
|
|
|
end)
|
|
|
|
|
self.editBox:SetScript("OnEnterPressed", function(self)
|
|
|
|
|
self:ClearFocus()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnEvent>
|
|
|
|
|
if event == "GLOBAL_MOUSE_DOWN" and self:IsShown() then
|
|
|
|
|
if not self:IsMouseOver() then
|
|
|
|
|
self.editBox:ClearFocus()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnEvent>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Button name="SortedConfigCategoryIcon" inherits="PopupButtonTemplate">
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="SortedConfigCategoryIconText" parentKey="title" inherits="SortedTitleFont" text="Icon">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" y="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.title:SetText(Sorted.Localize("CONFIG_CATEGORIES_ICON"))
|
|
|
|
|
|
|
|
|
|
self:SetScale(1.3, 1.3)
|
|
|
|
|
self.title:SetScale(1 / 1.3, 1 / 1.3)
|
|
|
|
|
self:SetPoint("TOPLEFT", 256 / 1.3, -24 / 1.3)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnClick>
|
|
|
|
|
local function OnIconPicked(icon)
|
|
|
|
|
Sorted_GetSetting("categories")[SortedConfigCategories.selected].icon = icon
|
|
|
|
|
SortedFilterButtons_Update(SortedFrameFilterButtons)
|
|
|
|
|
self:SetNormalTexture("Interface\\Icons\\"..icon)
|
|
|
|
|
end
|
|
|
|
|
Sorted_PickIcon(self, OnIconPicked)
|
|
|
|
|
</OnClick>
|
|
|
|
|
<OnHide>
|
|
|
|
|
SortedIconPicker:Hide()
|
|
|
|
|
</OnHide>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBottomLeft">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOP" relativeTo="$parentTop" relativePoint="BOTTOM"/>
|
|
|
|
|
<Anchor point="LEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="160"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="SortedConfigCategoryGroups" inherits="UIDropDownMenuTemplate" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="-16"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.value = 1
|
|
|
|
|
|
|
|
|
|
function self:GetData()
|
|
|
|
|
local data = SortedConfigCategories:GetData()
|
|
|
|
|
if data then
|
|
|
|
|
if not data.filterGroups then
|
|
|
|
|
data.filterGroups = {}
|
|
|
|
|
end
|
|
|
|
|
if not data.filterGroups[self.value] then
|
|
|
|
|
data.filterGroups[self.value] = {}
|
|
|
|
|
end
|
|
|
|
|
return data.filterGroups[self.value]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:GetEntries()
|
|
|
|
|
local t = SortedConfigCategories:GetData()
|
|
|
|
|
if t then
|
|
|
|
|
return t.filterGroups
|
|
|
|
|
else
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
local entries = self:GetEntries()
|
|
|
|
|
if entries then
|
|
|
|
|
if 1 >= #self:GetEntries() then
|
|
|
|
|
self.removeButton:Disable()
|
|
|
|
|
else
|
|
|
|
|
self.removeButton:Enable()
|
|
|
|
|
end
|
|
|
|
|
_G[self:GetName().."Text"]:SetText("Group "..self.value)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Sorted_CategoryGroupsDropdown_OnClick(self)
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigCategoryGroups, self.value)
|
|
|
|
|
SortedConfigCategoryGroups.value = self.value
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function Sorted_CategoryGroupsDropdown_Init()
|
|
|
|
|
local entries = self:GetEntries()
|
|
|
|
|
if entries then
|
|
|
|
|
for i, v in ipairs(entries) do
|
|
|
|
|
local info = {}
|
|
|
|
|
info.text = "Group "..i
|
|
|
|
|
info.value = i
|
|
|
|
|
info.func = Sorted_CategoryGroupsDropdown_OnClick
|
|
|
|
|
UIDropDownMenu_AddButton(info)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self.type = CONTROLTYPE_DROPDOWN
|
|
|
|
|
UIDropDownMenu_SetWidth(self, 96)
|
|
|
|
|
UIDropDownMenu_Initialize(self, Sorted_CategoryGroupsDropdown_Init)
|
|
|
|
|
|
|
|
|
|
self.addButton = CreateFrame("Button", self:GetName().."AddButton", self, "SortedSmallPlusButtonTemplate")
|
|
|
|
|
self.addButton:SetPoint("TOPLEFT", self, "TOPRIGHT", -16, 1)
|
|
|
|
|
|
|
|
|
|
self.removeButton = CreateFrame("Button", self:GetName().."AddButton", self, "SortedSmallMinusButtonTemplate")
|
|
|
|
|
self.removeButton:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", -16, 2)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
UIDropDownMenu_SetSelectedValue(SortedConfigCategoryGroups, 1)
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
<!--Frame name="SortedConfigCategoryItemTypes" inherits="InsetFrameTemplate3">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" y="-48"/>
|
|
|
|
|
<Anchor point="RIGHT" relativePoint="TOPRIGHT" y="-128"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Size y="96"/>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentTitle" inherits="SortedTitleFont" text="Item Types">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="6" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
</Frame-->
|
|
|
|
|
<Frame name="SortedConfigCategoryFilters" inherits="InsetFrameTemplate3">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" y="-16"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentTitle" inherits="SortedTitleFont" parentKey="title">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="6" y="2"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.title:SetText(Sorted.Localize("CONFIG_CATEGORIES_FILTERS"))
|
|
|
|
|
|
|
|
|
|
self.selected = nil
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
--local filters = SortedConfigCategoryGroups:GetData()
|
|
|
|
|
local filters = Sorted_filters
|
|
|
|
|
table.sort(self.buttons, function(a,b) return b:GetID() > a:GetID() end)
|
|
|
|
|
|
|
|
|
|
for i, v in pairs(self.buttons) do
|
|
|
|
|
self.buttons[i]:SetPoint("TOPLEFT", 2, -5 - 24 * (i - 1))
|
|
|
|
|
self.buttons[i]:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", -2, -3 - 24 * i)
|
|
|
|
|
if SortedConfigCategories.selected and Sorted_GetFilterModified(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, v:GetID()) then
|
|
|
|
|
self.buttons[i].text:SetText("• "..filters[v:GetID()].name)
|
|
|
|
|
else
|
|
|
|
|
self.buttons[i].text:SetText(filters[v:GetID()].name)
|
|
|
|
|
end
|
|
|
|
|
self.buttons[i]:Show()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--SortedConfigCategorySubfilters:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:Deselect()
|
|
|
|
|
if self.selected then
|
|
|
|
|
self:SelectButton(self.selected)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:SelectButton(filterID)
|
|
|
|
|
local buttonID
|
|
|
|
|
for i, v in pairs(self.buttons) do
|
|
|
|
|
if v:GetID() == filterID then
|
|
|
|
|
buttonID = i
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if filterID == self.selected then
|
|
|
|
|
self.buttons[buttonID].selectedTexture:Hide()
|
|
|
|
|
self.buttons[buttonID].text:SetTextColor(0.85, 0.8, 0.75)
|
|
|
|
|
SortedConfigCategorySubfiltersScrollFrame:GetParent():Hide()
|
|
|
|
|
self.selected = nil
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i, button in ipairs(self.buttons) do
|
|
|
|
|
if buttonID == i then
|
|
|
|
|
button.selectedTexture:Show()
|
|
|
|
|
button.text:SetTextColor(1, 1, 1)
|
|
|
|
|
else
|
|
|
|
|
button.selectedTexture:Hide()
|
|
|
|
|
button.text:SetTextColor(0.85, 0.8, 0.75)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self.selected = filterID
|
|
|
|
|
SortedConfigCategorySubfiltersScrollFrame:GetParent():Show()
|
|
|
|
|
SortedConfigCategorySubfilters:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.buttons = {}
|
|
|
|
|
for i, filter in pairs(Sorted_filters) do
|
|
|
|
|
local b = CreateFrame("Button", self:GetName()..i, self)
|
|
|
|
|
b:SetHighlightTexture("Interface\\WorldMap\\UI-QuestPoi-HighlightBar")
|
|
|
|
|
b:GetHighlightTexture():SetBlendMode("ADD")
|
|
|
|
|
b:SetPushedTexture("Interface\\WorldMap\\UI-QuestPoi-HighlightBar")
|
|
|
|
|
b:GetPushedTexture():SetBlendMode("ADD")
|
|
|
|
|
b:GetPushedTexture():SetAlpha(0.6)
|
|
|
|
|
b.selectedTexture = b:CreateTexture(self:GetName().."SelectedTexture", "OVERLAY")
|
|
|
|
|
b.selectedTexture:SetTexture("Interface\\WorldMap\\UI-QuestPoi-HighlightBar")
|
|
|
|
|
b.selectedTexture:SetBlendMode("ADD")
|
|
|
|
|
b.selectedTexture:SetAllPoints()
|
|
|
|
|
b.selectedTexture:Hide()
|
|
|
|
|
local fs = b:CreateFontString(b:GetName().."Text", "OVERLAY", "SortedButtonFont")
|
|
|
|
|
fs:SetPoint("LEFT", 4, 0)
|
|
|
|
|
fs:SetTextColor(0.85, 0.8, 0.75)
|
|
|
|
|
b.text = fs
|
|
|
|
|
b:SetID(i)
|
|
|
|
|
|
|
|
|
|
b:SetScript("OnEnter", function(self)
|
|
|
|
|
self.text:SetTextColor(1, 1, 1)
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnLeave", function(self)
|
|
|
|
|
if self:GetID() ~= SortedConfigCategoryFilters.selected then
|
|
|
|
|
self.text:SetTextColor(0.85, 0.8, 0.75)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
b:SetScript("OnClick", function(self)
|
|
|
|
|
self:GetParent():SelectButton(self:GetID())
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
b:Hide()
|
|
|
|
|
table.insert(self.buttons, b)
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnHide>
|
|
|
|
|
self:Deselect()
|
|
|
|
|
</OnHide>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
<Frame name="$parentBottomRight" inherits="InsetFrameTemplate3" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentBottomLeft" x="2"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<!--Layer level="BORDER">
|
|
|
|
|
<Texture name="$parentTexBG" parentKey="bg" file="Interface\Addons\Sorted\Textures\Backgrounds">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="1" y="-1"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" />
|
|
|
|
|
</Anchors>
|
|
|
|
|
<TexCoords left="0.5" right="1" top="0" bottom="0.7928" />
|
|
|
|
|
</Texture>
|
|
|
|
|
</Layer>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="text" inherits="SortedTitleFont" text="Subfilters">
|
|
|
|
|
<Anchors><Anchor point="TOP" y="-12"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer-->
|
|
|
|
|
</Layers>
|
|
|
|
|
<Frames>
|
|
|
|
|
<ScrollFrame name="SortedConfigCategorySubfiltersScrollFrame">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="2" y="-2"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT" x="-2" y="2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Frame name="SortedConfigCategorySubfilters">
|
|
|
|
|
<Size x="288" y="100"/>
|
|
|
|
|
<Anchors><Anchor point="TOPLEFT" /></Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.SetFilterOptionValue = function(optionGroup, option, value, key)
|
|
|
|
|
-- Since the table gets cleaned up, reconstruct anything that's missing
|
|
|
|
|
local data = SortedConfigCategoryGroups:GetData()
|
|
|
|
|
if not data.filters then
|
|
|
|
|
data.filters = {}
|
|
|
|
|
end
|
|
|
|
|
if not data.filters[SortedConfigCategoryFilters.selected] then
|
|
|
|
|
data.filters[SortedConfigCategoryFilters.selected] = {}
|
|
|
|
|
end
|
|
|
|
|
if not data.filters[SortedConfigCategoryFilters.selected].values then
|
|
|
|
|
data.filters[SortedConfigCategoryFilters.selected].values = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Set the value
|
|
|
|
|
local values = data.filters[SortedConfigCategoryFilters.selected].values
|
|
|
|
|
if not values[optionGroup] then values[optionGroup] = {} end
|
|
|
|
|
|
|
|
|
|
if key then
|
|
|
|
|
if not values[optionGroup][option] then values[optionGroup][option] = {} end
|
|
|
|
|
values[optionGroup][option][key] = value
|
|
|
|
|
else
|
|
|
|
|
values[optionGroup][option] = value
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Sorted_CleanTable(SortedConfigCategoryGroups:GetData())
|
|
|
|
|
SortedConfigCategoryFilters:Update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.checkButtons = {}
|
|
|
|
|
self.numberRanges = {}
|
|
|
|
|
self.specificItems = {}
|
|
|
|
|
self.fontStrings = {}
|
|
|
|
|
self.editBoxes = {}
|
|
|
|
|
self.allItems = {}
|
|
|
|
|
function self:GetItem(row, type)
|
|
|
|
|
local y = -13 - (row - 1) * 22
|
|
|
|
|
|
|
|
|
|
if type == "CheckButton" then
|
|
|
|
|
if not self.checkButtons[row] then
|
|
|
|
|
local cb = CreateFrame("CheckButton", self:GetName().."CheckButton"..row, self, "SortedFilterOptionCheckBox")
|
|
|
|
|
cb:SetPoint("TOPLEFT", 4, y + 11)
|
|
|
|
|
cb.clickable:SetPoint("RIGHT", self)
|
|
|
|
|
self.checkButtons[row] = cb
|
|
|
|
|
table.insert(self.allItems, cb)
|
|
|
|
|
end
|
|
|
|
|
return self.checkButtons[row]
|
|
|
|
|
|
|
|
|
|
elseif type == "Range" then
|
|
|
|
|
if not self.numberRanges[row] then
|
|
|
|
|
local nr = CreateFrame("Frame", self:GetName().."NumberRange"..row, self, "SortedFilterOptionRange")
|
|
|
|
|
nr:SetPoint("TOPLEFT", 6, y + 11)
|
|
|
|
|
nr:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 0, y - 11)
|
|
|
|
|
self.numberRanges[row] = nr
|
|
|
|
|
table.insert(self.allItems, nr)
|
|
|
|
|
end
|
|
|
|
|
return self.numberRanges[row]
|
|
|
|
|
|
|
|
|
|
elseif type == "Item" then
|
|
|
|
|
if not self.specificItems[row] then
|
|
|
|
|
local si = CreateFrame("Frame", self:GetName().."SpecificItem"..row, self, "SortedFilterOptionItem")
|
|
|
|
|
si:SetPoint("TOPLEFT", 6, y + 11)
|
|
|
|
|
si:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 0, y - 11)
|
|
|
|
|
self.specificItems[row] = si
|
|
|
|
|
table.insert(self.allItems, si)
|
|
|
|
|
|
|
|
|
|
--si.editBoxID:HookScript("OnTextChanged", ItemIDOnTextChanged)
|
|
|
|
|
--si.editBoxName:HookScript("OnTextChanged", ItemNameOnTextChanged)
|
|
|
|
|
end
|
|
|
|
|
return self.specificItems[row]
|
|
|
|
|
|
|
|
|
|
elseif type == "Text" then
|
|
|
|
|
if not self.editBoxes[row] then
|
|
|
|
|
local eb = CreateFrame("EditBox", self:GetName().."EditBox"..row, self, "SortedFilterOptionText")
|
|
|
|
|
eb:SetPoint("TOPLEFT", 8, y + 11)
|
|
|
|
|
eb:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", -4, y - 11)
|
|
|
|
|
self.editBoxes[row] = eb
|
|
|
|
|
table.insert(self.allItems, eb)
|
|
|
|
|
end
|
|
|
|
|
return self.editBoxes[row]
|
|
|
|
|
|
|
|
|
|
elseif type == "Header" then
|
|
|
|
|
if not self.fontStrings[row] then
|
|
|
|
|
self.fontStrings[row] = self:CreateFontString(self:GetName().."FontString"..row, "OVERLAY", "SortedButtonFont")
|
|
|
|
|
self.fontStrings[row]:SetPoint("LEFT", self, "TOPLEFT", 6, y)
|
|
|
|
|
table.insert(self.allItems, self.fontStrings[row])
|
|
|
|
|
end
|
|
|
|
|
return self.fontStrings[row]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
for _, v in pairs(self.allItems) do
|
|
|
|
|
v.toHide = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if SortedConfigCategoryFilters.selected then
|
|
|
|
|
local filterID = SortedConfigCategoryFilters.selected
|
|
|
|
|
local data = SortedConfigCategoryGroups:GetData()
|
|
|
|
|
local options = Sorted_filters[SortedConfigCategoryFilters.selected]
|
|
|
|
|
local row = 1
|
|
|
|
|
|
|
|
|
|
for optionGroupID, optionGroup in ipairs(options.optionGroups) do
|
|
|
|
|
local head = self:GetItem(row, "Header")
|
|
|
|
|
head:SetText(optionGroup.name)
|
|
|
|
|
head.toHide = false
|
|
|
|
|
head:Show()
|
|
|
|
|
|
|
|
|
|
if Sorted_GetSubfilterGroupEnabled(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID) then
|
|
|
|
|
self:GetItem(row, "Header"):SetTextColor(1, 0.82, 0)
|
|
|
|
|
row = row + 1
|
|
|
|
|
|
|
|
|
|
if optionGroup.type == "LIST" then
|
|
|
|
|
local i = 1
|
|
|
|
|
local v = Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, i)
|
|
|
|
|
while v do
|
|
|
|
|
local eb = self:GetItem(row, "Text")
|
|
|
|
|
eb.toHide = false
|
|
|
|
|
eb:Show()
|
|
|
|
|
eb:SetText(v)
|
|
|
|
|
eb.key1 = optionGroupID
|
|
|
|
|
eb.key2 = i
|
|
|
|
|
row = row + 1
|
|
|
|
|
i = i + 1
|
|
|
|
|
v = Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, i)
|
|
|
|
|
end
|
|
|
|
|
local eb = self:GetItem(row, "Text")
|
|
|
|
|
eb.toHide = false
|
|
|
|
|
eb:Show()
|
|
|
|
|
eb:SetText("")
|
|
|
|
|
eb.key1 = optionGroupID
|
|
|
|
|
eb.key2 = i
|
|
|
|
|
row = row + 1
|
|
|
|
|
elseif optionGroup.type == "IDLIST" then
|
|
|
|
|
local i = 1
|
|
|
|
|
local v = Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, i)
|
|
|
|
|
while v do
|
|
|
|
|
local si = self:GetItem(row, "Item")
|
|
|
|
|
si.toHide = false
|
|
|
|
|
si:Show()
|
|
|
|
|
if v.id then
|
|
|
|
|
si.editBoxID:SetText(v.id)
|
|
|
|
|
else
|
|
|
|
|
si.editBoxID:SetText("")
|
|
|
|
|
end
|
|
|
|
|
if v.name then
|
|
|
|
|
si.editBoxName:SetText(v.name)
|
|
|
|
|
else
|
|
|
|
|
si.editBoxName:SetText("")
|
|
|
|
|
end
|
|
|
|
|
si.key1 = optionGroupID
|
|
|
|
|
si.key2 = i
|
|
|
|
|
si:Update()
|
|
|
|
|
row = row + 3
|
|
|
|
|
i = i + 1
|
|
|
|
|
v = Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, i)
|
|
|
|
|
end
|
|
|
|
|
local si = self:GetItem(row, "Item")
|
|
|
|
|
si.toHide = false
|
|
|
|
|
si:Show()
|
|
|
|
|
si.editBoxID:SetText("")
|
|
|
|
|
si.editBoxName:SetText("")
|
|
|
|
|
si.key1 = optionGroupID
|
|
|
|
|
si.key2 = i
|
|
|
|
|
si:Update()
|
|
|
|
|
row = row + 3
|
|
|
|
|
else
|
|
|
|
|
for optionID, option in ipairs(optionGroup.options) do
|
|
|
|
|
if option.type == "RANGE" then
|
|
|
|
|
local nr = self:GetItem(row, "Range")
|
|
|
|
|
nr.text:SetText(option.name)
|
|
|
|
|
local value = Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, optionID)
|
|
|
|
|
if value then
|
|
|
|
|
if value.min and value.min > 0 then
|
|
|
|
|
nr.min:SetNumber(value.min)
|
|
|
|
|
else
|
|
|
|
|
nr.min:SetText("")
|
|
|
|
|
end
|
|
|
|
|
if value.max and value.max > 0 then
|
|
|
|
|
nr.max:SetNumber(value.max)
|
|
|
|
|
else
|
|
|
|
|
nr.max:SetText("")
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
nr.min:SetText("")
|
|
|
|
|
nr.max:SetText("")
|
|
|
|
|
end
|
|
|
|
|
nr.toHide = false
|
|
|
|
|
nr:Show()
|
|
|
|
|
nr.key1 = optionGroupID
|
|
|
|
|
nr.key2 = optionID
|
|
|
|
|
else
|
|
|
|
|
local cb = self:GetItem(row, "CheckButton")
|
|
|
|
|
cb.text:SetText(option.name)
|
|
|
|
|
cb.toHide = false
|
|
|
|
|
cb:Show()
|
|
|
|
|
if Sorted_GetSubfilterValue(SortedConfigCategories.selected, SortedConfigCategoryGroups.value, filterID, optionGroupID, optionID) then
|
|
|
|
|
cb:SetChecked(true)
|
|
|
|
|
else
|
|
|
|
|
cb:SetChecked(false)
|
|
|
|
|
end
|
|
|
|
|
cb.key1 = optionGroupID
|
|
|
|
|
cb.key2 = optionID
|
|
|
|
|
end
|
|
|
|
|
row = row + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
self:GetItem(row, "Header"):SetTextColor(0.5, 0.5, 0.5)
|
|
|
|
|
row = row + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:SetHeight(row * 22 - 12)
|
|
|
|
|
self:UpdateScrollBar()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for _, v in pairs(self.allItems) do
|
|
|
|
|
if v.toHide then
|
|
|
|
|
v:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:UpdateScrollBar()
|
|
|
|
|
local max = SortedConfigCategorySubfilters:GetHeight() - SortedConfigCategorySubfiltersScrollFrame:GetHeight()
|
|
|
|
|
if max > 0 then
|
|
|
|
|
self:GetParent().scrollBar:SetMinMaxValues(0, max)
|
|
|
|
|
else
|
|
|
|
|
self:GetParent().scrollBar:SetMinMaxValues(0, 0)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
self:UpdateScrollBar()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.scrollBar = CreateFrame("Slider", self:GetName().."ScrollBar", self, "MinimalScrollBarTemplate")
|
|
|
|
|
self.scrollBar.trackBG:Hide()
|
|
|
|
|
self.scrollBar:SetPoint("TOPRIGHT", 1, -18)
|
|
|
|
|
self.scrollBar:SetPoint("BOTTOM", 0, 16)
|
|
|
|
|
self.scrollBar:SetMinMaxValues(1, 1)
|
|
|
|
|
self.scrollBar:SetValueStep(1)
|
|
|
|
|
self.scrollBar.scrollStep = 16
|
|
|
|
|
self.scrollBar:SetValue(0)
|
|
|
|
|
self:SetScrollChild(_G["SortedConfigCategorySubfilters"])
|
|
|
|
|
|
|
|
|
|
self:EnableMouseWheel(1)
|
|
|
|
|
self:SetScript("OnMouseWheel", function(self, delta)
|
|
|
|
|
self.scrollBar:SetValue(self.scrollBar:GetValue() - delta * 30)
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</ScrollFrame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
|
|
|
|
|
<!-- Profiles Tab Contents -->
|
|
|
|
|
<Frame name="$parentProfiles" hidden="true">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT"/>
|
|
|
|
|
<Anchor point="BOTTOMRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Frames>
|
|
|
|
|
<Button name="SortedConfigProfileDropdown" inherits="SortedDropdownTemplate">
|
|
|
|
|
<Size x="256" y="24"/>
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="96" y="-64"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="title" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self:OnLoad()
|
|
|
|
|
|
|
|
|
|
self.title:SetText(Sorted.Localize("CONFIG_PROFILES_PROFILE"))
|
|
|
|
|
|
|
|
|
|
function self:Count()
|
|
|
|
|
local count = 0
|
|
|
|
|
for k,v in pairs(Sorted_settingsProfiles) do
|
|
|
|
|
count = count + 1
|
|
|
|
|
end
|
|
|
|
|
return count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
self:ValueFunc()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:ValueFunc()
|
|
|
|
|
self:SetValue(Sorted_GetSetting("profileName"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function ButtonClick(self)
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = self.data
|
|
|
|
|
SortedConfigProfileName:Update()
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function self:InitFunc()
|
|
|
|
|
local sortedTable = {}
|
|
|
|
|
for k,v in pairs(Sorted_settingsProfiles) do
|
|
|
|
|
table.insert(sortedTable, {k, v.profileName})
|
|
|
|
|
end
|
|
|
|
|
table.sort(sortedTable, function(a,b) return b[2] > a[2] end)
|
|
|
|
|
for i,v in ipairs(sortedTable) do
|
|
|
|
|
local b = SortedDropdownMenu:AddButton(ButtonClick, v[2])
|
|
|
|
|
b.data = v[1]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:ValueFunc()
|
|
|
|
|
</OnShow>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button name="SortedConfigProfileNew" inherits="SortedButtonTemplate">
|
|
|
|
|
<Size x="80" y="24" />
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigProfileDropdown" relativePoint="BOTTOMLEFT" x="0" y="-2"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_PROFILES_NEW"))
|
|
|
|
|
self.text:SetJustifyH("CENTER")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnClick>
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = Sorted_CreateNewSettingsProfile(Sorted.Localize("CONFIG_PROFILES_DEFAULT_NAME"))
|
|
|
|
|
|
|
|
|
|
SortedConfigProfileDropdown:Update()
|
|
|
|
|
SortedConfigProfileName:Update()
|
|
|
|
|
SortedConfigProfileDelete:Update()
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
SortedConfigProfileName.editBox:SetFocus(true)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button name="SortedConfigProfileCopy" inherits="SortedButtonTemplate">
|
|
|
|
|
<Size x="96" y="24" />
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigProfileNew" relativePoint="TOPRIGHT"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_PROFILES_COPY"))
|
|
|
|
|
self.text:SetJustifyH("CENTER")
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnClick>
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = Sorted_CreateCopyOfSettingsProfile(Sorted_GetData(UnitGUID("player")).settingsProfile)
|
|
|
|
|
|
|
|
|
|
SortedConfigProfileDropdown:Update()
|
|
|
|
|
SortedConfigProfileName:Update()
|
|
|
|
|
SortedConfigProfileDelete:Update()
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
SortedConfigProfileName.editBox:SetFocus(true)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button name="SortedConfigProfileDelete" inherits="SortedButtonTemplate">
|
|
|
|
|
<Size y="24" />
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" relativeTo="SortedConfigProfileCopy" relativePoint="TOPRIGHT"/>
|
|
|
|
|
<Anchor point="RIGHT" relativeTo="SortedConfigProfileDropdown"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.text:SetText(Sorted.Localize("CONFIG_PROFILES_DELETE"))
|
|
|
|
|
self.text:SetJustifyH("CENTER")
|
|
|
|
|
|
|
|
|
|
StaticPopupDialogs["SORTED_DELETE_PROFILE"] = {
|
|
|
|
|
text = Sorted.Localize("DIALOG_DELETE_SETTINGS_PROFILE"),
|
|
|
|
|
button1 = Sorted.Localize("DIALOG_BUTTON_DELETE"),
|
|
|
|
|
button2 = Sorted.Localize("DIALOG_BUTTON_CANCEL"),
|
|
|
|
|
OnAccept = function(self)
|
|
|
|
|
Sorted_settingsProfiles[Sorted_GetData(UnitGUID("player")).settingsProfile] = nil
|
|
|
|
|
if #Sorted_settingsProfiles > 0 then
|
|
|
|
|
for k,v in pairs(Sorted_settingsProfiles) do
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = k
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
Sorted_GetData(UnitGUID("player")).settingsProfile = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
SortedConfigProfileDropdown:Update()
|
|
|
|
|
SortedConfigProfileName:Update()
|
|
|
|
|
Sorted_ReloadAllSettings()
|
|
|
|
|
SortedConfigFrame:SetScale(Sorted_GetSetting("scale"))
|
|
|
|
|
SortedConfigProfileDelete:Update()
|
|
|
|
|
if not Sorted_GetData(UnitGUID("player")).settingsProfile then
|
|
|
|
|
SortedConfigFrame:Hide()
|
|
|
|
|
SortedProfileSelectFrame:Show()
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
timeout = 0,
|
|
|
|
|
hideOnEscape = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
--[[if 2 > SortedConfigProfileDropdown:Count() then
|
|
|
|
|
self:Disable()
|
|
|
|
|
else
|
|
|
|
|
self:Enable()
|
|
|
|
|
end]]
|
|
|
|
|
end
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnClick>
|
|
|
|
|
local dialog = StaticPopup_Show("SORTED_DELETE_PROFILE", Sorted_settingsProfiles[Sorted_GetData(UnitGUID("player")).settingsProfile].profileName)
|
|
|
|
|
</OnClick>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Button>
|
|
|
|
|
<Frame name="SortedConfigProfileName" inherits="SortedLargeInputBoxTemplate">
|
|
|
|
|
<Anchors>
|
|
|
|
|
<Anchor point="TOPLEFT" x="96" y="-176"/>
|
|
|
|
|
<Anchor point="RIGHT" x="-96"/>
|
|
|
|
|
</Anchors>
|
|
|
|
|
<Layers>
|
|
|
|
|
<Layer>
|
|
|
|
|
<FontString name="$parentText" parentKey="title" inherits="SortedTitleFont">
|
|
|
|
|
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="4"/></Anchors>
|
|
|
|
|
</FontString>
|
|
|
|
|
</Layer>
|
|
|
|
|
</Layers>
|
|
|
|
|
<Scripts>
|
|
|
|
|
<OnLoad>
|
|
|
|
|
self.title:SetText(Sorted.Localize("CONFIG_PROFILES_NAME"))
|
|
|
|
|
|
|
|
|
|
function self:Update()
|
|
|
|
|
self.editBox:SetText(Sorted_GetSetting("profileName"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not Sorted_IsClassic() then
|
|
|
|
|
self:RegisterEvent("GLOBAL_MOUSE_DOWN")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.editBox:SetScript("OnTextChanged", function(self)
|
|
|
|
|
Sorted_SetSetting("profileName", self:GetText())
|
|
|
|
|
SortedConfigProfileDropdown:ValueFunc()
|
|
|
|
|
end)
|
|
|
|
|
self.editBox:SetScript("OnEnterPressed", function(self)
|
|
|
|
|
self:ClearFocus()
|
|
|
|
|
end)
|
|
|
|
|
</OnLoad>
|
|
|
|
|
<OnShow>
|
|
|
|
|
self:Update()
|
|
|
|
|
</OnShow>
|
|
|
|
|
<OnEvent>
|
|
|
|
|
if event == "GLOBAL_MOUSE_DOWN" and self:IsShown() then
|
|
|
|
|
if not self:IsMouseOver() then
|
|
|
|
|
self.editBox:ClearFocus()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
</OnEvent>
|
|
|
|
|
</Scripts>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Frames>
|
|
|
|
|
</Frame>
|
|
|
|
|
</Ui>
|