aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/menu/UDisplay.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-04 07:29:52 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-04 07:29:52 +0000
commit14e96597c65a2402ee4ddc068ff08c7659123a1d (patch)
treeebefcbd5ec72570f68bb7b043365b3d6fb93dd6b /Lua/src/menu/UDisplay.pas
parent2449e4a979c23addcc9110a4dc876d9acd761005 (diff)
downloadusdx-14e96597c65a2402ee4ddc068ff08c7659123a1d.tar.gz
usdx-14e96597c65a2402ee4ddc068ff08c7659123a1d.tar.xz
usdx-14e96597c65a2402ee4ddc068ff08c7659123a1d.zip
old lua test stuff by hawkear removed or commented
new function: Party.SetWinner sets winner of current round new unit ULuaUtils w/ some functions that are or may become useful moved Lua_ClearStack and Lua_ToBinInt to ULuaUtils added first hooks (have a look at hooks.txt in game/plugins until documentation is finished) lua module for TextGl written and finished lua testfile (game/scripts/main.lua) ported to new interface, see game/plugins/LuaTest.usdx git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1709 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua/src/menu/UDisplay.pas')
-rw-r--r--Lua/src/menu/UDisplay.pas22
1 files changed, 20 insertions, 2 deletions
diff --git a/Lua/src/menu/UDisplay.pas b/Lua/src/menu/UDisplay.pas
index 1730406f..525b73a9 100644
--- a/Lua/src/menu/UDisplay.pas
+++ b/Lua/src/menu/UDisplay.pas
@@ -40,7 +40,8 @@ uses
gl,
glu,
SysUtils,
- UMusic;
+ UMusic,
+ UHookableEvent;
type
TDisplay = class
@@ -61,6 +62,9 @@ type
OSD_LastError : String;
+ ePreDraw: THookableEvent;
+ eDraw: THookableEvent;
+
procedure DrawDebugInformation;
public
NextScreen : PMenu;
@@ -131,6 +135,10 @@ begin
//Set LastError for OSD to No Error
OSD_LastError := 'No Errors';
+
+ // create events for plugins
+ ePreDraw := THookableEvent.Create('Display.PreDraw');
+ eDraw := THookableEvent.Create('Display.Draw');
end;
destructor TDisplay.Destroy;
@@ -183,6 +191,7 @@ begin
if (not assigned(NextScreen)) and (not BlackScreen) then
begin
+ ePreDraw.CallHookChain(false);
CurrentScreen.Draw;
//popup mod
@@ -197,6 +206,8 @@ begin
FadeEnabled := True
else if (Ini.ScreenFade = 0) then
FadeEnabled := False;
+
+ eDraw.CallHookChain(false);
end
else
begin
@@ -215,8 +226,11 @@ begin
glPushAttrib(GL_VIEWPORT_BIT);
glViewPort(0, 0, 512, 512);
+
// draw screen that will be faded
+ ePreDraw.CallHookChain(false);
CurrentScreen.Draw;
+ eDraw.CallHookChain(false);
// clear OpenGL errors, otherwise fading might be disabled due to some
// older errors in previous OpenGL calls.
@@ -255,7 +269,11 @@ begin
// blackscreen-hack
if not BlackScreen then
- NextScreen.Draw // draw next screen
+ begin
+ ePreDraw.CallHookChain(false);
+ NextScreen.Draw; // draw next screen
+ eDraw.CallHookChain(false);
+ end
else if ScreenAct = 1 then
begin
glClearColor(0, 0, 0 , 0);