Fix separator duplication in visual shader context menu
This commit is contained in:
parent
cbf5408685
commit
0fecd4ee4d
@ -2607,6 +2607,7 @@ void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_RIGHT) {
|
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_RIGHT) {
|
||||||
selected_constants.clear();
|
selected_constants.clear();
|
||||||
selected_uniforms.clear();
|
selected_uniforms.clear();
|
||||||
|
selected_comment = -1;
|
||||||
|
|
||||||
List<int> to_change;
|
List<int> to_change;
|
||||||
for (int i = 0; i < graph->get_child_count(); i++) {
|
for (int i = 0; i < graph->get_child_count(); i++) {
|
||||||
@ -2658,6 +2659,10 @@ void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
if (temp != -1) {
|
if (temp != -1) {
|
||||||
popup_menu->remove_item(temp);
|
popup_menu->remove_item(temp);
|
||||||
}
|
}
|
||||||
|
temp = popup_menu->get_item_index(NodeMenuOptions::SEPARATOR3);
|
||||||
|
if (temp != -1) {
|
||||||
|
popup_menu->remove_item(temp);
|
||||||
|
}
|
||||||
temp = popup_menu->get_item_index(NodeMenuOptions::SET_COMMENT_TITLE);
|
temp = popup_menu->get_item_index(NodeMenuOptions::SET_COMMENT_TITLE);
|
||||||
if (temp != -1) {
|
if (temp != -1) {
|
||||||
popup_menu->remove_item(temp);
|
popup_menu->remove_item(temp);
|
||||||
@ -2674,7 +2679,7 @@ void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (selected_constants.size() > 0 || selected_uniforms.size() > 0) {
|
if (selected_constants.size() > 0 || selected_uniforms.size() > 0) {
|
||||||
popup_menu->add_separator("", NodeMenuOptions::SEPARATOR2);
|
popup_menu->add_separator("", NodeMenuOptions::SEPARATOR3);
|
||||||
|
|
||||||
if (selected_constants.size() > 0) {
|
if (selected_constants.size() > 0) {
|
||||||
popup_menu->add_item(TTR("Convert Constant(s) to Uniform(s)"), NodeMenuOptions::CONVERT_CONSTANTS_TO_UNIFORMS);
|
popup_menu->add_item(TTR("Convert Constant(s) to Uniform(s)"), NodeMenuOptions::CONVERT_CONSTANTS_TO_UNIFORMS);
|
||||||
|
@ -198,6 +198,7 @@ class VisualShaderEditor : public VBoxContainer {
|
|||||||
SEPARATOR2, // ignore
|
SEPARATOR2, // ignore
|
||||||
CONVERT_CONSTANTS_TO_UNIFORMS,
|
CONVERT_CONSTANTS_TO_UNIFORMS,
|
||||||
CONVERT_UNIFORMS_TO_CONSTANTS,
|
CONVERT_UNIFORMS_TO_CONSTANTS,
|
||||||
|
SEPARATOR3, // ignore
|
||||||
SET_COMMENT_TITLE,
|
SET_COMMENT_TITLE,
|
||||||
SET_COMMENT_DESCRIPTION,
|
SET_COMMENT_DESCRIPTION,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user