Clean up
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ui.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="constants.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{60d5e9f4-335f-402b-9a07-d78674dffc9b}</ProjectGuid>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<Keyword>ManagedCProj</Keyword>
|
||||
<RootNamespace>Launcher</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>Launcher</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CLRSupport>true</CLRSupport>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CLRSupport>true</CLRSupport>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CLRSupport>true</CLRSupport>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CLRSupport>true</CLRSupport>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dva</TargetExt>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetExt>.dva</TargetExt>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies />
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>main</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>User32.lib</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>
|
||||
</EntryPointSymbol>
|
||||
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib;..\..\..\dependencies\freeglut\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies />
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>main</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>User32.lib</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>
|
||||
</EntryPointSymbol>
|
||||
<AdditionalLibraryDirectories>..\..\..\dependencies\detours\lib;..\..\..\dependencies\freeglut\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="TabPadding.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="TabPadding.h" />
|
||||
<ClInclude Include="ui.h">
|
||||
<FileType>CppForm</FileType>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="ui.resx">
|
||||
<DependentUpon>ui.h</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,44 @@
|
||||
#include "TabPadding.h"
|
||||
//#include <Windows.h>
|
||||
|
||||
// ported from https://stackoverflow.com/a/7785745
|
||||
// original code by user LarsTech https://stackoverflow.com/users/719186/larstech
|
||||
|
||||
TabPadding::TabPadding(TabControl^ tc)
|
||||
{
|
||||
tabControl = tc;
|
||||
tabControl->Selected += gcnew TabControlEventHandler(this, &TabPadding::tabControl_Selected);
|
||||
AssignHandle(tc->Handle);
|
||||
}
|
||||
|
||||
void TabPadding::tabControl_Selected(Object^ sender, TabControlEventArgs^ e)
|
||||
{
|
||||
tabControl->Invalidate();
|
||||
}
|
||||
|
||||
void TabPadding::WndProc(Message %m) {
|
||||
NativeWindow::WndProc(m);
|
||||
|
||||
if (m.Msg == 15) { //WM_PAINT
|
||||
Graphics^ g = Graphics::FromHwnd(m.HWnd);
|
||||
|
||||
//Replace the outside white borders:
|
||||
if (tabControl->Parent) {
|
||||
g->SetClip(System::Drawing::Rectangle(0, 0, tabControl->Width - 2, tabControl->Height - 1), Drawing2D::CombineMode::Exclude);
|
||||
g->FillRectangle(gcnew SolidBrush(tabControl->Parent->BackColor),
|
||||
System::Drawing::Rectangle(0, tabControl->ItemSize.Height + 2, tabControl->Width, tabControl->Height - (tabControl->ItemSize.Height + 2)));
|
||||
}
|
||||
|
||||
|
||||
//Replace the inside white borders:
|
||||
if (tabControl->SelectedTab) {
|
||||
g->ResetClip();
|
||||
System::Drawing::Rectangle r = tabControl->SelectedTab->Bounds;
|
||||
g->SetClip(r, Drawing2D::CombineMode::Exclude);
|
||||
g->FillRectangle(gcnew SolidBrush(tabControl->SelectedTab->BackColor),
|
||||
System::Drawing::Rectangle(r.Left - 3, r.Top - 1, r.Width + 4, r.Height + 3));
|
||||
}
|
||||
|
||||
delete g;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
using namespace System::Windows::Forms;
|
||||
using namespace System::Drawing;
|
||||
|
||||
// ported from https://stackoverflow.com/a/7785745
|
||||
// original code by user LarsTech https://stackoverflow.com/users/719186/larstech
|
||||
|
||||
ref class TabPadding : public NativeWindow
|
||||
{
|
||||
public:
|
||||
TabPadding(TabControl^ tc);
|
||||
|
||||
private:
|
||||
TabControl^ tabControl;
|
||||
void tabControl_Selected(Object^ sender, TabControlEventArgs^ e);
|
||||
|
||||
protected:
|
||||
virtual void WndProc(Message %m) override;
|
||||
};
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 229 KiB |
@@ -0,0 +1,45 @@
|
||||
#include "ui.h"
|
||||
#include "framework.h"
|
||||
#include <detours.h>
|
||||
#pragma comment(lib, "detours.lib")
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Windows::Forms;
|
||||
|
||||
[STAThread]
|
||||
int showUI() {
|
||||
if (Environment::OSVersion->Version->Major >= 6)
|
||||
SetProcessDPIAware();
|
||||
|
||||
Application::EnableVisualStyles();
|
||||
Application::SetCompatibleTextRenderingDefault(false);
|
||||
Application::Run(gcnew Launcher::ui());
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hookedMain(int argc, const char** argv, const char** envp)
|
||||
{
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
arg = argv[i];
|
||||
if (arg == "--launch" || nSkipLauncher)
|
||||
return divaMain(argc, argv, envp);
|
||||
}
|
||||
return showUI();
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
DisableThreadLibraryCalls(hModule);
|
||||
DetourTransactionBegin();
|
||||
DetourUpdateThread(GetCurrentThread());
|
||||
DetourAttach(&(PVOID&)divaMain, hookedMain);
|
||||
DetourTransactionCommit();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
int (__cdecl* divaMain)(int argc, const char** argv, const char** envp) = (int(__cdecl*)(int argc, const char** argv, const char** envp))0x140194D90;
|
||||
|
||||
using namespace std;
|
||||
|
||||
string arg;
|
||||
|
||||
wstring ExePath() {
|
||||
WCHAR buffer[MAX_PATH];
|
||||
GetModuleFileNameW(NULL, buffer, MAX_PATH);
|
||||
return wstring(buffer);
|
||||
}
|
||||
|
||||
wstring DirPath() {
|
||||
wstring exepath = ExePath();
|
||||
wstring::size_type pos = exepath.find_last_of(L"\\/");
|
||||
return exepath.substr(0, pos);
|
||||
}
|
||||
|
||||
wstring DIVA_EXECUTABLE_STRING = ExePath();
|
||||
LPCWSTR DIVA_EXECUTABLE = DIVA_EXECUTABLE_STRING.c_str();
|
||||
|
||||
wstring DIVA_EXECUTABLE_LAUNCH_STRING = DIVA_EXECUTABLE_STRING + L" --launch";
|
||||
LPWSTR DIVA_EXECUTABLE_LAUNCH = const_cast<WCHAR*>(DIVA_EXECUTABLE_LAUNCH_STRING.c_str());
|
||||
|
||||
wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\config.ini";
|
||||
LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str();
|
||||
|
||||
wstring COMPONENTS_FILE_STRING = DirPath() + L"\\plugins\\components.ini";
|
||||
LPCWSTR COMPONENTS_FILE = COMPONENTS_FILE_STRING.c_str();
|
||||
|
||||
int nDisplay = GetPrivateProfileIntW(L"resolution", L"display", 0, CONFIG_FILE);
|
||||
int nWidth = GetPrivateProfileIntW(L"resolution", L"width", 1280, CONFIG_FILE);
|
||||
int nHeight = GetPrivateProfileIntW(L"resolution", L"height", 720, CONFIG_FILE);
|
||||
|
||||
int nIntRes = GetPrivateProfileIntW(L"resolution", L"r.enable", FALSE, CONFIG_FILE);
|
||||
int nIntResWidth = GetPrivateProfileIntW(L"resolution", L"r.width", 1280, CONFIG_FILE);
|
||||
int nIntResHeight = GetPrivateProfileIntW(L"resolution", L"r.height", 720, CONFIG_FILE);
|
||||
|
||||
int nBitDepth = GetPrivateProfileIntW(L"resolution", L"bitdepth", 32, CONFIG_FILE);
|
||||
int nRefreshRate = GetPrivateProfileIntW(L"resolution", L"refreshrate", 60, CONFIG_FILE);
|
||||
|
||||
int nCursor = GetPrivateProfileIntW(L"patches", L"cursor", TRUE, CONFIG_FILE);
|
||||
int nHideFreeplay = GetPrivateProfileIntW(L"patches", L"hide_freeplay", FALSE, CONFIG_FILE);
|
||||
int nStatusIcons = GetPrivateProfileIntW(L"patches", L"status_icons", 0, CONFIG_FILE);
|
||||
int nHidePVWatermark = GetPrivateProfileIntW(L"patches", L"hide_pv_watermark", FALSE, CONFIG_FILE);
|
||||
int nNoPVUi = GetPrivateProfileIntW(L"patches", L"no_pv_ui", FALSE, CONFIG_FILE);
|
||||
int nHideVolCtrl = GetPrivateProfileIntW(L"patches", L"hide_volume", FALSE, CONFIG_FILE);
|
||||
int nNoLyrics = GetPrivateProfileIntW(L"patches", L"no_lyrics", FALSE, CONFIG_FILE);
|
||||
int nNoMovies = GetPrivateProfileIntW(L"patches", L"no_movies", FALSE, CONFIG_FILE);
|
||||
int nNoError = GetPrivateProfileIntW(L"patches", L"no_error", TRUE, CONFIG_FILE);
|
||||
|
||||
int nTAA = GetPrivateProfileIntW(L"graphics", L"TAA", TRUE, CONFIG_FILE);
|
||||
int nMLAA = GetPrivateProfileIntW(L"graphics", L"MLAA", TRUE, CONFIG_FILE);
|
||||
int nFPSLimit = GetPrivateProfileIntW(L"graphics", L"FPS.Limit", 0, CONFIG_FILE);
|
||||
|
||||
int nSkipLauncher = GetPrivateProfileIntW(L"launcher", L"skip", FALSE, CONFIG_FILE);
|
||||
|
||||
|
||||
// Custom function. Works like GetPrivateProfileIntW but returns bool. Can detect a numeric value or string.
|
||||
bool GetPrivateProfileBoolW(LPCWSTR lpAppName, LPCWSTR lpKeyName, bool default, LPCWSTR lpFileName)
|
||||
{
|
||||
wchar_t buffer[8];
|
||||
GetPrivateProfileStringW(lpAppName, lpKeyName, L"", buffer, 8, lpFileName);
|
||||
//MessageBoxW(NULL, buffer, NULL, 0);
|
||||
|
||||
for (wchar_t& chr : buffer)
|
||||
chr = towlower(chr);
|
||||
|
||||
bool out;
|
||||
if ((lstrcmpW(buffer, L"true") == 0) || (lstrcmpW(buffer, L"1") == 0))
|
||||
out = true;
|
||||
else if ((lstrcmpW(buffer, L"false") == 0) || (lstrcmpW(buffer, L"0") == 0))
|
||||
out = false;
|
||||
else
|
||||
out = default;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
struct componentInfo { const LPCWSTR name; LPCWSTR friendlyName; LPCWSTR description; System::IntPtr cb; };
|
||||
componentInfo componentsArray[] = {
|
||||
{ L"input_emulator", L"Input Emulator", L"Emulates input through keyboard and/or mouse.", System::IntPtr::Zero },
|
||||
{ L"touch_slider_emulator", L"Slider Emulator", L"Emulates slider through keyboard and/or mouse.", System::IntPtr::Zero },
|
||||
{ L"touch_panel_emulator", L"Touch Panel Emulator", L"Emulates touch panel through mouse.", System::IntPtr::Zero },
|
||||
|
||||
{ L"sys_timer", L"Timer Freeze", L"Freezes the PV select timer at 39 seconds.", System::IntPtr::Zero },
|
||||
|
||||
{ L"player_data_manager", L"Player Data Manager", L"Loads user-defined values into the PlayerData struct.\nRequired for modules and game mode modifiers.", System::IntPtr::Zero },
|
||||
|
||||
{ L"frame_rate_manager", L"Frame Rate Manager", L"Adjusts animations to the correct speed at different frame rates.\nOnly needed when FPS isn't locket at 60.", System::IntPtr::Zero },
|
||||
|
||||
{ L"stage_manager", L"Stage Manager", L"Allows for playing unlimited songs per session.", System::IntPtr::Zero },
|
||||
|
||||
{ L"fast_loader", L"Fast Loader", L"Skip or speed up unnecessary loading steps.", System::IntPtr::Zero },
|
||||
|
||||
{ L"camera_controller", L"Camera Controller", L"Enables freecam (toggled using F3).\nWASD to move, SPACE/CTRL for up/down, Q/R to rotate, R/F for zoom.\nHolding SHIFT/ALT changes control speed.", System::IntPtr::Zero },
|
||||
|
||||
{ L"scale_component", L"Scale Component", L"Scales the graphics output framebuffer to fill the screen/window.", System::IntPtr::Zero },
|
||||
|
||||
{ L"debug_component", L"Debug Component", L"Allows for changing game state (F4-F8 keys), using dev GUI and tests, and speeding up 2d animations/menus (hold SHIFT+TAB).", System::IntPtr::Zero },
|
||||
|
||||
{ L"fps_limiter", L"FPS Limiter", L"Lets you set a framerate cap. The value of the limit is in the options tab.", System::IntPtr::Zero },
|
||||
|
||||
{ L"target_inspector", L"Target Inspector", L"Enables hold transfers.", System::IntPtr::Zero },
|
||||
};
|
||||
|
||||
bool IsLineInFile(LPCSTR searchLine, LPCWSTR fileName)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
std::ifstream fileStream(fileName);
|
||||
|
||||
if (!fileStream.is_open())
|
||||
return false;
|
||||
|
||||
std::string line;
|
||||
|
||||
while (std::getline(fileStream, line))
|
||||
{
|
||||
if (line.compare(searchLine) == 0)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fileStream.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
void PrependFile(LPCSTR newStr, LPCWSTR fileName)
|
||||
{
|
||||
std::fstream fileStream(fileName);
|
||||
|
||||
if (!fileStream.is_open())
|
||||
return;
|
||||
|
||||
|
||||
std::string origStr;
|
||||
|
||||
// this is apparently more efficient than just going straight into the string
|
||||
fileStream.seekg(0, std::ios::end);
|
||||
origStr.reserve(fileStream.tellg());
|
||||
fileStream.seekg(0, std::ios::beg);
|
||||
origStr.assign((std::istreambuf_iterator<char>(fileStream)), std::istreambuf_iterator<char>());
|
||||
|
||||
std::string outStr = newStr;
|
||||
outStr += origStr;
|
||||
|
||||
fileStream.seekg(0, std::ios::beg);
|
||||
fileStream << outStr;
|
||||
fileStream.close();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user