It's a useful wrapper over IF:G. You can build your dialog by steps (not in a single call) or using loops. You can check result Value, not item flag. You get item index as result and not bitset. You can select item by its associated value and not by bitmask or position. For instance, for a choice of resources you may set
Item "Gold" = (RES_GOLD), "Ore" = (RES_ORE) and get final result without complex logic. Just try an example from docs.
You can even assign some tag like global variable name to each item and determine the tag of selected item later.
Simple example: select of 4 heroes or Cancel. Assign 4 hero names to items and value will be hero ID. If result value >= 0, then it's hero ID. Fast and simple:
- !?FU(OnAfterErmInstructions);
- !!FU(RadioDlg_Reset):P;
- !!FU(RadioDlg_SetTitle):P^Select your starting hero:^;
- !!FU(RadioDlg_AddCancelButton):P;
- !!FU(RadioDlg_AddItem):P^Orrin^/(HERO_ORRIN);
- !!FU(RadioDlg_AddItem):P^Xeron^/(HERO_XERON);
- !!FU(RadioDlg_AddItem):P^Gird^/(HERO_GIRD);
- !!FU(RadioDlg_AddItem):P^Valeska^/(HERO_VALESKA);
- !!FU(RadioDlg_SelectItemByValue):P(HERO_GIRD);
- !!FU(RadioDlg_Show):P?(item:y)/?(hero:y);
- !!if&(hero)>=(HERO_FIRST);
- !!IF:M^Selected hero: %(hero)^;
- !!en;