home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
_
/
3deditor
/
!3DEditor
/
Modules
/
Object
/
Module
(
.txt
)
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-01-07
|
6KB
|
191 lines
Object Placer/Editor
0,"To use this module run the !3DEditor application"
object_info
/ModulePurpose$="Object control and placing"
#ModuleAuthor$="Simon Wilkinson"
object_closed(win%):=0
object_priority:=49
object_initialise(data%)
PutStr(data%,"object1")
!data%=0
data%+=4
Z="-type creator -items 1 -windows -menus -variables -version 1.06 -atleast 2.04 -info"
object_toolclick(tool$,num%)
object_start
Window_NewYbox(Object_Ybox%,
object_toolend(tool$,num%)
Window_LooseYbox(Object_Ybox%)
object_windows(
IndrPos%,task%)
AObject_Ybox%=
Window_CreateYbox("ybox",IndrPos%,Block%,task%)
Block%!0=20:Block%!4=1
Block%!8=19:Block%!12=2
Block%!16=-1
Window_ActiveIcon(Object_Ybox%,Block%)
Window_Writeable(Object_Ybox%,19,19,255)
object_menus(task%)
Menu_BuildAlterable("ObList","Objects",12,1024)
Menu_BuildMenu("Object","Object",12)
Menu_AddSubMenu("Main","Object","Object",0,MenuNormal%)
Menu_AddItem("Object",task%,1,"Make root",-1,0,MenuNormal%)
Menu_AddSubMenu("Object","Edit","ObList",0,MenuNormal%)
Menu_AddItem("ObList",0,0,"dummy",-1,0,0)
object_menuwarning
ObjectFrom%=0
object_buildmenu(CurrentTask%,
object_variables
Obj_Xstep%=50
Obj_Ystep%=50
Obj_Zstep%=50
Object_Created%=1
object_click(win%,icon%,x%,y%,button%)
d%,dum%
Object_Ybox%
Object_Op%
9Oup%=
Window_ClickYbox(win%,icon%,d%,d%,d%,Obj_Xstep%,Obj_Ystep%,Obj_Zstep%)
;[up%=
Window_ClickYbox(win%,icon%,Obj_X%,Obj_Y%,Obj_Z%,Obj_Xstep%,Obj_Ystep%,Obj_Zstep%)
Object_UpdatePos(CurrentObj%,Selected%,Obj_X%,Obj_Y%,Obj_Z%,0,0,0,0,0,0,%100)
Display_RedrawItem(CurrentObj%,Selected%)
Display_UpdateItem(Selected%)
Icon_UpText(Object_Ybox%,17,"("+
Obj_X%+","+
Obj_Y%+","+
Obj_Z%+")")
Icon_Redraw(Object_Ybox%,17)
icon%
Window_Coord("Enter coordinates",Obj_X%,Obj_Y%,Obj_Z%,win%,1)
ObjectFrom%=1
object_buildmenu(ToolTask%,
Menu_OpenIcon(Object_Ybox%,20,"ObList")
MyObject%=-1
Object_EditObject(
Object_NewObject(
Icon_Read(Object_Ybox%,19)))
Object_Created%+=1
Object_EditObject(MyObject%)
object_updateybox(CurrentObj%)
Wimp_LoseCaret
Object_PlaceObject(CurrentObj%,dum%,MyObject%,0,0,0,0,0,0,1,1,1)
Selected%=dum%
Select_Type%=3
Display_RedrawAll
Obj_X%=0:Obj_Y%=0:Obj_Z%=0
Icon_UpText(Object_Ybox%,17,"(0,0,0)")
Icon_GreyOut(Object_Ybox%,17,0)
Icon_Redraw(Object_Ybox%,17)
Object_Op%=1
Wimp_LoseCaret
MyObject%<>-1
Object_UpdateName(MyObject%,
Icon_Read(Object_Ybox%,19))
MyObject%=-1
Object_EditObject(
Object_NewObject(
Icon_Read(Object_Ybox%,19)))
Object_Created%+=1
object_updateybox(CurrentObj%)
object_menuselect(name$,num%)
name$
"Object"
Wimp_Naughty(
num%)
object_makeroot
"ObList"
ObjectFrom%=1
object_updateybox(num%-2)
Wimp_LoseCaret
num%<>CurrentObj%
ObjectFrom%=0
Tool_Clear
CurrentObj%=num%
Selected%=-1
SelectType%=-1
Display_RedrawAll
Display_Update
Window_UpdateTitle
object_coords(num%,x%,y%,z%)
Obj_Xstep%=x%
Obj_Ystep%=y%
Obj_Zstep%=z%
Icon_UpText(Object_Ybox%,11,"("+
Obj_Xstep%+","+
Obj_Ystep%+","+
Obj_Zstep%+")")
Icon_Redraw(Object_Ybox%,11)
Obj_X%=x%
Obj_Y%=y%
Obj_Z%=z%
Object_UpdatePos(CurrentObj%,Selected%,Obj_X%,Obj_Y%,Obj_Z%,0,0,0,0,0,0,%100)
Display_RedrawItem(CurrentObj%,Selected%)
Display_UpdateItem(Selected%)
Icon_UpText(Object_Ybox%,17,"("+
Obj_X%+","+
Obj_Y%+","+
Obj_Z%+")")
Icon_Redraw(Object_Ybox%,17)
object_start
object_updateybox(-2)
object_updateybox(obj%)
reply%
Icon_GreyOut(Object_Ybox%,21,0)
Icon_GreyOut(Object_Ybox%,22,1)
Icon_UpText(Object_Ybox%,21,"Create")
Icon_Redraw(Object_Ybox%,21)
Icon_UpText(Object_Ybox%,19,"Untitled"+
Object_Created%)
Icon_Redraw(Object_Ybox%,19)
MyObject%=-1
Object_Op%=0
MyObject%=0
Wimp_Naughty("You cannot delete the root object")
reply%=
Wimp_Error(2,"Warning from 3D Editor","Are you sure that you want to delete the object '"+$((MyObject%)*16+ObjectList%+5)+"'","Cancel","Delete","")
reply%=2
Object_DeleteObject(MyObject%)
CurrentObj%=MyObject%
Object_EditObject(CurrentObj%-1)
MyObject%-=1
object_updateybox(MyObject%)
Icon_GreyOut(Object_Ybox%,22,0)
Icon_UpText(Object_Ybox%,21,"Edit")
Icon_Redraw(Object_Ybox%,21)
Icon_UpText(Object_Ybox%,19,$((obj%)*16+ObjectList%+5))
Icon_Redraw(Object_Ybox%,19)
Icon_GreyOut(Object_Ybox%,22,0)
MyObject%=obj%
Object_Op%=0
Icon_GreyOut(Object_Ybox%,17,1)
Icon_UpText(Object_Ybox%,17,"Unplaced")
obj%=CurrentObj%
Icon_GreyOut(Object_Ybox%,22,1)
Icon_GreyOut(Object_Ybox%,21,1)
object_buildmenu(task%,flag%)
loop%,obj$,shading%,add%,ptr%
Menu_Clear("ObList")
flag%
Menu_AddItem("ObList",task%,0,"New Object",-1,0,MenuNormal%)
MyObject%<>-1
shading%=MenuNormal%
shading%=MenuShaded%
Menu_AddItem("ObList",task%,1,"Delete Object",-1,MenuDot%,shading%)
add%=2
add%=0
loop%=0
Objects%-1
ptr%=loop%*16+5
obj$=$(ptr%+ObjectList%)
Menu_AddItem("ObList",task%,loop%+add%,obj$,-1,0,MenuNormal%)
loop%
Menu_End("ObList")
Menu_Tick("ObList",CurrentObj%+add%,1)
object_makeroot
dum%,loop%
loop%=0
dum%=ObjectList%!loop%
9ObjectList%!loop%=!(ObjectList%+CurrentObj%*16+loop%)
,!(ObjectList%+CurrentObj%*16+loop%)=dum%
CurrentObj%=0