aboutsummaryrefslogtreecommitdiff
path: root/c/ext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/ext.cpp')
-rw-r--r--c/ext.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/c/ext.cpp b/c/ext.cpp
index 77028d1..ea6718a 100644
--- a/c/ext.cpp
+++ b/c/ext.cpp
@@ -3,14 +3,12 @@
#include <string_view>
#include "data.h"
-#include "main.h"
+#include "window.h"
-extern Window* g_window;
-
-bool OpenOnline(int iEp)
+bool OpenOnline(const CfgA& cfg, int iEp)
{
- wchar_t url[sizeof(g_window->cfg.url)+4];
- Swprintf(url, L"%s%d", g_window->cfg.url, iEp);
+ wchar_t url[sizeof(cfg.url)+4];
+ Swprintf(url, L"%s%d", cfg.url, iEp);
INT_PTR r = reinterpret_cast<INT_PTR>(
ShellExecuteW(nullptr, L"open", url, nullptr, nullptr, SW_SHOWNORMAL));
if (r <= 32)
@@ -18,9 +16,8 @@ bool OpenOnline(int iEp)
return true;
}
-bool OpenWiki(int iEp)
+bool OpenWiki(const DlvDataA& d)
{
- const DlvDataA& d = g_window->fvDlv.At(iEp-1);
wchar_t url[sizeof(d.wiki)+35];
Swprintf(url, L"https://www.detectiveconanworld.com%s", d.wiki);
INT_PTR r = reinterpret_cast<INT_PTR>(
@@ -110,10 +107,10 @@ static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const roo
return false;
}
-bool OpenLocally(int iEp)
+bool OpenLocally(CfgA& cfg, const ElvDataA& e)
{
wchar_t file[MAX_PATH];
- if (FindMatchingFile(file, g_window->cfg.root, g_window->fvElv.At(iEp-1).siEp)) {
+ if (FindMatchingFile(file, cfg.root, e.siEp)) {
INT_PTR r = reinterpret_cast<INT_PTR>(
ShellExecuteW(nullptr, L"open", file, nullptr, nullptr, SW_SHOWNORMAL));
if (r <= 32)