Merge pull request #76372 from sygi/dont_propagate_lock_view
Store lock view rotation whether its on or off
This commit is contained in:
commit
6306eb4047
|
@ -3329,13 +3329,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
||||||
case VIEW_LOCK_ROTATION: {
|
case VIEW_LOCK_ROTATION: {
|
||||||
int idx = view_menu->get_popup()->get_item_index(VIEW_LOCK_ROTATION);
|
int idx = view_menu->get_popup()->get_item_index(VIEW_LOCK_ROTATION);
|
||||||
bool current = view_menu->get_popup()->is_item_checked(idx);
|
bool current = view_menu->get_popup()->is_item_checked(idx);
|
||||||
lock_rotation = !current;
|
_set_lock_view_rotation(!current);
|
||||||
view_menu->get_popup()->set_item_checked(idx, !current);
|
|
||||||
if (lock_rotation) {
|
|
||||||
locked_label->show();
|
|
||||||
} else {
|
|
||||||
locked_label->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case VIEW_AUDIO_LISTENER: {
|
case VIEW_AUDIO_LISTENER: {
|
||||||
|
@ -3809,10 +3803,7 @@ void Node3DEditorViewport::set_state(const Dictionary &p_state) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p_state.has("lock_rotation")) {
|
if (p_state.has("lock_rotation")) {
|
||||||
lock_rotation = p_state["lock_rotation"];
|
_set_lock_view_rotation(p_state["lock_rotation"]);
|
||||||
|
|
||||||
int idx = view_menu->get_popup()->get_item_index(VIEW_LOCK_ROTATION);
|
|
||||||
view_menu->get_popup()->set_item_checked(idx, lock_rotation);
|
|
||||||
}
|
}
|
||||||
if (p_state.has("use_environment")) {
|
if (p_state.has("use_environment")) {
|
||||||
bool env = p_state["use_environment"];
|
bool env = p_state["use_environment"];
|
||||||
|
@ -3928,9 +3919,7 @@ Dictionary Node3DEditorViewport::get_state() const {
|
||||||
if (previewing) {
|
if (previewing) {
|
||||||
d["previewing"] = EditorNode::get_singleton()->get_edited_scene()->get_path_to(previewing);
|
d["previewing"] = EditorNode::get_singleton()->get_edited_scene()->get_path_to(previewing);
|
||||||
}
|
}
|
||||||
if (lock_rotation) {
|
d["lock_rotation"] = lock_rotation;
|
||||||
d["lock_rotation"] = lock_rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
@ -4935,6 +4924,17 @@ void Node3DEditorViewport::shortcut_changed_callback(const Ref<Shortcut> p_short
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Node3DEditorViewport::_set_lock_view_rotation(bool p_lock_rotation) {
|
||||||
|
lock_rotation = p_lock_rotation;
|
||||||
|
int idx = view_menu->get_popup()->get_item_index(VIEW_LOCK_ROTATION);
|
||||||
|
view_menu->get_popup()->set_item_checked(idx, p_lock_rotation);
|
||||||
|
if (p_lock_rotation) {
|
||||||
|
locked_label->show();
|
||||||
|
} else {
|
||||||
|
locked_label->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p_index) {
|
Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p_index) {
|
||||||
cpu_time_history_index = 0;
|
cpu_time_history_index = 0;
|
||||||
gpu_time_history_index = 0;
|
gpu_time_history_index = 0;
|
||||||
|
|
|
@ -450,6 +450,8 @@ private:
|
||||||
void register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode, bool p_physical = false);
|
void register_shortcut_action(const String &p_path, const String &p_name, Key p_keycode, bool p_physical = false);
|
||||||
void shortcut_changed_callback(const Ref<Shortcut> p_shortcut, const String &p_shortcut_path);
|
void shortcut_changed_callback(const Ref<Shortcut> p_shortcut, const String &p_shortcut_path);
|
||||||
|
|
||||||
|
void _set_lock_view_rotation(bool p_lock_rotation);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
Loading…
Reference in New Issue