Add SteamDB link

This commit is contained in:
Jeddunk 2023-12-24 00:38:06 +01:00
parent 95361440f6
commit cfb9be69f7
2 changed files with 37 additions and 6 deletions

View File

@ -86,6 +86,8 @@ namespace auto_creamapi.ViewModels
public IMvxCommand GoToForumThreadCommand => new MvxCommand(GoToForumThread); public IMvxCommand GoToForumThreadCommand => new MvxCommand(GoToForumThread);
public IMvxCommand GoToSteamdbCommand => new MvxCommand(GoToSteamdb);
// // ATTRIBUTES // // // // ATTRIBUTES // //
public bool MainWindowEnabled public bool MainWindowEnabled
@ -383,9 +385,29 @@ namespace auto_creamapi.ViewModels
{ {
var searchTerm = AppId; //$"{GameName.Replace(" ", "+")}+{appId}"; var searchTerm = AppId; //$"{GameName.Replace(" ", "+")}+{appId}";
var destinationUrl = var destinationUrl =
"https://cs.rin.ru/forum/search.php?keywords=" + $"https://cs.rin.ru/forum/search.php?keywords={searchTerm}&terms=any&fid[]=10&sf=firstpost&sr=topics&submit=Search";
searchTerm + var uri = new Uri(destinationUrl);
"&terms=any&fid[]=10&sf=firstpost&sr=topics&submit=Search"; 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 uri = new Uri(destinationUrl);
var process = new ProcessStartInfo(uri.AbsoluteUri) var process = new ProcessStartInfo(uri.AbsoluteUri)
{ {

View File

@ -56,9 +56,18 @@
<wcl:WatermarkTextBox Text="{Binding AppId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" <wcl:WatermarkTextBox Text="{Binding AppId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Right" Margin="0,10,10,0" Watermark="AppID" TextWrapping="Wrap" HorizontalAlignment="Right" Margin="0,10,10,0" Watermark="AppID" TextWrapping="Wrap"
VerticalAlignment="Top" Width="120" Padding="0" Grid.Row="1" /> VerticalAlignment="Top" Width="120" Padding="0" Grid.Row="1" />
<TextBlock Grid.Row="2" Margin="10,10,10,0"> <Grid Grid.Row="2" Margin="10,10,0,0">
<Hyperlink Command="{Binding GoToForumThreadCommand}">Search for cs.rin.ru thread</Hyperlink> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="0,0,10,0">
<Hyperlink Command="{Binding GoToForumThreadCommand}">Search for cs.rin.ru thread...</Hyperlink>
</TextBlock> </TextBlock>
<TextBlock Grid.Column="1" Margin="0,0,0,0">
<Hyperlink Command="{Binding GoToSteamdbCommand}">Open SteamDB DLC page...</Hyperlink>
</TextBlock>
</Grid>
<ComboBox ItemsSource="{Binding Path=Languages}" SelectedItem="{Binding Path=Lang, Mode=TwoWay}" <ComboBox ItemsSource="{Binding Path=Languages}" SelectedItem="{Binding Path=Lang, Mode=TwoWay}"
HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="120" Grid.Row="3" /> HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="120" Grid.Row="3" />
<CheckBox Content="Force offline mode" IsChecked="{Binding Offline, Mode=TwoWay}" <CheckBox Content="Force offline mode" IsChecked="{Binding Offline, Mode=TwoWay}"