vsTASKER 7 User Manual
×
Menu
Index

Value List

 
A Value List is a table of (key, value) pairs that can be predefined at design, added or modified using code or user input with mouse and keyboard.
This Sprite does not use texture and is purely OpenGL drawn.
 
 
On the HMI grid, add a Value List:
or
 
Give it a name, then open the property window.
 
You can add some entries manually (or from the code).
Let's do both. First, in the property windows, add the following:
 
then:
 
Add then (Second, 2) then (Three, 3) to get:
 
 
Then, open the Scenario property window and add the following in the START case:
               
int selected_row = get();
if (selected_row > -1) {
   VlistEntry* vl = db->rows[selected_row];
   // get the selected entity
   Vt_Entity* selected_ship = scen()->findEntity(vl->value); // vl->value : ship identifier (name)
   if (selected_ship) {
     ScenarioSpecifications* scenario_specs = (ScenarioSpecifications*)scen()->findPlayer()->findDataModel("ScenarioSpecifications");
     if (scenario_specs) {
       // get the current uav
       Vt_Entity* current_uav = scen()->findEntity(scenario_specs->current_uav_name);
       if (current_uav) target_list->db->add(entity->getName(), entity->getName());
       // first target ? if yes automatic selection