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.
28 global MovieWindow
, TextAreaControl
, MoviesTable
, PlayButton
30 GemRB
.LoadWindowPack ("GUIMOVIE", 640, 480)
31 MovieWindow
= GemRB
.LoadWindow (0)
32 MovieWindow
.SetFrame ()
33 TextAreaControl
= MovieWindow
.GetControl (0)
34 PlayButton
= MovieWindow
.GetControl (2)
35 CreditsButton
= MovieWindow
.GetControl (3)
36 DoneButton
= MovieWindow
.GetControl (4)
37 MoviesTable
= GemRB
.LoadTable ("MOVIDESC")
38 for i
in range( MoviesTable
.GetRowCount () ):
39 t
= MoviesTable
.GetRowName (i
)
40 if GemRB
.GetVar (t
)==1:
41 s
= MoviesTable
.GetValue (i
, 0)
42 TextAreaControl
.Append (s
,-1)
43 TextAreaControl
.SetVarAssoc ("MovieIndex",0)
44 TextAreaControl
.SetFlags (IE_GUI_TEXTAREA_SELECTABLE
, OP_NAND
)
45 TextAreaControl
.SetEvent (IE_GUI_TEXTAREA_ON_CHANGE
, MoviePress
)
46 PlayButton
.SetText (17318)
47 CreditsButton
.SetText (15591)
48 DoneButton
.SetText (11973)
49 PlayButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, PlayPress
)
50 PlayButton
.SetStatus (IE_GUI_BUTTON_DISABLED
)
51 CreditsButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, CreditsPress
)
52 DoneButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, DonePress
)
53 MovieWindow
.SetVisible (WINDOW_VISIBLE
)
57 PlayButton
.SetStatus (IE_GUI_BUTTON_ENABLED
)
58 TextAreaControl
.SetFlags (IE_GUI_TEXTAREA_SELECTABLE
,OP_SET
) # show selection
62 s
= GemRB
.GetVar ("MovieIndex")
63 for i
in range( MoviesTable
.GetRowCount () ):
64 t
= MoviesTable
.GetRowName (i
)
65 if GemRB
.GetVar (t
)==1:
67 PlayButton
.SetStatus (IE_GUI_BUTTON_DISABLED
)
68 TextAreaControl
.SetFlags (IE_GUI_TEXTAREA_SELECTABLE
,OP_NAND
) # hide selection
69 s
= MoviesTable
.GetRowName (i
)
70 GemRB
.PlayMovie (s
, 1)
71 MovieWindow
.Invalidate ()
79 GemRB
.SetNextScript ("GUISONGS")
85 if GUICommon
.HasTOB():
86 GemRB
.SetNextScript ("Start2")
88 GemRB
.SetNextScript ("Start")