summaryrefslogtreecommitdiffstats
path: root/tools/worldbuilder/code/contexts/locatorcontext.h
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /tools/worldbuilder/code/contexts/locatorcontext.h
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'tools/worldbuilder/code/contexts/locatorcontext.h')
-rw-r--r--tools/worldbuilder/code/contexts/locatorcontext.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/tools/worldbuilder/code/contexts/locatorcontext.h b/tools/worldbuilder/code/contexts/locatorcontext.h
new file mode 100644
index 0000000..a785b8c
--- /dev/null
+++ b/tools/worldbuilder/code/contexts/locatorcontext.h
@@ -0,0 +1,86 @@
+#include "precompiled/PCH.h"
+
+#ifndef LOCATOR_CONTEXT
+#define LOCATOR_CONTEXT
+
+//----------------------------------------
+// System Includes
+//----------------------------------------
+#include <..\..\..\game\code\meta\locatortypes.h>
+#include <..\..\..\game\code\meta\locatorevents.h>
+
+//----------------------------------------
+// Forward References
+//----------------------------------------
+
+//-----------------------------------------------------------------------------
+//
+// L o c a t o r C o n t e x t
+//
+//-----------------------------------------------------------------------------
+class LocatorContext : public MPxContext
+{
+ public:
+
+ enum Stimulus // Maskable values.
+ {
+ BUTTONDOWN = 0x0001,
+ BUTTONUP = 0x0002,
+ MOUSEDRAG = 0x0004,
+ COMPLETED = 0x0008,
+ DELETED = 0x0010,
+ ABORTED = 0x0020
+ };
+
+
+ LocatorContext();
+ virtual ~LocatorContext();
+
+ static const char* stringId;
+
+ virtual void toolOnSetup( MEvent& );
+ virtual void toolOffCleanup();
+ virtual MStatus doPress( MEvent& );
+ virtual MStatus doDrag( MEvent& );
+ virtual MStatus doRelease( MEvent& event );
+ virtual MStatus doHold( MEvent& event );
+ virtual MStatus doEnterRegion( MEvent& event );
+ virtual void deleteAction();
+ virtual void completeAction();
+ virtual void abortAction();
+
+ private:
+ void ProcessState( Stimulus stimulus );
+ void SetHelpString();
+ void InitLocator();
+
+ MString mHelp;
+
+ short mXCurrent, mYCurrent;
+ short mXDrag, mYDrag;
+ MObject mLocator;
+ MObject mLocatorTransform;
+
+ static LocatorType::Type mLastLocatorType;
+ static LocatorEvent::Event mLastEvent;
+};
+
+//-----------------------------------------------------------------------------
+//
+// I n t e r s e c t i o n C o n t e x t C m d
+//
+//-----------------------------------------------------------------------------
+class LocatorContextCmd : public MPxContextCommand
+{
+ public:
+ LocatorContextCmd();
+ virtual ~LocatorContextCmd();
+
+ static void* creator();
+
+ virtual MPxContext* makeObj();
+
+ private:
+};
+
+#endif