Hi again, got stuck again
I have a dialog and 2 combobox controls on it.
Combobox 1 (idc 1701) has the following items: [A, B, C]
Based on the selection the player makes, the second combobox (idc 1702) displays an according list
(e.g.
If A was selected, the second combo list woud be A1, A2, A3...
If B was selected, the second combo list woud be B1, B2, B3...)
I managed to do this, but if the player changes again the first list, the second one doesn't update.
Maybe LBSelChanged is the solution, but I am clueless with ctrlSetEventHandler.
Here it is the code:
_ok = createDialog "GadCreateEnemyDialog";
// Seleccionador de tipo de unidades a crear (infanterĂa, grupos, vehĂculos, etc.)
for [{_i = 0}, {_i < count GadTypeToSpawnArray}, {_i = _i + 1}] do {
_item = GadTypeToSpawnArray select _i;
_index = lbadd [1701,_item];
};
waitUntil {lbcursel 1701 != -1;};
currentType = lbcursel 1701;
switch (lbcursel 1701) do {
case 0: {GadElementsToSpawnArray = GadInfantryToSpawnArray;};
case 1: {GadElementsToSpawnArray = GadGruposToSpawnArray;};
case 2: {GadElementsToSpawnArray = GadVehiclesToSpawnArray;};
};
for [{_i = 0}, {_i < count GadElementsToSpawnArray}, {_i = _i + 1}] do {
_item = GadElementsToSpawnArray select _i;
_index = lbadd [1702,_item];
};