mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Common refactor
This commit is contained in:
parent
4de8759ea2
commit
cb13b42960
10 changed files with 31 additions and 201 deletions
|
|
@ -43,9 +43,7 @@ using std::shared_ptr;
|
|||
|
||||
MenuScreen::MenuScreen(Engine* engine_) : Screen(engine_) {
|
||||
auto menu = engine->getGUI()->getMenu();
|
||||
|
||||
// Create pages if not created yet
|
||||
create_menus(engine, menu);
|
||||
menus::refresh_menus(engine, menu);
|
||||
menu->reset();
|
||||
menu->set("main");
|
||||
|
||||
|
|
@ -125,23 +123,6 @@ void LevelScreen::updateHotkeys() {
|
|||
if (Events::jpressed(keycode::F5)) {
|
||||
level->chunks->saveAndClear();
|
||||
}
|
||||
|
||||
// TODO: remove in v0.16
|
||||
if (Events::jpressed(keycode::F9)) {
|
||||
blockid_t woodid = level->content->requireBlock("base:wood")->rt.id;
|
||||
for (size_t i = 0; i < level->chunks->volume; i++){
|
||||
Chunk* chunk = level->chunks->chunks[i].get();
|
||||
if (chunk) {
|
||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
||||
auto& vox = chunk->voxels[i];
|
||||
if (vox.id == woodid) {
|
||||
vox.states = BLOCK_DIR_UP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
level->chunks->saveAndClear();
|
||||
}
|
||||
}
|
||||
|
||||
void LevelScreen::update(float delta) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue