forked from tiltedphoques/TiltedEvolution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (35 loc) · 1.3 KB
/
main.cpp
File metadata and controls
47 lines (35 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <TiltedOnlineApp.h>
#include <TiltedOnlinePCH.h>
#include <Commctrl.h>
#include <Windows.h>
#include <base/dialogues/win/TaskDialog.h>
std::unique_ptr<TiltedOnlineApp> g_appInstance{nullptr};
extern HICON g_SharedWindowIcon;
static void ShowAddressLibraryError(const wchar_t* apGamePath)
{
auto errorDetail = fmt::format(L"Looking for it here: {}\\Data\\SKSE\\Plugins", apGamePath);
Base::TaskDialog dia(g_SharedWindowIcon, L"Error", L"Failed to load Skyrim Address Library",
L"Make sure to use the All in one Anniversary Edition", errorDetail.c_str());
dia.AppendButton(0xBEEF, L"Visit Address Library modpage on nexusmods.com");
const int result = dia.Show();
if (result == 0xBEEF)
{
ShellExecuteW(nullptr, L"open", LR"(https://www.nexusmods.com/skyrimspecialedition/mods/32444?tab=files)",
nullptr, nullptr, SW_SHOWNORMAL);
}
exit(4);
}
void RunTiltedInit(const std::filesystem::path& acGamePath, const String& aExeVersion)
{
if (!VersionDb::Get().Load(acGamePath, aExeVersion))
{
ShowAddressLibraryError(acGamePath.c_str());
}
g_appInstance = std::make_unique<TiltedOnlineApp>();
TiltedOnlineApp::InstallHooks2();
TP_HOOK_COMMIT;
}
void RunTiltedApp()
{
g_appInstance->BeginMain();
}