[Add] <resedit> Changing planet class is supported now.

This commit is contained in:
Allanis 2013-06-22 14:36:03 +01:00
parent dca1a33c36
commit 72f0a93c30

View File

@ -132,6 +132,7 @@ class Space:
"trePlanets":["button-release-event", self.__pupdate],
"comSystem":["changed", self.__pnewSys],
"comFaction":["changed", self.__pnewFact],
"comClass":["changed", self.__class_sel],
"butSave":["clicked", self.savePlanets],
"butComAdd":["clicked", self.__commodity_add],
"butComRm":["clicked", self.__commodity_rm],
@ -334,7 +335,8 @@ class Space:
def __pupdate(self, wgt=None, event=None):
# Store the current values
self.__pstore()
if self.cur_planet != self.__curPlanet():
self.__pstore()
self.__genPlanetTree()
@ -809,6 +811,15 @@ class Space:
self.planets[self.cur_planet]["GFX"]["exterior"] = space
self.__pupdate()
"""
Change the planet class.
"""
def __class_sel(self, wgt=None, event=None):
cls = self.__pwidget("comClass").get_active_text()
if self.cur_planet != "":
self.planets[self.cur_planet]["general"]["class"] = cls
self.__pupdate()
"""
Open the description editor.
"""
@ -905,7 +916,6 @@ class Space:
# Append to new location.
self.systems[sys]["planets"].append(planet)
print self.systems[sys]["planets"]
# Recreate the tree.
self.__genPlanetTree()