Grid edit tool, grid menu, and bookmark menu improved
This commit is contained in:
parent
ffc9d42c5b
commit
47232ec7e9
8 changed files with 179 additions and 74 deletions
|
|
@ -20,6 +20,36 @@ void GridModifyTool::gui_toolbox() {
|
|||
Toolbar& t = drawP.world.main.toolbar;
|
||||
t.gui.push_id("Grid modify tool");
|
||||
t.gui.text_label_centered("Edit Grid");
|
||||
auto gridFoundIt = drawP.world.gridMan.grids.find(gridName);
|
||||
if(gridFoundIt != drawP.world.gridMan.grids.end()) {
|
||||
WorldGrid& g = gridFoundIt->second;
|
||||
t.gui.text_label("Name: " + gridName);
|
||||
size_t typeSelected = static_cast<size_t>(g.gridType);
|
||||
std::vector<std::string> listOfGridTypes = {
|
||||
"Circle Points",
|
||||
"Square Points",
|
||||
"Square Lines",
|
||||
"Ruled"
|
||||
};
|
||||
t.gui.left_to_right_line_layout([&]() {
|
||||
t.gui.text_label("Type");
|
||||
t.gui.dropdown_select("filepicker select type", &typeSelected, listOfGridTypes, 200.0f);
|
||||
});
|
||||
g.gridType = static_cast<WorldGrid::GridType>(typeSelected);
|
||||
uint32_t sDiv = g.get_subdivisions();
|
||||
t.gui.input_scalar_field<uint32_t>("Subdivisions", "Subdivisions", &sDiv, 0, 10);
|
||||
g.set_subdivisions(sDiv);
|
||||
bool divOut = g.get_remove_divisions_outwards();
|
||||
t.gui.checkbox_field("Subdivide outwards", "Subdivide outwards", &divOut);
|
||||
g.set_remove_divisions_outwards(divOut);
|
||||
t.gui.left_to_right_line_layout([&]() {
|
||||
CLAY({.layout = {.sizing = {.width = CLAY_SIZING_FIXED(40), .height = CLAY_SIZING_FIXED(40)}}}) {
|
||||
if(t.gui.color_button("Grid Color", &g.color, &g.color == t.colorRight))
|
||||
t.color_selector_right(&g.color == t.colorRight ? nullptr : &g.color);
|
||||
}
|
||||
t.gui.text_label("Grid Color");
|
||||
});
|
||||
}
|
||||
t.gui.pop_id();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue