Esempio n. 1
0
        private void RenderSaveProfileMenu()
        {
            if (ImGui.BeginPopupModal("Save Profile", WindowFlags.AlwaysAutoResize))
            {
                currentFileName = ImGuiExtension.InputText("File Name", currentFileName, 100, InputTextFlags.AlwaysInsertMode);
                if (currentFileName != null && currentFileName.Length > 0)
                {
                    if (ImGui.Button("Save"))
                    {
                        BaseTreeRoutinePlugin <BuildYourOwnRoutineSettings, BaseTreeCache> .SaveSettingFile <Profile.LoadedProfile>(Plugin.ProfileDirectory + currentFileName, Plugin.Settings.LoadedProfile);

                        currentFileName = "";
                        ImGui.CloseCurrentPopup();
                    }
                    ImGui.SameLine();
                }

                if (ImGui.Button("Cancel"))
                {
                    currentFileName = "";
                    ImGui.CloseCurrentPopup();
                }
                ImGui.EndPopup();
            }
        }
Esempio n. 2
0
        private void RenderSaveProfileMenu()
        {
            if (ImGui.BeginPopupModal($"Save Profile", WindowFlags.AlwaysAutoResize))
            {
                currentFileName = ImGuiExtension.InputText("File Name", currentFileName, 100, InputTextFlags.AlwaysInsertMode);
                if (!String.IsNullOrEmpty(currentFileName))
                {
                    if (ImGui.Button("Save"))
                    {
                        LoadedProfile profileToSave = LoadSaveTrigger != null
                            ? new LoadedProfile()
                        {
                            Composite = LoadSaveTrigger
                        }
                            : Plugin.Settings.LoadedProfile;

                        BaseTreeRoutinePlugin <BuildYourOwnRoutineSettings, BaseTreeCache> .SaveSettingFile <Profile.LoadedProfile>(Plugin.ProfileDirectory + currentFileName, profileToSave);

                        currentFileName = "";
                        forceOpenSave   = false;
                        ImGui.CloseCurrentPopup();
                    }
                    ImGui.SameLine();
                }

                if (ImGui.Button("Cancel"))
                {
                    currentFileName = "";
                    forceOpenSave   = false;
                    ImGui.CloseCurrentPopup();
                }
                ImGui.EndPopup();
            }
        }