Common refactor

This commit is contained in:
MihailRis
2023-12-13 14:18:24 +03:00
parent 4de8759ea2
commit cb13b42960
10 changed files with 31 additions and 201 deletions
+1 -20
View File
@@ -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) {