Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "StdAfx.h"
+#include "DTreePlanter.h"
-#include "gtkr_list.h"
+#include <list>
#include "str.h"
#include "DPoint.h"
#include "ScriptParser.h"
#include "misc.h"
-#include "DTreePlanter.h"
#include "funchandlers.h"
-bool DTreePlanter::OnMouseMove(guint32 nFlags, gdouble x, gdouble y) {
- return false;
-}
-
-bool DTreePlanter::OnLButtonDown(guint32 nFlags, gdouble x, gdouble y) {
- VIEWTYPE vt = m_XYWrapper->GetViewType();
+SignalHandlerResult DTreePlanter::mouseDown(const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers)
+{
+ if(button != c_buttonLeft)
+ {
+ return SIGNAL_CONTINUE_EMISSION;
+ }
+ VIEWTYPE vt = GlobalRadiant().XYWindow_getViewType();
switch(vt) {
case XY:
case YZ:
case XZ:
default:
- return false;
+ return SIGNAL_CONTINUE_EMISSION;
}
- vec3_t pt, vhit;
+ Vector3 pt, vhit;
- m_XYWrapper->SnapToGrid( static_cast<int>(x), static_cast<int>(y), pt );
+ pt = vector3_snapped(GlobalRadiant().XYWindow_windowToWorld(position));
- if(FindDropPoint(pt, vhit)) {
+ if(FindDropPoint(vector3_to_array(pt), vector3_to_array(vhit))) {
vhit[2] += m_offset;
char buffer[128];
e2.LoadFromEntity(lastEntNum, TRUE);
e2.AddEPair("target", buffer);
e2.RemoveFromRadiant();
- e2.BuildInRadiant(FALSE);
+ e2.BuildInRadiant(false);
}
#endif
}
e.AddEPair("modelscale", buffer);
}
- e.BuildInRadiant( FALSE );
+ e.BuildInRadiant( false );
}
if(m_autoLink) {
DoTrainPathPlot();
}
- return true;
-}
-
-bool DTreePlanter::OnLButtonUp(guint32 nFlags, gdouble x, gdouble y) {
- return false;
-}
-
-bool DTreePlanter::OnRButtonDown(guint32 nFlags, gdouble x, gdouble y) {
- return false;
-}
-
-bool DTreePlanter::OnRButtonUp(guint32 nFlags, gdouble x, gdouble y) {
- return false;
-}
-
-bool DTreePlanter::OnMButtonDown(guint32 nFlags, gdouble x, gdouble y) {
- return false;
-}
-
-bool DTreePlanter::OnMButtonUp(guint32 nFlags, gdouble x, gdouble y) {
- return false;
+ return SIGNAL_STOP_EMISSION;
}
bool DTreePlanter::FindDropPoint(vec3_t in, vec3_t out) {
sprintf( buffer, "%f %f %f", out[0], out[1], out[2] );
ent.AddEPair( "origin", buffer );
ent.RemoveFromRadiant();
- ent.BuildInRadiant(FALSE);
+ ent.BuildInRadiant(false);
}
g_FuncTable.m_pfnReleaseSelectedBrushHandles();
e.AddEPair( "control", buffer );
}
- e.BuildInRadiant( FALSE );
+ e.BuildInRadiant( false );
}
for(i = 0; i < m_linkNum-1; i++) {
sprintf( buffer, "0 %i 0", (i * 64) + 32);
e.AddEPair( "origin", buffer );
- e.BuildInRadiant( FALSE );
+ e.BuildInRadiant( false );
}
}
e.AddEPair( "control", buffer );
}
- e.BuildInRadiant( FALSE );
+ e.BuildInRadiant( false );
}
for(int i = 0; i < m_linkNum-1; i++) {
sprintf( buffer, "0 %i 0", (i * 64) + 32);
e.AddEPair( "origin", buffer );
- e.BuildInRadiant( FALSE );
+ e.BuildInRadiant( false );
}*/
}