Icaruk 14 Posted July 2, 2014 At the moment I have 2 items: init.sqf missionNamespace setVariable ["Log",1]; missionNamespace setVariable ["Wood",1]; When you open he menu: craftingmenu.sqf list = ["Log", "Wood"]; Q = [Log, Wood]; inventory = []; { _itemName = list select _forEachIndex; _itemQ = Q select _forEachIndex; _where = count invntory; inventario set [_where, [_itemNname, _itemQ]]; } foreach list; table = []; createDialog "crafting_dialog"; { _item = format ["%2 x %1", _x select 1, _x select 0]; _index = lbAdd [1500, _item]; } foreach inventory; When you click the button to move the selected item from the left to the right box: move.sqf _selected = _this select 0; ¿? Here is the problem, I don't know how to get the variable name and value from the listbox, any thoughts? Also, I would like too when you have 0 units from one item, it just doesn't show on the listbox. Share this post Link to post Share on other sites
Horner 13 Posted July 2, 2014 lbSetData and lbData can be used for what you're trying to accomplish. Share this post Link to post Share on other sites
Icaruk 14 Posted July 2, 2014 lbSetData and lbData can be used for what you're trying to accomplish. It returns me "". Share this post Link to post Share on other sites
Horner 13 Posted July 3, 2014 Post some code you are using or I can't help :) Share this post Link to post Share on other sites
Icaruk 14 Posted July 3, 2014 Post some code you are using or I can't help :) All the code I'm using is there, except the dialogs, 1500 is my inventory 1501 is the table. Share this post Link to post Share on other sites
Horner 13 Posted July 3, 2014 All the code I'm using is there, except the dialogs, 1500 is my inventory 1501 is the table. You are saying that the lbData command is returning an empty string, I can't see why if you don't show me how you're using the command. Share this post Link to post Share on other sites
Icaruk 14 Posted July 4, 2014 You are saying that the lbData command is returning an empty string, I can't see why if you don't show me how you're using the command. You mean this? When you select something on the left listbox and then click the "move button" it exec this: move.sqf _selected = lbData [1500,0]; hint format ["%1",_selected]; Share this post Link to post Share on other sites
Horner 13 Posted July 5, 2014 You have to use lbSetData first when adding the listbox rows, otherwise there will be no data to grab. Share this post Link to post Share on other sites
Icaruk 14 Posted July 5, 2014 You have to use lbSetData first when adding the listbox rows, otherwise there will be no data to grab. But I need to set 2 values, name of the item (variable) and quantity :/ Share this post Link to post Share on other sites
Deadfast 43 Posted July 5, 2014 For the quantity you can use lbSetValue/lbValue. Share this post Link to post Share on other sites
Horner 13 Posted July 5, 2014 But I need to set 2 values, name of the item (variable) and quantity :/ This can be accomplished by setting an array. Such as... lbSetData [1500, 0, str (["Log", 1])]; Then use lbData like so... _data = call compile (lbData [1500, 0]); //Returns actual array _item = _data select 0; _amount = _data select 1; Share this post Link to post Share on other sites
Icaruk 14 Posted July 6, 2014 This can be accomplished by setting an array. Such as... lbSetData [1500, 0, str (["Log", 1])]; Then use lbData like so... _data = call compile (lbData [1500, 0]); //Returns actual array _item = _data select 0; _amount = _data select 1; I'll try, thanks! Share this post Link to post Share on other sites