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.
20 from GUIDefines
import *
25 SinglePlayerButton
= 0
30 global StartWindow
, QuitWindow
31 global ExitButton
, MultiPlayerButton
, MoviesButton
, SinglePlayerButton
33 skip_videos
= GemRB
.GetVar ("SkipIntroVideos")
35 GemRB
.PlayMovie ('BG4LOGO',1)
36 GemRB
.PlayMovie ('TSRLOGO',1)
37 GemRB
.PlayMovie ('BILOGO',1)
38 GemRB
.PlayMovie ('INFELOGO',1)
39 GemRB
.PlayMovie ('INTRO',1)
40 GemRB
.SetVar ("SkipIntroVideos", 1)
42 GemRB
.LoadWindowPack("START")
45 QuitWindow
= GemRB
.LoadWindow(3)
46 QuitTextArea
= QuitWindow
.GetControl(0)
47 CancelButton
= QuitWindow
.GetControl(2)
48 ConfirmButton
= QuitWindow
.GetControl(1)
49 QuitTextArea
.SetText(19532)
50 CancelButton
.SetText(13727)
51 ConfirmButton
.SetText(15417)
52 ConfirmButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, ExitConfirmed
)
53 CancelButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, ExitCancelled
)
54 ConfirmButton
.SetFlags (IE_GUI_BUTTON_DEFAULT
, OP_OR
)
55 CancelButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
58 StartWindow
= GemRB
.LoadWindow(0)
59 SinglePlayerButton
= StartWindow
.GetControl(0)
60 MultiPlayerButton
= StartWindow
.GetControl(1)
61 MoviesButton
= StartWindow
.GetControl(2)
62 ExitButton
= StartWindow
.GetControl(3)
66 GemRB
.LoadMusicPL("Theme.mus")
69 def SinglePlayerPress():
71 SinglePlayerButton
.SetText(13728)
72 MultiPlayerButton
.SetText(13729)
73 MoviesButton
.SetText(24110)
74 ExitButton
.SetText(15416)
75 MultiPlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, LoadSingle
)
76 SinglePlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, NewSingle
)
77 MoviesButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, MissionPack
)
78 ExitButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, BackToMain
)
79 ExitButton
.SetFlags(IE_GUI_BUTTON_CANCEL
, OP_OR
)
80 if GemRB
.GetString(24110) == "": # TODO: better way to detect lack of mission pack?
81 MoviesButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_OR
)
84 def MultiPlayerPress():
86 SinglePlayerButton
.SetText(11825)
87 MultiPlayerButton
.SetText(20642)
88 MoviesButton
.SetText(15416)
89 ExitButton
.SetText("")
90 SinglePlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, PregenPress
)
91 MultiPlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, ConnectPress
)
92 MoviesButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, BackToMain
)
93 MoviesButton
.SetFlags(IE_GUI_BUTTON_CANCEL
, OP_OR
)
94 ExitButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, None)
95 ExitButton
.SetStatus(IE_GUI_BUTTON_DISABLED
)
96 ExitButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_SET
)
108 GemRB
.SetVar("PlayMode",0) #loadgame needs this hack
109 GemRB
.SetVar("Slot",1)
111 GemRB
.SetVar("PlayMode",-1)
112 GemRB
.SetNextScript("CharGen")
120 GemRB
.SetVar("PlayMode",0)
121 GemRB
.SetNextScript("GUILOAD")
129 GemRB
.SetVar("PlayMode",3) #use mpsave for saved games
130 GemRB
.SetNextScript("GUILOAD")
138 GemRB
.SetVar("PlayMode",0)
139 GemRB
.SetVar("Slot",1)
141 GemRB
.SetNextScript("CharGen") #temporarily
145 StartWindow
.SetVisible(WINDOW_INVISIBLE
)
146 QuitWindow
.SetVisible(WINDOW_VISIBLE
)
154 #apparently the order is important
159 GemRB
.SetNextScript("GUIMOVIE")
163 QuitWindow
.SetVisible(WINDOW_INVISIBLE
)
164 StartWindow
.SetVisible(WINDOW_VISIBLE
)
168 SinglePlayerButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
169 MultiPlayerButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
170 MoviesButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
171 ExitButton
.SetStatus(IE_GUI_BUTTON_ENABLED
)
172 SinglePlayerButton
.SetText(15413)
173 MultiPlayerButton
.SetText(15414)
174 MoviesButton
.SetText(15415)
175 ExitButton
.SetText(15417)
176 SinglePlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, SinglePlayerPress
)
177 MultiPlayerButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, MultiPlayerPress
)
178 MoviesButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, MoviesPress
)
179 ExitButton
.SetEvent(IE_GUI_BUTTON_ON_PRESS
, ExitPress
)
180 MoviesButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_NAND
)
181 ExitButton
.SetFlags(IE_GUI_BUTTON_NO_IMAGE
, OP_NAND
)
182 ExitButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
184 QuitWindow
.SetVisible(WINDOW_INVISIBLE
)
185 StartWindow
.SetVisible(WINDOW_VISIBLE
)