Home   Help Search Login Register  

Author Topic: ION_DialogShowModal  (Read 5007 times)

0 Members and 1 Guest are viewing this topic.

Offline i0n0s

  • Moderator
  • *****
Re: ION_DialogShowModal
« Reply #15 on: 10 May 2009, 19:52:59 »
New version:
   2.0 Beta

Changelog:
   Merged Draggable into RegisterDialog
   Changed parameter for RegisterDisplay
   ShowModal has "nowait" parameter for directly return after creating the dialog
   Show now adds a dialog to the open dialogs. The previous active dialogs are still active too.
   Added context menu :D

The parameters have changed. And I've added a context menu.
An example is not included, but here is example code from the RTE:
Code: [Select]
//structure of the context menu array:
_CM_Unit = ["UNIT", //menu identifier
["Edit unit", {
//code which runs after click on the entry
}
],
["Set unit position ...", ["UNIT_POS", //sub menu, structure stays the same
["Up", {}],
["Middle", {}],
["Down", {}],
["Auto", {}]
]],
["Revive unit", {ION_RTE_CM_Unit call ION_RTE_fRevive}],
["Switch to unit", {ION_RTE_CM_Unit call ION_RTE_pSwitchToPlayer}]
];

Code: [Select]
["Unit", _CM_Unit, {
if (_this select 0 == "UNIT") then { //only in main context menu, not in "UNIT_POS" sub menu
if (alive ION_RTE_CM_Unit) then {
(_this select 3) set [1, 2]; //Hide "Revive Unit"
} else {
(_this select 4) set [1, 1]; //Disable "Switch to Unit"
};
};
_this
}] call ION_DSM_CM_Register;