Dialog::~Dialog() { for(int i=0;ODItem *item = ItemAt(i);i++) delete item; optionstack.RemoveItem(this); }
void options_close() { Options::close_objects(); while(FocusHolder *fh = optionstack.ItemAt(0)) delete fh; settings_save(); }
void options_tick() { int i; FocusHolder *fh; if (justpushed(F3KEY)) { game.pause(0); return; } ClearScreen(BLACK); Options::run_and_draw_objects(); fh = optionstack.ItemAt(optionstack.CountItems() - 1); if (fh) { fh->RunInput(); if (game.paused != GP_OPTIONS) return; fh = optionstack.ItemAt(optionstack.CountItems() - 1); if (fh == opt.dismiss_on_focus && fh) { opt.dismiss_on_focus = NULL; delete fh; } } for(i=0;;i++) { fh = optionstack.ItemAt(i); if (!fh) break; fh->Draw(); } _vkey_edit_draw(); if (opt.xoffset > 0) { opt.dlg->offset(SLIDE_SPEED, 0); opt.xoffset -= SLIDE_SPEED; } }
Dialog::Dialog() { onclear = NULL; ondismiss = NULL; fCoords.x = DLG_X; fCoords.y = DLG_Y; fCoords.w = DLG_W; fCoords.h = DLG_H; fTextX = (fCoords.x + 42); fCurSel = 0; fNumShown = 0; fRepeatTimer = 0; optionstack.AddItem(this); }