aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTriBlade9 <triblade9@mail.com>2014-09-17 18:02:40 +0800
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-09-19 03:28:46 +0200
commit18bfa1c785a123499ee12d0551a9447a4d32d93b (patch)
tree02b821b2819c62f009ade17011cef8221b54defc /src
parent86a0f5603b9e936b8527ae22c4aeaf5714c9d279 (diff)
downloadminetest-18bfa1c785a123499ee12d0551a9447a4d32d93b.tar.gz
minetest-18bfa1c785a123499ee12d0551a9447a4d32d93b.tar.bz2
minetest-18bfa1c785a123499ee12d0551a9447a4d32d93b.zip
Added configurable selectionbox width. Min width = 1, Max = 5
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/drawscene.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index f3cb69e4b..22e7b4dfa 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -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");
diff --git a/src/drawscene.cpp b/src/drawscene.cpp
index 08b089908..2080ccb73 100644
--- a/src/drawscene.cpp
+++ b/src/drawscene.cpp
@@ -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);