From 5bf0ebf274fef28811ab952338bd261bd1dd0fa8 Mon Sep 17 00:00:00 2001 From: b1indy Date: Thu, 3 May 2007 00:19:52 +0000 Subject: added "popups" to ask for confirmation when leaving party mode or game or to display messages (like minor errors) still ugly, needs some theme work git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@157 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMain.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/UMain.pas') diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index c9002a36..69eca419 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -2,7 +2,7 @@ unit UMain; interface uses SDL, UGraphic, UMusic, URecord, UTime, SysUtils, UDisplay, UIni, ULog, ULyrics, UScreenSing, - OpenGL12, zlportio {you can disable it and all PortWriteB calls}, ULCD, ULight, UThemes; + OpenGL12, zlportio {you can disable it and all PortWriteB calls}, ULCD, ULight, UThemes{, UScreenPopup}; type TPlayer = record @@ -112,7 +112,7 @@ begin CheckEvents; // display - Display.Draw; + done:=not Display.Draw; SwapBuffers; // light @@ -156,6 +156,11 @@ Begin End; // With} SDL_KEYDOWN: begin + // popup hack... if there is a visible popup then let it handle input instead of underlying screen + // shoud be done in a way to be sure the topmost popup has preference (maybe error, then check) + if ScreenPopupError <> NIL then if ScreenPopupError.Visible then ScreenPopupError.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, True) else + if ScreenPopupCheck <> NIL then if ScreenPopupCheck.Visible then ScreenPopupCheck.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, True) else + // end of popup hack if (Not Display.ActualScreen^.ParseInput(Event.key.keysym.sym, Event.key.keysym.unicode, True)) then // if (Not Display.ActualScreen^.ParseInput(Event.key.keysym.scancode, True)) then done := true; // exit game -- cgit v1.2.3