public static void DrawWeaponStats(string file, string rowname) { if (WeaponsStatsArray == null) { //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string filepath = AssetEntries.AssetEntriesDict.Where(x => x.Key.Contains("/" + file + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(filepath)) { PakReader.PakReader reader = AssetsUtility.GetPakReader(filepath.Substring(0, filepath.LastIndexOf("."))); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(filepath.Substring(0, filepath.LastIndexOf("."))); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList, true); if (AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JArray AssetArray = JArray.FromObject(AssetData); WeaponsStatsArray = AssetArray[0]["rows"].Value <JArray>(); SearchWeaponStats(rowname); } } } } else { SearchWeaponStats(rowname); } }
private static JToken GetGameData() { string datFilePath = GetDatFile(); if (!string.IsNullOrEmpty(datFilePath) && File.Exists(datFilePath)) { string jsonData = File.ReadAllText(datFilePath); if (AssetsUtility.IsValidJson(jsonData)) { JToken games = JsonConvert.DeserializeObject <JToken>(jsonData); if (games != null) { JArray installationListArray = games["InstallationList"].Value <JArray>(); if (installationListArray != null) { return(installationListArray.FirstOrDefault(game => string.Equals(game["AppName"].Value <string>(), "Fortnite"))); } DebugHelper.WriteLine("Fortnite not found in .dat file"); } } } return(null); }
public static void GetBundleData(JArray AssetProperties) { BundleData = new List <BundleInfosEntry>(); JArray bundleDataArray = AssetsUtility.GetPropertyTagText <JArray>(AssetProperties, "QuestInfos", "data"); if (bundleDataArray != null) { foreach (JToken data in bundleDataArray) { if (data["struct_name"] != null && data["struct_type"] != null && string.Equals(data["struct_name"].Value <string>(), "FortChallengeBundleQuestEntry")) { JArray dataPropertiesArray = data["struct_type"]["properties"].Value <JArray>(); if (dataPropertiesArray != null) { JToken questDefinitionToken = AssetsUtility.GetPropertyTagText <JToken>(dataPropertiesArray, "QuestDefinition", "asset_path_name"); if (questDefinitionToken != null) { string path = FoldersUtility.FixFortnitePath(questDefinitionToken.Value <string>()); new UpdateMyProcessEvents(System.IO.Path.GetFileNameWithoutExtension(path), "Waiting").Update(); GetQuestData(dataPropertiesArray, path); } } } } } }
private static void DrawFeaturedImage(JArray AssetProperties, string displayAssetPath) { string jsonData = AssetsUtility.GetAssetJsonDataByPath(displayAssetPath); if (jsonData != null && AssetsUtility.IsValidJson(jsonData)) { FWindow.FCurrentAsset = Path.GetFileName(displayAssetPath); JToken AssetMainToken = AssetsUtility.ConvertJson2Token(jsonData); if (AssetMainToken != null) { JArray displayAssetProperties = AssetMainToken["properties"].Value <JArray>(); switch (displayAssetPath.Substring(displayAssetPath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1)) { case "DA_Featured_Glider_ID_070_DarkViking": case "DA_Featured_CID_319_Athena_Commando_F_Nautilus": JArray TileImageProperties = AssetsUtility.GetPropertyTagStruct <JArray>(displayAssetProperties, "TileImage", "properties"); if (TileImageProperties != null) { DrawFeaturedImageFromDisplayAssetProperty(AssetProperties, TileImageProperties); } break; default: JArray DetailsImageProperties = AssetsUtility.GetPropertyTagStruct <JArray>(displayAssetProperties, "DetailsImage", "properties"); if (DetailsImageProperties != null) { DrawFeaturedImageFromDisplayAssetProperty(AssetProperties, DetailsImageProperties); } break; } } } }
public static void DrawUserFacingFlag(JToken uFF) { if (ItemCategoriesArray == null) { PakReader.PakReader reader = AssetsUtility.GetPakReader("/FortniteGame/Content/Items/ItemCategories"); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries("/FortniteGame/Content/Items/ItemCategories"); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList, true); if (AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JArray AssetArray = JArray.FromObject(AssetData); JToken tertiaryCategoriesToken = AssetsUtility.GetPropertyTag <JToken>(AssetArray[0]["properties"].Value <JArray>(), "TertiaryCategories"); if (tertiaryCategoriesToken != null) { ItemCategoriesArray = tertiaryCategoriesToken["data"].Value <JArray>(); string uFFTargeted = uFF.Value <string>().Substring("Cosmetics.UserFacingFlags.".Length); SearchUserFacingFlag(uFFTargeted); } } } } else { string uFFTargeted = uFF.Value <string>().Substring("Cosmetics.UserFacingFlags.".Length); SearchUserFacingFlag(uFFTargeted); } }
private static string SearchSetDisplayName(string SetTagName) { JArray setArray = ItemSetsArray .Where(x => string.Equals(x["Item1"].Value <string>(), SetTagName)) .Select(x => x["Item2"]["properties"].Value <JArray>()) .FirstOrDefault(); if (setArray != null) { JToken set_namespace = AssetsUtility.GetPropertyTagText <JToken>(setArray, "DisplayName", "namespace"); JToken set_key = AssetsUtility.GetPropertyTagText <JToken>(setArray, "DisplayName", "key"); JToken set_source_string = AssetsUtility.GetPropertyTagText <JToken>(setArray, "DisplayName", "source_string"); if (set_namespace != null && set_key != null && set_source_string != null) { if (string.Equals(FProp.Default.FLanguage, "English")) { if (AssetTranslations.HotfixLocResDict != null && AssetTranslations.HotfixLocResDict.ContainsKey(set_namespace.Value <string>()) && AssetTranslations.HotfixLocResDict[set_namespace.Value <string>()].ContainsKey(set_key.Value <string>()) && AssetTranslations.HotfixLocResDict[set_namespace.Value <string>()][set_key.Value <string>()].ContainsKey("en")) { return(string.Format("\nPart of the {0} set.", AssetTranslations.HotfixLocResDict[set_namespace.Value <string>()][set_key.Value <string>()]["en"])); } return(string.Format("\nPart of the {0} set.", set_source_string.Value <string>())); } else { string cosmeticSet = AssetTranslations.SearchTranslation(set_namespace.Value <string>(), set_key.Value <string>(), set_source_string.Value <string>()); string cosmeticPart = AssetTranslations.SearchTranslation("Fort.Cosmetics", "CosmeticItemDescription_SetMembership_NotRich", "\nPart of the {0} set."); return(string.Format(cosmeticPart, cosmeticSet)); } } } return(string.Empty); }
private static void DecompressTwitterFrameworkFiles() { string _projectPath = AssetsUtility.GetProjectPath(); string _twitterNativeCodeFolderPath = Path.Combine(_projectPath, kRelativePathIOSNativeCodeFolder + "/Twitter"); string _twitterTempFolderPath = Path.Combine(_projectPath, kRelativePathNativePluginsTempFolder + "/Twitter"); if (!Directory.Exists(_twitterNativeCodeFolderPath)) { return; } Directory.CreateDirectory(_twitterTempFolderPath); // *********************** // Framework Section // *********************** string[] _zippedFiles = Directory.GetFiles(_twitterNativeCodeFolderPath, "*.gz", SearchOption.AllDirectories); string _destFolder = Path.Combine(_twitterTempFolderPath, "Framework"); Directory.CreateDirectory(_destFolder); // Iterate through each zip files foreach (string _curZippedFile in _zippedFiles) { Zip.DecompressToDirectory(_curZippedFile, _destFolder); } }
private static void DrawImageFromTagData(string assetPath, string quantity, int y, int mode = 0) { PakReader.PakReader reader = AssetsUtility.GetPakReader(assetPath); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(assetPath); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList); if (AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JToken AssetMainToken = null; if (jsonData.StartsWith("[") && jsonData.EndsWith("]")) { JArray AssetArray = JArray.FromObject(AssetData); AssetMainToken = AssetArray[0]; } else if (jsonData.StartsWith("{") && jsonData.EndsWith("}")) { AssetMainToken = AssetData; } if (AssetMainToken != null) { JArray AssetProperties = AssetMainToken["properties"].Value <JArray>(); DrawLargeSmallImage(AssetProperties, quantity, y, mode); } } } }
public static void Uninstall() { bool _startUninstall = EditorUtility.DisplayDialog(kUninstallAlertTitle, kUninstallAlertMessage, "Uninstall", "Cancel"); if (_startUninstall) { foreach (string _eachFolder in kPluginFolders) { string _absolutePath = AssetsUtility.AssetPathToAbsolutePath(_eachFolder); if (Directory.Exists(_absolutePath)) { Directory.Delete(_absolutePath, true); // Delete meta files. FileOperations.Delete(_absolutePath + ".meta"); } } // For LITE version we need to remove defines. GlobalDefinesManager _definesManager = new GlobalDefinesManager(); foreach (int _eachCompiler in System.Enum.GetValues(typeof(GlobalDefinesManager.eCompiler))) { _definesManager.RemoveDefineSymbol((GlobalDefinesManager.eCompiler)_eachCompiler, NPSettings.kLiteVersionMacro); } _definesManager.SaveAllCompilers(); AssetDatabase.Refresh(); EditorUtility.DisplayDialog("Cross Platform Native Plugins", "Uninstall successful!", "Ok"); } }
private static string GetAssetInfos(bool isFromDataGrid = false) { StringBuilder sb = new StringBuilder(); string fullPath = isFromDataGrid ? FWindow.FCurrentAsset : TreeViewUtility.GetFullPath(FWindow.TVItem) + "/" + FWindow.FCurrentAsset; PakReader.PakReader reader = AssetsUtility.GetPakReader(fullPath); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(fullPath); foreach (FPakEntry entry in entriesList) { sb.Append( "\n- PAK File:\t" + Path.GetFileName(reader.Name) + "\n- Path:\t\t" + entry.Name + "\n- Position:\t" + entry.Pos + "\n- Size:\t\t" + AssetsUtility.GetReadableSize(entry.UncompressedSize) + "\n- Encrypted:\t" + entry.Encrypted + "\n" ); } } if (isFromDataGrid) { string selectedName = fullPath.Substring(fullPath.LastIndexOf("/") + 1); if (selectedName.EndsWith(".uasset")) { selectedName = selectedName.Substring(0, selectedName.LastIndexOf('.')); } FWindow.FCurrentAsset = selectedName; } return(sb.ToString()); }
public static void DrawWeaponFacingFlag(JToken uFF) { if (SecondaryCategoriesDataArray == null) { string jsonData = AssetsUtility.GetAssetJsonDataByPath("/FortniteGame/Content/Items/ItemCategories", true); if (jsonData != null && AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JArray AssetArray = JArray.FromObject(AssetData); JToken secondaryCategoriesToken = AssetsUtility.GetPropertyTag <JToken>(AssetArray[0]["properties"].Value <JArray>(), "SecondaryCategories"); if (secondaryCategoriesToken != null) { SecondaryCategoriesDataArray = secondaryCategoriesToken["data"].Value <JArray>(); string uFFTargeted = uFF.Value <string>(); SearchWeaponFacingFlag(uFFTargeted); } } } else { string uFFTargeted = uFF.Value <string>(); SearchWeaponFacingFlag(uFFTargeted); } }
private static void DrawUnlockType(SolidColorBrush PrimaryColor, SolidColorBrush SecondaryColor, string path, int y) { Stream image = AssetsUtility.GetStreamImageFromPath(path); if (image != null) { using (image) { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.CacheOption = BitmapCacheOption.OnLoad; bmp.StreamSource = image; bmp.EndInit(); bmp.Freeze(); IconCreator.ICDrawingContext.DrawRectangle(ChallengesUtility.LightBrush(PrimaryColor, 0.04f), null, new Rect(20, y, 50, 35)); Point dStart = new Point(20, y); LineSegment[] dSegments = new[] { new LineSegment(new Point(31, y), true), new LineSegment(new Point(31, y + 20), true), new LineSegment(new Point(25, y + 15), true), new LineSegment(new Point(29, y + 35), true), new LineSegment(new Point(20, y + 35), true), }; PathFigure dFigure = new PathFigure(dStart, dSegments, true); PathGeometry dGeo = new PathGeometry(new[] { dFigure }); IconCreator.ICDrawingContext.DrawGeometry(ChallengesUtility.DarkBrush(PrimaryColor, 0.3f), null, dGeo); IconCreator.ICDrawingContext.DrawImage(bmp, new Rect(50 - 15, y + 2, 32, 32)); } } }
private static void DrawAdditionalWrapImage(JArray AssetProperties) { JToken largePreviewImage = AssetProperties.FirstOrDefault(x => string.Equals(x["name"].Value <string>(), "LargePreviewImage")); JToken smallPreviewImage = AssetProperties.FirstOrDefault(x => string.Equals(x["name"].Value <string>(), "SmallPreviewImage")); if (largePreviewImage != null || smallPreviewImage != null) { JToken assetPathName = largePreviewImage != null ? largePreviewImage["tag_data"]["asset_path_name"] : smallPreviewImage != null ? smallPreviewImage["tag_data"]["asset_path_name"] : null; if (assetPathName != null) { string texturePath = FoldersUtility.FixFortnitePath(assetPathName.Value <string>()); using (Stream image = AssetsUtility.GetStreamImageFromPath(texturePath)) { if (image != null) { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.CacheOption = BitmapCacheOption.OnLoad; bmp.StreamSource = image; bmp.EndInit(); bmp.Freeze(); IconCreator.ICDrawingContext.DrawImage(bmp, new Rect(275, 272, 122, 122)); } } } } }
public static void GetHeroPerk(JArray AssetProperties) { JToken heroGameplayDefinitionToken = AssetsUtility.GetPropertyTagImport <JToken>(AssetProperties, "HeroGameplayDefinition"); if (heroGameplayDefinitionToken != null) { string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + heroGameplayDefinitionToken.Value <string>().ToLowerInvariant() + ".")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { string jsonData = AssetsUtility.GetAssetJsonDataByPath(assetPath, false, assetPath.Substring(0, assetPath.LastIndexOf("."))); if (jsonData != null && AssetsUtility.IsValidJson(jsonData)) { JToken AssetMainToken = AssetsUtility.ConvertJson2Token(jsonData); if (AssetMainToken != null) { JArray heroGameplayProperties = AssetMainToken["properties"].Value <JArray>(); if (heroGameplayProperties != null) { _borderY = 518; _textY = 550; _imageY = 519; DrawHeroPerk(heroGameplayProperties); DrawTierAbilityKits(heroGameplayProperties); //RESIZE IconCreator.ICDrawingContext.DrawRectangle(Brushes.Transparent, null, new Rect(new Point(0, 0), new Size(515, 560 + 35 * 3))); } } } } } }
private static void DrawNormalIcon(string path, string quantity, int y, int mode = 0) { string jsonData = AssetsUtility.GetAssetJsonDataByPath(path); if (jsonData != null) { if (AssetsUtility.IsValidJson(jsonData)) { JToken AssetMainToken = AssetsUtility.ConvertJson2Token(jsonData); if (AssetMainToken != null) { JArray propertiesArray = AssetMainToken["properties"].Value <JArray>(); if (propertiesArray != null) { JToken heroToken = AssetsUtility.GetPropertyTagImport <JToken>(propertiesArray, "HeroDefinition"); JToken weaponToken = AssetsUtility.GetPropertyTagImport <JToken>(propertiesArray, "WeaponDefinition"); if (heroToken != null) { //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + heroToken.Value <string>().ToLowerInvariant() + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { DrawImageFromTagData(assetPath.Substring(0, assetPath.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase)), quantity, y, mode); } } else if (weaponToken != null) { string weaponName = weaponToken.Value <string>(); if (weaponToken.Value <string>().Equals("WID_Harvest_Pickaxe_STWCosmetic_Tier")) //STW PICKAXES MANUAL FIX { weaponName = "WID_Harvest_Pickaxe_STWCosmetic_Tier_" + FWindow.FCurrentAsset.Substring(FWindow.FCurrentAsset.Length - 1); } //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + weaponName.ToLowerInvariant() + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { DrawImageFromTagData(assetPath.Substring(0, assetPath.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase)), quantity, y, mode); } } else { DrawLargeSmallImage(propertiesArray, quantity, y, mode); } } } } } else { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.CacheOption = BitmapCacheOption.OnLoad; bmp.StreamSource = Application.GetResourceStream(new Uri(UNKNOWN_ICON)).Stream; bmp.EndInit(); bmp.Freeze(); IconCreator.ICDrawingContext.DrawImage(bmp, new Rect(902, y + 3, 64, 64)); } }
private static void GetSerieAsset(JToken serieToken, JToken rarityToken) { //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string seriesFullPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + serieToken.Value <string>().ToLowerInvariant() + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(seriesFullPath)) { string path = seriesFullPath.Substring(0, seriesFullPath.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase)); PakReader.PakReader reader = AssetsUtility.GetPakReader(path); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(path); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList); if (AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JToken AssetMainToken = null; if (jsonData.StartsWith("[") && jsonData.EndsWith("]")) { JArray AssetArray = JArray.FromObject(AssetData); AssetMainToken = AssetArray[0]; } else if (jsonData.StartsWith("{") && jsonData.EndsWith("}")) { AssetMainToken = AssetData; } if (AssetMainToken != null) { JArray propertiesArray = AssetMainToken["properties"].Value <JArray>(); if (propertiesArray != null) { JArray colorsArray = AssetsUtility.GetPropertyTagStruct <JArray>(propertiesArray, "Colors", "properties"); if (colorsArray != null) { DrawSerieBackground(colorsArray); } JToken backgroundTextureToken = AssetsUtility.GetPropertyTagText <JToken>(propertiesArray, "BackgroundTexture", "asset_path_name"); if (backgroundTextureToken != null) { string imagePath = FoldersUtility.FixFortnitePath(backgroundTextureToken.Value <string>()); DrawSerieImage(imagePath); } } } } } else { DrawNormalRarity(rarityToken); } } else { DrawNormalRarity(rarityToken); } }
private void RC_ExportData_Click(object sender, RoutedEventArgs e) { if (ListBox_Main.SelectedIndex >= 0) { FWindow.FCurrentAsset = ListBox_Main.SelectedItem.ToString(); AssetsUtility.ExportAssetData(); } }
private static string GetTwitterXcodeModFilePath() { string _projectPath = AssetsUtility.GetProjectPath(); string _externalFolder = Path.Combine(_projectPath, kExtenalFolderRelativePath); string _twitterModFile = Path.Combine(_externalFolder, "Twitter.xcodemods"); return(_twitterModFile); }
private void RC_Copy_FName_NoExt_Click(object sender, RoutedEventArgs e) { if (ListBox_Main.SelectedIndex >= 0) { FWindow.FCurrentAsset = ListBox_Main.SelectedItem.ToString(); Clipboard.SetText(AssetsUtility.GetAssetPathToCopy(true, false)); } }
private void WriteAndroidManifestFile() { string _manifestFolderPath = Constants.kAndroidPluginsLibraryPath; if (AssetsUtility.FolderExists(_manifestFolderPath)) { NPAndroidManifestGenerator _generator = new NPAndroidManifestGenerator(); _generator.SaveManifest("com.voxelbusters.androidnativeplugin", _manifestFolderPath + "/AndroidManifest.xml"); } }
private void PopulateRecipeIDs(IntListSO target) { var recipes = AssetsUtility.FindAllAssets <Recipe>(); target.ints = new System.Collections.Generic.List <int>(); for (int i = 0; i < recipes.Length; i++) { target.ints.Add(recipes[i].id); } }
public static void DrawIconImage(JArray AssetProperties, bool isFeatured) { if (isFeatured) { JToken displayAssetPathToken = AssetsUtility.GetPropertyTagStruct <JToken>(AssetProperties, "DisplayAssetPath", "asset_path_name"); if (displayAssetPathToken != null) { string displayAssetPath = FoldersUtility.FixFortnitePath(displayAssetPathToken.Value <string>()); DrawFeaturedImageFromTagData(AssetProperties, displayAssetPath); } else if (AssetEntries.AssetEntriesDict.ContainsKey("/FortniteGame/Content/Catalog/DisplayAssets/DA_Featured_" + FWindow.FCurrentAsset + ".uasset")) { string displayAssetPath = "/FortniteGame/Content/Catalog/DisplayAssets/DA_Featured_" + FWindow.FCurrentAsset; DrawFeaturedImageFromTagData(AssetProperties, displayAssetPath); } else { DrawIconImage(AssetProperties, false); } } else { JToken heroToken = AssetsUtility.GetPropertyTagImport <JToken>(AssetProperties, "HeroDefinition"); JToken weaponToken = AssetsUtility.GetPropertyTagImport <JToken>(AssetProperties, "WeaponDefinition"); if (heroToken != null) { //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + heroToken.Value <string>().ToLowerInvariant() + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { DrawImageFromTagData(assetPath.Substring(0, assetPath.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase))); } } else if (weaponToken != null) { string weaponName = weaponToken.Value <string>(); if (weaponToken.Value <string>().Equals("WID_Harvest_Pickaxe_STWCosmetic_Tier")) //STW PICKAXES MANUAL FIX { weaponName = "WID_Harvest_Pickaxe_STWCosmetic_Tier_" + FWindow.FCurrentAsset.Substring(FWindow.FCurrentAsset.Length - 1); } //this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry> string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + weaponName.ToLowerInvariant() + ".uasset")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { DrawImageFromTagData(assetPath.Substring(0, assetPath.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase))); } } else { DrawLargeSmallImage(AssetProperties); } } }
private static void SearchUserFacingFlag(string uFFTarget) { foreach (JToken data in TertiaryCategoriesDataArray) { JArray propertiesArray = data["struct_type"]["properties"].Value <JArray>(); if (propertiesArray != null) { JToken categoryNameToken = AssetsUtility.GetPropertyTagText <JToken>(propertiesArray, "CategoryName", "source_string"); if (categoryNameToken != null) { if ( uFFTarget.Contains("Animated") && categoryNameToken.Value <string>() == "Animated" || uFFTarget.Contains("HasVariants") && categoryNameToken.Value <string>() == "Unlockable Styles" || uFFTarget.Contains("Reactive") && categoryNameToken.Value <string>() == "Reactive" || uFFTarget.Contains("Traversal") && categoryNameToken.Value <string>() == "Traversal" || uFFTarget.Contains("BuiltInEmote") && categoryNameToken.Value <string>() == "Built-in" || uFFTarget.Contains("Synced") && categoryNameToken.Value <string>() == "Synced" || uFFTarget.Contains("GearUp") && categoryNameToken.Value <string>() == "Forged" || uFFTarget.Contains("Enlightened") && categoryNameToken.Value <string>() == "Enlightened") { GetUFFImage(propertiesArray); } else if (uFFTarget.Contains("HasUpgradeQuests") && categoryNameToken.Value <string>() == "Unlockable Styles") { if (AssetsLoader.ExportType == "AthenaPetCarrierItemDefinition") { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.CacheOption = BitmapCacheOption.OnLoad; bmp.UriSource = new Uri(PET_CUSTOM_ICON); bmp.EndInit(); bmp.Freeze(); xCoords += 25; IconCreator.ICDrawingContext.DrawImage(bmp, new Rect(xCoords, 4, 25, 25)); } else { BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.CacheOption = BitmapCacheOption.OnLoad; bmp.UriSource = new Uri(QUEST_CUSTOM_ICON); bmp.EndInit(); bmp.Freeze(); xCoords += 25; IconCreator.ICDrawingContext.DrawImage(bmp, new Rect(xCoords, 4, 25, 25)); } } } } } }
public static void DrawChallenge(JArray AssetProperties, string lastfolder) { isBanner = false; hasDisplayStyle = false; SolidColorBrush PrimaryColor; SolidColorBrush SecondaryColor; Stream image = null; string displayName = string.Empty; JArray displayStyleArray = AssetsUtility.GetPropertyTagStruct <JArray>(AssetProperties, "DisplayStyle", "properties"); if (FProp.Default.FUseChallengeWatermark) { string[] primaryParts = FProp.Default.FPrimaryColor.Split(':'); string[] secondaryParts = FProp.Default.FSecondaryColor.Split(':'); PrimaryColor = new SolidColorBrush(Color.FromRgb(Convert.ToByte(primaryParts[0]), Convert.ToByte(primaryParts[1]), Convert.ToByte(primaryParts[2]))); SecondaryColor = new SolidColorBrush(Color.FromRgb(Convert.ToByte(secondaryParts[0]), Convert.ToByte(secondaryParts[1]), Convert.ToByte(secondaryParts[2]))); if (string.IsNullOrEmpty(FProp.Default.FBannerFilePath) && displayStyleArray != null) { hasDisplayStyle = true; image = ChallengesUtility.GetChallengeBundleImage(displayStyleArray); } } else if (displayStyleArray != null) { hasDisplayStyle = true; PrimaryColor = ChallengesUtility.GetPrimaryColor(displayStyleArray); SecondaryColor = ChallengesUtility.GetSecondaryColor(displayStyleArray, lastfolder); image = ChallengesUtility.GetChallengeBundleImage(displayStyleArray); } else { PrimaryColor = ChallengesUtility.RandomSolidColorBrush(); SecondaryColor = ChallengesUtility.RandomSolidColorBrush(); } JToken name_namespace = AssetsUtility.GetPropertyTagText <JToken>(AssetProperties, "DisplayName", "namespace"); JToken name_key = AssetsUtility.GetPropertyTagText <JToken>(AssetProperties, "DisplayName", "key"); JToken name_source_string = AssetsUtility.GetPropertyTagText <JToken>(AssetProperties, "DisplayName", "source_string"); if (name_namespace != null && name_key != null && name_source_string != null) { displayName = AssetTranslations.SearchTranslation(name_namespace.Value <string>(), name_key.Value <string>(), name_source_string.Value <string>()); } DrawHeader(displayName, lastfolder, PrimaryColor, SecondaryColor, image); DrawQuests(PrimaryColor, SecondaryColor); ChallengeCompletionRewards.DrawChallengeCompletion(AssetProperties, PrimaryColor, SecondaryColor, y); }
private void WriteAndroidManifestFile() { string _manifestFolderPath = Constants.kAndroidPluginsLibraryPath; if (AssetsUtility.FolderExists(_manifestFolderPath)) { NPAndroidManifestGenerator _generator = new NPAndroidManifestGenerator(); #if UNITY_2017_1_OR_NEWER _generator.SaveManifest("com.voxelbusters.androidnativeplugin", _manifestFolderPath + "/AndroidManifest.xml", "9", "26"); #else _generator.SaveManifest("com.voxelbusters.androidnativeplugin", _manifestFolderPath + "/AndroidManifest.xml", "9", "24"); #endif } }
public static void GetHeroPerk(JArray AssetProperties) { JToken heroGameplayDefinitionToken = AssetsUtility.GetPropertyTagImport <JToken>(AssetProperties, "HeroGameplayDefinition"); if (heroGameplayDefinitionToken != null) { string assetPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.ToLowerInvariant().Contains("/" + heroGameplayDefinitionToken.Value <string>().ToLowerInvariant() + ".")).Select(d => d.Key).FirstOrDefault(); if (!string.IsNullOrEmpty(assetPath)) { PakReader.PakReader reader = AssetsUtility.GetPakReader(assetPath); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(assetPath.Substring(0, assetPath.Length - ".uasset".Length)); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList); if (AssetsUtility.IsValidJson(jsonData)) { dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JToken AssetMainToken = null; if (jsonData.StartsWith("[") && jsonData.EndsWith("]")) { JArray AssetArray = JArray.FromObject(AssetData); AssetMainToken = AssetArray[0]; } else if (jsonData.StartsWith("{") && jsonData.EndsWith("}")) { AssetMainToken = AssetData; } if (AssetMainToken != null) { JArray heroGameplayProperties = AssetMainToken["properties"].Value <JArray>(); if (heroGameplayProperties != null) { _borderY = 518; _textY = 550; _imageY = 519; DrawHeroPerk(heroGameplayProperties); DrawTierAbilityKits(heroGameplayProperties); //RESIZE IconCreator.ICDrawingContext.DrawRectangle(Brushes.Transparent, null, new Rect(new Point(0, 0), new Size(515, 560 + 35 * 3))); } } } } } } }
private static void DrawImageFromTagData(string assetPath) { string jsonData = AssetsUtility.GetAssetJsonDataByPath(assetPath); if (jsonData != null && AssetsUtility.IsValidJson(jsonData)) { JToken AssetMainToken = AssetsUtility.ConvertJson2Token(jsonData); if (AssetMainToken != null) { JArray AssetProperties = AssetMainToken["properties"].Value <JArray>(); DrawLargeSmallImage(AssetProperties); } } }
private static void DrawFeaturedImage(JArray AssetProperties, string displayAssetPath) { PakReader.PakReader reader = AssetsUtility.GetPakReader(displayAssetPath); if (reader != null) { List <FPakEntry> entriesList = AssetsUtility.GetPakEntries(displayAssetPath); string jsonData = AssetsUtility.GetAssetJsonData(reader, entriesList); if (AssetsUtility.IsValidJson(jsonData)) { FWindow.FCurrentAsset = Path.GetFileName(displayAssetPath); dynamic AssetData = JsonConvert.DeserializeObject(jsonData); JToken AssetMainToken = null; if (jsonData.StartsWith("[") && jsonData.EndsWith("]")) { JArray AssetArray = JArray.FromObject(AssetData); AssetMainToken = AssetArray[0]; } else if (jsonData.StartsWith("{") && jsonData.EndsWith("}")) { AssetMainToken = AssetData; } if (AssetMainToken != null) { JArray displayAssetProperties = AssetMainToken["properties"].Value <JArray>(); switch (displayAssetPath.Substring(displayAssetPath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1)) { case "DA_Featured_Glider_ID_070_DarkViking": case "DA_Featured_CID_319_Athena_Commando_F_Nautilus": JArray TileImageProperties = AssetsUtility.GetPropertyTagStruct <JArray>(displayAssetProperties, "TileImage", "properties"); if (TileImageProperties != null) { DrawFeaturedImageFromDisplayAssetProperty(AssetProperties, TileImageProperties); } break; default: JArray DetailsImageProperties = AssetsUtility.GetPropertyTagStruct <JArray>(displayAssetProperties, "DetailsImage", "properties"); if (DetailsImageProperties != null) { DrawFeaturedImageFromDisplayAssetProperty(AssetProperties, DetailsImageProperties); } break; } } } } }
public static void GenerateItemDatabase() { var itemDB = GetItemDatabase(); if (itemDB == null) { return; } itemDB.Initialise(GetAllItemAssets()); EditorUtility.SetDirty(itemDB); AssetsUtility.SaveRefreshAndFocus(); Selection.activeObject = itemDB; }
private static void DecompressTwitterSDKFiles() { string _projectPath = AssetsUtility.GetProjectPath(); string _twitterNativeCodeFolderPath = Path.Combine(_projectPath, kRelativePathIOSNativeCodeFolder + "/Twitter"); if (!Directory.Exists(_twitterNativeCodeFolderPath)) { return; } foreach (string _filePath in Directory.GetFiles(_twitterNativeCodeFolderPath, "*.gz", SearchOption.AllDirectories)) { Zip.DecompressToDirectory(_filePath, kRelativePathNativePluginsSDKFolder); } }