Context menu is back, but not quite yet.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user