factored out the EFFv2 saving into EFFImporter
[gemrb.git] / gemrb / GUIScripts / bg1 / GUICG9.py
blob01ef36a46a2fd7cb6be5e7a85d958e15775764cf
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 #character generation, proficiencies (GUICG9)
20 import GemRB
21 import GUICommon
22 from GUIDefines import *
23 from ie_stats import *
24 import CharGenCommon
25 import LUProfsSelection
27 SkillWindow = 0
28 DoneButton = 0
31 def RedrawSkills():
32 ProfsPointsLeft = GemRB.GetVar ("ProfsPointsLeft")
33 if not ProfsPointsLeft:
34 DoneButton.SetState(IE_GUI_BUTTON_ENABLED)
35 else:
36 DoneButton.SetState(IE_GUI_BUTTON_DISABLED)
37 return
39 def OnLoad():
40 global SkillWindow, DoneButton
42 GemRB.LoadWindowPack("GUICG", 640, 480)
43 SkillWindow = GemRB.LoadWindow(9)
45 GUICommon.CloseOtherWindow(SkillWindow.Unload)
47 MyChar = GemRB.GetVar ("Slot")
48 Levels = [GemRB.GetPlayerStat (MyChar, IE_LEVEL), GemRB.GetPlayerStat (MyChar, IE_LEVEL2), \
49 GemRB.GetPlayerStat (MyChar, IE_LEVEL3)]
50 LUProfsSelection.SetupProfsWindow (MyChar, LUProfsSelection.LUPROFS_TYPE_CHARGEN, SkillWindow, RedrawSkills, [0,0,0], Levels,scroll=False,profTableOffset=0)
52 BackButton = SkillWindow.GetControl(77)
53 BackButton.SetText(15416)
54 BackButton.SetFlags (IE_GUI_BUTTON_CANCEL, OP_OR)
55 BackButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, CharGenCommon.BackPress)
57 DoneButton = SkillWindow.GetControl(0)
58 DoneButton.SetText(11973)
59 DoneButton.SetFlags(IE_GUI_BUTTON_DEFAULT,OP_OR)
60 DoneButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, NextPress)
61 DoneButton.SetState(IE_GUI_BUTTON_DISABLED)
63 SkillWindow.ShowModal(MODAL_SHADOW_NONE)
64 return
66 def NextPress():
67 MyChar = GemRB.GetVar ("Slot")
68 LUProfsSelection.ProfsSave(MyChar, LUProfsSelection.LUPROFS_TYPE_CHARGEN)
69 CharGenCommon.next()