Context menu is back, but not quite yet.

This commit is contained in:
Sebastian
2024-12-05 23:39:01 +01:00
parent 638df54ee6
commit ade33b0608
6 changed files with 30 additions and 9 deletions
+5 -4
View File
@@ -103,11 +103,12 @@ namespace VISEQ::APP::UI{
DrawText(text.c_str(), position.x-offset/2.0f, position.y-(float)size/2.0f+1, size, color );
}
void drawPerNodeConfig(Camera2D camera){
for(auto& n : gm->getSelection() | std::views::filter([](std::shared_ptr<Node> n){ return n->config; })){
void drawContextMenu(Camera2D camera){
for(auto n : gm->getSelection() | std::views::filter([](std::shared_ptr<Node> n){ return n->config; })){
Vector2 np = GetWorldToScreen2D((Vector2){n->position.x, n->position.y}, camera);
n->config = !GuiWindowBox((Rectangle){np.x + 10, np.y + 10, 240, 440}, "config");
state->context_menu = !GuiWindowBox((Rectangle){np.x + 10, np.y + 10, 240, 440}, "config");
n->config = state->context_menu;
int option = n->distributionMode;
GuiToggleGroup((Rectangle){ np.x + 20, np.y + 40, 73, 20 }, "GEO;RR;RAND", &option);
@@ -195,7 +196,7 @@ namespace VISEQ::APP::UI{
void draw(Vec2Df mouse_pos, Camera2D camera){
drawSideBar();
drawPerNodeConfig(camera);
if(state->context_menu) drawContextMenu(camera);
}
};