Mercurial > traipse_dev
comparison orpg/mapper/fog_handler.py @ 20:072ffc1d466f traipse_dev
2nd attempt. Still untested.
author | sirebral |
---|---|
date | Sat, 25 Jul 2009 19:23:25 -0500 |
parents | 78407d627cba |
children | c54768cffbd4 |
comparison
equal
deleted
inserted
replaced
19:78407d627cba | 20:072ffc1d466f |
---|---|
115 data.SetColour(self.canvas.layers['fog'].color) | 115 data.SetColour(self.canvas.layers['fog'].color) |
116 dlg = wx.ColourDialog(self.canvas, data) | 116 dlg = wx.ColourDialog(self.canvas, data) |
117 if dlg.ShowModal() == wx.ID_OK: | 117 if dlg.ShowModal() == wx.ID_OK: |
118 data = dlg.GetColourData() | 118 data = dlg.GetColourData() |
119 color = data.GetColour() | 119 color = data.GetColour() |
120 if "__WXGTK__" not in wx.PlatformInfo: | 120 if "__WXGTK__" not in wx.PlatformInfo: color = wx.Color(color.Red(), color.Green(), color.Blue(), 128) |
121 color = wx.Color(color.Red(), color.Green(), color.Blue(), 128) | |
122 self.canvas.layers['fog'].color = color | 121 self.canvas.layers['fog'].color = color |
123 dlg.Destroy() | 122 dlg.Destroy() |
124 self.canvas.layers['fog'].fill_fog() | 123 self.canvas.layers['fog'].fill_fog() |
125 self.canvas.Refresh(False) | 124 self.canvas.Refresh(False) |
126 | 125 |
178 self.line[0].X*scale*COURSE,self.line[0].Y*scale*COURSE) | 177 self.line[0].X*scale*COURSE,self.line[0].Y*scale*COURSE) |
179 dc.SetPen(wx.NullPen) | 178 dc.SetPen(wx.NullPen) |
180 wx.BeginBusyCursor() | 179 wx.BeginBusyCursor() |
181 # This prevents the divide by zero error by not even | 180 # This prevents the divide by zero error by not even |
182 # sending the line to be proccessed if it contains less then 3 points | 181 # sending the line to be proccessed if it contains less then 3 points |
183 if (len(self.line)>1): | 182 if (len(self.line)>1): self.canvas.layers['fog'].createregn(self.line, showmode) |
184 self.canvas.layers['fog'].createregn(self.line, showmode) | 183 else: pass |
185 else: | |
186 #print "Error Divide by zero, ignoring this section" | |
187 pass | |
188 wx.EndBusyCursor() | 184 wx.EndBusyCursor() |
189 del dc | 185 del dc |
190 self.canvas.Refresh(False) | 186 self.canvas.Refresh(False) |
191 self.drawing = False | 187 self.drawing = False |