mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 2.5.4 - http://otclient.net/showthread.php?tid=329
This commit is contained in:
@@ -53,9 +53,12 @@ end
|
||||
|
||||
function setupSelector(widget, id, outfit, list)
|
||||
widget:setId(id)
|
||||
widget.title:setText(id:gsub("^%l", string.upper))
|
||||
table.insert(list, 1, {0, "-"})
|
||||
|
||||
local pos = 1
|
||||
for i, o in pairs(list) do
|
||||
if outfit[id] == o[1] then
|
||||
if (id == "shader" and outfit[id] == o[2]) or outfit[id] == o[1] then
|
||||
pos = i
|
||||
end
|
||||
end
|
||||
@@ -63,7 +66,7 @@ function setupSelector(widget, id, outfit, list)
|
||||
widget.outfit = list[pos]
|
||||
if id == "shader" then
|
||||
widget.creature:setOutfit({
|
||||
shader = list[pos][1]
|
||||
shader = list[pos][2]
|
||||
})
|
||||
else
|
||||
widget.creature:setOutfit({
|
||||
@@ -80,7 +83,7 @@ function setupSelector(widget, id, outfit, list)
|
||||
end
|
||||
local outfit = widget.creature:getOutfit()
|
||||
if id == "shader" then
|
||||
outfit.shader = list[pos][1]
|
||||
outfit.shader = list[pos][2]
|
||||
else
|
||||
outfit.type = list[pos][1]
|
||||
end
|
||||
@@ -97,7 +100,7 @@ function setupSelector(widget, id, outfit, list)
|
||||
end
|
||||
local outfit = widget.creature:getOutfit()
|
||||
if id == "shader" then
|
||||
outfit.shader = list[pos][1]
|
||||
outfit.shader = list[pos][2]
|
||||
else
|
||||
outfit.type = list[pos][1]
|
||||
end
|
||||
@@ -312,6 +315,15 @@ function updateOutfit()
|
||||
outfit.addons = 0
|
||||
outfitWindow.type.creature:setOutfit(outfit)
|
||||
|
||||
local shader = outfitWindow.extensions:getChildById("shader")
|
||||
if shader then
|
||||
outfit.shader = shader.creature:getOutfit().shader
|
||||
if outfit.shader == "-" then
|
||||
outfit.shader = ""
|
||||
end
|
||||
shader.creature:setOutfit(outfit)
|
||||
end
|
||||
|
||||
if availableAddons > 0 then
|
||||
for _, i in pairs(ADDON_SETS[availableAddons]) do
|
||||
addons[i].widget:setEnabled(true)
|
||||
|
@@ -5,11 +5,18 @@ PrevMountButton < PreviousButton
|
||||
|
||||
OutfitSelectorPanel < Panel
|
||||
size: 125 120
|
||||
|
||||
Label
|
||||
id: title
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
text-align: center
|
||||
|
||||
UICreature
|
||||
id: creature
|
||||
size: 96 96
|
||||
anchors.top: parent.top
|
||||
size: 100 80
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
margin-top: 1
|
||||
|
||||
@@ -39,7 +46,7 @@ OutfitSelectorPanel < Panel
|
||||
|
||||
MainWindow
|
||||
!text: tr('Select Outfit')
|
||||
size: 540 335
|
||||
size: 540 330
|
||||
|
||||
@onEnter: modules.game_outfit.accept()
|
||||
@onEscape: modules.game_outfit.destroy()
|
||||
|
Reference in New Issue
Block a user