From 27f4a9031d8ae4bc892f76d5479743cfa3d3fe3c Mon Sep 17 00:00:00 2001 From: Pete Goodfellow Date: Sun, 26 Feb 2023 19:11:45 +0000 Subject: [PATCH 1/4] Make containers respect searchbar focus options. --- .../MWSE/mods/UI Expansion/MenuContents.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua index bf7aed8..9deef27 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua @@ -112,7 +112,9 @@ local function onMenuContentsActivated(e) contentsFilters:createElements(filterBlock) -- Focus the filter search bar. - contentsFilters:focusSearchBar() + if (common.config.autoSelectInput == "Inventory") then + contentsFilters:focusSearchBar() + end -- Create capacity fillbar for containers. local container = contentsMenu:getPropertyObject("MenuContents_ObjectContainer") --- @type tes3actor From 406266c0201d4043006abaa02cab10acb412e21e Mon Sep 17 00:00:00 2001 From: Pete Goodfellow Date: Sat, 11 Jan 2025 15:13:34 +0000 Subject: [PATCH 2/4] Fix search focusing in a better way. --- .../MWSE/mods/UI Expansion/MenuContents.lua | 4 +--- User Interface Expansion/MWSE/mods/UI Expansion/common.lua | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua index 9deef27..bf7aed8 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua @@ -112,9 +112,7 @@ local function onMenuContentsActivated(e) contentsFilters:createElements(filterBlock) -- Focus the filter search bar. - if (common.config.autoSelectInput == "Inventory") then - contentsFilters:focusSearchBar() - end + contentsFilters:focusSearchBar() -- Create capacity fillbar for containers. local container = contentsMenu:getPropertyObject("MenuContents_ObjectContainer") --- @type tes3actor diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/common.lua b/User Interface Expansion/MWSE/mods/UI Expansion/common.lua index 654c2b4..61ce9cc 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/common.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/common.lua @@ -583,7 +583,7 @@ end --- Forces focus onto the search box. function uiExFilterFunction:focusSearchBar() - if (self.searchBlock) then + if (common.config.useSearch and self.searchBlock) then tes3ui.acquireTextInput(self.searchBlock.input) end end From fa43c09574975448985f97d60f756ac82a3732b7 Mon Sep 17 00:00:00 2001 From: Pete Goodfellow Date: Wed, 22 Jan 2025 02:05:55 +0000 Subject: [PATCH 3/4] Add option to disallow focusing contents/barter search fields when search bars are active. --- .../MWSE/mods/UI Expansion/MenuBarter.lua | 4 +++- .../MWSE/mods/UI Expansion/MenuContents.lua | 4 +++- User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua | 3 ++- User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua index f356c75..281cbbb 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua @@ -50,6 +50,8 @@ local function onMenuBarterActivated(e) end) -- Focus the filter search bar. - barterFilters:focusSearchBar() + if (common.config.autoSelectInput ~= "None") then + barterFilters:focusSearchBar() + end end event.register("uiActivated", onMenuBarterActivated, { filter = "MenuBarter" }) diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua index 5944478..bf122a7 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua @@ -112,7 +112,9 @@ local function onMenuContentsActivated(e) contentsFilters:createElements(filterBlock) -- Focus the filter search bar. - contentsFilters:focusSearchBar() + if (common.config.autoSelectInput ~= "None") then + contentsFilters:focusSearchBar() + end -- Create capacity fillbar for containers. local container = contentsMenu:getPropertyObject("MenuContents_ObjectContainer") --- @type tes3actor diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua b/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua index 5329e81..633df69 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua @@ -40,10 +40,11 @@ return { ["mcm.alwaysClearFiltersOnOpen.label"] = "Always reset filters when opening menu?", ["mcm.autoFilterToTradable.description"] = "When starting a barter with a merchant, automatically filter the player's inventory to items that that merchant is willing to buy or sell.", ["mcm.autoFilterToTradable.label"] = "Filter to tradable items when opening barter window?", - ["mcm.autoSelectSearch.description"] = "When entering menu mode, automatically select the search input for the given menu. This allows for quick searching without having to click on the search box.", + ["mcm.autoSelectSearch.description"] = "When entering menu mode, automatically select the search input for the given menu. This allows for quick searching without having to click on the search box. Choosing Inventory or Magic will also focus contents and barter windows.", ["mcm.autoSelectSearch.label"] = "Auto-select search bar:", ["mcm.autoSelectSearch.option.inventory"] = "Inventory", ["mcm.autoSelectSearch.option.magic"] = "Magic", + ["mcm.autoSelectSearch.option.onlyContentsBarter"] = "Only Contents & Barter", ["mcm.autoSelectSearch.option.none"] = "None", ["mcm.autoSelectSpells.description"] = "When searching using the spells menu, the first result will be equipped by the player. This allows quick selection of spells by typing the first few letters of the spell's name.", ["mcm.autoSelectSpells.label"] = "Auto-select first result when searching spell list?", diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua b/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua index ed584f3..5694035 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua @@ -101,6 +101,7 @@ local function registerModConfig() options = { { label = common.i18n("mcm.autoSelectSearch.option.inventory"), value = "Inventory" }, { label = common.i18n("mcm.autoSelectSearch.option.magic"), value = "Magic" }, + { label = common.i18n("mcm.autoSelectSearch.option.onlyContentsBarter"), value = "ContentsBarter" }, { label = common.i18n("mcm.autoSelectSearch.option.none"), value = "None" }, }, variable = mwse.mcm.createTableVariable({ id = "autoSelectInput", table = common.config }), From 12217c51c3f487befe1a0e5e3a6d98ac8caeda52 Mon Sep 17 00:00:00 2001 From: Pete Goodfellow Date: Thu, 23 Jan 2025 04:50:17 +0000 Subject: [PATCH 4/4] Use separate option for contents/barter search focus. Allows people to use inventory options (eg magic menu focus) without sacrificing MCP hotkeys for looting. --- .../MWSE/mods/UI Expansion/MenuBarter.lua | 2 +- .../MWSE/mods/UI Expansion/MenuContents.lua | 2 +- .../MWSE/mods/UI Expansion/i18n/eng.lua | 5 +++-- User Interface Expansion/MWSE/mods/UI Expansion/main.lua | 1 + User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua | 8 +++++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua index 281cbbb..7a44634 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuBarter.lua @@ -50,7 +50,7 @@ local function onMenuBarterActivated(e) end) -- Focus the filter search bar. - if (common.config.autoSelectInput ~= "None") then + if (common.config.autoSelectInputAdditional) then barterFilters:focusSearchBar() end end diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua index bf122a7..95a9516 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/MenuContents.lua @@ -112,7 +112,7 @@ local function onMenuContentsActivated(e) contentsFilters:createElements(filterBlock) -- Focus the filter search bar. - if (common.config.autoSelectInput ~= "None") then + if (common.config.autoSelectInputAdditional) then contentsFilters:focusSearchBar() end diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua b/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua index 633df69..bad9375 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua @@ -40,12 +40,13 @@ return { ["mcm.alwaysClearFiltersOnOpen.label"] = "Always reset filters when opening menu?", ["mcm.autoFilterToTradable.description"] = "When starting a barter with a merchant, automatically filter the player's inventory to items that that merchant is willing to buy or sell.", ["mcm.autoFilterToTradable.label"] = "Filter to tradable items when opening barter window?", - ["mcm.autoSelectSearch.description"] = "When entering menu mode, automatically select the search input for the given menu. This allows for quick searching without having to click on the search box. Choosing Inventory or Magic will also focus contents and barter windows.", + ["mcm.autoSelectSearch.description"] = "When entering menu mode, automatically select the search input for the given menu. This allows for quick searching without having to click on the search box.", ["mcm.autoSelectSearch.label"] = "Auto-select search bar:", ["mcm.autoSelectSearch.option.inventory"] = "Inventory", ["mcm.autoSelectSearch.option.magic"] = "Magic", - ["mcm.autoSelectSearch.option.onlyContentsBarter"] = "Only Contents & Barter", ["mcm.autoSelectSearch.option.none"] = "None", + ["mcm.autoSelectSearchAdditional.label"] = "Auto-select search bar in contents & barter menus?", + ["mcm.autoSelectSearchAdditional.description"] = "This option is independent of the above. When enabled, opening containers and bartering will have their searchbar selected automatically.", ["mcm.autoSelectSpells.description"] = "When searching using the spells menu, the first result will be equipped by the player. This allows quick selection of spells by typing the first few letters of the spell's name.", ["mcm.autoSelectSpells.label"] = "Auto-select first result when searching spell list?", ["mcm.category.console"] = "Console", diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/main.lua b/User Interface Expansion/MWSE/mods/UI Expansion/main.lua index 0bc452a..a115e49 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/main.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/main.lua @@ -7,6 +7,7 @@ local defaultConfig = { version = common.version, showHelpText = true, autoSelectInput = "Magic", + autoSelectInputAdditional = true, alwaysClearFiltersOnOpen = true, useSearch = true, useSearchEffects = true, diff --git a/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua b/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua index 5694035..0dc5301 100644 --- a/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua +++ b/User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua @@ -101,12 +101,18 @@ local function registerModConfig() options = { { label = common.i18n("mcm.autoSelectSearch.option.inventory"), value = "Inventory" }, { label = common.i18n("mcm.autoSelectSearch.option.magic"), value = "Magic" }, - { label = common.i18n("mcm.autoSelectSearch.option.onlyContentsBarter"), value = "ContentsBarter" }, { label = common.i18n("mcm.autoSelectSearch.option.none"), value = "None" }, }, variable = mwse.mcm.createTableVariable({ id = "autoSelectInput", table = common.config }), }) + -- Auto-selection for contents/barter + category:createOnOffButton({ + label = common.i18n("mcm.autoSelectSearchAdditional.label"), + description = common.i18n("mcm.autoSelectSearchAdditional.description"), + variable = mwse.mcm.createTableVariable({ id = "autoSelectInputAdditional", table = common.config }), + }) + -- Auto-equip spells category:createOnOffButton({ label = common.i18n("mcm.autoSelectSpells.label"),