Mercurial > traipse_dev
diff orpg/mapper/fog_handler.py @ 19:78407d627cba traipse_dev
Beginning of Code Clean-up. Some code untested, may break!
author | sirebral |
---|---|
date | Sat, 25 Jul 2009 17:24:40 -0500 |
parents | 0b8b7e3ed78d |
children | 072ffc1d466f |
line wrap: on
line diff
--- a/orpg/mapper/fog_handler.py Tue Jul 21 05:34:16 2009 -0500 +++ b/orpg/mapper/fog_handler.py Sat Jul 25 17:24:40 2009 -0500 @@ -48,39 +48,26 @@ self.f_type_radio = {} self.fogshow = wx.RadioButton(self, wx.ID_ANY, "Show", style=wx.RB_GROUP) self.foghide = wx.RadioButton(self, wx.ID_ANY, "Hide") - - #self.sizer.Add(self.foghide) - #self.sizer.Add(self.fogshow) - self.sizer.Add(self.foghide, 0, wx.ALIGN_CENTER) self.sizer.Add(self.fogshow, 0, wx.ALIGN_CENTER) - self.sizer.Add(wx.Size(20,25),1) - def build_menu(self,label = "fog"): base_layer_handler.build_menu(self,label) self.main_menu.AppendSeparator() - item = wx.MenuItem(self.main_menu, wx.ID_ANY, "&Hide All", "Hide All") self.canvas.Bind(wx.EVT_MENU, self.on_hideall, item) self.main_menu.AppendItem(item) - item = wx.MenuItem(self.main_menu, wx.ID_ANY, "&Fog Mask", "Fog Mask") self.canvas.Bind(wx.EVT_MENU, self.on_color, item) self.main_menu.AppendItem(item) - item = wx.MenuItem(self.main_menu, wx.ID_ANY, "&Remove Fog Layer", "Remove Fog Layer") self.canvas.Bind(wx.EVT_MENU, self.on_remove, item) self.main_menu.AppendItem(item) - item = wx.MenuItem(self.main_menu, wx.ID_ANY, "&Pen Color", "Pen Color") self.canvas.Bind(wx.EVT_MENU, self.on_pen_color, item) self.main_menu.AppendItem(item) - - - def on_remove(self,evt): session=self.canvas.frame.session if (session.my_role() != session.ROLE_GM): @@ -141,7 +128,6 @@ foglayer = self.canvas.layers['fog'] pass - def on_motion(self, evt): scale = self.canvas.layers['grid'].mapscale dc = wx.ClientDC(self.canvas) @@ -175,7 +161,8 @@ if (session.my_role() != session.ROLE_GM): open_rpg.get_component("chat").InfoPost("You must be a GM to use this feature") else: - # This code sets the mode to either new or del depending on the action to function with the updated createregen code. + # This code sets the mode to either new or del + # depending on the action to function with the updated createregen code. if (self.fogshow.GetValue() == 1): showmode = 'new' else: @@ -187,10 +174,12 @@ pen= wx.Pen(self.pencolor) pen.SetWidth(COURSE/2+1) dc.SetPen(pen) - dc.DrawLine(self.last.x*scale*COURSE,self.last.y*scale*COURSE,self.line[0].X*scale*COURSE,self.line[0].Y*scale*COURSE) + dc.DrawLine(self.last.x*scale*COURSE,self.last.y*scale*COURSE, + self.line[0].X*scale*COURSE,self.line[0].Y*scale*COURSE) dc.SetPen(wx.NullPen) wx.BeginBusyCursor() - # This prevents the divide by zero error by not even sending the line to be proccessed if it contains less then 3 points + # This prevents the divide by zero error by not even + # sending the line to be proccessed if it contains less then 3 points if (len(self.line)>1): self.canvas.layers['fog'].createregn(self.line, showmode) else: