for (std::vector<aabb3f>::const_iterator
i = boxes.begin();
- i != boxes.end(); i++) {
+ i != boxes.end(); ++i) {
aabb3f box = *i;
box.MinEdge += npf;
box.MaxEdge += npf;
if (!g_settings->getBool("enable_node_highlighting")) {
for (std::vector<aabb3f>::const_iterator
i2 = boxes.begin();
- i2 != boxes.end(); i2++) {
+ 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);
std::map<std::string, Meta> m_meta;
for (std::vector<Piece>::const_iterator k = m_log.begin();
- k != m_log.end(); k++) {
+ k != m_log.end(); ++k) {
const Piece &piece = *k;
for (Profiler::GraphValues::const_iterator i = piece.values.begin();
- i != piece.values.end(); i++) {
+ i != piece.values.end(); ++i) {
const std::string &id = i->first;
const float &value = i->second;
std::map<std::string, Meta>::iterator j =
u32 next_color_i = 0;
for (std::map<std::string, Meta>::iterator i = m_meta.begin();
- i != m_meta.end(); i++) {
+ i != m_meta.end(); ++i) {
Meta &meta = i->second;
video::SColor color(255, 200, 200, 200);
s32 meta_i = 0;
for (std::map<std::string, Meta>::const_iterator i = m_meta.begin();
- i != m_meta.end(); i++) {
+ i != m_meta.end(); ++i) {
const std::string &id = i->first;
const Meta &meta = i->second;
s32 x = x_left;
bool lastscaledvalue_exists = false;
for (std::vector<Piece>::const_iterator j = m_log.begin();
- j != m_log.end(); j++) {
+ j != m_log.end(); ++j) {
const Piece &piece = *j;
float value = 0;
bool value_exists = false;
void toggleChat(float *statustext_time, bool *flag);
void toggleHud(float *statustext_time, bool *flag);
- void toggleMinimap(float *statustext_time, bool *flag1, bool *flag2,
+ void toggleMinimap(float *statustext_time, bool *flag, bool show_hud,
bool shift_pressed);
void toggleFog(float *statustext_time, bool *flag);
void toggleDebug(float *statustext_time, bool *show_debug,
updateFrame(highlight_boxes, &graph, &stats, &runData, dtime,
flags, cam_view);
updateProfilerGraphs(&graph);
+
+ // Update if minimap has been disabled by the server
+ flags.show_minimap &= !client->isMinimapDisabledByServer();
}
}
} else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_TOGGLE_HUD])) {
toggleHud(statustext_time, &flags->show_hud);
} else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_MINIMAP])) {
- toggleMinimap(statustext_time, &flags->show_minimap, &flags->show_hud,
+ toggleMinimap(statustext_time, &flags->show_minimap, flags->show_hud,
input->isKeyDown(keycache.key[KeyCache::KEYMAP_ID_SNEAK]));
} else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_TOGGLE_CHAT])) {
toggleChat(statustext_time, &flags->show_chat);
client->setHighlighted(client->getHighlighted(), *flag);
}
-void Game::toggleMinimap(float *statustext_time, bool *flag, bool *show_hud, bool shift_pressed)
+void Game::toggleMinimap(float *statustext_time, bool *flag,
+ bool show_hud, bool shift_pressed)
{
- if (*show_hud && g_settings->getBool("enable_minimap")) {
- if (shift_pressed) {
- mapper->toggleMinimapShape();
- return;
- }
- MinimapMode mode = mapper->getMinimapMode();
- mode = (MinimapMode)((int)(mode) + 1);
- *flag = true;
- switch (mode) {
- case MINIMAP_MODE_SURFACEx1:
- statustext = L"Minimap in surface mode, Zoom x1";
- break;
- case MINIMAP_MODE_SURFACEx2:
- statustext = L"Minimap in surface mode, Zoom x2";
- break;
- case MINIMAP_MODE_SURFACEx4:
- statustext = L"Minimap in surface mode, Zoom x4";
- break;
- case MINIMAP_MODE_RADARx1:
- statustext = L"Minimap in radar mode, Zoom x1";
- break;
- case MINIMAP_MODE_RADARx2:
- statustext = L"Minimap in radar mode, Zoom x2";
- break;
- case MINIMAP_MODE_RADARx4:
- statustext = L"Minimap in radar mode, Zoom x4";
- break;
- default:
- mode = MINIMAP_MODE_OFF;
- *flag = false;
- statustext = L"Minimap hidden";
- }
- *statustext_time = 0;
- mapper->setMinimapMode(mode);
+ if (!show_hud || !g_settings->getBool("enable_minimap"))
+ return;
+
+ if (shift_pressed) {
+ mapper->toggleMinimapShape();
+ return;
}
+
+ u32 hud_flags = client->getEnv().getLocalPlayer()->hud_flags;
+
+ MinimapMode mode = MINIMAP_MODE_OFF;
+ if (hud_flags & HUD_FLAG_MINIMAP_VISIBLE) {
+ mode = mapper->getMinimapMode();
+ mode = (MinimapMode)((int)mode + 1);
+ }
+
+ *flag = true;
+ switch (mode) {
+ case MINIMAP_MODE_SURFACEx1:
+ statustext = L"Minimap in surface mode, Zoom x1";
+ break;
+ case MINIMAP_MODE_SURFACEx2:
+ statustext = L"Minimap in surface mode, Zoom x2";
+ break;
+ case MINIMAP_MODE_SURFACEx4:
+ statustext = L"Minimap in surface mode, Zoom x4";
+ break;
+ case MINIMAP_MODE_RADARx1:
+ statustext = L"Minimap in radar mode, Zoom x1";
+ break;
+ case MINIMAP_MODE_RADARx2:
+ statustext = L"Minimap in radar mode, Zoom x2";
+ break;
+ case MINIMAP_MODE_RADARx4:
+ statustext = L"Minimap in radar mode, Zoom x4";
+ break;
+ default:
+ mode = MINIMAP_MODE_OFF;
+ *flag = false;
+ statustext = (hud_flags & HUD_FLAG_MINIMAP_VISIBLE) ?
+ L"Minimap hidden" : L"Minimap disabled by server";
+ }
+
+ *statustext_time = 0;
+ mapper->setMinimapMode(mode);
}
void Game::toggleFog(float *statustext_time, bool *flag)