diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index af0af63..4edc919 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -262,13 +262,15 @@ function create(currentOutfit, outfitList, mountList, wingList, auraList, shader updateAppearanceTexts(currentOutfit) - local isMount = g_game.getLocalPlayer():isMounted() - if isMount then - window.configure.mount.check:setEnabled(true) - window.configure.mount.check:setChecked(true) - else - window.configure.mount.check:setEnabled(currentOutfit.mount > 0) - window.configure.mount.check:setChecked(isMount and currentOutfit.mount > 0) + if g_game.getFeature(GamePlayerMounts) then + local isMount = g_game.getLocalPlayer():isMounted() + if isMount then + window.configure.mount.check:setEnabled(true) + window.configure.mount.check:setChecked(true) + else + window.configure.mount.check:setEnabled(currentOutfit.mount > 0) + window.configure.mount.check:setChecked(isMount and currentOutfit.mount > 0) + end end if currentOutfit.addons == 3 then @@ -372,6 +374,8 @@ function create(currentOutfit, outfitList, mountList, wingList, auraList, shader window.appearance.settings.manaBar:setVisible(g_game.getFeature(GameHealthInfoBackground)) window.configure.mount:setVisible(g_game.getFeature(GamePlayerMounts)) + + window.listSearch.search.onKeyPress = onFilterSearch end function destroy() @@ -917,7 +921,9 @@ function onPresetSelect(list, focusedChild, unfocusedChild, reason) end end - window.configure.mount.check:setChecked(preset.mounted and tempOutfit.mount > 0) + if g_game.getFeature(GamePlayerMounts) then + window.configure.mount.check:setChecked(preset.mounted and tempOutfit.mount > 0) + end settings.currentPreset = presetId @@ -1144,7 +1150,7 @@ function updatePreview() previewOutfit.manaBar = 0 window.preview.panel.bars:hide() else - if settings.showMount and previewOutfit.mount > 0 then + if g_game.getFeature(GamePlayerMounts) and settings.showMount and previewOutfit.mount > 0 then window.preview.panel.bars:setMarginTop(45) window.preview.panel.bars:setMarginLeft(25) else @@ -1224,6 +1230,29 @@ function rotate(value) floor:setMargin(0) end +function onFilterSearch() + addEvent( + function() + local searchText = window.listSearch.search:getText():lower():trim() + local children = window.selectionList:getChildren() + if searchText:len() >= 1 then + for _, child in ipairs(children) do + local text = child.name:getText():lower() + if text:find(searchText) then + child:show() + else + child:hide() + end + end + else + for _, child in ipairs(children) do + child:show() + end + end + end + ) +end + function saveSettings() if not g_resources.fileExists(settingsFile) then g_resources.makeDir("/settings") diff --git a/otclient_dx.exe b/otclient_dx.exe index 3f01dbb..2431793 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index e6ba75d..aa1c435 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclient_linux b/otclient_linux index 775613f..e6b6387 100644 Binary files a/otclient_linux and b/otclient_linux differ diff --git a/otclient_mac b/otclient_mac index fde0a3a..5ed5b9d 100644 Binary files a/otclient_mac and b/otclient_mac differ diff --git a/otclientv8.apk b/otclientv8.apk index bf77856..e341c8e 100644 Binary files a/otclientv8.apk and b/otclientv8.apk differ