iwd: more gcw syncing with bg2 - actonpc and dragging
[gemrb.git] / gemrb / GUIScripts / bg2 / StartOpt.py
blob966dfa8646e0f8bee3aeea39c03a37a91fe5141c
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 import GemRB
21 OptionsWindow = 0
23 def OnLoad():
24 global OptionsWindow
25 GemRB.LoadWindowPack("GUIOPT", 640, 480)
26 OptionsWindow = GemRB.LoadWindow(13)
27 OptionsWindow.SetFrame ()
28 SoundButton = OptionsWindow.GetControl(8)
29 GameButton = OptionsWindow.GetControl(9)
30 GraphicButton = OptionsWindow.GetControl(7)
31 BackButton = OptionsWindow.GetControl(11)
32 SoundButton.SetStatus(IE_GUI_BUTTON_ENABLED)
33 GameButton.SetStatus(IE_GUI_BUTTON_ENABLED)
34 GraphicButton.SetStatus(IE_GUI_BUTTON_ENABLED)
35 BackButton.SetStatus(IE_GUI_BUTTON_ENABLED)
36 SoundButton.SetText(17164)
37 GameButton.SetText(17165)
38 GraphicButton.SetText(17162)
39 BackButton.SetText(10308)
40 SoundButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, SoundPress)
41 GameButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, GamePress)
42 GraphicButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, GraphicPress)
43 BackButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, BackPress)
44 BackButton.SetFlags (IE_GUI_BUTTON_CANCEL, OP_OR)
45 OptionsWindow.SetVisible(WINDOW_VISIBLE)
46 return
48 def SoundPress():
49 if OptionsWindow:
50 OptionsWindow.Unload()
51 GemRB.SetNextScript("GUIOPT7")
52 return
54 def GamePress():
55 if OptionsWindow:
56 OptionsWindow.Unload()
57 GemRB.SetNextScript("GUIOPT8")
58 return
60 def GraphicPress():
61 if OptionsWindow:
62 OptionsWindow.Unload()
63 GemRB.SetNextScript("GUIOPT6")
64 return
66 def BackPress():
67 if OptionsWindow:
68 OptionsWindow.Unload()
69 GemRB.SetNextScript("Start")
70 return