mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Market item filtering improvements and other some minor improvements
* Can now filter market items by vocation, level, slot type, and depot items. * Added new bitwise lib for handling flag operations. * Can now get/set local player vocation/premium (TODO: spell list).
This commit is contained in:
@@ -14,17 +14,17 @@ Panel
|
||||
anchors.top: parent.top
|
||||
|
||||
ButtonBox
|
||||
id: opengl1
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: prev.verticalCenter
|
||||
id: opengl1
|
||||
text: OpenGL 1
|
||||
size: 80 20
|
||||
margin-left: 6
|
||||
|
||||
ButtonBox
|
||||
id: opengl2
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: prev.verticalCenter
|
||||
id: opengl2
|
||||
text: OpenGL 2
|
||||
size: 80 20
|
||||
margin-left: 4
|
||||
|
@@ -34,7 +34,20 @@ function debugContainersItems()
|
||||
function UIItem:onHoverChange(hovered)
|
||||
if hovered then
|
||||
local item = self:getItem()
|
||||
if item then g_tooltip.display(item:getId()) end
|
||||
if item then
|
||||
local texts = {
|
||||
'id: '..item:getId(),
|
||||
'\nstackable: '..tostring(item:isStackable()),
|
||||
'\nmarketable: '..tostring(item:isMarketable()),
|
||||
'\nvocation: '..(item:getMarketData() and item:getMarketData().restrictVocation or 'none'),
|
||||
'\ncloth slot: '..item:getClothSlot()
|
||||
}
|
||||
local text = ''
|
||||
for _, str in pairs(texts) do
|
||||
text = text..str
|
||||
end
|
||||
g_tooltip.display(text)
|
||||
end
|
||||
else
|
||||
g_tooltip.hide()
|
||||
end
|
||||
|
17
modules/corelib/bitwise.lua
Normal file
17
modules/corelib/bitwise.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
Bit = {}
|
||||
|
||||
function Bit.bit(p)
|
||||
return 2 ^ p
|
||||
end
|
||||
|
||||
function Bit.hasBit(x, p)
|
||||
return x % (p + p) >= p
|
||||
end
|
||||
|
||||
function Bit.setbit(x, p)
|
||||
return Bit.hasBit(x, p) and x or x + p
|
||||
end
|
||||
|
||||
function Bit.clearbit(x, p)
|
||||
return Bit.hasBit(x, p) and x - p or x
|
||||
end
|
@@ -9,6 +9,7 @@ Module
|
||||
dofile 'math'
|
||||
dofile 'string'
|
||||
dofile 'table'
|
||||
dofile 'bitwise'
|
||||
|
||||
dofile 'const'
|
||||
dofile 'util'
|
||||
|
@@ -8,6 +8,12 @@ function UIComboBox.create()
|
||||
return combobox
|
||||
end
|
||||
|
||||
function UIComboBox:clearOptions()
|
||||
self.options = {}
|
||||
self.currentIndex = -1
|
||||
self:clearText()
|
||||
end
|
||||
|
||||
function UIComboBox:setCurrentOption(text)
|
||||
if not self.options then return end
|
||||
for i,v in ipairs(self.options) do
|
||||
@@ -29,6 +35,12 @@ function UIComboBox:setCurrentIndex(index)
|
||||
end
|
||||
end
|
||||
|
||||
function UIComboBox:getCurrentOption()
|
||||
if table.hasKey(self.options, self.currentIndex) then
|
||||
return self.options[self.currentIndex]
|
||||
end
|
||||
end
|
||||
|
||||
function UIComboBox:addOption(text, data)
|
||||
table.insert(self.options, { text = text, data = data })
|
||||
local index = #self.options
|
||||
|
@@ -10,35 +10,38 @@ local mainTabBar
|
||||
|
||||
local marketOffersPanel
|
||||
local selectionTabBar
|
||||
local displaysTabBar
|
||||
local offersTabBar
|
||||
|
||||
local itemsPanel
|
||||
local browsePanel
|
||||
local searchPanel
|
||||
|
||||
local displaysTabBar
|
||||
local itemOffersPanel
|
||||
local itemDetailsPanel
|
||||
local itemStatsPanel
|
||||
|
||||
local myOffersPanel
|
||||
local offersTabBar
|
||||
local currentOffersPanel
|
||||
local offerHistoryPanel
|
||||
|
||||
local marketOffers = {}
|
||||
local marketItems = {}
|
||||
local depot = {}
|
||||
local information ={}
|
||||
local selectedItem
|
||||
local nameLabel
|
||||
local radioItemSet
|
||||
local categoryList
|
||||
local subCategoryList
|
||||
local slotFilterList
|
||||
local filterButtons = {}
|
||||
|
||||
local buyOfferTable
|
||||
local sellOfferTable
|
||||
local detailsTable
|
||||
local buyStatsTable
|
||||
local sellStatsTable
|
||||
|
||||
local marketOffers = {}
|
||||
local marketItems = {}
|
||||
local depot = {}
|
||||
local information = {}
|
||||
local currentItems = {}
|
||||
local itemsPanel
|
||||
local radioItemSet
|
||||
local filterBox
|
||||
|
||||
local offerTableHeader = {
|
||||
{['text'] = 'Player Name', ['width'] = 100},
|
||||
@@ -74,6 +77,56 @@ local function getMarketDescriptionId(name)
|
||||
end
|
||||
end
|
||||
|
||||
local function getMarketSlotFilterId(name)
|
||||
local id = table.find(MarketSlotFilters, name)
|
||||
if id then
|
||||
return id
|
||||
end
|
||||
end
|
||||
|
||||
local function getMarketSlotFilterName(id)
|
||||
if table.hasKey(MarketSlotFilters, id) then
|
||||
return MarketSlotFilters[id]
|
||||
end
|
||||
end
|
||||
|
||||
local function isValidItem(item, category)
|
||||
if item.marketData.category ~= category and category ~= MarketCategory[0] then
|
||||
return false
|
||||
end
|
||||
|
||||
-- filter item
|
||||
local slotFilter = false
|
||||
if slotFilterList:isEnabled() then
|
||||
slotFilter = getMarketSlotFilterId(slotFilterList:getCurrentOption().text)
|
||||
end
|
||||
local marketData = item.marketData
|
||||
|
||||
local filterVocation = filterButtons[MarketFilters.Vocation]:isChecked()
|
||||
local filterLevel = filterButtons[MarketFilters.Level]:isChecked()
|
||||
local filterDepot = filterButtons[MarketFilters.Depot]:isChecked()
|
||||
|
||||
if slotFilter then
|
||||
if slotFilter ~= 255 and item.ptr:getClothSlot() ~= slotFilter then
|
||||
return false
|
||||
end
|
||||
end
|
||||
local player = g_game.getLocalPlayer()
|
||||
if filterLevel and marketData.requiredLevel and player:getLevel() < marketData.requiredLevel then
|
||||
return false
|
||||
end
|
||||
if filterVocation and marketData.restrictVocation > 0 then
|
||||
local voc = Bit.bit(information.vocation)
|
||||
if not Bit.hasBit(marketData.restrictVocation, voc) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
if filterDepot and not Market.depotContains(item.ptr:getId()) then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local function clearSelectedItem()
|
||||
if selectedItem and selectedItem.item.ptr then
|
||||
Market.updateOffers({})
|
||||
@@ -97,20 +150,19 @@ local function initMarketItems()
|
||||
local t = types[i]
|
||||
local newItem = Item.create(t:getId())
|
||||
if newItem then
|
||||
local item = {
|
||||
ptr = newItem,
|
||||
marketData = t:getMarketData()
|
||||
}
|
||||
marketItems[#marketItems+1] = item
|
||||
local marketData = t:getMarketData()
|
||||
if not table.empty(marketData) then
|
||||
local item = {
|
||||
ptr = newItem,
|
||||
marketData = marketData
|
||||
}
|
||||
marketItems[#marketItems+1] = item
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function updateItemsWidget()
|
||||
if table.empty(currentItems) then
|
||||
return
|
||||
end
|
||||
|
||||
itemsPanel = browsePanel:recursiveGetChildById('itemsPanel')
|
||||
local layout = itemsPanel:getLayout()
|
||||
layout:disableUpdates()
|
||||
@@ -138,25 +190,38 @@ local function updateItemsWidget()
|
||||
layout:update()
|
||||
end
|
||||
|
||||
local function loadDepotItems(depotItems)
|
||||
information.depotItems = {}
|
||||
for i = 1, #depotItems do
|
||||
local data = depotItems[i]
|
||||
local item = Item.create(data[1])
|
||||
if not item then
|
||||
break
|
||||
end
|
||||
item:setCount(data[2])
|
||||
local marketData = item:getMarketData()
|
||||
local function onUpdateCategory(combobox, option)
|
||||
local id = getMarketCategoryId(option)
|
||||
if id == MarketCategory.MetaWeapons then
|
||||
-- enable and load weapons filter/items
|
||||
subCategoryList:setEnabled(true)
|
||||
slotFilterList:setEnabled(true)
|
||||
local subId = getMarketCategoryId(subCategoryList:getCurrentOption().text)
|
||||
Market.loadMarketItems(subId)
|
||||
else
|
||||
subCategoryList:setEnabled(false)
|
||||
slotFilterList:setEnabled(false)
|
||||
Market.loadMarketItems(id) -- load standard filter
|
||||
end
|
||||
end
|
||||
|
||||
if not table.empty(marketData) then
|
||||
local newItem = {
|
||||
ptr = item,
|
||||
marketData = marketData
|
||||
}
|
||||
table.insert(information.depotItems, newItem)
|
||||
local function onUpdateSubCategory(combobox, option)
|
||||
local id = getMarketCategoryId(option)
|
||||
Market.loadMarketItems(id)
|
||||
-- setup slot filter
|
||||
slotFilterList:clearOptions()
|
||||
local subId = getMarketCategoryId(subCategoryList:getCurrentOption().text)
|
||||
local slots = MarketCategoryWeapons[subId].slots
|
||||
for _, slot in pairs(slots) do
|
||||
if table.hasKey(MarketSlotFilters, slot) then
|
||||
slotFilterList:addOption(MarketSlotFilters[slot])
|
||||
end
|
||||
end
|
||||
slotFilterList:setEnabled(true)
|
||||
end
|
||||
|
||||
local function onUpdateSlotFilter(combobox, option)
|
||||
Market.updateCurrentItems()
|
||||
end
|
||||
|
||||
local function initInterface()
|
||||
@@ -208,16 +273,33 @@ local function initInterface()
|
||||
selectedItem = marketOffersPanel:recursiveGetChildById('selectedItem')
|
||||
selectedItem.item = {}
|
||||
|
||||
-- populate filter combo box
|
||||
filterBox = browsePanel:getChildById('filterComboBox')
|
||||
for i = MarketCategory.First, MarketCategory.Last do
|
||||
filterBox:addOption(getMarketCategoryName(i))
|
||||
end
|
||||
filterBox:setCurrentOption(getMarketCategoryName(MarketCategory.First))
|
||||
-- setup filters
|
||||
filterButtons[MarketFilters.Vocation] = browsePanel:getChildById('filterVocation')
|
||||
filterButtons[MarketFilters.Level] = browsePanel:getChildById('filterLevel')
|
||||
filterButtons[MarketFilters.Depot] = browsePanel:getChildById('filterDepot')
|
||||
|
||||
filterBox.onOptionChange = function(combobox, option)
|
||||
Market.loadMarketItems(getMarketCategoryId(option))
|
||||
categoryList = browsePanel:getChildById('categoryComboBox')
|
||||
subCategoryList = browsePanel:getChildById('subCategoryComboBox')
|
||||
slotFilterList = browsePanel:getChildById('typeComboBox')
|
||||
|
||||
slotFilterList:addOption(MarketSlotFilters[255])
|
||||
slotFilterList:setEnabled(false)
|
||||
|
||||
for i = MarketCategory.First, MarketCategory.Last do
|
||||
if i >= MarketCategory.Ammunition and i <= MarketCategory.WandsRods then
|
||||
subCategoryList:addOption(getMarketCategoryName(i))
|
||||
else
|
||||
categoryList:addOption(getMarketCategoryName(i))
|
||||
end
|
||||
end
|
||||
categoryList:addOption(getMarketCategoryName(255)) -- meta weapons
|
||||
categoryList:setCurrentOption(getMarketCategoryName(MarketCategory.First))
|
||||
subCategoryList:setEnabled(false)
|
||||
|
||||
-- hook item filters
|
||||
categoryList.onOptionChange = onUpdateCategory
|
||||
subCategoryList.onOptionChange = onUpdateSubCategory
|
||||
slotFilterList.onOptionChange = onUpdateSlotFilter
|
||||
|
||||
-- get tables
|
||||
buyOfferTable = itemOffersPanel:recursiveGetChildById('buyingTable')
|
||||
@@ -242,48 +324,62 @@ function Market.terminate()
|
||||
end
|
||||
|
||||
mainTabBar = nil
|
||||
marketOffersPanel = nil
|
||||
displaysTabBar = nil
|
||||
offersTabBar = nil
|
||||
selectionTabBar = nil
|
||||
|
||||
marketOffersPanel = nil
|
||||
browsePanel = nil
|
||||
searchPanel = nil
|
||||
displaysTabBar = nil
|
||||
itemOffersPanel = nil
|
||||
itemDetailsPanel = nil
|
||||
itemStatsPanel = nil
|
||||
myOffersPanel = nil
|
||||
offersTabBar = nil
|
||||
currentOffersPanel = nil
|
||||
offerHistoryPanel = nil
|
||||
marketOffers = {}
|
||||
marketItems = {}
|
||||
depotItems = {}
|
||||
information = {}
|
||||
currentItems = {}
|
||||
itemsPanel = nil
|
||||
|
||||
nameLabel = nil
|
||||
radioItemSet = nil
|
||||
selectedItem = nil
|
||||
categoryList = nil
|
||||
subCategoryList = nil
|
||||
slotFilterList = nil
|
||||
filterButtons = {}
|
||||
|
||||
buyOfferTable = nil
|
||||
sellOfferTable = nil
|
||||
detailsTable = nil
|
||||
buyStatsTable = nil
|
||||
sellStatsTable = nil
|
||||
radioItemSet = nil
|
||||
selectedItem = nil
|
||||
filterBox = nil
|
||||
|
||||
marketOffers = {}
|
||||
marketItems = {}
|
||||
information = {}
|
||||
currentItems = {}
|
||||
|
||||
Market = nil
|
||||
end
|
||||
|
||||
function Market.loadMarketItems(_category)
|
||||
function Market.depotContains(itemId)
|
||||
for i = 1, #information.depotItems do
|
||||
local item = information.depotItems[i]
|
||||
if item.ptr:getId() == itemId then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function Market.loadMarketItems(category)
|
||||
if table.empty(marketItems) then
|
||||
initMarketItems()
|
||||
end
|
||||
|
||||
currentItems = {}
|
||||
for i = 1, #marketItems do
|
||||
-- filter items here
|
||||
local item = marketItems[i]
|
||||
local category = item.marketData.category
|
||||
if category == _category or _category == MarketCategory[0] then
|
||||
if isValidItem(item, category) then
|
||||
table.insert(currentItems, item)
|
||||
end
|
||||
end
|
||||
@@ -291,6 +387,36 @@ function Market.loadMarketItems(_category)
|
||||
updateItemsWidget()
|
||||
end
|
||||
|
||||
function Market.loadDepotItems(depotItems)
|
||||
information.depotItems = {}
|
||||
for i = 1, #depotItems do
|
||||
local data = depotItems[i]
|
||||
local newItem = Item.create(data[1])
|
||||
if not newItem then
|
||||
break
|
||||
end
|
||||
newItem:setCount(data[2])
|
||||
local marketData = newItem:getMarketData()
|
||||
|
||||
if not table.empty(marketData) then
|
||||
local item = {
|
||||
ptr = newItem,
|
||||
marketData = marketData
|
||||
}
|
||||
table.insert(information.depotItems, item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Market.updateCurrentItems()
|
||||
-- get market category
|
||||
local id = getMarketCategoryId(categoryList:getCurrentOption().text)
|
||||
if id == MarketCategory.MetaWeapons then
|
||||
id = getMarketCategoryId(subCategoryList:getCurrentOption().text)
|
||||
end
|
||||
Market.loadMarketItems(id)
|
||||
end
|
||||
|
||||
function Market.updateOffers(offers)
|
||||
marketOffers[MarketAction.Buy] = {}
|
||||
marketOffers[MarketAction.Sell] = {}
|
||||
@@ -330,7 +456,6 @@ function Market.updateDetails(itemId, descriptions, purchaseStats, saleStats)
|
||||
return
|
||||
end
|
||||
selectedItem.item.details = {
|
||||
serverItemId = itemId,
|
||||
descriptions = descriptions,
|
||||
purchaseStats = purchaseStats,
|
||||
saleStats = saleStats
|
||||
@@ -340,7 +465,7 @@ function Market.updateDetails(itemId, descriptions, purchaseStats, saleStats)
|
||||
detailsTable:clearData()
|
||||
for k, desc in pairs(descriptions) do
|
||||
local columns = {
|
||||
{['text'] = getMarketDescriptionName(desc[1])..':', ['width'] = 100},
|
||||
{['text'] = getMarketDescriptionName(desc[1])..':'},
|
||||
{['text'] = desc[2], ['width'] = 330}
|
||||
}
|
||||
detailsTable:addRow(columns)
|
||||
@@ -349,21 +474,20 @@ function Market.updateDetails(itemId, descriptions, purchaseStats, saleStats)
|
||||
-- update sale item statistics
|
||||
sellStatsTable:clearData()
|
||||
if table.empty(saleStats) then
|
||||
sellStatsTable:addRow({{['text'] = 'No information', ['width'] = 110}})
|
||||
sellStatsTable:addRow({{['text'] = 'No information'}})
|
||||
else
|
||||
for k, stat in pairs(saleStats) do
|
||||
if not table.empty(stat) then
|
||||
sellStatsTable:addRow({{['text'] = 'Total Transations:', ['width'] = 110},
|
||||
sellStatsTable:addRow({{['text'] = 'Total Transations:'},
|
||||
{['text'] = stat[1], ['width'] = 270}})
|
||||
|
||||
sellStatsTable:addRow({{['text'] = 'Highest Price:', ['width'] = 110},
|
||||
sellStatsTable:addRow({{['text'] = 'Highest Price:'},
|
||||
{['text'] = stat[3], ['width'] = 270}})
|
||||
|
||||
print(stat[2] .. '/' ..stat[1])
|
||||
sellStatsTable:addRow({{['text'] = 'Average Price:', ['width'] = 110},
|
||||
{['text'] = math.floor(stat[2]/stat[1]), ['width'] = 270}})
|
||||
sellStatsTable:addRow({{['text'] = 'Average Price:'},
|
||||
{['text'] = math.floor(stat[2]/stat[1])}})
|
||||
|
||||
sellStatsTable:addRow({{['text'] = 'Lowest Price:', ['width'] = 110},
|
||||
sellStatsTable:addRow({{['text'] = 'Lowest Price:'},
|
||||
{['text'] = stat[4], ['width'] = 270}})
|
||||
end
|
||||
end
|
||||
@@ -372,21 +496,20 @@ function Market.updateDetails(itemId, descriptions, purchaseStats, saleStats)
|
||||
-- update buy item statistics
|
||||
buyStatsTable:clearData()
|
||||
if table.empty(purchaseStats) then
|
||||
buyStatsTable:addRow({{['text'] = 'No information', ['width'] = 110}})
|
||||
buyStatsTable:addRow({{['text'] = 'No information'}})
|
||||
else
|
||||
for k, stat in pairs(purchaseStats) do
|
||||
if not table.empty(stat) then
|
||||
buyStatsTable:addRow({{['text'] = 'Total Transations:', ['width'] = 110},
|
||||
buyStatsTable:addRow({{['text'] = 'Total Transations:'},
|
||||
{['text'] = stat[1], ['width'] = 270}})
|
||||
|
||||
buyStatsTable:addRow({{['text'] = 'Highest Price:', ['width'] = 110},
|
||||
buyStatsTable:addRow({{['text'] = 'Highest Price:'},
|
||||
{['text'] = stat[3], ['width'] = 270}})
|
||||
|
||||
print(stat[2] .. '/' ..stat[1])
|
||||
buyStatsTable:addRow({{['text'] = 'Average Price:', ['width'] = 110},
|
||||
buyStatsTable:addRow({{['text'] = 'Average Price:'},
|
||||
{['text'] = math.floor(stat[2]/stat[1]), ['width'] = 270}})
|
||||
|
||||
buyStatsTable:addRow({{['text'] = 'Lowest Price:', ['width'] = 110},
|
||||
buyStatsTable:addRow({{['text'] = 'Lowest Price:'},
|
||||
{['text'] = stat[4], ['width'] = 270}})
|
||||
end
|
||||
end
|
||||
@@ -399,7 +522,7 @@ function Market.updateSelectedItem(newItem)
|
||||
if selectedItem.item.ptr then
|
||||
selectedItem:setItem(selectedItem.item.ptr)
|
||||
nameLabel:setText(selectedItem.item.marketData.name)
|
||||
MarketProtocol.sendMarketBrowse(selectedItem.item.ptr:getId()) -- send sprite id browsed
|
||||
MarketProtocol.sendMarketBrowse(selectedItem.item.ptr:getId()) -- send browsed msg
|
||||
end
|
||||
else
|
||||
selectedItem:setItem(nil)
|
||||
@@ -407,21 +530,32 @@ function Market.updateSelectedItem(newItem)
|
||||
end
|
||||
end
|
||||
|
||||
function Market.onMarketEnter(depotItems, offers, balance)
|
||||
function Market.onMarketEnter(depotItems, offers, balance, vocation)
|
||||
if marketWindow:isVisible() then
|
||||
return
|
||||
end
|
||||
marketWindow:lock()
|
||||
marketOffers[MarketAction.Buy] = {}
|
||||
marketOffers[MarketAction.Sell] = {}
|
||||
|
||||
--[[
|
||||
TODO:
|
||||
* clear filters on enter
|
||||
* add market reset function
|
||||
]]
|
||||
information.balance = balance
|
||||
information.totalOffers = offers
|
||||
if vocation < 0 then
|
||||
local player = g_game.getLocalPlayer()
|
||||
if player then information.vocation = player:getVocation() end
|
||||
else
|
||||
-- vocation must be compatible with < 950
|
||||
information.vocation = vocation
|
||||
end
|
||||
|
||||
if table.empty(currentItems) then
|
||||
Market.loadMarketItems(MarketCategory.First)
|
||||
end
|
||||
loadDepotItems(depotItems)
|
||||
Market.loadDepotItems(depotItems)
|
||||
|
||||
-- build offer table header
|
||||
if buyOfferTable and not buyOfferTable:hasHeader() then
|
||||
@@ -436,6 +570,8 @@ function Market.onMarketEnter(depotItems, offers, balance)
|
||||
-- Uncheck selected item, cannot make protocol calls to resend marketBrowsing
|
||||
clearSelectedItem()
|
||||
end
|
||||
|
||||
marketWindow:lock()
|
||||
marketWindow:show()
|
||||
end
|
||||
|
||||
|
@@ -37,8 +37,9 @@ end
|
||||
-- parsing protocols
|
||||
local function parseMarketEnter(msg)
|
||||
local balance = msg:getU32()
|
||||
local vocation = -1
|
||||
if g_game.getProtocolVersion() < 950 then
|
||||
msg:getU8() -- get vocation id
|
||||
vocation = msg:getU8() -- get vocation id
|
||||
end
|
||||
local offers = msg:getU8()
|
||||
local depotItems = {}
|
||||
@@ -51,7 +52,7 @@ local function parseMarketEnter(msg)
|
||||
table.insert(depotItems, {itemId, itemCount})
|
||||
end
|
||||
|
||||
signalcall(Market.onMarketEnter, depotItems, offers, balance)
|
||||
signalcall(Market.onMarketEnter, depotItems, offers, balance, vocation)
|
||||
return true
|
||||
end
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
MarketButtonBox < UICheckBox
|
||||
font: verdana-11px-antialised
|
||||
color: #f55e5ecc
|
||||
color: #f55e5ebb
|
||||
size: 106 22
|
||||
text-offset: 0 0
|
||||
text-align: center
|
||||
|
@@ -28,7 +28,7 @@ Panel
|
||||
margin: 1
|
||||
|
||||
MarketComboBox
|
||||
id: filterComboBox
|
||||
id: categoryComboBox
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
@@ -37,7 +37,7 @@ Panel
|
||||
margin-left: 3
|
||||
|
||||
MarketComboBox
|
||||
id: weaponComboBox
|
||||
id: subCategoryComboBox
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
@@ -45,8 +45,11 @@ Panel
|
||||
margin-right: 3
|
||||
margin-left: 3
|
||||
|
||||
$disabled:
|
||||
color: #aaaaaa44
|
||||
|
||||
MarketButtonBox
|
||||
id: filterMatchLevel
|
||||
id: filterLevel
|
||||
checked: false
|
||||
!text: tr('Level')
|
||||
!tooltip: tr('Filter list to match your level')
|
||||
@@ -57,20 +60,20 @@ Panel
|
||||
margin-left: 3
|
||||
width: 40
|
||||
height: 20
|
||||
//@onClick: Market.filterMatchLevel()
|
||||
@onCheckChange: Market.updateCurrentItems()
|
||||
|
||||
MarketButtonBox
|
||||
id: filterMatchVocation
|
||||
id: filterVocation
|
||||
checked: false
|
||||
!text: tr('Vocation')
|
||||
!text: tr('Voc.')
|
||||
!tooltip: tr('Filter list to match your vocation')
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
margin-right: 3
|
||||
margin-left: 3
|
||||
width: 60
|
||||
width: 34
|
||||
height: 20
|
||||
//@onClick: Market.filterMatchVocation()
|
||||
@onCheckChange: Market.updateCurrentItems()
|
||||
|
||||
MarketComboBox
|
||||
id: typeComboBox
|
||||
@@ -80,8 +83,11 @@ Panel
|
||||
margin-right: 3
|
||||
margin-left: 3
|
||||
|
||||
$disabled:
|
||||
color: #aaaaaa44
|
||||
|
||||
MarketButtonBox
|
||||
id: showDepotOnly
|
||||
id: filterDepot
|
||||
checked: false
|
||||
!text: tr('Show Depot Only')
|
||||
!tooltip: tr('Show your depot items only')
|
||||
@@ -91,7 +97,7 @@ Panel
|
||||
margin-top: 6
|
||||
margin-right: 3
|
||||
margin-left: 3
|
||||
//@onClick: Market.setDisplayDepot()
|
||||
@onCheckChange: Market.updateCurrentItems()
|
||||
|
||||
Panel
|
||||
anchors.top: prev.bottom
|
||||
|
@@ -12,7 +12,7 @@ DetailsTableColumn < TableColumn
|
||||
background-color: alpha
|
||||
text-offset: 5 2
|
||||
color: #cccccc
|
||||
width: 80
|
||||
width: 100
|
||||
focusable: false
|
||||
|
||||
Panel
|
||||
@@ -27,7 +27,7 @@ Panel
|
||||
anchors.right: parent.right
|
||||
margin-top: 55
|
||||
margin-left: 6
|
||||
margin-bottom: 45
|
||||
margin-bottom: 75
|
||||
margin-right: 6
|
||||
padding: 1
|
||||
focusable: false
|
||||
|
@@ -11,7 +11,7 @@ StatsTableColumn < TableColumn
|
||||
background-color: alpha
|
||||
text-offset: 5 0
|
||||
color: #cccccc
|
||||
width: 80
|
||||
width: 110
|
||||
focusable: false
|
||||
|
||||
Panel
|
||||
|
@@ -28,6 +28,15 @@ MarketCategory = {
|
||||
MarketCategory.First = MarketCategory.Armors
|
||||
MarketCategory.Last = MarketCategory.PremiumScrolls
|
||||
|
||||
MarketCategoryWeapons = {
|
||||
[MarketCategory.Ammunition] = { slots = {255} },
|
||||
[MarketCategory.Axes] = { slots = {255, InventorySlotOther, InventorySlotLeft} },
|
||||
[MarketCategory.Clubs] = { slots = {255, InventorySlotOther, InventorySlotLeft} },
|
||||
[MarketCategory.DistanceWeapons] = { slots = {255, InventorySlotOther, InventorySlotLeft} },
|
||||
[MarketCategory.Swords] = { slots = {255, InventorySlotOther, InventorySlotLeft} },
|
||||
[MarketCategory.WandsRods] = { slots = {255, InventorySlotOther, InventorySlotLeft} }
|
||||
}
|
||||
|
||||
MarketCategoryStrings = {
|
||||
[0] = 'All',
|
||||
[1] = 'Armors',
|
||||
@@ -52,7 +61,7 @@ MarketCategoryStrings = {
|
||||
[20] = 'Swords',
|
||||
[21] = 'Wands and Rods',
|
||||
[22] = 'Premium Scrolls',
|
||||
[255] = 'Meta Weapons'
|
||||
[255] = 'Weapons'
|
||||
}
|
||||
|
||||
MarketAction = {
|
||||
@@ -90,6 +99,7 @@ MarketItemDescription = {
|
||||
WeaponName = 14,
|
||||
Weight = 15
|
||||
}
|
||||
|
||||
MarketItemDescription.First = MarketItemDescription.Armor
|
||||
MarketItemDescription.Last = MarketItemDescription.Weight
|
||||
|
||||
@@ -110,3 +120,18 @@ MarketItemDescriptionStrings = {
|
||||
[14] = 'Weapon Type',
|
||||
[15] = 'Weight'
|
||||
}
|
||||
|
||||
MarketSlotFilters = {
|
||||
[InventorySlotOther] = "Two-Handed",
|
||||
[InventorySlotLeft] = "One-Handed",
|
||||
[255] = "Any"
|
||||
}
|
||||
|
||||
MarketFilters = {
|
||||
Vocation = 1,
|
||||
Level = 2,
|
||||
Depot = 3
|
||||
}
|
||||
|
||||
MarketFilters.First = MarketFilters.vocation
|
||||
MarketFilters.Last = MarketFilters.depot
|
@@ -1,5 +1,6 @@
|
||||
-- @docclass Player
|
||||
|
||||
InventorySlotOther = 0
|
||||
InventorySlotHead = 1
|
||||
InventorySlotNeck = 2
|
||||
InventorySlotBack = 3
|
||||
|
Reference in New Issue
Block a user