home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add thing name editing.
[plomrogue2]
/
plomrogue
/
commands.py
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index 65b054019b0f38dbb6d492803ec72e821baff28f..a2f98ed1bf989d3195096cf84456815e7da8fc0d 100644
(file)
--- a/
plomrogue/commands.py
+++ b/
plomrogue/commands.py
@@
-237,7
+237,10
@@
def cmd_MAP_LINE(game, big_yx, y, line):
cmd_MAP_LINE.argtypes = 'yx_tuple int:nonneg string'
def cmd_MAP(game, geometry, size):
cmd_MAP_LINE.argtypes = 'yx_tuple int:nonneg string'
def cmd_MAP(game, geometry, size):
- map_geometry_class = globals()['MapGeometry' + geometry]
+ from plomrogue.mapping import MapGeometryHex, MapGeometrySquare
+ map_geometry_class = MapGeometrySquare
+ if geometry == 'Hex':
+ map_geometry_class = MapGeometryHex
game.new_world(map_geometry_class(size))
cmd_MAP.argtypes = 'string:map_geometry yx_tuple:pos'
game.new_world(map_geometry_class(size))
cmd_MAP.argtypes = 'string:map_geometry yx_tuple:pos'
@@
-266,9
+269,17
@@
def cmd_THING(game, big_yx, little_yx, thing_type, thing_id):
game.changed = True
cmd_THING.argtypes = 'yx_tuple yx_tuple:nonneg string:thing_type int:nonneg'
game.changed = True
cmd_THING.argtypes = 'yx_tuple yx_tuple:nonneg string:thing_type int:nonneg'
-def cmd_THING_NAME(game, thing_id, name):
+def cmd_THING_NAME(game, thing_id, name
, connection_id
):
t = game.get_thing(thing_id)
if not t:
raise GameError('thing of ID %s not found' % thing_id)
t.name = name
t = game.get_thing(thing_id)
if not t:
raise GameError('thing of ID %s not found' % thing_id)
t.name = name
+ game.changed = True
cmd_THING_NAME.argtypes = 'int:pos string'
cmd_THING_NAME.argtypes = 'int:pos string'
+
+def cmd_GOD_THING_NAME(game, thing_id, name):
+ t = game.get_thing(thing_id)
+ if not t:
+ raise GameError('thing of ID %s not found' % thing_id)
+ t.name = name
+cmd_GOD_THING_NAME.argtypes = 'int:pos string'