This is my first attempt at trying to make a mapping prog, like CShop. I hope I'll be able to finish it!
+ Code Snippetset display mode 800,600,32
sync rate 0
sync on
autocam off
position camera -150,150,0
point camera 0,0,0
set camera range 1,1000000
make matrix 1,10000,10000,100,100
position matrix 1,10000/-2,0,10000/-2
type rect
x1 as integer
x2 as integer
y1 as integer
y2 as integer
z1 as integer
z2 as integer
endtype
dim boxes(100000) as rect
ink rgb(0,0,255),0
xs = 800
ys = 600
xp = 80
yp = 60
`View 1 : XZ
st1x1 = 400
st1y1 = 0
st1x2 = 800
st1y2 = 300
`View 2 : XY
st2x1 = 400
st2y1 = 300
st2x2 = 800
st2y2 = 600
`View 3 : YZ
st3x1 = 0
st3y1 = 300
st3x2 = 400
st3y2 = 600
`View 4 : 3D
st4x1 = 0
st4y1 = 0
st4x2 = 400
st4y2 = 300
` Snap to Grid
ppx# = (xp * 1.0) / (xs * 1.0)
ppy# = (yp * 1.0) / (ys * 1.0)
` Defaults
CurrX1 = 10
CurrX2 = -10
CurrY1 = 10
CurrY2 = 00
CurrZ1 = 10
CurrZ2 = -10
` 3D view : camera
set camera view st4x1,st4y1,st4x2,st4y2
`Grid
grid1 = 65000
grid2 = 65001
make object box grid1,1000000,6,6
make object box grid2,6,6,1000000
color object grid1,rgb(200,0,0)
color object grid2,rgb(200,0,0)
do
` cls rgb(200,200,200)
if mouseclick()=2 and (timer()-exitt) > 500 then goSub Place
set cursor 0,10
text 10,10,"FPS: "+str$(screen fps())
if spacekey() then goSub SaveMap
goSub Display1
goSub Display2
goSub Display3
` *-*
sync
loop
Rem *** Include File: Function.dba ***
Rem Created: 21/06/03 14:27:42
Rem Included in Project: C:Program FilesDark Basic SoftwareDark Basic ProfessionalProjectsMiscdragableedit.dbpro
Function LB(x,y,x2,y2)
line x,y,x2,y
line x,y2,x2,y2
line x,y,x,y2
line x2,y,x2,y2
endfunction
Function Trans(value,pp#)
value = int(value * pp#)*10
EndFunction value
Function Over(x,y,x2,y2)
if mousex() > x and mousey() > y and mousex() < x2 and mousey() < y2 then over = 1 else over = 0
endfunction overRem *** Include File: Placement.dba ***
Rem Created: 21/06/03 14:27:59
Rem Included in Project: C:Program FilesDark Basic SoftwareDark Basic ProfessionalProjectsMiscdragableedit.dbpro
`---------------------------------------
Place:
goSub Place1
goSub Place2
goSub Place3
goSub Cam
return
Place1:
If Over(st1x1,st1y1,st1x2,st1y2)=1
StartX = Trans(mousex(),ppx#)
StartY = Trans(mousey(),ppy#)
goSub Drag
if StartX = EndX and endy = starty then return
jx = st1x2 - st1x1
jy = st1y2 - st1y1
Boxes(NumPlaced).X1 = StartX - st1x1 - (jx / 2)
Boxes(NumPlaced).Y1 = CurrY1 * -1
Boxes(NumPlaced).Z1 = StartY - st1y1 - (jy / 2)
Boxes(NumPlaced).X2 = EndX - st1x1 - (jx / 2)
Boxes(NumPlaced).Y2 = CurrY2 * -1
Boxes(NumPlaced).Z2 = EndY - st1y1 - (jy / 2)
` input boxes(numplaced).x1,o
` input boxes(numplaced).z1,o
` input boxes(numplaced).x2,o
` input boxes(numplaced).z2,o
goSub Add
Inc NumPlaced
endif
return
Place2:
If Over(st2x1,st2y1,st2x2,st2y2)=1
StartX = Trans(mousex(),ppx#)
StartY = Trans(mousey(),ppy#)
goSub Drag
if StartX = EndX and endy = starty then return
jx = st2x2 - st2x1
jy = st2y2 - st2y1
Boxes(NumPlaced).X1 = StartX - st2x1 - (jx / 2)
Boxes(NumPlaced).Y1 = StartY - st2y1 - (jy / 2)
Boxes(NumPlaced).Z1 = CurrZ1 * -1
Boxes(NumPlaced).X2 = EndX - st2x1 - (jx / 2)
Boxes(NumPlaced).Y2 = EndY - st2y1 - (jy / 2)
Boxes(NumPlaced).Z2 = CurrZ2 * -1
` input boxes(numplaced).x1,o
` input boxes(numplaced).z1,o
` input boxes(numplaced).x2,o
` input boxes(numplaced).z2,o
goSub Add
Inc NumPlaced
endif
return
Place3:
If Over(st3x1,st3y1,st3x2,st3y2)=1
StartX = Trans(mousex(),ppx#)
StartY = Trans(mousey(),ppy#)
goSub Drag
if StartX = EndX and endy = starty then return
jx = st3x2 - st3x1
jy = st3y2 - st3y1
Boxes(NumPlaced).X1 = CurrX1 * -1
Boxes(NumPlaced).Y1 = StartY - st3y1 - (jy / 2)
Boxes(NumPlaced).Z1 = StartX - st3x1 - (jx / 2)
Boxes(NumPlaced).X2 = CurrX2 * -1
Boxes(NumPlaced).Y2 = EndY - st3y1 - (jy / 2)
Boxes(NumPlaced).Z2 = EndX - st3x1 - (jx / 2)
` input boxes(numplaced).x1,o
` input boxes(numplaced).z1,o
` input boxes(numplaced).x2,o
` input boxes(numplaced).z2,o
goSub Add
Inc NumPlaced
endif
return
Cam:
rem Control Cam view
if Over(st4x1,st4y1,st4x2,st4y2)=1
bx = mousex()
by = mousey()
cax = camera angle x()
cay = camera angle y()
while mouseclick()<>0
inc cax,mousemovey()
inc cay,mousemovex()
rotate camera cax,cay,0
position mouse bx,by
if upkey()=1 then move camera 0.5
if downkey()=1 then move camera -0.5
sync
endwhile
endif
return
Add:
width = Boxes(NumPlaced).X2 - Boxes(NumPlaced).X1
height = Boxes(NumPlaced).Y2 - Boxes(NumPlaced).Y1
depth = Boxes(NumPlaced).Z2 - Boxes(NumPlaced).Z1
cls
set cursor 0,250
print width
print height
print depth
print "-"
print Boxes(NumPlaced).X1
print Boxes(NumPlaced).Y1
print Boxes(NumPlaced).Z1
Make object box NumPlaced + 1,depth,height,width
position object NumPlaced + 1, (Boxes(NumPlaced).Z1 + (0.5 * depth))*-1,(Boxes(NumPlaced).Y1+ (0.5 * height))*-1,(Boxes(NumPlaced).X1 + (0.5 * width))*-1
set object cull NumPlaced+1,0
return
Drag:
while mouseclick()<>0
EndX = Trans(mousex(),ppx#)
EndY = Trans(mousey(),ppy#)
` print endx
` print endy
`cls rgb(200,200,200)
DrawDotIt(st1x1,st1y1,st1x2,st1y2,"XZ")
for b = 0 to NumPlaced
lb(st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy)
line st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy
next b
goSub display2
goSub display3
lb(StartX,StartY,EndX,EndY)
sync
endwhile
returnRem *** Include File: DisplayVIews.dba ***
Rem Created: 21/06/03 14:28:12
Rem Included in Project: C:Program FilesDark Basic SoftwareDark Basic ProfessionalProjectsMiscdragableedit.dbpro
Display1:
DrawDotIt(st1x1,st1y1,st1x2,st1y2,"XZ")
ink rgb(25,25,255),0
jx = (st1x2 - st1x1)/2
jy = (st1y2 - st1y1)/2
for b = NumPlaced to 0 step -1
if over(st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy)=1
ink rgb(0,255,0),0
else
ink rgb(25,25,255),0
endif
lb(st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy)
line st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy
if over(st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy)=1 and mouseclick()=1
Curr = b
goSub resize1
endif
next b
return
Display2:
DrawDotIt(st2x1,st2y1,st2x2,st2y2,"XY")
ink rgb(25,25,255),0
jx = (st1x2 - st1x1)/2
jy = (st1y2 - st1y1)/2
for b = NumPlaced to 0 step -1
if over(st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy)=1
ink rgb(0,255,0),0
else
ink rgb(25,25,255),0
endif
lb(st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy)
line st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy
if over(st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy)=1 and mouseclick()=1
Curr = b
goSub resize2
endif
next b
return
Display3:
DrawDotIt(st3x1,st3y1,st3x2,st3y2,"ZY")
` ink rgb(25,25,255),0
jx = (st3x2 - st3x1)/2
jy = (st3y2 - st3y1)/2
for b = NumPlaced to 0 step -1
if over(st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy)=1
ink rgb(0,255,0),0
else
ink rgb(25,25,255),0
endif
lb(st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy)
line st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy
if over(st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy)=1 and mouseclick()=1
Curr = b
goSub resize3
endif
next b
return
Function DrawDotIt(st1x1,st1y1,st1x2,st1y2,t$)
rem Background
ink rgb(200,200,200),0
box st1x1,st1y1,st1x2,st1y2
rem Border
ink 0,0
lb(st1x1 ,st1y1 ,st1x2 ,st1y2 )
rem Lines - minor
ink rgb(255,255,255),0
for dx = st1x1+10 to st1x2 step 20
for dy = st1y1+10 to st1y2 step 20
line dx-10,dy,dx+10,dy
line dx,dy-10,dx,dy+10
next dy
next dx
rem Dots - minor
ink rgb(110,110,110),0
for dx = st1x1+10 to st1x2 step 10
for dy = st1y1+10 to st1y2 step 10
dot dx,dy
next dy
next dx
rem Dots - major
ink rgb(0,0,0),0
for dx = st1x1+10 to st1x2 step 20
for dy = st1y1+10 to st1y2 step 20
dot dx,dy
next dy
next dx
rem Root
jx = (st1x2 - st1x1)/2
jy = (st1y2 - st1y1)/2
ink rgb(200,0,0),0
line st1x1+jx,st1y1,st1x1+jx,st1y2
line st1x1,st1y1+jy,st1x2,st1y1+jy
rem Text Label
ink rgb(0,0,200),0
text st1x1+5,st1y1+5,t$
EndFunctionRem *** Include File: Save.dba ***
Rem Created: 21/06/03 16:45:52
Rem Included in Project: C:Program FilesDark Basic SoftwareDark Basic ProfessionalProjectsMiscdragableedit.dbpro
SaveMap:
cls
set cursor 10,400
input "File name: ",n$
open to write 1,n$
write string 1,"Saved map from DTEdit"
write string 1,"---------------------"
for o = 0 to NumPlaced
write file 1,Boxes(o).X1
write file 1,Boxes(o).Y1
write file 1,Boxes(o).Z1
write file 1,Boxes(o).X2
write file 1,Boxes(o).Y2
write file 1,Boxes(o).Z2
next o
close file 1
returnRem *** Include File: Resize.dba ***
Rem Created: 21/06/03 18:46:08
Rem Included in Project: C:Program FilesDark Basic SoftwareDark Basic ProfessionalProjectsMiscdragableedit.dbpro
Resize1:
` Draw handles on edges
x1 = st1x1 + boxes(curr).x1+jx
y1 = st1y1 + boxes(curr).z1+jy
x2 = st1x1 + boxes(curr).x2+jx
y2 = st1y1 + boxes(curr).z2+jy
do
goSub updateothers
if object exist(curr+1) and scancode()=211 then delete object curr+1
ink rgb(0,200,0),0
` TL
box x1-5,y1-5,x1+5,y1+5
if over(x1-5,y1-5,x1+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTL1
` TR
box x2-5,y1-5,x2+5,y1+5
if over(x2-5,y1-5,x2+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTR1
` BL
box x1-5,y2-5,x1+5,y2+5
if over(x1-5,y2-5,x1+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBL1
` BR
box x2-5,y2-5,x2+5,y2+5
if over(x2-5,y2-5,x2+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBR1
if upkey()=1 then dec y1 : dec y2
if downkey()=1 then inc y1 : inc y2
if scancode()=211 then array delete element boxes(0),curr : return
` set cursor 0,400
` print x1;".";y1;".";x2;".";y2
` if controlkey()=1 then exit
if mouseclick() = 1 and over(x1,y1,x2,y2)=0 then exit
sync
loop
return
UpdateOthers:
` Draw others
DrawDotIt(st1x1,st1y1,st1x2,st1y2,"XZ")
for b = 0 to NumPlaced
lb(st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy)
line st1x1 + boxes(b).x1+jx,st1y1 + boxes(b).z1+jy,st1x1 + boxes(b).x2+jx,st1y1 + boxes(b).z2+jy
next b
DrawDotIt(st2x1,st2y1,st2x2,st2y2,"XY")
ink rgb(25,25,255),0
for b = 0 to NumPlaced
lb(st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy)
line st2x1 + boxes(b).x1+jx,st2y1 + boxes(b).y1+jy,st2x1 + boxes(b).x2+jx,st2y1 + boxes(b).y2+jy
next b
for b = NumPlaced to 0 step -1
lb(st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy)
line st3x1 + boxes(b).z1+jx,st3y1 + boxes(b).y1+jy,st3x1 + boxes(b).z2+jx,st3y1 + boxes(b).y2+jy
next b
return
SizeTR1:
sy1 = y1
sx1 = x2
goSub DragOutTR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y1 = rEndY
inc Boxes(curr).Z1,ydiff
inc Boxes(curr).X2,xdiff
return
SizeTL1:
sy1 = y1
sx1 = x1
goSub DragOutTL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y1 = rEndY
inc Boxes(curr).Z1,ydiff
inc Boxes(curr).X1,xdiff
return
SizeBR1:
sy1 = y2
sx1 = x2
goSub DragOutBR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y2 = rEndY
inc Boxes(curr).Z2,ydiff
inc Boxes(curr).X2,xdiff
return
SizeBL1:
sy1 = y2
sx1 = x1
goSub DragOutBL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y2 = rEndY
inc Boxes(curr).Z2,ydiff
inc Boxes(curr).X1,xdiff
return
rem Subs for dragging/resizing shapes
DragOutTR:
do
rEndX = Trans(mousex(),ppx#)
rEndY = Trans(mousey(),ppy#)
goSub updateothers
LB(x1,y2,rEndX,rEndY)
if mouseclick()=0 then exit
sync
loop
return
DragOutTL:
do
rEndX = Trans(mousex(),ppx#)
rEndY = Trans(mousey(),ppy#)
goSub updateothers
LB(x2,y2,rEndX,rEndY)
if mouseclick()=0 then exit
sync
loop
return
DragOutBR:
do
rEndX = Trans(mousex(),ppx#)
rEndY = Trans(mousey(),ppy#)
goSub updateothers
LB(x1,y1,rEndX,rEndY)
if mouseclick()=0 then exit
sync
loop
return
DragOutBL:
do
rEndX = Trans(mousex(),ppx#)
rEndY = Trans(mousey(),ppy#)
goSub updateothers
LB(x2,y1,rEndX,rEndY)
if mouseclick()=0 then exit
sync
loop
return
rem ---------------------------------------------------------------------------------
rem VIEW 2 RESIZE
rem ---------------------------------------------------------------------------------
Resize2:
` Draw handles on edges
x1 = st2x1 + boxes(curr).x1+jx
y1 = st2y1 + boxes(curr).y1+jy
x2 = st2x1 + boxes(curr).x2+jx
y2 = st2y1 + boxes(curr).y2+jy
do
goSub updateothers
if object exist(curr+1) and scancode()=211 then delete object curr+1
ink rgb(0,200,0),0
` TL
box x1-5,y1-5,x1+5,y1+5
if over(x1-5,y1-5,x1+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTL2
` TR
box x2-5,y1-5,x2+5,y1+5
if over(x2-5,y1-5,x2+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTR2
` BL
box x1-5,y2-5,x1+5,y2+5
if over(x1-5,y2-5,x1+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBL2
` BR
box x2-5,y2-5,x2+5,y2+5
if over(x2-5,y2-5,x2+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBR2
if upkey()=1 then dec y1 : dec y2
if downkey()=1 then inc y1 : inc y2
if scancode()=211 then array delete element boxes(0),curr : return
if mouseclick() = 1 and over(x1,y1,x2,y2)=0 then exit
sync
loop
return
REMSTART
---------------------------
HOW TO WORK OUT X/Y CO-ORDS
---------------------------
With X/Y view, X is X and Y is Y, pretty easy to remember.
Boxes().X1 = StartX
Boxes().Y1 = StartY
Boxes().Z1 = n/a
Boxes().X2 = EndX
Boxes().Y2 = EndY
Boxes().Z2 = n/a
REMEND
SizeTR2:
sy1 = y1
sx1 = x2
goSub DragOutTR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y1 = rEndY
inc Boxes(curr).Y1,ydiff
inc Boxes(curr).X2,xdiff
return
SizeTL2:
sy1 = y1
sx1 = x1
goSub DragOutTL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y1 = rEndY
inc Boxes(curr).Y1,ydiff
inc Boxes(curr).X1,xdiff
return
SizeBR2:
sy1 = y2
sx1 = x2
goSub DragOutBR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y2 = rEndY
inc Boxes(curr).Y2,ydiff
inc Boxes(curr).X2,xdiff
return
SizeBL2:
sy1 = y2
sx1 = x1
goSub DragOutBL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y2 = rEndY
inc Boxes(curr).Y2,ydiff
inc Boxes(curr).X1,xdiff
return
rem ---------------------------------------------------------------------------------
rem VIEW 3 RESIZE
rem ---------------------------------------------------------------------------------
Resize3:
` Draw handles on edges
x1 = st3x1 + boxes(curr).z1+jx
y1 = st3y1 + boxes(curr).y1+jy
x2 = st3x1 + boxes(curr).z2+jx
y2 = st3y1 + boxes(curr).y2+jy
do
goSub updateothers
if object exist(curr+1) and scancode()=211 then delete object curr+1
ink rgb(0,200,0),0
` TL
box x1-5,y1-5,x1+5,y1+5
if over(x1-5,y1-5,x1+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTL3
` TR
box x2-5,y1-5,x2+5,y1+5
if over(x2-5,y1-5,x2+5,y1+5)=1 and mouseclick() = 1 then goSub SizeTR3
` BL
box x1-5,y2-5,x1+5,y2+5
if over(x1-5,y2-5,x1+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBL3
` BR
box x2-5,y2-5,x2+5,y2+5
if over(x2-5,y2-5,x2+5,y2+5)=1 and mouseclick() = 1 then goSub SizeBR3
if upkey()=1 then dec y1 : dec y2
if downkey()=1 then inc y1 : inc y2
if scancode()=211 then array delete element boxes(0),curr : return
if mouseclick() = 1 and over(x1,y1,x2,y2)=0 then exit
sync
loop
return
REMSTART
---------------------------
HOW TO WORK OUT Z/Y CO-ORDS
---------------------------
With Z/Y view, X co-ords are Z and Y is Y
Boxes().X1 = n/a
Boxes().Y1 = StartY
Boxes().Z1 = StartX
Boxes().X2 = n/a
Boxes().Y2 = EndY
Boxes().Z2 = EndX
REMEND
SizeTR3:
sy1 = y1
sx1 = x2
goSub DragOutTR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y1 = rEndY
inc Boxes(curr).Y1,ydiff
inc Boxes(curr).Z2,xdiff
return
SizeTL3:
sy1 = y1
sx1 = x1
goSub DragOutTL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y1 = rEndY
inc Boxes(curr).Y1,ydiff
inc Boxes(curr).Z1,xdiff
return
SizeBR3:
sy1 = y2
sx1 = x2
goSub DragOutBR
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x2 = rEndX
y2 = rEndY
inc Boxes(curr).Y2,ydiff
inc Boxes(curr).Z2,xdiff
return
SizeBL3:
sy1 = y2
sx1 = x1
goSub DragOutBL
xdiff = rEndX - sx1
ydiff = rEndY - sy1
x1 = rEndX
y2 = rEndY
inc Boxes(curr).Y2,ydiff
inc Boxes(curr).Z1,xdiff
return
Run as 800 x 600. The code should set this. Recommended running in window.
There may be some quirs and bugs, plus some of the source if uncommented and very tricky!