diff 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
line wrap: on
line diff
--- a/orpg/player_list.py	Wed Aug 12 20:54:46 2009 -0500
+++ b/orpg/player_list.py	Thu Aug 13 04:25:10 2009 -0500
@@ -95,7 +95,7 @@
         self.SetImageList( self._imageList, wx.IMAGE_LIST_SMALL )
         # Create our column headers
         self.InsertColumn( 0, "ID" )
-        self.InsertColumn( 1, "Player" )
+        self.InsertColumn( 1, "Player")
         self.InsertColumn( 2, "Status" )
 #---------------------------------------------------------
 # [START] Digitalxero Multi Whisper Group 1/1/05
@@ -192,6 +192,13 @@
 #
 #       Revised 8/03 to add support for password manager
 #---------------------------------------------------------
+
+    def AutoAdjust(self):
+        self.SetColumnWidth(0, -1)
+        if self.GetColumnWidth(1) < 75: self.SetColumnWidth(1, 75)
+        if self.GetColumnWidth(2) < 75: self.SetColumnWidth(2, 75)
+        self.Refresh()
+
     def on_menu_password( self, evt ):
         id = evt.GetId()
         self.session = open_rpg.get_component("session")
@@ -328,6 +335,7 @@
         roleString = None
         roleBase = "/role %d=%s"
         infoBase = "Attempting to assign the role of %s to (%d) %s..."
+
         # Do type specific processing
 	recycle_bin = {PLAYER_ROLE_LURKER: ROLE_LURKER, PLAYER_ROLE_PLAYER: ROLE_PLAYER, PLAYER_ROLE_GM: ROLE_GM}
 	if recycle_bin.has_key(id):
@@ -449,6 +457,7 @@
         if sound_file != '':
             sound_player = open_rpg.get_component('sound')
             sound_player.play(sound_file)
+        self.AutoAdjust()
 
     def del_player(self,player):
         i = self.FindItemData(-1,int(player[2]))
@@ -492,7 +501,7 @@
         self.SetStringItem(i,2,player[3])
         item = self.GetItem(i)
         self.colorize_player_list()
-        self.Refresh()
+        self.AutoAdjust()
 
     def colorize_player_list(self):
         session = open_rpg.get_component("session")