mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added environment variable to set location of mod.
Multiple units selection and path drawing added.
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>.\..\..\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgAutoLink>true</VcpkgAutoLink>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "DCSUtils.h"
|
||||
#include "Logger.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#define DllExport __declspec( dllexport )
|
||||
|
||||
@@ -35,13 +36,25 @@ f_coreMissionData coreMissionData = nullptr;
|
||||
static int onSimulationStart(lua_State* L)
|
||||
{
|
||||
LOGGER->Log("onSimulationStart callback called successfully");
|
||||
#ifdef _DEBUG
|
||||
LOGGER->Log("Loading Debug core.dll");
|
||||
hGetProcIDDLL = LoadLibrary(L"C:\\Users\\dpass\\Documents\\Olympus\\bin\\x64\\Debug\\core.dll");
|
||||
#else
|
||||
LOGGER->Log("Loading Release core.dll");
|
||||
hGetProcIDDLL = LoadLibrary(L"C:\\Users\\dpass\\Documents\\Olympus\\bin\\x64\\Release\\core.dll");
|
||||
#endif
|
||||
|
||||
string modLocation;
|
||||
string dllLocation;
|
||||
char* buf = nullptr;
|
||||
size_t sz = 0;
|
||||
if (_dupenv_s(&buf, &sz, "OLYMPUS") == 0 && buf != nullptr)
|
||||
{
|
||||
modLocation = buf;
|
||||
free(buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER->Log("OLYMPUS environment variable is missing");
|
||||
goto error;
|
||||
}
|
||||
dllLocation = modLocation + "\\bin\\core.dll";
|
||||
|
||||
LOGGER->Log("Loading core.dll");
|
||||
hGetProcIDDLL = LoadLibrary(Utils::to_wstring(dllLocation).c_str());
|
||||
|
||||
if (!hGetProcIDDLL) {
|
||||
DCSUtils::LogError(L, "Error loading core DLL");
|
||||
|
||||
Reference in New Issue
Block a user