Preparando la interfaz

This commit is contained in:
Clinv committed 2026-09-29 23:35:03 -03:00
commit 66bedbb5f1
17 files changed
+876

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <cstddef>
#include "editor/Tool.hpp"
namespace tahgibu {
// Estado del editor que NO forma parte del proyecto guardado.
struct EditorState {
Tool activeTool = Tool::Select;
std::size_t currentFrame = 0;
};
} // namespace tahgibu
+55
View File
@@ -0,0 +1,55 @@
#pragma once
#include <cstddef>
namespace tahgibu {
enum class Tool {
Select,
Move,
Scale,
Rotate,
Transform,
Vertices,
Draw,
Eraser,
Sprite,
ColorPicker,
Zoom,
Pan,
};
struct ToolInfo {
Tool id;
const char* label;
};
// Registro de herramientas. La barra superior se genera a partir de esta
// tabla: agregar una herramienta nueva = agregar un valor al enum y una línea aquí.
inline constexpr ToolInfo kToolInfos[] = {
{Tool::Select, "Seleccionar"},
{Tool::Move, "Mover"},
{Tool::Scale, "Escalar"},
{Tool::Rotate, "Rotar"},
{Tool::Transform, "Transformar"},
{Tool::Vertices, "Vértices"},
{Tool::Draw, "Dibujar"},
{Tool::Eraser, "Borrador"},
{Tool::Sprite, "Sprite"},
{Tool::ColorPicker, "Color"},
{Tool::Zoom, "Zoom"},
{Tool::Pan, "Mano"},
};
inline constexpr std::size_t kToolCount = sizeof(kToolInfos) / sizeof(kToolInfos[0]);
inline const char* toolLabel(Tool tool) noexcept {
for (const ToolInfo& info : kToolInfos) {
if (info.id == tool) {
return info.label;
}
}
return "?";
}
} // namespace tahgibu