Skip to content

Commit

Permalink
c'est ciao
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Jun 18, 2023
1 parent d891c3e commit 8fa0277
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 211 deletions.
63 changes: 0 additions & 63 deletions FModel/Creator/CreatorPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,69 +203,6 @@ public bool TryConstructCreator(out UCreator creator)
case "QuestData":
creator = new Bases.MV.BaseQuest(_object, _style);
return true;
// Battle Breakers
case "WExpGenericAccountItemDefinition":
case "WExpGearAccountItemDefinition":
case "WExpHQWorkerLodgesDefinition":
case "WExpPersonalEventDefinition":
case "WExpUpgradePotionDefinition":
case "WExpAccountRewardDefinition":
case "WExpHQBlacksmithDefinition":
case "WExpHQSecretShopDefinition":
case "WExpHQMonsterPitDefinition":
case "WExpHQHeroTowerDefinition":
case "WExpVoucherItemDefinition":
case "WExpTreasureMapDefinition":
case "WExpHammerChestDefinition":
case "WExpHQWorkshopDefinition":
case "WExpUnlockableDefinition":
case "WExpHQSmelterDefinition":
case "WExpContainerDefinition":
case "WExpCharacterDefinition":
case "WExpHQMarketDefinition":
case "WExpGiftboxDefinition":
case "WExpStandInDefinition":
case "WExpRegionDefinition":
case "WExpHQMineDefinition":
case "WExpXpBookDefinition":
case "WExpTokenDefinition":
case "WExpItemDefinition":
case "WExpZoneDefinition":
creator = new BaseBreakersIcon(_object, EIconStyle.Default);
return true;
// Spellbreak
case "GTargetedTeleportActiveSkill":
case "GChronomasterV2ActiveSkill":
case "GShadowstepActiveSkill":
case "GGatewayActiveSkill":
case "GStealthActiveSkill":
case "GFeatherActiveSkill":
case "GCosmeticDropTrail":
case "GFlightActiveSkill":
case "GCosmeticRunTrail":
case "GCosmeticArtifact":
case "GCosmeticTriumph":
case "GWolfsbloodSkill":
case "GDashActiveSkill":
case "GCharacterPerk":
case "GCosmeticTitle":
case "GCosmeticBadge":
case "GRMTStoreOffer":
case "GCosmeticEmote":
case "GCosmeticCard":
case "GCosmeticSkin":
case "GStoreOffer":
case "GAccolade":
case "GRuneItem":
case "GQuest":
creator = new BaseSpellIcon(_object, EIconStyle.Default);
return true;
case "GLeagueTier":
creator = new BaseLeague(_object, EIconStyle.Default);
return true;
case "GLeagueDivision":
creator = new BaseDivision(_object, EIconStyle.Default);
return true;
default:
creator = null;
return false;
Expand Down
52 changes: 3 additions & 49 deletions FModel/Creator/Typefaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,6 @@ public class Typefaces
private const string _XIANGHEHEI_SC_PRO_BLACK = "XiangHeHei_SC/MXiangHeHeiSCPro-Black";
private const string _XIANGHEHEI_SC_PRO_HEAVY = "XiangHeHei_SC/MXiangHeHeiSCPro-Heavy";

// Spellbreak
private const string _SPELLBREAK_BASE_PATH = "/Game/UI/Fonts/";
private const string _MONTSERRAT_SEMIBOLD = "Montserrat-Semibold";
private const string _MONTSERRAT_SEMIBOLD_ITALIC = "Montserrat-SemiBoldItalic";
private const string _NANUM_GOTHIC = "NanumGothic";
private const string _QUADRAT_BOLD = "Quadrat_Bold";
private const string _SEGOE_BOLD_ITALIC = "Segoe_Bold_Italic";

// WorldExplorers
private const string _BATTLE_BREAKERS_BASE_PATH = "/Game/UMG/Fonts/Faces/";
private const string _HEMIHEAD426 = "HemiHead426";
private const string _NOTO_SANS_JP_REGULAR = "NotoSansJP-Regular";
private const string _LATO_BLACK = "Lato-Black";
private const string _LATO_BLACK_ITALIC = "Lato-BlackItalic";
private const string _LATO_LIGHT = "Lato-Light";
private const string _LATO_MEDIUM = "Lato-Medium";

private readonly CUE4ParseViewModel _viewModel;

public readonly SKTypeface Default; // used as a fallback font for all untranslated strings (item source, ...)
Expand All @@ -85,9 +68,9 @@ public Typefaces(CUE4ParseViewModel viewModel)

Default = SKTypeface.FromStream(Application.GetResourceStream(_BURBANK_BIG_CONDENSED_BOLD)?.Stream);

switch (viewModel.Game)
switch (viewModel.Provider.InternalGameName.ToUpperInvariant())
{
case FGame.FortniteGame:
case "FORTNITEGAME":
{
DisplayName = OnTheFly(_FORTNITE_BASE_PATH +
language switch
Expand Down Expand Up @@ -172,36 +155,7 @@ public Typefaces(CUE4ParseViewModel viewModel)
} + _EXT);
break;
}
case FGame.WorldExplorers:
{
DisplayName = OnTheFly(_BATTLE_BREAKERS_BASE_PATH +
language switch
{
ELanguage.Korean => _NOTO_SANS_KR_REGULAR,
ELanguage.Russian => _LATO_BLACK,
ELanguage.Japanese => _NOTO_SANS_JP_REGULAR,
ELanguage.Chinese => _NOTO_SANS_SC_REGULAR,
_ => _HEMIHEAD426
} + _EXT);

Description = OnTheFly(_BATTLE_BREAKERS_BASE_PATH +
language switch
{
ELanguage.Korean => _NOTO_SANS_KR_REGULAR,
ELanguage.Russian => _LATO_BLACK,
ELanguage.Japanese => _NOTO_SANS_JP_REGULAR,
ELanguage.Chinese => _NOTO_SANS_SC_REGULAR,
_ => _HEMIHEAD426
} + _EXT);
break;
}
case FGame.g3:
{
DisplayName = OnTheFly(_SPELLBREAK_BASE_PATH + _QUADRAT_BOLD + _EXT);
Description = OnTheFly(_SPELLBREAK_BASE_PATH + _MONTSERRAT_SEMIBOLD + _EXT);
break;
}
case FGame.MultiVersus:
case "MULTIVERSUS":
{
DisplayName = OnTheFly(_PANDAGAME_BASE_PATH + language switch
{
Expand Down
50 changes: 0 additions & 50 deletions FModel/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,56 +52,6 @@ public enum EDiscordRpc
Never
}

public enum FGame
{
[Description("Unknown")]
Unknown,
[Description("Fortnite")]
FortniteGame,
[Description("Valorant")]
ShooterGame,
[Description("Dead By Daylight")]
DeadByDaylight,
[Description("Borderlands 3")]
OakGame,
[Description("Minecraft Dungeons")]
Dungeons,
[Description("Battle Breakers")]
WorldExplorers,
[Description("Spellbreak")]
g3,
[Description("State Of Decay 2")]
StateOfDecay2,
[Description("The Cycle")]
Prospect,
[Description("The Outer Worlds")]
Indiana,
[Description("Rogue Company")]
RogueCompany,
[Description("Star Wars: Jedi Fallen Order")]
SwGame,
[Description("Core")]
Platform,
[Description("Days Gone")]
BendGame,
[Description("PLAYERUNKNOWN'S BATTLEGROUNDS")]
TslGame,
[Description("Splitgate")]
PortalWars,
[Description("GTA: The Trilogy - Definitive Edition")]
Gameface,
[Description("Sea of Thieves")]
Athena,
[Description("DEPRECATED")]
PandaGame,
[Description("MultiVersus")]
MultiVersus,
[Description("Tower of Fantasy")]
Hotta,
[Description("eFootball 2023")]
eFootball
}

public enum ELoadingMode
{
[Description("Single")]
Expand Down
2 changes: 1 addition & 1 deletion FModel/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding CUE4Parse.Game}" Value="{x:Static local:FGame.FortniteGame}">
<DataTrigger Binding="{Binding CUE4Parse.InternalGameName, Converter={x:Static converters:CaseInsensitiveStringEqualsConverter.Instance}, ConverterParameter='FortniteGame'}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
Expand Down
2 changes: 1 addition & 1 deletion FModel/Services/DiscordService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void Initialize(string gameName)

public void UpdatePresence(CUE4ParseViewModel viewModel) =>
UpdatePresence(
$"{viewModel.Provider.GameDisplayName ?? viewModel.Provider.GameName} - {viewModel.Provider.MountedVfs.Count}/{viewModel.Provider.MountedVfs.Count + viewModel.Provider.UnloadedVfs.Count} Packages",
$"{viewModel.Provider.GameDisplayName ?? viewModel.Provider.InternalGameName} - {viewModel.Provider.MountedVfs.Count}/{viewModel.Provider.MountedVfs.Count + viewModel.Provider.UnloadedVfs.Count} Packages",
$"Mode: {UserSettings.Default.LoadingMode.GetDescription()} - {viewModel.SearchVm.ResultsCount:### ### ###} Loaded Assets".Trim());

public void UpdatePresence(string details, string state)
Expand Down
32 changes: 16 additions & 16 deletions FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public class CUE4ParseViewModel : ViewModel
private readonly Regex _fnLive = new(@"^FortniteGame(/|\\)Content(/|\\)Paks(/|\\)",
RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

private FGame _game;
public FGame Game
private string _internalGameName;
public string InternalGameName
{
get => _game;
set => SetProperty(ref _game, value);
get => _internalGameName;
set => SetProperty(ref _internalGameName, value);
}

private bool _modelIsOverwritingMaterial;
Expand Down Expand Up @@ -137,29 +137,28 @@ public CUE4ParseViewModel()
{
case Constants._FN_LIVE_TRIGGER:
{
Game = FGame.FortniteGame;
InternalGameName = "FortniteGame";
Provider = new StreamedFileProvider("FortniteLive", true, versionContainer);
break;
}
case Constants._VAL_LIVE_TRIGGER:
{
Game = FGame.ShooterGame;
InternalGameName = "ShooterGame";
Provider = new StreamedFileProvider("ValorantLive", true, versionContainer);
break;
}
default:
{
var parent = gameDirectory.SubstringBeforeLast(gameDirectory.Contains("eFootball") ? "\\pak" : "\\Content").SubstringAfterLast("\\");
Game = parent.ToEnum(FGame.Unknown);
Provider = Game switch
InternalGameName = gameDirectory.SubstringBeforeLast(gameDirectory.Contains("eFootball") ? "\\pak" : "\\Content").SubstringAfterLast("\\");
Provider = InternalGameName switch
{
FGame.StateOfDecay2 => new DefaultFileProvider(new DirectoryInfo(gameDirectory),
"StateOfDecay2" => new DefaultFileProvider(new DirectoryInfo(gameDirectory),
new List<DirectoryInfo>
{
new(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\StateOfDecay2\\Saved\\Paks"),
new(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\StateOfDecay2\\Saved\\DisabledPaks")
}, SearchOption.AllDirectories, true, versionContainer),
FGame.eFootball => new DefaultFileProvider(new DirectoryInfo(gameDirectory),
"eFootball" => new DefaultFileProvider(new DirectoryInfo(gameDirectory),
new List<DirectoryInfo>
{
new(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KONAMI\\eFootball\\ST\\Download")
Expand Down Expand Up @@ -305,7 +304,7 @@ public void LoadVfs(CancellationToken token, IEnumerable<FileItem> aesKeys)
file.FileCount = vfs.FileCount;
}

Game = Provider.GameName.ToEnum(Game);
InternalGameName = Provider.InternalGameName;
}

public void ClearProvider()
Expand Down Expand Up @@ -339,7 +338,7 @@ public async Task InitInformation()
{
await _threadWorkerView.Begin(cancellationToken =>
{
var info = _apiEndpointView.FModelApi.GetNews(cancellationToken, Provider.GameName);
var info = _apiEndpointView.FModelApi.GetNews(cancellationToken, Provider.InternalGameName);
if (info == null) return;
FLogger.Append(ELog.None, () =>
Expand Down Expand Up @@ -454,7 +453,7 @@ public Task VerifyVirtualCache()

public Task VerifyContentBuildManifest()
{
if (Provider is not DefaultFileProvider || !Provider.GameName.Equals("FortniteGame", StringComparison.OrdinalIgnoreCase))
if (Provider is not DefaultFileProvider || !Provider.InternalGameName.Equals("FortniteGame", StringComparison.OrdinalIgnoreCase))
return Task.CompletedTask;

var persistentDownloadDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "FortniteGame/Saved/PersistentDownloadDir");
Expand Down Expand Up @@ -546,7 +545,7 @@ private Task LoadGameLocalizedResources()
}
private Task LoadHotfixedLocalizedResources()
{
if (!Provider.GameName.Equals("fortnitegame", StringComparison.OrdinalIgnoreCase) || HotfixedResourcesDone) return Task.CompletedTask;
if (!Provider.InternalGameName.Equals("fortnitegame", StringComparison.OrdinalIgnoreCase) || HotfixedResourcesDone) return Task.CompletedTask;
return Task.Run(() =>
{
var hotfixes = ApplicationService.ApiEndpointView.CentralApi.GetHotfixes(default, Provider.GetLanguageCode(UserSettings.Default.AssetLanguage));
Expand Down Expand Up @@ -894,7 +893,8 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat
case UStaticMesh when isNone && UserSettings.Default.PreviewStaticMeshes:
case USkeletalMesh when isNone && UserSettings.Default.PreviewSkeletalMeshes:
case UMaterialInstance when isNone && UserSettings.Default.PreviewMaterials && !ModelIsOverwritingMaterial &&
!(Game == FGame.FortniteGame && export.Owner != null && (export.Owner.Name.EndsWith($"/MI_OfferImages/{export.Name}", StringComparison.OrdinalIgnoreCase) ||
!(Provider.InternalGameName.Equals("FortniteGame", StringComparison.OrdinalIgnoreCase) && export.Owner != null &&
(export.Owner.Name.EndsWith($"/MI_OfferImages/{export.Name}", StringComparison.OrdinalIgnoreCase) ||
export.Owner.Name.EndsWith($"/RenderSwitch_Materials/{export.Name}", StringComparison.OrdinalIgnoreCase) ||
export.Owner.Name.EndsWith($"/MI_BPTile/{export.Name}", StringComparison.OrdinalIgnoreCase))):
{
Expand Down
6 changes: 1 addition & 5 deletions FModel/ViewModels/Commands/MenuCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public override async void Execute(ApplicationViewModel contextViewModel, object
Helper.OpenWindow<AdonisWindow>("AES Manager", () => new AesManager().Show());
break;
case "Directory_Backup":
Helper.OpenWindow<AdonisWindow>("Backup Manager", () => new BackupManager(contextViewModel.CUE4Parse.Provider.GameName).Show());
Helper.OpenWindow<AdonisWindow>("Backup Manager", () => new BackupManager(contextViewModel.CUE4Parse.Provider.InternalGameName).Show());
break;
case "Directory_ArchivesInfo":
contextViewModel.CUE4Parse.TabControl.AddTab("Archives Info");
Expand All @@ -51,10 +51,6 @@ public override async void Execute(ApplicationViewModel contextViewModel, object
case "Settings":
Helper.OpenWindow<AdonisWindow>("Settings", () => new SettingsView().Show());
break;
case "ModelSettings":
UserSettings.Default.LastOpenedSettingTab = contextViewModel.CUE4Parse.Game == FGame.FortniteGame ? 2 : 1;
Helper.OpenWindow<AdonisWindow>("Settings", () => new SettingsView().Show());
break;
case "Help_About":
Helper.OpenWindow<AdonisWindow>("About", () => new About().Show());
break;
Expand Down
39 changes: 16 additions & 23 deletions FModel/Views/Resources/Converters/StringToGameConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,24 @@ public class StringToGameConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var ret = value switch
return value switch
{
"Newt" => FGame.g3,
"Nebula" => FGame.BendGame,
"Fortnite" => FGame.FortniteGame,
"VALORANT" => FGame.ShooterGame,
"Pewee" => FGame.RogueCompany,
"Catnip" => FGame.OakGame,
"AzaleaAlpha" => FGame.Prospect,
"Snoek" => FGame.StateOfDecay2,
"Rosemallow" => FGame.Indiana,
"WorldExplorersLive" => FGame.WorldExplorers,
"MinecraftDungeons" => FGame.Dungeons,
"shoebill" => FGame.SwGame,
"a99769d95d8f400baad1f67ab5dfe508" => FGame.Platform,
"711c5e95dc094ca58e5f16bd48e751d6" => FGame.MultiVersus,
"9361c8c6d2f34b42b5f2f61093eedf48" => FGame.TslGame,
381210 => FGame.DeadByDaylight,
578080 => FGame.TslGame,
677620 => FGame.PortalWars,
1172620 => FGame.Athena,
1665460 => FGame.eFootball,
_ => FGame.Unknown
"Pewee" => "Rogue Company",
"Rosemallow" => "The Outer Worlds",
"Catnip" => "Borderlands 3",
"AzaleaAlpha" => "The Cycle",
"shoebill" => "Star Wars: Jedi Fallen Order",
"Snoek" => "State Of Decay 2",
"711c5e95dc094ca58e5f16bd48e751d6" => "MultiVersus",
"9361c8c6d2f34b42b5f2f61093eedf48" => "PLAYERUNKNOWN'S BATTLEGROUNDS",
381210 => "Dead By Daylight",
578080 => "PLAYERUNKNOWN'S BATTLEGROUNDS",
1172380 => "Star Wars: Jedi Fallen Order",
677620 => "Splitgate",
1172620 => "Sea of Thieves",
1665460 => "eFootball 2023",
_ => value
};
return ret == FGame.Unknown ? value : ret.GetDescription();
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
2 changes: 1 addition & 1 deletion FModel/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
<Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItemStyle}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding CUE4Parse.Game}" Value="{x:Static local:FGame.FortniteGame}">
<DataTrigger Binding="{Binding CUE4Parse.InternalGameName, Converter={x:Static converters:CaseInsensitiveStringEqualsConverter.Instance}, ConverterParameter='FortniteGame'}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
Expand Down
Loading

0 comments on commit 8fa0277

Please sign in to comment.