Compare commits
No commits in common. "ba1bf950a864fcd8b8d2c037238113ce8451b877" and "3544392fa8f6d725dfdef6c797be80e6198c934e" have entirely different histories.
ba1bf950a8
...
3544392fa8
@ -1,7 +1,6 @@
|
|||||||
target_sources(
|
target_sources(
|
||||||
NostalgiaCore-Studio PRIVATE
|
NostalgiaCore-Studio PRIVATE
|
||||||
commands/addcolorcommand.cpp
|
commands/addcolorcommand.cpp
|
||||||
commands/addpagecommand.cpp
|
|
||||||
commands/applycolorallpagescommand.cpp
|
commands/applycolorallpagescommand.cpp
|
||||||
commands/duplicatepagecommand.cpp
|
commands/duplicatepagecommand.cpp
|
||||||
commands/movecolorcommand.cpp
|
commands/movecolorcommand.cpp
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "commands.hpp"
|
|
||||||
|
|
||||||
#include "addpagecommand.hpp"
|
|
||||||
|
|
||||||
namespace nostalgia::core {
|
|
||||||
|
|
||||||
AddPageCommand::AddPageCommand(Palette &pal) noexcept:
|
|
||||||
m_pal(pal) {}
|
|
||||||
|
|
||||||
int AddPageCommand::commandId() const noexcept {
|
|
||||||
return static_cast<int>(PaletteEditorCommandId::AddPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error AddPageCommand::redo() noexcept {
|
|
||||||
m_pal.pages.emplace_back(ox::sfmt("Page {}", m_pal.pages.size() + 1), ox::Vector<PaletteColor>{});
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error AddPageCommand::undo() noexcept {
|
|
||||||
m_pal.pages.pop_back();
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <studio/studio.hpp>
|
|
||||||
|
|
||||||
#include <nostalgia/core/palette.hpp>
|
|
||||||
|
|
||||||
namespace nostalgia::core {
|
|
||||||
|
|
||||||
class AddPageCommand: public studio::UndoCommand {
|
|
||||||
private:
|
|
||||||
Palette &m_pal;
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit AddPageCommand(Palette &pal) noexcept;
|
|
||||||
|
|
||||||
~AddPageCommand() noexcept override = default;
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
int commandId() const noexcept final;
|
|
||||||
|
|
||||||
ox::Error redo() noexcept final;
|
|
||||||
|
|
||||||
ox::Error undo() noexcept final;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -9,7 +9,6 @@ namespace nostalgia::core {
|
|||||||
enum class PaletteEditorCommandId {
|
enum class PaletteEditorCommandId {
|
||||||
ApplyColorAllPages,
|
ApplyColorAllPages,
|
||||||
RenamePage,
|
RenamePage,
|
||||||
AddPage,
|
|
||||||
DuplicatePage,
|
DuplicatePage,
|
||||||
RemovePage,
|
RemovePage,
|
||||||
AddColor,
|
AddColor,
|
||||||
|
@ -23,7 +23,7 @@ int DuplicatePageCommand::commandId() const noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ox::Error DuplicatePageCommand::redo() noexcept {
|
ox::Error DuplicatePageCommand::redo() noexcept {
|
||||||
m_pal.pages.emplace(m_dstIdx, ox::sfmt("Page {}", m_pal.pages.size() + 1), std::move(m_page));
|
m_pal.pages.emplace(m_dstIdx, "", std::move(m_page));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include <keel/media.hpp>
|
#include <keel/media.hpp>
|
||||||
|
|
||||||
#include "commands/addcolorcommand.hpp"
|
#include "commands/addcolorcommand.hpp"
|
||||||
#include "commands/addpagecommand.hpp"
|
|
||||||
#include "commands/applycolorallpagescommand.hpp"
|
#include "commands/applycolorallpagescommand.hpp"
|
||||||
#include "commands/duplicatepagecommand.hpp"
|
#include "commands/duplicatepagecommand.hpp"
|
||||||
#include "commands/movecolorcommand.hpp"
|
#include "commands/movecolorcommand.hpp"
|
||||||
@ -197,11 +196,7 @@ void PaletteEditorImGui::drawPagesEditor() noexcept {
|
|||||||
constexpr auto toolbarHeight = 40;
|
constexpr auto toolbarHeight = 40;
|
||||||
auto const btnSz = ImVec2{paneSz.x / 4 - 5.5f, 24};
|
auto const btnSz = ImVec2{paneSz.x / 4 - 5.5f, 24};
|
||||||
if (ImGui::Button("Add", btnSz)) {
|
if (ImGui::Button("Add", btnSz)) {
|
||||||
if (m_pal.pages.empty()) {
|
std::ignore = pushCommand<DuplicatePageCommand>(m_pal, 0u, m_pal.pages.size());
|
||||||
std::ignore = pushCommand<AddPageCommand>(m_pal);
|
|
||||||
} else {
|
|
||||||
std::ignore = pushCommand<DuplicatePageCommand>(m_pal, 0u, m_pal.pages.size());
|
|
||||||
}
|
|
||||||
m_page = m_pal.pages.size() - 1;
|
m_page = m_pal.pages.size() - 1;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -234,7 +234,7 @@ void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept {
|
|||||||
ImGui::BeginChild("SubSheets", {s_palViewWidth - 24, ySize / 2.f}, true);
|
ImGui::BeginChild("SubSheets", {s_palViewWidth - 24, ySize / 2.f}, true);
|
||||||
{
|
{
|
||||||
static constexpr auto btnHeight = ig::BtnSz.y;
|
static constexpr auto btnHeight = ig::BtnSz.y;
|
||||||
auto constexpr btnSize = ImVec2{btnHeight, btnHeight};
|
auto const btnSize = ImVec2{btnHeight, btnHeight};
|
||||||
if (ig::PushButton("+", btnSize)) {
|
if (ig::PushButton("+", btnSize)) {
|
||||||
auto insertOnIdx = m_model.activeSubSheetIdx();
|
auto insertOnIdx = m_model.activeSubSheetIdx();
|
||||||
auto const&parent = m_model.activeSubSheet();
|
auto const&parent = m_model.activeSubSheet();
|
||||||
@ -258,19 +258,16 @@ void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept {
|
|||||||
m_exportMenu.show();
|
m_exportMenu.show();
|
||||||
}
|
}
|
||||||
TileSheet::SubSheetIdx path;
|
TileSheet::SubSheetIdx path;
|
||||||
static constexpr auto flags =
|
static constexpr auto flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
|
||||||
ImGuiTableFlags_RowBg |
|
if (ImGui::BeginTable("Subsheets", 4, flags)) {
|
||||||
ImGuiTableFlags_NoBordersInBody |
|
ImGui::TableSetupColumn("Subsheet", ImGuiTableColumnFlags_NoHide);
|
||||||
ImGuiTableFlags_ScrollY;
|
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed, 25);
|
||||||
if (ImGui::BeginTable("Subsheets", 4, flags)) {
|
ImGui::TableSetupColumn("Columns", ImGuiTableColumnFlags_WidthFixed, 50);
|
||||||
ImGui::TableSetupColumn("Subsheet", ImGuiTableColumnFlags_NoHide);
|
ImGui::TableSetupColumn("Rows", ImGuiTableColumnFlags_WidthFixed, 50);
|
||||||
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed, 25);
|
ImGui::TableHeadersRow();
|
||||||
ImGui::TableSetupColumn("Columns", ImGuiTableColumnFlags_WidthFixed, 50);
|
drawSubsheetSelector(m_view.img().subsheet, path);
|
||||||
ImGui::TableSetupColumn("Rows", ImGuiTableColumnFlags_WidthFixed, 50);
|
ImGui::EndTable();
|
||||||
ImGui::TableHeadersRow();
|
}
|
||||||
drawSubsheetSelector(m_view.img().subsheet, path);
|
|
||||||
ImGui::EndTable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
}
|
}
|
||||||
@ -465,12 +462,8 @@ void TileSheetEditorImGui::drawPaletteMenu() noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// header
|
// header
|
||||||
auto constexpr palTblFlags =
|
|
||||||
ImGuiTableFlags_RowBg |
|
|
||||||
ImGuiTableFlags_SizingStretchProp |
|
|
||||||
ImGuiTableFlags_ScrollY;
|
|
||||||
if (ImGui::BeginTable(
|
if (ImGui::BeginTable(
|
||||||
"PaletteTable", 4, palTblFlags)) {
|
"PaletteTable", 4, ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingStretchProp)) {
|
||||||
ImGui::TableSetupColumn("Idx", 0, 0.6f);
|
ImGui::TableSetupColumn("Idx", 0, 0.6f);
|
||||||
ImGui::TableSetupColumn("", 0, 0.22f);
|
ImGui::TableSetupColumn("", 0, 0.22f);
|
||||||
ImGui::TableSetupColumn("Name", 0, 3);
|
ImGui::TableSetupColumn("Name", 0, 3);
|
||||||
|
@ -11,7 +11,7 @@ target_link_libraries(
|
|||||||
|
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
NostalgiaStudio PUBLIC
|
NostalgiaStudio PUBLIC
|
||||||
OLYMPIC_APP_VERSION="d2024.12.3"
|
OLYMPIC_APP_VERSION="d2024.12.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user