diff options
Diffstat (limited to 'c/ext.cpp')
-rw-r--r-- | c/ext.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -3,15 +3,14 @@ #include <string_view> #include "data.h" +#include "main.h" -extern CfgA& g_cfg; -extern FileView<ElvDataA> g_fvElv; -extern FileView<DlvDataA> g_fvDlv; +extern Window* g_window; bool OpenOnline(int iEp) { - wchar_t url[sizeof(g_cfg.url)+4]; - Swprintf(url, L"%s%d", g_cfg.url, iEp); + wchar_t url[sizeof(g_window->cfg.url)+4]; + Swprintf(url, L"%s%d", g_window->cfg.url, iEp); INT_PTR r = reinterpret_cast<INT_PTR>( ShellExecuteW(nullptr, L"open", url, nullptr, nullptr, SW_SHOWNORMAL)); if (r <= 32) @@ -21,7 +20,7 @@ bool OpenOnline(int iEp) bool OpenWiki(int iEp) { - const DlvDataA& d = g_fvDlv.At(iEp-1); + 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>( @@ -114,7 +113,7 @@ static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const roo bool OpenLocally(int iEp) { wchar_t file[MAX_PATH]; - if (FindMatchingFile(file, g_cfg.root, g_fvElv.At(iEp-1).siEp)) { + if (FindMatchingFile(file, g_window->cfg.root, g_window->fvElv.At(iEp-1).siEp)) { INT_PTR r = reinterpret_cast<INT_PTR>( ShellExecuteW(nullptr, L"open", file, nullptr, nullptr, SW_SHOWNORMAL)); if (r <= 32) |