diff --git a/changelog/snippets/feature.7097.md b/changelog/snippets/feature.7097.md new file mode 100644 index 00000000000..eb22fdfe4a5 --- /dev/null +++ b/changelog/snippets/feature.7097.md @@ -0,0 +1 @@ +- (#7097) Reworked options window with improved layout, live search, and better overall usability. diff --git a/lua/ui/dialogs/options.lua b/lua/ui/dialogs/options.lua index 2ac44e2f731..852d4c3373d 100644 --- a/lua/ui/dialogs/options.lua +++ b/lua/ui/dialogs/options.lua @@ -9,7 +9,6 @@ local UIUtil = import("/lua/ui/uiutil.lua") local LayoutHelpers = import("/lua/maui/layouthelpers.lua") local Bitmap = import("/lua/maui/bitmap.lua").Bitmap -local Button = import("/lua/maui/button.lua").Button local MenuCommon = import("/lua/ui/menus/menucommon.lua") local Group = import("/lua/maui/group.lua").Group local Grid = import("/lua/maui/grid.lua").Grid @@ -18,15 +17,18 @@ local Combo = import("/lua/ui/controls/combo.lua").Combo local IntegerSlider = import("/lua/maui/slider.lua").IntegerSlider local OptionsLogic = import("/lua/options/optionslogic.lua") local Tooltip = import("/lua/ui/game/tooltip.lua") +local Edit = import("/lua/maui/edit.lua").Edit -- this will hold the working set of options, which won't be valid until applied local currentOptionsSet = nil local currentTabButton = nil -local currentTabBitmap = nil -- contains a map of current option controls keyed by their option keys local optionKeyToControlMap = nil +local OptionRowWidth = 700 +local OptionRowHeight = 34 + -- this table is keyed with the different types of controls that can be created -- each key's value is the function that actually creates the type -- the signature of the function is: fucntion(parent, optionItemData) and should return it's base control @@ -77,7 +79,7 @@ local controlTypeCreate = { self.Key = index currentOptionsSet[optionItemData.key] = combo.keyMap[index] if optionItemData.update and not skipUpdate then - optionItemData.update(self,combo.keyMap[index]) + optionItemData.update(self, combo.keyMap[index]) end end @@ -149,7 +151,7 @@ local controlTypeCreate = { LayoutHelpers.RightOf(sliderGroup._value, sliderGroup._slider) sliderGroup._slider.OnValueChanged = function(self, newValue) - sliderGroup._value:SetText(math.floor(tostring(newValue))) + sliderGroup._value:SetText(tostring(math.floor(newValue))) end sliderGroup._slider.OnValueSet = function(self, newValue) @@ -171,9 +173,9 @@ local controlTypeCreate = { end end - sliderGroup._slider.OnScrub = function(self,value) + sliderGroup._slider.OnScrub = function(self, value) if optionItemData.update then - optionItemData.update(self,value) + optionItemData.update(self, value) end end @@ -190,7 +192,7 @@ local controlTypeCreate = { end -- set initial value - if currentOptionsSet[optionItemData.key] then + if currentOptionsSet[optionItemData.key] then sliderGroup._slider:SetValue(currentOptionsSet[optionItemData.key]) else sliderGroup._slider:SetValue(optionItemData.default) @@ -208,34 +210,61 @@ local controlTypeCreate = { end, } - local function CreateOption(parent, optionItemData) - local bg = Bitmap(parent, UIUtil.SkinnableFile('/dialogs/options-02/content-box_bmp.dds')) + local bg = Group(parent) + if not bg.SetSolidColor then + bg.SetSolidColor = function(self, color) + end + end - bg._label = UIUtil.CreateText(bg, optionItemData.title, 16, UIUtil.bodyFont) - LayoutHelpers.AtLeftTopIn(bg._label, bg, 9, 6) - bg._label._tipText = optionItemData.key + LayoutHelpers.SetDimensions(bg, OptionRowWidth, OptionRowHeight) - bg._label.HandleEvent = function(self, event) - if bg._label._tipText then - if event.Type == 'MouseEnter' then - Tooltip.CreateMouseoverDisplay(self, "options_" .. bg._label._tipText, .5, true) - elseif event.Type == 'MouseExit' then - Tooltip.DestroyMouseoverDisplay() - end + if optionItemData.type ~= 'header' then + -- hover highlight background + bg._bg = UIUtil.CreateBitmapColor(bg, '00000000') + LayoutHelpers.AtLeftTopIn(bg._bg, bg, 4, 0) + LayoutHelpers.SetDimensions(bg._bg, OptionRowWidth - 8, OptionRowHeight) + bg._bg:DisableHitTest() + + -- bottom separator line + bg._bottomSep = UIUtil.CreateBitmapColor(bg, '18FFFFFF') + LayoutHelpers.AtLeftBottomIn(bg._bottomSep, bg, 4, 0) + LayoutHelpers.SetDimensions(bg._bottomSep, OptionRowWidth - 8, 1) + bg._bottomSep:DisableHitTest() + end + + local labelFont = UIUtil.bodyFont + local labelSize = 16 + if optionItemData.type == 'header' then + labelFont = UIUtil.titleFont + labelSize = 18 + end + + bg._label = UIUtil.CreateText(bg, optionItemData.title, labelSize, labelFont) + + if optionItemData.type == 'header' then + LayoutHelpers.AtTopIn(bg._label, bg, 3) + LayoutHelpers.AtHorizontalCenterIn(bg._label, bg) + bg._label:SetColor('FFE4E4E4') + else + LayoutHelpers.AtLeftTopIn(bg._label, bg, 14, 7) + if optionItemData.tip then + bg._tipText = {text = LOC(optionItemData.title), body = LOC(optionItemData.tip)} + else + bg._tipText = optionItemData.key end end local controlGroup = Group(bg) - LayoutHelpers.AtLeftTopIn(controlGroup, bg, 338, 5) - LayoutHelpers.SetDimensions(controlGroup, 252, 24) + LayoutHelpers.AtLeftTopIn(controlGroup, bg, 442, 5) + LayoutHelpers.SetDimensions(controlGroup, 248, 24) if controlTypeCreate[optionItemData.type] then bg._control = controlTypeCreate[optionItemData.type](controlGroup, optionItemData) else LOG("Warning: Option item data [" .. optionItemData.key .. "] contains an unknown control type: " .. optionItemData.type .. ". Valid types are") - for k,v in controlTypeCreate do + for k, v in controlTypeCreate do LOG(k) end end @@ -244,14 +273,10 @@ local function CreateOption(parent, optionItemData) LayoutHelpers.AtCenterIn(bg._control, controlGroup) end - if not (optionItemData.type == 'header') then + if not (optionItemData.type == 'header') then optionKeyToControlMap[optionItemData.key] = bg._control end - if optionItemData.type == 'header' then - bg:SetAlpha(0.0) - end - return bg end @@ -260,12 +285,14 @@ local dialog = nil function CreateDialog(over, exitBehavior) currentOptionsSet = OptionsLogic.GetCurrent() + local options = import("/lua/options/options.lua").options + local optionsOrder = import("/lua/options/options.lua").optionsOrder + local parent = nil -- lots of state local function KillDialog() currentTabButton = false - currentTabBitmap = false OptionsLogic.SetCustomDataChangedCallback(nil) OptionsLogic.SetSummonRestartDialogCallback(nil) @@ -277,84 +304,89 @@ function CreateDialog(over, exitBehavior) else parent:Destroy() end + dialog = nil end if over then parent = over else parent = UIUtil.CreateScreenGroup(GetFrame(0), "Options ScreenGroup") - local background = MenuCommon.SetupBackground(GetFrame(0)) + MenuCommon.SetupBackground(GetFrame(0)) end - dialog = Bitmap(parent, UIUtil.UIFile('/scx_menu/options/panel_bmp.dds')) + dialog = Group(parent) + LayoutHelpers.SetDimensions(dialog, 1080, 820) LayoutHelpers.AtCenterIn(dialog, parent) - dialog.brackets = UIUtil.CreateDialogBrackets(dialog, 41, 24, 41, 24) + local contentParent = Group(dialog) + LayoutHelpers.SetDimensions(contentParent, 1000, 760) + LayoutHelpers.AtCenterIn(contentParent, dialog) - local title = UIUtil.CreateText(dialog, "", 24, UIUtil.titleFont) - LayoutHelpers.AtTopIn(title, dialog, 30) - LayoutHelpers.AtHorizontalCenterIn(title, dialog) + local title = UIUtil.CreateText(contentParent, "", 26, UIUtil.titleFont) + LayoutHelpers.AtTopIn(title, contentParent, 18) + LayoutHelpers.AtHorizontalCenterIn(title, contentParent) - if over then - dialog.Depth:Set(GetFrame(over:GetRootFrame():GetTargetHead()):GetTopmostDepth() + 1) - end + local contentBgLeft = 90 + local contentBgTop = 8 + local contentBgWidth = 820 + local contentBgHeight = 744 + + local contentBackground = UIUtil.CreateBitmapColor(contentParent, 'E6060B12') + LayoutHelpers.AtLeftTopIn(contentBackground, contentParent, contentBgLeft, contentBgTop) + LayoutHelpers.SetDimensions(contentBackground, contentBgWidth, contentBgHeight) + contentBackground:DisableHitTest() + + local borderBackground = UIUtil.CreateNinePatchStd(contentParent, '/scx_menu/lan-game-lobby/dialog/background/') + LayoutHelpers.FillParentFixedBorder(borderBackground, contentBackground, 64) + LayoutHelpers.DepthUnderParent(borderBackground, contentBackground) + + title.Depth:Set(function() return contentBackground.Depth() + 10 end) - local function roHandler(self, event) - if event == 'enter' then - self.label:SetColor('ff000000') - elseif event == 'exit' then - self.label:SetColor(UIUtil.fontColor) + local searchEdit = Edit(contentParent) + LayoutHelpers.AtRightTopIn(searchEdit, contentParent, 110, 28) + LayoutHelpers.SetWidth(searchEdit, 180) + searchEdit.Height:Set(function() return searchEdit:GetFontHeight() end) + searchEdit:ShowBackground(true) + UIUtil.SetupEditStd(searchEdit, UIUtil.fontColor, '77778888', UIUtil.fontColor, UIUtil.highlightColor, UIUtil.bodyFont, 14, 30) + searchEdit:SetDropShadow(true) + searchEdit.Depth:Set(function() return contentBackground.Depth() + 10 end) + + local searchLabel = UIUtil.CreateText(contentParent, LOC("Search..."), 16, UIUtil.bodyFont) + LayoutHelpers.LeftOf(searchLabel, searchEdit, 10) + LayoutHelpers.AtVerticalCenterIn(searchLabel, searchEdit) + searchLabel.Depth:Set(function() return contentBackground.Depth() + 10 end) + + -- forward declaration so OnTextChanged captures the local page switcher + local SetNewPage + + searchEdit.OnTextChanged = function(self, new, old) + if currentTabButton then + SetNewPage(currentTabButton) end end + if over then + dialog.Depth:Set(GetFrame(over:GetRootFrame():GetTargetHead()):GetTopmostDepth() + 1) + end + -- layout buttons - local applyBtn = Button(dialog, - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_up.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_down.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_over.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_dis.dds'), - "UI_Opt_Yes_No", "UI_Opt_Affirm_Over") - LayoutHelpers.AtRightTopIn(applyBtn, dialog, 15, 515) - applyBtn.label = UIUtil.CreateText(applyBtn, LOC(""), 16) - LayoutHelpers.AtCenterIn(applyBtn.label, applyBtn) + local applyBtn = UIUtil.CreateButtonWithDropshadow(contentParent, '/BUTTON/medium/', LOC("")) + LayoutHelpers.SetWidth(applyBtn, 150) + LayoutHelpers.AtRightBottomIn(applyBtn, contentParent, 188, 24) Tooltip.AddButtonTooltip(applyBtn, 'options_tab_apply') - applyBtn.OnRolloverEvent = roHandler - - dialog.cancelBtn = Button(dialog, - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_up.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_down.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_over.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_dis.dds'), - "UI_Opt_Yes_No", "UI_Opt_Affirm_Over") - dialog.cancelBtn.label = UIUtil.CreateText(dialog.cancelBtn, LOC(""), 16) - LayoutHelpers.AtCenterIn(dialog.cancelBtn.label, dialog.cancelBtn) - LayoutHelpers.LeftOf(dialog.cancelBtn, applyBtn, -6) - dialog.cancelBtn.OnRolloverEvent = roHandler - - local okBtn = Button(dialog, - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_up.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_down.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_over.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_dis.dds'), - "UI_Opt_Yes_No", "UI_Opt_Affirm_Over") - okBtn.label = UIUtil.CreateText(okBtn, LOC(""), 16) - LayoutHelpers.AtCenterIn(okBtn.label, okBtn) - LayoutHelpers.LeftOf(okBtn, dialog.cancelBtn, -6) - okBtn.OnRolloverEvent = roHandler - - - local resetBtn = Button(dialog, - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_up.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_down.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_over.dds'), - UIUtil.UIFile('/scx_menu/small-short-btn/small-btn_dis.dds'), - "UI_Opt_Yes_No", "UI_Opt_Affirm_Over") - resetBtn.label = UIUtil.CreateText(resetBtn, LOC(""), 16) - LayoutHelpers.AtCenterIn(resetBtn.label, resetBtn) - LayoutHelpers.LeftOf(resetBtn, okBtn, -6) - Tooltip.AddButtonTooltip(resetBtn, 'options_reset_all') - resetBtn.OnRolloverEvent = roHandler + dialog.cancelBtn = UIUtil.CreateButtonWithDropshadow(contentParent, '/BUTTON/medium/', LOC("")) + LayoutHelpers.SetWidth(dialog.cancelBtn, 150) + LayoutHelpers.LeftOf(dialog.cancelBtn, applyBtn, 8) + + local okBtn = UIUtil.CreateButtonWithDropshadow(contentParent, '/BUTTON/medium/', LOC("")) + LayoutHelpers.SetWidth(okBtn, 150) + LayoutHelpers.LeftOf(okBtn, dialog.cancelBtn, 8) + + local resetBtn = UIUtil.CreateButtonWithDropshadow(contentParent, '/BUTTON/medium/', LOC("")) + LayoutHelpers.SetWidth(resetBtn, 150) + LayoutHelpers.LeftOf(resetBtn, okBtn, 8) + Tooltip.AddButtonTooltip(resetBtn, 'options_reset_all') -- set up button logic okBtn.OnClick = function(self, modifiers) @@ -364,10 +396,12 @@ function CreateDialog(over, exitBehavior) end dialog.cancelBtn.OnClick = function(self, modifiers) - if currentTabButton then - for index,option in currentTabButton.tabData.items do - if option.cancel then - option.cancel() + for _, key in optionsOrder do + if options[key] then + for _, option in options[key].items do + if option.cancel then + option.cancel() + end end end end @@ -399,68 +433,174 @@ function CreateDialog(over, exitBehavior) UIUtil.MakeInputModal(dialog, function() okBtn:OnClick() end, function() dialog.cancelBtn:OnClick() end) -- set up option grid - local elementWidth, elementHeight = GetTextureDimensions(UIUtil.UIFile('/dialogs/options-02/content-box_bmp.dds')) - local optionGrid = Grid(dialog, elementWidth, elementHeight) - LayoutHelpers.RelativeTo(optionGrid, dialog, UIUtil.SkinnableFile('/dialogs/options-02/options-02_layout.lua'), 'gameplay_bmp', 'panel_bmp') - LayoutHelpers.AtRightBottomIn(optionGrid, dialog, 43, 100) - LayoutHelpers.DimensionsRelativeTo(optionGrid, UIUtil.SkinnableFile('/dialogs/options-02/options-02_layout.lua'), 'gameplay_bmp') - local scrollbar = UIUtil.CreateVertScrollbarFor(optionGrid, -4) + local elementWidth, elementHeight = OptionRowWidth, OptionRowHeight + local optionGrid = Grid(contentParent, elementWidth, elementHeight) + LayoutHelpers.SetDimensions(optionGrid, elementWidth, 560) + LayoutHelpers.AtLeftTopIn(optionGrid, contentParent, 150, 122) + local scrollbar = UIUtil.CreateVertScrollbarFor(optionGrid, 15) + + applyBtn.Depth:Set(function() return optionGrid.Depth() + 20 end) + dialog.cancelBtn.Depth:Set(function() return optionGrid.Depth() + 20 end) + okBtn.Depth:Set(function() return optionGrid.Depth() + 20 end) + resetBtn.Depth:Set(function() return optionGrid.Depth() + 20 end) + + local tabWidth = 166 + local tabHeight = 34 + + local function CreateModernTab(parent, labelText) + local tab = Group(parent) + LayoutHelpers.SetDimensions(tab, tabWidth, tabHeight) + + tab.label = UIUtil.CreateText(tab, labelText, 18, UIUtil.titleFont) + tab.label:SetColor('FFBFC8D0') + LayoutHelpers.AtCenterIn(tab.label, tab) + tab.label:DisableHitTest() + + tab.underline = UIUtil.CreateBitmapColor(tab, '00000000') + LayoutHelpers.AtBottomIn(tab.underline, tab) + LayoutHelpers.AtHorizontalCenterIn(tab.underline, tab.label) + LayoutHelpers.SetDimensions(tab.underline, tabWidth - 20, 2) + tab.underline:DisableHitTest() + + tab.SetVisualState = function(self, state) + if state == 'selected' then + self.label:SetColor('FFF2F5F8') + self.underline:SetSolidColor('C8A6C6DA') + elseif state == 'hover' then + self.label:SetColor('FFE1E8EE') + self.underline:SetSolidColor('66A6C6DA') + else + self.label:SetColor('FFBFC8D0') + self.underline:SetSolidColor('00000000') + end + end + + tab.HandleEvent = function(self, event) + if event.Type == 'MouseEnter' then + if currentTabButton ~= self then + self:SetVisualState('hover') + end + elseif event.Type == 'MouseExit' then + if currentTabButton ~= self then + self:SetVisualState('normal') + end + elseif event.Type == 'ButtonPress' then + if self.OnClick then + self:OnClick() + end + return true + end + end + + return tab + end + + local tabButtons = {} -- set up a page - function SetNewPage(tabControl) - -- kill any other page - if currentTabBitmap then - currentTabBitmap:Destroy() - currentTabBitmap = false - currentTabButton:Show() - end - - -- store the tab data for this tab for easy access - local tabData = tabControl.tabData - - -- show the "selected" state of the tab, which hides the button and shows a bitmap - currentTabButton = tabControl - currentTabButton:Hide() - currentTabBitmap = Bitmap(dialog, UIUtil.SkinnableFile('/scx_menu/tab_btn/tab_btn_selected.dds')) - LayoutHelpers.AtCenterIn(currentTabBitmap, currentTabButton) - local tabLabel = UIUtil.CreateText(currentTabBitmap, tabData.title, 16, UIUtil.titleFont) - LayoutHelpers.AtCenterIn(tabLabel, currentTabBitmap) - - -- remove controls and populate grid + SetNewPage = function(tabControl) + + if currentTabButton and currentTabButton ~= tabControl and currentTabButton.SetVisualState then + currentTabButton:SetVisualState('normal') + end + + local searchString = searchEdit:GetText() + local isSearching = searchString and searchString ~= "" + + if currentTabButton ~= tabControl then + currentTabButton = tabControl + if currentTabButton.SetVisualState then + currentTabButton:SetVisualState('selected') + end + end + + Tooltip.DestroyMouseoverDisplay() optionGrid:DeleteAndDestroyAll(true) optionGrid:AppendCols(1, true) - - -- initialzie key to control map each time page is changed, as controls get destroyed optionKeyToControlMap = {} - for index, option in tabData.items do - optionGrid:AppendRows(1, true) - local optCtrl = CreateOption(optionGrid, option) - - optCtrl.HandleEvent = function(self, event) - if scrollbar and event.Type == 'WheelRotation' then - local scrollDim = { optionGrid:GetScrollValues('Vert') } - if event.WheelRotation <= 0 then -- scroll down ... - if scrollDim[2] != scrollDim[4] then -- ... if we can - PlaySound(Sound({ Cue = 'UI_Tab_Rollover_01', Bank = 'Interface' })) - scrollbar:DoScrollLines(1) + for _, btn in tabButtons do + if isSearching then + btn:Hide() + else + btn:Show() + end + end + + local row = 1 + local function AddOptionsFromTabData(tData) + for index, option in tData.items do + if isSearching then + local titleStr = LOC(option.title) + -- Note: string.lower does not fully handle Unicode case matching + if not string.find(string.lower(titleStr), string.lower(searchString), 1, true) then + continue + end + end + + -- add an empty row before headers for visual spacing (except the very first row) + if option.type == 'header' and row > 1 then + optionGrid:AppendRows(1, true) + row = row + 1 + end + + optionGrid:AppendRows(1, true) + local optCtrl = CreateOption(optionGrid, option) + + optCtrl.HandleEvent = function(self, event) + if event.Type == 'MouseEnter' then + if self._bg then self._bg:SetSolidColor('1AA6C6DA') end + if self._tipText and (type(self._tipText) == 'table' or self._tipText ~= "") then + if type(self._tipText) == 'table' then + Tooltip.CreateMouseoverDisplay(self, self._tipText, nil, true, nil, nil, nil, nil, nil, 'left') + else + Tooltip.CreateMouseoverDisplay(self, "options_" .. self._tipText, nil, true, nil, nil, nil, nil, nil, 'left') + end end - else -- scroll up ... - if scrollDim[1] != scrollDim[3] then -- ... if we can - PlaySound(Sound({ Cue = 'UI_Tab_Rollover_01', Bank = 'Interface' })) - scrollbar:DoScrollLines(-1) + elseif event.Type == 'MouseExit' then + if self._bg then self._bg:SetSolidColor('00000000') end + Tooltip.DestroyMouseoverDisplay() + elseif event.Type == 'WheelRotation' then + local scrollDim = { optionGrid:GetScrollValues('Vert') } + if event.WheelRotation <= 0 then + if scrollDim[2] ~= scrollDim[4] then + PlaySound(Sound({ Cue = 'UI_Tab_Rollover_01', Bank = 'Interface' })) + scrollbar:DoScrollLines(1) + end + else + if scrollDim[1] ~= scrollDim[3] then + PlaySound(Sound({ Cue = 'UI_Tab_Rollover_01', Bank = 'Interface' })) + scrollbar:DoScrollLines(-1) + end end end end + + optionGrid:SetItem(optCtrl, 1, row, true) + if option.init then + option.init() + end + row = row + 1 end - - optionGrid:SetItem(optCtrl, 1, index, true) - if option.init then - option.init() + end + + if isSearching then + for _, key in optionsOrder do + if options[key] then + AddOptionsFromTabData(options[key]) + end end + else + AddOptionsFromTabData(tabControl.tabData) end optionGrid:EndBatch() + + if optionGrid:IsScrollable("Vert") then + scrollbar:Show() + else + scrollbar:Hide() + end end -- tab layout @@ -468,20 +608,21 @@ function CreateDialog(over, exitBehavior) local defaultTab = false -- get the tab data - local options = import("/lua/options/options.lua").options - local optionsOrder = import("/lua/options/options.lua").optionsOrder + for _, key in optionsOrder do + if not options[key] then + continue + end - for index, key in optionsOrder do - tabData = options[key] - local curButton = UIUtil.CreateButtonStd(dialog, '/scx_menu/tab_btn/tab', tabData.title, 16, 0, 0, "UI_Tab_Click_01", "UI_Tab_Rollover_01") - curButton.label:SetDropShadow(true) + local tabData = options[key] + local curButton = CreateModernTab(contentParent, tabData.title) if prev then - LayoutHelpers.RightOf(curButton, prev, -10) + LayoutHelpers.RightOf(curButton, prev, 12) else - LayoutHelpers.AtLeftTopIn(curButton, dialog, 10, 64) + LayoutHelpers.AtLeftTopIn(curButton, contentParent, 150, 72) defaultTab = curButton end prev = curButton + table.insert(tabButtons, curButton) curButton.OnClick = function(self, modifiers) SetNewPage(self) @@ -492,10 +633,6 @@ function CreateDialog(over, exitBehavior) SetNewPage(defaultTab) - if not optionGrid:IsScrollable("Vert") then - scrollbar:Hide() - end - OptionsLogic.SetCustomDataChangedCallback(function(optionKey, newCustomData, newDefault) if optionKeyToControlMap and optionKeyToControlMap[optionKey] then optionKeyToControlMap[optionKey].SetCustomData(newCustomData, newDefault) @@ -503,12 +640,12 @@ function CreateDialog(over, exitBehavior) end) local function OptionRestartFunc(proceedFunc, cancelFunc) - UIUtil.QuickDialog(GetFrame(0) , "You have modified an option which requires you to restart Forged Alliance. Selecting OK will exit the game, selecting Cancel will revert the option to its prior setting." - , "", proceedFunc - ,"", cancelFunc - , nil, nil - , true - , {escapeButton = 2, enterButton = 1, worldCover = false} + UIUtil.QuickDialog(GetFrame(0), "You have modified an option which requires you to restart Forged Alliance. Selecting OK will exit the game, selecting Cancel will revert the option to its prior setting.", + "", proceedFunc, + "", cancelFunc, + nil, nil, + true, + {escapeButton = 2, enterButton = 1, worldCover = false} ) end OptionsLogic.SetSummonRestartDialogCallback(OptionRestartFunc) @@ -517,12 +654,12 @@ function CreateDialog(over, exitBehavior) local secondsToWait = 15 local thread - local dlg = UIUtil.QuickDialog(GetFrame(0), "Click OK to accept these settings." - , LOC("") .. " [" .. secondsToWait .. "]", function() KillThread(thread) end - , "", function() KillThread(thread) undoFunc() end - , nil, nil - , true - , {escapeButton = 2, enterButton = 1, worldCover = false} + local dlg = UIUtil.QuickDialog(GetFrame(0), "Click OK to accept these settings.", + LOC("") .. " [" .. secondsToWait .. "]", function() KillThread(thread) end, + "", function() KillThread(thread) undoFunc() end, + nil, nil, + true, + {escapeButton = 2, enterButton = 1, worldCover = false} ) thread = ForkThread(function() @@ -544,4 +681,4 @@ function OnNISBegin() end -- kept for mod backwards compatibility -local Text = import("/lua/maui/text.lua").Text \ No newline at end of file +local Text = import("/lua/maui/text.lua").Text