add SettingsEditor
This commit is contained in:
@@ -9,6 +9,7 @@ set(
|
||||
YAZE_APP_EDITOR_SRC
|
||||
app/editor/dungeon_editor.cc
|
||||
app/editor/master_editor.cc
|
||||
app/editor/settings_editor.cc
|
||||
app/editor/overworld_editor.cc
|
||||
app/editor/sprite/sprite_editor.cc
|
||||
app/editor/music/music_editor.cc
|
||||
|
||||
@@ -168,6 +168,11 @@ void MasterEditor::ManageActiveEditors() {
|
||||
active_editors_.push_back(&assembly_editor_);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (ImGui::MenuItem("Settings", nullptr, false,
|
||||
!IsEditorActive(&settings_editor_, active_editors_))) {
|
||||
active_editors_.push_back(&settings_editor_);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
@@ -243,6 +248,13 @@ void MasterEditor::ManageActiveEditors() {
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
break;
|
||||
case EditorType::kSettings:
|
||||
if (ImGui::BeginTabItem("Settings", &open)) {
|
||||
current_editor_ = &settings_editor_;
|
||||
status_ = settings_editor_.Update();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "app/editor/graphics/screen_editor.h"
|
||||
#include "app/editor/music/music_editor.h"
|
||||
#include "app/editor/overworld_editor.h"
|
||||
#include "app/editor/settings_editor.h"
|
||||
#include "app/editor/sprite/sprite_editor.h"
|
||||
#include "app/editor/utils/gfx_context.h"
|
||||
#include "app/emu/emulator.h"
|
||||
@@ -121,6 +122,7 @@ class MasterEditor : public SharedRom,
|
||||
PaletteEditor palette_editor_;
|
||||
ScreenEditor screen_editor_;
|
||||
SpriteEditor sprite_editor_;
|
||||
SettingsEditor settings_editor_;
|
||||
MemoryEditorWithDiffChecker memory_editor_;
|
||||
|
||||
ImVector<int> active_tabs_;
|
||||
|
||||
38
src/app/editor/settings_editor.cc
Normal file
38
src/app/editor/settings_editor.cc
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <editor/settings_editor.h>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
using ImGui::BeginTabItem;
|
||||
using ImGui::EndTabBar;
|
||||
using ImGui::EndTabItem;
|
||||
using ImGui::TabBar;
|
||||
using ImGui::Text;
|
||||
|
||||
absl::Status SettingsEditor::Update() {
|
||||
if (TabBar("Settings", ImGuiTabBarFlags_None)) {
|
||||
if (BeginTabItem("General")) {
|
||||
Text("General settings");
|
||||
EndTabItem();
|
||||
}
|
||||
if (BeginTabItem("Keyboard Shortcuts")) {
|
||||
|
||||
EndTabItem();
|
||||
}
|
||||
EndTabBar();
|
||||
}
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status SettingsEditor::DrawKeyboardShortcuts() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
30
src/app/editor/settings_editor.h
Normal file
30
src/app/editor/settings_editor.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef YAZE_APP_EDITOR_SETTINGS_EDITOR_H
|
||||
#define YAZE_APP_EDITOR_SETTINGS_EDITOR_H
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
class SettingsEditor : public Editor {
|
||||
public:
|
||||
absl::Status Update() override;
|
||||
|
||||
absl::Status Undo() override { return absl::UnimplementedError("Undo"); }
|
||||
absl::Status Redo() override { return absl::UnimplementedError("Redo"); }
|
||||
absl::Status Cut() override { return absl::UnimplementedError("Cut"); }
|
||||
absl::Status Copy() override { return absl::UnimplementedError("Copy"); }
|
||||
absl::Status Paste() override { return absl::UnimplementedError("Paste"); }
|
||||
absl::Status Find() override { return absl::UnimplementedError("Find"); }
|
||||
|
||||
private:
|
||||
absl::Status DrawKeyboardShortcuts();
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_EDITOR_SETTINGS_EDITOR_H_
|
||||
@@ -21,6 +21,7 @@ enum class EditorType {
|
||||
kPalette,
|
||||
kScreen,
|
||||
kSprite,
|
||||
kSettings,
|
||||
};
|
||||
|
||||
constexpr std::array<const char*, 8> kEditorNames = {
|
||||
|
||||
Reference in New Issue
Block a user