mirror of
				https://github.com/ErikasKontenis/SabrehavenServer.git
				synced 2025-10-30 19:56:22 +01:00 
			
		
		
		
	commit client
This commit is contained in:
		
							
								
								
									
										1433
									
								
								SabrehavenOTClient/modules/game_market/market.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1433
									
								
								SabrehavenOTClient/modules/game_market/market.lua
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										9
									
								
								SabrehavenOTClient/modules/game_market/market.otmod
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								SabrehavenOTClient/modules/game_market/market.otmod
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| Module | ||||
|   name: game_market | ||||
|   description: Global item market system | ||||
|   author: BeniS | ||||
|   website: https://github.com/edubart/otclient | ||||
|   sandboxed: true | ||||
|   scripts: [ offerstatistic, marketoffer, marketprotocol, market ] | ||||
|   @onLoad: init() | ||||
|   @onUnload: terminate() | ||||
							
								
								
									
										62
									
								
								SabrehavenOTClient/modules/game_market/market.otui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								SabrehavenOTClient/modules/game_market/market.otui
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,62 @@ | ||||
| MarketWindow < MainWindow | ||||
|   id: marketWindow | ||||
|   !text: tr('Market') | ||||
|   size: 700 530 | ||||
|  | ||||
|   @onEscape: Market.close() | ||||
|  | ||||
|   // Main Panel Window | ||||
|  | ||||
|   MarketTabBar | ||||
|     id: mainTabBar | ||||
|     width: 164 | ||||
|     height: 25 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|  | ||||
|   Panel | ||||
|     id: mainTabContent | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     anchors.bottom: parent.bottom | ||||
|     padding: 3 | ||||
|     border-width: 1 | ||||
|     border-color: #000000 | ||||
|     margin-bottom: 20 | ||||
|  | ||||
|   Label | ||||
|     id: balanceLabel | ||||
|     !text: tr('Balance') .. ':' | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: parent.top | ||||
|     anchors.right: parent.right | ||||
|  | ||||
|   Button | ||||
|     id: closeButton | ||||
|     !text: tr('Close') | ||||
|     anchors.top: mainTabContent.bottom | ||||
|     anchors.horizontalCenter: mainTabContent.horizontalCenter | ||||
|     margin-top: 5 | ||||
|     width: 110 | ||||
|     @onClick: Market.close() | ||||
|  | ||||
|   Button | ||||
|     id: refreshOffersButton | ||||
|     !text: tr('Refresh Offers') | ||||
|     anchors.top: mainTabContent.bottom | ||||
|     anchors.right: mainTabContent.right | ||||
|     margin-top: 5 | ||||
|     width: 110 | ||||
|     @onClick: Market.refreshOffers() | ||||
|  | ||||
|   Button | ||||
|     id: resetButton | ||||
|     !text: tr('Reset Market') | ||||
|     !tooltip: tr('Reset selection, filters & search') | ||||
|     anchors.top: mainTabContent.bottom | ||||
|     anchors.left: mainTabContent.left | ||||
|     margin-top: 5 | ||||
|     width: 110 | ||||
|     @onClick: Market.reset() | ||||
							
								
								
									
										158
									
								
								SabrehavenOTClient/modules/game_market/marketoffer.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										158
									
								
								SabrehavenOTClient/modules/game_market/marketoffer.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,158 @@ | ||||
| MarketOffer = {} | ||||
| MarketOffer.__index = MarketOffer | ||||
|  | ||||
| local OFFER_TIMESTAMP = 1 | ||||
| local OFFER_COUNTER = 2 | ||||
|  | ||||
| MarketOffer.new = function(offerId, t, item, amount, price, playerName, state, var) | ||||
|   local offer = { | ||||
|     id = {}, | ||||
|     type = nil, | ||||
|     item = 0, | ||||
|     amount = 0, | ||||
|     price = 0, | ||||
|     player = '', | ||||
|     state = 0, | ||||
|     var = nil | ||||
|   } | ||||
|  | ||||
|   if not offerId or type(offerId) ~= 'table'  then | ||||
|     g_logger.error('MarketOffer.new - invalid offer id provided.') | ||||
|   end | ||||
|   offer.id = offerId | ||||
|  | ||||
|   t = tonumber(t) | ||||
|   if t ~= MarketAction.Buy and t ~= MarketAction.Sell then | ||||
|     g_logger.error('MarketOffer.new - invalid type provided.') | ||||
|   end | ||||
|   offer.type = t | ||||
|  | ||||
|   if not item then | ||||
|     g_logger.error('MarketOffer.new - invalid item provided.') | ||||
|   end | ||||
|   offer.item = item | ||||
|  | ||||
|   offer.amount = amount | ||||
|   offer.price = price | ||||
|   offer.player = playerName | ||||
|  | ||||
|   state = tonumber(state) | ||||
|   if state ~= MarketOfferState.Active and state ~= MarketOfferState.Cancelled | ||||
|     and state ~= MarketOfferState.Expired and state ~= MarketOfferState.Accepted then | ||||
|     g_logger.error('MarketOffer.new - invalid state provided.') | ||||
|   end | ||||
|   offer.state = state | ||||
|   offer.var = var | ||||
|  | ||||
|   setmetatable(offer, MarketOffer) | ||||
|   return offer | ||||
| end | ||||
|  | ||||
| function MarketOffer:isEqual(id) | ||||
|   return self.id[OFFER_TIMESTAMP] == id[OFFER_TIMESTAMP] and self.id[OFFER_COUNTER] == id[OFFER_COUNTER] | ||||
| end | ||||
|  | ||||
| function MarketOffer:isLessThan(id) | ||||
|   return self.id[OFFER_TIMESTAMP] <= id[OFFER_TIMESTAMP] and self.id[OFFER_COUNTER] < id[OFFER_COUNTER] | ||||
| end | ||||
|  | ||||
| function MarketOffer:isNull() | ||||
|   return table.empty(self.id) | ||||
| end | ||||
|  | ||||
| -- Sets/Gets | ||||
|  | ||||
| function MarketOffer:setId(id) | ||||
|   if not id or type(id) ~= 'table'  then | ||||
|     g_logger.error('MarketOffer.setId - invalid id provided.') | ||||
|   end | ||||
|   self.id = id | ||||
| end | ||||
|  | ||||
| function MarketOffer:getId() | ||||
|   return self.id | ||||
| end | ||||
|  | ||||
| function MarketOffer:setType(t) | ||||
|   if not t or type(t) ~= 'number'  then | ||||
|     g_logger.error('MarketOffer.setItem - invalid type provided.') | ||||
|   end | ||||
|   self.type = type | ||||
| end | ||||
|  | ||||
| function MarketOffer:getType() | ||||
|   return self.type | ||||
| end | ||||
|  | ||||
| function MarketOffer:setItem(item) | ||||
|   if not item or type(item) ~= 'userdata'  then | ||||
|     g_logger.error('MarketOffer.setItem - invalid item id provided.') | ||||
|   end | ||||
|   self.item = item | ||||
| end | ||||
|  | ||||
| function MarketOffer:getItem() | ||||
|   return self.item | ||||
| end | ||||
|  | ||||
| function MarketOffer:setAmount(amount) | ||||
|   if not amount or type(amount) ~= 'number'  then | ||||
|     g_logger.error('MarketOffer.setAmount - invalid amount provided.') | ||||
|   end | ||||
|   self.amount = amount | ||||
| end | ||||
|  | ||||
| function MarketOffer:getAmount() | ||||
|   return self.amount | ||||
| end | ||||
|  | ||||
| function MarketOffer:setPrice(price) | ||||
|   if not price or type(price) ~= 'number'  then | ||||
|     g_logger.error('MarketOffer.setPrice - invalid price provided.') | ||||
|   end | ||||
|   self.price = price | ||||
| end | ||||
|  | ||||
| function MarketOffer:getPrice() | ||||
|   return self.price | ||||
| end | ||||
|  | ||||
| function MarketOffer:getTotalPrice() | ||||
|   return self.price * self.amount | ||||
| end | ||||
|  | ||||
| function MarketOffer:setPlayer(player) | ||||
|   if not player or type(player) ~= 'number'  then | ||||
|     g_logger.error('MarketOffer.setPlayer - invalid player provided.') | ||||
|   end | ||||
|   self.player = player | ||||
| end | ||||
|  | ||||
| function MarketOffer:getPlayer() | ||||
|   return self.player | ||||
| end | ||||
|  | ||||
| function MarketOffer:setState(state) | ||||
|   if not state or type(state) ~= 'number'  then | ||||
|     g_logger.error('MarketOffer.setState - invalid state provided.') | ||||
|   end | ||||
|   self.state = state | ||||
| end | ||||
|  | ||||
| function MarketOffer:getState() | ||||
|   return self.state | ||||
| end | ||||
|  | ||||
| function MarketOffer:getTimeStamp() | ||||
|   if table.empty(self.id)  or #self.id < OFFER_TIMESTAMP then | ||||
|     return | ||||
|   end | ||||
|   return self.id[OFFER_TIMESTAMP] | ||||
| end | ||||
|  | ||||
| function MarketOffer:getCounter() | ||||
|   if table.empty(self.id) or #self.id < OFFER_COUNTER then | ||||
|     return | ||||
|   end | ||||
|   return self.id[OFFER_COUNTER] | ||||
| end | ||||
							
								
								
									
										278
									
								
								SabrehavenOTClient/modules/game_market/marketprotocol.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										278
									
								
								SabrehavenOTClient/modules/game_market/marketprotocol.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,278 @@ | ||||
| MarketProtocol = {} | ||||
|  | ||||
| -- private functions | ||||
|  | ||||
| local silent | ||||
| local protocol | ||||
| local statistics = runinsandbox('offerstatistic') | ||||
|  | ||||
| local function send(msg) | ||||
|   if protocol and not silent then | ||||
|     protocol:send(msg) | ||||
|   end | ||||
| end | ||||
|  | ||||
| local function readMarketOffer(msg, action, var) | ||||
|   local timestamp = msg:getU32() | ||||
|   local counter = msg:getU16() | ||||
|  | ||||
|   local itemId = 0 | ||||
|   if var == MarketRequest.MyOffers or var == MarketRequest.MyHistory then | ||||
|     itemId = msg:getU16() | ||||
|   else | ||||
|     itemId = var | ||||
|   end | ||||
|  | ||||
|   local amount = msg:getU16() | ||||
|   local price = msg:getU32() | ||||
|   local playerName | ||||
|   local state = MarketOfferState.Active | ||||
|   if var == MarketRequest.MyHistory then | ||||
|     state = msg:getU8() | ||||
|   elseif var == MarketRequest.MyOffers then | ||||
|   else | ||||
|     playerName = msg:getString() | ||||
|   end | ||||
|  | ||||
|   return MarketOffer.new({timestamp, counter}, action, Item.create(itemId), amount, price, playerName, state, var) | ||||
| end | ||||
|  | ||||
| -- parsing protocols | ||||
| local function parseMarketEnter(protocol, msg) | ||||
|   local items | ||||
|   if g_game.getClientVersion() < 944 then | ||||
|     items = {} | ||||
|     local itemsCount = msg:getU16() | ||||
|     for i = 1, itemsCount do | ||||
|       local itemId = msg:getU16() | ||||
|       local category = msg:getU8() | ||||
|       local name = msg:getString() | ||||
|       table.insert(items, { | ||||
|         id = itemId, | ||||
|         category = category, | ||||
|         name = name | ||||
|       }) | ||||
|     end     | ||||
|   end | ||||
|    | ||||
|   local balance = 0 | ||||
|   if g_game.getClientVersion() <= 1250 or not g_game.getFeature(GameTibia12Protocol) then | ||||
|     if g_game.getClientVersion() >= 981 or g_game.getClientVersion() < 944 then | ||||
|       balance = msg:getU64() | ||||
|     else | ||||
|       balance = msg:getU32() | ||||
|     end | ||||
|   end | ||||
|    | ||||
|   local vocation = -1 | ||||
|   if g_game.getClientVersion() >= 944 and g_game.getClientVersion() < 950 then | ||||
|     vocation = msg:getU8() -- get vocation id | ||||
|   end | ||||
|   local offers = msg:getU8() | ||||
|  | ||||
|   local depotItems = {} | ||||
|   local depotCount = msg:getU16() | ||||
|   for i = 1, depotCount do | ||||
|     local itemId = msg:getU16() -- item id | ||||
|     local itemCount = msg:getU16() -- item count | ||||
|  | ||||
|     depotItems[itemId] = itemCount | ||||
|   end | ||||
|  | ||||
|   signalcall(Market.onMarketEnter, depotItems, offers, balance, vocation, items) | ||||
|   return true | ||||
| end | ||||
|  | ||||
| local function parseMarketLeave(protocol, msg) | ||||
|   Market.onMarketLeave() | ||||
|   return true | ||||
| end | ||||
|  | ||||
| local function parseMarketDetail(protocol, msg) | ||||
|   local itemId = msg:getU16() | ||||
|  | ||||
|   local descriptions = {} | ||||
|   for i = MarketItemDescription.First, MarketItemDescription.Last do | ||||
|     if msg:peekU16() ~= 0x00 then | ||||
|       table.insert(descriptions, {i, msg:getString()}) -- item descriptions | ||||
|     else | ||||
|       msg:getU16() | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   if g_game.getClientVersion() >= 1100 then -- imbuements | ||||
|     if msg:peekU16() ~= 0x00 then | ||||
|       table.insert(descriptions, {MarketItemDescription.Last + 1, msg:getString()}) | ||||
|     else | ||||
|       msg:getU16() | ||||
|     end   | ||||
|   end | ||||
|  | ||||
|   local time = (os.time() / 1000) * statistics.SECONDS_PER_DAY; | ||||
|  | ||||
|   local purchaseStats = {} | ||||
|   local count = msg:getU8() | ||||
|   for i=1, count do | ||||
|     local transactions = msg:getU32() -- transaction count | ||||
|     local totalPrice = msg:getU32() -- total price | ||||
|     local highestPrice = msg:getU32() -- highest price | ||||
|     local lowestPrice = msg:getU32() -- lowest price | ||||
|  | ||||
|     local tmp = time - statistics.SECONDS_PER_DAY | ||||
|     table.insert(purchaseStats, OfferStatistic.new(tmp, MarketAction.Buy, transactions, totalPrice, highestPrice, lowestPrice)) | ||||
|   end | ||||
|  | ||||
|   local saleStats = {} | ||||
|   count = msg:getU8() | ||||
|   for i=1, count do | ||||
|     local transactions = msg:getU32() -- transaction count | ||||
|     local totalPrice = msg:getU32() -- total price | ||||
|     local highestPrice = msg:getU32() -- highest price | ||||
|     local lowestPrice = msg:getU32() -- lowest price | ||||
|  | ||||
|     local tmp = time - statistics.SECONDS_PER_DAY | ||||
|     table.insert(saleStats, OfferStatistic.new(tmp, MarketAction.Sell, transactions, totalPrice, highestPrice, lowestPrice)) | ||||
|   end | ||||
|  | ||||
|   signalcall(Market.onMarketDetail, itemId, descriptions, purchaseStats, saleStats) | ||||
|   return true | ||||
| end | ||||
|  | ||||
| local function parseMarketBrowse(protocol, msg) | ||||
|   local var = msg:getU16() | ||||
|   local offers = {} | ||||
|  | ||||
|   local buyOfferCount = msg:getU32() | ||||
|   for i = 1, buyOfferCount do | ||||
|     table.insert(offers, readMarketOffer(msg, MarketAction.Buy, var)) | ||||
|   end | ||||
|  | ||||
|   local sellOfferCount = msg:getU32() | ||||
|   for i = 1, sellOfferCount do | ||||
|     table.insert(offers, readMarketOffer(msg, MarketAction.Sell, var)) | ||||
|   end | ||||
|  | ||||
|   signalcall(Market.onMarketBrowse, offers, var) | ||||
|   return true | ||||
| end | ||||
|  | ||||
| -- public functions | ||||
| function initProtocol() | ||||
|   connect(g_game, { onGameStart = MarketProtocol.registerProtocol, | ||||
|                     onGameEnd = MarketProtocol.unregisterProtocol }) | ||||
|  | ||||
|   -- reloading module | ||||
|   if g_game.isOnline() then | ||||
|     MarketProtocol.registerProtocol() | ||||
|   end | ||||
|  | ||||
|   MarketProtocol.silent(false) | ||||
| end | ||||
|  | ||||
| function terminateProtocol() | ||||
|   disconnect(g_game, { onGameStart = MarketProtocol.registerProtocol, | ||||
|                        onGameEnd = MarketProtocol.unregisterProtocol }) | ||||
|  | ||||
|   -- reloading module | ||||
|   MarketProtocol.unregisterProtocol() | ||||
|   MarketProtocol = nil | ||||
| end | ||||
|  | ||||
| function MarketProtocol.updateProtocol(_protocol) | ||||
|   protocol = _protocol | ||||
| end | ||||
|  | ||||
| function MarketProtocol.registerProtocol() | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     ProtocolGame.registerOpcode(GameServerOpcodes.GameServerMarketEnter, parseMarketEnter) | ||||
|     ProtocolGame.registerOpcode(GameServerOpcodes.GameServerMarketLeave, parseMarketLeave) | ||||
|     ProtocolGame.registerOpcode(GameServerOpcodes.GameServerMarketDetail, parseMarketDetail) | ||||
|     ProtocolGame.registerOpcode(GameServerOpcodes.GameServerMarketBrowse, parseMarketBrowse) | ||||
|   end | ||||
|   MarketProtocol.updateProtocol(g_game.getProtocolGame()) | ||||
| end | ||||
|  | ||||
| function MarketProtocol.unregisterProtocol() | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     ProtocolGame.unregisterOpcode(GameServerOpcodes.GameServerMarketEnter, parseMarketEnter) | ||||
|     ProtocolGame.unregisterOpcode(GameServerOpcodes.GameServerMarketLeave, parseMarketLeave) | ||||
|     ProtocolGame.unregisterOpcode(GameServerOpcodes.GameServerMarketDetail, parseMarketDetail) | ||||
|     ProtocolGame.unregisterOpcode(GameServerOpcodes.GameServerMarketBrowse, parseMarketBrowse) | ||||
|   end | ||||
|   MarketProtocol.updateProtocol(nil) | ||||
| end | ||||
|  | ||||
| function MarketProtocol.silent(mode) | ||||
|   silent = mode | ||||
| end | ||||
|  | ||||
| -- sending protocols | ||||
|  | ||||
| function MarketProtocol.sendMarketLeave() | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     local msg = OutputMessage.create() | ||||
|     msg:addU8(ClientOpcodes.ClientMarketLeave) | ||||
|     send(msg) | ||||
|   else | ||||
|     g_logger.error('MarketProtocol.sendMarketLeave does not support the current protocol.') | ||||
|   end | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketBrowse(browseId) | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     local msg = OutputMessage.create() | ||||
|     msg:addU8(ClientOpcodes.ClientMarketBrowse) | ||||
|     msg:addU16(browseId) | ||||
|     send(msg) | ||||
|   else | ||||
|     g_logger.error('MarketProtocol.sendMarketBrowse does not support the current protocol.') | ||||
|   end | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketBrowseMyOffers() | ||||
|   MarketProtocol.sendMarketBrowse(MarketRequest.MyOffers) | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketBrowseMyHistory() | ||||
|   MarketProtocol.sendMarketBrowse(MarketRequest.MyHistory) | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketCreateOffer(type, spriteId, amount, price, anonymous) | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     local msg = OutputMessage.create() | ||||
|     msg:addU8(ClientOpcodes.ClientMarketCreate) | ||||
|     msg:addU8(type) | ||||
|     msg:addU16(spriteId) | ||||
|     msg:addU16(amount) | ||||
|     msg:addU32(price) | ||||
|     msg:addU8(anonymous) | ||||
|     send(msg) | ||||
|   else | ||||
|     g_logger.error('MarketProtocol.sendMarketCreateOffer does not support the current protocol.') | ||||
|   end | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketCancelOffer(timestamp, counter) | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     local msg = OutputMessage.create() | ||||
|     msg:addU8(ClientOpcodes.ClientMarketCancel) | ||||
|     msg:addU32(timestamp) | ||||
|     msg:addU16(counter) | ||||
|     send(msg) | ||||
|   else | ||||
|     g_logger.error('MarketProtocol.sendMarketCancelOffer does not support the current protocol.') | ||||
|   end | ||||
| end | ||||
|  | ||||
| function MarketProtocol.sendMarketAcceptOffer(timestamp, counter, amount) | ||||
|   if g_game.getFeature(GamePlayerMarket) then | ||||
|     local msg = OutputMessage.create() | ||||
|     msg:addU8(ClientOpcodes.ClientMarketAccept) | ||||
|     msg:addU32(timestamp) | ||||
|     msg:addU16(counter) | ||||
|     msg:addU16(amount) | ||||
|     send(msg) | ||||
|   else | ||||
|     g_logger.error('MarketProtocol.sendMarketAcceptOffer does not support the current protocol.') | ||||
|   end | ||||
| end | ||||
							
								
								
									
										101
									
								
								SabrehavenOTClient/modules/game_market/offerstatistic.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								SabrehavenOTClient/modules/game_market/offerstatistic.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | ||||
| OfferStatistic = {} | ||||
| OfferStatistic.__index = OfferStatistic | ||||
|  | ||||
| SECONDS_PER_DAY = 86400 | ||||
|  | ||||
| OfferStatistic.new = function(timestamp, t, transactions, totalPrice, highestPrice, lowestPrice) | ||||
|   local stat = { | ||||
|     time = 0, | ||||
|     type = nil, | ||||
|     transactions = 0, | ||||
|     totalPrice = 0, | ||||
|     highestPrice = 0, | ||||
|     lowestPrice = 0 | ||||
|   } | ||||
|   stat.time = math.floor(timestamp / SECONDS_PER_DAY) * SECONDS_PER_DAY | ||||
|  | ||||
|   if t ~= MarketAction.Buy and t ~= MarketAction.Sell then | ||||
|     g_logger.error('OfferStatistic.new - invalid type provided.') | ||||
|   end | ||||
|   stat.type = t | ||||
|  | ||||
|   stat.transactions = transactions | ||||
|   stat.totalPrice = totalPrice | ||||
|   stat.highestPrice = highestPrice | ||||
|   stat.lowestPrice = lowestPrice | ||||
|  | ||||
|   setmetatable(stat, OfferStatistic) | ||||
|   return stat | ||||
| end | ||||
|  | ||||
| function OfferStatistic:isNull() | ||||
|   return self.time == 0 or not self.type | ||||
| end | ||||
|  | ||||
| -- Sets/Gets | ||||
|  | ||||
| function OfferStatistic:setTime(time) | ||||
|   if not time or type(time) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setTime - invalid time provided.') | ||||
|   end | ||||
|   self.time = time | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getTime() | ||||
|   return self.time | ||||
| end | ||||
|  | ||||
| function OfferStatistic:setType(t) | ||||
|   if not t or type(t) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setType - invalid type provided.') | ||||
|   end | ||||
|   self.type = t | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getType() | ||||
|   return self.type | ||||
| end | ||||
|  | ||||
| function OfferStatistic:setTransactions(transactions) | ||||
|   if not transactions or type(transactions) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setTransactions - invalid transactions provided.') | ||||
|   end | ||||
|   self.transactions = transactions | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getTransactions() | ||||
|   return self.transactions | ||||
| end | ||||
|  | ||||
| function OfferStatistic:setTotalPrice(amount) | ||||
|   if not totalPrice or type(totalPrice) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setTotalPrice - invalid total price provided.') | ||||
|   end | ||||
|   self.totalPrice = totalPrice | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getTotalPrice() | ||||
|   return self.totalPrice | ||||
| end | ||||
|  | ||||
| function OfferStatistic:setHighestPrice(highestPrice) | ||||
|   if not highestPrice or type(highestPrice) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setHighestPrice - invalid highestPrice provided.') | ||||
|   end | ||||
|   self.highestPrice = highestPrice | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getHighestPrice() | ||||
|   return self.highestPrice | ||||
| end | ||||
|  | ||||
| function OfferStatistic:setLowestPrice(lowestPrice) | ||||
|   if not lowestPrice or type(lowestPrice) ~= 'number'  then | ||||
|     g_logger.error('OfferStatistic.setLowestPrice - invalid lowestPrice provided.') | ||||
|   end | ||||
|   self.lowestPrice = lowestPrice | ||||
| end | ||||
|  | ||||
| function OfferStatistic:getLowestPrice() | ||||
|   return self.lowestPrice | ||||
| end | ||||
| @@ -0,0 +1,44 @@ | ||||
| AmountWindow < MainWindow | ||||
|   id: amountWindow | ||||
|   !text: tr('Amount') | ||||
|   size: 270 90 | ||||
|  | ||||
|   Item | ||||
|     id: item | ||||
|     text-offset: 0 22 | ||||
|     text-align: right | ||||
|     anchors.left: parent.left | ||||
|     anchors.top: parent.top | ||||
|     margin-top: 2 | ||||
|     margin-left: -4 | ||||
|     focusable: false | ||||
|     virtual: true | ||||
|  | ||||
|   HorizontalScrollBar | ||||
|     id: amountScrollBar | ||||
|     anchors.left: prev.right | ||||
|     anchors.right: parent.right | ||||
|     anchors.top: prev.top | ||||
|     margin-left: 10 | ||||
|     margin-top: -2 | ||||
|  | ||||
|   Button | ||||
|     id: buttonCancel | ||||
|     !text: tr('Cancel') | ||||
|     height: 20 | ||||
|     anchors.left: amountScrollBar.horizontalCenter | ||||
|     anchors.right: amountScrollBar.right | ||||
|     anchors.top: amountScrollBar.bottom | ||||
|     margin-top: 7 | ||||
|     focusable: false | ||||
|  | ||||
|   Button | ||||
|     id: buttonOk | ||||
|     !text: tr('Ok') | ||||
|     height: 20 | ||||
|     anchors.right: amountScrollBar.horizontalCenter | ||||
|     anchors.left: amountScrollBar.left | ||||
|     anchors.top: amountScrollBar.bottom | ||||
|     margin-top: 7 | ||||
|     margin-right: 6 | ||||
|     focusable: false | ||||
| @@ -0,0 +1,13 @@ | ||||
| MarketButtonBox < ButtonBoxRounded | ||||
|   font: verdana-11px-rounded | ||||
|   color: #f55e5ebb | ||||
|   size: 106 22 | ||||
|   text-offset: 0 2 | ||||
|   text-align: center | ||||
|  | ||||
|   $checked: | ||||
|     color: white | ||||
|  | ||||
|   $disabled: | ||||
|     color: #666666ff | ||||
|     image-color: #ffffff88 | ||||
| @@ -0,0 +1,18 @@ | ||||
| MarketComboBoxPopupMenuButton < ComboBoxPopupMenuButton | ||||
|   height: 18 | ||||
|   font: verdana-11px-rounded | ||||
|   text-offset: 2 2 | ||||
|  | ||||
| MarketComboBoxPopupMenuSeparator < UIWidget | ||||
|   image-source: /images/combobox_rounded | ||||
|   image-repeated: true | ||||
|   image-clip: 1 59 89 1 | ||||
|   height: 1 | ||||
|   phantom: true | ||||
|  | ||||
| MarketComboBoxPopupMenu < ComboBoxPopupMenu | ||||
|  | ||||
| MarketComboBox < ComboBox | ||||
|   font: verdana-11px-rounded | ||||
|   size: 86 20 | ||||
|   text-offset: 3 2 | ||||
| @@ -0,0 +1,44 @@ | ||||
| MarketTabBar < TabBar | ||||
| MarketTabBarPanel < TabBarPanel | ||||
| MarketTabBarButton < TabBarButton | ||||
|   size: 20 25 | ||||
|   font: verdana-11px-rounded | ||||
|   text-offset: 0 2 | ||||
|  | ||||
|   $!first: | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 0 | ||||
|  | ||||
|   $hover !checked: | ||||
|     color: #ffffff | ||||
|  | ||||
|   $checked: | ||||
|     color: #ffffff | ||||
|  | ||||
|   $on !checked: | ||||
|     color: #f55e5e | ||||
|  | ||||
| MarketRightTabBar < TabBar | ||||
| MarketRightTabBarPanel < TabBarPanel | ||||
| MarketRightTabBarButton < TabBarButton | ||||
|   size: 20 25 | ||||
|   font: verdana-11px-rounded | ||||
|   text-offset: 0 2 | ||||
|   color: #929292 | ||||
|  | ||||
|   $first: | ||||
|     anchors.right: parent.right | ||||
|     anchors.left: none | ||||
|  | ||||
|   $!first: | ||||
|     anchors.right: prev.left | ||||
|     anchors.left: none | ||||
|  | ||||
|   $hover !checked: | ||||
|     color: #ffffff | ||||
|  | ||||
|   $checked: | ||||
|     color: #ffffff | ||||
|  | ||||
|   $on !checked: | ||||
|     color: #f55e5e | ||||
							
								
								
									
										188
									
								
								SabrehavenOTClient/modules/game_market/ui/marketoffers.otui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										188
									
								
								SabrehavenOTClient/modules/game_market/ui/marketoffers.otui
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,188 @@ | ||||
| Panel | ||||
|  | ||||
|   MarketTabBar | ||||
|     id: leftTabBar | ||||
|     width: 107 | ||||
|     height:25 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|  | ||||
|   Panel | ||||
|     id: leftTabContent | ||||
|     width: 180 | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     anchors.bottom: parent.bottom | ||||
|     border-width: 1 | ||||
|     border-color: #000000 | ||||
|  | ||||
|   MarketRightTabBar | ||||
|     id: rightTabBar | ||||
|     width: 166 | ||||
|     height:25 | ||||
|     anchors.top: parent.top | ||||
|     anchors.right: parent.right | ||||
|  | ||||
|   Panel | ||||
|     id: rightTabContent | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: leftTabContent.right | ||||
|     anchors.right: prev.right | ||||
|     anchors.bottom: parent.bottom | ||||
|     margin-left:3 | ||||
|     border-width: 1 | ||||
|     border-color: #000000 | ||||
|  | ||||
|   UIItem | ||||
|     id: selectedItem | ||||
|     phantom: true | ||||
|     size: 34 34 | ||||
|     padding: 1 | ||||
|     font: verdana-11px-rounded | ||||
|     border-color: white | ||||
|     anchors.top: rightTabBar.bottom | ||||
|     anchors.left: rightTabContent.left | ||||
|     margin-top: 6 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Label | ||||
|     id: nameLabel | ||||
|     !text: tr('No item selected.') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: prev.top | ||||
|     anchors.left: prev.right | ||||
|     anchors.right: parent.right | ||||
|     margin-left: 5 | ||||
|  | ||||
|   Label | ||||
|     id: createLabel | ||||
|     !text: tr('Create New Offer') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: rightTabBar.top | ||||
|     anchors.left: rightTabContent.left | ||||
|     margin-top: 355 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Label | ||||
|     id: offerTypeLabel | ||||
|     !text: tr('Offer Type') .. ':' | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     margin-top: 7 | ||||
|  | ||||
|   MarketComboBox | ||||
|     id: offerTypeComboBox | ||||
|     !text: tr('Please Select') | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: createLabel.left | ||||
|     margin-top: 3 | ||||
|     width: 105 | ||||
|  | ||||
|     $disabled: | ||||
|       color: #aaaaaa44 | ||||
|  | ||||
|   Label | ||||
|     id: totalPriceLabel | ||||
|     !text: tr('Total Price') .. ':' | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: offerTypeLabel.top | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 7 | ||||
|  | ||||
|   SpinBox | ||||
|     id: totalPriceEdit | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     margin-top: 3 | ||||
|     width: 75 | ||||
|     minimum: 1 | ||||
|     maximum: 999999999 | ||||
|     focusable: true | ||||
|  | ||||
|     $disabled: | ||||
|       color: #aaaaaa44 | ||||
|  | ||||
|   Label | ||||
|     id: piecePriceLabel | ||||
|     !text: tr('Piece Price') .. ':' | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: offerTypeLabel.top | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 7 | ||||
|  | ||||
|   SpinBox | ||||
|     id: piecePriceEdit | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     margin-top: 3 | ||||
|     width: 75 | ||||
|     minimum: 1 | ||||
|     maximum: 999999999 | ||||
|     focusable: true | ||||
|  | ||||
|     $disabled: | ||||
|       color: #aaaaaa44 | ||||
|  | ||||
|   Label | ||||
|     id: amountLabel | ||||
|     !text: tr('Amount') .. ':' | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: offerTypeLabel.top | ||||
|     anchors.left: amountEdit.left | ||||
|  | ||||
|   PreviousButton | ||||
|     id: prevAmountButton | ||||
|     anchors.verticalCenter: piecePriceEdit.verticalCenter | ||||
|     anchors.left: piecePriceEdit.right | ||||
|     margin-left: 7 | ||||
|     @onClick: Market.decrementAmount() | ||||
|  | ||||
|   SpinBox | ||||
|     id: amountEdit | ||||
|     anchors.top: prev.top | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 3 | ||||
|     width: 55 | ||||
|     buttons: false | ||||
|     minimum: 1 | ||||
|     maximum: 64000 | ||||
|     focusable: true | ||||
|  | ||||
|   NextButton | ||||
|     id: nextAmountButton | ||||
|     anchors.verticalCenter: piecePriceEdit.verticalCenter | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 3 | ||||
|     @onClick: Market.incrementAmount() | ||||
|  | ||||
|   Button | ||||
|     id: createOfferButton | ||||
|     !text: tr('Create Offer') | ||||
|     anchors.verticalCenter: prev.verticalCenter | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 7 | ||||
|     width: 90 | ||||
|  | ||||
|   CheckBox | ||||
|     id: anonymousCheckBox | ||||
|     !text: tr('Anonymous') | ||||
|     anchors.left: prev.left | ||||
|     anchors.bottom: prev.top | ||||
|     margin-bottom: 6 | ||||
|     @onSetup: self:setChecked(false) | ||||
|     height: 16 | ||||
|     width: 90 | ||||
|  | ||||
|   Label | ||||
|     id: feeLabel | ||||
|     font: verdana-11px-rounded | ||||
|     anchors.top: createOfferButton.bottom | ||||
|     anchors.left: createOfferButton.left | ||||
|     margin: 2 | ||||
| @@ -0,0 +1,158 @@ | ||||
| MarketItemBox < UICheckBox | ||||
|   id: itemBox | ||||
|   border-width: 1 | ||||
|   border-color: #000000 | ||||
|   color: #aaaaaa | ||||
|   text-align: center | ||||
|  | ||||
|   Item | ||||
|     id: item | ||||
|     phantom: true | ||||
|     virtual: true | ||||
|     text-offset: 0 22 | ||||
|     text-align: right | ||||
|     anchors.top: parent.top | ||||
|     anchors.horizontalCenter: parent.horizontalCenter | ||||
|     margin: 1 | ||||
|  | ||||
|   $checked: | ||||
|     border-color: #ffffff | ||||
|  | ||||
|   $hover !checked: | ||||
|     border-color: #aaaaaa | ||||
|  | ||||
|   $disabled: | ||||
|     image-color: #ffffff88 | ||||
|     color: #aaaaaa88 | ||||
|  | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   MarketComboBox | ||||
|     id: categoryComboBox | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 3 | ||||
|     margin-right: 3 | ||||
|     margin-left: 3 | ||||
|  | ||||
|   MarketComboBox | ||||
|     id: subCategoryComboBox | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 3 | ||||
|     margin-right: 3 | ||||
|     margin-left: 3 | ||||
|  | ||||
|     $disabled: | ||||
|       color: #aaaaaa44 | ||||
|  | ||||
|   MarketButtonBox | ||||
|     id: filterLevel | ||||
|     &default: false | ||||
|     !text: tr('Level') | ||||
|     !tooltip: tr('Filter list to match your level') | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 3 | ||||
|     margin-right: 3 | ||||
|     margin-left: 3 | ||||
|     width: 40 | ||||
|     height: 20 | ||||
|  | ||||
|   MarketButtonBox | ||||
|     id: filterVocation | ||||
|     &default: false | ||||
|     !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: 34 | ||||
|     height: 20 | ||||
|  | ||||
|   MarketComboBox | ||||
|     id: slotComboBox | ||||
|     anchors.top: prev.top | ||||
|     anchors.left: prev.right | ||||
|     anchors.right: parent.right | ||||
|     margin-right: 3 | ||||
|     margin-left: 3 | ||||
|  | ||||
|     $disabled: | ||||
|       color: #aaaaaa44 | ||||
|  | ||||
|   MarketButtonBox | ||||
|     id: filterDepot | ||||
|     &default: false | ||||
|     !text: tr('Show Depot Only') | ||||
|     !tooltip: tr('Show your depot items only') | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 6 | ||||
|     margin-right: 3 | ||||
|     margin-left: 3 | ||||
|  | ||||
|   Panel | ||||
|     id: itemsContainer | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     anchors.bottom: parent.bottom | ||||
|     margin-top: 10 | ||||
|     margin-left: 3 | ||||
|     margin-bottom: 30 | ||||
|     margin-right: 3 | ||||
|  | ||||
|     VerticalScrollBar | ||||
|       id: itemsPanelListScrollBar | ||||
|       anchors.top: parent.top | ||||
|       anchors.bottom: parent.bottom | ||||
|       anchors.right: parent.right | ||||
|       step: 28 | ||||
|       pixels-scroll: true | ||||
|  | ||||
|     ScrollablePanel | ||||
|       id: itemsPanel | ||||
|       anchors.left: parent.left | ||||
|       anchors.right: prev.left | ||||
|       anchors.top: parent.top | ||||
|       anchors.bottom: parent.bottom | ||||
|       vertical-scrollbar: itemsPanelListScrollBar | ||||
|       layout: | ||||
|         type: grid | ||||
|         cell-size: 36 36 | ||||
|         flow: true | ||||
|         auto-spacing: true | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Find') .. ':' | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     margin-top: 9 | ||||
|     width: 30 | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|  | ||||
|   TextEdit | ||||
|     id: searchEdit | ||||
|     anchors.verticalCenter: prev.verticalCenter | ||||
|     anchors.left: prev.right | ||||
|     margin-left: 3 | ||||
|     width: 113 | ||||
|     @onTextChange: Market.updateCurrentItems() | ||||
|  | ||||
|   MarketButtonBox | ||||
|     id: filterSearchAll | ||||
|     &default: true | ||||
|     !text: tr('All') | ||||
|     !tooltip: tr('Search all items') | ||||
|     anchors.verticalCenter: prev.verticalCenter | ||||
|     anchors.left: prev.right | ||||
|     anchors.right: itemsContainer.right | ||||
|     margin-left: 3 | ||||
| @@ -0,0 +1,56 @@ | ||||
| DetailsTableRow < TableRow | ||||
|   font: verdana-11px-monochrome | ||||
|   focusable: true | ||||
|   color: #cccccc | ||||
|   height: 45 | ||||
|   focusable: false | ||||
|   padding: 2 | ||||
|   even-background-color: alpha | ||||
|   odd-background-color: alpha | ||||
|  | ||||
| DetailsTableColumn < TableColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   background-color: alpha | ||||
|   text-offset: 2 2 | ||||
|   color: #cccccc | ||||
|   width: 100 | ||||
|   focusable: false | ||||
|  | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Table | ||||
|     id: detailsTable | ||||
|     anchors.top: parent.top | ||||
|     anchors.bottom: parent.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 63 | ||||
|     margin-left: 6 | ||||
|     margin-bottom: 85 | ||||
|     margin-right: 6 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: detailsTableData | ||||
|     row-style: DetailsTableRow | ||||
|     column-style: DetailsTableColumn | ||||
|  | ||||
|   TableData | ||||
|     id: detailsTableData | ||||
|     anchors.top: detailsTable.top | ||||
|     anchors.bottom: detailsTable.bottom | ||||
|     anchors.left: detailsTable.left | ||||
|     anchors.right: detailsTable.right | ||||
|     vertical-scrollbar: detailsTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: detailsTableScrollBar | ||||
|     anchors.top: detailsTable.top | ||||
|     anchors.bottom: detailsTable.bottom | ||||
|     anchors.right: detailsTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
| @@ -0,0 +1,176 @@ | ||||
| OfferTableRow < TableRow | ||||
|   font: verdana-11px-monochrome | ||||
|   color: #cccccc | ||||
|   height: 15 | ||||
|  | ||||
| OfferTableColumn < TableColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   background-color: alpha | ||||
|   text-offset: 5 0 | ||||
|   color: #cccccc | ||||
|   width: 80 | ||||
|  | ||||
| OfferTableWarningColumn < OfferTableColumn | ||||
|   color: #e03d3d | ||||
|  | ||||
| OfferTableHeaderRow < TableHeaderRow | ||||
|   font: verdana-11px-monochrome | ||||
|   color: #cccccc | ||||
|   height: 20 | ||||
|  | ||||
| OfferTableHeaderColumn < SortableTableHeaderColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   text-offset: 2 0 | ||||
|   color: #cccccc | ||||
|  | ||||
|   $focus: | ||||
|     background-color: #294f6d | ||||
|     color: #ffffff | ||||
|  | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Button | ||||
|     id: buyButton | ||||
|     !text: tr('Buy Now') | ||||
|     anchors.right: parent.right | ||||
|     anchors.bottom: next.bottom | ||||
|     margin-right: 6 | ||||
|     width: 80 | ||||
|     enabled: false | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Sell Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 44 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Table | ||||
|     id: sellingTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     anchors.right: parent.right | ||||
|     height: 115 | ||||
|     margin-top: 5 | ||||
|     margin-bottom: 5 | ||||
|     margin-right: 6 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: sellingTableData | ||||
|     row-style: OfferTableRow | ||||
|     column-style: OfferTableColumn | ||||
|     header-column-style: false | ||||
|     header-row-style: false | ||||
|  | ||||
|     OfferTableHeaderRow | ||||
|       id: header | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Buyer Name') | ||||
|         width: 100 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Amount') | ||||
|         width: 60 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Total Price') | ||||
|         width: 90 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Piece Price') | ||||
|         width: 80 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Auction End') | ||||
|         width: 120 | ||||
|  | ||||
|   TableData | ||||
|     id: sellingTableData | ||||
|     anchors.bottom: sellingTable.bottom | ||||
|     anchors.left: sellingTable.left | ||||
|     anchors.right: sellingTable.right | ||||
|     margin-top: 2 | ||||
|     vertical-scrollbar: sellingTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: sellingTableScrollBar | ||||
|     anchors.top: sellingTable.top | ||||
|     anchors.bottom: sellingTable.bottom | ||||
|     anchors.right: sellingTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
|  | ||||
|   Button | ||||
|     id: sellButton | ||||
|     !text: tr('Sell Now') | ||||
|     anchors.right: parent.right | ||||
|     anchors.top: prev.bottom | ||||
|     margin-top: 5 | ||||
|     margin-right: 6 | ||||
|     width: 80 | ||||
|     enabled: false | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Buy Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: prev.top | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 9 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Table | ||||
|     id: buyingTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 5 | ||||
|     margin-bottom: 5 | ||||
|     margin-right: 6 | ||||
|     height: 115 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: buyingTableData | ||||
|     row-style: OfferTableRow | ||||
|     column-style: OfferTableColumn | ||||
|     header-column-style: false | ||||
|     header-row-style: false | ||||
|  | ||||
|     OfferTableHeaderRow | ||||
|       id: header | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Seller Name') | ||||
|         width: 100 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Amount') | ||||
|         width: 60 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Total Price') | ||||
|         width: 90 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Piece Price') | ||||
|         width: 80 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Auction End') | ||||
|         width: 120 | ||||
|  | ||||
|   TableData | ||||
|     id: buyingTableData | ||||
|     anchors.bottom: buyingTable.bottom | ||||
|     anchors.left: buyingTable.left | ||||
|     anchors.right: buyingTable.right | ||||
|     vertical-scrollbar: buyingTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: buyingTableScrollBar | ||||
|     anchors.top: buyingTable.top | ||||
|     anchors.bottom: buyingTable.bottom | ||||
|     anchors.right: buyingTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
| @@ -0,0 +1,103 @@ | ||||
| StatsTableRow < TableRow | ||||
|   font: verdana-11px-monochrome | ||||
|   focusable: true | ||||
|   color: #cccccc | ||||
|   height: 20 | ||||
|   focusable: false | ||||
|  | ||||
| StatsTableColumn < TableColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   background-color: alpha | ||||
|   text-offset: 5 3 | ||||
|   color: #cccccc | ||||
|   width: 110 | ||||
|   focusable: false | ||||
|  | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Buy Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 44 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Table | ||||
|     id: buyStatsTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     anchors.right: prev.right | ||||
|     margin-top: 6 | ||||
|     margin-bottom: 5 | ||||
|     margin-right: 6 | ||||
|     height: 121 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: buyStatsTableData | ||||
|     row-style: StatsTableRow | ||||
|     column-style: StatsTableColumn | ||||
|  | ||||
|   TableData | ||||
|     id: buyStatsTableData | ||||
|     anchors.top: buyStatsTable.top | ||||
|     anchors.bottom: buyStatsTable.bottom | ||||
|     anchors.left: buyStatsTable.left | ||||
|     anchors.right: buyStatsTable.right | ||||
|     vertical-scrollbar: buyStatsTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: buyStatsTableScrollBar | ||||
|     anchors.top: buyStatsTable.top | ||||
|     anchors.bottom: buyStatsTable.bottom | ||||
|     anchors.right: buyStatsTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Sell Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: buyStatsTable.bottom | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 9 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Table | ||||
|     id: sellStatsTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: buyStatsTable.left | ||||
|     anchors.right: buyStatsTable.right | ||||
|     margin-top: 6 | ||||
|     height: 112 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: sellStatsTableData | ||||
|     row-style: StatsTableRow | ||||
|     column-style: StatsTableColumn | ||||
|  | ||||
|   TableData | ||||
|     id: sellStatsTableData | ||||
|     anchors.top: sellStatsTable.top | ||||
|     anchors.bottom: sellStatsTable.bottom | ||||
|     anchors.left: sellStatsTable.left | ||||
|     anchors.right: sellStatsTable.right | ||||
|     vertical-scrollbar: sellStatsTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: sellStatsTableScrollBar | ||||
|     anchors.top: sellStatsTable.top | ||||
|     anchors.bottom: sellStatsTable.bottom | ||||
|     anchors.right: sellStatsTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
| @@ -0,0 +1,16 @@ | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Reserved for more functionality later.') | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 6 | ||||
|     margin-left: 6 | ||||
|     margin-right: 6 | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     height: 50 | ||||
|     text-wrap: true | ||||
							
								
								
									
										16
									
								
								SabrehavenOTClient/modules/game_market/ui/myoffers.otui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								SabrehavenOTClient/modules/game_market/ui/myoffers.otui
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| Panel | ||||
|  | ||||
|   MarketTabBar | ||||
|     id: offersTabBar | ||||
|     width: 187 | ||||
|     height:25 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|  | ||||
|   Panel | ||||
|     id: offersTabContent | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: prev.left | ||||
|     anchors.right: prev.right | ||||
|     anchors.bottom: parent.bottom | ||||
| @@ -0,0 +1,178 @@ | ||||
| OfferTableRow < TableRow | ||||
|   font: verdana-11px-monochrome | ||||
|   color: #cccccc | ||||
|   height: 15 | ||||
|  | ||||
| OfferTableColumn < TableColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   background-color: alpha | ||||
|   text-offset: 5 0 | ||||
|   color: #cccccc | ||||
|   width: 80 | ||||
|  | ||||
| OfferTableWarningColumn < OfferTableColumn | ||||
|   color: #e03d3d | ||||
|  | ||||
| OfferTableHeaderRow < TableHeaderRow | ||||
|   font: verdana-11px-monochrome | ||||
|   color: #cccccc | ||||
|   height: 20 | ||||
|  | ||||
| OfferTableHeaderColumn < SortableTableHeaderColumn | ||||
|   font: verdana-11px-monochrome | ||||
|   text-offset: 2 0 | ||||
|   color: #cccccc | ||||
|  | ||||
|   $focus: | ||||
|     background-color: #294f6d | ||||
|     color: #ffffff | ||||
|  | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Button | ||||
|     id: sellCancelButton | ||||
|     !text: tr('Cancel') | ||||
|     anchors.right: parent.right | ||||
|     anchors.bottom: next.bottom | ||||
|     margin-right: 6 | ||||
|     width: 80 | ||||
|     enabled: false | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Sell Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 20 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Table | ||||
|     id: mySellingTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     height: 160 | ||||
|     margin-top: 5 | ||||
|     margin-bottom: 5 | ||||
|     margin-left: 6 | ||||
|     margin-right: 6 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: mySellingTableData | ||||
|     row-style: OfferTableRow | ||||
|     column-style: OfferTableColumn | ||||
|     header-column-style: false | ||||
|     header-row-style: false | ||||
|  | ||||
|     OfferTableHeaderRow | ||||
|       id: header | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Item Name') | ||||
|         width: 160 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Total Price') | ||||
|         width: 125 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Piece Price') | ||||
|         width: 125 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Amount') | ||||
|         width: 100 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Auction End') | ||||
|         width: 120 | ||||
|  | ||||
|   TableData | ||||
|     id: mySellingTableData | ||||
|     anchors.bottom: mySellingTable.bottom | ||||
|     anchors.left: mySellingTable.left | ||||
|     anchors.right: mySellingTable.right | ||||
|     margin-top: 2 | ||||
|     vertical-scrollbar: mySellingTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: mySellingTableScrollBar | ||||
|     anchors.top: mySellingTable.top | ||||
|     anchors.bottom: mySellingTable.bottom | ||||
|     anchors.right: mySellingTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Buy Offers') | ||||
|     font: verdana-11px-rounded | ||||
|     text-offset: 0 2 | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     margin-top: 20 | ||||
|     margin-left: 6 | ||||
|  | ||||
|   Button | ||||
|     id: buyCancelButton | ||||
|     !text: tr('Cancel') | ||||
|     anchors.right: parent.right | ||||
|     anchors.bottom: prev.bottom | ||||
|     margin-top: 5 | ||||
|     margin-right: 6 | ||||
|     width: 80 | ||||
|     enabled: false | ||||
|  | ||||
|   Table | ||||
|     id: myBuyingTable | ||||
|     anchors.top: prev.bottom | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     margin-top: 5 | ||||
|     margin-bottom: 5 | ||||
|     margin-left: 6 | ||||
|     margin-right: 6 | ||||
|     height: 160 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: myBuyingTableData | ||||
|     row-style: OfferTableRow | ||||
|     column-style: OfferTableColumn | ||||
|     header-column-style: false | ||||
|     header-row-style: false | ||||
|  | ||||
|     OfferTableHeaderRow | ||||
|       id: header | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Item Name') | ||||
|         width: 160 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Total Price') | ||||
|         width: 125 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Piece Price') | ||||
|         width: 125 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Amount') | ||||
|         width: 100 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Auction End') | ||||
|         width: 120 | ||||
|  | ||||
|   TableData | ||||
|     id: myBuyingTableData | ||||
|     anchors.bottom: myBuyingTable.bottom | ||||
|     anchors.left: myBuyingTable.left | ||||
|     anchors.right: myBuyingTable.right | ||||
|     vertical-scrollbar: myBuyingTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: myBuyingTableScrollBar | ||||
|     anchors.top: myBuyingTable.top | ||||
|     anchors.bottom: myBuyingTable.bottom | ||||
|     anchors.right: myBuyingTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
| @@ -0,0 +1,9 @@ | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Label | ||||
|     !text: tr('Item Offers') | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     margin-left: 10 | ||||
| @@ -0,0 +1,61 @@ | ||||
| Panel | ||||
|   background-color: #22283399 | ||||
|   margin: 1 | ||||
|  | ||||
|   Table | ||||
|     id: myHistoryTable | ||||
|     anchors.top: parent.top | ||||
|     anchors.left: parent.left | ||||
|     anchors.right: parent.right | ||||
|     height: 390 | ||||
|     margin-top: 5 | ||||
|     margin-bottom: 5 | ||||
|     margin-left: 8 | ||||
|     margin-right: 8 | ||||
|     padding: 1 | ||||
|     focusable: false | ||||
|     background-color: #222833 | ||||
|     border-width: 1 | ||||
|     border-color: #191f27 | ||||
|     table-data: myHistoryTableData | ||||
|     row-style: OfferTableRow | ||||
|     column-style: OfferTableColumn | ||||
|     header-column-style: false | ||||
|     header-row-style: false | ||||
|  | ||||
|     OfferTableHeaderRow | ||||
|       id: header | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Action') | ||||
|         width: 60 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Item Name') | ||||
|         width: 140 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Total Price') | ||||
|         width: 115 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Piece Price') | ||||
|         width: 115 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Amount') | ||||
|         width: 75 | ||||
|       OfferTableHeaderColumn | ||||
|         !text: tr('Auction End') | ||||
|         width: 120 | ||||
|          | ||||
|   TableData | ||||
|     id: myHistoryTableData | ||||
|     anchors.bottom: myHistoryTable.bottom | ||||
|     anchors.left: myHistoryTable.left | ||||
|     anchors.right: myHistoryTable.right | ||||
|     margin-top: 2 | ||||
|     vertical-scrollbar: myHistoryTableScrollBar | ||||
|  | ||||
|   VerticalScrollBar | ||||
|     id: myHistoryTableScrollBar | ||||
|     anchors.top: myHistoryTable.top | ||||
|     anchors.bottom: myHistoryTable.bottom | ||||
|     anchors.right: myHistoryTable.right | ||||
|     step: 28 | ||||
|     pixels-scroll: true | ||||
		Reference in New Issue
	
	Block a user
	 ErikasKontenis
					ErikasKontenis