[Add] Ugly hack to allow modifying special tech1.

This commit is contained in:
Allanis 2013-08-03 11:44:06 +01:00
parent 22d3be7a34
commit eff81d7163

View File

@ -452,8 +452,10 @@ class Space:
# Tech. # Tech.
try: try:
self.__pwidget("spiTech0").set_text(str(planet["general"]["tech"]["main"])) self.__pwidget("spiTech0").set_text(str(planet["general"]["tech"]["main"]))
self.__pwidget("spiTech1").set_text(str(planet["general"]["tech"]["special"]))
except: except:
self.__pwidget("spiTech0").set_text(str(0)) self.__pwidget("spiTech0").set_text(str(0))
self.__pwidget("spiTech1").set_text(str(0))
# Services. # Services.
services = int(planet["general"]["services"]) services = int(planet["general"]["services"])
@ -560,15 +562,24 @@ class Space:
planet["general"]["services"] = services planet["general"]["services"] = services
# Get the techs. # Get the techs.
tech0 = self.__pwidget("spiTech0").get_text() tech = self.__pwidget("spiTech0").get_text()
if tech0 > 0: if tech > 0:
try: try:
planet["general"]["tech"]["main"] = tech0 planet["general"]["tech"]["main"] = tech
except: except:
planet["general"]["tech"] = {} planet["general"]["tech"] = {}
planet["general"]["tech"]["main"] = tech0 planet["general"]["tech"]["main"] = tech
else: else:
del planet["general"]["tech"]["main"] del planet["general"]["tech"]["main"]
tech = self.__pwidget("spiTech1").get_text()
if tech > 0:
try:
planet["general"]["tech"]["special"] = tech
except:
planet["general"]["tech"] = {}
planet["general"]["tech"]["special"] = tech
else:
del planet["general"]["tech"]["special"]
def __sinpStore(self, system, wgt, tag, minortag=None): def __sinpStore(self, system, wgt, tag, minortag=None):
text = self.__swidget(wgt).get_text() text = self.__swidget(wgt).get_text()