diff --git a/Source/Windows/Help.cpp b/Source/Windows/Help.cpp index 61437ef..7e6d0a7 100644 --- a/Source/Windows/Help.cpp +++ b/Source/Windows/Help.cpp @@ -16,7 +16,7 @@ HelpWindow::HelpWindow() #define Keybind(key, text) ImGui::Text(key); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX() - DPI_SCALED(17)); ImGui::Bullet(); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX() + DPI_SCALED(7)); ImGui::TextWrapped(text) void HelpWindow::OnImGuiDraw() { - ImGui::SetNextWindowSize({std::min(ImGui::GetContentRegionAvail().x * .85f, 500.f), ImGui::GetContentRegionAvail().y * .8f}, ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize({std::min(MainWindow::SwapWidth * .85f, 500.f), std::min(MainWindow::SwapHeight * .8f, 400.f)}, ImGuiCond_Once); Gui_Begin(); ImGui::PushFont(MainWindow::Font); ImGui::Text("Using Resonate"); @@ -118,6 +118,7 @@ void HelpWindow::OnImGuiDraw() StartTreeNode("Dealing with Raw Text"); ImGui::TextWrapped("The Raw Text view is meant to make changes to the lyrics before timing in case you don't have access to an extrnal text editor. " + "It can be opened from the View menu by selecting the option Raw Text. " "It shows and allows you to edit the file that is readable by both ECHO and Resonate. Please note that if an effect value is changed it might not be recognized as a Resonate effect. " "Changing the Resonate headers are not recommended as it may result in undefined behavior."); EndTreeNode diff --git a/Source/Windows/RawText.cpp b/Source/Windows/RawText.cpp index 1f693e0..4fa7ed4 100644 --- a/Source/Windows/RawText.cpp +++ b/Source/Windows/RawText.cpp @@ -16,7 +16,8 @@ TextEditor::TextEditor() void TextEditor::OnImGuiDraw() { - if(ImGui::Begin(GetName().c_str(), 0, ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_HorizontalScrollbar | (Serialization::KaraokeDocument::Get().GetIsDirty() ? ImGuiWindowFlags_UnsavedDocument : 0))) + //if(ImGui::Begin(GetName().c_str(), 0, ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_HorizontalScrollbar | (Serialization::KaraokeDocument::Get().GetIsDirty() ? ImGuiWindowFlags_UnsavedDocument : 0))) + if(Gui_Begin(ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_HorizontalScrollbar | (Serialization::KaraokeDocument::Get().GetIsDirty() ? ImGuiWindowFlags_UnsavedDocument : 0))) { if(ImGui::InputTextMultiline("##RawText", &myRawText, ImGui::GetContentRegionAvail()) && myHasTakenFocus) { @@ -25,12 +26,13 @@ void TextEditor::OnImGuiDraw() } TouchInput_ReadyKeyboard(); - if(!myHasTakenFocus) + if(!myHasTakenFocus || ImGui::IsWindowAppearing() || ImGui::IsItemActivated()) { myRawText = Serialization::KaraokeDocument::Get().Serialize(); ((TimingEditor*)WindowManager::GetWindow("Timing"))->SetInputUnsafe(true); + ((TimingEditor*)WindowManager::GetWindow("Timing"))->SetInputUnsafe(false); + myHasTakenFocus = true; } - myHasTakenFocus = true; } else { diff --git a/Source/main.cpp b/Source/main.cpp index d9f09e7..2064444 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -516,6 +516,17 @@ void loop(void* window){ WindowManager::AddWindow("Touch Control"); } } + if(ImGui::MenuItem("Raw Text", 0, WindowManager::GetWindow("Raw Text") != nullptr)) + { + if(WindowManager::GetWindow("Raw Text") != nullptr) + { + WindowManager::DestroyWindow(WindowManager::GetWindow("Raw Text")); + } + else + { + WindowManager::AddWindow("Raw Text"); + } + } if(ImGui::MenuItem("Settings", 0, WindowManager::GetWindow("Settings") != nullptr)) { if(WindowManager::GetWindow("Settings") != nullptr) @@ -755,7 +766,7 @@ int main(){ } WindowManager::Init(); - WindowManager::AddWindow("Raw Text"); + //WindowManager::AddWindow("Raw Text"); TimingEditor* timingEditor = WindowManager::AddWindow("Timing"); WindowManager::AddWindow("Audio"); ImGui::SetWindowFocus("Timing");