Added surface tool
This commit is contained in:
@@ -311,6 +311,10 @@
|
|||||||
RelativePath=".\src\source\Tool\ArrowTool.cpp"
|
RelativePath=".\src\source\Tool\ArrowTool.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\SurfaceTool.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\source\Tool\Tool.cpp"
|
RelativePath=".\src\source\Tool\Tool.cpp"
|
||||||
>
|
>
|
||||||
@@ -661,10 +665,6 @@
|
|||||||
RelativePath=".\src\include\Enum.h"
|
RelativePath=".\src\include\Enum.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\src\include\Enums.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\ErrorFunctions.h"
|
RelativePath=".\src\include\ErrorFunctions.h"
|
||||||
>
|
>
|
||||||
@@ -788,6 +788,10 @@
|
|||||||
RelativePath=".\src\include\Tool\ArrowTool.h"
|
RelativePath=".\src\include\Tool\ArrowTool.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\SurfaceTool.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\Tool\Tool.h"
|
RelativePath=".\src\include\Tool\Tool.h"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border: outset 2px;">
|
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border: outset 2px;">
|
||||||
<img src="../images/FlatTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/FlatTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(0, 0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/BumpTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/BumpTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(1, 0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/HingeTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/HingeTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(2, 0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/LeftMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/LeftMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3, 1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/LeftMotorFastTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(4)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/LeftMotorFastTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3, 2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/RightMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(5)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/RightMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3, 3)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
<img src="../images/RightMotorFastTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(6)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
<img src="../images/RightMotorFastTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3, 4)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -5,7 +5,7 @@ namespace Enum
|
|||||||
namespace SurfaceType
|
namespace SurfaceType
|
||||||
{
|
{
|
||||||
enum Value {
|
enum Value {
|
||||||
Smooth, Snaps, Inlets, Glue, Weld, Spawn, Hinge, Motor, Bumps
|
Smooth = 0, Bumps = 1, Hinge = 2, Motor = 3, StepperMotor = 4, Spawn = 5
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
namespace Shape
|
namespace Shape
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#ifdef UENUMS
|
|
||||||
#ifndef ENUM_H
|
|
||||||
#define ENUM_H
|
|
||||||
static enum BinType {GameTool, Grab, Clone, Hammer};
|
|
||||||
static enum ControllerType {None, KeyboardRight, KeyboardLeft, Joypad1, Joypad2, Chase, Flee};
|
|
||||||
//static enum JointType {UNK0, WeldJoint, SnapJoint, UNK3, Rotate, RotateP, RotateV, GlueJoint, UNK8, UNK9, None};
|
|
||||||
static enum ActionType {Nothing, Pause, Lose, Draw, Win};
|
|
||||||
static enum AffectType {NoChange, Increase, Decrease};
|
|
||||||
static enum InputType {NoInput, LeftTread, RightTread, Steer, Throtle, UpDown, Action1, Action2, Action3, Action4, Action5, Constant, Sin};
|
|
||||||
//static enum SurfaceConstraint {None, Hinge, SteppingMotor, Motor};
|
|
||||||
static enum SurfaceType{Smooth, Snaps, Inlets, Glue, Weld, Spawn, Hinge, Motor, Bumps};
|
|
||||||
static enum SoundType {NoSound, Boing, Bomb, Break, Click, Clock, Slingshot, Page, Ping, Snap, Splat, Step, StepOn, Swoosh, Victory};
|
|
||||||
static enum PartType {Ball, Block, Cylinder};
|
|
||||||
static enum KeywordFilterType {Include, Exclude};
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@@ -7,12 +7,12 @@ class ArrowTool :
|
|||||||
public:
|
public:
|
||||||
ArrowTool(void); //OnSelect?
|
ArrowTool(void); //OnSelect?
|
||||||
~ArrowTool(void); //OnDeselect?
|
~ArrowTool(void); //OnDeselect?
|
||||||
virtual void onButton1MouseDown(Mouse);
|
void onButton1MouseDown(Mouse);
|
||||||
virtual void onButton1MouseUp(Mouse);
|
void onButton1MouseUp(Mouse);
|
||||||
virtual void onMouseMoved(Mouse mouse);
|
void onMouseMoved(Mouse mouse);
|
||||||
virtual void onSelect(Mouse mouse);
|
void onSelect(Mouse mouse);
|
||||||
virtual void onKeyDown(int key);
|
void onKeyDown(int key);
|
||||||
virtual void onKeyUp(int key);
|
void onKeyUp(int key);
|
||||||
private:
|
private:
|
||||||
bool lctrlDown;
|
bool lctrlDown;
|
||||||
bool rctrlDown;
|
bool rctrlDown;
|
||||||
|
|||||||
20
src/include/Tool/SurfaceTool.h
Normal file
20
src/include/Tool/SurfaceTool.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "tool.h"
|
||||||
|
#include "Enum.h"
|
||||||
|
|
||||||
|
class SurfaceTool :
|
||||||
|
public Tool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SurfaceTool(Enum::SurfaceType::Value surface, int extraParam); //OnSelect?
|
||||||
|
~SurfaceTool(void); //OnDeselect?
|
||||||
|
void onButton1MouseDown(Mouse);
|
||||||
|
void onButton1MouseUp(Mouse);
|
||||||
|
void onMouseMoved(Mouse mouse);
|
||||||
|
void onSelect(Mouse mouse);
|
||||||
|
void onKeyDown(int key);
|
||||||
|
void onKeyUp(int key);
|
||||||
|
private:
|
||||||
|
Enum::SurfaceType::Value surface;
|
||||||
|
int param;
|
||||||
|
};
|
||||||
@@ -135,8 +135,8 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
|||||||
webBrowser = new IEBrowser(_hwndToolbox);
|
webBrowser = new IEBrowser(_hwndToolbox);
|
||||||
|
|
||||||
SetProp(_hwndToolbox,"Browser",(HANDLE)webBrowser);
|
SetProp(_hwndToolbox,"Browser",(HANDLE)webBrowser);
|
||||||
navigateToolbox("http://androdome.com/res/ClientToolbox.php");
|
//navigateToolbox("http://androdome.com/res/ClientToolbox.php");
|
||||||
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
|
navigateToolbox(GetFileInPath("/content/page/surface.html"));
|
||||||
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
|
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "ax.h"
|
#include "ax.h"
|
||||||
|
#include "Tool/SurfaceTool.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
HRESULT IEBrowser::doExternal(std::wstring funcName,
|
HRESULT IEBrowser::doExternal(std::wstring funcName,
|
||||||
DISPID dispIdMember,
|
DISPID dispIdMember,
|
||||||
@@ -53,6 +55,28 @@ HRESULT IEBrowser::doExternal(std::wstring funcName,
|
|||||||
AudioPlayer::playSound(dingSound);
|
AudioPlayer::playSound(dingSound);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
else if(funcName==L"SetSurface")
|
||||||
|
{
|
||||||
|
if(pDispParams->cArgs < 2)
|
||||||
|
return E_NOTIMPL;
|
||||||
|
int j = pDispParams->rgvarg->intVal;
|
||||||
|
int i = (pDispParams->rgvarg+1)->intVal;
|
||||||
|
printf("Got values %d and %d", i, j);
|
||||||
|
if(i > 5 || i < 0)
|
||||||
|
return E_NOTIMPL;
|
||||||
|
g_usableApp->changeTool(new SurfaceTool((Enum::SurfaceType::Value)i, j));
|
||||||
|
/*VARIANT val1;
|
||||||
|
VARIANT val2;
|
||||||
|
unsigned int puArgErr;
|
||||||
|
HRESULT res = DispGetParam(pDispParams,1,VT_VARIANT,&val1, &puArgErr);
|
||||||
|
if(res != S_OK)
|
||||||
|
return res;
|
||||||
|
//res = DispGetParam(pDispParams,1,VT_UI4,&val2, &puArgErr);
|
||||||
|
//if(res != S_OK)
|
||||||
|
//return res;
|
||||||
|
*/
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
else if(funcName==L"SetColor")
|
else if(funcName==L"SetColor")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
38
src/source/Tool/SurfaceTool.cpp
Normal file
38
src/source/Tool/SurfaceTool.cpp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#include "Tool/SurfaceTool.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
|
SurfaceTool::SurfaceTool(Enum::SurfaceType::Value theSurface, int extraParam)
|
||||||
|
{
|
||||||
|
surface = theSurface;
|
||||||
|
param = extraParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
SurfaceTool::~SurfaceTool(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SurfaceTool::onButton1MouseDown(Mouse mouse)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
void SurfaceTool::onButton1MouseUp(Mouse mouse)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SurfaceTool::onMouseMoved(Mouse mouse)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void SurfaceTool::onSelect(Mouse mouse)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SurfaceTool::onKeyDown(int key)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SurfaceTool::onKeyUp(int key)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user