diff orpg/mapper/whiteboard_handler.py @ 66:c54768cffbd4 ornery-dev

Traipse Dev 'OpenRPG' {090818-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: *Unstable* This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. I think the XML files where not removed during testing of Core and switching back.
author sirebral
date Tue, 18 Aug 2009 06:33:37 -0500
parents 072ffc1d466f
children 449a8900f9ac
line wrap: on
line diff
--- a/orpg/mapper/whiteboard_handler.py	Mon Aug 17 06:56:31 2009 -0500
+++ b/orpg/mapper/whiteboard_handler.py	Tue Aug 18 06:33:37 2009 -0500
@@ -261,7 +261,7 @@
     def undo_line(self,evt):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.use_roles()):
-            self.top_frame.openrpg.get_component("chat").InfoPost("You must be a GM to use this feature")
+            self.top_frame.openrpg.get("chat").InfoPost("You must be a GM to use this feature")
             return
         self.canvas.layers['whiteboard'].undo_line()
         dc = self.create_dc()
@@ -272,7 +272,7 @@
     def delete_all_lines(self,evt):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.use_roles()):
-            open_rpg.get_component("chat").InfoPost("You must be a GM to use this feature")
+            component.get("chat").InfoPost("You must be a GM to use this feature")
             return
         dlg = wx.MessageDialog(self, "Are you sure you want to delete all lines?","Delete All Lines",wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
         if dlg.ShowModal() != wx.ID_YES: return
@@ -436,7 +436,7 @@
                 #check to role to make sure user can draw at all....
                 session = self.canvas.frame.session
                 if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-                    open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+                    component.get("chat").InfoPost("You must be either a player or GM to use this feature")
                     self.canvas.Refresh(False)
                 else: line = self.canvas.layers['whiteboard'].add_line(self.line_string,self.upperleft,self.lowerright)
             #resetting variables for next line
@@ -472,7 +472,7 @@
             #check to role to make sure user can draw at all....
             session = self.canvas.frame.session
             if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-                open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+                component.get("chat").InfoPost("You must be either a player or GM to use this feature")
                 self.canvas.Refresh(False)
             else: line = self.canvas.layers['whiteboard'].add_line(self.line_string,self.upperleft,self.lowerright)
         #resetting variables for next line
@@ -566,7 +566,7 @@
             self.drawing = False
             session = self.canvas.frame.session
             if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-                open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+                component.get("chat").InfoPost("You must be either a player or GM to use this feature")
                 self.canvas.Refresh(False)
                 return
         #self.id +=1
@@ -584,7 +584,7 @@
     def on_text_left_down(self, evt):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-            open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+            component.get("chat").InfoPost("You must be either a player or GM to use this feature")
             self.canvas.Refresh(False)
             return
         scale = self.canvas.layers['grid'].mapscale
@@ -618,7 +618,7 @@
     def on_text_right_down(self, evt, dc):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-            open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+            component.get("chat").InfoPost("You must be either a player or GM to use this feature")
             self.canvas.Refresh(False)
             return
         pos = evt.GetLogicalPosition(dc)
@@ -632,7 +632,7 @@
     def on_start_cone(self, evt):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-            open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+            component.get("chat").InfoPost("You must be either a player or GM to use this feature")
             self.canvas.Refresh(False)
             return
         self.cone_start = self.get_snapped_to_logical_pos(evt)
@@ -748,7 +748,7 @@
     def draw_temporary_circle(self, evt):
         session = self.canvas.frame.session
         if (session.my_role() != session.ROLE_GM) and (session.my_role()!=session.ROLE_PLAYER) and (session.use_roles()):
-            open_rpg.get_component("chat").InfoPost("You must be either a player or GM to use this feature")
+            component.get("chat").InfoPost("You must be either a player or GM to use this feature")
             self.canvas.Refresh(False)
             return
         pos = self.get_snapped_to_logical_pos(evt)