from retail
This commit is contained in:
@@ -677,8 +677,18 @@ typeControlAdders = {
|
||||
bigStep = option.bigStep
|
||||
min = option.min
|
||||
max = option.max
|
||||
if max and min then
|
||||
max = math.max(min, max)
|
||||
local effectiveMin = softMin or min or 0
|
||||
local effectiveMax = softMax or max or 100
|
||||
if (effectiveMin > effectiveMax) then
|
||||
-- This will cause a error inside the slider
|
||||
-- Fix up either softMax or max, depending on which one is the effective one
|
||||
if softMax then
|
||||
softMax = effectiveMin
|
||||
elseif max then
|
||||
max = effectiveMin
|
||||
else
|
||||
softMax = effectiveMin
|
||||
end
|
||||
end
|
||||
step = option.step
|
||||
args[prefix .. "default"] = {
|
||||
@@ -967,7 +977,6 @@ typeControlAdders = {
|
||||
end,
|
||||
multiselect = function(options, args, data, order, prefix, i)
|
||||
local option = options[i]
|
||||
args[prefix .. "width"] = nil
|
||||
local values = getValues(option)
|
||||
local defaultValues = {}
|
||||
for i, v in ipairs(values) do
|
||||
@@ -2234,8 +2243,18 @@ local function addUserModeOption(options, args, data, order, prefix, i)
|
||||
userOption.bigStep = option.bigStep
|
||||
userOption.min = option.min
|
||||
userOption.max = option.max
|
||||
if userOption.max and userOption.min then
|
||||
userOption.max = max(userOption.min, userOption.max)
|
||||
local effectiveMin = userOption.softMin or userOption.min or 0
|
||||
local effectiveMax = userOption.softMax or userOption.max or 100
|
||||
if (effectiveMin > effectiveMax) then
|
||||
-- This will cause a error inside the slider
|
||||
-- Fix up either softMax or max, depending on which one is the effective one
|
||||
if userOption.softMax then
|
||||
userOption.softMax = effectiveMin
|
||||
elseif userOption.max then
|
||||
userOption.max = effectiveMin
|
||||
else
|
||||
userOption.softMax = effectiveMin
|
||||
end
|
||||
end
|
||||
userOption.step = option.step
|
||||
elseif optionType == "color" then
|
||||
|
||||
@@ -1184,7 +1184,7 @@ function OptionsPrivate.CreateFrame()
|
||||
tinsert(regionTypesSorted, regionType)
|
||||
end
|
||||
|
||||
-- Sort group + dynamic group first, then the others alphabeticaly
|
||||
-- Sort group + dynamic group first, then the others alphabetically
|
||||
table.sort(regionTypesSorted, function(a, b)
|
||||
if (a == "group") then
|
||||
return true
|
||||
|
||||
@@ -624,7 +624,7 @@ local function ConstructTextEditor(frame)
|
||||
editor.editBox:SetScript(
|
||||
"OnEscapePressed",
|
||||
function()
|
||||
group:CancelClose()
|
||||
-- catch it so that escape doesn't default to losing focus (after which another escape would close config)
|
||||
end
|
||||
)
|
||||
self.oldOnTextChanged = editor.editBox:GetScript("OnTextChanged")
|
||||
|
||||
@@ -12,7 +12,7 @@ local function notEmptyString(str)
|
||||
end
|
||||
|
||||
local function addCode(codes, text, code, ...)
|
||||
-- The 4th paramter is a "check" if the code is active
|
||||
-- The 4th parameter is a "check" if the code is active
|
||||
-- The following line let's distinguish between addCode(a, b, c, nil) and addCode(a, b, c)
|
||||
-- If the 4th parameter is nil, then we want to return
|
||||
if (select("#", ...) > 0) then
|
||||
@@ -182,7 +182,7 @@ local function recurseUpdate(data, chunk)
|
||||
end
|
||||
end
|
||||
|
||||
local ignoredForDiffChecking -- Needs to be created lazyly
|
||||
local ignoredForDiffChecking -- Needs to be created lazily
|
||||
local function RecurseDiff(ours, theirs)
|
||||
local diff, seen, same = {}, {}, true
|
||||
for key, ourVal in pairs(ours) do
|
||||
@@ -315,7 +315,7 @@ local function BuildUidMap(data, children, type)
|
||||
idToUid[data.id] = data.uid
|
||||
for i, child in ipairs(children) do
|
||||
if idToUid[child.id] then
|
||||
error("Diplicated id in import data")
|
||||
error("Duplicate id in import data: "..child.id)
|
||||
end
|
||||
idToUid[child.id] = child.uid
|
||||
end
|
||||
@@ -381,7 +381,7 @@ local function BuildUidMap(data, children, type)
|
||||
self.idToUid[data.id] = data.uid
|
||||
self.totalCount = self.totalCount + 1
|
||||
|
||||
-- clean up children/sortHybird
|
||||
-- clean up children/sortHybrid
|
||||
-- The Update code first inserts children before it inserts us
|
||||
-- But not every child might be inserted, since empty groups aren't inserted
|
||||
-- so clean that up here
|
||||
@@ -1242,7 +1242,7 @@ local function AddAuraList(container, uidMap, list, expandText)
|
||||
end
|
||||
|
||||
local methods = {
|
||||
Open = function(self, data, children, target, sender)
|
||||
Open = function(self, data, children, target, sender, callbackFunc)
|
||||
if(self.optionsWindow.window == "importexport") then
|
||||
self.optionsWindow.importexport:Close();
|
||||
elseif(self.optionsWindow.window == "texture") then
|
||||
@@ -1264,6 +1264,7 @@ local methods = {
|
||||
self.userChoices = {
|
||||
|
||||
}
|
||||
self.callbackFunc = callbackFunc
|
||||
|
||||
self:ReleaseChildren()
|
||||
self:AddBasicInformationWidgets(data, sender)
|
||||
@@ -1513,7 +1514,7 @@ local methods = {
|
||||
local onePhaseProgress = matchInfo.oldUidMap:GetTotalCount() + matchInfo.newUidMap:GetTotalCount()
|
||||
local IncProgress = function() self:IncProgress() end
|
||||
|
||||
-- The progress is more for appereance than anything resembling real calculation
|
||||
-- The progress is more for appearances than anything resembling real calculation
|
||||
-- The estimate for the total work is wonky, as is how the code compensates for that
|
||||
-- But then again, lying progress bar is a industry standard pratice
|
||||
self:InitializeProgress(onePhaseProgress * 26)
|
||||
@@ -1543,7 +1544,7 @@ local methods = {
|
||||
local GetPhase1Data -- Getting the right data is a bit tricky, and depends on the mode
|
||||
local GetPhase2Data
|
||||
if userChoices.activeCategories.arrangement then
|
||||
-- new arragement
|
||||
-- new arrangement
|
||||
structureUidMap = matchInfo.newUidMap
|
||||
if not userChoices.activeCategories.oldchildren then
|
||||
-- Keep old children
|
||||
@@ -1641,8 +1642,7 @@ local methods = {
|
||||
self.closeButton:Enable()
|
||||
OptionsPrivate.Private.callbacks:Fire("Import")
|
||||
|
||||
self:Close()
|
||||
|
||||
self:Close(true, pendingPickData.id)
|
||||
|
||||
if pendingPickData then
|
||||
OptionsPrivate.ClearPicks()
|
||||
@@ -1942,9 +1942,12 @@ local methods = {
|
||||
self.progress = self.total
|
||||
self.progressBar:SetProgress(self.progress, self.total)
|
||||
end,
|
||||
Close = function(self)
|
||||
Close = function(self, success, id)
|
||||
self.optionsWindow.window = "default";
|
||||
self.optionsWindow:UpdateFrameVisible()
|
||||
if self.callbackFunc then
|
||||
self.callbackFunc(success, id)
|
||||
end
|
||||
end,
|
||||
AddBasicInformationWidgets = function(self, data, sender)
|
||||
local title = AceGUI:Create("Label")
|
||||
@@ -2025,7 +2028,7 @@ local function ConstructUpdateFrame(frame)
|
||||
importButton:SetText(L["Import"])
|
||||
|
||||
local closeButton = CreateFrame("Button", nil, group.frame, "UIPanelButtonTemplate");
|
||||
closeButton:SetScript("OnClick", function() group:Close() end);
|
||||
closeButton:SetScript("OnClick", function() group:Close(false) end);
|
||||
closeButton:SetPoint("BOTTOMRIGHT", -20, -24);
|
||||
closeButton:SetFrameLevel(closeButton:GetFrameLevel() + 1)
|
||||
closeButton:SetHeight(20);
|
||||
|
||||
@@ -896,8 +896,8 @@ function OptionsPrivate.OpenDebugLog(text)
|
||||
frame.debugLog:Open(text)
|
||||
end
|
||||
|
||||
function OptionsPrivate.OpenUpdate(data, children, target, sender)
|
||||
return frame.update:Open(data, children, target, sender)
|
||||
function OptionsPrivate.OpenUpdate(data, children, target, sender, callbackFunc)
|
||||
return frame.update:Open(data, children, target, sender, callbackFunc)
|
||||
end
|
||||
|
||||
function OptionsPrivate.ConvertDisplay(data, newType)
|
||||
@@ -1931,7 +1931,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h
|
||||
headerOption = {
|
||||
type = "execute",
|
||||
control = "WeakAurasExpandSmall",
|
||||
name = L["|cFFffcc00Format Options|r"],
|
||||
name = L["|cffffcc00Format Options|r"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
func = function(info, button)
|
||||
setHidden(not hidden())
|
||||
|
||||
Reference in New Issue
Block a user