mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
Added CheckBox
This commit is contained in:
parent
9cd8870bd6
commit
dda9c40c41
5 changed files with 93 additions and 6 deletions
|
|
@ -181,7 +181,7 @@ Panel* create_settings_panel(Engine* engine) {
|
|||
std::to_wstring(engine->getSettings().chunks.loadDistance);
|
||||
}));
|
||||
|
||||
TrackBar* trackbar = new TrackBar(3, 66, 10);
|
||||
TrackBar* trackbar = new TrackBar(3, 66, 10, 1, 3);
|
||||
trackbar->supplier([=]() {
|
||||
return engine->getSettings().chunks.loadDistance;
|
||||
});
|
||||
|
|
@ -209,6 +209,25 @@ Panel* create_settings_panel(Engine* engine) {
|
|||
panel->add(trackbar);
|
||||
}
|
||||
|
||||
{
|
||||
Panel* checkpanel = new Panel(vec2(400, 32), vec4(5.0f), 1.0f);
|
||||
checkpanel->color(vec4(0.0f));
|
||||
checkpanel->orientation(Orientation::horizontal);
|
||||
|
||||
CheckBox* checkbox = new CheckBox();
|
||||
checkbox->margin(vec4(0.0f, 0.0f, 5.0f, 0.0f));
|
||||
checkbox->supplier([=]() {
|
||||
return engine->getSettings().display.swapInterval != 0;
|
||||
});
|
||||
checkbox->consumer([=](bool checked) {
|
||||
engine->getSettings().display.swapInterval = checked;
|
||||
});
|
||||
checkpanel->add(checkbox);
|
||||
checkpanel->add(new Label(L"V-Sync"));
|
||||
|
||||
panel->add(checkpanel);
|
||||
}
|
||||
|
||||
panel->add((new Button(L"Back", vec4(10.f)))->listenAction([=](GUI* gui) {
|
||||
panel->visible(false);
|
||||
gui->get("back")->visible(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue