|
35 | 35 | //-------------------------------------------------------------- |
36 | 36 | Constant::Constant() : |
37 | 37 | // Extend the classes you need |
38 | | - PatchObject("constant"), |
| 38 | + PatchObject("number"), |
39 | 39 |
|
40 | 40 | // define default values |
41 | 41 | inputValueNew(0.f, "") |
@@ -85,6 +85,7 @@ void Constant::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWindow){ |
85 | 85 |
|
86 | 86 | //-------------------------------------------------------------- |
87 | 87 | void Constant::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjects){ |
| 88 | + unusedArgs(patchObjects); |
88 | 89 |
|
89 | 90 | if(this->inletsConnected[0]){ |
90 | 91 | if(*(float *)&_inletParams[0] < 1.0){ |
@@ -118,6 +119,7 @@ void Constant::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObject |
118 | 119 |
|
119 | 120 | //-------------------------------------------------------------- |
120 | 121 | void Constant::drawObjectContent(ofTrueTypeFont *font, shared_ptr<ofBaseGLRenderer>& glRenderer){ |
| 122 | + unusedArgs(font,glRenderer); |
121 | 123 | ofSetColor(255); |
122 | 124 | } |
123 | 125 |
|
@@ -159,14 +161,26 @@ void Constant::drawObjectNodeGui( ImGuiEx::NodeCanvas& _nodeCanvas ){ |
159 | 161 |
|
160 | 162 | //-------------------------------------------------------------- |
161 | 163 | void Constant::drawObjectNodeConfig(){ |
| 164 | + |
| 165 | + ImGui::Spacing(); |
| 166 | + ImGui::PushItemWidth(80*scaleFactor); |
| 167 | + ImGui::InputText("Variable name",&varName); |
| 168 | + ImGui::Spacing(); |
| 169 | + if(ImGui::Button("APPLY",ImVec2(224*scaleFactor,26*scaleFactor))){ |
| 170 | + this->setSpecialName("| "+varName); |
| 171 | + filepath = this->getSpecialName(); |
| 172 | + this->saveConfig(false); |
| 173 | + } |
| 174 | + |
| 175 | + |
162 | 176 | ImGuiEx::ObjectInfo( |
163 | 177 | "Single numeric value controller.", |
164 | 178 | "https://mosaic.d3cod3.org/reference.php?r=constant", scaleFactor); |
165 | 179 | } |
166 | 180 |
|
167 | 181 | //-------------------------------------------------------------- |
168 | 182 | void Constant::removeObjectContent(bool removeFileFromData){ |
169 | | - |
| 183 | + unusedArgs(removeFileFromData); |
170 | 184 | } |
171 | 185 |
|
172 | | -OBJECT_REGISTER( Constant, "constant", OFXVP_OBJECT_CAT_MATH) |
| 186 | +OBJECT_REGISTER( Constant, "number", OFXVP_OBJECT_CAT_MATH) |
0 commit comments