Jump to content
Sign in to follow this  
Gameadd1cted

How to update a dialog in real time

Recommended Posts

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];
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×