1 # GemRB - Infinity Engine Emulator
2 # Copyright (C) 2003 The GemRB Project
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #this is essentially Start.py from the SoA game, except for a very small change
27 SinglePlayerButton
= 0
33 global StartWindow
, TutorialWindow
, QuitWindow
34 global ExitButton
, OptionsButton
, MultiPlayerButton
, MoviesButton
, SinglePlayerButton
35 global SinglePlayerButton
37 skip_videos
= GemRB
.GetVar ("SkipIntroVideos")
39 GemRB
.LoadWindowPack("START", 640, 480)
41 TutorialWindow
= GemRB
.LoadWindow (5)
42 TextAreaControl
= TutorialWindow
.GetControl (1)
43 CancelButton
= TutorialWindow
.GetControl (11)
44 PlayButton
= TutorialWindow
.GetControl (10)
45 TextAreaControl
.SetText (44200)
46 CancelButton
.SetText (13727)
47 PlayButton
.SetText (33093)
48 PlayButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, PlayPress
)
49 CancelButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, CancelTut
)
50 PlayButton
.SetFlags (IE_GUI_BUTTON_DEFAULT
, OP_OR
)
51 CancelButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
53 QuitWindow
= GemRB
.LoadWindow (3)
54 QuitTextArea
= QuitWindow
.GetControl (0)
55 CancelButton
= QuitWindow
.GetControl (2)
56 ConfirmButton
= QuitWindow
.GetControl (1)
57 QuitTextArea
.SetText (19532)
58 CancelButton
.SetText (13727)
59 ConfirmButton
.SetText (15417)
60 ConfirmButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ExitConfirmed
)
61 CancelButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ExitCancelled
)
62 ConfirmButton
.SetFlags (IE_GUI_BUTTON_DEFAULT
, OP_OR
)
63 CancelButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
65 StartWindow
= GemRB
.LoadWindow (0)
66 StartWindow
.SetFrame ()
67 #this is the ToB specific part of Start.py
68 if GemRB
.GetVar("oldgame")==1:
69 if GUICommon
.HasTOB():
70 StartWindow
.SetPicture("STARTOLD")
72 GemRB
.PlayMovie ("INTRO15F", 1)
75 GemRB
.PlayMovie ("INTRO", 1)
77 #end ToB specific part
78 SinglePlayerButton
= StartWindow
.GetControl (0)
79 ExitButton
= StartWindow
.GetControl (3)
80 OptionsButton
= StartWindow
.GetControl (4)
81 MultiPlayerButton
= StartWindow
.GetControl (1)
82 MoviesButton
= StartWindow
.GetControl (2)
83 BackButton
= StartWindow
.GetControl (5)
84 StartWindow
.CreateLabel(0x0fff0000, 0,450,640,30, "REALMS", "", 1)
85 Label
=StartWindow
.GetControl (0x0fff0000)
86 Label
.SetText (GEMRB_VERSION
)
87 if not GUICommon
.HasTOB():
88 BackButton
.SetState (IE_GUI_BUTTON_DISABLED
)
89 BackButton
.SetText ("")
91 BackButton
.SetState (IE_GUI_BUTTON_ENABLED
)
92 BackButton
.SetText (15416)
93 SinglePlayerButton
.SetState (IE_GUI_BUTTON_ENABLED
)
94 ExitButton
.SetState (IE_GUI_BUTTON_ENABLED
)
95 OptionsButton
.SetState (IE_GUI_BUTTON_ENABLED
)
96 MultiPlayerButton
.SetState (IE_GUI_BUTTON_ENABLED
)
97 MoviesButton
.SetState (IE_GUI_BUTTON_ENABLED
)
98 SinglePlayerButton
.SetText (15413)
99 ExitButton
.SetText (15417)
100 OptionsButton
.SetText (13905)
101 MultiPlayerButton
.SetText (15414)
102 MoviesButton
.SetText (15415)
103 SinglePlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, SinglePlayerPress
)
104 ExitButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ExitPress
)
105 OptionsButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, OptionsPress
)
106 MultiPlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, MultiPlayerPress
)
107 MoviesButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, MoviesPress
)
108 BackButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, Restart
)
109 ExitButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
110 QuitWindow
.SetVisible (WINDOW_INVISIBLE
)
111 TutorialWindow
.SetVisible (WINDOW_INVISIBLE
)
112 StartWindow
.SetVisible (WINDOW_VISIBLE
)
113 MusicTable
= GemRB
.LoadTable ("songlist")
114 # the table has useless rownames, so we can't search for BG2Theme
115 theme
= MusicTable
.GetValue ("33", "RESOURCE")
116 GemRB
.LoadMusicPL (theme
, 1)
119 def SinglePlayerPress():
121 OptionsButton
.SetText ("")
122 SinglePlayerButton
.SetText (13728)
123 ExitButton
.SetText (15416)
124 MultiPlayerButton
.SetText (13729)
125 MoviesButton
.SetText (33093)
126 MultiPlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, LoadSingle
)
127 SinglePlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, NewSingle
)
128 MoviesButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, Tutorial
)
129 ExitButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, BackToMain
)
130 OptionsButton
.SetState (IE_GUI_BUTTON_DISABLED
)
133 def MultiPlayerPress():
135 OptionsButton
.SetText ("")
136 SinglePlayerButton
.SetText (20642)
137 ExitButton
.SetText (15416)
138 MultiPlayerButton
.SetText ("")
139 MoviesButton
.SetText (11825)
140 MultiPlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, None)
141 SinglePlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ConnectPress
)
142 MoviesButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, PregenPress
)
143 ExitButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, BackToMain
)
144 MultiPlayerButton
.SetState (IE_GUI_BUTTON_DISABLED
)
145 OptionsButton
.SetState (IE_GUI_BUTTON_DISABLED
)
150 #GemRB.SetVar("PlayMode",2)
159 TutorialWindow
.Unload()
160 #do not start game after chargen
161 GemRB
.SetVar("PlayMode",-1) #will allow export
162 GemRB
.SetVar("Slot",0)
164 GemRB
.SetNextScript ("CharGen")
173 TutorialWindow
.Unload()
174 if GemRB
.GetVar ("oldgame") == 0:
175 GemRB
.GameSetExpansion(1)
176 GemRB
.SetVar ("PlayMode", 2)
177 GemRB
.SetVar ("SaveDir", 1)
179 GemRB
.GameSetExpansion(0)
180 GemRB
.SetVar ("PlayMode", 0)
181 GemRB
.SetVar ("SaveDir", 0)
183 GemRB
.SetNextScript ("GUILOAD")
192 TutorialWindow
.Unload()
193 if GemRB
.GetVar ("oldgame") == 0:
194 GemRB
.GameSetExpansion(1)
195 GemRB
.SetVar ("PlayMode", 2)
196 GemRB
.SetVar ("SaveDir", 1)
198 GemRB
.GameSetExpansion(0)
199 GemRB
.SetVar ("PlayMode", 0)
200 GemRB
.SetVar ("SaveDir", 0)
201 GemRB
.SetVar("Slot",1)
203 GemRB
.SetNextScript ("CharGen")
207 StartWindow
.SetVisible (WINDOW_INVISIBLE
)
208 TutorialWindow
.SetVisible (WINDOW_VISIBLE
)
217 TutorialWindow
.Unload()
218 GemRB
.SetVar("PlayMode",1) #tutorial
219 GemRB
.SetVar("SaveDir",0)
220 GemRB
.GameSetExpansion(0)
221 GemRB
.SetVar("Slot",1)
223 GemRB
.SetNextScript ("CharGen")
227 TutorialWindow
.SetVisible (WINDOW_INVISIBLE
)
228 StartWindow
.SetVisible (WINDOW_VISIBLE
)
232 StartWindow
.SetVisible (WINDOW_INVISIBLE
)
233 QuitWindow
.SetVisible (WINDOW_VISIBLE
)
241 #apparently the order is important
247 TutorialWindow
.Unload()
248 GemRB
.SetNextScript ("StartOpt")
252 #apparently the order is important
258 TutorialWindow
.Unload()
259 GemRB
.SetNextScript ("GUIMOVIE")
263 QuitWindow
.SetVisible (WINDOW_INVISIBLE
)
264 StartWindow
.SetVisible (WINDOW_VISIBLE
)
268 SinglePlayerButton
.SetState (IE_GUI_BUTTON_ENABLED
)
269 OptionsButton
.SetState (IE_GUI_BUTTON_ENABLED
)
270 MultiPlayerButton
.SetState (IE_GUI_BUTTON_ENABLED
)
271 SinglePlayerButton
.SetText (15413)
272 ExitButton
.SetText (15417)
273 OptionsButton
.SetText (13905)
274 MultiPlayerButton
.SetText (15414)
275 MoviesButton
.SetText (15415)
276 SinglePlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, SinglePlayerPress
)
277 ExitButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ExitPress
)
278 OptionsButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, OptionsPress
)
279 MultiPlayerButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, MultiPlayerPress
)
280 MoviesButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, MoviesPress
)
281 QuitWindow
.SetVisible (WINDOW_INVISIBLE
)
282 StartWindow
.SetVisible (WINDOW_VISIBLE
)
288 GemRB
.SetNextScript ("Start")