From 0c711f7da68a0ffc5be998ee5e5c4ebd63c29bbf Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Fri, 8 Jan 2021 18:36:57 +0100 Subject: [PATCH] Init commit --- .gitignore | 543 ++++++++++++++++++ .../.idea/codeStyles/codeStyleConfig.xml | 5 + .idea/.idea.GoldbergGUI/.idea/encodings.xml | 4 + .idea/.idea.GoldbergGUI/.idea/indexLayout.xml | 8 + .idea/.idea.GoldbergGUI/.idea/modules.xml | 8 + .../.idea/projectSettingsUpdater.xml | 6 + .idea/.idea.GoldbergGUI/.idea/vcs.xml | 6 + .idea/.idea.GoldbergGUI/riderModule.iml | 7 + GoldbergGUI.Core/App.cs | 20 + GoldbergGUI.Core/GoldbergGUI.Core.csproj | 25 + GoldbergGUI.Core/Models/SteamAppModel.cs | 61 ++ GoldbergGUI.Core/Services/GoldbergService.cs | 217 +++++++ GoldbergGUI.Core/Services/SteamService.cs | 201 +++++++ GoldbergGUI.Core/Utils/CustomMvxAppStart.cs | 29 + GoldbergGUI.Core/Utils/ISecrets.cs | 7 + GoldbergGUI.Core/Utils/Misc.cs | 42 ++ GoldbergGUI.Core/ViewModels/MainViewModel.cs | 328 +++++++++++ GoldbergGUI.WPF/App.xaml | 9 + GoldbergGUI.WPF/App.xaml.cs | 17 + GoldbergGUI.WPF/AssemblyInfo.cs | 10 + GoldbergGUI.WPF/GoldbergGUI.WPF.csproj | 17 + GoldbergGUI.WPF/MainWindow.xaml | 10 + GoldbergGUI.WPF/MainWindow.xaml.cs | 15 + GoldbergGUI.WPF/Views/MainView.xaml | 90 +++ GoldbergGUI.WPF/Views/MainView.xaml.cs | 17 + GoldbergGUI.sln | 31 + 26 files changed, 1733 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.idea.GoldbergGUI/.idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/.idea.GoldbergGUI/.idea/encodings.xml create mode 100644 .idea/.idea.GoldbergGUI/.idea/indexLayout.xml create mode 100644 .idea/.idea.GoldbergGUI/.idea/modules.xml create mode 100644 .idea/.idea.GoldbergGUI/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.GoldbergGUI/.idea/vcs.xml create mode 100644 .idea/.idea.GoldbergGUI/riderModule.iml create mode 100644 GoldbergGUI.Core/App.cs create mode 100644 GoldbergGUI.Core/GoldbergGUI.Core.csproj create mode 100644 GoldbergGUI.Core/Models/SteamAppModel.cs create mode 100644 GoldbergGUI.Core/Services/GoldbergService.cs create mode 100644 GoldbergGUI.Core/Services/SteamService.cs create mode 100644 GoldbergGUI.Core/Utils/CustomMvxAppStart.cs create mode 100644 GoldbergGUI.Core/Utils/ISecrets.cs create mode 100644 GoldbergGUI.Core/Utils/Misc.cs create mode 100644 GoldbergGUI.Core/ViewModels/MainViewModel.cs create mode 100644 GoldbergGUI.WPF/App.xaml create mode 100644 GoldbergGUI.WPF/App.xaml.cs create mode 100644 GoldbergGUI.WPF/AssemblyInfo.cs create mode 100644 GoldbergGUI.WPF/GoldbergGUI.WPF.csproj create mode 100644 GoldbergGUI.WPF/MainWindow.xaml create mode 100644 GoldbergGUI.WPF/MainWindow.xaml.cs create mode 100644 GoldbergGUI.WPF/Views/MainView.xaml create mode 100644 GoldbergGUI.WPF/Views/MainView.xaml.cs create mode 100644 GoldbergGUI.sln diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1ef113 --- /dev/null +++ b/.gitignore @@ -0,0 +1,543 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/intellij,rider,visualstudio,dotnetcore,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,rider,visualstudio,dotnetcore,windows + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bugfix +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +### Rider ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# End of https://www.toptal.com/developers/gitignore/api/intellij,rider,visualstudio,dotnetcore,windows diff --git a/.idea/.idea.GoldbergGUI/.idea/codeStyles/codeStyleConfig.xml b/.idea/.idea.GoldbergGUI/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/.idea/encodings.xml b/.idea/.idea.GoldbergGUI/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/.idea/indexLayout.xml b/.idea/.idea.GoldbergGUI/.idea/indexLayout.xml new file mode 100644 index 0000000..27ba142 --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/.idea/modules.xml b/.idea/.idea.GoldbergGUI/.idea/modules.xml new file mode 100644 index 0000000..13845fc --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/.idea/projectSettingsUpdater.xml b/.idea/.idea.GoldbergGUI/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..4bb9f4d --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/.idea/vcs.xml b/.idea/.idea.GoldbergGUI/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.GoldbergGUI/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.GoldbergGUI/riderModule.iml b/.idea/.idea.GoldbergGUI/riderModule.iml new file mode 100644 index 0000000..1a4e0d9 --- /dev/null +++ b/.idea/.idea.GoldbergGUI/riderModule.iml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/GoldbergGUI.Core/App.cs b/GoldbergGUI.Core/App.cs new file mode 100644 index 0000000..695c2f8 --- /dev/null +++ b/GoldbergGUI.Core/App.cs @@ -0,0 +1,20 @@ +using GoldbergGUI.Core.Utils; +using GoldbergGUI.Core.ViewModels; +using MvvmCross.IoC; +using MvvmCross.ViewModels; + +namespace GoldbergGUI.Core +{ + public class App : MvxApplication + { + public override void Initialize() + { + CreatableTypes() + .EndingWith("Service") + .AsInterfaces() + .RegisterAsLazySingleton(); + //RegisterAppStart(); + RegisterCustomAppStart>(); + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/GoldbergGUI.Core.csproj b/GoldbergGUI.Core/GoldbergGUI.Core.csproj new file mode 100644 index 0000000..7ee430e --- /dev/null +++ b/GoldbergGUI.Core/GoldbergGUI.Core.csproj @@ -0,0 +1,25 @@ + + + + netcoreapp3.1 + + + + + + + + + + + + + + + + + ..\..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + + + + diff --git a/GoldbergGUI.Core/Models/SteamAppModel.cs b/GoldbergGUI.Core/Models/SteamAppModel.cs new file mode 100644 index 0000000..1a13adf --- /dev/null +++ b/GoldbergGUI.Core/Models/SteamAppModel.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; +using System.Text.RegularExpressions; +using GoldbergGUI.Core.Utils; + +// ReSharper disable UnusedMember.Global +// ReSharper disable ClassNeverInstantiated.Global +// ReSharper disable CollectionNeverUpdated.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable StringLiteralTypo +// ReSharper disable InconsistentNaming +namespace GoldbergGUI.Core.Models +{ + public class SteamApp + { + private string _name; + private string _comparableName; + [JsonPropertyName("appid")] public int AppId { get; set; } + + [JsonPropertyName("name")] + public string Name + { + get => _name; + set + { + _name = value; + _comparableName = Regex.Replace(value, Misc.SpecialCharsRegex, "").ToLower(); + } + } + + public bool CompareName(string value) + { + return _comparableName.Equals(value); + } + + public override string ToString() + { + return $"{AppId}={Name}"; + } + } + + public class AppList + { + [JsonPropertyName("apps")] public List Apps { get; set; } + } + + public class SteamApps + { + [JsonPropertyName("applist")] public AppList AppList { get; set; } + } + public static class AppType + { + public const string Game = "game"; + public const string DLC = "dlc"; + public const string Music = "music"; + public const string Demo = "demo"; + public const string Ad = "advertising"; + public const string Mod = "mod"; + public const string Video = "video"; + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/Services/GoldbergService.cs b/GoldbergGUI.Core/Services/GoldbergService.cs new file mode 100644 index 0000000..a808f3f --- /dev/null +++ b/GoldbergGUI.Core/Services/GoldbergService.cs @@ -0,0 +1,217 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using GoldbergGUI.Core.Models; +using MvvmCross.Logging; + +namespace GoldbergGUI.Core.Services +{ + // downloads and updates goldberg emu + // sets up config files + // does file copy stuff + public interface IGoldbergService + { + public Task<(string accountName, long userSteamId)> Initialize(IMvxLog log); + public Task<(int appId, List dlcList)> Read(string path); + public Task Save(string path, int appId, List dlcList); + public bool GoldbergApplied(string path); + public void Download(); + public void Extract(string archivePath); + public Task GenerateInterfacesFile(string filePath); + } + + // ReSharper disable once UnusedType.Global + public class GoldbergService : IGoldbergService + { + private IMvxLog _log; + //private const string GoldbergUrl = "https://mr_goldberg.gitlab.io/goldberg_emulator/"; + private readonly string _goldbergPath = Path.Combine(Directory.GetCurrentDirectory(), "goldberg"); + private static readonly string GlobalSettingsPath = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "Goldberg SteamEmu Saves"); + private readonly string _accountNamePath = Path.Combine(GlobalSettingsPath, "settings/account_name.txt"); + private readonly string _userSteamIdPath = Path.Combine(GlobalSettingsPath, "settings/user_steam_id.txt"); + private readonly List _interfaceNames = new List + { + "SteamClient", + "SteamGameServer", + "SteamGameServerStats", + "SteamUser", + "SteamFriends", + "SteamUtils", + "SteamMatchMaking", + "SteamMatchMakingServers", + "STEAMUSERSTATS_INTERFACE_VERSION", + "STEAMAPPS_INTERFACE_VERSION", + "SteamNetworking", + "STEAMREMOTESTORAGE_INTERFACE_VERSION", + "STEAMSCREENSHOTS_INTERFACE_VERSION", + "STEAMHTTP_INTERFACE_VERSION", + "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION", + "STEAMUGC_INTERFACE_VERSION", + "STEAMAPPLIST_INTERFACE_VERSION", + "STEAMMUSIC_INTERFACE_VERSION", + "STEAMMUSICREMOTE_INTERFACE_VERSION", + "STEAMHTMLSURFACE_INTERFACE_VERSION_", + "STEAMINVENTORY_INTERFACE_V", + "SteamController", + "SteamMasterServerUpdater", + "STEAMVIDEO_INTERFACE_V" + }; + + // Call Download + // Get global settings + public async Task<(string accountName, long userSteamId)> Initialize(IMvxLog log) + { + _log = log; + var accountName = "Account name..."; + long steamId = -1; + await Task.Run(() => + { + if (File.Exists(_accountNamePath)) accountName = File.ReadLines(_accountNamePath).First().Trim(); + if (File.Exists(_userSteamIdPath) && + !long.TryParse(File.ReadLines(_userSteamIdPath).First().Trim(), out steamId)) + _log.Error("Invalid User Steam ID!"); + }).ConfigureAwait(false); + + return (accountName, steamId); + } + + // If first time, call GenerateInterfaces + // else try to read config + public async Task<(int appId, List dlcList)> Read(string path) + { + var appId = -1; + var dlcList = new List(); + var steamAppidTxt = Path.Combine(path, "steam_appid.txt"); + if (File.Exists(steamAppidTxt)) + { + await Task.Run(() => int.TryParse(File.ReadLines(steamAppidTxt).First().Trim(), out appId)) + .ConfigureAwait(false); + } + var dlcTxt = Path.Combine(path, "steam_settings", "DLC.txt"); + if (File.Exists(dlcTxt)) + { + var readAllLinesAsync = await File.ReadAllLinesAsync(dlcTxt).ConfigureAwait(false); + var expression = new Regex(@"(?.*) *= *(?.*)"); + foreach (var line in readAllLinesAsync) + { + var match = expression.Match(line); + if (match.Success) + dlcList.Add(new SteamApp {AppId = Convert.ToInt32(match.Groups["id"].Value), + Name = match.Groups["name"].Value}); + } + } + return (appId, dlcList); + } + + // If first time, rename original SteamAPI DLL to steam_api(64)_o.dll + // If not, rename current SteamAPI DLL to steam_api(64).dll.backup + // Copy Goldberg DLL to path + // Save configuration files + public async Task Save(string path, int appId, List dlcList) + { + const string x86Name = "steam_api"; + const string x64Name = "steam_api64"; + if (File.Exists(Path.Combine(path, $"{x86Name}.dll"))) + { + CopyDllFiles(path, x86Name); + } + + if (File.Exists(Path.Combine(path, $"{x64Name}.dll"))) + { + CopyDllFiles(path, x64Name); + } + + if (!Directory.Exists(Path.Combine(path, "steam_settings"))) + { + Directory.CreateDirectory(Path.Combine(path, "steam_settings")); + } + + await File.WriteAllTextAsync(Path.Combine(path, "steam_appid.txt"), appId.ToString()).ConfigureAwait(false); + var dlcString = ""; + dlcList.ForEach(x => dlcString += $"{x}\n"); + await File.WriteAllTextAsync(Path.Combine(path, "steam_settings", "DLC.txt"), dlcString).ConfigureAwait(false); + } + + private void CopyDllFiles(string path, string name) + { + var steamApiDll = Path.Combine(path, $"{name}.dll"); + var originalDll = Path.Combine(path, $"{name}_o.dll"); + var guiBackup = Path.Combine(path, $"{name}.dll.GOLDBERGGUIBACKUP"); + var goldbergDll = Path.Combine(_goldbergPath, $"{name}.dll"); + + if (!File.Exists(originalDll)) + File.Move(steamApiDll, originalDll); + else + { + File.Move(steamApiDll, guiBackup, true); + File.SetAttributes(guiBackup, FileAttributes.Hidden); + } + File.Copy(goldbergDll, steamApiDll); + } + + public bool GoldbergApplied(string path) + { + //throw new NotImplementedException(); + return true; + } + + // Get webpage + // Get commit, compare with local if exists, save it if false or missing + // Get latest archive if mismatch, call Extract + public void Download() + { + //throw new NotImplementedException(); + } + + // Empty subfolder ./goldberg/ + // Extract all from archive to subfolder ./goldberg/ + public void Extract(string archivePath) + { + //throw new NotImplementedException(); + } + + // https://gitlab.com/Mr_Goldberg/goldberg_emulator/-/blob/master/generate_interfaces_file.cpp + // (maybe) check DLL date first + public async Task GenerateInterfacesFile(string filePath) + { + //throw new NotImplementedException(); + // Get DLL content + var result = new HashSet(); + var dllContent = await File.ReadAllTextAsync(filePath).ConfigureAwait(false); + // find interfaces + foreach (var name in _interfaceNames) + { + FindInterfaces(ref result, dllContent, new Regex($"{name}\\d{{3}}")); + if (!FindInterfaces(ref result, dllContent, new Regex(@"STEAMCONTROLLER_INTERFACE_VERSION\d{3}"))) + { + FindInterfaces(ref result, dllContent, new Regex("STEAMCONTROLLER_INTERFACE_VERSION")); + } + } + var dirPath = Path.GetDirectoryName(filePath); + if (dirPath == null) return; + await using var destination = File.CreateText(dirPath + "/steam_interfaces.txt"); + foreach (var s in result) + { + await destination.WriteLineAsync(s).ConfigureAwait(false); + } + } + + private static bool FindInterfaces(ref HashSet result, string dllContent, Regex regex) + { + var success = false; + var matches = regex.Matches(dllContent); + foreach (Match match in matches) + { + success = true; + //result += $@"{match.Value}\n"; + result.Add(match.Value); + } + return success; + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/Services/SteamService.cs b/GoldbergGUI.Core/Services/SteamService.cs new file mode 100644 index 0000000..e11ecc7 --- /dev/null +++ b/GoldbergGUI.Core/Services/SteamService.cs @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using AngleSharp.Dom; +using AngleSharp.Html.Parser; +using GoldbergGUI.Core.Models; +using GoldbergGUI.Core.Utils; +using MvvmCross.Logging; +using NinjaNye.SearchExtensions; +using SteamStorefrontAPI; + +namespace GoldbergGUI.Core.Services +{ + // gets info from steam api + public interface ISteamService + { + public Task Initialize(IMvxLog log); + public IEnumerable GetListOfAppsByName(string name); + public SteamApp GetAppByName(string name); + public SteamApp GetAppById(int appid); + public Task> GetListOfDlc(SteamApp steamApp, bool useSteamDb); + } + + // ReSharper disable once UnusedType.Global + public class SteamService : ISteamService + { + private const string CachePath = "steamapps.json"; + private const string SteamUri = "https://api.steampowered.com/ISteamApps/GetAppList/v2/"; + + private const string UserAgent = + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " + + "Chrome/87.0.4280.88 Safari/537.36"; + + private HashSet _cache = new HashSet(); + private IMvxLog _log; + + public async Task Initialize(IMvxLog log) + { + _log = log; + _log.Info("Updating cache..."); + var updateNeeded = DateTime.Now.Subtract(File.GetLastWriteTimeUtc(CachePath)).TotalDays >= 1; + string cacheString; + if (updateNeeded) + { + _log.Info("Getting content from API..."); + var client = new HttpClient(); + var httpCall = client.GetAsync(SteamUri); + var response = await httpCall.ConfigureAwait(false); + var readAsStringAsync = response.Content.ReadAsStringAsync(); + var responseBody = await readAsStringAsync.ConfigureAwait(false); + _log.Info("Got content from API successfully. Writing to file..."); + + await File.WriteAllTextAsync(CachePath, responseBody, Encoding.UTF8).ConfigureAwait(false); + cacheString = responseBody; + _log.Info("Cache written to file successfully."); + } + else + { + _log.Info("Cache already up to date!"); + cacheString = await File.ReadAllTextAsync(CachePath).ConfigureAwait(false); + } + + var steamApps = JsonSerializer.Deserialize(cacheString); + _cache = new HashSet(steamApps.AppList.Apps); + _log.Info("Loaded cache into memory!"); + } + + public IEnumerable GetListOfAppsByName(string name) + { + var listOfAppsByName = _cache.Search(x => x.Name) + .SetCulture(StringComparison.OrdinalIgnoreCase) + .ContainingAll(name.Split(' ')).ToHashSet(); + foreach (var steamApp in listOfAppsByName) + { + var sa = Task.Run(async () => await AppDetails.GetAsync(steamApp.AppId).ConfigureAwait(false)).Result; + if (sa.Type != AppType.Game) listOfAppsByName.Remove(steamApp); + } + return listOfAppsByName; + } + + public SteamApp GetAppByName(string name) + { + _log.Info($"Trying to get app {name}"); + var comparableName = Regex.Replace(name, Misc.SpecialCharsRegex, "").ToLower(); + var app = _cache.FirstOrDefault(x => x.CompareName(comparableName)); + if (app != null) _log.Info($"Successfully got app {app}"); + return app; + } + + public SteamApp GetAppById(int appid) + { + _log.Info($"Trying to get app with ID {appid}"); + var app = _cache.FirstOrDefault(x => x.AppId.Equals(appid)); + if (app != null) _log.Info($"Successfully got app {app}"); + return app; + } + + public async Task> GetListOfDlc(SteamApp steamApp, bool useSteamDb) + { + _log.Info("Get DLC"); + var dlcList = new List(); + if (steamApp != null) + { + var task = AppDetails.GetAsync(steamApp.AppId); + var steamAppDetails = await task.ConfigureAwait(true); + if (steamAppDetails.Type == AppType.Game) + { + steamAppDetails.DLC.ForEach(x => + { + var result = _cache.FirstOrDefault(y => y.AppId.Equals(x)) ?? + new SteamApp {AppId = x, Name = $"Unknown DLC {x}"}; + dlcList.Add(result); + }); + + dlcList.ForEach(x => _log.Debug($"{x.AppId}={x.Name}")); + _log.Info("Got DLC successfully..."); + + // Get DLC from SteamDB + // Get Cloudflare cookie + // Scrape and parse HTML page + // Add missing to DLC list + if (useSteamDb) + { + var steamDbUri = new Uri($"https://steamdb.info/app/{steamApp.AppId}/dlc/"); + + /* var handler = new ClearanceHandler(); + + var client = new HttpClient(handler); + + var content = client.GetStringAsync(steamDbUri).Result; + _log.Debug(content); */ + + var client = new HttpClient(); + client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgent); + + _log.Info("Get SteamDB App"); + var httpCall = client.GetAsync(steamDbUri); + var response = await httpCall.ConfigureAwait(false); + _log.Debug(httpCall.Status.ToString()); + _log.Debug(response.EnsureSuccessStatusCode().ToString()); + + var readAsStringAsync = response.Content.ReadAsStringAsync(); + var responseBody = await readAsStringAsync.ConfigureAwait(false); + _log.Debug(readAsStringAsync.Status.ToString()); + + var parser = new HtmlParser(); + var doc = parser.ParseDocument(responseBody); + // Console.WriteLine(doc.DocumentElement.OuterHtml); + + var query1 = doc.QuerySelector("#dlc"); + if (query1 != null) + { + var query2 = query1.QuerySelectorAll(".app"); + foreach (var element in query2) + { + var dlcId = element.GetAttribute("data-appid"); + var dlcName = $"Unknown DLC {dlcId}"; + var query3 = element.QuerySelectorAll("td"); + if (query3 != null) dlcName = query3[1].Text().Replace("\n", "").Trim(); + + var dlcApp = new SteamApp {AppId = Convert.ToInt32(dlcId), Name = dlcName}; + var i = dlcList.FindIndex(x => x.AppId.Equals(dlcApp.AppId)); + if (i > -1) + { + if (dlcList[i].Name.Contains("Unknown DLC")) dlcList[i] = dlcApp; + } + else + { + dlcList.Add(dlcApp); + } + } + + dlcList.ForEach(x => _log.Debug($"{x.AppId}={x.Name}")); + _log.Info("Got DLC from SteamDB successfully..."); + } + else + { + _log.Error("Could not get DLC from SteamDB!"); + } + } + } + else + { + _log.Error("Could not get DLC: Steam App is not of type \"game\""); + } + } + else + { + _log.Error("Could not get DLC: Invalid Steam App"); + } + + return dlcList; + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/Utils/CustomMvxAppStart.cs b/GoldbergGUI.Core/Utils/CustomMvxAppStart.cs new file mode 100644 index 0000000..d5fcc3a --- /dev/null +++ b/GoldbergGUI.Core/Utils/CustomMvxAppStart.cs @@ -0,0 +1,29 @@ +using System; +using System.Threading.Tasks; +using MvvmCross.Exceptions; +using MvvmCross.Navigation; +using MvvmCross.ViewModels; + +namespace GoldbergGUI.Core.Utils +{ + // ReSharper disable once ClassNeverInstantiated.Global + public class CustomMvxAppStart : MvxAppStart where TViewModel : IMvxViewModel + { + public CustomMvxAppStart(IMvxApplication application, IMvxNavigationService navigationService) : base(application, navigationService) + { + } + + protected override async Task NavigateToFirstViewModel(object hint = null) + { + //return base.NavigateToFirstViewModel(hint); + try + { + await NavigationService.Navigate().ConfigureAwait(false); + } + catch (System.Exception exception) + { + throw exception.MvxWrap("Problem navigating to ViewModel {0}", typeof(TViewModel).Name); + } + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/Utils/ISecrets.cs b/GoldbergGUI.Core/Utils/ISecrets.cs new file mode 100644 index 0000000..3ab1d9e --- /dev/null +++ b/GoldbergGUI.Core/Utils/ISecrets.cs @@ -0,0 +1,7 @@ +namespace GoldbergGUI.Core.Utils +{ + public interface ISecrets + { + public string SteamWebApiKey(); + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/Utils/Misc.cs b/GoldbergGUI.Core/Utils/Misc.cs new file mode 100644 index 0000000..2a76437 --- /dev/null +++ b/GoldbergGUI.Core/Utils/Misc.cs @@ -0,0 +1,42 @@ +using System.Collections.ObjectModel; + +namespace GoldbergGUI.Core.Utils +{ + public class Misc + { + public const string SpecialCharsRegex = "[^0-9a-zA-Z]+"; + public const string DefaultLanguageSelection = "english"; + public static readonly ObservableCollection DefaultLanguages = new ObservableCollection(new[] + { + "arabic", + "bulgarian", + "schinese", + "tchinese", + "czech", + "danish", + "dutch", + "english", + "finnish", + "french", + "german", + "greek", + "hungarian", + "italian", + "japanese", + "koreana", + "norwegian", + "polish", + "portuguese", + "brazilian", + "romanian", + "russian", + "spanish", + "latam", + "swedish", + "thai", + "turkish", + "ukrainian", + "vietnamese" + }); + } +} \ No newline at end of file diff --git a/GoldbergGUI.Core/ViewModels/MainViewModel.cs b/GoldbergGUI.Core/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..885cc77 --- /dev/null +++ b/GoldbergGUI.Core/ViewModels/MainViewModel.cs @@ -0,0 +1,328 @@ +using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.IO; + using System.Linq; + using System.Threading.Tasks; + using GoldbergGUI.Core.Models; + using GoldbergGUI.Core.Services; + using Microsoft.Win32; + using MvvmCross.Commands; + using MvvmCross.Logging; + using MvvmCross.ViewModels; + + namespace GoldbergGUI.Core.ViewModels +{ + // ReSharper disable once ClassNeverInstantiated.Global + public class MainViewModel : MvxViewModel + { + private string _dllPath; + private string _gameName; + + private int _appId; + + //private SteamApp _currentGame; + private ObservableCollection _dlcs; + private string _accountName; + private long _steamId; + private bool _offline; + private bool _disableNetworking; + private bool _disableOverlay; + + private readonly ISteamService _steam; + private readonly IGoldbergService _goldberg; + private readonly IMvxLog _log; + private bool _mainWindowEnabled; + + public MainViewModel(ISteamService steam, IGoldbergService goldberg, IMvxLog log) + { + _steam = steam; + _goldberg = goldberg; + _log = log; + } + + public override void Prepare() + { + base.Prepare(); + Task.Run(async () => + { + MainWindowEnabled = false; + ResetForm(); + await _steam.Initialize(_log).ConfigureAwait(false); + var (accountName, userSteamId) = await _goldberg.Initialize(_log).ConfigureAwait(false); + AccountName = accountName; + SteamId = userSteamId; + MainWindowEnabled = true; + }); + } + + public override async Task Initialize() + { + _log.Info("Init"); + await base.Initialize().ConfigureAwait(false); + } + + // PROPERTIES // + + public string DllPath + { + get => _dllPath; + private set + { + _dllPath = value; + RaisePropertyChanged(() => DllPath); + } + } + + public string GameName + { + get => _gameName; + set + { + _gameName = value; + RaisePropertyChanged(() => GameName); + } + } + + public int AppId + { + get => _appId; + set + { + _appId = value; + RaisePropertyChanged(() => AppId); + Task.Run(async () => await GetNameById().ConfigureAwait(false)); + } + } + + // ReSharper disable once InconsistentNaming + public ObservableCollection DLCs + { + get => _dlcs; + private set + { + _dlcs = value; + RaisePropertyChanged(() => DLCs); + } + } + + public string AccountName + { + get => _accountName; + set + { + _accountName = value; + RaisePropertyChanged(() => AccountName); + } + } + + public long SteamId + { + get => _steamId; + set + { + _steamId = value; + RaisePropertyChanged(() => SteamId); + } + } + + public bool Offline + { + get => _offline; + set + { + _offline = value; + RaisePropertyChanged(() => Offline); + } + } + + public bool DisableNetworking + { + get => _disableNetworking; + set + { + _disableNetworking = value; + RaisePropertyChanged(() => DisableNetworking); + } + } + + public bool DisableOverlay + { + get => _disableOverlay; + set + { + _disableOverlay = value; + RaisePropertyChanged(() => DisableOverlay); + } + } + + public bool MainWindowEnabled + { + get => _mainWindowEnabled; + set + { + _mainWindowEnabled = value; + RaisePropertyChanged(() => MainWindowEnabled); + } + } + + // COMMANDS // + + public IMvxCommand OpenFileCommand => new MvxAsyncCommand(OpenFile); + + private async Task OpenFile() + { + var dialog = new OpenFileDialog + { + Filter = "SteamAPI DLL|steam_api.dll;steam_api64.dll|" + + "All files (*.*)|*.*", + Multiselect = false, + Title = "Select SteamAPI DLL..." + }; + if (dialog.ShowDialog() != true) + { + _log.Warn("File selection canceled."); + return; + } + DllPath = dialog.FileName; + //_goldberg.GenerateInterfacesFile(filePath); + await ReadConfig().ConfigureAwait(false); + } + + public IMvxCommand FindIdCommand => new MvxCommand(FindId); + + private void FindId() + { + if (GameName.Contains("Game name...")) + { + _log.Error("No game name entered!"); + return; + } + var appByName = _steam.GetAppByName(_gameName); + if (appByName != null) + { + GameName = appByName.Name; + AppId = appByName.AppId; + } + else + { + _log.Warn("Steam app could not be found!"); + } + } + + //public IMvxCommand GetNameByIdCommand => new MvxAsyncCommand(GetNameById); + + private async Task GetNameById() + { + if (AppId <= 0) + { + _log.Error("Invalid Steam App!"); + return; + } + var steamApp = await Task.Run(() => _steam.GetAppById(AppId)).ConfigureAwait(false); + if (steamApp != null) GameName = steamApp.Name; + } + + public IMvxCommand GetListOfDlcCommand => new MvxAsyncCommand(GetListOfDlc); + + private async Task GetListOfDlc() + { + if (AppId <= 0) + { + _log.Error("Invalid Steam App!"); + return; + } + MainWindowEnabled = false; + var listOfDlc = await _steam.GetListOfDlc(new SteamApp {AppId = AppId, Name = GameName}, true).ConfigureAwait(false); + DLCs = new MvxObservableCollection(listOfDlc); + MainWindowEnabled = true; + } + + public IMvxCommand SaveConfigCommand => new MvxAsyncCommand(SaveConfig); + + private async Task SaveConfig() + { + if (DllPath.Contains("Path to game's steam_api(64).dll")) + { + _log.Error("No DLL selected!"); + return; + } + _log.Info("Saving..."); + if (!GetDllPathDir(out var dirPath)) return; + MainWindowEnabled = false; + await _goldberg.Save(dirPath, AppId, DLCs.ToList()).ConfigureAwait(false); + MainWindowEnabled = true; + } + + public IMvxCommand ResetConfigCommand => new MvxAsyncCommand(ResetConfig); + + private async Task ResetConfig() + { + if (DllPath.Contains("Path to game's steam_api(64).dll")) + { + _log.Error("No DLL selected!"); + return; + } + _log.Info("Reset form..."); + MainWindowEnabled = false; + await ReadConfig().ConfigureAwait(false); + MainWindowEnabled = true; + } + + public IMvxCommand GenerateSteamInterfacesCommand => new MvxAsyncCommand(GenerateSteamInterfaces); + + private async Task GenerateSteamInterfaces() + { + if (DllPath.Contains("Path to game's steam_api(64).dll")) + { + _log.Error("No DLL selected!"); + return; + } + + _log.Info("Generate steam_interfaces.txt..."); + MainWindowEnabled = false; + await _goldberg.GenerateInterfacesFile(DllPath).ConfigureAwait(false); + MainWindowEnabled = true; + } + + // OTHER METHODS // + + private void ResetForm() + { + DllPath = "Path to game's steam_api(64).dll..."; + GameName = "Game name..."; + AppId = -1; + DLCs = new ObservableCollection(); + AccountName = "Account name..."; + SteamId = -1; + Offline = false; + DisableNetworking = false; + DisableOverlay = false; + } + + private async Task ReadConfig() + { + if (!GetDllPathDir(out var dirPath)) return; + MainWindowEnabled = false; + List dlcList; + (AppId, dlcList) = await _goldberg.Read(dirPath).ConfigureAwait(false); + DLCs = new ObservableCollection(dlcList); + MainWindowEnabled = true; + } + + private bool GetDllPathDir(out string dirPath) + { + if (DllPath.Contains("Path to game's steam_api(64).dll")) + { + _log.Error("No DLL selected!"); + dirPath = null; + return false; + } + + dirPath = Path.GetDirectoryName(DllPath); + if (dirPath != null) return true; + + _log.Error($"Invalid directory for {DllPath}."); + return false; + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.WPF/App.xaml b/GoldbergGUI.WPF/App.xaml new file mode 100644 index 0000000..59a88cb --- /dev/null +++ b/GoldbergGUI.WPF/App.xaml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/GoldbergGUI.WPF/App.xaml.cs b/GoldbergGUI.WPF/App.xaml.cs new file mode 100644 index 0000000..e3b871f --- /dev/null +++ b/GoldbergGUI.WPF/App.xaml.cs @@ -0,0 +1,17 @@ +using MvvmCross.Core; +using MvvmCross.Platforms.Wpf.Core; +using MvvmCross.Platforms.Wpf.Views; + +namespace GoldbergGUI.WPF +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : MvxApplication + { + public App() + { + this.RegisterSetupType>(); + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.WPF/AssemblyInfo.cs b/GoldbergGUI.WPF/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/GoldbergGUI.WPF/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] \ No newline at end of file diff --git a/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj b/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj new file mode 100644 index 0000000..43d989b --- /dev/null +++ b/GoldbergGUI.WPF/GoldbergGUI.WPF.csproj @@ -0,0 +1,17 @@ + + + + WinExe + netcoreapp3.1 + true + + + + + + + + + + + diff --git a/GoldbergGUI.WPF/MainWindow.xaml b/GoldbergGUI.WPF/MainWindow.xaml new file mode 100644 index 0000000..313c271 --- /dev/null +++ b/GoldbergGUI.WPF/MainWindow.xaml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/GoldbergGUI.WPF/MainWindow.xaml.cs b/GoldbergGUI.WPF/MainWindow.xaml.cs new file mode 100644 index 0000000..6f788af --- /dev/null +++ b/GoldbergGUI.WPF/MainWindow.xaml.cs @@ -0,0 +1,15 @@ +using MvvmCross.Platforms.Wpf.Views; + +namespace GoldbergGUI.WPF +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : MvxWindow + { + public MainWindow() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/GoldbergGUI.WPF/Views/MainView.xaml b/GoldbergGUI.WPF/Views/MainView.xaml new file mode 100644 index 0000000..85fd0aa --- /dev/null +++ b/GoldbergGUI.WPF/Views/MainView.xaml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + +