diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-05-02 15:29:37 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-05-02 15:29:37 +0000 |
commit | 94e4421ad3a7615c7ce91beff95634c98b4edd49 (patch) | |
tree | 7bcebb5913b9eb02757a6acabaf6274d3d82a51b /Lua/src/menu | |
parent | d2c6680bc0c2354b6c972402951b6118bf6843af (diff) | |
download | usdx-94e4421ad3a7615c7ce91beff95634c98b4edd49.tar.gz usdx-94e4421ad3a7615c7ce91beff95634c98b4edd49.tar.xz usdx-94e4421ad3a7615c7ce91beff95634c98b4edd49.zip |
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
Diffstat (limited to 'Lua/src/menu')
-rw-r--r-- | Lua/src/menu/UDisplay.pas | 28 |
1 files changed, 28 insertions, 0 deletions
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; |