private void DrawTilePreviewSection() { GUILayout.Space(10); GUILayout.BeginHorizontal(); RotorzEditorGUI.Title(TileLang.Text("Tile Previews")); GUILayout.FlexibleSpace(); if (GUILayout.Button(TileLang.ParticularText("Action", "Refresh Previews"), RotorzEditorStyles.Instance.ButtonWide)) { this.OnRefreshPreviews(); GUIUtility.ExitGUI(); } GUILayout.Space(5); GUILayout.EndHorizontal(); ExtraEditorGUI.SeparatorLight(); GUILayout.Space(-5); GUILayout.BeginVertical(RotorzEditorStyles.Instance.PaddedScrollView); this.DrawTilePreviews(); GUILayout.EndVertical(); GUILayout.Space(-10); }
void OnGUI_Welcome() { RotorzEditorGUI.Title("Step 1: Welcome"); GUILayout.Label(_welcomeMessage, _boldWrapStyle); GUILayout.Space(5); GUILayout.Label("The latest update includes a number of new features including new and improved brushes.", EditorStyles.wordWrappedLabel); GUILayout.Space(5); GUILayout.Label("Existing brushes and tile systems can be upgraded for use with the newer version of this extension. Alternatively you are welcome to use both the newer and older versions of this extension side by side.", EditorStyles.wordWrappedLabel); GUILayout.Space(10); EditorGUILayout.HelpBox("Backup all of your files before proceeding. Upgraded brushes may differ from original brushes.", MessageType.Warning, true); GUILayout.Space(10); GUILayout.BeginHorizontal(); if (File.Exists(Directory.GetCurrentDirectory() + "/Assets/Rotorz/Tile System/Support/Migration Guide from 1x.pdf")) { if (GUILayout.Button("Migration Guide...", GUILayout.Height(24))) { EditorUtility.OpenWithDefaultApp("Assets/Rotorz/Tile System/Support/Migration Guide from 1x.pdf"); GUIUtility.ExitGUI(); } GUILayout.Space(5); } if (GUILayout.Button("Proceed to Next Step", GUILayout.Height(24))) { _hasWelcomed = true; GUIUtility.ExitGUI(); } GUILayout.EndHorizontal(); }
private void DrawSelectedTab() { RotorzEditorGUI.UseExtendedLabelWidthForLocalization(); GUILayout.Space(10); RotorzEditorGUI.Title(this.tabs[this.selectedTabIndex]); GUILayout.Space(10); switch (this.selectedTabIndex) { case 0: this.DrawToolsTab(); break; case 1: this.DrawPaintingTab(); break; case 2: this.DrawGridTab(); break; case 3: this.DrawMiscTab(); break; } }
/// <inheritdoc/> protected override void DoGUI() { GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Space(69); GUI.DrawTexture(new Rect(10, 10, 59, 52), RotorzEditorStyles.Skin.Caution); GUILayout.BeginVertical(this.paddedAreaStyle); { GUILayout.BeginVertical(); { RotorzEditorGUI.Title(TileLang.ParticularText("Action", "Cleanup Non-Procedural Meshes")); GUILayout.Space(5); GUILayout.Label(this.headingText, RotorzEditorStyles.Instance.BoldLabel); GUILayout.Space(7); GUILayout.Label(TileLang.Text("Mesh assets are generated for non-procedural tileset brushes and often not needed after brushes are deleted.\n\nMeshes not referenced by at least one tileset brush can be removed. Mesh will be missing for previously painted tiles."), EditorStyles.wordWrappedLabel); GUILayout.Space(5); } GUILayout.EndVertical(); GUILayout.FlexibleSpace(); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); this.OnGUI_ButtonStrip(); }
/// <inheritdoc/> protected override void DoGUI() { GUILayout.Space(10); GUILayout.BeginVertical(this.paddedArea1Style); RotorzEditorGUI.Title(TileLang.ParticularText("Action", "Refresh Tiles")); GUILayout.Space(5); GUILayout.Label(TileLang.Text("Tiles are replaced if obvious changes are detected. You can force refresh all tiles if necessary."), EditorStyles.wordWrappedLabel); ExtraEditorGUI.SeparatorLight(marginTop: 5, marginBottom: 5, thickness: 3); GUILayout.BeginVertical(this.paddedArea2Style); s_ForceRefreshTiles = EditorGUILayout.ToggleLeft(TileLang.ParticularText("Property", "Force refresh all tiles"), s_ForceRefreshTiles); GUILayout.Space(2); EditorGUI.indentLevel += 2; if (!s_ForceRefreshTiles) { s_UpdateProcedural = EditorGUILayout.ToggleLeft(TileLang.ParticularText("Property", "Update procedural tiles"), s_UpdateProcedural); } else { EditorGUI.BeginDisabledGroup(true); EditorGUILayout.ToggleLeft(TileLang.ParticularText("Property", "Update procedural tiles"), true); EditorGUI.EndDisabledGroup(); } EditorGUI.indentLevel -= 2; GUILayout.Space(2); s_PreserveManualOffset = EditorGUILayout.ToggleLeft(TileLang.ParticularText("Property", "Preserve manual offsets"), s_PreserveManualOffset); GUILayout.Space(2); s_PreserveFlags = EditorGUILayout.ToggleLeft(TileLang.ParticularText("Property", "Preserve painted user flags"), s_PreserveFlags); GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); EditorGUILayout.HelpBox(TileLang.Text("Some manual changes may be lost when refreshing tiles."), MessageType.Warning, true); GUILayout.Space(8); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(TileLang.ParticularText("Action", "Refresh"), ExtraEditorStyles.Instance.BigButtonPadded)) { this.OnButtonRefresh(); GUIUtility.ExitGUI(); } GUILayout.Space(3); if (GUILayout.Button(TileLang.ParticularText("Action", "Cancel"), ExtraEditorStyles.Instance.BigButtonPadded)) { this.Close(); GUIUtility.ExitGUI(); } GUILayout.Space(5); GUILayout.EndHorizontal(); GUILayout.Space(8); }
void OnGUI_UpgradeBrushes() { RotorzEditorGUI.Title("Step 2: Upgrade Brushes"); if (RtsBrushDatabaseWrapper.Instance.records.Count == 0) { OnGUI_UpgradeNoBrushes(); return; } if (_brushUpgrader == null) { _brushUpgrader = new RtsBrushUpgradeUtility(); } GUILayout.Label("Existing brushes will not be removed automatically.", _boldWrapStyle); GUILayout.Space(5); GUILayout.Label("An asset will be generated that maps existing brushes to their upgraded counterparts which is used when upgrading tile systems. If map asset is deleted this wizard restart.", EditorStyles.wordWrappedLabel); GUILayout.Space(5); EditorGUILayout.HelpBox("Do not remove older version of extension nor existing brushes folder 'Assets/TilePrefabs' until you have upgraded all of your tile systems.", MessageType.Warning, true); GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.Space(15); GUILayout.BeginVertical(); _brushUpgrader.useProceduralTilesets = GUILayout.Toggle(_brushUpgrader.useProceduralTilesets, "Use procedural tilesets / atlas brushes"); _brushUpgrader.useNewAssets = GUILayout.Toggle(_brushUpgrader.useNewAssets, "Use newer smooth platform brushes."); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Please click 'Upgrade Brushes' to proceed.", EditorStyles.wordWrappedLabel); GUILayout.Space(10); GUILayout.BeginHorizontal(); if (GUILayout.Button("Go Back", GUILayout.Height(24))) { _hasWelcomed = false; GUIUtility.ExitGUI(); } if (GUILayout.Button("Upgrade Brushes", GUILayout.Height(24))) { _brushUpgrader.UpgradeBrushes(); ToolUtility.RepaintPaletteWindows(); GUIUtility.ExitGUI(); } GUILayout.EndHorizontal(); }
private void OnGUI_Title() { GUILayout.BeginVertical(); { RotorzEditorGUI.Title(TileLang.ParticularText("Action", "Delete Tileset")); GUILayout.Space(5); GUILayout.Label(this.headingText, RotorzEditorStyles.Instance.BoldLabel); GUILayout.Space(7); GUILayout.Label(TileLang.Text("Caution, proceeding will delete tileset which will cause damage to any scenes or assets that require it.\n\nAll contained brushes will also be deleted."), EditorStyles.wordWrappedLabel); GUILayout.Space(5); } GUILayout.EndVertical(); ExtraEditorGUI.SeparatorLight(thickness: 3); }
private void DrawAtlasTexture() { GUILayout.Space(10); RotorzEditorGUI.Title(TileLang.Text("Atlas Texture")); ExtraEditorGUI.SeparatorLight(marginBottom: 0); this.scrollingAtlasPreview = GUILayout.BeginScrollView(this.scrollingAtlasPreview); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(this.tileset.AtlasTexture); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndScrollView(); }
void OnGUI_UpgradeTileSystems() { RotorzEditorGUI.Title("Step 3: Upgrade Tile Systems"); GUILayout.Space(3); if (EditorApplication.isPlaying) { GUILayout.Label("Cannot upgrade tile systems during play mode.", EditorStyles.wordWrappedMiniLabel); return; } if (_systems == null || _systems.Count == 0) { OnGUI_NoOlderTileSystems(); return; } RotorzEditorGUI.Splitter(); GUILayout.Space(-7); _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); EditorGUILayout.HelpBox("Ensure that your project is backed up before proceeding.", MessageType.Warning, true); GUILayout.Space(7); foreach (TileSystemItem item in _systems) { GUILayout.Space(-4); DrawTileSystemItem(item); GUILayout.Space(2); RotorzEditorGUI.SplitterLight(); } GUILayout.FlexibleSpace(); EditorGUILayout.EndScrollView(); GUILayout.Space(-7); RotorzEditorGUI.Splitter(); switch (GUILayout.Toolbar(-1, new string[] { "All", "None", "Invert" })) { case 0: // All for (int i = 0; i < _systems.Count; ++i) { _systems[i].selected = true; } break; case 1: // None for (int i = 0; i < _systems.Count; ++i) { _systems[i].selected = false; } break; case 2: // Invert for (int i = 0; i < _systems.Count; ++i) { _systems[i].selected = !_systems[i].selected; } break; } GUILayout.Space(5); GUI.enabled = _systems.FindIndex(item => item.selected) != -1; if (GUILayout.Button("Bulk Upgrade", GUILayout.Height(24))) { OnBulkUpgrade(); GUIUtility.ExitGUI(); } GUI.enabled = true; GUILayout.Space(5); }