/** * Uses a SelectResourceTool to get the assetPath of a resource belonging to * the given category using an asset chooser with the given filter * * @param category * @param filter * @return */ public static string selectAssetPathUsingChooser(int category, int filter) { string assetPath = null; ResourcesUni resources = new ResourcesUni(); AssetInformation[] assetsInformation = new AssetInformation[1]; assetsInformation[0] = new AssetInformation("", "marihuanhell", false, category, filter); int resourcesType = -10; int index = 0; //try //{ SelectResourceTool tool = new SelectResourceTool(resources, assetsInformation, resourcesType, index); tool.doTool(); if (tool.resources.existAsset("marihuanhell")) { assetPath = tool.resources.getAssetPath("marihuanhell"); } //} //catch (CloneNotSupportedException e) //{ // ReportDialog.GenerateErrorReport(e, true, "Error selecting asset path"); //} return(assetPath); }
protected static AssetInformation[] createAssetInfoArray() { AssetInformation[] array = new AssetInformation[1]; array[0] = new AssetInformation("", AUDIO_STR, true, AssetsConstants.CATEGORY_AUDIO, AssetsController.FILTER_NONE); return(array); }
public static void GetAssetsManifest() { /* Download assets manifest */ string assetsManifest = webClient.DownloadString(minecraftVersionJson.AssetIndex.Url); minecrafetVersionAssetsData = assetsManifest; JObject jObject = (JObject)JsonConvert.DeserializeObject(assetsManifest); JEnumerable <JToken> jTokens = jObject.Children(); foreach (JToken jToken in jTokens) { JProperty jProperty = (JProperty)jToken; if (jProperty.Name == "objects") { /* Get Objects JSON Object */ JToken jToken1 = jProperty.Value; foreach (JToken jToken2 in jToken1.Children()) { /* Get "objects" children to receive all assets data */ JProperty jProperty1 = (JProperty)jToken2; AssetInformation assetInformation = jProperty1.Value.ToObject <AssetInformation>(); assetInformation.Title = jProperty1.Name; assetsInformation.Add(assetInformation); } } } }
protected static AssetInformation[] createAssetInfoArray(int t) { string type = DescriptorData.getCursorTypeString(t); AssetInformation[] array = new AssetInformation[1]; array[0] = new AssetInformation("", type, true, AssetsConstants.CATEGORY_CURSOR, AssetsController.FILTER_NONE); return(array); }
/// <summary>Edit a matched asset.</summary> /// <param name="asset">A helper which encapsulates metadata about an asset and enables changes to it.</param> public void Edit <T>(IAssetData asset) { string[] files = Directory.GetFiles(CustomAssetModifier.objectInformationPath); foreach (var file in files) { var ok = AssetInformation.readJson(file); asset .AsDictionary <int, string>() .Set(Convert.ToInt32(ok.id), ok.informationString); } }
private AssetInformation GetAssetInformation(string resID) { AssetInformation assetInfo = null; if (!m_assets.TryGetValue(resID, out assetInfo)) { assetInfo = new AssetInformation(resID); m_assets.Add(resID, assetInfo); } return(assetInfo); }
protected static AssetInformation[] createAssetInfoArray(string type) { AssetInformation[] array = new AssetInformation[1]; if (type.StartsWith(DescriptorData.SOUND_PATH)) { array[0] = new AssetInformation("", type, true, AssetsConstants.CATEGORY_AUDIO, AssetsController.FILTER_NONE); } else { array[0] = new AssetInformation("", type, true, AssetsConstants.CATEGORY_BUTTON, AssetsController.FILTER_NONE); } return(array); }
private void buttonOpenAsset_Click(object sender, EventArgs e) { IAsset AssetToDisplayP = MyProgram.Asset; if (AssetToDisplayP != null) { AssetInformation form = new AssetInformation(MyMainForm, MyContext) { myAsset = AssetToDisplayP, myStreamingEndpoints = MyStreamingEndpoints // we want to keep the same sorting }; DialogResult dialogResult = form.ShowDialog(this); } }
public void tooltip_Popup(object sender, PopupEventArgs e) { String assetId = m_dataSource.Text; AssetInformation assetInformation = Database.Database.getAsset(assetId); if (assetInformation != null) { Image image = Search.FrmAsset.getImage(assetInformation.filename, assetInformation.base_id.ToString(), assetInformation.descr, out assetInformation.filename); if (image != null) { e.ToolTipSize = new Size(image.Width, image.Height); } } }
private void buttonOpenAsset_Click(object sender, EventArgs e) { _client.RefreshTokenIfNeeded(); Asset AssetToDisplayP = _client.AMSclient.Assets.Get(_client.credentialsEntry.ResourceGroup, _client.credentialsEntry.AccountName, MyLiveOutput.AssetName); if (AssetToDisplayP != null) { AssetInformation form = new AssetInformation(MyMainForm, _client) { myAssetV3 = AssetToDisplayP, myStreamingEndpoints = MyStreamingEndpoints // we want to keep the same sorting }; DialogResult dialogResult = form.ShowDialog(this); } else { MessageBox.Show(string.Format("Asset '{0}' not found !", MyLiveOutput.AssetName), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DisplayAssetInfo(bool input) { string assetName = null; if (input) { if (MyJob.Input.GetType() == typeof(JobInputAsset)) { JobInputAsset inputAsset = MyJob.Input as JobInputAsset; assetName = inputAsset.AssetName; } } else // output { int index = listBoxOutputs.SelectedIndices[0]; if (MyJob.Outputs[index].GetType() == typeof(JobOutputAsset)) { JobOutputAsset outputAsset = MyJob.Outputs[index] as JobOutputAsset; assetName = outputAsset.AssetName; } } if (assetName != null) { _amsClient.RefreshTokenIfNeeded(); Asset asset = Task.Run(() => _amsClient.AMSclient.Assets.GetAsync(_amsClient.credentialsEntry.ResourceGroup, _amsClient.credentialsEntry.AccountName, assetName)) .GetAwaiter().GetResult(); using (AssetInformation form = new AssetInformation(_mainform, _amsClient) { myAssetV3 = asset, myStreamingEndpoints = MyStreamingEndpoints // we want to keep the same sorting }) { DialogResult dialogResult = form.ShowDialog(this); } } }
private void DisplayAssetInfo(bool input) { IAsset asset; if (input) { var index = listViewInputAssets.SelectedIndices[0]; asset = MyJob.InputMediaAssets[index]; } else { var index = listViewOutputAssets.SelectedIndices[0]; asset = MyJob.OutputMediaAssets[index]; } AssetInformation form = new AssetInformation(_mainform, _context) { myAsset = asset, myStreamingEndpoints = MyStreamingEndpoints // we want to keep the same sorting }; DialogResult dialogResult = form.ShowDialog(this); }
public void tooltip_Draw(object sender, DrawToolTipEventArgs e) { String assetId = m_dataSource.Text; AssetInformation assetInformation = Database.Database.getAsset(assetId); if (assetInformation != null) { // Draw the standard background. //e.DrawBackground(); // Draw the standard background //e.DrawBorder(); Image image = Search.FrmAsset.getImage(assetInformation.filename, assetInformation.base_id.ToString(), assetInformation.descr, out assetInformation.filename); if (image != null) { e.Graphics.DrawImage(image, 0, 0); } /* * // Draw the custom border to appear 3-dimensional. * e.Graphics.DrawLines(SystemPens.ControlLightLight, new Point[] { * new Point (0, e.Bounds.Height - 1), * new Point (0, 0), * new Point (e.Bounds.Width - 1, 0) * }); * e.Graphics.DrawLines(SystemPens.ControlDarkDark, new Point[] { * new Point (0, e.Bounds.Height - 1), * new Point (e.Bounds.Width - 1, e.Bounds.Height - 1), * new Point (e.Bounds.Width - 1, 0) * }); */ } }
/// <summary> /// Creates the blank object example for dinosaur eggs. /// </summary> public void createBlankObjectTemplate() { var ok = new AssetInformation("107", "Dinosaur Egg / 720 / -300 / Arch / A giant dino egg...The entire shell is still intact!/ Mine .01 Mountain .008 / Item 1 107"); ok.writeJson(Path.Combine(TemplatePath, "ObjectInformation", ok.id.ToString() + ".json")); }
private UnityEngine.Object LoadImmediately(string resID, out AssetInformation outAssetInfo) { outAssetInfo = GetAssetInformation(resID); return(outAssetInfo.AssetLoad()); }