Skip to content

Commit

Permalink
Improved PCGW link (#104)
Browse files Browse the repository at this point in the history
- Don't use app ID for Non-Steam games
- Naively fall back to using window title for other games
  • Loading branch information
Aemony authored Oct 7, 2023
1 parent 416f160 commit 24f5bd3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/control_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3676,17 +3676,24 @@ SK_ImGui_ControlPanel (void)

ImGui::Separator ();

if (SK::SteamAPI::AppID () != 0x0)
if ( (0 < config.steam.appid && config.steam.appid <= INT32_MAX) ||
0 < wcslen (rb.windows.focus.title))
{
if (ImGui::MenuItem ( "Check PCGamingWiki for this Game", "Third-Party Site", &selected ))
{
SK_SteamOverlay_GoToURL (
SK_FormatString (
"http://pcgamingwiki.com/api/appid.php?appid=%lu",
SK::SteamAPI::AppID ()
((0 < config.steam.appid && config.steam.appid <= INT32_MAX)
? SK_FormatString (
"https://pcgamingwiki.com/api/appid.php?appid=%lu",
SK::SteamAPI::AppID ())
: SK_FormatString (
"https://www.pcgamingwiki.com/w/index.php?search=%hs",
SK_WideCharToUTF8 (rb.windows.focus.title).c_str())
).c_str (), true
);
}

ImGui::Separator ();
}

if (sk::NVAPI::nv_hardware)
Expand Down

0 comments on commit 24f5bd3

Please sign in to comment.