Change default gizmo visibility and icons
This commit is contained in:
parent
e77afb8507
commit
e5a4fa5281
2 changed files with 9 additions and 9 deletions
|
@ -4204,10 +4204,10 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
|
|||
gizmo_plugins.write[j]->set_state(state);
|
||||
|
||||
switch (state) {
|
||||
case EditorSpatialGizmoPlugin::ON_TOP:
|
||||
case EditorSpatialGizmoPlugin::VISIBLE:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible"));
|
||||
break;
|
||||
case EditorSpatialGizmoPlugin::VISIBLE:
|
||||
case EditorSpatialGizmoPlugin::ON_TOP:
|
||||
gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray"));
|
||||
break;
|
||||
case EditorSpatialGizmoPlugin::HIDDEN:
|
||||
|
@ -4317,10 +4317,10 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) {
|
|||
// Change icon
|
||||
const int state = gizmos_menu->get_item_state(idx);
|
||||
switch (state) {
|
||||
case EditorSpatialGizmoPlugin::ON_TOP:
|
||||
case EditorSpatialGizmoPlugin::VISIBLE:
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_icon("visibility_visible"));
|
||||
break;
|
||||
case EditorSpatialGizmoPlugin::VISIBLE:
|
||||
case EditorSpatialGizmoPlugin::ON_TOP:
|
||||
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_icon("visibility_xray"));
|
||||
break;
|
||||
case EditorSpatialGizmoPlugin::HIDDEN:
|
||||
|
@ -4839,7 +4839,7 @@ void SpatialEditor::_init_gizmos_menu() {
|
|||
for (int i = 0; i < gizmo_plugins.size(); ++i) {
|
||||
if (!gizmo_plugins[i]->can_be_hidden()) continue;
|
||||
String plugin_name = gizmo_plugins[i]->get_name();
|
||||
gizmos_menu->add_multistate_item(TTR(plugin_name), 3, EditorSpatialGizmoPlugin::ON_TOP, i);
|
||||
gizmos_menu->add_multistate_item(TTR(plugin_name), 3, EditorSpatialGizmoPlugin::VISIBLE, i);
|
||||
gizmos_menu->set_item_icon(gizmos_menu->get_item_index(i), gizmos_menu->get_icon("visibility_visible"));
|
||||
}
|
||||
}
|
||||
|
@ -5919,7 +5919,7 @@ void EditorSpatialGizmoPlugin::unregister_gizmo(EditorSpatialGizmo *p_gizmo) {
|
|||
}
|
||||
|
||||
EditorSpatialGizmoPlugin::EditorSpatialGizmoPlugin() {
|
||||
current_state = ON_TOP;
|
||||
current_state = VISIBLE;
|
||||
}
|
||||
|
||||
EditorSpatialGizmoPlugin::~EditorSpatialGizmoPlugin() {
|
||||
|
|
|
@ -754,9 +754,9 @@ class EditorSpatialGizmoPlugin : public Resource {
|
|||
GDCLASS(EditorSpatialGizmoPlugin, Resource);
|
||||
|
||||
public:
|
||||
static const int ON_TOP = 0;
|
||||
static const int VISIBLE = 1;
|
||||
static const int HIDDEN = 2;
|
||||
static const int VISIBLE = 0;
|
||||
static const int HIDDEN = 1;
|
||||
static const int ON_TOP = 2;
|
||||
|
||||
private:
|
||||
int current_state;
|
||||
|
|
Loading…
Reference in a new issue