diff options
-rw-r--r-- | doc/classes/Button.xml | 2 | ||||
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/SCsub | 11 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/register_types.cpp | 15 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 5 | ||||
-rw-r--r-- | scene/gui/button.cpp | 6 |
7 files changed, 31 insertions, 12 deletions
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index adf826c26b..6a8cdcd2a8 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -15,7 +15,7 @@ Text alignment policy for the button's text, use one of the [code]ALIGN_*[/code] constants. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false"> - When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. This property is disabled by default. + When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. </member> <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> Flat buttons don't display decoration. diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index ab0ee7c24f..640d45ae65 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -919,7 +919,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { actions[VS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"] = "modelview_matrix"; actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix"; - actions[VS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"] = "extra_matrix"; + actions[VS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"] = "extra_matrix_instance"; actions[VS::SHADER_CANVAS_ITEM].renames["TIME"] = "time"; actions[VS::SHADER_CANVAS_ITEM].renames["AT_LIGHT_PASS"] = "at_light_pass"; actions[VS::SHADER_CANVAS_ITEM].renames["INSTANCE_CUSTOM"] = "instance_custom"; diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub index 6285e6bb54..74e653ce43 100644 --- a/modules/gdscript/SCsub +++ b/modules/gdscript/SCsub @@ -8,5 +8,12 @@ env_gdscript = env_modules.Clone() env_gdscript.add_source_files(env.modules_sources, "*.cpp") if env['tools']: - env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp") - env_gdscript.add_source_files(env.modules_sources, "./language_server/*.cpp") + env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp") + + # Those two modules are required for the language server protocol + if env['module_jsonrpc_enabled'] and env['module_websocket_enabled']: + env_gdscript.add_source_files(env.modules_sources, "./language_server/*.cpp") + else: + # Using a define in the disabled case, to avoid having an extra define + # in regular builds where all modules are enabled. + env_gdscript.Append(CPPDEFINES=['GDSCRIPT_NO_LSP']) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index a9f22225a0..99bfdae7ec 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3366,7 +3366,7 @@ void GDScriptParser::_parse_extends(ClassNode *p_class) { return; } - if (!p_class->constant_expressions.empty() || !p_class->subclasses.empty() || !p_class->functions.empty() || !p_class->variables.empty() || p_class->classname_used) { + if (!p_class->constant_expressions.empty() || !p_class->subclasses.empty() || !p_class->functions.empty() || !p_class->variables.empty()) { _set_error("\"extends\" must be used before anything else."); return; diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index d07949b34b..94b9e8c2d9 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -34,10 +34,8 @@ #include "core/io/resource_loader.h" #include "core/os/dir_access.h" #include "core/os/file_access.h" -#include "editor/gdscript_highlighter.h" #include "gdscript.h" #include "gdscript_tokenizer.h" -#include "language_server/gdscript_language_server.h" GDScriptLanguage *script_language_gd = NULL; Ref<ResourceFormatLoaderGDScript> resource_loader_gd; @@ -45,10 +43,15 @@ Ref<ResourceFormatSaverGDScript> resource_saver_gd; #ifdef TOOLS_ENABLED -#include "core/engine.h" #include "editor/editor_export.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/gdscript_highlighter.h" + +#ifndef GDSCRIPT_NO_LSP +#include "core/engine.h" +#include "language_server/gdscript_language_server.h" +#endif // !GDSCRIPT_NO_LSP class EditorExportGDScript : public EditorExportPlugin { @@ -137,13 +140,15 @@ static void _editor_init() { gd_export.instance(); EditorExport::get_singleton()->add_export_plugin(gd_export); +#ifndef GDSCRIPT_NO_LSP register_lsp_types(); GDScriptLanguageServer *lsp_plugin = memnew(GDScriptLanguageServer); EditorNode::get_singleton()->add_editor_plugin(lsp_plugin); Engine::get_singleton()->add_singleton(Engine::Singleton("GDScriptLanguageProtocol", GDScriptLanguageProtocol::get_singleton())); +#endif // !GDSCRIPT_NO_LSP } -#endif +#endif // TOOLS_ENABLED void register_gdscript_types() { @@ -162,7 +167,7 @@ void register_gdscript_types() { #ifdef TOOLS_ENABLED ScriptEditor::register_create_syntax_highlighter_function(GDScriptSyntaxHighlighter::create); EditorNode::add_init_callback(_editor_init); -#endif +#endif // TOOLS_ENABLED } void unregister_gdscript_types() { diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index ca72393e43..dfa0a45538 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1757,7 +1757,10 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { // XLookupString returns keysyms usable as nice scancodes/ char str[256 + 1]; - XLookupString(xkeyevent, str, 256, &keysym_keycode, NULL); + XKeyEvent xkeyevent_no_mod = *xkeyevent; + xkeyevent_no_mod.state &= ~ShiftMask; + xkeyevent_no_mod.state &= ~ControlMask; + XLookupString(&xkeyevent_no_mod, str, 256, &keysym_keycode, NULL); // Meanwhile, XLookupString returns keysyms useful for unicode. diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 65e9cccd05..4ce3f18505 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -159,7 +159,11 @@ void Button::_notification(int p_what) { switch (align) { case ALIGN_LEFT: { - text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x + _internal_margin[MARGIN_LEFT] + get_constant("hseparation"); + if (_internal_margin[MARGIN_LEFT] > 0) { + text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x + _internal_margin[MARGIN_LEFT] + get_constant("hseparation"); + } else { + text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x; + } text_ofs.y += style->get_offset().y; } break; case ALIGN_CENTER: { |