Move all nodes up when a node is placed below the ground
parent
229649a961
commit
3b1060e7b0
|
@ -18,7 +18,7 @@ viewport_bottom_right = right
|
||||||
|
|
||||||
# Lighting
|
# Lighting
|
||||||
# 0: no lighting / shadows
|
# 0: no lighting / shadows
|
||||||
# 1: Depth lighting (things further away from camera are darker)
|
# 1: Depth lighting (things further away from camera are darker) (TODO)
|
||||||
# 2: Normal lighting (like in Minetest)
|
# 2: Normal lighting (like in Minetest)
|
||||||
lighting = 2
|
lighting = 2
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@ lighting = 2
|
||||||
# when not in the node tool
|
# when not in the node tool
|
||||||
hide_other_nodes = true
|
hide_other_nodes = true
|
||||||
|
|
||||||
|
# Move all nodes up when a node is placed at negative y
|
||||||
|
no_negative_node_y = true
|
||||||
|
|
||||||
# Driver used to render
|
# Driver used to render
|
||||||
driver = opengl
|
driver = opengl
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ int main(int argc, char *argv[]) {
|
||||||
conf->set("viewport_bottom_right", "right");
|
conf->set("viewport_bottom_right", "right");
|
||||||
conf->set("lighting", "2");
|
conf->set("lighting", "2");
|
||||||
conf->set("hide_other_nodes", "true");
|
conf->set("hide_other_nodes", "true");
|
||||||
|
conf->set("no_negative_node_y", "true");
|
||||||
conf->set("fullscreen", "false");
|
conf->set("fullscreen", "false");
|
||||||
conf->set("width", "896");
|
conf->set("width", "896");
|
||||||
conf->set("height", "520");
|
conf->set("height", "520");
|
||||||
|
|
|
@ -222,9 +222,21 @@ void NodeEditor::updateProperties() {
|
||||||
try {
|
try {
|
||||||
irr::core::stringc name = prop->getElementFromId(ENG_GUI_PROP_NAME)->getText();
|
irr::core::stringc name = prop->getElementFromId(ENG_GUI_PROP_NAME)->getText();
|
||||||
node->name = str_replace(std::string(name.c_str(), name.size()), ' ', '_');
|
node->name = str_replace(std::string(name.c_str(), name.size()), ' ', '_');
|
||||||
|
int y = wcstod(prop->getElementFromId(ENG_GUI_PROP_Y)->getText(), NULL);
|
||||||
|
if (state->settings->getBool("no_negative_node_y") && y < 0) {
|
||||||
|
std::list<Node*> & nodes = state->project->nodes;
|
||||||
|
for (std::list<Node*>::const_iterator it = nodes.begin();
|
||||||
|
it != nodes.end();
|
||||||
|
++it) {
|
||||||
|
(*it)->position.Y -= y; // Remember, y is negative
|
||||||
|
}
|
||||||
|
state->project->remesh();
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
node->position = vector3di(
|
node->position = vector3di(
|
||||||
wcstod(prop->getElementFromId(ENG_GUI_PROP_X)->getText(), NULL),
|
wcstod(prop->getElementFromId(ENG_GUI_PROP_X)->getText(), NULL),
|
||||||
wcstod(prop->getElementFromId(ENG_GUI_PROP_Y)->getText(), NULL),
|
y,
|
||||||
wcstod(prop->getElementFromId(ENG_GUI_PROP_Z)->getText(), NULL)
|
wcstod(prop->getElementFromId(ENG_GUI_PROP_Z)->getText(), NULL)
|
||||||
);
|
);
|
||||||
node->remesh();
|
node->remesh();
|
||||||
|
|
Loading…
Reference in New Issue