diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-05-08 19:00:47 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-05-08 19:00:47 +0000 |
commit | b61e647b67ac0d449d764b89b117a3ac8b603403 (patch) | |
tree | f94140bec26b23ff7cc82be4da2c0739d1c16ee1 /Game/Code/Screens/UScreenPopup.pas | |
parent | 67b726eecadbfdc9a02827e8ecab07a5c0762708 (diff) | |
download | usdx-b61e647b67ac0d449d764b89b117a3ac8b603403.tar.gz usdx-b61e647b67ac0d449d764b89b117a3ac8b603403.tar.xz usdx-b61e647b67ac0d449d764b89b117a3ac8b603403.zip |
Readded Q Shortcut (Exit Application) on all Screens
Clean up Popup Code a little bit
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@180 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Screens/UScreenPopup.pas | 101 |
1 files changed, 19 insertions, 82 deletions
diff --git a/Game/Code/Screens/UScreenPopup.pas b/Game/Code/Screens/UScreenPopup.pas index 019632ff..9b71eb9a 100644 --- a/Game/Code/Screens/UScreenPopup.pas +++ b/Game/Code/Screens/UScreenPopup.pas @@ -42,36 +42,6 @@ implementation uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist, UDisplay;
function TScreenPopupCheck.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
- function IsVisible: Boolean;
- begin
- Result := True;
- if (Interactions[Interaction].Typ = 0) then
- begin
- Result := Button[Interactions[Interaction].Num].Visible;
- end
- else if (Interactions[Interaction].Typ = 1) then
- begin
- //Result := Selects[Interactions[Interaction].Num].Visible;
- end
- else if (Interactions[Interaction].Typ = 3) then
- begin
- Result := SelectsS[Interactions[Interaction].Num].Visible;
- end;
- end;
-
- Procedure SelectNext;
- begin
- repeat
- InteractNext;
- until IsVisible;
- end;
-
- Procedure SelectPrev;
- begin
- repeat
- InteractPrev;
- until IsVisible;
- end;
begin
Result := true;
If (PressedDown) Then
@@ -95,6 +65,15 @@ begin begin
case Interaction of
0: begin
+ //Hack to Finish Singscreen correct on Exit with Q Shortcut
+ if (Display.NextScreenWithCheck = NIL) then
+ begin
+ if (Display.ActualScreen = @ScreenSing) then
+ ScreenSing.Finish
+ else if (Display.ActualScreen = @ScreenSingModi) then
+ ScreenSingModi.Finish;
+ end;
+
Display.CheckOK:=True;
end;
1: begin
@@ -106,19 +85,13 @@ begin Result := false;
end;
- SDLK_DOWN: SelectNext;
- SDLK_UP: SelectPrev;
+ SDLK_DOWN: InteractNext;
+ SDLK_UP: InteractPrev;
- SDLK_RIGHT: SelectNext;
- SDLK_LEFT: SelectPrev;
- end;
- end
- else // Key Up
- case PressedKey of
- SDLK_RETURN :
- begin
- end;
+ SDLK_RIGHT: InteractNext;
+ SDLK_LEFT: InteractPrev;
end;
+ end;
end;
constructor TScreenPopupCheck.Create;
@@ -175,36 +148,6 @@ end; // error popup
function TScreenPopupError.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
- function IsVisible: Boolean;
- begin
- Result := True;
- if (Interactions[Interaction].Typ = 0) then
- begin
- Result := Button[Interactions[Interaction].Num].Visible;
- end
- else if (Interactions[Interaction].Typ = 1) then
- begin
- //Result := Selects[Interactions[Interaction].Num].Visible;
- end
- else if (Interactions[Interaction].Typ = 3) then
- begin
- Result := SelectsS[Interactions[Interaction].Num].Visible;
- end;
- end;
-
- Procedure SelectNext;
- begin
- repeat
- InteractNext;
- until IsVisible;
- end;
-
- Procedure SelectPrev;
- begin
- repeat
- InteractPrev;
- until IsVisible;
- end;
begin
Result := true;
If (PressedDown) Then
@@ -228,19 +171,13 @@ begin Result := false;
end;
- SDLK_DOWN: SelectNext;
- SDLK_UP: SelectPrev;
+ SDLK_DOWN: InteractNext;
+ SDLK_UP: InteractPrev;
- SDLK_RIGHT: SelectNext;
- SDLK_LEFT: SelectPrev;
- end;
- end
- else // Key Up
- case PressedKey of
- SDLK_RETURN :
- begin
- end;
+ SDLK_RIGHT: InteractNext;
+ SDLK_LEFT: InteractPrev;
end;
+ end;
end;
constructor TScreenPopupError.Create;
|