Jump to content

[SOLVED] Callback with parameters of more than one


photo

Recommended Posts

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.

 

Link to comment

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"
}

 

Link to comment
×
×
  • Create New...