vita_de Posted January 15, 2013 Posted January 15, 2013 Hi. How do I file a interfeys.ui the call callback to set more than one parameter? Example: // inventory.ui <button> <text>Buy</text> <callback type="clicked" string="abc" string="50">Game::buy</callback> </button> // game.h void buy (string name, string cost) { // } Thank.
frustum Posted January 15, 2013 Posted January 15, 2013 A workaround: <callback type="clicked" string="abc,50">Game::buy</callback> void buy(string data) { string args[0]; strsplit(data,",",args); //args[0] == "abs" //args[1] == "50" }
vita_de Posted January 15, 2013 Author Posted January 15, 2013 Thank you. And one more question. I can dynamically change these variables? for example: string="abc,50" => string="abc,30"
frustum Posted January 15, 2013 Posted January 15, 2013 You have to reinite the callback for this widget: widget.setCallback(GUI_CLICKED,"buy","abc,30");
Recommended Posts