/// <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 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.CharIndexRanges; 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); }
/// <inheritdoc/> protected internal override void Initialize() { importOptions = GetImportOptions(); BuildGUI(); }
private static extern void Internal_create(FontImportOptions managedInstance);