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.
24 SinglePlayerButton
= 0
29 global StartWindow
, QuitWindow
30 global ExitButton
, MultiPlayerButton
, MoviesButton
, SinglePlayerButton
32 skip_videos
= GemRB
.GetVar ("SkipIntroVideos")
34 GemRB
.PlayMovie ('BG4LOGO',1)
35 GemRB
.PlayMovie ('TSRLOGO',1)
36 GemRB
.PlayMovie ('BILOGO',1)
37 GemRB
.PlayMovie ('INFELOGO',1)
38 GemRB
.PlayMovie ('INTRO',1)
39 GemRB
.SetVar ("SkipIntroVideos", 1)
41 GemRB
.LoadWindowPack("START")
44 QuitWindow
= GemRB
.LoadWindow(3)
45 QuitTextArea
= QuitWindow
.GetControl(0)
46 CancelButton
= QuitWindow
.GetControl(2)
47 ConfirmButton
= QuitWindow
.GetControl(1)
48 QuitTextArea
.SetText(19532)
49 CancelButton
.SetText(13727)
50 ConfirmButton
.SetText(15417)
51 ConfirmButton
.SetEventByName(0, "ExitConfirmed")
52 CancelButton
.SetEventByName(0, "ExitCancelled")
53 ConfirmButton
.SetFlags (IE_GUI_BUTTON_DEFAULT
, OP_OR
)
54 CancelButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
57 StartWindow
= GemRB
.LoadWindow(0)
58 SinglePlayerButton
= StartWindow
.GetControl(0)
59 MultiPlayerButton
= StartWindow
.GetControl(1)
60 MoviesButton
= StartWindow
.GetControl(2)
61 ExitButton
= StartWindow
.GetControl(3)
65 GemRB
.LoadMusicPL("Theme.mus")
68 def SinglePlayerPress():
70 SinglePlayerButton
.SetText(13728)
71 MultiPlayerButton
.SetText(13729)
72 MoviesButton
.SetText(24110)
73 ExitButton
.SetText(15416)
74 MultiPlayerButton
.SetEventByName(0, "LoadSingle")
75 SinglePlayerButton
.SetEventByName(0, "NewSingle")
76 MoviesButton
.SetEventByName(0, "MissionPack")
77 ExitButton
.SetEventByName(0, "BackToMain")
78 ExitButton
.SetFlags(IE_GUI_BUTTON_CANCEL
, OP_OR
)
79 if GemRB
.GetString(24110) == "": # TODO: better way to detect lack of mission pack?
80 MoviesButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_OR
)
83 def MultiPlayerPress():
85 SinglePlayerButton
.SetText(11825)
86 MultiPlayerButton
.SetText(20642)
87 MoviesButton
.SetText(15416)
88 ExitButton
.SetText("")
89 SinglePlayerButton
.SetEventByName(0, "PregenPress")
90 MultiPlayerButton
.SetEventByName(0, "ConnectPress")
91 MoviesButton
.SetEventByName(0, "BackToMain")
92 MoviesButton
.SetFlags(IE_GUI_BUTTON_CANCEL
, OP_OR
)
93 ExitButton
.SetEvent(0, None)
94 ExitButton
.SetStatus(IE_GUI_BUTTON_DISABLED
)
95 ExitButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_SET
)
107 GemRB
.SetVar("PlayMode",0) #loadgame needs this hack
108 GemRB
.GameSetExpansion(0)
110 GemRB
.SetVar("PlayMode",-1)
111 GemRB
.SetNextScript("GUIMP")
119 GemRB
.SetVar("PlayMode",0)
120 GemRB
.GameSetExpansion(0)
121 GemRB
.SetNextScript("GUILOAD")
129 GemRB
.SetVar("PlayMode",3) #use mpsave for saved games
130 GemRB
.GameSetExpansion(1)
131 GemRB
.SetNextScript("GUILOAD")
139 GemRB
.SetVar("PlayMode",0)
140 GemRB
.GameSetExpansion(0)
141 GemRB
.SetVar("Slot",1)
143 GemRB
.SetNextScript("CharGen") #temporarily
147 StartWindow
.SetVisible(WINDOW_INVISIBLE
)
148 QuitWindow
.SetVisible(WINDOW_VISIBLE
)
156 #apparently the order is important
161 GemRB
.SetNextScript("GUIMOVIE")
165 QuitWindow
.SetVisible(WINDOW_INVISIBLE
)
166 StartWindow
.SetVisible(WINDOW_VISIBLE
)
170 SinglePlayerButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
171 MultiPlayerButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
172 MoviesButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
173 ExitButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
174 SinglePlayerButton
.SetText(15413)
175 MultiPlayerButton
.SetText(15414)
176 MoviesButton
.SetText(15415)
177 ExitButton
.SetText(15417)
178 SinglePlayerButton
.SetEventByName(IE_GUI_BUTTON_ON_PRESS
, "SinglePlayerPress")
179 MultiPlayerButton
.SetEventByName(IE_GUI_BUTTON_ON_PRESS
, "MultiPlayerPress")
180 MoviesButton
.SetEventByName(IE_GUI_BUTTON_ON_PRESS
, "MoviesPress")
181 ExitButton
.SetEventByName(IE_GUI_BUTTON_ON_PRESS
, "ExitPress")
182 MoviesButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_NAND
)
183 ExitButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_NAND
)
184 ExitButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
186 QuitWindow
.SetVisible(WINDOW_INVISIBLE
)
187 StartWindow
.SetVisible(WINDOW_VISIBLE
)