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