1 -- In this file we define functions that serves for player windows
2 local base
= "ui:interface:player_trade:header_opened";
3 local slots
= 10; -- Change in local_database.xml, database.xml and NbExchangeSlots on server
5 ------------------------------------------------------------------------------------------------------------
6 -- create the game namespace without reseting if already created in an other file.
11 ------------------------------------------------------------------------------------------------------------
12 -- Update weight and bulk indicator in trade window for receive side
13 function game
:updateReceiveBulkAndWeight()
14 getUI(base
.. ":receive:bulk_txt").hardtext
= tostring(getBulk("RECEIVE"));
15 getUI(base
.. ":receive:weight_txt").hardtext
= tostring(getWeight("RECEIVE"));
18 -- Update weight and bulk indicator in trade window for give side
19 function game
:updateGiveBulkAndWeight()
20 getUI(base
.. ":give:bulk_txt").hardtext
= tostring(getBulk("GIVE"));
21 getUI(base
.. ":give:weight_txt").hardtext
= tostring(getWeight("GIVE"));
24 function getWeight(inventory
)
25 local weight
= runExpr("getItemsWeight('LOCAL:EXCHANGE:"..inventory
.."', 0," .. slots
.. ")");
26 return math
.floor(weight
* 100) / 100;
29 function getBulk(inventory
)
30 local bulk
= runExpr("getItemsBulk('LOCAL:EXCHANGE:"..inventory
.."', 0," .. slots
.. ")");
31 return math
.floor(bulk
* 100) / 100;
35 RYZOM_PLAYER_TRADE_VERSION
= 324