From c07c700247d4c70f79d2f7fb9c5b368196d1cf53 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 17 May 2007 09:47:02 +0000 Subject: Added functionality to Cancel Button in ScreenOpen Pressing ESC in ScreenOpen now causes last Screen to be displayed git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@205 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOpen.pas | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Game/Code/Screens/UScreenOpen.pas b/Game/Code/Screens/UScreenOpen.pas index f5e121f9..af984a21 100644 --- a/Game/Code/Screens/UScreenOpen.pas +++ b/Game/Code/Screens/UScreenOpen.pas @@ -35,7 +35,6 @@ begin begin if Interaction = 0 then begin Text[TextN].Text := Text[TextN].Text + chr(ScanCode); - FileName := Text[TextN].Text; end; end; end; @@ -50,18 +49,29 @@ begin if Interaction = 0 then begin Text[TextN].DeleteLastL; - FileName := Text[TextN].Text; end; end; SDLK_ESCAPE: begin - result := false; + //Empty Filename and go to last Screen + FileName := ''; + Music.PlayBack; + FadeTo(BackScreen); end; SDLK_RETURN: begin - if Interaction = 2 then begin + if (Interaction = 2) then begin + //Update Filename and go to last Screen + FileName := Text[TextN].Text; + Music.PlayBack; + FadeTo(BackScreen); + end + else if (Interaction = 1) then + begin + //Empty Filename and go to last Screen + FileName := ''; Music.PlayBack; FadeTo(BackScreen); end; -- cgit v1.2.3