mirror of
https://github.com/4sval/FModel.git
synced 2026-03-26 19:55:18 -05:00
Merge pull request #312 from OutTheShade/dev
Some more Multiversus support
This commit is contained in:
commit
5330da94c8
|
|
@ -272,4 +272,4 @@ public class BaseCommunity : BaseIcon
|
|||
// draw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,4 +281,4 @@ public class BaseIcon : UCreator
|
|||
x += size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
122
FModel/Creator/Bases/MV/BaseMultiversusIcon.cs
Normal file
122
FModel/Creator/Bases/MV/BaseMultiversusIcon.cs
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
using CUE4Parse.UE4.Assets.Exports;
|
||||
using CUE4Parse.UE4.Assets.Exports.Material;
|
||||
using CUE4Parse.UE4.Objects.Core.i18N;
|
||||
using CUE4Parse.UE4.Objects.Core.Math;
|
||||
using CUE4Parse.UE4.Objects.UObject;
|
||||
using FModel.Creator.Bases.FN;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace FModel.Creator.Bases.MV;
|
||||
|
||||
public class BaseMultiversusIcon : BaseIcon
|
||||
{
|
||||
public BaseMultiversusIcon(UObject uObject, EIconStyle style) : base(uObject, style)
|
||||
{
|
||||
}
|
||||
|
||||
public override void ParseForInfo()
|
||||
{
|
||||
if (Object.TryGetValue<FLinearColor>(out var backgroundColor, "BackgroundColor"))
|
||||
{
|
||||
var bgColor = SKColor.Parse(backgroundColor.Hex);
|
||||
Background = new[] { bgColor, bgColor };
|
||||
}
|
||||
else if (Object.TryGetValue<FName>(out var rarity, "Rarity"))
|
||||
{
|
||||
Background = GetRarityBackground(rarity.ToString());
|
||||
Border = new[] { GetRarityBorder(rarity.ToString()) };
|
||||
}
|
||||
|
||||
if (Object.TryGetValue<FLinearColor>(out var nameColor, "DisplayNameColor"))
|
||||
{
|
||||
Border = new[] { SKColor.Parse(nameColor.Hex) };
|
||||
}
|
||||
|
||||
if (Object.TryGetValue<FSoftObjectPath>(out var rewardThumbnail, "RewardThumbnail"))
|
||||
Preview = Utils.GetBitmap(rewardThumbnail);
|
||||
|
||||
else if (Object.TryGetValue<FSoftObjectPath>(out var portaitPtr, "CollectionsPortraitMaterial", "CharacterSelectPortraitMaterial")
|
||||
&& portaitPtr.TryLoad<UMaterialInstanceConstant>(out var portait))
|
||||
Preview = Utils.GetBitmap(portait);
|
||||
|
||||
else if (Object.TryGetValue<FSoftObjectPath[]>(out var skins, "Skins") &&
|
||||
skins[0].TryLoad(out var defaultSkin) &&
|
||||
defaultSkin.TryGetValue<FSoftObjectPath>(out var skinRewardThumb, "RewardThumbnail"))
|
||||
Preview = Utils.GetBitmap(skinRewardThumb);
|
||||
|
||||
else if (Object.TryGetValue<FSoftObjectPath>(out var eogPortrait, "EOGPortrait"))
|
||||
Preview = Utils.GetBitmap(eogPortrait);
|
||||
|
||||
if (Object.TryGetValue<FText>(out var displayName, "DisplayName"))
|
||||
DisplayName = displayName.Text;
|
||||
|
||||
if (Object.TryGetValue<FText>(out var description, "Overview", "Bio"))
|
||||
Description = description.Text;
|
||||
|
||||
if (Object.TryGetValue<FText>(out var property, "Property"))
|
||||
ShortDescription = property.Text;
|
||||
|
||||
if (Object.TryGetValue<FName>(out var unlockLocation, "UnlockLocation"))
|
||||
CosmeticSource = unlockLocation.ToString().Split("::")[1];
|
||||
}
|
||||
|
||||
private static SKColor[] GetRarityBackground(string rarity)
|
||||
{
|
||||
string rarityName = rarity.Split("::")[1];
|
||||
|
||||
switch (rarityName) // the colors here are the base color and brighter color that the game uses for rarities from the "Rarity to Color" blueprint function
|
||||
{
|
||||
case "Common":
|
||||
return new[]
|
||||
{
|
||||
SKColor.Parse(new FLinearColor(0.068478f, 0.651406f, 0.016807f, 1.000000f).Hex),
|
||||
SKColor.Parse(new FLinearColor(0.081422f, 1.000000f, 0.000000f, 1.000000f).Hex)
|
||||
};
|
||||
case "Rare":
|
||||
return new[]
|
||||
{
|
||||
SKColor.Parse(new FLinearColor(0.035911f, 0.394246f, 0.900000f, 1.000000f).Hex),
|
||||
SKColor.Parse(new FLinearColor(0.033333f, 0.434207f, 1.000000f, 1.000000f).Hex)
|
||||
};
|
||||
case "Epic":
|
||||
return new[]
|
||||
{
|
||||
SKColor.Parse(new FLinearColor(0.530391f, 0.060502f, 0.900000f, 1.000000f).Hex),
|
||||
SKColor.Parse(new FLinearColor(0.579907f, 0.045833f, 1.000000f, 1.000000f).Hex)
|
||||
};
|
||||
case "Legendary":
|
||||
return new[]
|
||||
{
|
||||
SKColor.Parse(new FLinearColor(1.000000f, 0.223228f, 0.002428f, 1.000000f).Hex),
|
||||
SKColor.Parse(new FLinearColor(1.000000f, 0.479320f, 0.030713f, 1.000000f).Hex)
|
||||
};
|
||||
case "None":
|
||||
default:
|
||||
return new[]
|
||||
{
|
||||
SKColor.Parse(new FLinearColor(0.194618f, 0.651406f, 0.630757f, 1.000000f).Hex),
|
||||
SKColor.Parse(new FLinearColor(0.273627f, 0.955208f, 0.914839f, 1.000000f).Hex)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static SKColor GetRarityBorder(string rarity)
|
||||
{
|
||||
string rarityName = rarity.Split("::")[1];
|
||||
|
||||
switch (rarityName) // the colors here are the desaturated versions of the rarity colors
|
||||
{
|
||||
case "Common":
|
||||
return SKColor.Parse(new FLinearColor(0.172713f, 0.651406f, 0.130281f, 1.000000f).Hex);
|
||||
case "Rare":
|
||||
return SKColor.Parse(new FLinearColor(0.198220f, 0.527026f, 0.991102f, 1.000000f).Hex);
|
||||
case "Epic":
|
||||
return SKColor.Parse(new FLinearColor(0.642017f, 0.198220f, 0.991102f, 1.000000f).Hex);
|
||||
case "Legendary":
|
||||
return SKColor.Parse(new FLinearColor(1.000000f, 0.328434f, 0.200000f, 1.000000f).Hex);
|
||||
case "None":
|
||||
default:
|
||||
return SKColor.Parse(new FLinearColor(0.308843f, 0.571125f, 0.557810f, 1.000000f).Hex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,13 +43,13 @@ public abstract class UCreator
|
|||
protected readonly SKPaint DisplayNamePaint = new()
|
||||
{
|
||||
IsAntialias = true, FilterQuality = SKFilterQuality.High,
|
||||
Typeface = Utils.Typefaces.DisplayName, TextSize = _NAME_TEXT_SIZE,
|
||||
Typeface = Utils.Typefaces.DisplayName ?? Utils.Typefaces.Default, TextSize = _NAME_TEXT_SIZE,
|
||||
Color = SKColors.White, TextAlign = SKTextAlign.Center
|
||||
};
|
||||
protected readonly SKPaint DescriptionPaint = new()
|
||||
{
|
||||
IsAntialias = true, FilterQuality = SKFilterQuality.High,
|
||||
Typeface = Utils.Typefaces.Description, TextSize = 13,
|
||||
Typeface = Utils.Typefaces.Description ?? Utils.Typefaces.Default, TextSize = 13,
|
||||
Color = SKColors.White
|
||||
};
|
||||
protected readonly SKPaint ImagePaint = new()
|
||||
|
|
@ -214,7 +214,7 @@ public abstract class UCreator
|
|||
switch (side)
|
||||
{
|
||||
case SKTextAlign.Left:
|
||||
_shortDescriptionPaint.Typeface = Utils.Typefaces.Bottom ?? Utils.Typefaces.DisplayName;
|
||||
_shortDescriptionPaint.Typeface = Utils.Typefaces.Bottom ?? Utils.Typefaces.DisplayName ?? Utils.Typefaces.Default;
|
||||
var shaper = new CustomSKShaper(_shortDescriptionPaint.Typeface);
|
||||
shaper.Shape(text, _shortDescriptionPaint);
|
||||
|
||||
|
|
@ -226,4 +226,4 @@ public abstract class UCreator
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using CUE4Parse.UE4.Assets.Exports;
|
|||
using FModel.Creator.Bases;
|
||||
using FModel.Creator.Bases.BB;
|
||||
using FModel.Creator.Bases.FN;
|
||||
using FModel.Creator.Bases.MV;
|
||||
using FModel.Creator.Bases.SB;
|
||||
|
||||
namespace FModel.Creator;
|
||||
|
|
@ -173,6 +174,11 @@ public class CreatorPackage : IDisposable
|
|||
case "PlaylistUserOptionCollisionProfileEnum":
|
||||
creator = new BaseUserControl(_object, _style);
|
||||
return true;
|
||||
// Multiversus
|
||||
case "CharacterData":
|
||||
case "SkinData":
|
||||
creator = new BaseMultiversusIcon(_object, _style);
|
||||
return true;
|
||||
// Battle Breakers
|
||||
case "WExpGenericAccountItemDefinition":
|
||||
case "WExpGearAccountItemDefinition":
|
||||
|
|
@ -248,4 +254,4 @@ public class CreatorPackage : IDisposable
|
|||
{
|
||||
_object = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using CUE4Parse.UE4.Versions;
|
||||
|
|
@ -41,6 +41,11 @@ public class Typefaces
|
|||
private const string _BURBANK_SMALL_BLACK = "burbanksmall-black";
|
||||
private const string _BURBANK_SMALL_BOLD = "burbanksmall-bold";
|
||||
|
||||
// Multiversus
|
||||
private const string _MULTIVERSUS_BASE_PATH = "/Game/Panda_Main/UI/Fonts/";
|
||||
private const string _MONTSERRAT_BOLD = "Montserrat/Montserrat-Bold";
|
||||
private const string _VCCARDINAL_CONDENSED_BOLDITALIC_ITALIC = "VCCardinal/VCCardinalCondensed-BoldItalic";
|
||||
|
||||
// Spellbreak
|
||||
private const string _SPELLBREAK_BASE_PATH = "/Game/UI/Fonts/";
|
||||
private const string _MONTSERRAT_SEMIBOLD = "Montserrat-Semibold";
|
||||
|
|
@ -264,6 +269,24 @@ public class Typefaces
|
|||
}
|
||||
else Description = Default;
|
||||
|
||||
break;
|
||||
}
|
||||
case FGame.Multiversus:
|
||||
{
|
||||
if (viewModel.Provider.TrySaveAsset(_MULTIVERSUS_BASE_PATH + _VCCARDINAL_CONDENSED_BOLDITALIC_ITALIC + _EXT, out data))
|
||||
{
|
||||
var m = new MemoryStream(data) { Position = 0 };
|
||||
DisplayName = SKTypeface.FromStream(m);
|
||||
}
|
||||
else DisplayName = Default;
|
||||
|
||||
if (viewModel.Provider.TrySaveAsset(_MULTIVERSUS_BASE_PATH + _MONTSERRAT_BOLD + _EXT, out data))
|
||||
{
|
||||
var m = new MemoryStream(data) { Position = 0 };
|
||||
Description = SKTypeface.FromStream(m);
|
||||
}
|
||||
else Description = Default;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -275,4 +298,4 @@ public class Typefaces
|
|||
var m = new MemoryStream(data) { Position = 0 };
|
||||
return SKTypeface.FromStream(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ public static class Utils
|
|||
switch (textureParameter.ParameterInfo.Name.Text)
|
||||
{
|
||||
case "MainTex":
|
||||
case "Texture":
|
||||
case "TextureA":
|
||||
case "TextureB":
|
||||
case "OfferImage":
|
||||
|
|
@ -391,4 +392,4 @@ public static class Utils
|
|||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace FModel;
|
||||
|
||||
|
|
@ -91,7 +91,9 @@ public enum FGame
|
|||
[Description("GTA: The Trilogy - Definitive Edition")]
|
||||
Gameface,
|
||||
[Description("Sea of Thieves")]
|
||||
Athena
|
||||
Athena,
|
||||
[Description("Multiversus")]
|
||||
Multiversus
|
||||
}
|
||||
|
||||
public enum ELoadingMode
|
||||
|
|
@ -138,4 +140,4 @@ public enum EIconStyle
|
|||
Cataba,
|
||||
// [Description("Community")]
|
||||
// CommunityMade
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<IsPackable>false</IsPackable>
|
||||
<IsPublishable>true</IsPublishable>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<PublishSingleFile Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">true</PublishSingleFile>
|
||||
<PublishSingleFile Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">false</PublishSingleFile>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
<StartupObject>FModel.App</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -286,7 +286,8 @@ namespace FModel.Settings
|
|||
{FGame.TslGame, Constants._NO_PRESET_TRIGGER},
|
||||
{FGame.PortalWars, Constants._NO_PRESET_TRIGGER},
|
||||
{FGame.Gameface, Constants._NO_PRESET_TRIGGER},
|
||||
{FGame.Athena, Constants._NO_PRESET_TRIGGER}
|
||||
{FGame.Athena, Constants._NO_PRESET_TRIGGER},
|
||||
{FGame.Multiversus, Constants._NO_PRESET_TRIGGER}
|
||||
};
|
||||
public IDictionary<FGame, string> Presets
|
||||
{
|
||||
|
|
@ -314,7 +315,8 @@ namespace FModel.Settings
|
|||
{FGame.TslGame, EGame.GAME_PlayerUnknownsBattlegrounds},
|
||||
{FGame.PortalWars, EGame.GAME_UE4_LATEST},
|
||||
{FGame.Gameface, EGame.GAME_GTATheTrilogyDefinitiveEdition},
|
||||
{FGame.Athena, EGame.GAME_SeaOfThieves}
|
||||
{FGame.Athena, EGame.GAME_SeaOfThieves},
|
||||
{FGame.Multiversus, EGame.GAME_UE4_LATEST}
|
||||
};
|
||||
public IDictionary<FGame, EGame> OverridedGame
|
||||
{
|
||||
|
|
@ -342,7 +344,8 @@ namespace FModel.Settings
|
|||
{FGame.TslGame, null},
|
||||
{FGame.PortalWars, null},
|
||||
{FGame.Gameface, null},
|
||||
{FGame.Athena, null}
|
||||
{FGame.Athena, null},
|
||||
{FGame.Multiversus, null}
|
||||
};
|
||||
public IDictionary<FGame, List<FCustomVersion>> OverridedCustomVersions
|
||||
{
|
||||
|
|
@ -370,7 +373,8 @@ namespace FModel.Settings
|
|||
{FGame.TslGame, null},
|
||||
{FGame.PortalWars, null},
|
||||
{FGame.Gameface, null},
|
||||
{FGame.Athena, null}
|
||||
{FGame.Athena, null},
|
||||
{FGame.Multiversus, null}
|
||||
};
|
||||
public IDictionary<FGame, Dictionary<string, bool>> OverridedOptions
|
||||
{
|
||||
|
|
@ -435,6 +439,12 @@ namespace FModel.Settings
|
|||
new("Strings", "g3/Content/Localization/")
|
||||
}
|
||||
},
|
||||
{
|
||||
FGame.Multiversus, new List<CustomDirectory>()
|
||||
{
|
||||
new("Characters", "MultiVersus/Content/Panda_Main/Characters/")
|
||||
}
|
||||
},
|
||||
{FGame.StateOfDecay2, new List<CustomDirectory>()},
|
||||
{FGame.Prospect, new List<CustomDirectory>()},
|
||||
{FGame.Indiana, new List<CustomDirectory>()},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user