Compare commits

..

No commits in common. "950844a14ba7fa693e22165100f288314fa934ec" and "508d23da5f6af43038fa95443b2acb48c3a98fc8" have entirely different histories.

8 changed files with 47 additions and 94 deletions

View File

@ -24,7 +24,7 @@ namespace GoldbergGUI.Core.Models
set set
{ {
_name = value; _name = value;
_comparableName = Regex.Replace(value, Misc.AlphaNumOnlyRegex, "").ToLower(); _comparableName = Regex.Replace(value, Misc.SpecialCharsRegex, "").ToLower();
} }
} }

View File

@ -177,7 +177,7 @@ namespace GoldbergGUI.Core.Services
public SteamApp GetAppByName(string name) public SteamApp GetAppByName(string name)
{ {
_log.Info($"Trying to get app {name}"); _log.Info($"Trying to get app {name}");
var comparableName = Regex.Replace(name, Misc.AlphaNumOnlyRegex, "").ToLower(); var comparableName = Regex.Replace(name, Misc.SpecialCharsRegex, "").ToLower();
var app = _caches[AppType.Game].Cache.FirstOrDefault(x => x.CompareName(comparableName)); var app = _caches[AppType.Game].Cache.FirstOrDefault(x => x.CompareName(comparableName));
if (app != null) _log.Info($"Successfully got app {app}"); if (app != null) _log.Info($"Successfully got app {app}");
return app; return app;

View File

@ -1,25 +1,42 @@
using System.Collections.ObjectModel;
namespace GoldbergGUI.Core.Utils namespace GoldbergGUI.Core.Utils
{ {
public static class Misc public class Misc
{ {
public const string AlphaNumOnlyRegex = "[^0-9a-zA-Z]+"; public const string SpecialCharsRegex = "[^0-9a-zA-Z]+";
} public const string DefaultLanguageSelection = "english";
public static readonly ObservableCollection<string> DefaultLanguages = new ObservableCollection<string>(new[]
public class GlobalHelp
{ {
public static string Header => "arabic",
"Information\n"; "bulgarian",
"schinese",
public static string TextPreLink => "tchinese",
"Usually these settings are saved under"; "czech",
"danish",
public static string Link => "%APPDATA%\\Goldberg SteamEmu Saves\\settings"; "dutch",
"english",
public static string TextPostLink => "finnish",
", which makes these " + "french",
"available for every game that uses the Goldberg Emulator. However, if you want to set specific settings " + "german",
"for certain games (e.g. different language), you can remove the \"Global\" checkmark next to the option " + "greek",
"and then change it. If you want to remove that setting, just empty the field while \"Global\" is " + "hungarian",
"unchecked. (Not implemented yet!)"; "italian",
"japanese",
"koreana",
"norwegian",
"polish",
"portuguese",
"brazilian",
"romanian",
"russian",
"spanish",
"latam",
"swedish",
"thai",
"turkish",
"ukrainian",
"vietnamese"
});
} }
} }

View File

@ -11,7 +11,6 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using GoldbergGUI.Core.Models; using GoldbergGUI.Core.Models;
using GoldbergGUI.Core.Services; using GoldbergGUI.Core.Services;
using GoldbergGUI.Core.Utils;
using Microsoft.Win32; using Microsoft.Win32;
using MvvmCross.Commands; using MvvmCross.Commands;
using MvvmCross.Logging; using MvvmCross.Logging;
@ -252,6 +251,9 @@ namespace GoldbergGUI.Core.ViewModels
} }
} }
public string AboutVersionText =>
FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
public string StatusText public string StatusText
{ {
get => _statusText; get => _statusText;
@ -262,11 +264,6 @@ namespace GoldbergGUI.Core.ViewModels
} }
} }
public static string AboutVersionText =>
FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
public static GlobalHelp G => new GlobalHelp();
// COMMANDS // // COMMANDS //
public IMvxCommand OpenFileCommand => new MvxAsyncCommand(OpenFile); public IMvxCommand OpenFileCommand => new MvxAsyncCommand(OpenFile);
@ -292,7 +289,6 @@ namespace GoldbergGUI.Core.ViewModels
DllPath = dialog.FileName; DllPath = dialog.FileName;
await ReadConfig().ConfigureAwait(false); await ReadConfig().ConfigureAwait(false);
if (!GoldbergApplied) await GetListOfDlc().ConfigureAwait(false);
MainWindowEnabled = true; MainWindowEnabled = true;
StatusText = "Ready."; StatusText = "Ready.";
} }
@ -349,7 +345,7 @@ namespace GoldbergGUI.Core.ViewModels
await FindIdInList(steamApps).ConfigureAwait(false); await FindIdInList(steamApps).ConfigureAwait(false);
} }
} }
await GetListOfDlc().ConfigureAwait(false);
MainWindowEnabled = true; MainWindowEnabled = true;
StatusText = "Ready."; StatusText = "Ready.";
} }
@ -507,22 +503,6 @@ namespace GoldbergGUI.Core.ViewModels
} }
}); });
public IMvxCommand OpenGlobalSettingsFolderCommand => new MvxCommand(OpenGlobalSettingsFolder);
private void OpenGlobalSettingsFolder()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
StatusText = "Can't open folder (Windows only)! Ready.";
return;
}
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Goldberg SteamEmu Saves", "settings");
var start = Process.Start("explorer.exe", path);
start?.Dispose();
}
// OTHER METHODS // // OTHER METHODS //
private void ResetForm() private void ResetForm()

View File

@ -20,20 +20,4 @@
<ProjectReference Include="..\GoldbergGUI.Core\GoldbergGUI.Core.csproj" /> <ProjectReference Include="..\GoldbergGUI.Core\GoldbergGUI.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Remove="publish\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="publish\**" />
</ItemGroup>
<ItemGroup>
<None Remove="publish\**" />
</ItemGroup>
<ItemGroup>
<Page Remove="publish\**" />
</ItemGroup>
</Project> </Project>

View File

@ -5,6 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" mc:Ignorable="d"
Title="GoldbergGUI" MinHeight="600" MinWidth="800" Background="#FFF0F0F0"> Title="GoldbergGUI" MinHeight="500" MinWidth="600" Background="#FFF0F0F0">
<Grid /> <Grid />
</views:MvxWindow> </views:MvxWindow>

View File

@ -96,54 +96,26 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Content="Account name" HorizontalAlignment="Left" Margin="0,0,10,0" /> <Label Content="Account name" HorizontalAlignment="Left" Margin="0,0,10,0" />
<TextBox Text="{Binding AccountName, Mode=TwoWay}" Height="20" Grid.Row="0" Grid.Column="1"/> <TextBox Text="{Binding AccountName, Mode=TwoWay}" Height="20" Grid.Row="0" Grid.Column="1"/>
<CheckBox Content="Global" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right"
Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="True"
IsEnabled="False"/>
<!--
IsEnabled="{Binding DllSelected, UpdateSourceTrigger=PropertyChanged}"/>
-->
<Label Content="Steam64ID" HorizontalAlignment="Left" Grid.Row="1" <Label Content="Steam64ID" HorizontalAlignment="Left" Grid.Row="1"
Grid.Column="0" Margin="0,0,10,0" /> Grid.Column="0" Margin="0,0,10,0" />
<TextBox Text="{Binding SteamId, Mode=TwoWay}" Grid.Column="1" Height="20" Grid.Row="1"/> <TextBox Text="{Binding SteamId, Mode=TwoWay}" Grid.Column="1" Height="20" Grid.Row="1"/>
<CheckBox Content="Global" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right"
Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="True"
IsEnabled="False"/>
<!--
IsEnabled="{Binding DllSelected, UpdateSourceTrigger=PropertyChanged}"/>
-->
<Label Content="Language" HorizontalAlignment="Left" Grid.Row="2" <Label Content="Language" HorizontalAlignment="Left" Grid.Row="2"
Grid.Column="0" Margin="0,0,10,0" /> Grid.Column="0" Margin="0,0,10,0" />
<ComboBox Grid.Row="2" Grid.Column="1" ItemsSource="{Binding SteamLanguages}" SelectedItem="{Binding SelectedLanguage}" VerticalAlignment="Center"/> <ComboBox Grid.Row="2" Grid.Column="1" ItemsSource="{Binding SteamLanguages}" SelectedItem="{Binding SelectedLanguage}"/>
<CheckBox Content="Global" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right"
Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="True"
IsEnabled="False"/>
<!--
IsEnabled="{Binding DllSelected, UpdateSourceTrigger=PropertyChanged}"/>
-->
<TextBlock TextWrapping="Wrap" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Margin="5,10,5,5">
<Run Text="{Binding G.Header, Mode=OneTime}" FontWeight="Bold"/><!--
--><Run Text="{Binding G.TextPreLink, Mode=OneTime}"/>
<Hyperlink Command="{Binding OpenGlobalSettingsFolderCommand}"><Run
Text="{Binding G.Link, Mode=OneTime}"/></Hyperlink><!--
--><Run Text="{Binding G.TextPostLink, Mode=OneTime}"/>
</TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
</TabItem> </TabItem>
<TabItem Header="About" HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Width="54"> <TabItem Header="About" HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Width="54">
<StackPanel Margin="10,20,10,10"> <StackPanel Margin="10,20,10,10">
<Label VerticalAlignment="Stretch" Content="{Binding AboutVersionText, Mode=OneTime}"> <Label VerticalAlignment="Stretch" Content="{Binding AboutVersionText}">
<Label.ContentTemplate> <Label.ContentTemplate>
<DataTemplate> <DataTemplate>
<StackPanel> <StackPanel>

View File

@ -1,6 +1,6 @@
using MvvmCross.Platforms.Wpf.Presenters.Attributes; using MvvmCross.Platforms.Wpf.Presenters.Attributes;
using MvvmCross.Platforms.Wpf.Views;
// ReSharper disable UnusedType.Global
namespace GoldbergGUI.WPF.Views namespace GoldbergGUI.WPF.Views
{ {
[MvxWindowPresentation(Identifier = nameof(SearchResultView), Modal = false)] [MvxWindowPresentation(Identifier = nameof(SearchResultView), Modal = false)]