mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
packages bump
This commit is contained in:
parent
91eb123cc7
commit
be061df238
|
|
@ -124,8 +124,7 @@ public class BaseBundle : UCreator
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_headerPaint.Typeface);
|
||||
var shapedText = shaper.Shape(DisplayName, _headerPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, (Width - shapedText.Points[^1].X) / 2, _headerHeight / 2 + _headerPaint.TextSize / 2 - 10, _headerPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, Width / 2f, _headerHeight / 2f + _headerPaint.TextSize / 2 - 10, _headerPaint);
|
||||
}
|
||||
|
||||
private void DrawQuests(SKCanvas c)
|
||||
|
|
@ -137,4 +136,4 @@ public class BaseBundle : UCreator
|
|||
y += quest.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,10 +155,9 @@ public class BaseCommunity : BaseIcon
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(DisplayNamePaint.Typeface);
|
||||
var shapedText = shaper.Shape(DisplayName, DisplayNamePaint);
|
||||
var x = font.Alignment switch
|
||||
{
|
||||
SKTextAlign.Center => (Width - shapedText.Points[^1].X) / 2f,
|
||||
SKTextAlign.Center => Width / 2f,
|
||||
_ => font.X
|
||||
};
|
||||
|
||||
|
|
@ -192,10 +191,9 @@ public class BaseCommunity : BaseIcon
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(DescriptionPaint.Typeface);
|
||||
var shapedText = shaper.Shape(Description, DescriptionPaint);
|
||||
var x = font.Alignment switch
|
||||
{
|
||||
SKTextAlign.Center => (Width - shapedText.Points[^1].X) / 2f,
|
||||
SKTextAlign.Center => Width / 2f,
|
||||
_ => font.X
|
||||
};
|
||||
|
||||
|
|
@ -236,11 +234,9 @@ public class BaseCommunity : BaseIcon
|
|||
DisplayNamePaint.Typeface = Utils.Typefaces.OnTheFly(path);
|
||||
|
||||
var shaper = new CustomSKShaper(DisplayNamePaint.Typeface);
|
||||
var shapedText = shaper.Shape(text, DisplayNamePaint);
|
||||
var x = font.Alignment switch
|
||||
{
|
||||
SKTextAlign.Center => (Width - shapedText.Points[^1].X) / 2f,
|
||||
SKTextAlign.Right => font.X - DisplayNamePaint.MeasureText(text),
|
||||
SKTextAlign.Center => Width / 2f,
|
||||
_ => font.X
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -217,8 +217,7 @@ public class BaseIconStats : BaseIcon
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_informationPaint.Typeface);
|
||||
shaper.Shape(DisplayName, _informationPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, _headerHeight + _headerHeight / 3 + 10, _headerHeight / 2 + _informationPaint.TextSize / 3, _informationPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, _headerHeight + _headerHeight / 3 + 10, _headerHeight / 2f + _informationPaint.TextSize / 3, _informationPaint);
|
||||
}
|
||||
|
||||
private void DrawStatistics(SKCanvas c)
|
||||
|
|
@ -270,7 +269,6 @@ public class IconStat
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_statPaint.Typeface);
|
||||
shaper.Shape(_statName, _statPaint);
|
||||
c.DrawShapedText(shaper, _statName, 50, y + 10, _statPaint);
|
||||
|
||||
_statPaint.TextAlign = SKTextAlign.Right;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class BaseItemAccessToken : UCreator
|
|||
|
||||
var shaper = new CustomSKShaper(DisplayNamePaint.Typeface);
|
||||
var shapedText = shaper.Shape(DisplayName, DisplayNamePaint);
|
||||
c.DrawShapedText(shaper, DisplayName, left - shapedText.Points[^1].X / 2, _icon.Margin * 8 + size, DisplayNamePaint);
|
||||
c.DrawShapedText(shaper, DisplayName, left - shapedText.Width / 2, _icon.Margin * 8 + size, DisplayNamePaint);
|
||||
|
||||
float topBase = _icon.Margin + size * 2;
|
||||
if (!string.IsNullOrEmpty(_unlockedDescription))
|
||||
|
|
@ -96,4 +96,4 @@ public class BaseItemAccessToken : UCreator
|
|||
var h = Width - _icon.Margin - topBase;
|
||||
c.DrawBitmap(_icon.Preview ?? _icon.DefaultPreview, new SKRect(left - h / 2, topBase, left + h / 2, Width - _icon.Margin), ImagePaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@ public class BaseQuest : BaseIcon
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_informationPaint.Typeface);
|
||||
shaper.Shape(DisplayName, _informationPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, Height, y + 50, _informationPaint);
|
||||
}
|
||||
|
||||
|
|
@ -263,4 +262,4 @@ public class BaseQuest : BaseIcon
|
|||
|
||||
_reward.DrawQuest(c, new SKRect(Height, outY + 25, Width - 20, y + Height - 25));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,8 +136,7 @@ public class BaseSeason : UCreator
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_headerPaint.Typeface);
|
||||
var shapedText = shaper.Shape(DisplayName, _headerPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, (Width - shapedText.Points[^1].X) / 2, _headerHeight / 2 + _headerPaint.TextSize / 2 - 10, _headerPaint);
|
||||
c.DrawShapedText(shaper, DisplayName, Width / 2f, _headerHeight / 2f + _headerPaint.TextSize / 2 - 10, _headerPaint);
|
||||
}
|
||||
|
||||
private void DrawBookSchedule(SKCanvas c)
|
||||
|
|
@ -156,4 +155,4 @@ public class BaseSeason : UCreator
|
|||
x = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ public class BaseUserControl : UCreator
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_displayNamePaint.Typeface);
|
||||
shaper.Shape(DisplayName, _displayNamePaint);
|
||||
c.DrawShapedText(shaper, DisplayName, Margin, Margin + _displayNamePaint.TextSize, _displayNamePaint);
|
||||
#if DEBUG
|
||||
c.DrawRect(new SKRect(Margin, Margin, Width - Margin, Margin + _displayNamePaint.TextSize), new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ public class Reward
|
|||
}
|
||||
|
||||
var shaper = new CustomSKShaper(_rewardPaint.Typeface);
|
||||
shaper.Shape(_rewardQuantity, _rewardPaint);
|
||||
c.DrawShapedText(shaper, _rewardQuantity, rect.Left + rect.Height + 25, rect.MidY + 20, _rewardPaint);
|
||||
}
|
||||
else
|
||||
|
|
@ -149,4 +148,4 @@ public class Reward
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public abstract class UCreator
|
|||
|
||||
var shaper = new CustomSKShaper(DisplayNamePaint.Typeface);
|
||||
var shapedText = shaper.Shape(DisplayName, DisplayNamePaint);
|
||||
var x = (Width - shapedText.Points[^1].X) / 2;
|
||||
var x = Width / 2f;
|
||||
var y = _STARTER_TEXT_POSITION + _NAME_TEXT_SIZE;
|
||||
|
||||
switch (Style)
|
||||
|
|
@ -174,14 +174,15 @@ public abstract class UCreator
|
|||
case EIconStyle.Flat:
|
||||
{
|
||||
DisplayNamePaint.TextAlign = SKTextAlign.Right;
|
||||
x = Width - Margin * 2 - shapedText.Points[^1].X;
|
||||
x = Width - Margin * 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
c.DrawLine(x, 0, x, Width, new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
c.DrawLine(x + shapedText.Points[^1].X, 0, x + shapedText.Points[^1].X, Width, new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
var halfWidth = shapedText.Width / 2f;
|
||||
c.DrawLine(x - halfWidth, 0, x - halfWidth, Width, new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
c.DrawLine(x + halfWidth, 0, x + halfWidth, Width, new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
c.DrawRect(new SKRect(Margin, _STARTER_TEXT_POSITION, Width - Margin, y), new SKPaint { Color = SKColors.Blue, IsStroke = true });
|
||||
#endif
|
||||
|
||||
|
|
@ -216,8 +217,6 @@ public abstract class UCreator
|
|||
case SKTextAlign.Left:
|
||||
_shortDescriptionPaint.Typeface = Utils.Typefaces.Bottom ?? Utils.Typefaces.DisplayName;
|
||||
var shaper = new CustomSKShaper(_shortDescriptionPaint.Typeface);
|
||||
shaper.Shape(text, _shortDescriptionPaint);
|
||||
|
||||
c.DrawShapedText(shaper, text, Margin * 2.5f, Width - Margin * 2.5f, _shortDescriptionPaint);
|
||||
break;
|
||||
case SKTextAlign.Right:
|
||||
|
|
|
|||
|
|
@ -204,9 +204,6 @@ public static class Utils
|
|||
return string.Empty;
|
||||
}
|
||||
|
||||
public static string FixPath(string weirdPath) =>
|
||||
_applicationView.CUE4Parse.Provider.FixPath(weirdPath, StringComparison.Ordinal);
|
||||
|
||||
public static void DrawCenteredMultilineText(SKCanvas c, string text, int maxCount, int size, int margin, SKTextAlign side, SKRect area, SKPaint paint)
|
||||
{
|
||||
var lineHeight = paint.TextSize * 1.2f;
|
||||
|
|
@ -233,8 +230,8 @@ public static class Utils
|
|||
y += lineHeight;
|
||||
var x = side switch
|
||||
{
|
||||
SKTextAlign.Center => area.MidX - shapedText.Points[^1].X / 2,
|
||||
SKTextAlign.Right => size - margin - shapedText.Points[^1].X,
|
||||
SKTextAlign.Center => area.MidX - shapedText.Width / 2,
|
||||
SKTextAlign.Right => size - margin - shapedText.Width,
|
||||
SKTextAlign.Left => margin,
|
||||
_ => throw new NotImplementedException()
|
||||
};
|
||||
|
|
@ -266,8 +263,8 @@ public static class Utils
|
|||
|
||||
var x = side switch
|
||||
{
|
||||
SKTextAlign.Center => area.MidX - shapedText.Points[^1].X / 2,
|
||||
SKTextAlign.Right => size - margin - shapedText.Points[^1].X,
|
||||
SKTextAlign.Center => area.MidX - shapedText.Width / 2,
|
||||
SKTextAlign.Right => size - margin - shapedText.Width,
|
||||
SKTextAlign.Left => area.Left,
|
||||
_ => throw new NotImplementedException()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -135,22 +135,22 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="AdonisUI" Version="1.17.1" />
|
||||
<PackageReference Include="AdonisUI.ClassicTheme" Version="1.17.1" />
|
||||
<PackageReference Include="Autoupdater.NET.Official" Version="1.7.6" />
|
||||
<PackageReference Include="AvalonEdit" Version="6.2.0.78" />
|
||||
<PackageReference Include="Autoupdater.NET.Official" Version="1.8.2" />
|
||||
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
|
||||
<PackageReference Include="CSCore" Version="1.2.1.2" />
|
||||
<PackageReference Include="DiscordRichPresence" Version="1.1.3.18" />
|
||||
<PackageReference Include="ImGui.NET" Version="1.89.4" />
|
||||
<PackageReference Include="ImGui.NET" Version="1.89.5" />
|
||||
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NVorbis" Version="0.10.5" />
|
||||
<PackageReference Include="Oodle.NET" Version="1.0.1" />
|
||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
||||
<PackageReference Include="OpenTK" Version="4.7.7" />
|
||||
<PackageReference Include="RestSharp" Version="108.0.3" />
|
||||
<PackageReference Include="RestSharp" Version="110.2.0" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
|
||||
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
|
||||
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.3" />
|
||||
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class CustomSKShaper : SKShaper
|
|||
points[i] = new SKPoint(xOffset + pos[i].XOffset * textSizeX, yOffset - pos[i].YOffset * textSizeY);
|
||||
}
|
||||
|
||||
return new Result(codepoints, clusters, points);
|
||||
return new Result(codepoints, clusters, points, points[^1].X);
|
||||
}
|
||||
|
||||
public new Result Shape(string text, SKPaint paint) => Shape(text, 0, 0, paint);
|
||||
|
|
@ -87,4 +87,4 @@ public class CustomSKShaper : SKShaper
|
|||
buffer.GuessSegmentProperties();
|
||||
return Shape(buffer, xOffset, yOffset, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ public class JsonNetSerializer : IRestSerializer, ISerializer, IDeserializer
|
|||
public ISerializer Serializer => this;
|
||||
public IDeserializer Deserializer => this;
|
||||
|
||||
public string ContentType { get; set; } = "application/json";
|
||||
public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept;
|
||||
public SupportsContentType SupportsContentType => contentType => contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase);
|
||||
public ContentType ContentType { get; set; } = ContentType.Json;
|
||||
public string[] AcceptedContentTypes => ContentType.JsonAccept;
|
||||
public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase);
|
||||
|
||||
public DataFormat DataFormat => DataFormat.Json;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,11 @@ namespace FModel.ViewModels;
|
|||
|
||||
public class ApiEndpointViewModel
|
||||
{
|
||||
private readonly RestClient _client = new RestClient
|
||||
private readonly RestClient _client = new (new RestClientOptions
|
||||
{
|
||||
Options =
|
||||
{
|
||||
UserAgent = $"FModel/{Constants.APP_VERSION}",
|
||||
MaxTimeout = 3 * 1000
|
||||
}
|
||||
}.UseSerializer<JsonNetSerializer>();
|
||||
UserAgent = $"FModel/{Constants.APP_VERSION}",
|
||||
MaxTimeout = 3 * 1000
|
||||
}, configureSerialization: s => s.UseSerializer<JsonNetSerializer>());
|
||||
|
||||
public FortniteApiEndpoint FortniteApi { get; }
|
||||
public ValorantApiEndpoint ValorantApi { get; }
|
||||
|
|
|
|||
|
|
@ -549,6 +549,7 @@ public class CUE4ParseViewModel : ViewModel
|
|||
{
|
||||
FLogger.Append(ELog.Information, () =>
|
||||
FLogger.Text($"{LocalizedResourcesCount} localized resources loaded for '{UserSettings.Default.AssetLanguage.GetDescription()}'", Constants.WHITE, true));
|
||||
Utils.Typefaces = new Typefaces(this);
|
||||
}
|
||||
}
|
||||
private Task LoadGameLocalizedResources()
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
|
|||
await Task.WhenAll(
|
||||
_applicationView.CUE4Parse.LoadLocalizedResources(), // load locres if not already loaded,
|
||||
_applicationView.CUE4Parse.LoadVirtualPaths(), // load virtual paths if not already loaded
|
||||
Task.Run(() => Utils.Typefaces = new Typefaces(_applicationView.CUE4Parse)),
|
||||
_threadWorkerView.Begin(cancellationToken =>
|
||||
{
|
||||
// filter what to show
|
||||
|
|
|
|||
|
|
@ -430,30 +430,28 @@ public class MapViewerViewModel : ViewModel
|
|||
!poiData.TryGetValue(out FName discoverBackend, "DiscoverObjectiveBackendName")) continue;
|
||||
|
||||
var shaper = new CustomSKShaper(_textPaint.Typeface);
|
||||
var shapedText = shaper.Shape(text.Text, _textPaint);
|
||||
|
||||
if (discoverBackend.Text.Contains("papaya", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_fillPaint.StrokeWidth = 5;
|
||||
var vector = GetMapPosition(worldLocation, _prRadius);
|
||||
prLandmarks.DrawPoint(vector.X, vector.Y, _pathPaint);
|
||||
prLandmarks.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _fillPaint);
|
||||
prLandmarks.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _textPaint);
|
||||
prLandmarks.DrawShapedText(shaper, text.Text, vector.X, vector.Y - 12.5F, _fillPaint);
|
||||
prLandmarks.DrawShapedText(shaper, text.Text, vector.X, vector.Y - 12.5F, _textPaint);
|
||||
}
|
||||
else if (discoveryQuest.AssetPathName.Text.Contains("landmarks", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_fillPaint.StrokeWidth = 5;
|
||||
var vector = GetMapPosition(worldLocation, _brRadius);
|
||||
brLandmarks.DrawPoint(vector.X, vector.Y, _pathPaint);
|
||||
brLandmarks.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _fillPaint);
|
||||
brLandmarks.DrawShapedText(shaper, text.Text, vector.X - shapedText.Points[^1].X / 2, vector.Y - 12.5F, _textPaint);
|
||||
brLandmarks.DrawShapedText(shaper, text.Text, vector.X, vector.Y - 12.5F, _fillPaint);
|
||||
brLandmarks.DrawShapedText(shaper, text.Text, vector.X, vector.Y - 12.5F, _textPaint);
|
||||
}
|
||||
else
|
||||
{
|
||||
_fillPaint.StrokeWidth = 10;
|
||||
var vector = GetMapPosition(worldLocation, _brRadius);
|
||||
pois.DrawShapedText(shaper, text.Text.ToUpperInvariant(), vector.X - shapedText.Points[^1].X / 2, vector.Y, _fillPaint);
|
||||
pois.DrawShapedText(shaper, text.Text.ToUpperInvariant(), vector.X - shapedText.Points[^1].X / 2, vector.Y, _textPaint);
|
||||
pois.DrawShapedText(shaper, text.Text.ToUpperInvariant(), vector.X, vector.Y, _fillPaint);
|
||||
pois.DrawShapedText(shaper, text.Text.ToUpperInvariant(), vector.X, vector.Y, _textPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user