Added surface tool

This commit is contained in:
Vulpovile
2021-03-15 01:53:25 -07:00
parent c27a56b42f
commit 0e3968acd4
9 changed files with 106 additions and 36 deletions

View File

@@ -311,6 +311,10 @@
RelativePath=".\src\source\Tool\ArrowTool.cpp"
>
</File>
<File
RelativePath=".\src\source\Tool\SurfaceTool.cpp"
>
</File>
<File
RelativePath=".\src\source\Tool\Tool.cpp"
>
@@ -661,10 +665,6 @@
RelativePath=".\src\include\Enum.h"
>
</File>
<File
RelativePath=".\src\include\Enums.h"
>
</File>
<File
RelativePath=".\src\include\ErrorFunctions.h"
>
@@ -788,6 +788,10 @@
RelativePath=".\src\include\Tool\ArrowTool.h"
>
</File>
<File
RelativePath=".\src\include\Tool\SurfaceTool.h"
>
</File>
<File
RelativePath=".\src\include\Tool\Tool.h"
>

View File

@@ -12,12 +12,12 @@
}
</script>
<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/BumpTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(1)" 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/LeftMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(3)" 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/RightMotorTool.png" onmouseout="toolOut(this)" onclick="window.external.SetSurface(5)" 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/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, 0)" 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, 1)" 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(3, 3)" 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>
</html>

View File

@@ -5,7 +5,7 @@ namespace Enum
namespace SurfaceType
{
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

View File

@@ -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

View File

@@ -7,12 +7,12 @@ class ArrowTool :
public:
ArrowTool(void); //OnSelect?
~ArrowTool(void); //OnDeselect?
virtual void onButton1MouseDown(Mouse);
virtual void onButton1MouseUp(Mouse);
virtual void onMouseMoved(Mouse mouse);
virtual void onSelect(Mouse mouse);
virtual void onKeyDown(int key);
virtual void onKeyUp(int key);
void onButton1MouseDown(Mouse);
void onButton1MouseUp(Mouse);
void onMouseMoved(Mouse mouse);
void onSelect(Mouse mouse);
void onKeyDown(int key);
void onKeyUp(int key);
private:
bool lctrlDown;
bool rctrlDown;

View 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;
};

View File

@@ -135,8 +135,8 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
webBrowser = new IEBrowser(_hwndToolbox);
SetProp(_hwndToolbox,"Browser",(HANDLE)webBrowser);
navigateToolbox("http://androdome.com/res/ClientToolbox.php");
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
//navigateToolbox("http://androdome.com/res/ClientToolbox.php");
navigateToolbox(GetFileInPath("/content/page/surface.html"));
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
}

View File

@@ -9,6 +9,8 @@
#include "Globals.h"
#pragma once
#include "ax.h"
#include "Tool/SurfaceTool.h"
#include "Application.h"
HRESULT IEBrowser::doExternal(std::wstring funcName,
DISPID dispIdMember,
@@ -53,6 +55,28 @@ HRESULT IEBrowser::doExternal(std::wstring funcName,
AudioPlayer::playSound(dingSound);
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")
{

View 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)
{
}