comparison orpg/player_list.py @ 61:f3d8101211c4 ornery-dev

Traipse Dev 'OpenRPG' {090813-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: This update completes the front end of the Updater tab. Material is now ready to start adding to the Controls tab, however GUI planning needs to take place first. Player List and Game Server Menu Columns now have a minimum width and the software will refresh to that width on an update, if the column is too small.
author sirebral
date Thu, 13 Aug 2009 04:25:10 -0500
parents 65c5cb9be59c
children c54768cffbd4
comparison
equal deleted inserted replaced
60:3b2cfa13b610 61:f3d8101211c4
93 img = wx.Image(orpg.dirpath.dir_struct["icon"]+"player-whisper.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 93 img = wx.Image(orpg.dirpath.dir_struct["icon"]+"player-whisper.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
94 self._imageList.Add( img ) 94 self._imageList.Add( img )
95 self.SetImageList( self._imageList, wx.IMAGE_LIST_SMALL ) 95 self.SetImageList( self._imageList, wx.IMAGE_LIST_SMALL )
96 # Create our column headers 96 # Create our column headers
97 self.InsertColumn( 0, "ID" ) 97 self.InsertColumn( 0, "ID" )
98 self.InsertColumn( 1, "Player" ) 98 self.InsertColumn( 1, "Player")
99 self.InsertColumn( 2, "Status" ) 99 self.InsertColumn( 2, "Status" )
100 #--------------------------------------------------------- 100 #---------------------------------------------------------
101 # [START] Digitalxero Multi Whisper Group 1/1/05 101 # [START] Digitalxero Multi Whisper Group 1/1/05
102 #--------------------------------------------------------- 102 #---------------------------------------------------------
103 ##Main Menu 103 ##Main Menu
190 #--------------------------------------------------------- 190 #---------------------------------------------------------
191 # [START] Snowdog Password/Room Name altering code 12/02 191 # [START] Snowdog Password/Room Name altering code 12/02
192 # 192 #
193 # Revised 8/03 to add support for password manager 193 # Revised 8/03 to add support for password manager
194 #--------------------------------------------------------- 194 #---------------------------------------------------------
195
196 def AutoAdjust(self):
197 self.SetColumnWidth(0, -1)
198 if self.GetColumnWidth(1) < 75: self.SetColumnWidth(1, 75)
199 if self.GetColumnWidth(2) < 75: self.SetColumnWidth(2, 75)
200 self.Refresh()
201
195 def on_menu_password( self, evt ): 202 def on_menu_password( self, evt ):
196 id = evt.GetId() 203 id = evt.GetId()
197 self.session = open_rpg.get_component("session") 204 self.session = open_rpg.get_component("session")
198 self.password_manager = open_rpg.get_component("password_manager") 205 self.password_manager = open_rpg.get_component("password_manager")
199 self.chat = open_rpg.get_component("chat") 206 self.chat = open_rpg.get_component("chat")
326 self.chat = open_rpg.get_component( "chat" ) 333 self.chat = open_rpg.get_component( "chat" )
327 playerID = self.GetItemData( self.selected_item ) 334 playerID = self.GetItemData( self.selected_item )
328 roleString = None 335 roleString = None
329 roleBase = "/role %d=%s" 336 roleBase = "/role %d=%s"
330 infoBase = "Attempting to assign the role of %s to (%d) %s..." 337 infoBase = "Attempting to assign the role of %s to (%d) %s..."
338
331 # Do type specific processing 339 # Do type specific processing
332 recycle_bin = {PLAYER_ROLE_LURKER: ROLE_LURKER, PLAYER_ROLE_PLAYER: ROLE_PLAYER, PLAYER_ROLE_GM: ROLE_GM} 340 recycle_bin = {PLAYER_ROLE_LURKER: ROLE_LURKER, PLAYER_ROLE_PLAYER: ROLE_PLAYER, PLAYER_ROLE_GM: ROLE_GM}
333 if recycle_bin.has_key(id): 341 if recycle_bin.has_key(id):
334 roleName = recycle_bin[id] 342 roleName = recycle_bin[id]
335 roleString = (roleBase % ( playerID, roleName )) 343 roleString = (roleBase % ( playerID, roleName ))
447 setobj = open_rpg.get_component('settings') 455 setobj = open_rpg.get_component('settings')
448 sound_file = setobj.get_setting("AddSound") 456 sound_file = setobj.get_setting("AddSound")
449 if sound_file != '': 457 if sound_file != '':
450 sound_player = open_rpg.get_component('sound') 458 sound_player = open_rpg.get_component('sound')
451 sound_player.play(sound_file) 459 sound_player.play(sound_file)
460 self.AutoAdjust()
452 461
453 def del_player(self,player): 462 def del_player(self,player):
454 i = self.FindItemData(-1,int(player[2])) 463 i = self.FindItemData(-1,int(player[2]))
455 self.DeleteItem(i) 464 self.DeleteItem(i)
456 465
490 i = self.FindItemData(-1,int(player[2])) # finds the right list box index 499 i = self.FindItemData(-1,int(player[2])) # finds the right list box index
491 self.SetStringItem(i,1,self.strip_html(player)) 500 self.SetStringItem(i,1,self.strip_html(player))
492 self.SetStringItem(i,2,player[3]) 501 self.SetStringItem(i,2,player[3])
493 item = self.GetItem(i) 502 item = self.GetItem(i)
494 self.colorize_player_list() 503 self.colorize_player_list()
495 self.Refresh() 504 self.AutoAdjust()
496 505
497 def colorize_player_list(self): 506 def colorize_player_list(self):
498 session = open_rpg.get_component("session") 507 session = open_rpg.get_component("session")
499 settings = open_rpg.get_component('settings') 508 settings = open_rpg.get_component('settings')
500 mode = settings.get_setting("ColorizeRoles") 509 mode = settings.get_setting("ColorizeRoles")