mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
More on Market (far from done), Minor Fixes, Edited Outfits Module, Some Cosmetics.
* Started building the market UI. * More work on the market functionality. * Fixes to the market protocol. (Known issue: if I use safeSend method from Market (like so: MarketProtocol.send~) is thinks it is a bot). * Fixes to the market offer class. * Outfit window will no longer display the mount box if you are using protocol < 870. * Added getFeature to playermount module. * Added isMarketable and getMarketData to the lua binding. * Added lua casts for MarketData. * Fixed typo in the module manager. * Added new 'light flat panel' for more variation (can change later) will require some graphics for market. * Added new functions to table lib. * Fixed some styling issues from previous commits.
This commit is contained in:
@@ -150,14 +150,35 @@ function Outfit.create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||
mountCreature = creatureMount
|
||||
outfits = outfitList
|
||||
mounts = mountList
|
||||
Outfit.destroy()
|
||||
Outfit.destroy()
|
||||
|
||||
outfitWindow = g_ui.displayUI('outfitwindow.otui')
|
||||
outfit = outfitCreature:getOutfit()
|
||||
if mountCreature then
|
||||
local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel')
|
||||
|
||||
-- setup outfit/mount display boxs
|
||||
local outfitCreatureBox = outfitWindow:getChildById('outfitCreatureBox')
|
||||
if outfitCreature then
|
||||
outfit = outfitCreature:getOutfit()
|
||||
outfitCreatureBox:setCreature(outfitCreature)
|
||||
else
|
||||
outfitCreatureBox:hide()
|
||||
outfitWindow:getChildById('outfitName'):hide()
|
||||
outfitWindow:getChildById('outfitNextButton'):hide()
|
||||
outfitWindow:getChildById('outfitPrevButton'):hide()
|
||||
end
|
||||
|
||||
local mountCreatureBox = outfitWindow:getChildById('mountCreatureBox')
|
||||
if mountCreature then
|
||||
mount = mountCreature:getOutfit()
|
||||
mountCreatureBox:setCreature(mountCreature)
|
||||
else
|
||||
mountCreatureBox:hide()
|
||||
outfitWindow:getChildById('mountName'):hide()
|
||||
outfitWindow:getChildById('mountNextButton'):hide()
|
||||
outfitWindow:getChildById('mountPrevButton'):hide()
|
||||
end
|
||||
|
||||
-- set addons
|
||||
addons = {
|
||||
[1] = {widget = outfitWindow:getChildById('addon1'), value = 1},
|
||||
[2] = {widget = outfitWindow:getChildById('addon2'), value = 2},
|
||||
@@ -174,21 +195,14 @@ function Outfit.create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||
end
|
||||
end
|
||||
|
||||
-- hook outfit sections
|
||||
currentClotheButtonBox = outfitWindow:getChildById('head')
|
||||
outfitWindow:getChildById('head').onCheckChange = onClotheCheckChange
|
||||
outfitWindow:getChildById('primary').onCheckChange = onClotheCheckChange
|
||||
outfitWindow:getChildById('secondary').onCheckChange = onClotheCheckChange
|
||||
outfitWindow:getChildById('detail').onCheckChange = onClotheCheckChange
|
||||
|
||||
local outfitCreatureBox = outfitWindow:getChildById('outfitCreatureBox')
|
||||
local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel')
|
||||
outfitCreatureBox:setCreature(outfitCreature)
|
||||
|
||||
if mountCreature then
|
||||
local mountCreatureBox = outfitWindow:getChildById('mountCreatureBox')
|
||||
mountCreatureBox:setCreature(mountCreature)
|
||||
end
|
||||
|
||||
-- populate color panel
|
||||
for j=0,6 do
|
||||
for i=0,18 do
|
||||
local colorBox = g_ui.createWidget('ColorBox', colorBoxPanel)
|
||||
@@ -206,9 +220,10 @@ function Outfit.create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||
end
|
||||
end
|
||||
|
||||
-- set current outfit/mount
|
||||
currentOutfit = 1
|
||||
for i=1,#outfitList do
|
||||
if outfitList[i][1] == outfit.type then
|
||||
if outfit and outfitList[i][1] == outfit.type then
|
||||
currentOutfit = i
|
||||
break
|
||||
end
|
||||
|
@@ -48,7 +48,7 @@ Window
|
||||
Label
|
||||
id: outfitName
|
||||
!text: tr('No Outfit')
|
||||
width: 100
|
||||
width: 115
|
||||
anchors.bottom: prev.top
|
||||
anchors.left: prev.left
|
||||
margin-bottom: 2
|
||||
@@ -81,7 +81,7 @@ Window
|
||||
Label
|
||||
id: mountName
|
||||
!text: tr('No Mount')
|
||||
width: 140
|
||||
width: 115
|
||||
anchors.bottom: prev.top
|
||||
anchors.left: prev.left
|
||||
margin-bottom: 2
|
||||
@@ -95,7 +95,7 @@ Window
|
||||
@onClick: Outfit.nextMountType()
|
||||
|
||||
PrevMountButton
|
||||
id: mountPreviousButton
|
||||
id: mountPrevButton
|
||||
anchors.right: mountCreatureBox.left
|
||||
anchors.verticalCenter: mountCreatureBox.verticalCenter
|
||||
margin-right: 3
|
||||
@@ -170,7 +170,7 @@ Window
|
||||
anchors.left: head.left
|
||||
margin-top: 3
|
||||
margin-right: 20
|
||||
width: 323
|
||||
width: 302
|
||||
height: 119
|
||||
layout:
|
||||
type: grid
|
||||
|
Reference in New Issue
Block a user