aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-09-16 12:38:37 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-09-17 22:06:13 +0200
commit58e6d25e033c76dc91aaac18fdeda92ac23fe0e1 (patch)
treeb2691cefc6d239acaef8128861f387234688d183 /src/game.cpp
parent206f0764225de4eeb3b2cef119e22df8005e5d60 (diff)
downloadminetest-58e6d25e033c76dc91aaac18fdeda92ac23fe0e1.tar.gz
minetest-58e6d25e033c76dc91aaac18fdeda92ac23fe0e1.tar.bz2
minetest-58e6d25e033c76dc91aaac18fdeda92ac23fe0e1.zip
Node highlighting.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp
index cb5fe8046..bae946f28 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -407,14 +407,16 @@ PointedThing getPointedThing(Client *client, v3f player_position,
mindistance = distance;
hilightboxes.clear();
- for(std::vector<aabb3f>::const_iterator
- i2 = boxes.begin();
- i2 != boxes.end(); i2++)
- {
- aabb3f box = *i2;
- box.MinEdge += npf + v3f(-d,-d,-d) - intToFloat(camera_offset, BS);
- box.MaxEdge += npf + v3f(d,d,d) - intToFloat(camera_offset, BS);
- hilightboxes.push_back(box);
+ if (!g_settings->getBool("enable_node_highlighting")) {
+ for(std::vector<aabb3f>::const_iterator
+ i2 = boxes.begin();
+ i2 != boxes.end(); i2++)
+ {
+ aabb3f box = *i2;
+ box.MinEdge += npf + v3f(-d,-d,-d) - intToFloat(camera_offset, BS);
+ box.MaxEdge += npf + v3f(d,d,d) - intToFloat(camera_offset, BS);
+ hilightboxes.push_back(box);
+ }
}
}
}
@@ -2096,10 +2098,13 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
else if(input->wasKeyDown(getKeySetting("keymap_toggle_hud")))
{
show_hud = !show_hud;
- if(show_hud)
+ if(show_hud) {
statustext = L"HUD shown";
- else
+ client.setHighlighted(client.getHighlighted(), true);
+ } else {
statustext = L"HUD hidden";
+ client.setHighlighted(client.getHighlighted(), false);
+ }
statustext_time = 0;
}
else if(input->wasKeyDown(getKeySetting("keymap_toggle_chat")))
@@ -2796,7 +2801,8 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
if(pointed != pointed_old)
{
infostream<<"Pointing at "<<pointed.dump()<<std::endl;
- //dstream<<"Pointing at "<<pointed.dump()<<std::endl;
+ if (g_settings->getBool("enable_node_highlighting"))
+ client.setHighlighted(pointed.node_undersurface, show_hud);
}
/*