Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIEXP: Make containers respect searchbar focus options. #59

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ local function onMenuBarterActivated(e)
end)

-- Focus the filter search bar.
barterFilters:focusSearchBar()
if (common.config.autoSelectInputAdditional) then
barterFilters:focusSearchBar()
end
end
event.register("uiActivated", onMenuBarterActivated, { filter = "MenuBarter" })
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ local function onMenuContentsActivated(e)
contentsFilters:createElements(filterBlock)

-- Focus the filter search bar.
contentsFilters:focusSearchBar()
if (common.config.autoSelectInputAdditional) then
contentsFilters:focusSearchBar()
end

-- Create capacity fillbar for containers.
local container = contentsMenu:getPropertyObject("MenuContents_ObjectContainer") --- @type tes3actor
Expand Down
2 changes: 1 addition & 1 deletion User Interface Expansion/MWSE/mods/UI Expansion/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions User Interface Expansion/MWSE/mods/UI Expansion/i18n/eng.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ return {
["mcm.autoSelectSearch.option.inventory"] = "Inventory",
["mcm.autoSelectSearch.option.magic"] = "Magic",
["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",
Expand Down
1 change: 1 addition & 0 deletions User Interface Expansion/MWSE/mods/UI Expansion/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local defaultConfig = {
version = common.version,
showHelpText = true,
autoSelectInput = "Magic",
autoSelectInputAdditional = true,
alwaysClearFiltersOnOpen = true,
useSearch = true,
useSearchEffects = true,
Expand Down
7 changes: 7 additions & 0 deletions User Interface Expansion/MWSE/mods/UI Expansion/mcm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ local function registerModConfig()
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"),
Expand Down