void OnGUI() { if (localizedObjectContextMenu == null || localizedObjectAdaptor == null || settingsContextMenu == null || settingsAdaptor == null) { Initialize(); } if (LocalizationWindowUtility.ShouldShowWindow()) { ReorderableListGUI.Title("Edit Root Values"); EditorGUILayout.Space(); settingsContextMenu.Draw(settingsAdaptor); bool shouldRepaint = listColumns.DrawColumns(); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); localizedObjectContextMenu.Draw(localizedObjectAdaptor); EditorGUILayout.EndScrollView(); if (guiChanged) { GUILayout.Label("- You have unsaved changes", EditorStyles.miniLabel); } //If any changes to the gui is made if (GUI.changed) { guiChanged = true; } GUILayout.Label("Save Changes", EditorStyles.boldLabel); GUILayout.Label("Remember to always press save when you have changed values", EditorStyles.miniLabel); if (GUILayout.Button("Save Root Language File")) { SaveRootLanguageFile(); guiChanged = false; GUIUtility.keyboardControl = 0; } if (shouldRepaint) { Repaint(); } } }
/// <summary> /// Draws the settings window and the main translation view where all the keys are. /// </summary> void DrawMainTranslationView() { ReorderableListGUI.Title("Language - " + thisLanguage); EditorGUILayout.Space(); settingsContextMenu.Draw(settingsAdaptor); GUILayout.Label("Language Values", EditorStyles.boldLabel); bool shouldRepaintColumns = listColumns.DrawColumns(); if (shouldRepaintColumns) { shouldRepaint = true; } scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); localizedObjectContextMenu.Draw(localizedObjectAdaptor); EditorGUILayout.EndScrollView(); if (guiChanged) { GUILayout.Label("- You have unsaved changes", EditorStyles.miniLabel); } //If any changes to the gui is made if (GUI.changed) { guiChanged = true; } GUILayout.Label("Save Changes", EditorStyles.boldLabel); GUILayout.Label("Remember to always press save when you have changed values", EditorStyles.miniLabel); if (GUILayout.Button("Save/Rebuild")) { SaveAndRebuild(); } if (shouldRepaint) { Repaint(); shouldRepaint = false; } }