FModel v4.1

This commit is contained in:
iAmAsval 2021-11-21 18:02:12 +01:00
parent d846750ac6
commit 9224207aeb
2 changed files with 11 additions and 13 deletions

View File

@ -27,7 +27,7 @@ namespace FModel.ViewModels.ApiEndpoints
private Game _game;
private readonly IDictionary<string, CommunityDesign> _communityDesigns = new Dictionary<string, CommunityDesign>();
private ApplicationViewModel _applicationView => ApplicationService.ApplicationView;
public FModelApi(IRestClient client) : base(client)
{
}
@ -70,7 +70,7 @@ namespace FModel.ViewModels.ApiEndpoints
{
return _backups ??= GetBackupsAsync(token, gameName).GetAwaiter().GetResult();
}
public async Task<Game> GetGamesAsync(CancellationToken token, string gameName)
{
var request = new RestRequest($"https://api.fmodel.app/v1/games/{gameName}", Method.GET);
@ -78,7 +78,7 @@ namespace FModel.ViewModels.ApiEndpoints
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, request.Resource);
return response.Data;
}
public Game GetGames(CancellationToken token, string gameName)
{
return _game ??= GetGamesAsync(token, gameName).GetAwaiter().GetResult();
@ -101,14 +101,14 @@ namespace FModel.ViewModels.ApiEndpoints
_communityDesigns[designName] = communityDesign;
return communityDesign;
}
public void CheckForUpdates(EUpdateMode updateMode)
{
AutoUpdater.ParseUpdateInfoEvent += ParseUpdateInfoEvent;
AutoUpdater.CheckForUpdateEvent += CheckForUpdateEvent;
AutoUpdater.Start($"https://api.fmodel.app/v1/infos/{updateMode}");
}
private void ParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
{
_infos = JsonConvert.DeserializeObject<Info>(args.RemoteData);
@ -122,7 +122,7 @@ namespace FModel.ViewModels.ApiEndpoints
};
}
}
private void CheckForUpdateEvent(UpdateInfoEventArgs args)
{
if (args is {CurrentVersion: { }})
@ -144,7 +144,7 @@ namespace FModel.ViewModels.ApiEndpoints
Buttons = MessageBoxButtons.YesNo(),
IsSoundEnabled = false
};
MessageBox.Show(messageBox);
if (messageBox.Result != MessageBoxResult.Yes) return;
@ -175,11 +175,11 @@ namespace FModel.ViewModels.ApiEndpoints
var request = new RestRequest(args.ChangelogURL, Method.GET);
var response = _client.Execute(request);
if (string.IsNullOrEmpty(response.Content)) return;
_applicationView.CUE4Parse.TabControl.AddTab($"Release Notes: {args.CurrentVersion}");
_applicationView.CUE4Parse.TabControl.SelectedTab.Highlighter = AvalonExtensions.HighlighterSelector("changelog");
_applicationView.CUE4Parse.TabControl.SelectedTab.SetDocumentText(response.Content, false);
UserSettings.Default.ShowChangelog = false;
}
}
}
}

View File

@ -1,14 +1,12 @@
# FModel [![Discord](https://discordapp.com/api/guilds/637265123144237061/widget.png?style=shield)](https://discord.gg/fdkNYYQ)
&ensp;&ensp;&ensp;&ensp;Open-source software for exploring Unreal Engine games' files. From seeing the properties of an asset to listening to your favorite audio files, it has never been easier to navigate inside a game's assets. FModel supports tens of file types and asset types, to display the most information possible and it also has the ability to let you <kbd>CTRL+LMB</kbd> on an asset path to display its properties too.
Beginner-friendly and open-source software for data-mining games made with Unreal Engine.
<img src="https://user-images.githubusercontent.com/26126862/119065662-52534800-b9de-11eb-85fd-a47797daa062.png" align="center" alt="FModel">
## Installation
To use FModel, you need to install the **[.NET 6](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-6.0.0-windows-x64-installer)** runtime on your computer
* **[Download](https://github.com/iAmAsval/FModel/releases/latest/download/FModel.zip)** the latest release.
* **Extract FModel.exe** somewhere on your PC and launch it
Follow [our documentation](https://fmodel.app/docs#installation)
## Authors