DEADSOFTWARE

gui: close menu before show loadscreen
[d2df-sdl.git] / src / game / g_window.pas
1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../shared/a_modes.inc}
16 unit g_window;
18 interface
20 procedure g_Game_ClearLoading;
21 procedure g_Game_SetLoadingText (const text: String; maxval: Integer; rewrite: Boolean);
22 procedure g_Game_StepLoading (value: Integer = -1);
24 procedure ProcessLoading (forceUpdate: Boolean=false);
26 implementation
28 uses
29 {$IFDEF ENABLE_RENDER}
30 r_render,
31 {$ENDIF}
32 {$IFDEF ENABLE_SYSTEM}
33 g_system,
34 {$ENDIF}
35 {$IFDEF ENABLE_MENU}
36 g_gui,
37 {$ENDIF}
38 e_sound, g_net
39 ;
41 procedure ProcessLoading (forceUpdate: Boolean = False);
42 begin
43 {$IFDEF ENABLE_MENU}
44 g_ActiveWindow := nil;
45 {$ENDIF}
46 {$IFDEF ENABLE_RENDER}
47 r_Render_DrawLoading(forceUpdate);
48 {$ENDIF}
49 end;
51 procedure g_Game_ClearLoading;
52 begin
53 {$IFDEF ENABLE_MENU}
54 g_ActiveWindow := nil;
55 {$ENDIF}
56 {$IFDEF ENABLE_RENDER}
57 r_Render_ClearLoading;
58 {$ENDIF}
59 end;
61 procedure g_Game_SetLoadingText (const text: String; maxval: Integer; rewrite: Boolean);
62 begin
63 {$IFDEF ENABLE_MENU}
64 g_ActiveWindow := nil;
65 {$ENDIF}
66 {$IFDEF ENABLE_RENDER}
67 if maxval < 0 then maxval := 0;
68 r_Render_SetLoading(text, maxval);
69 {$ENDIF}
70 end;
72 procedure g_Game_StepLoading (value: Integer = -1);
73 begin
74 {$IFDEF ENABLE_MENU}
75 g_ActiveWindow := nil;
76 {$ENDIF}
77 {$IFDEF ENABLE_RENDER}
78 if value < 0 then value := 1;
79 r_Render_StepLoading(value);
80 {$ENDIF}
81 end;
83 end.