summaryrefslogtreecommitdiff
path: root/vec2ddes.bmx
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-10-21 01:34:39 +0000
committerIan C <ianc@noddybox.co.uk>2005-10-21 01:34:39 +0000
commitc7f1f10d3a27f82de2f68c704fdd3baf08b866e7 (patch)
tree2d64194e252c7e82d99c0676b7be35501fea0e64 /vec2ddes.bmx
parentaf2a9b47a3d44b0980567f16f741ed28b049a3d6 (diff)
Fixed broken line menu
Diffstat (limited to 'vec2ddes.bmx')
-rw-r--r--vec2ddes.bmx96
1 files changed, 47 insertions, 49 deletions
diff --git a/vec2ddes.bmx b/vec2ddes.bmx
index f0c2780..fe0c86a 100644
--- a/vec2ddes.bmx
+++ b/vec2ddes.bmx
@@ -609,7 +609,7 @@ Function DoDesigner(loadfile:String)
EndIf
If mode=NORMAL_MODE And KeyHit(KEY_MOUSERIGHT)
- If sellist.Count()>0
+ If sellist.Count()>1
Select GUIMenu("Point Menu",["Snap to grid","Delete"],MouseX(),MouseY(),pointer)
Case 0
For Local o:TDesPoint=EachIn sellist
@@ -628,60 +628,58 @@ Function DoDesigner(loadfile:String)
Next
sellist.Clear()
EndSelect
- Else
- If sel<>Null
- If IsPoint(sel)
- Select GUIMenu("Point Menu",["Snap to grid","Delete"],MouseX(),MouseY(),pointer)
- Case 0
- sel.Snap()
- Case 1
- Designer.obj.Remove(sel)
-
- For Local d:TDesLine=EachIn Designer.obj
- If d<>Null And (d.p1=sel Or d.p2=sel)
- Designer.obj.Remove(d)
- EndIf
- Next
- End Select
- Else
- Local l:TDesLine=TDesLine(sel)
- Select GUIMenu("Line Menu",["Edit","Snap to grid","Flip","Delete"],MouseX(),MouseY(),pointer)
- Case 0
- l.Edit()
- Case 1
- l.Snap()
- Case 2
- l.FlipNormal()
- Case 3
- Designer.obj.Remove(l)
- End Select
- EndIf
+ ElseIf sel<>Null
+ If IsPoint(sel)
+ Select GUIMenu("Point Menu",["Snap to grid","Delete"],MouseX(),MouseY(),pointer)
+ Case 0
+ sel.Snap()
+ Case 1
+ Designer.obj.Remove(sel)
+
+ For Local d:TDesLine=EachIn Designer.obj
+ If d<>Null And (d.p1=sel Or d.p2=sel)
+ Designer.obj.Remove(d)
+ EndIf
+ Next
+ End Select
Else
- Select GUIMenu("Create Menu",["Create Point","Create Line","Create Points","Create Points (Snapped)","Create Lines"],MouseX(),MouseY(),pointer)
+ Local l:TDesLine=TDesLine(sel)
+ Select GUIMenu("Line Menu",["Edit","Snap to grid","Flip","Delete"],MouseX(),MouseY(),pointer)
Case 0
- Designer.obj.AddLast(TDesPoint.Create(x/scale,y/scale))
+ l.Edit()
Case 1
- sellist.Clear()
- sel=Null
- line_sel=Null
- mode=LINE_MODE
+ l.Snap()
Case 2
- sellist.Clear()
- sel=Null
- mode=DOT_TO_DOT_MODE
+ l.FlipNormal()
Case 3
- sellist.Clear()
- sel=Null
- mode=DOT_TO_DOT_SNAP_MODE
- Case 4
- sellist.Clear()
- sel=Null
- line_sel=Null
- mode=LINE_TO_LINE_MODE
+ Designer.obj.Remove(l)
End Select
- EndIf
- sel=Null
- EndIf
+ EndIf
+ Else
+ Select GUIMenu("Create Menu",["Create Point","Create Line","Create Points","Create Points (Snapped)","Create Lines"],MouseX(),MouseY(),pointer)
+ Case 0
+ Designer.obj.AddLast(TDesPoint.Create(x/scale,y/scale))
+ Case 1
+ sellist.Clear()
+ sel=Null
+ line_sel=Null
+ mode=LINE_MODE
+ Case 2
+ sellist.Clear()
+ sel=Null
+ mode=DOT_TO_DOT_MODE
+ Case 3
+ sellist.Clear()
+ sel=Null
+ mode=DOT_TO_DOT_SNAP_MODE
+ Case 4
+ sellist.Clear()
+ sel=Null
+ line_sel=Null
+ mode=LINE_TO_LINE_MODE
+ End Select
+ EndIf
+ sel=Null
EndIf
SetColor(255,255,255)