[nostalgia/core/studio] Decouple core TileSheetEditor from ImGui
This commit is contained in:
@@ -95,12 +95,9 @@ constexpr ox::Error model(T *io, TileSheetClipboard *b) noexcept {
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
class TileSheetEditor: public studio::Editor {
|
||||
class TileSheetEditor {
|
||||
|
||||
private:
|
||||
ox::String m_itemPath;
|
||||
ox::String m_itemName;
|
||||
glutils::FrameBuffer m_framebuffer;
|
||||
TileSheetGrid m_pixelGridDrawer;
|
||||
TileSheetPixels m_pixelsDrawer;
|
||||
bool m_updated = false;
|
||||
@@ -108,31 +105,38 @@ class TileSheetEditor: public studio::Editor {
|
||||
AssetRef<NostalgiaPalette> m_pal;
|
||||
float m_pixelSizeMod = 1;
|
||||
common::Vec2 m_scrollOffset;
|
||||
float m_palViewWidth = 200;
|
||||
|
||||
public:
|
||||
TileSheetEditor(Context *ctx, const ox::String &path);
|
||||
|
||||
~TileSheetEditor() override = default;
|
||||
~TileSheetEditor() = default;
|
||||
|
||||
ox::String itemName() const noexcept override;
|
||||
void cut();
|
||||
|
||||
ox::String itemDisplayName() const noexcept override;
|
||||
void copy();
|
||||
|
||||
void exportFile() override;
|
||||
void paste();
|
||||
|
||||
void cut() override;
|
||||
void draw() noexcept;
|
||||
|
||||
void copy() override;
|
||||
void clickPixel(const common::Vec2 &paneSize, const common::Vec2 &clickPos) noexcept;
|
||||
|
||||
void paste() override;
|
||||
void scrollV(const common::Vec2 paneSz, float wheel, bool zoomMod) noexcept;
|
||||
|
||||
void draw(core::Context*) noexcept override;
|
||||
void scrollH(const common::Vec2 paneSz, float wheel) noexcept;
|
||||
|
||||
void glDraw() noexcept;
|
||||
void resize(const common::Vec2 &sz) noexcept;
|
||||
|
||||
const NostalgiaGraphic &img() const;
|
||||
|
||||
const NostalgiaPalette &pal() const;
|
||||
|
||||
bool updated() const noexcept;
|
||||
|
||||
void ackUpdate() noexcept;
|
||||
|
||||
protected:
|
||||
void saveItem() override;
|
||||
void saveItem();
|
||||
|
||||
void getFillPixels(bool *pixels, common::Point pt, int oldColor) const;
|
||||
|
||||
@@ -149,22 +153,12 @@ class TileSheetEditor: public studio::Editor {
|
||||
[[nodiscard]]
|
||||
ox::String palettePath(const ox::String &palettePath) const;
|
||||
|
||||
void drawTileSheet(const common::Vec2 &fbSize) noexcept;
|
||||
|
||||
void drawPalettePicker() noexcept;
|
||||
|
||||
void clickPixel(const common::Vec2 &paneSize, const common::Vec2 &clickPos) noexcept;
|
||||
|
||||
// slots
|
||||
public:
|
||||
ox::Error colorSelected() noexcept;
|
||||
|
||||
ox::Error setColorTable() noexcept;
|
||||
|
||||
// slots
|
||||
private:
|
||||
ox::Error updateAfterClicked() noexcept;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user