/// <summary> /// Retrieves import options for the texture we're currently inspecting. /// </summary> /// <returns>Font import options object.</returns> private FontImportOptions GetImportOptions() { Font font = InspectedObject as Font; FontImportOptions output = null; if (font != null) { LibraryEntry texEntry = ProjectLibrary.GetEntry(ProjectLibrary.GetPath(font)); if (texEntry != null && texEntry.Type == LibraryEntryType.File) { FileEntry texFileEntry = (FileEntry)texEntry; output = texFileEntry.Options as FontImportOptions; } } if (output == null) { if (importOptions == null) { output = new FontImportOptions(); } else { output = importOptions; } } return(output); }
/// <summary> /// Retrieves import options for the texture we're currently inspecting. /// </summary> /// <returns>Font import options object.</returns> private FontImportOptions GetImportOptions() { FontImportOptions output = null; LibraryEntry texEntry = ProjectLibrary.GetEntry(InspectedResourcePath); if (texEntry != null && texEntry.Type == LibraryEntryType.File) { FileEntry texFileEntry = (FileEntry)texEntry; output = texFileEntry.Options as FontImportOptions; } if (output == null) { if (importOptions == null) { output = new FontImportOptions(); } else { output = importOptions; } } return(output); }
/// <inheritdoc/> protected internal override void Initialize() { if (InspectedObject != null) { importOptions = GetImportOptions(); BuildGUI(); } }
/// <inheritdoc/> protected internal override void Initialize() { if (InspectedObject != null) { importOptions = GetImportOptions(); BuildGUI(); } }
/// <inheritdoc/> protected internal override InspectableState Refresh() { FontImportOptions newImportOptions = GetImportOptions(); bool rebuildGUI = false; int[] newFontSizes = newImportOptions.FontSizes; if (newFontSizes == null) { rebuildGUI |= fontSizes.Array != null; } else { if (fontSizes.Array == null) { rebuildGUI = true; } else { rebuildGUI |= newFontSizes.Length != fontSizes.Array.GetLength(0); } } CharRange[] newCharRanges = newImportOptions.CharRanges; if (newCharRanges == null) { rebuildGUI |= charRanges.Array != null; } else { if (charRanges.Array == null) { rebuildGUI = true; } else { rebuildGUI |= newCharRanges.Length != charRanges.Array.GetLength(0); } } if (rebuildGUI) { BuildGUI(); } fontSizes.Refresh(); charRanges.Refresh(); renderModeField.Value = (ulong)newImportOptions.RenderMode; boldField.Value = newImportOptions.Bold; italicField.Value = newImportOptions.Italic; dpiField.Value = newImportOptions.DPI; importOptions = newImportOptions; return(InspectableState.NotModified); }
private static extern void Internal_create(FontImportOptions managedInstance);
private static extern void Internal_CreateInstance(FontImportOptions instance);
private static extern void Internal_CreateInstance(FontImportOptions instance);
/// <inheritdoc/> protected internal override InspectableState Refresh() { FontImportOptions newImportOptions = GetImportOptions(); bool rebuildGUI = false; int[] newFontSizes = newImportOptions.FontSizes; if (newFontSizes == null) rebuildGUI |= fontSizes.Array != null; else { if (fontSizes.Array == null) rebuildGUI = true; else rebuildGUI |= newFontSizes.Length != fontSizes.Array.GetLength(0); } CharRange[] newCharRanges = newImportOptions.CharRanges; if (newCharRanges == null) rebuildGUI |= charRanges.Array != null; else { if (charRanges.Array == null) rebuildGUI = true; else rebuildGUI |= newCharRanges.Length != charRanges.Array.GetLength(0); } if (rebuildGUI) BuildGUI(); fontSizes.Refresh(); charRanges.Refresh(); renderModeField.Value = (ulong)newImportOptions.RenderMode; boldField.Value = newImportOptions.Bold; italicField.Value = newImportOptions.Italic; dpiField.Value = newImportOptions.DPI; importOptions = newImportOptions; return InspectableState.NotModified; }
/// <summary> /// Retrieves import options for the texture we're currently inspecting. /// </summary> /// <returns>Font import options object.</returns> private FontImportOptions GetImportOptions() { Font font = InspectedObject as Font; FontImportOptions output = null; if (font != null) { LibraryEntry texEntry = ProjectLibrary.GetEntry(ProjectLibrary.GetPath(font)); if (texEntry != null && texEntry.Type == LibraryEntryType.File) { FileEntry texFileEntry = (FileEntry)texEntry; output = texFileEntry.Options as FontImportOptions; } } if (output == null) { if (importOptions == null) output = new FontImportOptions(); else output = importOptions; } return output; }
/// <inheritdoc/> protected internal override void Initialize() { importOptions = GetImportOptions(); BuildGUI(); }