2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 // $Header: r:/t2repos/thief2/src/editor/autovbr.cpp,v 1.3 2000/02/19 12:27:40 toml Exp $
35 #include <dbmem.h> // must be last header!
37 ILabelProperty
*gAutoVBrushProp
;
38 EXTERN
void br_update_obj(editBrush
*us
);
40 static void ObjSysListener(ObjID obj
, eObjNotifyMsg msg
, void*)
42 AutoAppIPtr_(ObjectSystem
,pObjSys
);
46 if ((msg
== kObjNotifyCreate
) && (OBJ_IS_CONCRETE(obj
)))
48 if (gAutoVBrushProp
->IsRelevant(obj
))
50 gAutoVBrushProp
->Get(obj
, &vbrname
);
51 sprintf(cmd
,"load_group %s",vbrname
->text
);
53 mprintf("loading group %s from obj %d\n",vbrname
->text
,obj
);
55 // load up the multibrush
58 // move the multibrush to this location
60 editBrush
*br
=vBrush_GetSel();
62 mx_sub_vec(br_trans_vec
,&p1
->loc
.vec
,&br
->pos
);
63 vBrush_GroupOp(FALSE
,br_translate
); // zero relative them all
64 vBrush_GroupOp(FALSE
,br_update_obj
);
66 // delete this poor object
67 pObjSys
->Destroy(obj
);
73 static sPropertyDesc AutoVBrushDesc
=
76 NULL
, 0, 0, // constraints, versions
77 { "Editor", "Auto-Multibrush" },
80 void AutoVBrushInit(void)
82 gAutoVBrushProp
= CreateLabelProperty(&AutoVBrushDesc
, kPropertyImplDense
);
84 // listen to obj sys changes
85 AutoAppIPtr_(ObjectSystem
,pObjSys
);
86 sObjListenerDesc listener
= { ObjSysListener
, NULL
};
87 pObjSys
->Listen(&listener
);