summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_editor.cpp14
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--editor/editor_node.cpp42
-rw-r--r--editor/editor_node.h9
-rw-r--r--editor/editor_settings.cpp6
-rw-r--r--editor/editor_themes.cpp26
-rw-r--r--editor/plugins/script_editor_plugin.cpp14
-rw-r--r--editor/plugins/script_editor_plugin.h1
8 files changed, 93 insertions, 21 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp
index 7c29162e67..a5de4fee88 100644
--- a/editor/animation_editor.cpp
+++ b/editor/animation_editor.cpp
@@ -2601,7 +2601,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
float clickp = click.at.x - ofs.x;
float dif = base - clickp;
- float target = mb->get_pos().x + dif - ofs.x;
+ float target = mm->get_pos().x + dif - ofs.x;
float ratio = target / settings_limit;
@@ -2615,7 +2615,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_DRAG_TIMELINE: {
- Point2 mpos = mb->get_pos() - ofs;
+ Point2 mpos = mm->get_pos() - ofs;
/*
if (mpos.x<name_limit)
mpos.x=name_limit;
@@ -2646,7 +2646,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_SELECT_KEYS: {
- click.to = mb->get_pos();
+ click.to = mm->get_pos();
if (click.to.y < h && click.at.y > h && mm->get_relative().y < 0) {
float prev = v_scroll->get_value();
@@ -2665,22 +2665,22 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_MOVE_KEYS: {
- click.to = mb->get_pos();
+ click.to = mm->get_pos();
} break;
default: {}
}
return;
- } else if (mb->get_button_mask() & BUTTON_MASK_MIDDLE) {
+ } else if (mm->get_button_mask() & BUTTON_MASK_MIDDLE) {
int rel = mm->get_relative().x;
float relf = rel / _get_zoom_scale();
h_scroll->set_value(h_scroll->get_value() - relf);
}
- if (mb->get_button_mask() == 0) {
+ if (mm->get_button_mask() == 0) {
- Point2 mpos = mb->get_pos() - ofs;
+ Point2 mpos = mm->get_pos() - ofs;
if (mpos.y < h) {
#if 0
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 5c5fc7c3d4..8fb307a77d 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -371,10 +371,12 @@ void EditorHelpIndex::_tree_item_selected() {
void EditorHelpIndex::select_class(const String &p_class) {
+ EditorNode *editor = EditorNode::get_singleton();
if (!tree_item_map.has(p_class))
return;
tree_item_map[p_class]->select(0);
class_list->ensure_cursor_is_visible();
+ editor->call("_editor_select", EditorNode::EDITOR_SCRIPT); // in case EditorHelpIndex beeen invoked on top of other editor window
}
void EditorHelpIndex::popup() {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index fd1ecc78b9..f00ad97ee8 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2561,8 +2561,25 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
file->popup_centered_ratio();
} break;
- case SETTINGS_ABOUT: {
-
+ case HELP_CLASSES: {
+ emit_signal("request_help_index", "");
+ } break;
+ case HELP_SEARCH: {
+ emit_signal("request_help_search", "");
+ } break;
+ case HELP_DOCS: {
+ OS::get_singleton()->shell_open("http://docs.godotengine.org/");
+ } break;
+ case HELP_QA: {
+ OS::get_singleton()->shell_open("https://godotengine.org/qa/");
+ } break;
+ case HELP_ISSUES: {
+ OS::get_singleton()->shell_open("https://github.com/godotengine/godot/issues");
+ } break;
+ case HELP_COMMUNITY: {
+ OS::get_singleton()->shell_open("https://godotengine.org/community");
+ } break;
+ case HELP_ABOUT: {
about->popup_centered_minsize(Size2(500, 130) * EDSCALE);
} break;
case SOURCES_REIMPORT: {
@@ -4823,6 +4840,7 @@ void EditorNode::_bind_methods() {
ADD_SIGNAL(MethodInfo("stop_pressed"));
ADD_SIGNAL(MethodInfo("request_help"));
ADD_SIGNAL(MethodInfo("request_help_search"));
+ ADD_SIGNAL(MethodInfo("request_help_index"));
ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::POOL_STRING_ARRAY, "args")));
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "obj")));
}
@@ -5355,7 +5373,6 @@ EditorNode::EditorNode() {
left_menu_hb->add_child(settings_menu);
settings_menu->set_text(TTR("Editor"));
settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
- settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
//settings_menu->set_anchor(MARGIN_RIGHT,ANCHOR_END);
p = settings_menu->get_popup();
@@ -5368,13 +5385,26 @@ EditorNode::EditorNode() {
p->add_child(editor_layouts);
editor_layouts->connect("id_pressed", this, "_layout_menu_option");
p->add_submenu_item(TTR("Editor Layout"), "Layouts");
-
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREN);
-
p->add_separator();
p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES);
+
+ // Help Menu
+ MenuButton *help_menu = memnew(MenuButton);
+ left_menu_hb->add_child(help_menu);
+ help_menu->set_text(TTR("Help"));
+ help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles"));
+ p = help_menu->get_popup();
+ p->connect("id_pressed", this, "_menu_option");
+ p->add_icon_item(gui_base->get_icon("ClassList", "EditorIcons"), TTR("Classes"), HELP_CLASSES);
+ p->add_icon_item(gui_base->get_icon("Help", "EditorIcons"), TTR("Search"), HELP_SEARCH);
+ p->add_separator();
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Q&A"), HELP_QA);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Issue Tracker"), HELP_ISSUES);
+ p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Community"), HELP_COMMUNITY);
p->add_separator();
- p->add_item(TTR("About"), SETTINGS_ABOUT);
+ p->add_icon_item(gui_base->get_icon("GodotDocs", "EditorIcons"), TTR("About"), HELP_ABOUT);
//Separator *s1 = memnew( VSeparator );
//menu_panel->add_child(s1);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index b996505016..55b3aa94d3 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -186,12 +186,19 @@ private:
SETTINGS_PICK_MAIN_SCENE,
SETTINGS_TOGGLE_FULLSCREN,
SETTINGS_HELP,
- SETTINGS_ABOUT,
SOURCES_REIMPORT,
DEPENDENCY_LOAD_CHANGED_IMAGES,
DEPENDENCY_UPDATE_IMPORTED,
SCENE_TAB_CLOSE,
+ HELP_CLASSES,
+ HELP_SEARCH,
+ HELP_DOCS,
+ HELP_QA,
+ HELP_ISSUES,
+ HELP_COMMUNITY,
+ HELP_ABOUT,
+
IMPORT_PLUGIN_BASE = 100,
OBJECT_METHOD_BASE = 500,
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 858c38c796..df12c7c75f 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -511,9 +511,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("interface/separate_distraction_mode", false);
- set("interface/theme/base_color", Color(0.3, 0.3, 0.3, 1));
+ set("interface/theme/preset", 0);
+ hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/theme/base_color", Color::html("#273241"));
hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
- set("interface/theme/highlight_color", Color(0.5, 0.5, 0.6, 1));
+ set("interface/theme/highlight_color", Color::html("#b79047"));
hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/contrast", 0.2);
hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 9968b73044..bf15f43d32 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -96,8 +96,32 @@ Ref<Theme> create_editor_theme() {
// Define colors
Color highlight_color = EDITOR_DEF("interface/theme/highlight_color", Color::html("#b79047"));
- Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#213d4c"));
+ Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#273241"));
float contrast = EDITOR_DEF("interface/theme/contrast", 0.25);
+ int preset = EDITOR_DEF("interface/theme/preset", 0);
+
+ switch (preset) {
+ case 0: { // Default
+ highlight_color = Color::html("#b79047");
+ base_color = Color::html("#273241");
+ contrast = 0.25;
+ } break;
+ case 1: { // Grey
+ highlight_color = Color::html("#3e3e3e");
+ base_color = Color::html("#3d3d3d");
+ contrast = 0.2;
+ } break;
+ case 2: { // Godot 2
+ highlight_color = Color::html("#86ace2");
+ base_color = Color::html("#3C3A44");
+ contrast = 0.25;
+ } break;
+ case 3: { // Arc
+ highlight_color = Color::html("#68a7f2");
+ base_color = Color::html("#434a59");
+ contrast = 0.2;
+ } break;
+ }
Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast);
Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index d369064050..fde6d83aa8 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -38,7 +38,6 @@
#include "os/file_access.h"
#include "os/input.h"
#include "os/keyboard.h"
-#include "os/keyboard.h"
#include "os/os.h"
#include "scene/main/viewport.h"
@@ -48,6 +47,7 @@ void ScriptEditorBase::_bind_methods() {
ADD_SIGNAL(MethodInfo("name_changed"));
ADD_SIGNAL(MethodInfo("request_help_search", PropertyInfo(Variant::STRING, "topic")));
+ ADD_SIGNAL(MethodInfo("request_help_index"));
ADD_SIGNAL(MethodInfo("request_open_script_at_line", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::INT, "line")));
ADD_SIGNAL(MethodInfo("request_save_history"));
ADD_SIGNAL(MethodInfo("go_to_help", PropertyInfo(Variant::STRING, "what")));
@@ -1039,7 +1039,7 @@ void ScriptEditor::_notification(int p_what) {
EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
help_search->set_icon(get_icon("Help", "EditorIcons"));
- site_search->set_icon(get_icon("GodotDocs", "EditorIcons"));
+ site_search->set_icon(get_icon("Instance", "EditorIcons"));
class_search->set_icon(get_icon("ClassList", "EditorIcons"));
script_forward->set_icon(get_icon("Forward", "EditorIcons"));
@@ -1051,6 +1051,7 @@ void ScriptEditor::_notification(int p_what) {
get_tree()->connect("tree_changed", this, "_tree_changed");
editor->connect("request_help", this, "_request_help");
editor->connect("request_help_search", this, "_help_search");
+ editor->connect("request_help_index", this, "_help_index");
}
if (p_what == NOTIFICATION_EXIT_TREE) {
@@ -2028,6 +2029,10 @@ void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
auto_reload_running_scripts = p_enabled;
}
+void ScriptEditor::_help_index(String p_text) {
+ help_index->popup();
+}
+
void ScriptEditor::_help_search(String p_text) {
help_search_dialog->popup(p_text);
}
@@ -2069,6 +2074,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_goto_script_line", &ScriptEditor::_goto_script_line);
ClassDB::bind_method("_goto_script_line2", &ScriptEditor::_goto_script_line2);
ClassDB::bind_method("_help_search", &ScriptEditor::_help_search);
+ ClassDB::bind_method("_help_index", &ScriptEditor::_help_index);
ClassDB::bind_method("_save_history", &ScriptEditor::_save_history);
ClassDB::bind_method("_breaked", &ScriptEditor::_breaked);
@@ -2211,10 +2217,10 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
menu_hb->add_spacer();
site_search = memnew(ToolButton);
- site_search->set_text(TTR("Tutorials"));
+ site_search->set_text(TTR("Online Docs"));
site_search->connect("pressed", this, "_menu_option", varray(SEARCH_WEBSITE));
menu_hb->add_child(site_search);
- site_search->set_tooltip(TTR("Open https://godotengine.org at tutorials section."));
+ site_search->set_tooltip(TTR("Open Godot online documentation"));
class_search = memnew(ToolButton);
class_search->set_text(TTR("Classes"));
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index fb2f108277..455a888f0e 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -291,6 +291,7 @@ class ScriptEditor : public VBoxContainer {
void _unhandled_input(const Ref<InputEvent> &p_event);
void _help_search(String p_text);
+ void _help_index(String p_text);
void _history_forward();
void _history_back();