void WindowFunction(int windowID) { TranslationManager.EnableTranslation = GUILayout.Toggle(TranslationManager.EnableTranslation, "Enable translation"); TranslationManager.EnableStringNumber = enableStringNo.Value = GUILayout.Toggle(TranslationManager.EnableStringNumber, "Display string number"); if (GUILayout.Button("Reload translations")) { TranslationManager.ReloadAllSources(); } if (GUILayout.Button("Export catalog")) { ExportCatalog(); } GUILayout.Space(15); if (GUILayout.Button("Export dialogue database")) { var db = Resources.FindObjectsOfTypeAll <PixelCrushers.DialogueSystem.DialogueDatabase>()[0]; var json = UnityEngine.JsonUtility.ToJson(db, prettyPrint); File.WriteAllText(BepInEx.Utility.CombinePaths(Paths.PluginPath, PLUGIN_DIR, "database.json"), json); } prettyPrint = GUILayout.Toggle(prettyPrint, "Pretty print(format) JSON output"); GUILayout.Space(15); if (GUILayout.Button("Export images")) { ImageManager.ExportImages(Path.Combine(GetPluginDir(), "OriginalImages")); } GUILayout.Space(15); GUILayout.Label($"Press {toggleKey.Value} to close this window."); GUI.DragWindow(); }
public void Update() { if (reloadKey.Value.IsDown()) { TranslationManager.ReloadAllSources(); Logger.LogInfo("Reload sources"); } if (toggleKey.Value.IsDown()) { showingUI = !showingUI; } }