mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
FModel v4.0.0.1
This commit is contained in:
parent
eecc708cba
commit
a86de258b3
|
|
@ -1 +1 @@
|
|||
Subproject commit c2535e18b0dd26c8173c73ba26f58d0c55afc0b8
|
||||
Subproject commit 70d417009d729260486d905eb5d10f45c78cfec7
|
||||
|
|
@ -80,6 +80,7 @@ namespace FModel
|
|||
Icon = MessageBoxImage.Error,
|
||||
Buttons = new[]
|
||||
{
|
||||
MessageBoxButtons.Custom("Reset Settings", EErrorKind.ResetSettings),
|
||||
MessageBoxButtons.Custom("Restart", EErrorKind.Restart),
|
||||
MessageBoxButtons.Custom("OK", EErrorKind.Ignore)
|
||||
},
|
||||
|
|
@ -89,6 +90,9 @@ namespace FModel
|
|||
MessageBox.Show(messageBox);
|
||||
if (messageBox.Result == MessageBoxResult.Custom && (EErrorKind) messageBox.ButtonPressed.Id != EErrorKind.Ignore)
|
||||
{
|
||||
if ((EErrorKind) messageBox.ButtonPressed.Id == EErrorKind.ResetSettings)
|
||||
UserSettings.Delete();
|
||||
|
||||
ApplicationService.ApplicationView.Restart();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace FModel.Creator.Bases.FN
|
|||
if (Object.TryGetValue(out FText shortDescription, "ShortDescription", "UIDisplaySubName"))
|
||||
ShortDescription = shortDescription.Text;
|
||||
else if (Object.ExportType.Equals("AthenaItemWrapDefinition", StringComparison.OrdinalIgnoreCase))
|
||||
ShortDescription = "Wrap";
|
||||
ShortDescription = Utils.GetLocalizedResource("Fort.Cosmetics", "ItemWrapShortDescription", "Wrap");
|
||||
|
||||
// Only works on non-cataba designs
|
||||
if (Object.TryGetValue(out FStructFallback eventArrowColor, "EventArrowColor") &&
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ namespace FModel
|
|||
|
||||
public enum EErrorKind
|
||||
{
|
||||
Close,
|
||||
Ignore,
|
||||
Restart
|
||||
Restart,
|
||||
ResetSettings
|
||||
}
|
||||
|
||||
public enum SettingsOut
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<UseWPF>true</UseWPF>
|
||||
<ApplicationIcon>FModel.ico</ApplicationIcon>
|
||||
<Version>4.0.0</Version>
|
||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||
<FileVersion>4.0.0.0</FileVersion>
|
||||
<AssemblyVersion>4.0.0.1</AssemblyVersion>
|
||||
<FileVersion>4.0.0.1</FileVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsPublishable>true</IsPublishable>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ namespace FModel.Settings
|
|||
File.WriteAllText(FilePath, JsonConvert.SerializeObject(Default, Formatting.Indented));
|
||||
}
|
||||
|
||||
public static void Delete()
|
||||
{
|
||||
if (File.Exists(FilePath)) File.Delete(FilePath);
|
||||
}
|
||||
|
||||
private string _outputDirectory;
|
||||
public string OutputDirectory
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FModel.ViewModels.ApiEndpoints.Models;
|
||||
|
|
@ -16,7 +15,7 @@ namespace FModel.ViewModels.ApiEndpoints
|
|||
|
||||
public async Task<AesResponse> GetAesKeysAsync(CancellationToken token)
|
||||
{
|
||||
var request = new RestRequest("https://benbotfn.tk/api/v2/aes", Method.GET)
|
||||
var request = new RestRequest("https://benbot.app/api/v2/aes", Method.GET)
|
||||
{
|
||||
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
|
||||
};
|
||||
|
|
@ -32,7 +31,7 @@ namespace FModel.ViewModels.ApiEndpoints
|
|||
|
||||
public async Task<MappingsResponse[]> GetMappingsAsync(CancellationToken token)
|
||||
{
|
||||
var request = new RestRequest("https://benbotfn.tk/api/v1/mappings", Method.GET)
|
||||
var request = new RestRequest("https://benbot.app/api/v1/mappings", Method.GET)
|
||||
{
|
||||
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,17 +53,17 @@ namespace FModel.ViewModels.ApiEndpoints
|
|||
return _infos ?? GetInfosAsync(token, updateMode).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public async Task<Backup[]> GetBackupsAsync(CancellationToken token, FGame game)
|
||||
public async Task<Backup[]> GetBackupsAsync(CancellationToken token, string gameName)
|
||||
{
|
||||
var request = new RestRequest($"https://api.fmodel.app/v1/backups/{game}", Method.GET);
|
||||
var request = new RestRequest($"https://api.fmodel.app/v1/backups/{gameName}", Method.GET);
|
||||
var response = await _client.ExecuteAsync<Backup[]>(request, token).ConfigureAwait(false);
|
||||
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, request.Resource);
|
||||
return response.Data;
|
||||
}
|
||||
|
||||
public Backup[] GetBackups(CancellationToken token, FGame game)
|
||||
public Backup[] GetBackups(CancellationToken token, string gameName)
|
||||
{
|
||||
return _backups ??= GetBackupsAsync(token, game).GetAwaiter().GetResult();
|
||||
return _backups ??= GetBackupsAsync(token, gameName).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public async Task<CommunityDesign> GetDesignAsync(string designName)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace FModel.ViewModels
|
|||
private ThreadWorkerViewModel _threadWorkerView => ApplicationService.ThreadWorkerView;
|
||||
private ApiEndpointViewModel _apiEndpointView => ApplicationService.ApiEndpointView;
|
||||
private ApplicationViewModel _applicationView => ApplicationService.ApplicationView;
|
||||
private readonly FGame _game;
|
||||
private readonly string _gameName;
|
||||
|
||||
private Backup _selectedBackup;
|
||||
public Backup SelectedBackup
|
||||
|
|
@ -35,9 +35,9 @@ namespace FModel.ViewModels
|
|||
public ObservableCollection<Backup> Backups { get; }
|
||||
public ICollectionView BackupsView { get; }
|
||||
|
||||
public BackupManagerViewModel(FGame game)
|
||||
public BackupManagerViewModel(string gameName)
|
||||
{
|
||||
_game = game;
|
||||
_gameName = gameName;
|
||||
Backups = new ObservableCollection<Backup>();
|
||||
BackupsView = new ListCollectionView(Backups) {SortDescriptions = {new SortDescription("FileName", ListSortDirection.Ascending)}};
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ namespace FModel.ViewModels
|
|||
{
|
||||
await _threadWorkerView.Begin(cancellationToken =>
|
||||
{
|
||||
var backups = _apiEndpointView.FModelApi.GetBackups(cancellationToken, _game);
|
||||
var backups = _apiEndpointView.FModelApi.GetBackups(cancellationToken, _gameName);
|
||||
if (backups == null) return;
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
|
|
@ -62,7 +62,7 @@ namespace FModel.ViewModels
|
|||
await _threadWorkerView.Begin(_ =>
|
||||
{
|
||||
var backupFolder = Path.Combine(UserSettings.Default.OutputDirectory, "Backups");
|
||||
var fileName = $"{_game}_{DateTime.Now:MMddyyyy}.fbkp";
|
||||
var fileName = $"{_gameName}_{DateTime.Now:MMddyyyy}.fbkp";
|
||||
var fullPath = Path.Combine(backupFolder, fileName);
|
||||
|
||||
using var fileStream = new FileStream(fullPath, FileMode.Create);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace FModel.ViewModels.Commands
|
|||
Helper.OpenWindow<AdonisWindow>("AES Manager", () => new AesManager().Show());
|
||||
break;
|
||||
case "Directory_Backup":
|
||||
Helper.OpenWindow<AdonisWindow>("Backup Manager", () => new BackupManager(contextViewModel.CUE4Parse.Game).Show());
|
||||
Helper.OpenWindow<AdonisWindow>("Backup Manager", () => new BackupManager(contextViewModel.CUE4Parse.Provider.GameName).Show());
|
||||
break;
|
||||
case "Views_AudioPlayer":
|
||||
Helper.OpenWindow<AdonisWindow>("Audio Player", () => new AudioPlayer().Show());
|
||||
|
|
|
|||
|
|
@ -28,6 +28,13 @@ namespace FModel.ViewModels
|
|||
get => _showCities;
|
||||
set => SetProperty(ref _showCities, value, nameof(ShowCities));
|
||||
}
|
||||
|
||||
private bool _showLandmarks;
|
||||
public bool ShowLandmarks
|
||||
{
|
||||
get => _showLandmarks;
|
||||
set => SetProperty(ref _showLandmarks, value, nameof(ShowLandmarks));
|
||||
}
|
||||
|
||||
private bool _showPatrolPaths;
|
||||
public bool ShowPatrolPaths
|
||||
|
|
@ -49,6 +56,13 @@ namespace FModel.ViewModels
|
|||
get => _citiesImage;
|
||||
set => SetProperty(ref _citiesImage, value);
|
||||
}
|
||||
|
||||
private BitmapImage _landmarksImage;
|
||||
public BitmapImage LandmarksImage
|
||||
{
|
||||
get => _landmarksImage;
|
||||
set => SetProperty(ref _landmarksImage, value);
|
||||
}
|
||||
|
||||
private BitmapImage _patrolPathImage;
|
||||
public BitmapImage PatrolPathImage
|
||||
|
|
@ -81,6 +95,8 @@ namespace FModel.ViewModels
|
|||
c.DrawBitmap(_mapBitmap, 0, 0);
|
||||
if (ShowCities)
|
||||
c.DrawBitmap(_citiesBitmap, 0, 0);
|
||||
if (ShowLandmarks)
|
||||
c.DrawBitmap(_landmarksBitmap, 0, 0);
|
||||
if (ShowPatrolPaths)
|
||||
c.DrawBitmap(_patrolPathBitmap, 0, 0);
|
||||
|
||||
|
|
@ -98,7 +114,12 @@ namespace FModel.ViewModels
|
|||
{
|
||||
switch (propertyName)
|
||||
{
|
||||
case nameof(ShowCities) when _citiesBitmap == null && _mapBitmap != null:
|
||||
case nameof(ShowCities) when _citiesBitmap == null && _landmarksBitmap == null && _mapBitmap != null:
|
||||
{
|
||||
await LoadCities();
|
||||
break;
|
||||
}
|
||||
case nameof(ShowLandmarks) when _landmarksBitmap == null && _citiesBitmap == null && _mapBitmap != null:
|
||||
{
|
||||
await LoadCities();
|
||||
break;
|
||||
|
|
@ -127,6 +148,7 @@ namespace FModel.ViewModels
|
|||
private const int WorldRadius = 135000;
|
||||
private SKBitmap _mapBitmap;
|
||||
private SKBitmap _citiesBitmap;
|
||||
private SKBitmap _landmarksBitmap;
|
||||
private SKBitmap _patrolPathBitmap;
|
||||
private readonly SKBitmap _pinBitmap =
|
||||
SKBitmap.Decode(Application.GetResourceStream(new Uri("pack://application:,,,/Resources/pin.png"))?.Stream);
|
||||
|
|
@ -141,7 +163,7 @@ namespace FModel.ViewModels
|
|||
private readonly SKPaint _pathPaint = new()
|
||||
{
|
||||
IsAntialias = true, FilterQuality = SKFilterQuality.High, IsStroke = true,
|
||||
Style = SKPaintStyle.Stroke, StrokeWidth = 5, Color = SKColors.Red,
|
||||
Style = SKPaintStyle.Stroke, StrokeWidth = 10, Color = SKColors.Red,
|
||||
ImageFilter = SKImageFilter.CreateDropShadow(4, 4, 8, 8, SKColors.Black)
|
||||
};
|
||||
|
||||
|
|
@ -173,27 +195,38 @@ namespace FModel.ViewModels
|
|||
await _threadWorkerView.Begin(_ =>
|
||||
{
|
||||
_citiesBitmap = new SKBitmap(_mapBitmap.Width, _mapBitmap.Height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
||||
using var c = new SKCanvas(_citiesBitmap);
|
||||
_landmarksBitmap = new SKBitmap(_mapBitmap.Width, _mapBitmap.Height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
||||
using var cities = new SKCanvas(_citiesBitmap);
|
||||
using var landmarks = new SKCanvas(_landmarksBitmap);
|
||||
if (Utils.TryLoadObject("FortniteGame/Content/Quests/QuestIndicatorData", out UObject indicatorData) &&
|
||||
indicatorData.TryGetValue(out FStructFallback[] challengeMapPoiData, "ChallengeMapPoiData"))
|
||||
{
|
||||
foreach (var poiData in challengeMapPoiData)
|
||||
{
|
||||
if (!poiData.TryGetValue(out FSoftObjectPath discoveryQuest, "DiscoveryQuest") ||
|
||||
!poiData.TryGetValue(out FText text, "Text") ||
|
||||
!poiData.TryGetValue(out FVector worldLocation, "WorldLocation") ||
|
||||
discoveryQuest.AssetPathName.Text.Contains("Landmarks")) continue;
|
||||
!poiData.TryGetValue(out FText text, "Text") || string.IsNullOrEmpty(text.Text) ||
|
||||
!poiData.TryGetValue(out FVector worldLocation, "WorldLocation")) continue;
|
||||
|
||||
var shaper = new CustomSKShaper(_imagePaint.Typeface);
|
||||
var shapedText = shaper.Shape(text.Text, _imagePaint);
|
||||
|
||||
var vector = GetMapPosition(worldLocation);
|
||||
c.DrawPoint(vector.X, vector.Y, _pathPaint);
|
||||
c.DrawBitmap(_cityPinBitmap, vector.X - 50, vector.Y - 90, _imagePaint);
|
||||
c.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _imagePaint);
|
||||
|
||||
if (discoveryQuest.AssetPathName.Text.Contains("landmarks", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
landmarks.DrawPoint(vector.X, vector.Y, _pathPaint);
|
||||
landmarks.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _imagePaint);
|
||||
}
|
||||
else
|
||||
{
|
||||
cities.DrawPoint(vector.X, vector.Y, _pathPaint);
|
||||
cities.DrawBitmap(_cityPinBitmap, vector.X - 50, vector.Y - 90, _imagePaint);
|
||||
cities.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _imagePaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CitiesImage = GetImageSource(_citiesBitmap);
|
||||
LandmarksImage = GetImageSource(_landmarksBitmap);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
<TextBlock Text="				" FontSize="25" FontWeight="700" Height="2" Foreground="Transparent" HorizontalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<TextBlock FontSize="12" Foreground="#727272" TextWrapping="Wrap" Margin="0 0 0 30"
|
||||
Text="Maiky ♥, HYPEX ♥, VenomLeaks ♥, JayKey ♥, Fevers ♥, Netu ♥, TheGameVlog ♥, Quentin ♥, Mikey, kyle, Yanteh, Shiina, SexyNutella, Alexander, Jinx, Tector, s0ll, imatrix, LamZykoss, Frenzy Leaks, LlamaLeaks, XTigerHyperX, FunGames, WeLoveFortnite." />
|
||||
Text="Maiky ♥, HYPEX ♥, VenomLeaks ♥, JayKey ♥, Fevers ♥, Netu ♥, TheGameVlog ♥, Quentin ♥, Laggy ♥, s0ll ♥, RazTracker, Mikey, kyle, Yanteh, Shiina, SexyNutella, Alexander, Jinx, Tector, imatrix, LamZykoss, Frenzy Leaks, LlamaLeaks, XTigerHyperX, FunGames, WeLoveFortnite." />
|
||||
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<TextBlock Text="Powered by" FontSize="15" FontWeight="700" Foreground="#9DA3DD" FontStretch="Expanded" />
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace FModel.Views
|
|||
{
|
||||
private readonly BackupManagerViewModel _viewModel;
|
||||
|
||||
public BackupManager(FGame game)
|
||||
public BackupManager(string gameName)
|
||||
{
|
||||
DataContext = _viewModel = new BackupManagerViewModel(game);
|
||||
DataContext = _viewModel = new BackupManagerViewModel(gameName);
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
<StackPanel Grid.Column="0" VerticalAlignment="Center" Margin="50">
|
||||
<CheckBox Content="Show Cities" IsEnabled="{Binding IsReady}" IsChecked="{Binding MapViewer.ShowCities, Mode=TwoWay}"
|
||||
Margin="0 0 0 10" Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}" />
|
||||
<CheckBox Content="Show Landmarks" IsEnabled="{Binding IsReady}" IsChecked="{Binding MapViewer.ShowLandmarks, Mode=TwoWay}"
|
||||
Margin="0 0 0 10" Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}" />
|
||||
<CheckBox Content="Show Patrol Paths" IsEnabled="{Binding IsReady}" IsChecked="{Binding MapViewer.ShowPatrolPaths, Mode=TwoWay}"
|
||||
Margin="0 0 0 10" Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}" />
|
||||
<Button Content="Save Image" IsEnabled="{Binding IsReady}" Click="OnClick" />
|
||||
|
|
@ -43,6 +45,8 @@
|
|||
Visibility="{Binding IsReady, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<Image UseLayoutRounding="True" Source="{Binding MapViewer.CitiesImage}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Visibility="{Binding MapViewer.ShowCities, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<Image UseLayoutRounding="True" Source="{Binding MapViewer.LandmarksImage}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Visibility="{Binding MapViewer.ShowLandmarks, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<Image UseLayoutRounding="True" Source="{Binding MapViewer.PatrolPathImage}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Visibility="{Binding MapViewer.ShowPatrolPaths, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
</Grid>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user