Added controllerflag selection

This commit is contained in:
andreja6
2020-03-09 23:55:13 -07:00
parent d36f9df272
commit 4f415cf98b
6 changed files with 48 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include "DataModelInstance.h"
#include <G3DAll.h>
class Application;

View File

@@ -42,6 +42,7 @@ bool IEBrowser::navigateSyncURL(wchar_t* url)
MSG messages;
if (webBrowser)
{
webBrowser->Navigate(url,0,0,0,0);
}
else

32
ax.cpp
View File

@@ -1,10 +1,7 @@
// AX.CPP
#include <windows.h>
#include <comdef.h>
#include <exdisp.h>
#include <oledlg.h>
#include "ax.h"
#include "AudioPlayer.h"
#include "Enum.h"
#pragma warning (disable: 4311)
#pragma warning (disable: 4312)
@@ -106,6 +103,8 @@ STDMETHODIMP AXClientSite :: FilterDataObject( IDataObject *pDO, IDataObject **p
STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject)
{
*ppvObject = 0;
// if (iid == IID_IOleInPlaceSite)
// *ppvObject = (IOleInPlaceSite*)this;
if (iid == IID_IOleClientSite)
*ppvObject = (IOleClientSite*)this;
if (iid == IID_IUnknown)
@@ -114,7 +113,7 @@ STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject)
*ppvObject = (IAdviseSink*)this;
if (iid == IID_IDispatch)
*ppvObject = (IDispatch*)this;
if (ExternalPlace == false)
//if (ExternalPlace == false)
{
if (iid == IID_IOleInPlaceSite)
*ppvObject = (IOleInPlaceSite*)this;
@@ -517,6 +516,27 @@ HRESULT _stdcall AXClientSite :: Invoke(
{
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
}
else if (m_lastExternalName==L"SetController")
{
bool ding = false;
//int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1;
//char * args = new char[len];
//WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE);
if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7)
return S_OK;
Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal;
for(size_t i = 0; i < g_selectedInstances.size(); i++)
{
if(PVInstance* part = dynamic_cast<PVInstance*>(g_selectedInstances.at(i)))
{
ding = true;
part->controller = cont;
}
}
if(ding)
AudioPlayer::playSound(dingSound);
return S_OK;
}
else
{
return E_NOTIMPL;

2
ax.h
View File

@@ -1,4 +1,6 @@
// AX.H
#pragma once
#include "Globals.h"
#include <mshtmhst.h>
#include <string>

View File

@@ -12,10 +12,10 @@
}
</script>
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border:0;">
<img src="../images/Controller1Tool.png" onclick="SetController(1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/Controller2Tool.png" onclick="Insert(2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI1Tool.png" onclick="SetController(3)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI2Tool.png" onclick="SetController(4)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerNoneTool.png" onclick="SetController(0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/Controller1Tool.png" onclick="window.external.SetController(1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/Controller2Tool.png" onclick="window.external.SetController(2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI1Tool.png" onclick="window.external.SetController(5)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI2Tool.png" onclick="window.external.SetController(623423434234)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerNoneTool.png" onclick="window.external.SetController(0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
</body>
</html>

View File

@@ -175,6 +175,19 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int main(int argc, char** argv) {
try{
hresult = OleInitialize(NULL);
HRESULT hr;
/* IInternetSecurityManager *pSecurityMgr;
IInternetZoneManager *pZoneMgr;
LPCWSTR site1 = SysAllocString(L"http://www.androdome.com");
hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr);
pSecurityMgr->SetZoneMapping((DWORD)2, site1, (DWORD)0); // 2 = Trusted Site, site1 is the URL to add, and 0 is to create the entry.
*/
if (!AXRegister())
return 0;