from retail
This commit is contained in:
@@ -65,7 +65,7 @@ local function ConstructDebugLog(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.DebugLog(frame)
|
function OptionsPrivate.DebugLog(frame, noConstruct)
|
||||||
debugLog = debugLog or ConstructDebugLog(frame)
|
debugLog = debugLog or (not noConstruct and ConstructDebugLog(frame))
|
||||||
return debugLog
|
return debugLog
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ local function ConstructIconPicker(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.IconPicker(frame)
|
function OptionsPrivate.IconPicker(frame, noConstruct)
|
||||||
iconPicker = iconPicker or ConstructIconPicker(frame)
|
iconPicker = iconPicker or (not noConstruct and ConstructIconPicker(frame))
|
||||||
return iconPicker
|
return iconPicker
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,11 +35,20 @@ local function ConstructImportExport(frame)
|
|||||||
|
|
||||||
function group.Open(self, mode, id)
|
function group.Open(self, mode, id)
|
||||||
if(frame.window == "texture") then
|
if(frame.window == "texture") then
|
||||||
frame.texturePicker:CancelClose();
|
local texturepicker = OptionsPrivate.TexturePicker(frame, true)
|
||||||
|
if texturepicker then
|
||||||
|
texturepicker:CancelClose();
|
||||||
|
end
|
||||||
elseif(frame.window == "icon") then
|
elseif(frame.window == "icon") then
|
||||||
frame.iconPicker:CancelClose();
|
local iconpicker = OptionsPrivate.IconPicker(frame, true)
|
||||||
|
if iconpicker then
|
||||||
|
iconpicker:CancelClose();
|
||||||
|
end
|
||||||
elseif(frame.window == "model") then
|
elseif(frame.window == "model") then
|
||||||
frame.modelPicker:CancelClose();
|
local modelpicker = OptionsPrivate.ModelPicker(frame, true)
|
||||||
|
if modelpicker then
|
||||||
|
modelpicker:CancelClose();
|
||||||
|
end
|
||||||
end
|
end
|
||||||
frame.window = "importexport";
|
frame.window = "importexport";
|
||||||
frame:UpdateFrameVisible()
|
frame:UpdateFrameVisible()
|
||||||
@@ -89,7 +98,7 @@ local function ConstructImportExport(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.ImportExport(frame)
|
function OptionsPrivate.ImportExport(frame, noConstruct)
|
||||||
importexport = importexport or ConstructImportExport(frame)
|
importexport = importexport or (not noConstruct and ConstructImportExport(frame))
|
||||||
return importexport
|
return importexport
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ local function ConstructModelPicker(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.ModelPicker(frame)
|
function OptionsPrivate.ModelPicker(frame, noConstruct)
|
||||||
modelPicker = modelPicker or ConstructModelPicker(frame)
|
modelPicker = modelPicker or (not noConstruct and ConstructModelPicker(frame))
|
||||||
return modelPicker
|
return modelPicker
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -241,48 +241,31 @@ function OptionsPrivate.CreateFrame()
|
|||||||
self.dynamicTextCodesFrame:Hide()
|
self.dynamicTextCodesFrame:Hide()
|
||||||
self:HideTip()
|
self:HideTip()
|
||||||
end
|
end
|
||||||
|
local widgets = {
|
||||||
|
{ window = "texture", title = L["Texture Picker"], fn = "TexturePicker" },
|
||||||
|
{ window = "icon", title = L["Icon Picker"], fn = "IconPicker" },
|
||||||
|
{ window = "model", title = L["Model Picker"], fn = "ModelPicker" },
|
||||||
|
{ window = "importexport", title = L["Import / Export"], fn = "ImportExport" },
|
||||||
|
{ window = "texteditor", title = L["Code Editor"], fn = "TextEditor" },
|
||||||
|
{ window = "codereview", title = L["Custom Code Viewer"], fn = "CodeReview" },
|
||||||
|
{ window = "debuglog", title = L["Debug Log"], fn = "DebugLog" },
|
||||||
|
{ window = "update", title = L["Update"], fn = "UpdateFrame" },
|
||||||
|
}
|
||||||
|
|
||||||
if self.window == "texture" then
|
for _, widget in ipairs(widgets) do
|
||||||
OptionsPrivate.SetTitle(L["Texture Picker"])
|
local obj = OptionsPrivate[widget.fn](self, true)
|
||||||
self.texturePicker.frame:Show()
|
if self.window == widget.window then
|
||||||
else
|
OptionsPrivate.SetTitle(widget.title)
|
||||||
self.texturePicker.frame:Hide()
|
if obj then
|
||||||
|
obj.frame:Show()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if obj then
|
||||||
|
obj.frame:Hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.window == "icon" then
|
|
||||||
OptionsPrivate.SetTitle(L["Icon Picker"])
|
|
||||||
self.iconPicker.frame:Show()
|
|
||||||
else
|
|
||||||
self.iconPicker.frame:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.window == "model" then
|
|
||||||
OptionsPrivate.SetTitle(L["Model Picker"])
|
|
||||||
self.modelPicker.frame:Show()
|
|
||||||
else
|
|
||||||
self.modelPicker.frame:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.window == "importexport" then
|
|
||||||
OptionsPrivate.SetTitle(L["Import / Export"])
|
|
||||||
self.importexport.frame:Show()
|
|
||||||
else
|
|
||||||
self.importexport.frame:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.window == "texteditor" then
|
|
||||||
OptionsPrivate.SetTitle(L["Code Editor"])
|
|
||||||
self.texteditor.frame:Show()
|
|
||||||
else
|
|
||||||
self.texteditor.frame:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.window == "codereview" then
|
|
||||||
OptionsPrivate.SetTitle(L["Custom Code Viewer"])
|
|
||||||
self.codereview.frame:Show()
|
|
||||||
else
|
|
||||||
self.codereview.frame:Hide()
|
|
||||||
end
|
|
||||||
if self.window == "newView" then
|
if self.window == "newView" then
|
||||||
OptionsPrivate.SetTitle(L["New Template"])
|
OptionsPrivate.SetTitle(L["New Template"])
|
||||||
self.newView.frame:Show()
|
self.newView.frame:Show()
|
||||||
@@ -291,18 +274,6 @@ function OptionsPrivate.CreateFrame()
|
|||||||
self.newView.frame:Hide()
|
self.newView.frame:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if self.window == "update" then
|
|
||||||
OptionsPrivate.SetTitle(L["Update"])
|
|
||||||
self.update.frame:Show()
|
|
||||||
else
|
|
||||||
self.update.frame:Hide()
|
|
||||||
end
|
|
||||||
if self.window == "debuglog" then
|
|
||||||
OptionsPrivate.SetTitle(L["Debug Log"])
|
|
||||||
self.debugLog.frame:Show()
|
|
||||||
else
|
|
||||||
self.debugLog.frame:Hide()
|
|
||||||
end
|
|
||||||
if self.window == "default" then
|
if self.window == "default" then
|
||||||
if self.loadProgessVisible then
|
if self.loadProgessVisible then
|
||||||
self.loadProgress:Show()
|
self.loadProgress:Show()
|
||||||
@@ -490,15 +461,6 @@ function OptionsPrivate.CreateFrame()
|
|||||||
container.content:SetPoint("BOTTOMRIGHT", 0, 0)
|
container.content:SetPoint("BOTTOMRIGHT", 0, 0)
|
||||||
frame.container = container
|
frame.container = container
|
||||||
|
|
||||||
frame.texturePicker = OptionsPrivate.TexturePicker(frame)
|
|
||||||
frame.iconPicker = OptionsPrivate.IconPicker(frame)
|
|
||||||
frame.modelPicker = OptionsPrivate.ModelPicker(frame)
|
|
||||||
frame.importexport = OptionsPrivate.ImportExport(frame)
|
|
||||||
frame.texteditor = OptionsPrivate.TextEditor(frame)
|
|
||||||
frame.codereview = OptionsPrivate.CodeReview(frame)
|
|
||||||
frame.update = OptionsPrivate.UpdateFrame(frame)
|
|
||||||
frame.debugLog = OptionsPrivate.DebugLog(frame)
|
|
||||||
|
|
||||||
frame.moversizer, frame.mover = OptionsPrivate.MoverSizer(frame)
|
frame.moversizer, frame.mover = OptionsPrivate.MoverSizer(frame)
|
||||||
|
|
||||||
-- filter line
|
-- filter line
|
||||||
|
|||||||
@@ -605,9 +605,15 @@ local function ConstructTextEditor(frame)
|
|||||||
helpButton:Hide()
|
helpButton:Hide()
|
||||||
end
|
end
|
||||||
if (frame.window == "texture") then
|
if (frame.window == "texture") then
|
||||||
frame.texturePicker:CancelClose()
|
local texturepicker = OptionsPrivate.TexturePicker(frame, true)
|
||||||
|
if texturepicker then
|
||||||
|
texturepicker:CancelClose()
|
||||||
|
end
|
||||||
elseif (frame.window == "icon") then
|
elseif (frame.window == "icon") then
|
||||||
frame.iconPicker:CancelClose()
|
local iconpicker = OptionsPrivate.IconPicker(frame, true)
|
||||||
|
if iconpicker then
|
||||||
|
iconpicker:CancelClose()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
frame.window = "texteditor"
|
frame.window = "texteditor"
|
||||||
frame:UpdateFrameVisible()
|
frame:UpdateFrameVisible()
|
||||||
@@ -774,7 +780,7 @@ local function ConstructTextEditor(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.TextEditor(frame)
|
function OptionsPrivate.TextEditor(frame, noConstruct)
|
||||||
textEditor = textEditor or ConstructTextEditor(frame)
|
textEditor = textEditor or (not noConstruct and ConstructTextEditor(frame))
|
||||||
return textEditor
|
return textEditor
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ local function ConstructTexturePicker(frame)
|
|||||||
return group
|
return group
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsPrivate.TexturePicker(frame)
|
function OptionsPrivate.TexturePicker(frame, noConstruct)
|
||||||
texturePicker = texturePicker or ConstructTexturePicker(frame)
|
texturePicker = texturePicker or (not noConstruct and ConstructTexturePicker(frame))
|
||||||
return texturePicker
|
return texturePicker
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user