expand ppbr export dialog
This commit is contained in:
@@ -366,11 +366,11 @@
|
|||||||
<ClCompile Include="libs\glad\src\glad_wgl.c">
|
<ClCompile Include="libs\glad\src\glad_wgl.c">
|
||||||
<Filter>libs\glad</Filter>
|
<Filter>libs\glad</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="src\node_input_box.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\node_dialog_export_ppbr.cpp">
|
<ClCompile Include="src\node_dialog_export_ppbr.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\ui</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\node_input_box.cpp">
|
||||||
|
<Filter>Source Files\ui</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -614,11 +614,11 @@
|
|||||||
<ClInclude Include="src\node_tool_bucket.h">
|
<ClInclude Include="src\node_tool_bucket.h">
|
||||||
<Filter>Header Files\ui</Filter>
|
<Filter>Header Files\ui</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="src\node_input_box.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\node_dialog_export_ppbr.h">
|
<ClInclude Include="src\node_dialog_export_ppbr.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\ui</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\node_input_box.h">
|
||||||
|
<Filter>Header Files\ui</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -48,10 +48,13 @@
|
|||||||
<border width="100%" color="0 0 0 .9" pad="10" dir="row" grow="1">
|
<border width="100%" color="0 0 0 .9" pad="10" dir="row" grow="1">
|
||||||
<border id="files-list" dir="row" wrap="1" flood-events="1" grow="1" height="100%" margin="0 0 0 0" pad="10" color=".2 .2 .2 1">
|
<border id="files-list" dir="row" wrap="1" flood-events="1" grow="1" height="100%" margin="0 0 0 0" pad="10" color=".2 .2 .2 1">
|
||||||
<node dir="col" margin="0 20 0 0">
|
<node dir="col" margin="0 20 0 0">
|
||||||
<image width="200" height="100"/>
|
<image-texture id="header-tex" width="256" height="128" pad="10">
|
||||||
<node dir="row" width="200" height="30" justify="center" margin="10 0 0 0">
|
<text text="Header image.\nSelect a 256x128 pixels image that will be displayed as a preview for this brushes collection." text-wrap-width="230" color=".5"/>
|
||||||
<button text="Generate" grow="1" height="100%"/>
|
</image-texture>
|
||||||
<button text="Open..." grow="1" height="100%"/>
|
<node dir="row" width="256" height="30" justify="center" margin="10 0 0 0">
|
||||||
|
<button id="header-gen" text="Generate" grow="1" height="100%"/>
|
||||||
|
<button id="header-open" text="Open" grow="1" height="100%"/>
|
||||||
|
<button id="header-clear" text="Clear" grow="1" height="100%"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node grow="1">
|
<node grow="1">
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "node_dialog_export_ppbr.h"
|
#include "node_dialog_export_ppbr.h"
|
||||||
|
#include "app.h"
|
||||||
|
#include "image.h"
|
||||||
|
|
||||||
Node* NodeDialogExportPPBR::clone_instantiate() const
|
Node* NodeDialogExportPPBR::clone_instantiate() const
|
||||||
{
|
{
|
||||||
@@ -26,10 +28,42 @@ void NodeDialogExportPPBR::init()
|
|||||||
void NodeDialogExportPPBR::init_controls()
|
void NodeDialogExportPPBR::init_controls()
|
||||||
{
|
{
|
||||||
btn_ok = find<NodeButton>("btn-ok");
|
btn_ok = find<NodeButton>("btn-ok");
|
||||||
|
btn_ok->on_click = [this] (Node*) {
|
||||||
|
start_exporting();
|
||||||
|
};
|
||||||
btn_cancel = find<NodeButton>("btn-cancel");
|
btn_cancel = find<NodeButton>("btn-cancel");
|
||||||
btn_cancel->on_click = [this](Node*) {
|
btn_cancel->on_click = [this](Node*) {
|
||||||
destroy();
|
destroy();
|
||||||
};
|
};
|
||||||
|
btn_header_open = find<NodeButton>("header-open");
|
||||||
|
btn_header_open->on_click = [this] (Node*) {
|
||||||
|
open_header();
|
||||||
|
};
|
||||||
|
btn_header_clear = find<NodeButton>("header-clear");
|
||||||
|
btn_header_clear->on_click = [this] (Node*) {
|
||||||
|
m_header_image.destroy();
|
||||||
|
img_header->tex.destroy();
|
||||||
|
};
|
||||||
|
btn_header_gen = find<NodeButton>("header-gen");
|
||||||
|
btn_header_gen->on_click = [this] (Node*) {
|
||||||
|
App::I->message_box("WIP", "This feature is not yet implemented.");
|
||||||
|
};
|
||||||
|
img_header = find<NodeImageTexture>("header-tex");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void NodeDialogExportPPBR::open_header()
|
||||||
|
{
|
||||||
|
App::I->pick_image([this](std::string path) {
|
||||||
|
m_header_image.load(path);
|
||||||
|
m_header_image.resize(256, 128);
|
||||||
|
img_header->tex.create(m_header_image);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void NodeDialogExportPPBR::start_exporting()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeDialogExportPPBR::added(Node* parent)
|
void NodeDialogExportPPBR::added(Node* parent)
|
||||||
|
|||||||
@@ -3,15 +3,23 @@
|
|||||||
#include "node_button.h"
|
#include "node_button.h"
|
||||||
#include "node_combobox.h"
|
#include "node_combobox.h"
|
||||||
#include "node_text.h"
|
#include "node_text.h"
|
||||||
|
#include "node_image_texture.h"
|
||||||
|
|
||||||
class NodeDialogExportPPBR : public NodeBorder
|
class NodeDialogExportPPBR : public NodeBorder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NodeButton* btn_cancel;
|
NodeButton* btn_cancel;
|
||||||
NodeButton* btn_ok;
|
NodeButton* btn_ok;
|
||||||
|
NodeButton* btn_header_open;
|
||||||
|
NodeButton* btn_header_clear;
|
||||||
|
NodeButton* btn_header_gen;
|
||||||
|
NodeImageTexture* img_header;
|
||||||
|
Image m_header_image;
|
||||||
virtual Node* clone_instantiate() const override;
|
virtual Node* clone_instantiate() const override;
|
||||||
virtual void clone_finalize(Node* dest) const override;
|
virtual void clone_finalize(Node* dest) const override;
|
||||||
virtual void init() override;
|
virtual void init() override;
|
||||||
virtual void added(Node* parent) override;
|
virtual void added(Node* parent) override;
|
||||||
void init_controls();
|
void init_controls();
|
||||||
|
void open_header();
|
||||||
|
void start_exporting();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user