-
Posts
710 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Slastraf
-
Sorry to bother so much, yes the original post was about selection Nodes, but my post from 19 hours ago was to reset the whole tree (and it worked prior but not anymore). Regardless, both things need to work. There shou.ld be ->SetParent(NULL) to remove 1 item and also tree->root->SetParent(NULL) or an equivalent tree->root->ClearNodes() (exists but throws error currently) which resets the whole tree.
-
That is good and I have implemented a similar thing, but what if you want to remove all nodes from the tree ? You could select an item and delete it, but in an other case I want to reset the whole tree. For example you have 10 different users and for each user there is a list of items and you want the tree to display all items of the selected user. This requires for the entire tree to refresh and rebuild. This functionality does not work anymore because a few days ago you could take the node which you iterated the tree with (like my example above) and set its parent to null and the tree would hide. This does not work anymore. Can you provide an example for reseting the tree ?
-
any fix ?
-
How to use it ? Yesterday it seemed to work by setting subnode->SetParent(nullptr); then it would hide the whole tree but today I get an error. I made code to reproduce it, can replace lines 74-76 in the default project main. auto tree2 = CreateTreeView(border, border, 280, subpanel3->ClientSize().y - border * 2, subpanel3, TREEVIEW_DRAGANDDROP | TREEVIEW_DRAGINSERT); tree2->SetLayout(1, 0, 1, 1); auto subnode2 = tree2->root->AddNode("Node 1"); for (int n = 1; n < 10; ++n) { subnode2->AddNode("Subnode " + String(n)); } //error here subnode2->SetParent(nullptr); BTW, also happens with SetParent(NULL);
-
I understand pointers at a fundamental level but the flip did not switch yet in production, I wish the kit would be available in c#
-
Hmm hatte früher auch oft Probleme mit den Grafiktreibern, versuch die immer aktuell zu halten vielleicht hast du jetzt gerade auch keine aktuelle Version drauf, und die offiziellen von Nvidia. Ich benutze jedoch Windows. Und bitte benutzte ab jetzt deepl.com/translator anstatt google Übersetzer und stelle deine Frage nochmal neu ?
-
Hello, I am yet challenged by adding nodes, namely a subnode to a selected node. shared_ptr<TreeViewNode> *currentNode; ... case EVENT_WIDGETSELECT: ... if(event.extra->As<TreeViewNode>()) *currentNode = event.extra->As<TreeViewNode>(); ... currentNode->addNode(); // currentNode has no member addNode() I think the code is self explainatory. How do I make this right ? regards
-
Hello, it would be really cool to have a system that automatically serializes the application state for later use. Say you make some array and a correlating treeNode in runtime then click on save and it will detect all the things the users has put in and just brute force saves all the things that are going on and load them for later use. Regards
-
Hey there, I have noticed the updates will only apply if steam has downloaded it, and you make a new project (and copy the old code over). There should be a button in the app kit to update old projects. Thanks
- 1 reply
-
- 1
-
WIP - Heavy Rust Elements, Crackled Paint, Metals, Painted Piping
Slastraf commented on TWahl's blog entry in Work in Progress - Scifi PBR Media
Almost could be in an environment where there is a guy slaughtering devils and demons -
Text Field bugged (I already have a workaround, but plz fix)
Slastraf replied to Slastraf's topic in Bug Reports
bump -
Hey there, the following code example will make a text field which is rather big and can be applied to the example project if replaced by line 141 and following. auto styleTextArea = CreateTextField(border, border + 40, subpanel2->ClientSize().x - 2 * border, subpanel2->ClientSize().y - 2 * border - 40, subpanel2); styleTextArea->SetAlignment(1, 1, 1, 1); styleTextArea->SetText(" #my_iframe{\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n border:0;\n }\n\n #hide_button, #show_button{\n position: absolute;\n width: 100px;\n height: 30px;\n background-color: DodgerBlue;\n color: white;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n }\n\n #hide_button{\n left: 10px;\n }\n\n #show_button{\n left: 120px;\n }\n"); In the latter code example i put the whole text thing in one line , but using my original approach made it even buggier : #define MULTI_LINE_STRING(a) #a struct styleTextTemplate{ const char* text = MULTI_LINE_STRING( #my_iframe{\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n border:0;\n }\n\n #hide_button, #show_button{\n position: absolute;\n width: 100px;\n height: 30px;\n background-color: DodgerBlue;\n color: white;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n }\n\n #hide_button{\n left: 10px;\n }\n\n #show_button{\n left: 120px;\n }\n ); }; // and use setText auto styleTextArea = CreateTextField(border, border + 40, subpanel2->ClientSize().x - 2 * border, subpanel2->ClientSize().y - 2 * border - 40, subpanel2); styleTextArea->SetAlignment(1, 1, 1, 1); styleTextTemplate style; styleTextArea->SetText(style.text); EDIT: Sorry wrong category
-
Hey there, it would be a cool feature to have.
-
FindChild implies you would need to know there is a parent. But if you dont know the parent you would need to call it from the root, then it collapses on itself and it becomes a Find() function. Now if you had a find function there needs to be a unique identifier for each widget which the user could set and dont need to worry about all of this.
-
A findchild method could also be useful for many situations, but in this scenario you would know which exact widget you need to remove. Is there a way to hide a widget by widget text ?
-
It would be better to access the tree by array or pointer .
-
Hello, It is rather hard to remove an item from a TreeView if its not on the lowest subnode. auto it = std::find(itemFolder->begin(), itemFolder->end(), itemClass); if (it != itemFolder->end()) itemFolder->erase(it); subnode->ClearNodes(); // rebuild nodes for each (itemClass k in *itemFolder) { subnode->AddNode(k.info); } This for example works okay if you rebuild the tree in the following but you won't be able to remove if it is in a top treenode.
-
Hello, i don thave much time to make this but here is a bug report about making a new window in U.A.K. Therefore I am posting the whole script I got, and will tell you where the important lines are. #include "pch.h" #include <iostream> #include <fstream> using namespace UltraEngine; string compileAndWrite(fstream& file, string& contentsOfWebsite); string compileAndExport(string& contents); bool RescaleUI(const Event& event, shared_ptr<Object> extra) { auto ui = dynamic_pointer_cast<Interface>(extra); ui->SetScale(float(event.data) / 100.0f); auto window = dynamic_pointer_cast<Window>(event.source); window->SetShape(event.position.x, event.position.y, event.size.x, event.size.y); return true; } int main(int argc, const char* argv[]) { fstream sourceFile; string contentsOfWebsite = ""; cout << "app starting..." << endl; auto displays = ListDisplays(); displays = ListDisplays(); auto win = CreateWindow("Slastraf Tool", 0, 0, 1000 /** displays[0]->scale*/, 600 /** displays[0]->scale*/, displays[0], WINDOW_HIDDEN | WINDOW_CENTER | WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_DOUBLEBUFFERED); win->SetMinSize(600, 300); auto ui = CreateInterface(win); auto mainpanel = CreatePanel(0, 0, win->ClientSize().x, win->ClientSize().y, ui); mainpanel->SetAlignment(1, 1, 1, 1); auto mainmenu = CreateMenu("", mainpanel); int menuheight = mainmenu->GetSize().y; auto menu_file = CreateMenu("File", mainmenu); auto menu_new = CreateMenu("New", menu_file); auto newFileWindow = CreateWindow("Create New File", 0, 0, 420, 2 * 69, displays[0], WINDOW_HIDDEN | WINDOW_CENTER | WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_DOUBLEBUFFERED); auto newFileUi = CreateInterface(newFileWindow); auto mainNewFilepanel = CreatePanel(0, 0, newFileWindow->ClientSize().x, newFileWindow->ClientSize().y, newFileUi); mainNewFilepanel->SetAlignment(1, 1, 1, 1); auto mainNewMenu = CreateMenu("", mainNewFilepanel); auto textfieldNew = CreateTextField(12, 10, newFileWindow->ClientSize().x*0.5, 32, mainNewMenu); textfieldNew->SetAlignment(1, 1, 1, 0); textfieldNew->SetText("untitled"); auto menu_saveTextNewFile = CreateButton("Save and close (doesnt work yet, just hide the window)", 12+(newFileWindow->ClientSize().x*0.5), 10, newFileWindow->ClientSize().x*0.23, 32, mainNewMenu); auto menu_open = CreateMenu("Open File...", menu_file); auto menu_save = CreateMenu("Save...", menu_file); auto menu_export = CreateMenu("Export", menu_file); ui->SetScale(displays[0]->scale); ListenEvent(EVENT_WINDOWDPICHANGED, win, RescaleUI, ui); win->Show(); win->Activate(); shared_ptr<TreeViewNode> dragnode, destnode; while (true) { auto event = WaitEvent(); switch (event.id) { case EVENT_WIDGETDROP: dragnode = event.source->As<TreeViewNode>(); if (dragnode) { destnode = event.extra->As<TreeViewNode>(); dragnode->Insert(destnode, event.data); } break; case EVENT_WIDGETSELECT: break; case EVENT_WIDGETACTION: if (event.source == menu_open) { wstring file = RequestFile(L"Open File"); sourceFile.open(file, ios::out); if (!sourceFile) { sourceFile.close(); } else { Notify("Opened file. Please export it later as .html to open it in browser."); } break; } if (event.source = menu_new) { newFileUi->SetScale(displays[0]->scale); ListenEvent(EVENT_WINDOWDPICHANGED, newFileWindow, RescaleUI, newFileUi); newFileWindow->Show(); newFileWindow->Activate(); break; } if (event.source == menu_save) { string errors = compileAndWrite(sourceFile, contentsOfWebsite); if (errors != "") { Notify(errors); } sourceFile.close(); break; } if (event.source == menu_saveTextNewFile) { sourceFile.open(textfieldNew->text, ios::out); newFileWindow->Close(); newFileWindow->Hide(); newFileWindow = nullptr; break; } if (event.source == menu_export) { string errors = compileAndExport(contentsOfWebsite); break; } break; case EVENT_WINDOWCLOSE: return 0; break; } } return 0; } //writes all changes to the file, does not export it string compileAndWrite(fstream& file, string& contentsOfWebsite) { /* if (contentsOfWebsite == "") { return "The app is empty, most likely an error."; } */ file << "hello thois isa a test"; return ""; } string compileAndExport(string& contents) { return ""; } I create a button at line 53 which is on a second window. This window is shown in line 107, so far so good but at line 124 it will not hide. I hope you can fix this issue soon. Regards Slastraf
-
(Solved) Help with content shown using 2 CAMERA entities
Slastraf replied to Russell's topic in Programming
Check your parameters because you are not using them except entity and i dont know if it collides with sometihg so maybe rename that. Check if target is set and if the function is called. -
Hey, just wanted to say that game looks really cool. Did you post more about it in showcase ?
-
(Solved) Help with content shown using 2 CAMERA entities
Slastraf replied to Russell's topic in Programming
Place a pivot in the exact rotation and location of your second camera and then write a small script that puts your current camera wherever the cutscene pos is. You need to think of having only one camera at all times. Store information about text/images/post process in script and disable/enable whenever you need it. -
-
Happy to be a part of this. As you said, lack of proper communication contributed pretty badly for the state of the project. Text communication is probably the worst of all forms. Voice would be good but the best would be in-person, though its impossible . Hereby I propose that we could meet on a voice channel maybe discord some time soon. Lets make more discussion about game design and make a better plan about everything (e.g. code documentation, asset list, map design etc.).
-
-
Hey, I am sorry to hear that and wish you and your daughter all the best.