From 94e4421ad3a7615c7ce91beff95634c98b4edd49 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 2 May 2009 15:29:37 +0000 Subject: Display.AbortScreenChange added (used in ScreenSing and ScreenPartyOptions) some minor fixes in UParty, ULuaParty and ULuaUsdx adapting of UScreenPartyNewRound, UScreenPartyPlayer and UScreenPartyOption nearly finished git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1705 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Lua/src/menu/UDisplay.pas | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Lua/src/menu') diff --git a/Lua/src/menu/UDisplay.pas b/Lua/src/menu/UDisplay.pas index 86bad12c..1730406f 100644 --- a/Lua/src/menu/UDisplay.pas +++ b/Lua/src/menu/UDisplay.pas @@ -81,6 +81,9 @@ type { fades to specific screen (playing specified sound) } function FadeTo(Screen: PMenu; const aSound: TAudioPlaybackStream = nil): PMenu; + { abort fading to the current screen, may be used in OnShow, or during fade process } + procedure AbortScreenChange; + function Draw: Boolean; end; @@ -311,6 +314,31 @@ begin end; // for end; +{ abort fading to the next screen, may be used in OnShow, or during fade process } +procedure TDisplay.AbortScreenChange; + var + Temp: PMenu; +begin + // this is some kind of "hack" it is based on the + // code that is used to change the screens in TDisplay.Draw + // we should rewrite this whole behaviour, as it is not well + // structured and not well extendable. Also we should offer + // a possibility to change screens to plugins + // change this code when restructuring is done + if (assigned(NextScreen)) then + begin + // we have to swap the screens + Temp := CurrentScreen; + CurrentScreen := NextScreen; + NextScreen := Temp; + + // and call the OnShow procedure of the previous screen + // because it was already called by default fade procedure + NextScreen.OnShow; + + end; +end; + { fades to specific screen (playing specified sound) returns old screen } function TDisplay.FadeTo(Screen: PMenu; const aSound: TAudioPlaybackStream = nil): PMenu; -- cgit v1.2.3