[Change] resedit: Some cleanups in preperation for planet editor.

This commit is contained in:
Allanis 2013-04-16 13:15:20 +01:00
parent 081449b5ea
commit fcd8496fa4
3 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@
import space
# Load the universe.
universe = space.space()
universe = space.Space()
universe.loadSystems("../../dat/ssys.xml")
universe.loadPlanets("../../dat/planet.xml")
universe.window()

View File

@ -11,7 +11,7 @@ except:
import data
class space:
class Space:
def __init__(self):
self.glade = "space.glade"
@ -47,8 +47,8 @@ class space:
# Hook events and stuff.
hooks = {
"winSystems":["destroy",self.__done],
"treSystems":["button-release-event", self.__update],
"inpName":["changed", self.__update],
"treSystems":["button-release-event", self.__supdate],
"inpName":["changed", self.__supdate],
"butDone":["clicked", self.__done],
"butSave":["clicked",self.saveSystems],
"butZoomIn":["clicked", self.__space_zoomin],
@ -118,13 +118,13 @@ class space:
def __pwidget(self, wgtname):
return self.pwtree.get_widget(wgtname)
def __update(self, wgt=None, index=None, iter=None):
def __supdate(self, wgt=None, index=None, iter=None):
"""
Update the window
"""
# Store the current values.
self.__store();
self.__sstore();
self.cur_system = self.__curSystem()
if self.cur_system == "":
@ -159,7 +159,7 @@ class space:
self.__space_draw()
def __store(self):
def __sstore(self):
sys_name = self.__swidget("inpName").get_text()
if sys_name == "":
return
@ -379,7 +379,7 @@ class space:
data.uniq(self.systems[self.cur_system]["jumps"])
data.uniq(self.systems[self.space_sel]["jumps"])
self.__update()
self.__supdate()
self.__space_draw()
def __jump_rm(self, wgt=None, event=None):
@ -394,7 +394,7 @@ class space:
if e == self.cur_system:
self.systems[self.space_sel]["jumps"].pop(i)
i = i + 1
self.__update()
self.__supdate()
self.__space_draw()
def __new(self, wgt=None, event=None):
@ -412,7 +412,7 @@ class space:
for row in tree.get_model():
if row[0] == system:
tree.set_cursor(i)
self.__update()
self.__supdate()
break
i = i+1

Binary file not shown.