summaryrefslogtreecommitdiff
path: root/designer.bmx
diff options
context:
space:
mode:
Diffstat (limited to 'designer.bmx')
-rw-r--r--designer.bmx56
1 files changed, 55 insertions, 1 deletions
diff --git a/designer.bmx b/designer.bmx
index 0b349a5..9040d63 100644
--- a/designer.bmx
+++ b/designer.bmx
@@ -578,11 +578,20 @@ Function DoDesigner()
Cls
If Designer.grid_check.checked
- SetColor(50,50,128)
For Local x:Int=-400 To 400 Step 20
+ If x=0
+ SetColor(50,50,255)
+ Else
+ SetColor(50,50,128)
+ EndIf
DrawLine(399+x,0,399+x,599)
Next
For Local y:Int=-300 To 300 Step 20
+ If y=0
+ SetColor(50,50,255)
+ Else
+ SetColor(50,50,128)
+ EndIf
DrawLine(0,299+y,799,299+y)
Next
EndIf
@@ -699,6 +708,50 @@ Function TestCallback(w:TWidget)
End Function
Function CheckCallback(w:TWidget)
+ Designer.SaveLevel()
+
+ Local s:String="The following problems were found:"
+ Local ok:Int=True
+ Local m:TList=CreateList()
+ Local p:TList=CreateList()
+
+ Designer.level.CreatePlayfield(m,p)
+
+ If m.Count()+Designer.level.maxmass>MAX_GRAV
+ ok=False
+ s:+"|Too many masses (combining placed and dropped)"
+ EndIf
+
+ Local friends:Int=(Designer.level.placefriend And Designer.level.maxmass>0)
+
+ If Not friends
+ For Local gp:TMass=EachIn m
+ If gp.friend
+ friends=True
+ EndIf
+ Next
+ EndIf
+
+ If Not friends
+ ok=False
+ s:+"|No collector masses (no particles can be captured by player)"
+ EndIf
+
+ If p.Count()>MAX_POINT
+ ok=False
+ s:+"|Too many points (" + p.Count() + " -- maximum is " + MAX_POINT
+ EndIf
+
+ If p.Count()=0
+ ok=False
+ s:+"|No particles to collect!"
+ EndIf
+
+ If Not ok
+ GUINotify(s,GameGFX.pointer)
+ Else
+ GUINotify("Level is valid",GameGFX.pointer)
+ EndIf
End Function
Function LoadCallback(w:TWidget)
@@ -708,6 +761,7 @@ Function LoadCallback(w:TWidget)
Designer.levelset=load
Designer.levelindex=0
Designer.levnum.maxval=Designer.levelset.level.Count()-1
+ Designer.levnum.value=0
Designer.LoadLevel()
EndIf
Catch e:TLevelException