},
node_highlighting = {
fgettext("Node Outlining"),
- fgettext("Node Highlighting")
+ fgettext("Node Highlighting"),
+ fgettext("None")
},
filters = {
fgettext("No Filter"),
},
node_highlighting = {
table.concat(labels.node_highlighting, ","),
- {"box", "halo"}
+ {"box", "halo", "none"}
},
filters = {
table.concat(labels.filters, ","),
m_halo_boxes.clear();
m_selection_pos = v3f(0.0, 0.0, 0.0);
- std::string mode = g_settings->get("node_highlighting");
+ std::string mode_setting = g_settings->get("node_highlighting");
+
+ if (mode_setting == "halo") {
+ m_mode = HIGHLIGHT_HALO;
+ } else if (mode_setting == "none") {
+ m_mode = HIGHLIGHT_NONE;
+ } else {
+ m_mode = HIGHLIGHT_BOX;
+ }
+
m_selection_material.Lighting = false;
if (g_settings->getBool("enable_shaders")) {
IShaderSource *shdrsrc = client->getShaderSource();
u16 shader_id = shdrsrc->getShader(
- mode == "halo" ? "selection_shader" : "default_shader", 1, 1);
+ m_mode == HIGHLIGHT_HALO ? "selection_shader" : "default_shader", 1, 1);
m_selection_material.MaterialType = shdrsrc->getShaderInfo(shader_id).material;
} else {
m_selection_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
}
- if (mode == "box") {
- m_use_selection_mesh = false;
+ if (m_mode == HIGHLIGHT_BOX) {
m_selection_material.Thickness =
rangelim(g_settings->getS16("selectionbox_width"), 1, 5);
- } else if (mode == "halo") {
- m_use_selection_mesh = true;
+ } else if (m_mode == HIGHLIGHT_HALO) {
m_selection_material.setTexture(0, tsrc->getTextureForMesh("halo.png"));
m_selection_material.setFlag(video::EMF_BACK_FACE_CULLING, true);
} else {
void Hud::drawSelectionMesh()
{
- if (!m_use_selection_mesh) {
+ if (m_mode == HIGHLIGHT_BOX) {
// Draw 3D selection boxes
video::SMaterial oldmaterial = driver->getMaterial2D();
driver->setMaterial(m_selection_material);
driver->draw3DBox(box, video::SColor(255, r, g, b));
}
driver->setMaterial(oldmaterial);
- } else if (m_selection_mesh) {
+ } else if (m_mode == HIGHLIGHT_HALO && m_selection_mesh) {
// Draw selection mesh
video::SMaterial oldmaterial = driver->getMaterial2D();
driver->setMaterial(m_selection_material);
void Hud::updateSelectionMesh(const v3s16 &camera_offset)
{
m_camera_offset = camera_offset;
- if (!m_use_selection_mesh)
+ if (m_mode != HIGHLIGHT_HALO)
return;
if (m_selection_mesh) {