Compare commits
No commits in common. "6298ac3a215e28a35a6e99266190ad9222564ff0" and "be51838775cd37d8c0778378a5d944f8f261830c" have entirely different histories.
6298ac3a21
...
be51838775
@ -4,8 +4,6 @@
|
|||||||
* Add PaletteV5 to accommodate namespace change.
|
* Add PaletteV5 to accommodate namespace change.
|
||||||
* Add TileSheetV5. TileSheetV5 retains the bpp field for the sake of
|
* Add TileSheetV5. TileSheetV5 retains the bpp field for the sake of
|
||||||
CompactTileSheet, but always store it pixel as 8 bpp for itself.
|
CompactTileSheet, but always store it pixel as 8 bpp for itself.
|
||||||
* Add ability to move subsheets in the subsheet tree.
|
|
||||||
* Add Flip X and Flip Y button for TileSheet Editor.
|
|
||||||
* Replace file picker combo boxes with a browse button and file picker, and
|
* Replace file picker combo boxes with a browse button and file picker, and
|
||||||
support for dragging files from the project explorer.
|
support for dragging files from the project explorer.
|
||||||
* Add ability to create directories.
|
* Add ability to create directories.
|
||||||
|
@ -1,28 +1 @@
|
|||||||
K1;0f75977f-1c52-45f8-9793-52ea2dc200a0;O1;net.drinkingtea.nostalgia.gfx.Palette;5;{
|
K1;0f75977f-1c52-45f8-9793-52ea2dc200a0;M2;net.drinkingtea.nostalgia.core.Palette;1;ûÿ³Ö
|
||||||
"colorNames" :
|
|
||||||
[
|
|
||||||
"Color 1",
|
|
||||||
"Color 2"
|
|
||||||
],
|
|
||||||
"pages" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"colors" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"a" : 1,
|
|
||||||
"b" : 31,
|
|
||||||
"g" : 31,
|
|
||||||
"r" : 31
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a" : 1,
|
|
||||||
"b" : 22,
|
|
||||||
"g" : 22,
|
|
||||||
"r" : 22
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name" : "Page 1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
@ -1,36 +1 @@
|
|||||||
K1;c79f21e2-f74f-4ad9-90ed-32b0ef7da6ed;O1;net.drinkingtea.nostalgia.gfx.Palette;5;{
|
K1;c79f21e2-f74f-4ad9-90ed-32b0ef7da6ed;M2;net.drinkingtea.nostalgia.core.Palette;1;PÛ{³ÖCˆ
|
||||||
"colorNames" :
|
|
||||||
[
|
|
||||||
"Color 1",
|
|
||||||
"Color 2",
|
|
||||||
"Color 3",
|
|
||||||
"Color 4"
|
|
||||||
],
|
|
||||||
"pages" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"colors" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"b" : 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b" : 22,
|
|
||||||
"g" : 22,
|
|
||||||
"r" : 22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b" : 27,
|
|
||||||
"g" : 27,
|
|
||||||
"r" : 27
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b" : 20,
|
|
||||||
"g" : 8,
|
|
||||||
"r" : 8
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name" : "Page 1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Binary file not shown.
@ -289,7 +289,7 @@ constexpr ox::Error repair(TileSheetV4 &ts) noexcept {
|
|||||||
|
|
||||||
|
|
||||||
struct TileSheetV5 {
|
struct TileSheetV5 {
|
||||||
using SubSheetIdx = ox::Vector<uint32_t, 4>;
|
using SubSheetIdx = ox::Vector<std::size_t, 4>;
|
||||||
|
|
||||||
struct SubSheet {
|
struct SubSheet {
|
||||||
static constexpr auto TypeName = "net.drinkingtea.nostalgia.gfx.TileSheet.SubSheet";
|
static constexpr auto TypeName = "net.drinkingtea.nostalgia.gfx.TileSheet.SubSheet";
|
||||||
@ -445,25 +445,23 @@ TileSheet::SubSheetIdx validateSubSheetIdx(TileSheet const&ts, TileSheet::SubShe
|
|||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TileSheet::SubSheet const&getSubSheet(
|
TileSheet::SubSheet const&getSubSheet(
|
||||||
ox::SpanView<uint32_t> const&idx,
|
TileSheet::SubSheetIdx const&idx,
|
||||||
std::size_t idxIt,
|
std::size_t idxIt,
|
||||||
TileSheet::SubSheet const&pSubsheet) noexcept;
|
TileSheet::SubSheet const&pSubsheet) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TileSheet::SubSheet &getSubSheet(
|
TileSheet::SubSheet &getSubSheet(
|
||||||
ox::SpanView<uint32_t> const&idx,
|
TileSheet::SubSheetIdx const&idx,
|
||||||
std::size_t idxIt,
|
std::size_t idxIt,
|
||||||
TileSheet::SubSheet &pSubsheet) noexcept;
|
TileSheet::SubSheet &pSubsheet) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TileSheet::SubSheet const&getSubSheet(TileSheet const&ts, ox::SpanView<uint32_t> const &idx) noexcept;
|
TileSheet::SubSheet const&getSubSheet(TileSheet const&ts, TileSheet::SubSheetIdx const&idx) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TileSheet::SubSheet &getSubSheet(TileSheet &ts, ox::SpanView<uint32_t> const &idx) noexcept;
|
TileSheet::SubSheet &getSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept;
|
||||||
|
|
||||||
ox::Error addSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const &idx) noexcept;
|
ox::Error addSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept;
|
||||||
|
|
||||||
ox::Error insertSubSheet(TileSheet &ts, ox::SpanView<uint32_t> const &idx, TileSheet::SubSheet ss) noexcept;
|
|
||||||
|
|
||||||
ox::Error rmSubSheet(
|
ox::Error rmSubSheet(
|
||||||
TileSheet &ts,
|
TileSheet &ts,
|
||||||
|
@ -5,7 +5,6 @@ target_sources(
|
|||||||
deletetilescommand.cpp
|
deletetilescommand.cpp
|
||||||
drawcommand.cpp
|
drawcommand.cpp
|
||||||
flipcommand.cpp
|
flipcommand.cpp
|
||||||
movesubsheetcommand.cpp
|
|
||||||
inserttilescommand.cpp
|
inserttilescommand.cpp
|
||||||
palettechangecommand.cpp
|
palettechangecommand.cpp
|
||||||
rmsubsheetcommand.cpp
|
rmsubsheetcommand.cpp
|
||||||
|
@ -15,10 +15,9 @@ enum class CommandId {
|
|||||||
AddSubSheet,
|
AddSubSheet,
|
||||||
RmSubSheet,
|
RmSubSheet,
|
||||||
DeleteTile,
|
DeleteTile,
|
||||||
FlipX,
|
FlipXCommand,
|
||||||
FlipY,
|
FlipYCommand,
|
||||||
InsertTile,
|
InsertTile,
|
||||||
MoveSubSheet,
|
|
||||||
UpdateSubSheet,
|
UpdateSubSheet,
|
||||||
Cut,
|
Cut,
|
||||||
Paste,
|
Paste,
|
||||||
|
@ -31,7 +31,7 @@ ox::Error FlipXCommand::undo() noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int FlipXCommand::commandId() const noexcept {
|
int FlipXCommand::commandId() const noexcept {
|
||||||
return static_cast<int>(CommandId::FlipX);
|
return static_cast<int>(CommandId::FlipXCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheetIdx const &FlipXCommand::subsheetIdx() const noexcept {
|
TileSheet::SubSheetIdx const &FlipXCommand::subsheetIdx() const noexcept {
|
||||||
@ -62,7 +62,7 @@ ox::Error FlipYCommand::undo() noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int FlipYCommand::commandId() const noexcept {
|
int FlipYCommand::commandId() const noexcept {
|
||||||
return static_cast<int>(CommandId::FlipY);
|
return static_cast<int>(CommandId::FlipYCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheetIdx const &FlipYCommand::subsheetIdx() const noexcept {
|
TileSheet::SubSheetIdx const &FlipYCommand::subsheetIdx() const noexcept {
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "movesubsheetcommand.hpp"
|
|
||||||
|
|
||||||
namespace nostalgia::gfx {
|
|
||||||
|
|
||||||
MoveSubSheetCommand::MoveSubSheetCommand(
|
|
||||||
TileSheet &img,
|
|
||||||
TileSheet::SubSheetIdx src,
|
|
||||||
TileSheet::SubSheetIdx dst) noexcept:
|
|
||||||
m_img{img},
|
|
||||||
m_src{std::move(src)},
|
|
||||||
m_dst{std::move(dst)} {
|
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error MoveSubSheetCommand::redo() noexcept {
|
|
||||||
m_active = &m_dst;
|
|
||||||
TileSheet::SubSheet ss = std::move(getSubSheet(m_img, m_src));
|
|
||||||
OX_RETURN_ERROR(rmSubSheet(m_img, m_src));
|
|
||||||
return insertSubSheet(m_img, m_dst, std::move(ss));
|
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error MoveSubSheetCommand::undo() noexcept {
|
|
||||||
m_active = &m_src;
|
|
||||||
TileSheet::SubSheet ss = std::move(getSubSheet(m_img, m_dst));
|
|
||||||
OX_RETURN_ERROR(rmSubSheet(m_img, m_dst));
|
|
||||||
return insertSubSheet(m_img, m_src, std::move(ss));
|
|
||||||
}
|
|
||||||
|
|
||||||
int MoveSubSheetCommand::commandId() const noexcept {
|
|
||||||
return static_cast<int>(CommandId::MoveSubSheet);
|
|
||||||
}
|
|
||||||
|
|
||||||
TileSheet::SubSheetIdx const&MoveSubSheetCommand::subsheetIdx() const noexcept {
|
|
||||||
return *m_active;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "commands.hpp"
|
|
||||||
|
|
||||||
namespace nostalgia::gfx {
|
|
||||||
|
|
||||||
class MoveSubSheetCommand: public TileSheetCommand {
|
|
||||||
private:
|
|
||||||
TileSheet &m_img;
|
|
||||||
TileSheet::SubSheetIdx m_src;
|
|
||||||
TileSheet::SubSheetIdx m_dst;
|
|
||||||
TileSheet::SubSheetIdx *m_active = &m_dst;
|
|
||||||
|
|
||||||
public:
|
|
||||||
MoveSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept;
|
|
||||||
|
|
||||||
ox::Error redo() noexcept final;
|
|
||||||
|
|
||||||
ox::Error undo() noexcept final;
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
int commandId() const noexcept final;
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
TileSheet::SubSheetIdx const&subsheetIdx() const noexcept override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -15,16 +15,6 @@ namespace nostalgia::gfx {
|
|||||||
|
|
||||||
namespace ig = studio::ig;
|
namespace ig = studio::ig;
|
||||||
|
|
||||||
struct SubSheetRef {
|
|
||||||
static constexpr auto TypeName = "nostalgia.gfx.studio.SubSheetRef";
|
|
||||||
static constexpr auto TypeVersion = 1;
|
|
||||||
TileSheet::SubSheetIdx subsheet{};
|
|
||||||
};
|
|
||||||
|
|
||||||
OX_MODEL_BEGIN(SubSheetRef)
|
|
||||||
OX_MODEL_FIELD(subsheet)
|
|
||||||
OX_MODEL_END()
|
|
||||||
|
|
||||||
struct TileSheetEditorConfig {
|
struct TileSheetEditorConfig {
|
||||||
static constexpr auto TypeName = "net.drinkingtea.nostalgia.gfx.studio.TileSheetEditorConfig";
|
static constexpr auto TypeName = "net.drinkingtea.nostalgia.gfx.studio.TileSheetEditorConfig";
|
||||||
static constexpr auto TypeVersion = 1;
|
static constexpr auto TypeVersion = 1;
|
||||||
@ -319,16 +309,6 @@ void TileSheetEditorImGui::drawSubsheetSelector(
|
|||||||
| (rowSelected ? ImGuiTreeNodeFlags_Selected : 0);
|
| (rowSelected ? ImGuiTreeNodeFlags_Selected : 0);
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
auto const open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
auto const open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||||
std::ignore = ig::dragDropSource([&subsheet, &path] {
|
|
||||||
ImGui::Text("%s", subsheet.name.c_str());
|
|
||||||
return ig::setDragDropPayload(SubSheetRef{path});
|
|
||||||
});
|
|
||||||
if (ig::DragDropTarget const dragDropTarget; dragDropTarget) {
|
|
||||||
auto const [ref, err] = ig::getDragDropPayload<SubSheetRef>();
|
|
||||||
if (!err) {
|
|
||||||
oxLogError(m_model.moveSubSheet(ref.subsheet, path));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
setActiveSubsheet(path);
|
setActiveSubsheet(path);
|
||||||
@ -350,7 +330,7 @@ void TileSheetEditorImGui::drawSubsheetSelector(
|
|||||||
ImGui::Text("--");
|
ImGui::Text("--");
|
||||||
}
|
}
|
||||||
if (open) {
|
if (open) {
|
||||||
for (uint32_t i{}; auto &child : subsheet.subsheets) {
|
for (auto i = 0ul; auto &child : subsheet.subsheets) {
|
||||||
path.push_back(i);
|
path.push_back(i);
|
||||||
ImGui::PushID(static_cast<int>(i));
|
ImGui::PushID(static_cast<int>(i));
|
||||||
ig::IndentStackItem const indentStackItem{-indentReduce};
|
ig::IndentStackItem const indentStackItem{-indentReduce};
|
||||||
|
@ -58,7 +58,6 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
ox::Vec2 m_prevMouseDownPos;
|
ox::Vec2 m_prevMouseDownPos;
|
||||||
TileSheetTool m_tool = TileSheetTool::Draw;
|
TileSheetTool m_tool = TileSheetTool::Draw;
|
||||||
bool m_palPathFocused{};
|
bool m_palPathFocused{};
|
||||||
ox::Vector<ox::UPtr<studio::UndoCommand>, 1> m_deferredCmds;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TileSheetEditorImGui(studio::StudioContext &sctx, ox::StringParam path);
|
TileSheetEditorImGui(studio::StudioContext &sctx, ox::StringParam path);
|
||||||
|
@ -11,19 +11,18 @@
|
|||||||
|
|
||||||
#include <nostalgia/gfx/ptidxconv.hpp>
|
#include <nostalgia/gfx/ptidxconv.hpp>
|
||||||
|
|
||||||
#include "commands/addsubsheetcommand.hpp"
|
|
||||||
#include "commands/commands.hpp"
|
#include "commands/commands.hpp"
|
||||||
|
#include "commands/addsubsheetcommand.hpp"
|
||||||
#include "commands/cutpastecommand.hpp"
|
#include "commands/cutpastecommand.hpp"
|
||||||
#include "commands/deletetilescommand.hpp"
|
#include "commands/deletetilescommand.hpp"
|
||||||
#include "commands/drawcommand.hpp"
|
#include "commands/drawcommand.hpp"
|
||||||
#include "commands/flipcommand.hpp"
|
|
||||||
#include "commands/inserttilescommand.hpp"
|
#include "commands/inserttilescommand.hpp"
|
||||||
#include "commands/palettechangecommand.hpp"
|
#include "commands/palettechangecommand.hpp"
|
||||||
#include "commands/rmsubsheetcommand.hpp"
|
#include "commands/rmsubsheetcommand.hpp"
|
||||||
#include "commands/updatesubsheetcommand.hpp"
|
#include "commands/updatesubsheetcommand.hpp"
|
||||||
#include "tilesheeteditormodel.hpp"
|
#include "tilesheeteditormodel.hpp"
|
||||||
|
|
||||||
#include "commands/movesubsheetcommand.hpp"
|
#include "commands/flipcommand.hpp"
|
||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
@ -304,10 +303,6 @@ ox::Error TileSheetEditorModel::flipY() noexcept {
|
|||||||
return pushCommand(ox::make<FlipYCommand>(m_img, m_activeSubsSheetIdx, a, b));
|
return pushCommand(ox::make<FlipYCommand>(m_img, m_activeSubsSheetIdx, a, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error TileSheetEditorModel::moveSubSheet(TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept {
|
|
||||||
return pushCommand(ox::make<MoveSubSheetCommand>(m_img, std::move(src), std::move(dst)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void TileSheetEditorModel::getFillPixels(
|
void TileSheetEditorModel::getFillPixels(
|
||||||
TileSheet::SubSheet const&activeSubSheet,
|
TileSheet::SubSheet const&activeSubSheet,
|
||||||
ox::Span<bool> pixels,
|
ox::Span<bool> pixels,
|
||||||
|
@ -130,8 +130,6 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
|
|
||||||
ox::Error flipY() noexcept;
|
ox::Error flipY() noexcept;
|
||||||
|
|
||||||
ox::Error moveSubSheet(TileSheet::SubSheetIdx src, TileSheet::SubSheetIdx dst) noexcept;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void getFillPixels(
|
void getFillPixels(
|
||||||
TileSheet::SubSheet const&activeSubSheet,
|
TileSheet::SubSheet const&activeSubSheet,
|
||||||
|
@ -177,7 +177,7 @@ TileSheet::SubSheetIdx validateSubSheetIdx(
|
|||||||
pIdx.resize(pIdxIt);
|
pIdx.resize(pIdxIt);
|
||||||
return std::move(pIdx);
|
return std::move(pIdx);
|
||||||
} else {
|
} else {
|
||||||
currentIdx = static_cast<uint32_t>(pSubsheet.subsheets.size() - 1);
|
currentIdx = pSubsheet.subsheets.size() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return validateSubSheetIdx(std::move(pIdx), pIdxIt + 1, pSubsheet.subsheets[currentIdx]);
|
return validateSubSheetIdx(std::move(pIdx), pIdxIt + 1, pSubsheet.subsheets[currentIdx]);
|
||||||
@ -188,9 +188,9 @@ TileSheet::SubSheetIdx validateSubSheetIdx(TileSheet const&ts, TileSheet::SubShe
|
|||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheet const&getSubSheet(
|
TileSheet::SubSheet const&getSubSheet(
|
||||||
ox::SpanView<uint32_t> const &idx,
|
TileSheet::SubSheetIdx const&idx,
|
||||||
std::size_t const idxIt,
|
std::size_t const idxIt,
|
||||||
TileSheet::SubSheet const &pSubsheet) noexcept {
|
TileSheet::SubSheet const&pSubsheet) noexcept {
|
||||||
if (idxIt == idx.size()) {
|
if (idxIt == idx.size()) {
|
||||||
return pSubsheet;
|
return pSubsheet;
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ TileSheet::SubSheet const&getSubSheet(
|
|||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheet &getSubSheet(
|
TileSheet::SubSheet &getSubSheet(
|
||||||
ox::SpanView<uint32_t> const &idx,
|
TileSheet::SubSheetIdx const&idx,
|
||||||
std::size_t const idxIt,
|
std::size_t const idxIt,
|
||||||
TileSheet::SubSheet &pSubsheet) noexcept {
|
TileSheet::SubSheet &pSubsheet) noexcept {
|
||||||
if (idxIt == idx.size()) {
|
if (idxIt == idx.size()) {
|
||||||
@ -211,11 +211,11 @@ TileSheet::SubSheet &getSubSheet(
|
|||||||
return getSubSheet(idx, idxIt + 1, pSubsheet.subsheets[idx[idxIt]]);
|
return getSubSheet(idx, idxIt + 1, pSubsheet.subsheets[idx[idxIt]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheet const&getSubSheet(TileSheet const &ts, ox::SpanView<uint32_t> const &idx) noexcept {
|
TileSheet::SubSheet const&getSubSheet(TileSheet const&ts, TileSheet::SubSheetIdx const&idx) noexcept {
|
||||||
return gfx::getSubSheet(idx, 0, ts.subsheet);
|
return gfx::getSubSheet(idx, 0, ts.subsheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
TileSheet::SubSheet &getSubSheet(TileSheet &ts, ox::SpanView<uint32_t> const&idx) noexcept {
|
TileSheet::SubSheet &getSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept {
|
||||||
return gfx::getSubSheet(idx, 0, ts.subsheet);
|
return gfx::getSubSheet(idx, 0, ts.subsheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,20 +227,7 @@ ox::Error addSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept
|
|||||||
parent.subsheets.emplace_back(++ts.idIt, "Subsheet 0", parent.columns, parent.rows);
|
parent.subsheets.emplace_back(++ts.idIt, "Subsheet 0", parent.columns, parent.rows);
|
||||||
parent.subsheets.emplace_back(++ts.idIt, "Subsheet 1", 1, 1);
|
parent.subsheets.emplace_back(++ts.idIt, "Subsheet 1", 1, 1);
|
||||||
}
|
}
|
||||||
return {};
|
return ox::Error(0);
|
||||||
}
|
|
||||||
|
|
||||||
ox::Error insertSubSheet(TileSheet &ts, ox::SpanView<uint32_t> const&idx, TileSheet::SubSheet ss) noexcept {
|
|
||||||
if (idx.empty()) {
|
|
||||||
return ox::Error{1, "invalid insert idx"};
|
|
||||||
}
|
|
||||||
auto &parent = getSubSheet(ts, {idx.data(), idx.size() - 1});
|
|
||||||
auto const insertIdx = idx[idx.size() - 1];
|
|
||||||
if (insertIdx > parent.subsheets.size()) {
|
|
||||||
return ox::Error{1, "invalid insert idx"};
|
|
||||||
}
|
|
||||||
parent.subsheets.emplace(insertIdx, std::move(ss));
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error rmSubSheet(
|
ox::Error rmSubSheet(
|
||||||
|
@ -349,6 +349,10 @@ void StudioUI::handleKeyInput() noexcept {
|
|||||||
m_activeEditorUpdatePending = m_activeEditor;
|
m_activeEditorUpdatePending = m_activeEditor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ImGui::IsKeyPressed(ImGuiKey_0)) {
|
||||||
|
m_activeEditor = m_editors[10 < m_editors.size() ? 10 : range].get();
|
||||||
|
m_activeEditorUpdatePending = m_activeEditor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user