summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct32
-rw-r--r--core/os/input_event.cpp4
-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
-rw-r--r--main/input_default.cpp2
-rw-r--r--platform/iphone/app_delegate.mm3
-rw-r--r--platform/osx/os_osx.mm4
12 files changed, 114 insertions, 31 deletions
diff --git a/SConstruct b/SConstruct
index c07baa2709..11cd95464d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -145,7 +145,7 @@ opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all
opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '')
opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'yes')
opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no')
-opts.Add('warnings', "Enable showing warnings during the compilation (yes/no)", 'yes')
+opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'all')
# Thirdparty libraries
opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes')
@@ -272,16 +272,28 @@ if selected_platform in platform_list:
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
detect.configure(env)
- # TODO: Add support to specify different levels of warning, e.g. only critical/significant, instead of on/off
- if (env["warnings"] == "yes"):
- if (os.name == "nt" and os.getenv("VSINSTALLDIR")): # MSVC, needs to stand out of course
- pass# env.Append(CCFLAGS=['/W2'])
- else: # Rest of the world
- env.Append(CCFLAGS=['-Wall'])
- else:
- if (os.name == "nt" and os.getenv("VSINSTALLDIR")): # MSVC
+ if (env["warnings"] == 'yes'):
+ print("WARNING: warnings=yes is deprecated; assuming warnings=all")
+
+ if (os.name == "nt" and os.getenv("VSINSTALLDIR")): # MSVC, needs to stand out of course
+ disable_nonessential_warnings = ['/wd4267', '/wd4244', '/wd4305', '/wd4800'] # Truncations, narrowing conversions...
+ if (env["warnings"] == 'extra'):
+ env.Append(CCFLAGS=['/Wall']) # Implies /W4
+ elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
+ env.Append(CCFLAGS=['/W3'] + disable_nonessential_warnings)
+ elif (env["warnings"] == 'moderate'):
+ # C4244 shouldn't be needed here being a level-3 warning, but it is
+ env.Append(CCFLAGS=['/W2'] + disable_nonessential_warnings)
+ else: # 'no'
env.Append(CCFLAGS=['/w'])
- else: # Rest of the world
+ else: # Rest of the world
+ if (env["warnings"] == 'extra'):
+ env.Append(CCFLAGS=['-Wall', '-Wextra'])
+ elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
+ env.Append(CCFLAGS=['-Wall'])
+ elif (env["warnings"] == 'moderate'):
+ env.Append(CCFLAGS=['-Wall', '-Wno-unused'])
+ else: # 'no'
env.Append(CCFLAGS=['-w'])
#env['platform_libsuffix'] = env['LIBSUFFIX']
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index cf3b8f74ec..7ec76c1eed 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -62,11 +62,11 @@ bool InputEvent::is_action(const StringName &p_action) const {
bool InputEvent::is_action_pressed(const StringName &p_action) const {
- return false; // InputMap::get_singleton()->event_is_action(Ref<InputEvent>(this),p_action);
+ return (is_pressed() && !is_echo() && is_action(p_action));
}
bool InputEvent::is_action_released(const StringName &p_action) const {
- return false;
+ return (!is_pressed() && is_action(p_action));
}
bool InputEvent::is_echo() const {
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();
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 9e11a595dc..0de30e5e9e 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -369,7 +369,7 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
set_joy_axis(jm->get_device(), jm->get_axis(), jm->get_axis_value());
}
- if (p_event->is_echo()) {
+ if (!p_event->is_echo()) {
for (const Map<StringName, InputMap::Action>::Element *E = InputMap::get_singleton()->get_action_map().front(); E; E = E->next()) {
if (InputMap::get_singleton()->event_is_action(p_event, E->key()) && is_action_pressed(E->key()) != p_event->is_pressed()) {
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index 576292b920..1f81f0f86e 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -402,8 +402,7 @@ static int frame_count = 0;
OSIPhone::get_singleton()->set_data_dir(
String::utf8([documentsDirectory UTF8String]));
- NSString *locale_code =
- [[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2];
+ NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
OSIPhone::get_singleton()->set_locale(
String::utf8([locale_code UTF8String]));
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index d13486b490..13bc2226f4 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1228,8 +1228,8 @@ Error OS_OSX::shell_open(String p_uri) {
}
String OS_OSX::get_locale() const {
- NSString *preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0];
- return [preferredLang UTF8String];
+ NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
+ return [locale_code UTF8String];
}
void OS_OSX::swap_buffers() {