public CompletionReward(IntProperty completionCount) { string all = Localizations.GetLocalization("AthenaChallengeDetailsEntry", "CompletionRewardFormat_All", "Complete <text color=\"FFF\" case=\"upper\" fontface=\"black\">all {0} challenges</> to earn the reward item"); string allFormated = ReformatString(all, completionCount.Value.ToString(), true); string any = Localizations.GetLocalization("AthenaChallengeDetailsEntry", "CompletionRewardFormat", "Complete <text color=\"FFF\" case=\"upper\" fontface=\"black\">any {0} challenges</> to earn the reward item"); string anyFormated = ReformatString(any, completionCount.Value.ToString(), false); CompletionText = completionCount.Value >= 0 ? anyFormated : allFormated; Reward = null; }
internal FStringTable(PackageReader reader) { TableNamespace = reader.ReadFString(); KeysToMetadata = new Dictionary <string, Dictionary <string, string> > { { TableNamespace, new Dictionary <string, string>() } }; int NumEntries = reader.ReadInt32(); for (int i = 0; i < NumEntries; i++) { string key = reader.ReadFString(); KeysToMetadata[TableNamespace].Add(key, Localizations.GetLocalization(TableNamespace, key, reader.ReadFString())); } }
/// <summary> /// Order: /// 1. Rarity /// 2. Image /// 3. Text /// 1. DisplayName /// 2. Description /// 3. Misc /// 4. GameplayTags /// 1. order doesn't matter /// 2. the importance here is to get the description before gameplay tags /// </summary> public BaseIcon(IUExport export, string exportType, ref string assetName) : this() { // rarity if (export.GetExport <ObjectProperty>("Series") is ObjectProperty series) { Serie.GetRarity(this, series); } else if (Properties.Settings.Default.UseGameColors) // override default green { Rarity.GetInGameRarity(this, export.GetExport <EnumProperty>("Rarity")); // uncommon will be triggered by Rarity being null } else if (export.GetExport <EnumProperty>("Rarity") is EnumProperty rarity) { Rarity.GetHardCodedRarity(this, rarity); } // image if (Properties.Settings.Default.UseItemShopIcon && DisplayAssetImage.GetDisplayAssetImage(this, export.GetExport <SoftObjectProperty>("DisplayAssetPath"), ref assetName)) { } // ^^^^ will return false if image not found, if so, we try to get the normal icon else if (export.GetExport <ObjectProperty>("HeroDefinition", "WeaponDefinition") is ObjectProperty itemDef) { LargeSmallImage.GetPreviewImage(this, itemDef, assetName); } else if (export.GetExport <SoftObjectProperty>("LargePreviewImage", "SmallPreviewImage", "ItemDisplayAsset") is SoftObjectProperty previewImage) { LargeSmallImage.GetPreviewImage(this, previewImage); } else if (export.GetExport <StructProperty>("IconBrush") is StructProperty iconBrush) // abilities { LargeSmallImage.GetPreviewImage(this, iconBrush); } // text if (export.GetExport <TextProperty>("DisplayName", "DefaultHeaderText", "UIDisplayName") is TextProperty displayName) { DisplayName = Text.GetTextPropertyBase(displayName); } if (export.GetExport <TextProperty>("Description", "DefaultBodyText") is TextProperty description) { Description = Text.GetTextPropertyBase(description); } else if (export.GetExport <ArrayProperty>("Description") is ArrayProperty arrayDescription) // abilities { Description = Text.GetTextPropertyBase(arrayDescription); } if (export.GetExport <StructProperty>("MaxStackSize") is StructProperty maxStackSize) { ShortDescription = Text.GetMaxStackSize(maxStackSize); } else if (export.GetExport <TextProperty>("ShortDescription") is TextProperty shortDescription) { ShortDescription = Text.GetTextPropertyBase(shortDescription); } else if (exportType.Equals("AthenaItemWrapDefinition")) // if no ShortDescription it's most likely a wrap { ShortDescription = Localizations.GetLocalization("Fort.Cosmetics", "ItemWrapShortDescription", "Wrap"); } // gameplaytags if (export.GetExport <StructProperty>("GameplayTags") is StructProperty gameplayTags) { GameplayTag.GetGameplayTags(this, gameplayTags, exportType); } else if (export.GetExport <ObjectProperty>("cosmetic_item") is ObjectProperty cosmeticItem) // variants { CosmeticSource = cosmeticItem.Value.Resource.ObjectName.String; } if (export.GetExport <SoftObjectProperty>("AmmoData") is SoftObjectProperty ammoData) { Statistics.GetAmmoData(this, ammoData); } if (export.GetExport <StructProperty>("WeaponStatHandle") is StructProperty weaponStatHandle) { Statistics.GetWeaponStats(this, weaponStatHandle); } if (export.GetExport <ObjectProperty>("HeroGameplayDefinition") is ObjectProperty heroGameplayDefinition) { Statistics.GetHeroStats(this, heroGameplayDefinition); } /* Please do not add Schematics support because it takes way too much memory */ /* Thank the STW Dev Team for using a 5,69Mb file to get... Oh nvm, they all left */ AdditionalSize = 48 * Stats.Count; }
internal Base(PackageReader reader) { Namespace = reader.ReadFString() ?? string.Empty; // namespaces are sometimes null Key = reader.ReadFString() ?? string.Empty; SourceString = Localizations.GetLocalization(Namespace, Key, reader.ReadFString()); }