diff --git a/plugins/builtin/source/content/data_processor_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes.cpp index f6a26cfd6..ed48125e5 100644 --- a/plugins/builtin/source/content/data_processor_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes.cpp @@ -112,6 +112,24 @@ namespace hex::plugin::builtin { ImColor m_color; }; + class NodeComment : public dp::Node { + public: + NodeComment() : Node("Comment", { }) { + this->m_comment.resize(0xFFF, 0x00); + } + + void drawNode() override { + ImGui::InputTextMultiline("##string", reinterpret_cast(this->m_comment.data()), this->m_comment.size() - 1, ImVec2(150, 100)); + } + + void process() override { + + } + + private: + std::string m_comment; + }; + class NodeDisplayInteger : public dp::Node { public: @@ -461,8 +479,8 @@ namespace hex::plugin::builtin { std::vector output; for (u32 i = 0; i < input.size(); i += 2) { - char c1 = tolower(input[i]); - char c2 = tolower(input[i + 1]); + char c1 = static_cast(std::tolower(input[i])); + char c2 = static_cast(std::tolower(input[i + 1])); if (!std::isxdigit(c1) || !isxdigit(c2)) throwNodeError("Can't decode non-hexadecimal character"); @@ -491,6 +509,7 @@ namespace hex::plugin::builtin { ContentRegistry::DataProcessorNode::add("Constants", "Nullptr"); ContentRegistry::DataProcessorNode::add("Constants", "String"); ContentRegistry::DataProcessorNode::add("Constants", "RGBA8 Color"); + ContentRegistry::DataProcessorNode::add("Constants", "Comment"); ContentRegistry::DataProcessorNode::add("Display", "Integer"); ContentRegistry::DataProcessorNode::add("Display", "Float"); diff --git a/source/views/view_data_processor.cpp b/source/views/view_data_processor.cpp index 7ff9b9796..31cdf5cf7 100644 --- a/source/views/view_data_processor.cpp +++ b/source/views/view_data_processor.cpp @@ -123,7 +123,6 @@ namespace hex { printf("Node implementation bug! %s\n", e.what()); } - } void ViewDataProcessor::drawContent() { @@ -185,12 +184,16 @@ namespace hex { this->m_nodes.push_back(node); bool hasOutput = false; + bool hasInput = false; for (auto &attr : node->getAttributes()) { if (attr.getIOType() == dp::Attribute::IOType::Out) hasOutput = true; + + if (attr.getIOType() == dp::Attribute::IOType::In) + hasInput = true; } - if (!hasOutput) + if (hasInput && !hasOutput) this->m_endNodes.push_back(node); imnodes::SetNodeScreenSpacePos(node->getID(), this->m_rightClickedCoords);