diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index 6145c3e6..8964a6e7 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -1,15 +1,14 @@ #include "master_editor.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ImGuiColorTextEdit/TextEditor.h" +#include "ImGuiFileDialog/ImGuiFileDialog.h" +#include "abseil-cpp/absl/strings/match.h" +#include "imgui/backends/imgui_impl_sdl2.h" +#include "imgui/backends/imgui_impl_sdlrenderer2.h" +#include "imgui/imgui.h" +#include "imgui/misc/cpp/imgui_stdlib.h" +#include "imgui_internal.h" +#include "imgui_memory_editor.h" #include "absl/status/status.h" #include "app/core/common.h" @@ -682,8 +681,6 @@ void MasterEditor::DrawTestMenu() { EndMenu(); } - if (show_tests_) - ImGuiTestEngine_ShowTestEngineWindows(test_engine, &show_tests_); } void MasterEditor::DrawProjectMenu() { diff --git a/src/app/editor/master_editor.h b/src/app/editor/master_editor.h index 0736e9e5..28d26fbd 100644 --- a/src/app/editor/master_editor.h +++ b/src/app/editor/master_editor.h @@ -3,18 +3,16 @@ #define IMGUI_DEFINE_MATH_OPERATORS -#include -#include -#include -#include -#include -#include +#include "ImGuiColorTextEdit/TextEditor.h" +#include "ImGuiFileDialog/ImGuiFileDialog.h" +#include "imgui/imgui.h" +#include "imgui/misc/cpp/imgui_stdlib.h" +#include "imgui_memory_editor.h" #include "absl/status/status.h" #include "app/core/common.h" #include "app/core/constants.h" #include "app/core/project.h" -#include "app/core/testable.h" #include "app/editor/code/assembly_editor.h" #include "app/editor/code/memory_editor.h" #include "app/editor/dungeon/dungeon_editor.h" @@ -59,8 +57,7 @@ namespace editor { */ class MasterEditor : public SharedRom, public context::GfxContext, - public core::ExperimentFlags, - public core::GuiTestable { + public core::ExperimentFlags { public: MasterEditor() { current_editor_ = &overworld_editor_; @@ -79,8 +76,6 @@ class MasterEditor : public SharedRom, auto emulator() -> emu::Emulator& { return emulator_; } auto quit() { return quit_; } - void RegisterTests(ImGuiTestEngine* e) override; - private: void ManageActiveEditors(); void ManageKeyboardShortcuts(); @@ -142,4 +137,4 @@ class MasterEditor : public SharedRom, } // namespace app } // namespace yaze -#endif // YAZE_APP_EDITOR_MASTER_EDITOR_H \ No newline at end of file +#endif // YAZE_APP_EDITOR_MASTER_EDITOR_H diff --git a/src/app/editor/master_editor_test.cc b/src/app/editor/master_editor_test.cc index 59fef8a0..69cd54b5 100644 --- a/src/app/editor/master_editor_test.cc +++ b/src/app/editor/master_editor_test.cc @@ -4,42 +4,6 @@ namespace yaze { namespace app { namespace editor { -void MasterEditor::RegisterTests(ImGuiTestEngine* e) { - message_editor_.RegisterTests(e); - - test_engine = e; - ImGuiTest* t = nullptr; - - t = IM_REGISTER_TEST(e, "master_editor", "open_rom"); - t->GuiFunc = [](ImGuiTestContext* ctx) { - IM_UNUSED(ctx); - ImGui::Begin("Test Window", nullptr, ImGuiWindowFlags_NoSavedSettings); - ImGui::Text("Hello, automation world"); - ImGui::Button("Click Me"); - if (ImGui::TreeNode("Node")) { - static bool b = false; - ImGui::Checkbox("Checkbox", &b); - ImGui::TreePop(); - } - ImGui::End(); - }; - t->TestFunc = [](ImGuiTestContext* ctx) { - ctx->SetRef("Test Window"); - ctx->ItemClick("Click Me"); - ctx->ItemOpen("Node"); // Optional as ItemCheck("Node/Checkbox") can do it - ctx->ItemCheck("Node/Checkbox"); - ctx->ItemUncheck("Node/Checkbox"); - }; - - t = IM_REGISTER_TEST(e, "master_editor", "open_metrics"); - t->GuiFunc = [](ImGuiTestContext* ctx) { - IM_UNUSED(ctx); - ImGui::ShowMetricsWindow(); - }; - t->TestFunc = [](ImGuiTestContext* ctx) { - ctx->SetRef("Dear ImGui Metrics"); - }; -} } // namespace editor } // namespace app diff --git a/src/app/editor/message/message_editor.cc b/src/app/editor/message/message_editor.cc index 513ca413..fb3691a8 100644 --- a/src/app/editor/message/message_editor.cc +++ b/src/app/editor/message/message_editor.cc @@ -1,16 +1,15 @@ #include "message_editor.h" -#include -#include -#include -#include - #include #include #include #include #include +#include "absl/status/status.h" +#include "absl/strings/str_format.h" +#include "absl/strings/str_replace.h" +#include "absl/strings/str_split.h" #include "app/core/common.h" #include "app/editor/utils/editor.h" #include "app/gfx/bitmap.h" @@ -525,8 +524,7 @@ string MessageEditor::ParseTextDataByte(uint8_t value) { } void MessageEditor::DrawTileToPreview(int x, int y, int srcx, int srcy, int pal, - bool mirror_x, bool mirror_y, int sizex, - int sizey) { + int sizex, int sizey) { int drawid = srcx + (srcy * 32); for (int yl = 0; yl < sizey * 8; yl++) { for (int xl = 0; xl < 4; xl++) { @@ -580,8 +578,7 @@ void MessageEditor::DrawCharacterToPreview(const std::vector& text) { text_line++; } - DrawTileToPreview(text_pos, text_line * 16, srcx, srcy, 0, false, false, - 1, 2); + DrawTileToPreview(text_pos, text_line * 16, srcx, srcy, 0, 1, 2); text_pos += width_array[value]; } else if (value == kLine1) { text_pos = 0; diff --git a/src/app/editor/message/message_editor.h b/src/app/editor/message/message_editor.h index 6c809781..9d1f5842 100644 --- a/src/app/editor/message/message_editor.h +++ b/src/app/editor/message/message_editor.h @@ -1,11 +1,6 @@ #ifndef YAZE_APP_EDITOR_MESSAGE_EDITOR_H #define YAZE_APP_EDITOR_MESSAGE_EDITOR_H -#include -#include -#include -#include - #include #include #include @@ -13,7 +8,10 @@ #include #include -#include "app/core/testable.h" +#include "absl/status/status.h" +#include "absl/strings/str_format.h" +#include "absl/strings/str_replace.h" +#include "absl/strings/str_split.h" #include "app/editor/message/message_data.h" #include "app/editor/utils/editor.h" #include "app/gfx/bitmap.h" @@ -185,9 +183,7 @@ static const std::unordered_map CharEncoder = { static TextElement DictionaryElement = TextElement(0x80, DICTIONARYTOKEN, true, "Dictionary"); -class MessageEditor : public Editor, - public SharedRom, - public core::GuiTestable { +class MessageEditor : public Editor, public SharedRom { public: struct DictionaryEntry { uint8_t ID; @@ -242,7 +238,7 @@ class MessageEditor : public Editor, absl::Status Save(); void Delete(); void SelectAll(); - void RegisterTests(ImGuiTestEngine* e) override; + // void RegisterTests(ImGuiTestEngine* e) override; TextElement FindMatchingCommand(uint8_t byte); TextElement FindMatchingSpecial(uint8_t value); @@ -252,7 +248,6 @@ class MessageEditor : public Editor, static uint8_t FindDictionaryEntry(uint8_t value); static uint8_t FindMatchingCharacter(char value); void DrawTileToPreview(int x, int y, int srcx, int srcy, int pal, - bool mirror_x = false, bool mirror_y = false, int sizex = 1, int sizey = 1); void DrawCharacterToPreview(char c); void DrawCharacterToPreview(const std::vector& text); @@ -368,4 +363,4 @@ static std::vector AllDictionaries; } // namespace app } // namespace yaze -#endif // YAZE_APP_EDITOR_MESSAGE_EDITOR_H \ No newline at end of file +#endif // YAZE_APP_EDITOR_MESSAGE_EDITOR_H diff --git a/src/app/editor/message/message_editor_test.cc b/src/app/editor/message/message_editor_test.cc index 662571b5..67c52ae9 100644 --- a/src/app/editor/message/message_editor_test.cc +++ b/src/app/editor/message/message_editor_test.cc @@ -1,22 +1,7 @@ #include "message_editor.h" -#include "app/core/testable.h" - namespace yaze { namespace app { -namespace editor { - -void MessageEditor::RegisterTests(ImGuiTestEngine* e) { - test_engine = e; - ImGuiTest* t = nullptr; - - t = IM_REGISTER_TEST(e, "message_editor", "read_all_text_data"); - t->TestFunc = [](ImGuiTestContext* ctx) { - ctx->SetRef("##YazeMain/##TabBar/Message"); - - }; -} - -} // namespace editor +namespace editor {} // namespace editor } // namespace app } // namespace yaze