Updated to OTCv8 3.1 rev 200

This commit is contained in:
OTCv8 2022-05-11 15:57:17 +00:00
parent 56ede4a075
commit 66a260a3a3
6 changed files with 38 additions and 9 deletions

View File

@ -262,6 +262,7 @@ function create(currentOutfit, outfitList, mountList, wingList, auraList, shader
updateAppearanceTexts(currentOutfit) updateAppearanceTexts(currentOutfit)
if g_game.getFeature(GamePlayerMounts) then
local isMount = g_game.getLocalPlayer():isMounted() local isMount = g_game.getLocalPlayer():isMounted()
if isMount then if isMount then
window.configure.mount.check:setEnabled(true) window.configure.mount.check:setEnabled(true)
@ -270,6 +271,7 @@ function create(currentOutfit, outfitList, mountList, wingList, auraList, shader
window.configure.mount.check:setEnabled(currentOutfit.mount > 0) window.configure.mount.check:setEnabled(currentOutfit.mount > 0)
window.configure.mount.check:setChecked(isMount and currentOutfit.mount > 0) window.configure.mount.check:setChecked(isMount and currentOutfit.mount > 0)
end end
end
if currentOutfit.addons == 3 then if currentOutfit.addons == 3 then
window.configure.addon1.check:setChecked(true) window.configure.addon1.check:setChecked(true)
@ -372,6 +374,8 @@ function create(currentOutfit, outfitList, mountList, wingList, auraList, shader
window.appearance.settings.manaBar:setVisible(g_game.getFeature(GameHealthInfoBackground)) window.appearance.settings.manaBar:setVisible(g_game.getFeature(GameHealthInfoBackground))
window.configure.mount:setVisible(g_game.getFeature(GamePlayerMounts)) window.configure.mount:setVisible(g_game.getFeature(GamePlayerMounts))
window.listSearch.search.onKeyPress = onFilterSearch
end end
function destroy() function destroy()
@ -917,7 +921,9 @@ function onPresetSelect(list, focusedChild, unfocusedChild, reason)
end end
end end
if g_game.getFeature(GamePlayerMounts) then
window.configure.mount.check:setChecked(preset.mounted and tempOutfit.mount > 0) window.configure.mount.check:setChecked(preset.mounted and tempOutfit.mount > 0)
end
settings.currentPreset = presetId settings.currentPreset = presetId
@ -1144,7 +1150,7 @@ function updatePreview()
previewOutfit.manaBar = 0 previewOutfit.manaBar = 0
window.preview.panel.bars:hide() window.preview.panel.bars:hide()
else 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:setMarginTop(45)
window.preview.panel.bars:setMarginLeft(25) window.preview.panel.bars:setMarginLeft(25)
else else
@ -1224,6 +1230,29 @@ function rotate(value)
floor:setMargin(0) floor:setMargin(0)
end 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() function saveSettings()
if not g_resources.fileExists(settingsFile) then if not g_resources.fileExists(settingsFile) then
g_resources.makeDir("/settings") g_resources.makeDir("/settings")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.