From 6c2abde5c99a236453b795abaa6d7d70105e31f7 Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 26 Dec 2025 14:50:33 +0500 Subject: Just a big Ctrl+H refactoring --- src/game/client/experiments.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/game/client/experiments.cc') diff --git a/src/game/client/experiments.cc b/src/game/client/experiments.cc index eb415f7..4df6f1e 100644 --- a/src/game/client/experiments.cc +++ b/src/game/client/experiments.cc @@ -19,10 +19,10 @@ #include "client/globals.hh" #include "client/session.hh" -static void on_glfw_mouse_button(const io::GlfwMouseButtonEvent& event) +static void on_glfw_mouse_button(const GlfwMouseButtonEvent& event) { if(!globals::gui_screen && session::is_ingame()) { - if((event.action == GLFW_PRESS) && world::player_target::voxel) { + if((event.action == GLFW_PRESS) && player_target::voxel) { if(event.button == GLFW_MOUSE_BUTTON_LEFT) { experiments::attack(); return; @@ -38,20 +38,20 @@ static void on_glfw_mouse_button(const io::GlfwMouseButtonEvent& event) void experiments::init(void) { - globals::dispatcher.sink().connect<&on_glfw_mouse_button>(); + globals::dispatcher.sink().connect<&on_glfw_mouse_button>(); } void experiments::init_late(void) { - gui::hotbar::slots[0] = game_items::cobblestone; - gui::hotbar::slots[1] = game_items::stone; - gui::hotbar::slots[2] = game_items::dirt; - gui::hotbar::slots[3] = game_items::grass; - gui::hotbar::slots[4] = game_items::oak_leaves; - gui::hotbar::slots[5] = game_items::oak_planks; - gui::hotbar::slots[6] = game_items::oak_log; - gui::hotbar::slots[7] = game_items::glass; - gui::hotbar::slots[8] = game_items::slime; + hotbar::slots[0] = game_items::cobblestone; + hotbar::slots[1] = game_items::stone; + hotbar::slots[2] = game_items::dirt; + hotbar::slots[3] = game_items::grass; + hotbar::slots[4] = game_items::oak_leaves; + hotbar::slots[5] = game_items::oak_planks; + hotbar::slots[6] = game_items::oak_log; + hotbar::slots[7] = game_items::glass; + hotbar::slots[8] = game_items::slime; } void experiments::shutdown(void) @@ -68,16 +68,16 @@ void experiments::update_late(void) void experiments::attack(void) { - globals::dimension->set_voxel(nullptr, world::player_target::coord); + globals::dimension->set_voxel(nullptr, player_target::coord); } void experiments::interact(void) { - auto active_item = gui::hotbar::slots[gui::hotbar::active_slot]; + auto active_item = hotbar::slots[hotbar::active_slot]; if(active_item) { if(auto place_voxel = active_item->get_place_voxel()) { - globals::dimension->set_voxel(place_voxel, world::player_target::coord + world::player_target::normal); + globals::dimension->set_voxel(place_voxel, player_target::coord + player_target::normal); return; } } -- cgit