DOSUB "DEFINES.KXL" clear dbox, $$levelsets, displevels, levnums $progname = "Level Set Display v0.9" // DMH 180208 // This program displays a list of saved level sets and then displays the selected set n = -1 LevelSetList $$levelsets $$levelsets[0] = "default" // fill it in for the list box dg_init_dialog 25, 80, 5, $progname, 0 , 0, 4, 0 dbox = @ERROR dg_add_button dbox, 0, 21, 33, 14, "&Cancel", 0, 0, DG_CANCEL | DG_DEFAULT dg_add_list dbox, 1, 4, 4, 15, 70, 0, $$levelsets, 0, 0, DG_RET_ON_SEL dg_add_note dbox, 2, 1.5, 4, "Select level set to display:" dg_draw_dialog dbox dg_run_dialog dbox dg_get_list dbox, 1 n = @error dg_erase_dialog dbox dg_free_dialog dbox if (n >= 0) goto showlevels goto end :showlevels $$levelsets[0] = "" // clear it back out because really the default set is unnamed LevelSetGetDisplayedLevels $$levelsets[n], displevels numlevs = sizeof(displevels) if (numlevs < 1) Goto badlevset slist $$levnums[numlevs] l = 0 $levs = "" :loop if (l>0) StrCat $levs, "," getlevelinfo displevels[l], $name, $curlev StrCat $levs, $curlev l = l + 1 if (l < numlevs) goto loop LevelMod NDISP LevelMod PDISP, $levs notestate goto end :badlevset Pause "Bad level set... exiting!" :end clear dbox, $$levelsets, displevels, levnumsm, n, l, curlev, levs