2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003 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 ###################################################
25 from GUIDefines
import *
31 Table
= GemRB
.LoadTable ("areaload")
32 Area
= GemRB
.GetGameString (STR_AREANAME
)
33 LoadPic
= Table
.GetValue (Area
, Table
.GetColumnName(0) )
35 Picture
.SetPicture(LoadPic
)
38 def StartLoadScreen ():
39 global LoadScreen
, Picture
41 GemRB
.LoadWindowPack ("guils", 800, 600)
42 LoadScreen
= GemRB
.LoadWindow (0)
43 LoadScreen
.SetFrame( )
45 LoadPic
= GemRB
.GetGameString (STR_LOADMOS
)
47 LoadPic
= "GUILS0"+str(GemRB
.Roll(1,9,0))
48 LoadScreen
.SetPicture(LoadPic
)
50 GemRB
.SetVar ("Progress", Progress
)
52 Table
= GemRB
.LoadTable ("loadhint")
53 tmp
= Table
.GetRowCount ()
54 tmp
= GemRB
.Roll (1,tmp
,0)
55 HintStr
= Table
.GetValue (tmp
, 0)
56 TextArea
= LoadScreen
.GetControl (2)
57 TextArea
.SetText (HintStr
)
59 Picture
= LoadScreen
.GetControl (4)
61 Bar
= LoadScreen
.GetControl (0)
62 Bar
.SetVarAssoc ("Progress", Progress
)
63 Bar
.SetEvent (IE_GUI_PROGRESS_END_REACHED
, EndLoadScreen
)
64 LoadScreen
.SetVisible (WINDOW_VISIBLE
)
68 Skull
= LoadScreen
.GetControl (3)
69 Skull
.SetMOS ("GTRBPSK2")
70 LoadScreen
.SetVisible (WINDOW_VISIBLE
)