summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2015-11-25 07:24:58 +0100
committerRémi Verschelde <remi@verschelde.fr>2015-11-25 07:24:58 +0100
commit7aa2a2e62c52e27853066e393991c72c005b3a6d (patch)
tree634d4d30a02cf46a1383366f5c139283a80281f2
parentbd10df93ec1c19405659ed82e6c7116921ba5e0c (diff)
parent8d97eef0fe634b8dba17d786123714fe83d5a4f8 (diff)
Merge pull request #2909 from neikeq/imp_2908
Put 2D, 3D and Script editor table indexes in enum
-rw-r--r--tools/editor/editor_help.cpp4
-rw-r--r--tools/editor/editor_node.cpp18
-rw-r--r--tools/editor/editor_node.h6
3 files changed, 17 insertions, 11 deletions
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index af2f1fd775..1a009214ac 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -271,7 +271,7 @@ void EditorHelpSearch::_confirmed() {
String mdata=ti->get_metadata(0);
emit_signal("go_to_help",mdata);
- editor->call("_editor_select",2); // in case EditorHelpSearch beeen invoked on top of other editor window
+ editor->call("_editor_select",EditorNode::EDITOR_SCRIPT); // in case EditorHelpSearch beeen invoked on top of other editor window
// go to that
hide();
}
@@ -1057,7 +1057,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
void EditorHelp::_request_help(const String& p_string) {
Error err = _goto_desc(p_string);
if (err==OK) {
- editor->call("_editor_select",2);
+ editor->call("_editor_select",EditorNode::EDITOR_SCRIPT);
}
//100 palabras
}
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 01e53ead18..15ac06aff1 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -167,19 +167,19 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) {
/*case KEY_F1:
if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(3);
+ _editor_select(EDITOR_SCRIPT);
break;*/
case KEY_F1:
if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(0);
+ _editor_select(EDITOR_2D);
break;
case KEY_F2:
if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(1);
+ _editor_select(EDITOR_3D);
break;
case KEY_F3:
if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(2);
+ _editor_select(EDITOR_SCRIPT);
break;
case KEY_F5: _menu_option_confirm((p_event.key.mod.control&&p_event.key.mod.shift)?RUN_PLAY_CUSTOM_SCENE:RUN_PLAY,true); break;
case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break;
@@ -298,7 +298,7 @@ void EditorNode::_notification(int p_what) {
VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true);
- _editor_select(1);
+ _editor_select(EDITOR_3D);
if (defer_load_scene!="") {
@@ -888,7 +888,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
}
}
- _editor_select(is2d?0:1);
+ _editor_select(is2d?EDITOR_2D:EDITOR_3D);
VS::get_singleton()->viewport_queue_screen_capture(viewport);
save.step("Creating Thumbnail",2);
@@ -2528,7 +2528,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
case OBJECT_REQUEST_HELP: {
if (current) {
- _editor_select(2);
+ _editor_select(EDITOR_SCRIPT);
emit_signal("request_help",current->get_type());
}
@@ -3305,9 +3305,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state) {
int n2d=0,n3d=0;
_find_node_types(get_edited_scene(),n2d,n3d);
if (n2d>n3d) {
- _editor_select(0);
+ _editor_select(EDITOR_2D);
} else if (n3d>n2d) {
- _editor_select(1);
+ _editor_select(EDITOR_3D);
}
}
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 7d8b97688e..2b91929b94 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -529,6 +529,12 @@ protected:
static void _bind_methods();
public:
+ enum EditorTable {
+ EDITOR_2D = 0,
+ EDITOR_3D,
+ EDITOR_SCRIPT
+ };
+
static EditorNode* get_singleton() { return singleton; }