Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20885
Modified Files:
info.py
Log Message:
fixed problems with bool properities of chars.
Index: info.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/info.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** info.py 3 Aug 2004 14:19:53 -0000 1.15
--- info.py 7 Aug 2004 05:35:47 -0000 1.16
***************
*** 22,25 ****
--- 22,30 ----
from wolfpack import *
+ def str2bool( str ):
+ if str.upper() == "TRUE":
+ return True
+ return False
+
def info( socket, command, argstring ):
#args = argstring.split(" ")
***************
*** 202,206 ****
gump.addText( 113, 360, "Position (x,y,z,map):", 0x834 )
gump.addResizeGump( 280, 360, 0xBB8, 215, 20 )
! gump.addInputField( 284, 360, 200, 16, 0x834, 10, unicode( char.pos.x )+","+unicode( char.pos.y )+","+unicode( char.pos.z )+","+unicode( char.pos.map ) )
# 12
gump.addText( 113, 380, "Direction:", 0x834 )
--- 207,211 ----
gump.addText( 113, 360, "Position (x,y,z,map):", 0x834 )
gump.addResizeGump( 280, 360, 0xBB8, 215, 20 )
! gump.addInputField( 284, 360, 200, 16, 0x834, 11, unicode( char.pos.x )+","+unicode( char.pos.y )+","+unicode( char.pos.z )+","+unicode( char.pos.map ) )
# 12
gump.addText( 113, 380, "Direction:", 0x834 )
***************
*** 383,396 ****
gump.addResizeGump( 280, 220, 0xBB8, 215, 20 )
if char.hastag('notoriety'):
! gump.addInputField( 284, 200, 200, 16, 0x834, 42, unicode( char.gettag('notoriety') ) )
else:
! gump.addInputField( 284, 200, 200, 16, 0x834, 42, '' )
# 44
gump.addText( 113, 240, "Poisoned:", 0x834 )
gump.addResizeGump( 280, 240, 0xBB8, 215, 20 )
if char.hastag('poisoned'):
! gump.addInputField( 284, 200, 200, 16, 0x834, 42, unicode( char.gettag('poisoned') ) )
else:
! gump.addInputField( 284, 200, 200, 16, 0x834, 42, '' )
# 45
#gump.addText( 113, 260, ":", 0x834 )
--- 388,401 ----
gump.addResizeGump( 280, 220, 0xBB8, 215, 20 )
if char.hastag('notoriety'):
! gump.addInputField( 284, 200, 200, 16, 0x834, 43, unicode( char.gettag('notoriety') ) )
else:
! gump.addInputField( 284, 200, 200, 16, 0x834, 43, '' )
# 44
gump.addText( 113, 240, "Poisoned:", 0x834 )
gump.addResizeGump( 280, 240, 0xBB8, 215, 20 )
if char.hastag('poisoned'):
! gump.addInputField( 284, 200, 200, 16, 0x834, 44, unicode( char.gettag('poisoned') ) )
else:
! gump.addInputField( 284, 200, 200, 16, 0x834, 44, '' )
# 45
#gump.addText( 113, 260, ":", 0x834 )
***************
*** 570,574 ****
char.direction = int( textentries[ key ] )
elif key == 13:
! char.invulnerable = int( textentries[ key ] )
elif key == 14:
char.strength = int( textentries[ key ] )
--- 575,579 ----
char.direction = int( textentries[ key ] )
elif key == 13:
! char.invulnerable = str2bool( textentries[ key ] )
elif key == 14:
char.strength = int( textentries[ key ] )
***************
*** 590,608 ****
char.mana = int( textentries[ key ] )
elif key == 23:
! char.hidden = int( textentries[ key ] )
elif key == 24:
! char.dead = int( textentries[ key ] )
elif key == 25:
! char.polymorph = int( textentries[ key ] )
elif key == 26:
! char.incognito = int( textentries[ key ] )
elif key == 27:
char.hunger = int( textentries[ key ] )
elif key == 28:
! char.war = int( textentries[ key ] )
elif key == 29:
! char.invisible = int( textentries[ key ] )
elif key == 30:
! char.frozen = int( textentries[ key ] )
elif key == 31:
char.stealthedsteps = int( textentries[ key ] )
--- 595,613 ----
char.mana = int( textentries[ key ] )
elif key == 23:
! char.hidden = str2bool( textentries[ key ] )
elif key == 24:
! char.dead = str2bool( textentries[ key ] )
elif key == 25:
! char.polymorph = str2bool( textentries[ key ] )
elif key == 26:
! char.incognito = str2bool( textentries[ key ] )
elif key == 27:
char.hunger = int( textentries[ key ] )
elif key == 28:
! char.war = str2bool( textentries[ key ] )
elif key == 29:
! char.invisible = str2bool( textentries[ key ] )
elif key == 30:
! char.frozen = str2bool( textentries[ key ] )
elif key == 31:
char.stealthedsteps = int( textentries[ key ] )
|