Added configurable selectionbox width. Min width = 1, Max = 5
authorTriBlade9 <triblade9@mail.com>
Wed, 17 Sep 2014 10:02:40 +0000 (18:02 +0800)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 19 Sep 2014 01:28:46 +0000 (03:28 +0200)
minetest.conf.example
src/defaultsettings.cpp
src/drawscene.cpp

index 8609281e8566f5703c62426d133e08c3836bffc6..95b4b51504c30e3c650742acfb6a6f763e544f03 100644 (file)
 #sound_volume = 0.7
 # Whether node texture animations should be desynchronized per MapBlock
 #desynchronize_mapblock_texture_animation = true
+# (useful if you've there's something to be displayed right or left of hotbar)
+# Width of the selectionbox's lines (Between 1 and 5)
+#selectionbox_width = 2
 # maximum percentage of current window to be used for hotbar
-# (usefull if you've there's something to be displayed right or left of hotbar)
 #hud_hotbar_max_width = 1.0
 # Enable highlighting for nodes (disables selectionboxes)
 #enable_node_highlighting = false
index f3cb69e4bd0653c3f6407d041a8dbc44c792ebf9..22e7b4dfa1b931d0c84cb9c6762e86806dbf3d22 100644 (file)
@@ -128,6 +128,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("enable_sound", "true");
        settings->setDefault("sound_volume", "0.8");
        settings->setDefault("desynchronize_mapblock_texture_animation", "true");
+       settings->setDefault("selectionbox_width","2");
        settings->setDefault("hud_hotbar_max_width","1.0");
 
        settings->setDefault("mip_map", "false");
index 08b08990830adebd0f05edbed4550517778b01e9..2080ccb73c20adf3e4bb26e4bd79db96a4213f23 100644 (file)
@@ -30,15 +30,18 @@ typedef enum {
        EYECOUNT = 2
 } paralax_sign;
 
+
 void draw_selectionbox(video::IVideoDriver* driver, Hud& hud,
                std::vector<aabb3f>& hilightboxes, bool show_hud)
 {
+       static const s16 selectionbox_width = rangelim(g_settings->getS16("selectionbox_width"), 1, 5);
+
        if (!show_hud)
                return;
 
        video::SMaterial oldmaterial = driver->getMaterial2D();
        video::SMaterial m;
-       m.Thickness = 3;
+       m.Thickness = selectionbox_width;
        m.Lighting = false;
        driver->setMaterial(m);
        hud.drawSelectionBoxes(hilightboxes);