Move editor interface to editor/utils
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
#include "app/core/common.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/core/labeling.h"
|
||||
#include "app/editor/modules/gfx_group_editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
|
||||
@@ -62,7 +62,7 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable |
|
||||
/**
|
||||
* @class GraphicsEditor
|
||||
* @brief Allows the user to edit graphics sheets from the game or view
|
||||
* prototype graphics of Link to the Past from the CGX, SCR, and OBJ formats.
|
||||
* prototype graphics.
|
||||
*
|
||||
* The GraphicsEditor class is responsible for providing functionality to edit
|
||||
* graphics sheets from the game or view prototype graphics of Link to the Past
|
||||
|
||||
@@ -12,6 +12,10 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
/**
|
||||
* @class AssemblyEditor
|
||||
* @brief Text editor for modifying assembly code.
|
||||
*/
|
||||
class AssemblyEditor {
|
||||
public:
|
||||
AssemblyEditor();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
@@ -23,6 +23,10 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
/**
|
||||
* @class GfxGroupEditor
|
||||
* @brief Manage graphics group configurations in a ROM.
|
||||
*/
|
||||
class GfxGroupEditor : public SharedROM {
|
||||
public:
|
||||
absl::Status Update();
|
||||
|
||||
@@ -54,6 +54,11 @@ static const char* kGameSongs[] = {"Title",
|
||||
static constexpr absl::string_view kSongNotes[] = {
|
||||
"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C",
|
||||
"C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C"};
|
||||
|
||||
/**
|
||||
* @class MusicEditor
|
||||
* @brief A class for editing music data in a ROM.
|
||||
*/
|
||||
class MusicEditor : public SharedROM {
|
||||
public:
|
||||
void Update();
|
||||
|
||||
@@ -77,6 +77,10 @@ class PaletteEditorHistory {
|
||||
};
|
||||
} // namespace palette_internal
|
||||
|
||||
/**
|
||||
* @class PaletteEditor
|
||||
* @brief Allows the user to view and edit in game palettes.
|
||||
*/
|
||||
class PaletteEditor : public SharedROM {
|
||||
public:
|
||||
absl::Status Update();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/context/gfx_context.h"
|
||||
#include "app/editor/modules/palette_editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
|
||||
@@ -697,8 +697,6 @@ void OverworldEditor::CheckForMousePan() {
|
||||
}
|
||||
}
|
||||
|
||||
// Overworld Editor canvas
|
||||
// Allows the user to make changes to the overworld map.
|
||||
void OverworldEditor::DrawOverworldCanvas() {
|
||||
if (all_gfx_loaded_) {
|
||||
DrawOverworldMapSettings();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "absl/status/statusor.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/common.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/editor/context/entrance_context.h"
|
||||
#include "app/editor/context/gfx_context.h"
|
||||
#include "app/editor/modules/gfx_group_editor.h"
|
||||
@@ -88,6 +88,9 @@ class OverworldEditor : public Editor,
|
||||
|
||||
auto overworld() { return &overworld_; }
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
int jump_to_tab() { return jump_to_tab_; }
|
||||
int jump_to_tab_ = -1;
|
||||
|
||||
@@ -139,6 +142,10 @@ class OverworldEditor : public Editor,
|
||||
void CheckForSelectRectangle();
|
||||
absl::Status CheckForCurrentMap();
|
||||
void CheckForMousePan();
|
||||
|
||||
/**
|
||||
* @brief Allows the user to make changes to the overworld map.
|
||||
*/
|
||||
void DrawOverworldCanvas();
|
||||
|
||||
absl::Status DrawTile16Selector();
|
||||
|
||||
40
src/app/editor/utils/editor.h
Normal file
40
src/app/editor/utils/editor.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef YAZE_APP_CORE_EDITOR_H
|
||||
#define YAZE_APP_CORE_EDITOR_H
|
||||
|
||||
#include "absl/status/status.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
|
||||
/**
|
||||
* @namespace editor
|
||||
* @brief Editors are the view controllers for the application.
|
||||
*/
|
||||
namespace editor {
|
||||
|
||||
/**
|
||||
* @class Editor
|
||||
* @brief Interface for editor classes.
|
||||
*
|
||||
* Provides basic editing operations that each editor should implement.
|
||||
*/
|
||||
class Editor {
|
||||
public:
|
||||
Editor() = default;
|
||||
virtual ~Editor() = default;
|
||||
|
||||
virtual absl::Status Cut() = 0;
|
||||
virtual absl::Status Copy() = 0;
|
||||
virtual absl::Status Paste() = 0;
|
||||
|
||||
virtual absl::Status Undo() = 0;
|
||||
virtual absl::Status Redo() = 0;
|
||||
|
||||
virtual absl::Status Update() = 0;
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_CORE_EDITOR_H
|
||||
Reference in New Issue
Block a user