factored out the EFFv2 saving into EFFImporter
[gemrb.git] / gemrb / GUIScripts / CommonTables.py
blobcda3f9589c769274f868038756a5c9e7f4f409f1
1 # -*-python-*-
2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003 The GemRB Project
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # the place for preloading the most commonly used tables
20 import GemRB
21 from ie_restype import RES_2DA
23 # these two are only used in SetEncumbranceLabels, but that is called very often
24 StrMod = StrModEx = None
25 Classes = KitList = ClassSkills = Races = NextLevel = None
26 Pdolls = None
28 def Load():
29 global Classes, KitList, ClassSkills, Races, NextLevel
30 global Pdolls, StrModEx, StrMod
32 print # so the following output isn't appended to an existing line
33 if not Classes:
34 Classes = GemRB.LoadTable ("classes")
35 if not KitList and GemRB.HasResource("kitlist", RES_2DA):
36 KitList = GemRB.LoadTable ("kitlist")
37 if not ClassSkills:
38 ClassSkills= GemRB.LoadTable ("clskills")
39 if not Races:
40 Races = GemRB.LoadTable ("races")
41 if not NextLevel:
42 NextLevel = GemRB.LoadTable ("xplevel")
43 if not Pdolls and GemRB.HasResource("pdolls", RES_2DA):
44 Pdolls = GemRB.LoadTable ("pdolls")
45 if not StrMod:
46 StrMod = GemRB.LoadTable ("strmod")
47 StrModEx = GemRB.LoadTable ("strmodex")