fixed the rest of the functions that needed globalid capabilities
[gemrb.git] / gemrb / GUIScripts / bg2 / LoadScreen.py
blobd3eaebba143bf59183a4db70cbeb88f01ee875c8
1 # -*-python-*-
2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003-2004 The GemRB Project
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # LoadScreen.py - display Loading screen
22 ###################################################
24 import GemRB
25 import GUICommon
26 from GUIDefines import *
28 LoadScreen = None
29 hide = None
31 def SetLoadScreen ():
32 return
34 def StartLoadScreen ():
35 global LoadScreen
37 GemRB.LoadWindowPack ("guils", 640, 480)
38 LoadScreen = GemRB.LoadWindow (0)
39 LoadScreen.SetFrame ()
40 Middle = LoadScreen.GetControl (3)
41 LoadPic = GemRB.GetGameString (STR_LOADMOS)
42 if LoadPic == "":
43 LoadPic = "GTRSK00"+str(GemRB.Roll(1,5,1) )
44 Middle.SetMOS (LoadPic)
45 Progress = 0
46 GemRB.SetVar ("Progress", Progress)
47 if GUICommon.HasTOB():
48 Table = GemRB.LoadTable ("loadh25")
49 else:
50 Table = GemRB.LoadTable ("loadhint")
51 tmp = Table.GetRowCount ()
52 tmp = GemRB.Roll (1,tmp,0)
53 HintStr = Table.GetValue (tmp, 0)
54 TextArea = LoadScreen.GetControl (2)
55 TextArea.SetText (HintStr)
56 Bar = LoadScreen.GetControl (0)
57 Bar.SetVarAssoc ("Progress", Progress)
58 Bar.SetEvent (IE_GUI_PROGRESS_END_REACHED, EndLoadScreen)
59 LoadScreen.SetVisible (WINDOW_VISIBLE)
61 def EndLoadScreen ():
62 LoadScreen.SetVisible (WINDOW_VISIBLE)
63 LoadScreen.Unload()
64 return