From cfb9be69f7bfd0e07879cc8808cd03c8163524e8 Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Sun, 24 Dec 2023 00:38:06 +0100 Subject: [PATCH] Add SteamDB link --- auto-creamapi/ViewModels/MainViewModel.cs | 28 ++++++++++++++++++++--- auto-creamapi/Views/MainView.xaml | 15 +++++++++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/auto-creamapi/ViewModels/MainViewModel.cs b/auto-creamapi/ViewModels/MainViewModel.cs index 23bd933..ee5dcce 100644 --- a/auto-creamapi/ViewModels/MainViewModel.cs +++ b/auto-creamapi/ViewModels/MainViewModel.cs @@ -86,6 +86,8 @@ namespace auto_creamapi.ViewModels public IMvxCommand GoToForumThreadCommand => new MvxCommand(GoToForumThread); + public IMvxCommand GoToSteamdbCommand => new MvxCommand(GoToSteamdb); + // // ATTRIBUTES // // public bool MainWindowEnabled @@ -383,9 +385,29 @@ namespace auto_creamapi.ViewModels { var searchTerm = AppId; //$"{GameName.Replace(" ", "+")}+{appId}"; var destinationUrl = - "https://cs.rin.ru/forum/search.php?keywords=" + - searchTerm + - "&terms=any&fid[]=10&sf=firstpost&sr=topics&submit=Search"; + $"https://cs.rin.ru/forum/search.php?keywords={searchTerm}&terms=any&fid[]=10&sf=firstpost&sr=topics&submit=Search"; + var uri = new Uri(destinationUrl); + var process = new ProcessStartInfo(uri.AbsoluteUri) + { + UseShellExecute = true + }; + Process.Start(process); + } + else + { + _logger.LogError("OpenURL: Invalid AppID {AppId}", AppId); + Status = $"Could not open URL: Invalid AppID {AppId}"; + } + } + + private void GoToSteamdb() + { + Status = "Opening URL..."; + if (AppId > 0) + { + var searchTerm = AppId; //$"{GameName.Replace(" ", "+")}+{appId}"; + var destinationUrl = + $"https://steamdb.info/app/{searchTerm}/dlc/"; var uri = new Uri(destinationUrl); var process = new ProcessStartInfo(uri.AbsoluteUri) { diff --git a/auto-creamapi/Views/MainView.xaml b/auto-creamapi/Views/MainView.xaml index 154e9f4..719893e 100644 --- a/auto-creamapi/Views/MainView.xaml +++ b/auto-creamapi/Views/MainView.xaml @@ -56,9 +56,18 @@ - - Search for cs.rin.ru thread - + + + + + + + Search for cs.rin.ru thread... + + + Open SteamDB DLC page... + +