got everything up to the point that it matches what's in the C++ version of the position tool

develop
doomchild 2011-03-29 10:38:29 -05:00
parent f1bb4a4661
commit d0cd969ed2
1 changed files with 50 additions and 3 deletions

@ -13,9 +13,56 @@ if not df.attach():
gui = df.gui gui = df.gui
print "view coords: %s" % (gui.view_coords,) if gui is not None:
print "cursor coords: %s" % (gui.cursor_coords,) maps = df.maps
print "window size: %s" % (gui.window_size,) world = df.world
have_maps = maps.start()
world.start()
gm = world.read_game_mode()
if gm is not None:
print gm
date_tuple = (world.read_current_year(), world.read_current_month(), world.read_current_day(), world.read_current_tick())
print "Year: %d Month: %d Day: %d Tick: %d" % date_tuple
v_coords = gui.get_view_coords()
c_coords = gui.get_cursor_coords()
w_coords = (-1, -1, -1)
world_pos_string = ""
if have_maps is True:
w_coords = maps.getPosition()
x = (v_coords[0] + w_coords[0]) * 48
y = (v_coords[1] + w_coords[1]) * 48
z = (v_coords[2] + w_coords[2])
world_pos_string = " world: %d/%d/%d" % (x, y, z)
print "Map world offset: %d/%d/%d embark squares" % w_coords
if v_coords != (-1, -1, -1):
print "view coords: %d/%d/%d" % v_coords
if have_maps is True:
print world_pos_string
if c_coords != (-1, -1, -1):
print "cursor coords: %d/%d/%d" % c_coords
if have_maps is True:
print world_pos_string
window_size = gui.get_window_size()
if window_size != (-1, -1):
print "window size : %d %d" % window_size
else:
print "cursor and window parameters are unsupported on your version of DF"
if not df.detach(): if not df.detach():
print "Unable to detach!" print "Unable to detach!"