diff options
114 files changed, 1407 insertions, 818 deletions
diff --git a/SConstruct b/SConstruct index a6767e6a25..4fd1b86f54 100644 --- a/SConstruct +++ b/SConstruct @@ -1,7 +1,7 @@ #!/usr/bin/env python -EnsureSConsVersion(0, 14) +EnsureSConsVersion(0, 98, 1) import string @@ -132,46 +132,46 @@ opts = Variables(customs, ARGUMENTS) # Target build options opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/etc)", '') -opts.Add('bits', "Target platform bits (default/32/64/fat)", 'default') +opts.Add(EnumVariable('bits', "Target platform bits", 'default', ('default', '32', '64', 'fat'))) opts.Add('p', "Platform (alias for 'platform')", '') -opts.Add('platform', "Target platform: any in " + str(platform_list), '') -opts.Add('target', "Compilation target (debug/release_debug/release)", 'debug') -opts.Add('tools', "Build the tools a.k.a. the Godot editor (yes/no)", 'yes') +opts.Add('platform', "Target platform (%s)" % ('|'.join(platform_list), ), '') +opts.Add(EnumVariable('target', "Compilation target", 'debug', ('debug', 'release_debug', 'release'))) +opts.Add(BoolVariable('tools', "Build the tools a.k.a. the Godot editor", True)) # Components -opts.Add('deprecated', "Enable deprecated features (yes/no)", 'yes') -opts.Add('gdscript', "Build GDSCript support (yes/no)", 'yes') -opts.Add('minizip', "Build minizip archive support (yes/no)", 'yes') -opts.Add('xaudio2', "XAudio2 audio driver (yes/no)", 'no') -opts.Add('xml', "XML format support for resources (yes/no)", 'yes') +opts.Add(BoolVariable('deprecated', "Enable deprecated features", True)) +opts.Add(BoolVariable('gdscript', "Build GDSCript support", True)) +opts.Add(BoolVariable('minizip', "Build minizip archive support", True)) +opts.Add(BoolVariable('xaudio2', "XAudio2 audio driver", False)) +opts.Add(BoolVariable('xml', "XML format support for resources", True)) # Advanced options -opts.Add('disable_3d', "Disable 3D nodes for smaller executable (yes/no)", 'no') -opts.Add('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors (yes/no)", 'no') +opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for smaller executable", False)) +opts.Add(BoolVariable('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors", False)) opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '') 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)", 'no') -opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no') -opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'no') -opts.Add('progress', "Show a progress indicator during build (yes/no)", 'yes') -opts.Add('dev', "If yes, alias for verbose=yes warnings=all (yes/no)", 'no') +opts.Add(BoolVariable('verbose', "Enable verbose output for the compilation", False)) +opts.Add(BoolVariable('vsproj', "Generate Visual Studio Project.", False)) +opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'no', ('extra', 'all', 'moderate', 'no'))) +opts.Add(BoolVariable('progress', "Show a progress indicator during build", True)) +opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False)) # Thirdparty libraries -opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes') -opts.Add('builtin_freetype', "Use the builtin freetype library (yes/no)", 'yes') -opts.Add('builtin_libogg', "Use the builtin libogg library (yes/no)", 'yes') -opts.Add('builtin_libpng', "Use the builtin libpng library (yes/no)", 'yes') -opts.Add('builtin_libtheora', "Use the builtin libtheora library (yes/no)", 'yes') -opts.Add('builtin_libvorbis', "Use the builtin libvorbis library (yes/no)", 'yes') -opts.Add('builtin_libvpx', "Use the builtin libvpx library (yes/no)", 'yes') -opts.Add('builtin_libwebp', "Use the builtin libwebp library (yes/no)", 'yes') -opts.Add('builtin_openssl', "Use the builtin openssl library (yes/no)", 'yes') -opts.Add('builtin_opus', "Use the builtin opus library (yes/no)", 'yes') -opts.Add('builtin_pcre2', "Use the builtin pcre2 library (yes/no)", 'yes') -opts.Add('builtin_recast', "Use the builtin recast library (yes/no)", 'yes') -opts.Add('builtin_squish', "Use the builtin squish library (yes/no)", 'yes') -opts.Add('builtin_zlib', "Use the builtin zlib library (yes/no)", 'yes') -opts.Add('builtin_zstd', "Use the builtin zstd library (yes/no)", 'yes') +opts.Add(BoolVariable('builtin_enet', "Use the builtin enet library", True)) +opts.Add(BoolVariable('builtin_freetype', "Use the builtin freetype library", True)) +opts.Add(BoolVariable('builtin_libogg', "Use the builtin libogg library", True)) +opts.Add(BoolVariable('builtin_libpng', "Use the builtin libpng library", True)) +opts.Add(BoolVariable('builtin_libtheora', "Use the builtin libtheora library", True)) +opts.Add(BoolVariable('builtin_libvorbis', "Use the builtin libvorbis library", True)) +opts.Add(BoolVariable('builtin_libvpx', "Use the builtin libvpx library", True)) +opts.Add(BoolVariable('builtin_libwebp', "Use the builtin libwebp library", True)) +opts.Add(BoolVariable('builtin_openssl', "Use the builtin openssl library", True)) +opts.Add(BoolVariable('builtin_opus', "Use the builtin opus library", True)) +opts.Add(BoolVariable('builtin_pcre2', "Use the builtin pcre2 library)", True)) +opts.Add(BoolVariable('builtin_recast', "Use the builtin recast library", True)) +opts.Add(BoolVariable('builtin_squish', "Use the builtin squish library", True)) +opts.Add(BoolVariable('builtin_zlib', "Use the builtin zlib library", True)) +opts.Add(BoolVariable('builtin_zstd', "Use the builtin zstd library", True)) # Environment setup opts.Add("CXX", "C++ compiler") @@ -186,10 +186,10 @@ opts.Add("LINKFLAGS", "Custom flags for the linker") for k in platform_opts.keys(): opt_list = platform_opts[k] for o in opt_list: - opts.Add(o[0], o[1], o[2]) + opts.Add(o) for x in module_list: - opts.Add('module_' + x + '_enabled', "Enable module '" + x + "' (yes/no)", "yes") + opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), True)) opts.Update(env_base) # update environment Help(opts.GenerateHelpText(env_base)) # generate help @@ -213,7 +213,7 @@ if (env_base['target'] == 'debug'): env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE']) -if (env_base['deprecated'] == 'no'): +if not env_base['deprecated']: env_base.Append(CPPFLAGS=['-DDISABLE_DEPRECATED']) env_base.platforms = {} @@ -237,11 +237,11 @@ if selected_platform in platform_list: else: env = env_base.Clone() - if (env["dev"] == "yes"): + if env['dev']: env["warnings"] = "all" - env["verbose"] = "yes" + env['verbose'] = True - if env['vsproj'] == "yes": + if env['vsproj']: env.vs_incs = [] env.vs_srcs = [] @@ -319,19 +319,19 @@ if selected_platform in platform_list: suffix = "." + selected_platform if (env["target"] == "release"): - if (env["tools"] == "yes"): + if env["tools"]: print("Tools can only be built with targets 'debug' and 'release_debug'.") sys.exit(255) suffix += ".opt" env.Append(CCFLAGS=['-DNDEBUG']) elif (env["target"] == "release_debug"): - if (env["tools"] == "yes"): + if env["tools"]: suffix += ".opt.tools" else: suffix += ".opt.debug" else: - if (env["tools"] == "yes"): + if env["tools"]: suffix += ".tools" else: suffix += ".debug" @@ -359,7 +359,7 @@ if selected_platform in platform_list: env.doc_class_path={} for x in module_list: - if env['module_' + x + '_enabled'] != "yes": + if not env['module_' + x + '_enabled']: continue tmppath = "./modules/" + x sys.path.append(tmppath) @@ -386,22 +386,22 @@ if selected_platform in platform_list: # to test 64 bits compiltion # env.Append(CPPFLAGS=['-m64']) - if (env['tools'] == 'yes'): + if env['tools']: env.Append(CPPFLAGS=['-DTOOLS_ENABLED']) - if (env['disable_3d'] == 'yes'): + if env['disable_3d']: env.Append(CPPFLAGS=['-D_3D_DISABLED']) - if (env['gdscript'] == 'yes'): + if env['gdscript']: env.Append(CPPFLAGS=['-DGDSCRIPT_ENABLED']) - if (env['disable_advanced_gui'] == 'yes'): + if env['disable_advanced_gui']: env.Append(CPPFLAGS=['-DADVANCED_GUI_DISABLED']) - if (env['minizip'] == 'yes'): + if env['minizip']: env.Append(CPPFLAGS=['-DMINIZIP_ENABLED']) - if (env['xml'] == 'yes'): + if env['xml']: env.Append(CPPFLAGS=['-DXML_ENABLED']) - if (env['verbose'] == 'no'): + if not env['verbose']: methods.no_verbose(sys, env) if (True): # FIXME: detect GLES3 @@ -423,7 +423,7 @@ if selected_platform in platform_list: SConscript("platform/" + selected_platform + "/SCsub") # build selected platform # Microsoft Visual Studio Project Generation - if (env['vsproj']) == "yes": + if env['vsproj']: methods.generate_vs_project(env, GetOption("num_jobs")) # Check for the existence of headers @@ -470,7 +470,7 @@ def progress_finish(target, source, env): with open(node_count_fname, 'w') as f: f.write('%d\n' % node_count) -if ('env' in locals() and env["progress"] == "yes"): +if 'env' in locals() and env['progress']: try: with open(node_count_fname) as f: node_count_max = int(f.readline()) diff --git a/core/SCsub b/core/SCsub index e78fe185a9..e9b21bc71b 100644 --- a/core/SCsub +++ b/core/SCsub @@ -83,7 +83,7 @@ thirdparty_minizip_sources = [ thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources] env.add_source_files(env.core_sources, thirdparty_minizip_sources) -if "builtin_zstd" in env and env["builtin_zstd"] == "yes": +if 'builtin_zstd' in env and env['builtin_zstd']: SConscript("#thirdparty/zstd/SCsub") diff --git a/core/variant.h b/core/variant.h index 5ea540a63f..e0d0bf05c8 100644 --- a/core/variant.h +++ b/core/variant.h @@ -368,6 +368,7 @@ public: static Vector<Variant> get_method_default_arguments(Variant::Type p_type, const StringName &p_method); static Variant::Type get_method_return_type(Variant::Type p_type, const StringName &p_method, bool *r_has_return = NULL); static Vector<StringName> get_method_argument_names(Variant::Type p_type, const StringName &p_method); + static bool is_method_const(Variant::Type p_type, const StringName &p_method); void set_named(const StringName &p_index, const Variant &p_value, bool *r_valid = NULL); Variant get_named(const StringName &p_index, bool *r_valid = NULL) const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 7205280938..d141621fbb 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -53,6 +53,7 @@ struct _VariantCall { Vector<StringName> arg_names; Variant::Type return_type; + bool _const; #ifdef DEBUG_ENABLED bool returns; #endif @@ -145,11 +146,12 @@ struct _VariantCall { #endif } - static void addfunc(Variant::Type p_type, Variant::Type p_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg()) { + static void addfunc(bool p_const, Variant::Type p_type, Variant::Type p_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg()) { FuncData funcdata; funcdata.func = p_func; funcdata.default_args = p_defaultarg; + funcdata._const = p_const; #ifdef DEBUG_ENABLED funcdata.return_type = p_return; funcdata.returns = p_return != Variant::NIL; @@ -1201,6 +1203,17 @@ Vector<Variant::Type> Variant::get_method_argument_types(Variant::Type p_type, c return E->get().arg_types; } +bool Variant::is_method_const(Variant::Type p_type, const StringName &p_method) { + + const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type]; + + const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method); + if (!E) + return false; + + return E->get()._const; +} + Vector<StringName> Variant::get_method_argument_names(Variant::Type p_type, const StringName &p_method) { const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type]; @@ -1248,6 +1261,10 @@ void Variant::get_method_list(List<MethodInfo> *p_list) const { MethodInfo mi; mi.name = E->key(); + if (fd._const) { + mi.flags |= METHOD_FLAG_CONST; + } + for (int i = 0; i < fd.arg_types.size(); i++) { PropertyInfo pi; @@ -1360,15 +1377,26 @@ void register_variant_methods() { _VariantCall::constant_data = memnew_arr(_VariantCall::ConstantData, Variant::VARIANT_MAX); #define ADDFUNC0(m_vtype, m_ret, m_class, m_method, m_defarg) \ - _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg); + _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg); #define ADDFUNC1(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_defarg) \ - _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1))); + _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1))); #define ADDFUNC2(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_defarg) \ - _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2))); + _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2))); #define ADDFUNC3(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_defarg) \ - _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3))); + _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3))); #define ADDFUNC4(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_defarg) \ - _VariantCall::addfunc(Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4))); + _VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4))); + +#define ADDFUNC0NC(m_vtype, m_ret, m_class, m_method, m_defarg) \ + _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg); +#define ADDFUNC1NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_defarg) \ + _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1))); +#define ADDFUNC2NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_defarg) \ + _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2))); +#define ADDFUNC3NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_defarg) \ + _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3))); +#define ADDFUNC4NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_defarg) \ + _VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4))); /* STRING */ ADDFUNC1(STRING, INT, String, casecmp_to, STRING, "to", varray()); @@ -1545,7 +1573,7 @@ void register_variant_methods() { ADDFUNC0(DICTIONARY, INT, Dictionary, size, varray()); ADDFUNC0(DICTIONARY, BOOL, Dictionary, empty, varray()); - ADDFUNC0(DICTIONARY, NIL, Dictionary, clear, varray()); + ADDFUNC0NC(DICTIONARY, NIL, Dictionary, clear, varray()); ADDFUNC1(DICTIONARY, BOOL, Dictionary, has, NIL, "key", varray()); ADDFUNC1(DICTIONARY, BOOL, Dictionary, has_all, ARRAY, "keys", varray()); ADDFUNC1(DICTIONARY, NIL, Dictionary, erase, NIL, "key", varray()); @@ -1555,15 +1583,15 @@ void register_variant_methods() { ADDFUNC0(ARRAY, INT, Array, size, varray()); ADDFUNC0(ARRAY, BOOL, Array, empty, varray()); - ADDFUNC0(ARRAY, NIL, Array, clear, varray()); + ADDFUNC0NC(ARRAY, NIL, Array, clear, varray()); ADDFUNC0(ARRAY, INT, Array, hash, varray()); - ADDFUNC1(ARRAY, NIL, Array, push_back, NIL, "value", varray()); - ADDFUNC1(ARRAY, NIL, Array, push_front, NIL, "value", varray()); - ADDFUNC1(ARRAY, NIL, Array, append, NIL, "value", varray()); - ADDFUNC1(ARRAY, NIL, Array, resize, INT, "size", varray()); - ADDFUNC2(ARRAY, NIL, Array, insert, INT, "position", NIL, "value", varray()); - ADDFUNC1(ARRAY, NIL, Array, remove, INT, "position", varray()); - ADDFUNC1(ARRAY, NIL, Array, erase, NIL, "value", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, push_back, NIL, "value", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, push_front, NIL, "value", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, append, NIL, "value", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, resize, INT, "size", varray()); + ADDFUNC2NC(ARRAY, NIL, Array, insert, INT, "position", NIL, "value", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, remove, INT, "position", varray()); + ADDFUNC1NC(ARRAY, NIL, Array, erase, NIL, "value", varray()); ADDFUNC0(ARRAY, NIL, Array, front, varray()); ADDFUNC0(ARRAY, NIL, Array, back, varray()); ADDFUNC2(ARRAY, INT, Array, find, NIL, "what", INT, "from", varray(0)); @@ -1571,12 +1599,12 @@ void register_variant_methods() { ADDFUNC1(ARRAY, INT, Array, find_last, NIL, "value", varray()); ADDFUNC1(ARRAY, INT, Array, count, NIL, "value", varray()); ADDFUNC1(ARRAY, BOOL, Array, has, NIL, "value", varray()); - ADDFUNC0(ARRAY, NIL, Array, pop_back, varray()); - ADDFUNC0(ARRAY, NIL, Array, pop_front, varray()); - ADDFUNC0(ARRAY, NIL, Array, sort, varray()); - ADDFUNC2(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray()); - ADDFUNC0(ARRAY, NIL, Array, invert, varray()); - ADDFUNC0(ARRAY, ARRAY, Array, duplicate, varray()); + ADDFUNC0NC(ARRAY, NIL, Array, pop_back, varray()); + ADDFUNC0NC(ARRAY, NIL, Array, pop_front, varray()); + ADDFUNC0NC(ARRAY, NIL, Array, sort, varray()); + ADDFUNC2NC(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray()); + ADDFUNC0NC(ARRAY, NIL, Array, invert, varray()); + ADDFUNC0NC(ARRAY, ARRAY, Array, duplicate, varray()); ADDFUNC0(POOL_BYTE_ARRAY, INT, PoolByteArray, size, varray()); ADDFUNC2(POOL_BYTE_ARRAY, NIL, PoolByteArray, set, INT, "idx", INT, "byte", varray()); diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index f4a8eeabe4..e46fdc80e0 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -4,7 +4,7 @@ Sprite frame library for AnimatedSprite. </brief_description> <description> - Sprite frame library for [AnimatedSprite]. + Sprite frame library for [AnimatedSprite]. Contains frames and animation data for playback. </description> <tutorials> </tutorials> @@ -17,6 +17,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + Adds a new animation to the the library. </description> </method> <method name="add_frame"> @@ -29,6 +30,7 @@ <argument index="2" name="at_position" type="int" default="-1"> </argument> <description> + Adds a frame to the given animation. </description> </method> <method name="clear"> @@ -37,12 +39,14 @@ <argument index="0" name="anim" type="String"> </argument> <description> + Removes all frames from the given animation. </description> </method> <method name="clear_all"> <return type="void"> </return> <description> + Removes all animations. A "default" animation will be created. </description> </method> <method name="get_animation_loop" qualifiers="const"> @@ -51,6 +55,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + If [code]true[/code] the given animation will loop. </description> </method> <method name="get_animation_speed" qualifiers="const"> @@ -59,6 +64,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + The animation's speed in frames per second. </description> </method> <method name="get_frame" qualifiers="const"> @@ -69,6 +75,7 @@ <argument index="1" name="idx" type="int"> </argument> <description> + Returns the animation's selected frame. </description> </method> <method name="get_frame_count" qualifiers="const"> @@ -77,6 +84,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + Returns the number of frames in the animation. </description> </method> <method name="has_animation" qualifiers="const"> @@ -85,6 +93,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + If [code]true[/code] the named animation exists. </description> </method> <method name="remove_animation"> @@ -93,6 +102,7 @@ <argument index="0" name="anim" type="String"> </argument> <description> + Removes the given animation. </description> </method> <method name="remove_frame"> @@ -103,6 +113,7 @@ <argument index="1" name="idx" type="int"> </argument> <description> + Removes the animation's selected frame. </description> </method> <method name="rename_animation"> @@ -113,6 +124,7 @@ <argument index="1" name="newname" type="String"> </argument> <description> + Changes the animation's name to [code]newname[/code]. </description> </method> <method name="set_animation_loop"> @@ -123,6 +135,7 @@ <argument index="1" name="loop" type="bool"> </argument> <description> + If [code]true[/code] the animation will loop. </description> </method> <method name="set_animation_speed"> @@ -133,6 +146,7 @@ <argument index="1" name="speed" type="float"> </argument> <description> + The animation's speed in frames per second. </description> </method> <method name="set_frame"> @@ -145,11 +159,13 @@ <argument index="2" name="txt" type="Texture"> </argument> <description> + Sets the texture of the given frame. </description> </method> </methods> <members> <member name="animations" type="Array" setter="_set_animations" getter="_get_animations"> + An [Array] containing the [code]name[/code], [code]speed[/code], [code]loop[/code], and [code]frames[/code] of each animation. </member> <member name="frames" type="Array" setter="_set_frames" getter="_get_frames"> </member> diff --git a/drivers/SCsub b/drivers/SCsub index b8bba91378..195f7ec438 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -4,7 +4,7 @@ Import('env') env.drivers_sources = [] -if ("builtin_zlib" in env and env["builtin_zlib"] == "yes"): +if 'builtin_zlib' in env and env['builtin_zlib']: SConscript("zlib/SCsub") # OS drivers @@ -17,7 +17,7 @@ SConscript('pulseaudio/SCsub') if (env["platform"] == "windows"): SConscript("rtaudio/SCsub") SConscript("wasapi/SCsub") -if (env["xaudio2"] == "yes"): +if env['xaudio2']: SConscript("xaudio2/SCsub") # Graphics drivers @@ -29,10 +29,10 @@ SConscript("png/SCsub") # Tools override # FIXME: Should likely be integrated in the tools/ codebase -if (env["tools"] == "yes"): +if env['tools']: SConscript("convex_decomp/SCsub") -if env['vsproj'] == "yes": +if env['vsproj']: env.AddToVSProject(env.drivers_sources) if env.split_drivers: diff --git a/drivers/png/SCsub b/drivers/png/SCsub index 6684e36b20..39480351a6 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -5,7 +5,7 @@ Import('env') env_png = env.Clone() # Thirdparty source files -if (env['builtin_libpng'] != 'no'): +if env['builtin_libpng']: thirdparty_dir = "#thirdparty/libpng/" thirdparty_sources = [ "png.c", diff --git a/editor/SCsub b/editor/SCsub index 315865ad32..bf88ebb1b5 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -395,8 +395,8 @@ def _make_doc_data_class_path(to_path): g.write("{NULL,NULL}\n") g.write("};\n") -if (env["tools"] == "yes"): +if env['tools']: # Register exporters reg_exporters_inc = '#include "register_exporters.h"\n' reg_exporters = 'void register_exporters() {\n' diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b74bd3ab43..bdd297b56c 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -64,6 +64,8 @@ void EditorAudioBus::_notification(int p_what) { if (has_focus()) { draw_style_box(get_stylebox("focus", "Button"), Rect2(Vector2(), get_size())); + } else if (is_master) { + draw_style_box(get_stylebox("disabled", "Button"), Rect2(Vector2(), get_size())); } } @@ -123,7 +125,7 @@ void EditorAudioBus::_notification(int p_what) { void EditorAudioBus::update_send() { send->clear(); - if (get_index() == 0) { + if (is_master) { send->set_disabled(true); send->set_text(TTR("Speakers")); } else { @@ -154,7 +156,7 @@ void EditorAudioBus::update_bus() { slider->set_value(AudioServer::get_singleton()->get_bus_volume_db(index)); track_name->set_text(AudioServer::get_singleton()->get_bus_name(index)); - if (get_index() == 0) + if (is_master) track_name->set_editable(false); solo->set_pressed(AudioServer::get_singleton()->is_bus_solo(index)); @@ -237,6 +239,8 @@ void EditorAudioBus::_name_changed(const String &p_new_name) { ur->commit_action(); updating_bus = false; + + track_name->release_focus(); } void EditorAudioBus::_volume_db_changed(float p_db) { @@ -619,10 +623,11 @@ void EditorAudioBus::_bind_methods() { ADD_SIGNAL(MethodInfo("dropped")); } -EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { +EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { buses = p_buses; updating_bus = false; + is_master = p_is_master; set_tooltip(TTR("Audio Bus, Drag and Drop to rearrange.")); @@ -630,24 +635,15 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { add_child(vb); set_v_size_flags(SIZE_EXPAND_FILL); + set_custom_minimum_size(Size2(100, 0) * EDSCALE); - HBoxContainer *head = memnew(HBoxContainer); track_name = memnew(LineEdit); - head->add_child(track_name); track_name->connect("text_entered", this, "_name_changed"); track_name->connect("focus_exited", this, "_name_focus_exit"); - track_name->set_h_size_flags(SIZE_EXPAND_FILL); - - bus_options = memnew(MenuButton); - bus_options->set_h_size_flags(SIZE_SHRINK_END); - bus_options->set_tooltip(TTR("Bus options")); - head->add_child(bus_options); - - vb->add_child(head); + vb->add_child(track_name); HBoxContainer *hbc = memnew(HBoxContainer); vb->add_child(hbc); - hbc->add_spacer(); solo = memnew(ToolButton); solo->set_toggle_mode(true); solo->set_tooltip(TTR("Solo")); @@ -668,6 +664,23 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { hbc->add_child(bypass); hbc->add_spacer(); + bus_options = memnew(MenuButton); + bus_options->set_h_size_flags(SIZE_SHRINK_END); + bus_options->set_anchor(MARGIN_RIGHT, 0.0); + bus_options->set_tooltip(TTR("Bus options")); + hbc->add_child(bus_options); + + Ref<StyleBoxEmpty> sbempty = memnew(StyleBoxEmpty); + for (int i = 0; i < hbc->get_child_count(); i++) { + Control *child = Object::cast_to<Control>(hbc->get_child(i)); + child->add_style_override("normal", sbempty); + child->add_style_override("hover", sbempty); + child->add_style_override("focus", sbempty); + child->add_style_override("pressed", sbempty); + } + + vb->add_child(memnew(HSeparator)); + HBoxContainer *hb = memnew(HBoxContainer); vb->add_child(hb); slider = memnew(VSlider); @@ -699,8 +712,6 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { scale = memnew(TextureRect); hb->add_child(scale); - //add_child(hb); - effects = memnew(Tree); effects->set_hide_root(true); effects->set_custom_minimum_size(Size2(0, 100) * EDSCALE); @@ -744,7 +755,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { bus_popup = bus_options->get_popup(); bus_popup->add_item(TTR("Duplicate")); - bus_popup->add_item(TTR("Delete")); + if (!is_master) + bus_popup->add_item(TTR("Delete")); bus_popup->add_item(TTR("Reset Volume")); bus_popup->connect("index_pressed", this, "_bus_popup_pressed"); @@ -787,10 +799,8 @@ void EditorAudioBuses::_update_buses() { for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - EditorAudioBus *audio_bus = memnew(EditorAudioBus(this)); - if (i == 0) { - audio_bus->set_self_modulate(Color(1, 0.9, 0.9)); - } + bool is_master = i == 0 ? true : false; + EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master)); bus_hb->add_child(audio_bus); audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED); audio_bus->connect("duplicate_request", this, "_duplicate_bus", varray(), CONNECT_DEFERRED); diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index dba1b73295..995def468c 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -84,6 +84,8 @@ class EditorAudioBus : public PanelContainer { bool updating_bus; + bool is_master; + void _gui_input(const Ref<InputEvent> &p_event); void _bus_popup_pressed(int p_option); @@ -120,7 +122,7 @@ public: void update_bus(); void update_send(); - EditorAudioBus(EditorAudioBuses *p_buses = NULL); + EditorAudioBus(EditorAudioBuses *p_buses = NULL, bool p_is_master = false); }; class EditorAudioBusDrop : public Panel { diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 4caf2641fc..db12998dd2 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -273,6 +273,8 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) } Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { + if (p_path.ends_with(".so") || p_path.ends_with(".dylib") || p_path.ends_with(".dll")) + return OK; PackData *pd = (PackData *)p_userdata; diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 6e5726a16d..110b2a6a8c 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -158,6 +158,16 @@ void editor_register_fonts(Ref<Theme> p_theme) { p_theme->set_font("doc_source", "EditorFonts", df_doc_code); + Ref<DynamicFont> df_output_code; + df_output_code.instance(); + df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE); + df_output_code->set_spacing(DynamicFont::SPACING_TOP, -EDSCALE); + df_output_code->set_spacing(DynamicFont::SPACING_BOTTOM, -EDSCALE); + df_output_code->set_font_data(dfmono); + MAKE_FALLBACKS(df_output_code); + + p_theme->set_font("output_source", "EditorFonts", df_output_code); + //replace default theme Ref<Texture> di; Ref<StyleBox> ds; diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 481f2aaecf..3b20660013 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -31,6 +31,7 @@ #include "editor_node.h" #include "scene/gui/center_container.h" +#include "scene/resources/dynamic_font.h" #include "version.h" void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) { @@ -51,7 +52,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f self->emit_signal("show_request"); */ - err_str = " " + err_str; self->add_message(err_str, true); } @@ -60,6 +60,13 @@ void EditorLog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { //button->set_icon(get_icon("Console","EditorIcons")); + log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + } else if (p_what == NOTIFICATION_THEME_CHANGED) { + Ref<DynamicFont> df_output_code = get_font("output_source", "EditorFonts"); + if (df_output_code.is_valid()) { + df_output_code->set_size(int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE); + log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + } } /*if (p_what==NOTIFICATION_DRAW) { @@ -85,15 +92,13 @@ void EditorLog::clear() { void EditorLog::add_message(const String &p_msg, bool p_error) { - Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts"); - log->push_font(doc_code_font); - log->add_newline(); if (p_error) { log->push_color(get_color("error_color", "Editor")); Ref<Texture> icon = get_icon("Error", "EditorIcons"); log->add_image(icon); + log->add_text(" "); //button->set_icon(icon); } else { //button->set_icon(Ref<Texture>()); @@ -104,8 +109,6 @@ void EditorLog::add_message(const String &p_msg, bool p_error) { if (p_error) log->pop(); - - log->pop(); // pop font; } /* diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index cec3bc7f2d..1b1306e303 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -131,6 +131,11 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { return true; } +void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_value) { + set(p_name, p_value); + props[p_name].initial = p_value; +} + struct _EVCSort { String name; @@ -214,6 +219,8 @@ Variant _EDITOR_DEF(const String &p_var, const Variant &p_default) { if (EditorSettings::get_singleton()->has(p_var)) return EditorSettings::get_singleton()->get(p_var); EditorSettings::get_singleton()->set(p_var, p_default); + EditorSettings::get_singleton()->set_initial_value(p_var, p_default); + return p_default; } @@ -546,235 +553,235 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { best = "en"; } - set("interface/editor_language", best); + _initial_set("interface/editor_language", best); hints["interface/editor_language"] = PropertyInfo(Variant::STRING, "interface/editor_language", PROPERTY_HINT_ENUM, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); } - set("interface/hidpi_mode", 0); + _initial_set("interface/hidpi_mode", 0); hints["interface/hidpi_mode"] = PropertyInfo(Variant::INT, "interface/hidpi_mode", PROPERTY_HINT_ENUM, "Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/show_script_in_scene_tabs", false); - set("interface/font_size", 14); + _initial_set("interface/show_script_in_scene_tabs", false); + _initial_set("interface/font_size", 14); hints["interface/font_size"] = PropertyInfo(Variant::INT, "interface/font_size", PROPERTY_HINT_RANGE, "10,40,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/source_font_size", 14); + _initial_set("interface/source_font_size", 14); hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/custom_font", ""); + _initial_set("interface/custom_font", ""); hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/dim_editor_on_dialog_popup", true); - set("interface/dim_amount", 0.6f); + _initial_set("interface/dim_editor_on_dialog_popup", true); + _initial_set("interface/dim_amount", 0.6f); hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); - set("interface/dim_transition_time", 0.08f); + _initial_set("interface/dim_transition_time", 0.08f); hints["interface/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); - set("interface/separate_distraction_mode", false); + _initial_set("interface/separate_distraction_mode", false); - set("interface/save_each_scene_on_quit", true); // Regression - set("interface/quit_confirmation", true); + _initial_set("interface/save_each_scene_on_quit", true); // Regression + _initial_set("interface/quit_confirmation", true); - set("interface/theme/preset", 0); + _initial_set("interface/theme/preset", 0); hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Light,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/icon_and_font_color", 0); + _initial_set("interface/theme/icon_and_font_color", 0); hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/base_color", Color::html("#323b4f")); + _initial_set("interface/theme/base_color", Color::html("#323b4f")); hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/accent_color", Color::html("#699ce8")); + _initial_set("interface/theme/accent_color", Color::html("#699ce8")); 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.25); + _initial_set("interface/theme/contrast", 0.25); hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); - set("interface/theme/highlight_tabs", false); - set("interface/theme/border_size", 1); - set("interface/theme/use_graph_node_headers", false); + _initial_set("interface/theme/highlight_tabs", false); + _initial_set("interface/theme/border_size", 1); + _initial_set("interface/theme/use_graph_node_headers", false); hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/additional_spacing", 0); + _initial_set("interface/theme/additional_spacing", 0); hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/custom_theme", ""); + _initial_set("interface/theme/custom_theme", ""); hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/scene_tabs/show_extension", false); - set("interface/scene_tabs/show_thumbnail_on_hover", true); - set("interface/scene_tabs/resize_if_many_tabs", true); - set("interface/scene_tabs/minimum_width", 50); + _initial_set("interface/scene_tabs/show_extension", false); + _initial_set("interface/scene_tabs/show_thumbnail_on_hover", true); + _initial_set("interface/scene_tabs/resize_if_many_tabs", true); + _initial_set("interface/scene_tabs/minimum_width", 50); hints["interface/scene_tabs/minimum_width"] = PropertyInfo(Variant::INT, "interface/scene_tabs/minimum_width", PROPERTY_HINT_RANGE, "50,500,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("filesystem/directories/autoscan_project_path", ""); + _initial_set("filesystem/directories/autoscan_project_path", ""); hints["filesystem/directories/autoscan_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/autoscan_project_path", PROPERTY_HINT_GLOBAL_DIR); - set("filesystem/directories/default_project_path", OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS)); + _initial_set("filesystem/directories/default_project_path", OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS)); hints["filesystem/directories/default_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/default_project_path", PROPERTY_HINT_GLOBAL_DIR); - set("filesystem/directories/default_project_export_path", ""); + _initial_set("filesystem/directories/default_project_export_path", ""); hints["global/default_project_export_path"] = PropertyInfo(Variant::STRING, "global/default_project_export_path", PROPERTY_HINT_GLOBAL_DIR); - set("interface/show_script_in_scene_tabs", false); + _initial_set("interface/show_script_in_scene_tabs", false); - set("text_editor/theme/color_theme", "Adaptive"); + _initial_set("text_editor/theme/color_theme", "Adaptive"); hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default"); - set("text_editor/theme/line_spacing", 4); + _initial_set("text_editor/theme/line_spacing", 4); _load_default_text_editor_theme(); - set("text_editor/highlighting/syntax_highlighting", true); + _initial_set("text_editor/highlighting/syntax_highlighting", true); - set("text_editor/highlighting/highlight_all_occurrences", true); - set("text_editor/cursor/scroll_past_end_of_file", false); + _initial_set("text_editor/highlighting/highlight_all_occurrences", true); + _initial_set("text_editor/cursor/scroll_past_end_of_file", false); - set("text_editor/indent/type", 0); + _initial_set("text_editor/indent/type", 0); hints["text_editor/indent/type"] = PropertyInfo(Variant::INT, "text_editor/indent/type", PROPERTY_HINT_ENUM, "Tabs,Spaces"); - set("text_editor/indent/size", 4); + _initial_set("text_editor/indent/size", 4); hints["text_editor/indent/size"] = PropertyInfo(Variant::INT, "text_editor/indent/size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes. - set("text_editor/indent/auto_indent", true); - set("text_editor/indent/convert_indent_on_save", false); - set("text_editor/indent/draw_tabs", true); - - set("text_editor/line_numbers/show_line_numbers", true); - set("text_editor/line_numbers/line_numbers_zero_padded", false); - set("text_editor/line_numbers/show_breakpoint_gutter", true); - set("text_editor/line_numbers/show_line_length_guideline", false); - set("text_editor/line_numbers/line_length_guideline_column", 80); + _initial_set("text_editor/indent/auto_indent", true); + _initial_set("text_editor/indent/convert_indent_on_save", false); + _initial_set("text_editor/indent/draw_tabs", true); + + _initial_set("text_editor/line_numbers/show_line_numbers", true); + _initial_set("text_editor/line_numbers/line_numbers_zero_padded", false); + _initial_set("text_editor/line_numbers/show_breakpoint_gutter", true); + _initial_set("text_editor/line_numbers/show_line_length_guideline", false); + _initial_set("text_editor/line_numbers/line_length_guideline_column", 80); hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 10"); - set("text_editor/open_scripts/smooth_scrolling", true); - set("text_editor/open_scripts/v_scroll_speed", 80); - set("text_editor/open_scripts/show_members_overview", true); + _initial_set("text_editor/open_scripts/smooth_scrolling", true); + _initial_set("text_editor/open_scripts/v_scroll_speed", 80); + _initial_set("text_editor/open_scripts/show_members_overview", true); - set("text_editor/files/trim_trailing_whitespace_on_save", false); - set("text_editor/completion/idle_parse_delay", 2); - set("text_editor/tools/create_signal_callbacks", true); - set("text_editor/files/autosave_interval_secs", 0); + _initial_set("text_editor/files/trim_trailing_whitespace_on_save", false); + _initial_set("text_editor/completion/idle_parse_delay", 2); + _initial_set("text_editor/tools/create_signal_callbacks", true); + _initial_set("text_editor/files/autosave_interval_secs", 0); - set("text_editor/cursor/block_caret", false); - set("text_editor/cursor/caret_blink", false); - set("text_editor/cursor/caret_blink_speed", 0.65); + _initial_set("text_editor/cursor/block_caret", false); + _initial_set("text_editor/cursor/caret_blink", false); + _initial_set("text_editor/cursor/caret_blink_speed", 0.65); hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.1"); - set("text_editor/theme/font", ""); + _initial_set("text_editor/theme/font", ""); hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res"); - set("text_editor/completion/auto_brace_complete", false); - set("text_editor/files/restore_scripts_on_load", true); - set("text_editor/completion/complete_file_paths", true); - set("text_editor/files/maximum_recent_files", 20); + _initial_set("text_editor/completion/auto_brace_complete", false); + _initial_set("text_editor/files/restore_scripts_on_load", true); + _initial_set("text_editor/completion/complete_file_paths", true); + _initial_set("text_editor/files/maximum_recent_files", 20); hints["text_editor/files/maximum_recent_files"] = PropertyInfo(Variant::INT, "text_editor/files/maximum_recent_files", PROPERTY_HINT_RANGE, "1, 200, 0"); - set("docks/scene_tree/start_create_dialog_fully_expanded", false); - set("docks/scene_tree/draw_relationship_lines", false); - set("docks/scene_tree/relationship_line_color", Color::html("464646")); + _initial_set("docks/scene_tree/start_create_dialog_fully_expanded", false); + _initial_set("docks/scene_tree/draw_relationship_lines", false); + _initial_set("docks/scene_tree/relationship_line_color", Color::html("464646")); - set("editors/grid_map/pick_distance", 5000.0); + _initial_set("editors/grid_map/pick_distance", 5000.0); - set("editors/3d/grid_color", Color(1, 1, 1, 0.2)); + _initial_set("editors/3d/grid_color", Color(1, 1, 1, 0.2)); hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("editors/3d/default_fov", 55.0); - set("editors/3d/default_z_near", 0.1); - set("editors/3d/default_z_far", 500.0); + _initial_set("editors/3d/default_fov", 55.0); + _initial_set("editors/3d/default_z_near", 0.1); + _initial_set("editors/3d/default_z_far", 500.0); // navigation - set("editors/3d/navigation/navigation_scheme", 0); + _initial_set("editors/3d/navigation/navigation_scheme", 0); hints["editors/3d/navigation/navigation_scheme"] = PropertyInfo(Variant::INT, "editors/3d/navigation/navigation_scheme", PROPERTY_HINT_ENUM, "Godot,Maya,Modo"); - set("editors/3d/navigation/zoom_style", 0); + _initial_set("editors/3d/navigation/zoom_style", 0); hints["editors/3d/navigation/zoom_style"] = PropertyInfo(Variant::INT, "editors/3d/navigation/zoom_style", PROPERTY_HINT_ENUM, "Vertical, Horizontal"); - set("editors/3d/navigation/emulate_3_button_mouse", false); - set("editors/3d/navigation/orbit_modifier", 0); + _initial_set("editors/3d/navigation/emulate_3_button_mouse", false); + _initial_set("editors/3d/navigation/orbit_modifier", 0); hints["editors/3d/navigation/orbit_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/orbit_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/navigation/pan_modifier", 1); + _initial_set("editors/3d/navigation/pan_modifier", 1); hints["editors/3d/navigation/pan_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/pan_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/navigation/zoom_modifier", 4); + _initial_set("editors/3d/navigation/zoom_modifier", 4); hints["editors/3d/navigation/zoom_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/zoom_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - // set("editors/3d/navigation/emulate_numpad", false); not used at the moment - set("editors/3d/navigation/warped_mouse_panning", true); + // _initial_set("editors/3d/navigation/emulate_numpad", false); not used at the moment + _initial_set("editors/3d/navigation/warped_mouse_panning", true); // navigation feel - set("editors/3d/navigation_feel/orbit_sensitivity", 0.4); + _initial_set("editors/3d/navigation_feel/orbit_sensitivity", 0.4); hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01"); - set("editors/3d/navigation_feel/orbit_inertia", 0.15); + _initial_set("editors/3d/navigation_feel/orbit_inertia", 0.15); hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/translation_inertia", 0.15); + _initial_set("editors/3d/navigation_feel/translation_inertia", 0.15); hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/zoom_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/zoom_inertia", 0.075); hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); + _initial_set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // freelook - set("editors/3d/freelook/freelook_inertia", 0.1); + _initial_set("editors/3d/freelook/freelook_inertia", 0.1); hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/freelook/freelook_base_speed", 0.1); + _initial_set("editors/3d/freelook/freelook_base_speed", 0.1); hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01"); - set("editors/3d/freelook/freelook_activation_modifier", 0); + _initial_set("editors/3d/freelook/freelook_activation_modifier", 0); hints["editors/3d/freelook/freelook_activation_modifier"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_activation_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); - set("editors/3d/freelook/freelook_modifier_speed_factor", 3.0); + _initial_set("editors/3d/freelook/freelook_modifier_speed_factor", 3.0); hints["editors/3d/freelook/freelook_modifier_speed_factor"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_modifier_speed_factor", PROPERTY_HINT_RANGE, "0.0, 10.0, 0.1"); - set("editors/2d/bone_width", 5); - set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9)); - set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9)); - set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9)); - set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9)); - set("editors/2d/keep_margins_when_changing_anchors", false); - set("editors/2d/warped_mouse_panning", true); - set("editors/2d/scroll_to_pan", false); - set("editors/2d/pan_speed", 20); + _initial_set("editors/2d/bone_width", 5); + _initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9)); + _initial_set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9)); + _initial_set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9)); + _initial_set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9)); + _initial_set("editors/2d/keep_margins_when_changing_anchors", false); + _initial_set("editors/2d/warped_mouse_panning", true); + _initial_set("editors/2d/scroll_to_pan", false); + _initial_set("editors/2d/pan_speed", 20); - set("editors/poly_editor/point_grab_radius", 8); - set("editors/poly_editor/show_previous_outline", true); + _initial_set("editors/poly_editor/point_grab_radius", 8); + _initial_set("editors/poly_editor/show_previous_outline", true); - set("run/window_placement/rect", 1); + _initial_set("run/window_placement/rect", 1); hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen"); String screen_hints = TTR("Default (Same as Editor)"); for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) { screen_hints += ",Monitor " + itos(i + 1); } - set("run/window_placement/rect_custom_position", Vector2()); - set("run/window_placement/screen", 0); + _initial_set("run/window_placement/rect_custom_position", Vector2()); + _initial_set("run/window_placement/screen", 0); hints["run/window_placement/screen"] = PropertyInfo(Variant::INT, "run/window_placement/screen", PROPERTY_HINT_ENUM, screen_hints); - set("filesystem/on_save/compress_binary_resources", true); - set("filesystem/on_save/save_modified_external_resources", true); + _initial_set("filesystem/on_save/compress_binary_resources", true); + _initial_set("filesystem/on_save/save_modified_external_resources", true); - set("text_editor/tools/create_signal_callbacks", true); + _initial_set("text_editor/tools/create_signal_callbacks", true); - set("filesystem/file_dialog/show_hidden_files", false); - set("filesystem/file_dialog/display_mode", 0); + _initial_set("filesystem/file_dialog/show_hidden_files", false); + _initial_set("filesystem/file_dialog/display_mode", 0); hints["filesystem/file_dialog/display_mode"] = PropertyInfo(Variant::INT, "filesystem/file_dialog/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("filesystem/file_dialog/thumbnail_size", 64); + _initial_set("filesystem/file_dialog/thumbnail_size", 64); hints["filesystem/file_dialog/thumbnail_size"] = PropertyInfo(Variant::INT, "filesystem/file_dialog/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16"); - set("docks/filesystem/display_mode", 0); + _initial_set("docks/filesystem/display_mode", 0); hints["docks/filesystem/display_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("docks/filesystem/thumbnail_size", 64); + _initial_set("docks/filesystem/thumbnail_size", 64); hints["docks/filesystem/thumbnail_size"] = PropertyInfo(Variant::INT, "docks/filesystem/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16"); - set("docks/filesystem/display_mode", 0); + _initial_set("docks/filesystem/display_mode", 0); hints["docks/filesystem/display_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"); - set("docks/filesystem/always_show_folders", true); + _initial_set("docks/filesystem/always_show_folders", true); - set("editors/animation/autorename_animation_tracks", true); - set("editors/animation/confirm_insert_track", true); + _initial_set("editors/animation/autorename_animation_tracks", true); + _initial_set("editors/animation/confirm_insert_track", true); - set("docks/property_editor/texture_preview_width", 48); - set("docks/property_editor/auto_refresh_interval", 0.3); - set("text_editor/help/doc_path", ""); - set("text_editor/help/show_help_index", true); + _initial_set("docks/property_editor/texture_preview_width", 48); + _initial_set("docks/property_editor/auto_refresh_interval", 0.3); + _initial_set("text_editor/help/doc_path", ""); + _initial_set("text_editor/help/show_help_index", true); - set("filesystem/import/ask_save_before_reimport", false); + _initial_set("filesystem/import/ask_save_before_reimport", false); - set("filesystem/import/pvrtc_texture_tool", ""); + _initial_set("filesystem/import/pvrtc_texture_tool", ""); #ifdef WINDOWS_ENABLED hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, "*.exe"); #else hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, ""); #endif - set("filesystem/import/pvrtc_fast_conversion", false); + _initial_set("filesystem/import/pvrtc_fast_conversion", false); - set("run/auto_save/save_before_running", true); - set("run/output/always_clear_output_on_play", true); - set("run/output/always_open_output_on_play", true); - set("run/output/always_close_output_on_stop", false); - set("filesystem/resources/save_compressed_resources", true); - set("filesystem/resources/auto_reload_modified_images", true); + _initial_set("run/auto_save/save_before_running", true); + _initial_set("run/output/always_clear_output_on_play", true); + _initial_set("run/output/always_open_output_on_play", true); + _initial_set("run/output/always_close_output_on_stop", false); + _initial_set("filesystem/resources/save_compressed_resources", true); + _initial_set("filesystem/resources/auto_reload_modified_images", true); - set("filesystem/import/automatic_reimport_on_sources_changed", true); + _initial_set("filesystem/import/automatic_reimport_on_sources_changed", true); if (p_extra_config.is_valid()) { @@ -804,35 +811,35 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { } void EditorSettings::_load_default_text_editor_theme() { - set("text_editor/highlighting/background_color", Color::html("3b000000")); - set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); - set("text_editor/highlighting/completion_selected_color", Color::html("434244")); - set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); - set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); - set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); - set("text_editor/highlighting/caret_color", Color::html("aaaaaa")); - set("text_editor/highlighting/caret_background_color", Color::html("000000")); - set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); - set("text_editor/highlighting/text_color", Color::html("aaaaaa")); - set("text_editor/highlighting/text_selected_color", Color::html("000000")); - set("text_editor/highlighting/keyword_color", Color::html("ffffb3")); - set("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); - set("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); - set("text_editor/highlighting/function_color", Color::html("66a2ce")); - set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); - set("text_editor/highlighting/comment_color", Color::html("676767")); - set("text_editor/highlighting/string_color", Color::html("ef6ebe")); - set("text_editor/highlighting/number_color", Color::html("EB9532")); - set("text_editor/highlighting/symbol_color", Color::html("badfff")); - set("text_editor/highlighting/selection_color", Color::html("6ca9c2")); - set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); - set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); - set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); - set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); - set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); - set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); - set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); - set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); + _initial_set("text_editor/highlighting/background_color", Color::html("3b000000")); + _initial_set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); + _initial_set("text_editor/highlighting/completion_selected_color", Color::html("434244")); + _initial_set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); + _initial_set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); + _initial_set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/caret_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/caret_background_color", Color::html("000000")); + _initial_set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); + _initial_set("text_editor/highlighting/text_color", Color::html("aaaaaa")); + _initial_set("text_editor/highlighting/text_selected_color", Color::html("000000")); + _initial_set("text_editor/highlighting/keyword_color", Color::html("ffffb3")); + _initial_set("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); + _initial_set("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); + _initial_set("text_editor/highlighting/function_color", Color::html("66a2ce")); + _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); + _initial_set("text_editor/highlighting/comment_color", Color::html("676767")); + _initial_set("text_editor/highlighting/string_color", Color::html("ef6ebe")); + _initial_set("text_editor/highlighting/number_color", Color::html("EB9532")); + _initial_set("text_editor/highlighting/symbol_color", Color::html("badfff")); + _initial_set("text_editor/highlighting/selection_color", Color::html("6ca9c2")); + _initial_set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); + _initial_set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); + _initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); + _initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); + _initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); + _initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); + _initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); + _initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); } void EditorSettings::notify_changes() { @@ -1037,7 +1044,7 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) { String theme_name = p_file.substr(0, p_file.length() - 4).get_file(); if (p_file.get_base_dir() == get_settings_path() + "/text_editor_themes") { - set("text_editor/theme/color_theme", theme_name); + _initial_set("text_editor/theme/color_theme", theme_name); load_text_editor_theme(); } return true; @@ -1161,6 +1168,28 @@ void EditorSettings::set_project_metadata(const String &p_section, const String cf->save(path); } +bool EditorSettings::property_can_revert(const String &p_name) { + + if (!props.has(p_name)) + return false; + + return props[p_name].initial != props[p_name].variant; +} + +Variant EditorSettings::property_get_revert(const String &p_name) { + + if (!props.has(p_name)) + return Variant(); + + return props[p_name].initial; +} + +void EditorSettings::set_initial_value(const StringName &p_name, const Variant &p_value) { + + ERR_FAIL_COND(!props.has(p_name)); + props[p_name].initial = p_value; +} + void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("erase", "property"), &EditorSettings::erase); @@ -1175,6 +1204,11 @@ void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("set_recent_dirs", "dirs"), &EditorSettings::set_recent_dirs); ClassDB::bind_method(D_METHOD("get_recent_dirs"), &EditorSettings::get_recent_dirs); + ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &EditorSettings::property_can_revert); + ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &EditorSettings::property_get_revert); + + ClassDB::bind_method(D_METHOD("set_initial_value", "name", "value"), &EditorSettings::set_initial_value); + ADD_SIGNAL(MethodInfo("settings_changed")); } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 177ec4760d..6a814c41a5 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -65,6 +65,7 @@ private: struct VariantContainer { int order; Variant variant; + Variant initial; bool hide_from_editor; bool save; VariantContainer() { @@ -88,6 +89,8 @@ private: bool _get(const StringName &p_name, Variant &r_ret) const; void _get_property_list(List<PropertyInfo> *p_list) const; + void _initial_set(const StringName &p_name, const Variant &p_value); + static Ref<EditorSettings> singleton; String config_file_path; @@ -171,6 +174,11 @@ public: Variant get_project_metadata(const String &p_section, const String &p_key, Variant p_default); void set_project_metadata(const String &p_section, const String &p_key, Variant p_data); + bool property_can_revert(const String &p_name); + Variant property_get_revert(const String &p_name); + + void set_initial_value(const StringName &p_name, const Variant &p_value); + EditorSettings(); ~EditorSettings(); }; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 51fdef37cf..ca337551eb 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -802,7 +802,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_tooltip->set_bg_color(Color(mono_color.r, mono_color.g, mono_color.b, 0.9)); style_tooltip->set_border_width_all(border_width); style_tooltip->set_border_color_all(mono_color); - theme->set_color("font_color", "TooltipPanel", font_color); + theme->set_color("font_color", "TooltipLabel", font_color.inverted()); + theme->set_color("font_color_shadow", "TooltipLabel", mono_color.inverted() * Color(1, 1, 1, 0.1)); theme->set_stylebox("panel", "TooltipPanel", style_tooltip); // PopupPanel diff --git a/editor/icons/icon_status_error.svg b/editor/icons/icon_status_error.svg new file mode 100644 index 0000000000..4da9471835 --- /dev/null +++ b/editor/icons/icon_status_error.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm-2.8281 2.7578l2.8281 2.8281 2.8281-2.8281 1.4141 1.4141-2.8281 2.8281 2.8281 2.8281-1.4141 1.4141-2.8281-2.8281-2.8281 2.8281-1.4141-1.4141 2.8281-2.8281-2.8281-2.8281 1.4141-1.4141z" fill="#ff5d5d"/> +</g> +</g> +</svg> diff --git a/editor/icons/icon_status_success.svg b/editor/icons/icon_status_success.svg new file mode 100644 index 0000000000..6a6e2d6d30 --- /dev/null +++ b/editor/icons/icon_status_success.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7zm3.293 3.877 1.4141 1.4141-5.707 5.709-3.707-3.709 1.4141-1.4141 2.293 2.293z" fill="#45ff8b"/> +</g> +</g> +</svg> diff --git a/editor/icons/icon_status_warning.svg b/editor/icons/icon_status_warning.svg new file mode 100644 index 0000000000..f92021379d --- /dev/null +++ b/editor/icons/icon_status_warning.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7 -7 7 7 0 0 0 -7 -7zm-1 2h2v7h-2v-7zm0 8h2v2h-2v-2z" fill="#ffdd65"/> +</g> +</g> +</svg> diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index c591bc733b..d3a0685777 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3823,7 +3823,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_config_menu = memnew(MenuButton); hb->add_child(snap_config_menu); - snap_config_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); snap_config_menu->set_h_size_flags(SIZE_SHRINK_END); snap_config_menu->set_tooltip(TTR("Snapping options")); @@ -3877,7 +3876,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p = skeleton_menu->get_popup(); p->set_hide_on_checkable_item_selection(false); - p->connect("id_pressed", this, "_popup_callback"); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bones"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Bones")), SKELETON_CLEAR_BONES); p->add_separator(); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 328d07d7a8..2f2ed7bdf0 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -39,6 +39,14 @@ void TileMapEditor::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_PROCESS: { + + if (bucket_queue.size() && canvas_item_editor) { + canvas_item_editor->update(); + } + + } break; + case NOTIFICATION_ENTER_TREE: { transp->set_icon(get_icon("Transpose", "EditorIcons")); @@ -382,20 +390,26 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era bucket_cache = PoolVector<Vector2>(); bucket_cache_tile = prev_id; bucket_cache_rect = r; - } else { - return bucket_cache; + bucket_queue.clear(); } } PoolVector<Vector2> points; + int count = 0; + int limit = 0; - List<Point2i> queue; - queue.push_back(p_start); + if (preview) { + limit = 1024; + } else { + bucket_queue.clear(); + } - while (queue.size()) { + bucket_queue.push_back(p_start); - Point2i n = queue.front()->get(); - queue.pop_front(); + while (bucket_queue.size()) { + + Point2i n = bucket_queue.front()->get(); + bucket_queue.pop_front(); if (!r.has_point(n)) continue; @@ -413,10 +427,15 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era points.push_back(n); } - queue.push_back(n + Point2i(0, 1)); - queue.push_back(n + Point2i(0, -1)); - queue.push_back(n + Point2i(1, 0)); - queue.push_back(n + Point2i(-1, 0)); + bucket_queue.push_back(Point2i(n.x, n.y + 1)); + bucket_queue.push_back(Point2i(n.x, n.y - 1)); + bucket_queue.push_back(Point2i(n.x + 1, n.y)); + bucket_queue.push_back(Point2i(n.x - 1, n.y)); + count++; + } + + if (limit > 0 && count >= limit) { + break; } } @@ -1648,6 +1667,7 @@ TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) { tile_map_editor = memnew(TileMapEditor(p_node)); add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor); tile_map_editor->hide(); + tile_map_editor->set_process(true); } TileMapEditorPlugin::~TileMapEditorPlugin() { diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index de9b9e8e0d..c8f29dfb7b 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -113,6 +113,7 @@ class TileMapEditor : public VBoxContainer { Rect2i bucket_cache_rect; int bucket_cache_tile; PoolVector<Vector2> bucket_cache; + List<Point2i> bucket_queue; struct CellOp { int idx; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index f8f222ac2e..5ab0253d6d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -51,9 +51,9 @@ #include "version.h" #include "version_hash.gen.h" -class NewProjectDialog : public ConfirmationDialog { +class ProjectDialog : public ConfirmationDialog { - GDCLASS(NewProjectDialog, ConfirmationDialog); + GDCLASS(ProjectDialog, ConfirmationDialog); public: enum Mode { @@ -64,20 +64,56 @@ public: }; private: + enum MessageType { + MESSAGE_ERROR, + MESSAGE_WARNING, + MESSAGE_SUCCESS + }; + Mode mode; Button *browse; - Label *pp, *pn; - Label *error; + Button *create_dir; + Container *name_container; + Container *path_container; + Label *msg; LineEdit *project_path; LineEdit *project_name; + ToolButton *status_btn; FileDialog *fdialog; String zip_path; String zip_title; AcceptDialog *dialog_error; + String fav_dir; + + String created_folder_path; + + void set_message(const String &p_msg, MessageType p_type = MESSAGE_SUCCESS) { + msg->set_text(p_msg); + if (p_msg == "") { + status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons")); + return; + } + msg->hide(); + switch (p_type) { + case MESSAGE_ERROR: + msg->add_color_override("font_color", get_color("error_color", "Editor")); + status_btn->set_icon(get_icon("StatusError", "EditorIcons")); + msg->show(); + break; + case MESSAGE_WARNING: + msg->add_color_override("font_color", get_color("warning_color", "Editor")); + status_btn->set_icon(get_icon("StatusWarning", "EditorIcons")); + break; + case MESSAGE_SUCCESS: + msg->add_color_override("font_color", get_color("success_color", "Editor")); + status_btn->set_icon(get_icon("StatusSuccess", "EditorIcons")); + break; + } + } String _test_path() { - error->set_text(""); + set_message(" "); get_ok()->set_disabled(true); DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); String valid_path; @@ -88,7 +124,7 @@ private: } if (valid_path == "") { - error->set_text(TTR("Invalid project path, the path must exist!")); + set_message(TTR("The path does not exists."), MESSAGE_ERROR); memdelete(d); return ""; } @@ -97,16 +133,35 @@ private: if (valid_path != "" && !d->file_exists("project.godot")) { - error->set_text(TTR("Invalid project path, project.godot must exist.")); + set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR); memdelete(d); return ""; } + } else if (mode == MODE_NEW) { + + // check if the specified folder is empty, even though this is not an error, it is good to check here + d->list_dir_begin(); + bool is_empty = true; + String n = d->get_next(); + while (n != String()) { + if (!n.begins_with(".")) { // i dont know if this is enough to guarantee an empty dir + is_empty = false; + break; + } + n = d->get_next(); + } + d->list_dir_end(); + + if (!is_empty) { + set_message(TTR("Your project will be created in a non empty folder (you might want to create a new folder)."), MESSAGE_WARNING); + } + } else { if (d->file_exists("project.godot")) { - error->set_text(TTR("Invalid project path, project.godot must not exist.")); + set_message(TTR("Please choose a folder that does not contain a 'project.godot' file."), MESSAGE_ERROR); memdelete(d); return ""; } @@ -122,16 +177,23 @@ private: String sp = _test_path(); if (sp != "") { - sp = sp.replace("\\", "/"); - int lidx = sp.find_last("/"); + // set the project name to the select folder name + if (project_name->get_text() == "") { + sp = sp.replace("\\", "/"); + int lidx = sp.find_last("/"); - if (lidx != -1) { - sp = sp.substr(lidx + 1, sp.length()); + if (lidx != -1) { + sp = sp.substr(lidx + 1, sp.length()); + } + if (sp == "" && mode == MODE_IMPORT) + sp = TTR("Imported Project"); + + project_name->set_text(sp); } - if (sp == "" && mode == MODE_IMPORT) - sp = TTR("Imported Project"); + } - project_name->set_text(sp); + if (created_folder_path != "" && created_folder_path != p_path) { + _remove_created_folder(); } } @@ -140,13 +202,17 @@ private: String p = p_path; if (mode == MODE_IMPORT) { if (p.ends_with("project.godot")) { - p = p.get_base_dir(); + get_ok()->set_disabled(false); + } else { + set_message(TTR("Please choose a 'project.godot' file."), MESSAGE_ERROR); + get_ok()->set_disabled(true); + return; } } String sp = p.simplify_path(); project_path->set_text(sp); - _path_text_changed(sp); + set_message(TTR(" ")); // just so it does not disappear get_ok()->call_deferred("grab_focus"); } @@ -155,12 +221,13 @@ private: String p = p_path; String sp = p.simplify_path(); project_path->set_text(sp); - _path_text_changed(sp); get_ok()->call_deferred("grab_focus"); } void _browse_path() { + fdialog->set_current_dir(project_path->get_text()); + if (mode == MODE_IMPORT) { fdialog->set_mode(FileDialog::MODE_OPEN_FILE); @@ -172,34 +239,46 @@ private: fdialog->popup_centered_ratio(); } - void _text_changed(const String &p_text) { - _test_path(); - error->set_text(""); - if (p_text == "") { + void _create_folder() { - error->set_text(TTR("Name cannot be empty")); - get_ok()->set_disabled(true); + if (project_name->get_text() == "" || created_folder_path != "") { return; } - get_ok()->set_disabled(false); + + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + if (d->change_dir(project_path->get_text()) == OK) { + if (!d->dir_exists(project_name->get_text())) { + if (d->make_dir(project_name->get_text()) == OK) { + d->change_dir(project_name->get_text()); + project_path->set_text(d->get_current_dir()); + created_folder_path = d->get_current_dir(); + create_dir->set_disabled(true); + } + } + } + memdelete(d); } - void _name_changed(const String &p_text) { + void _text_changed(const String &p_text) { + + if (mode != MODE_NEW) + return; + + _test_path(); + + if (p_text == "") + set_message(TTR("It would be a good idea to name your project."), MESSAGE_WARNING); } void ok_pressed() { - String dir = _test_path(); - if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); - return; - } + String dir = project_path->get_text(); if (mode == MODE_RENAME) { String dir = _test_path(); if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); + set_message(TTR("Invalid project path (changed anything?)."), MESSAGE_ERROR); return; } @@ -207,13 +286,13 @@ private: current->add_singleton(ProjectSettings::Singleton("Current")); if (current->setup(dir, "")) { - error->set_text(TTR("Couldn't get project.godot in project path.")); + set_message(TTR("Couldn't get project.godot in project path."), MESSAGE_ERROR); } else { ProjectSettings::CustomMap edited_settings; edited_settings["application/config/name"] = project_name->get_text(); if (current->save_custom(dir.plus_file("/project.godot"), edited_settings, Vector<String>(), true)) { - error->set_text(TTR("Couldn't edit project.godot in project path.")); + set_message(TTR("Couldn't edit project.godot in project path."), MESSAGE_ERROR); } } @@ -232,13 +311,13 @@ private: initial_settings["rendering/environment/default_environment"] = "res://default_env.tres"; if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("/project.godot"), initial_settings, Vector<String>(), false)) { - error->set_text(TTR("Couldn't create project.godot in project path.")); + set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { ResourceSaver::save(dir.plus_file("/icon.png"), get_icon("DefaultProjectIcon", "EditorIcons")); FileAccess *f = FileAccess::open(dir.plus_file("/default_env.tres"), FileAccess::WRITE); if (!f) { - error->set_text(TTR("Couldn't create project.godot in project path.")); + set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]"); f->store_line("[sub_resource type=\"ProceduralSky\" id=1]"); @@ -356,14 +435,40 @@ private: } } + void _remove_created_folder() { + + if (created_folder_path != "") { + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + d->remove(created_folder_path); + memdelete(d); + + create_dir->set_disabled(false); + created_folder_path = ""; + } + } + + void _toggle_message() { + msg->set_visible(!msg->is_visible()); + } + + void cancel_pressed() { + + _remove_created_folder(); + + project_path->clear(); + project_name->clear(); + } + protected: static void _bind_methods() { - ClassDB::bind_method("_browse_path", &NewProjectDialog::_browse_path); - ClassDB::bind_method("_text_changed", &NewProjectDialog::_text_changed); - ClassDB::bind_method("_path_text_changed", &NewProjectDialog::_path_text_changed); - ClassDB::bind_method("_path_selected", &NewProjectDialog::_path_selected); - ClassDB::bind_method("_file_selected", &NewProjectDialog::_file_selected); + ClassDB::bind_method("_browse_path", &ProjectDialog::_browse_path); + ClassDB::bind_method("_create_folder", &ProjectDialog::_create_folder); + ClassDB::bind_method("_text_changed", &ProjectDialog::_text_changed); + ClassDB::bind_method("_path_text_changed", &ProjectDialog::_path_text_changed); + ClassDB::bind_method("_path_selected", &ProjectDialog::_path_selected); + ClassDB::bind_method("_file_selected", &ProjectDialog::_file_selected); + ClassDB::bind_method("_toggle_message", &ProjectDialog::_toggle_message); ADD_SIGNAL(MethodInfo("project_created")); ADD_SIGNAL(MethodInfo("project_renamed")); } @@ -390,129 +495,129 @@ public: if (mode == MODE_RENAME) { project_path->set_editable(false); - browse->set_disabled(true); + browse->hide(); set_title(TTR("Rename Project")); get_ok()->set_text(TTR("Rename")); - pp->set_text(TTR("Project Path:")); - pn->set_text(TTR("Project Name:")); - pn->show(); - project_name->show(); + name_container->show(); - String dir = _test_path(); - if (dir == "") { - error->set_text(TTR("Invalid project path (changed anything?).")); - return; - } ProjectSettings *current = memnew(ProjectSettings); current->add_singleton(ProjectSettings::Singleton("Current")); - if (current->setup(dir, "")) { - error->set_text(TTR("Couldn't get project.godot in project path.")); - } else { - if (current->has("application/config/name")) { - String appname = current->get("application/config/name"); - project_name->set_text(appname); - } + if (current->setup(project_path->get_text(), "")) { + set_message(TTR("Couldn't get project.godot in the project path."), MESSAGE_ERROR); + } else if (current->has("application/config/name")) { + project_name->set_text(current->get("application/config/name")); } - - popup_centered(Size2(500, 125) * EDSCALE); project_name->grab_focus(); + create_dir->hide(); + status_btn->hide(); + } else { - project_path->clear(); - project_name->clear(); + fav_dir = EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"); + if (fav_dir != "") { + project_path->set_text(fav_dir); + fdialog->set_current_dir(fav_dir); + } else { + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + project_path->set_text(d->get_current_dir()); + fdialog->set_current_dir(d->get_current_dir()); + memdelete(d); + } + project_name->set_text(TTR("New Game Project")); + project_path->set_editable(true); browse->set_disabled(false); + browse->show(); + create_dir->show(); + status_btn->show(); if (mode == MODE_IMPORT) { set_title(TTR("Import Existing Project")); get_ok()->set_text(TTR("Import")); - pp->set_text(TTR("Project Path (Must Exist):")); - pn->set_text(TTR("Project Name:")); - pn->hide(); - project_name->hide(); - - popup_centered(Size2(500, 125) * EDSCALE); + name_container->hide(); + project_path->grab_focus(); } else if (mode == MODE_NEW) { set_title(TTR("Create New Project")); get_ok()->set_text(TTR("Create")); - pp->set_text(TTR("Project Path:")); - pn->set_text(TTR("Project Name:")); - pn->show(); - project_name->show(); + name_container->show(); + project_name->grab_focus(); - popup_centered(Size2(500, 145) * EDSCALE); } else if (mode == MODE_INSTALL) { set_title(TTR("Install Project:") + " " + zip_title); get_ok()->set_text(TTR("Install")); - pp->set_text(TTR("Project Path:")); - pn->hide(); - project_name->hide(); - - popup_centered(Size2(500, 125) * EDSCALE); + name_container->hide(); + project_path->grab_focus(); } - project_path->grab_focus(); _test_path(); } + + popup_centered(Size2(500, 125) * EDSCALE); } - NewProjectDialog() { + ProjectDialog() { VBoxContainer *vb = memnew(VBoxContainer); add_child(vb); - //set_child_rect(vb); + + name_container = memnew(VBoxContainer); + vb->add_child(name_container); Label *l = memnew(Label); + l->set_text(TTR("Project Name:")); + name_container->add_child(l); + + HBoxContainer *pnhb = memnew(HBoxContainer); + name_container->add_child(pnhb); + + project_name = memnew(LineEdit); + project_name->set_h_size_flags(SIZE_EXPAND_FILL); + pnhb->add_child(project_name); + + create_dir = memnew(Button); + pnhb->add_child(create_dir); + create_dir->set_text(TTR("Create folder")); + create_dir->connect("pressed", this, "_create_folder"); + + path_container = memnew(VBoxContainer); + vb->add_child(path_container); + + l = memnew(Label); l->set_text(TTR("Project Path:")); - vb->add_child(l); - pp = l; + path_container->add_child(l); - project_path = memnew(LineEdit); - MarginContainer *mc = memnew(MarginContainer); - vb->add_child(mc); HBoxContainer *pphb = memnew(HBoxContainer); - mc->add_child(pphb); - pphb->add_child(project_path); + path_container->add_child(pphb); + + project_path = memnew(LineEdit); project_path->set_h_size_flags(SIZE_EXPAND_FILL); + pphb->add_child(project_path); + + // status button + status_btn = memnew(ToolButton); + status_btn->connect("pressed", this, "_toggle_message"); + pphb->add_child(status_btn); browse = memnew(Button); - pphb->add_child(browse); browse->set_text(TTR("Browse")); browse->connect("pressed", this, "_browse_path"); + pphb->add_child(browse); - l = memnew(Label); - l->set_text(TTR("Project Name:")); - l->set_position(Point2(5, 50)); - vb->add_child(l); - pn = l; - - project_name = memnew(LineEdit); - mc = memnew(MarginContainer); - vb->add_child(mc); - mc->add_child(project_name); - project_name->set_text(TTR("New Game Project")); - - l = memnew(Label); - l->set_text(TTR("That's a BINGO!")); - vb->add_child(l); - error = l; - l->add_color_override("font_color", Color(1, 0.4, 0.3, 0.8)); - l->set_align(Label::ALIGN_CENTER); - - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - project_path->set_text(d->get_current_dir()); - memdelete(d); + msg = memnew(Label); + msg->set_text(TTR("That's a BINGO!")); + msg->set_align(Label::ALIGN_CENTER); + msg->hide(); + vb->add_child(msg); fdialog = memnew(FileDialog); - add_child(fdialog); fdialog->set_access(FileDialog::ACCESS_FILESYSTEM); - fdialog->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path")); + add_child(fdialog); project_name->connect("text_changed", this, "_text_changed"); project_path->connect("text_changed", this, "_path_text_changed"); fdialog->connect("dir_selected", this, "_path_selected"); @@ -564,7 +669,7 @@ void ProjectManager::_panel_draw(Node *p_hb) { hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree")); if (selected_list.has(hb->get_meta("name"))) { - hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0))); + hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); } } @@ -1168,13 +1273,13 @@ void ProjectManager::_scan_projects() { void ProjectManager::_new_project() { - npdialog->set_mode(NewProjectDialog::MODE_NEW); + npdialog->set_mode(ProjectDialog::MODE_NEW); npdialog->show_dialog(); } void ProjectManager::_import_project() { - npdialog->set_mode(NewProjectDialog::MODE_IMPORT); + npdialog->set_mode(ProjectDialog::MODE_IMPORT); npdialog->show_dialog(); } @@ -1188,7 +1293,7 @@ void ProjectManager::_rename_project() { const String &selected = E->key(); String path = EditorSettings::get_singleton()->get("projects/" + selected); npdialog->set_project_path(path); - npdialog->set_mode(NewProjectDialog::MODE_RENAME); + npdialog->set_mode(ProjectDialog::MODE_RENAME); npdialog->show_dialog(); } } @@ -1224,7 +1329,7 @@ void ProjectManager::_exit_dialog() { void ProjectManager::_install_project(const String &p_zip_path, const String &p_title) { - npdialog->set_mode(NewProjectDialog::MODE_INSTALL); + npdialog->set_mode(ProjectDialog::MODE_INSTALL); npdialog->set_zip_path(p_zip_path); npdialog->set_zip_title(p_title); npdialog->show_dialog(); @@ -1511,7 +1616,7 @@ ProjectManager::ProjectManager() { OS::get_singleton()->set_low_processor_usage_mode(true); - npdialog = memnew(NewProjectDialog); + npdialog = memnew(ProjectDialog); gui_base->add_child(npdialog); npdialog->connect("project_renamed", this, "_on_project_renamed"); diff --git a/editor/project_manager.h b/editor/project_manager.h index 8a3e7c0457..bfae0b2297 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -37,7 +37,7 @@ #include "scene/gui/tool_button.h" #include "scene/gui/tree.h" -class NewProjectDialog; +class ProjectDialog; class ProjectListFilter; class ProjectManager : public Control { @@ -60,7 +60,7 @@ class ProjectManager : public Control { ConfirmationDialog *multi_scan_ask; AcceptDialog *run_error_diag; AcceptDialog *dialog_error; - NewProjectDialog *npdialog; + ProjectDialog *npdialog; ScrollContainer *scroll; VBoxContainer *scroll_childs; Map<String, String> selected_list; // name -> main_scene diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 19f674c395..81bd450484 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2958,7 +2958,7 @@ void PropertyEditor::update_tree() { item->set_metadata(1, p.name); if (draw_red) - item->set_custom_color(0, Color(0.8, 0.4, 0.20)); + item->set_custom_color(0, get_color("error_color", "Editor")); if (p.name == selected_property) { diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 76e75cff0a..d71bc1838b 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1065,7 +1065,7 @@ void ScriptEditorDebugger::start() { int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); if (server->listen(remote_port) != OK) { - EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **")); + EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), true); return; } set_process(true); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 05e3feedb5..7d7fb9fc21 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -334,6 +334,7 @@ EditorSettingsDialog::EditorSettingsDialog() { property_editor->get_property_editor()->set_use_filter(true); property_editor->register_search_box(search_box); property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); + property_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo()); vbc->add_child(property_editor); property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited"); diff --git a/misc/dist/ios_xcode/export_options.plist b/misc/dist/ios_xcode/export_options.plist new file mode 100644 index 0000000000..86d89a6e42 --- /dev/null +++ b/misc/dist/ios_xcode/export_options.plist @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>method</key> + <string>$export_method</string> + <key>teamID</key> + <string>$team_id</string> +</dict> +</plist>
\ No newline at end of file diff --git a/misc/dist/ios_xcode/godot_debug.iphone b/misc/dist/ios_xcode/godot.iphone.debug.arm index e69de29bb2..e69de29bb2 100755 --- a/misc/dist/ios_xcode/godot_debug.iphone +++ b/misc/dist/ios_xcode/godot.iphone.debug.arm diff --git a/misc/dist/ios_xcode/godot_opt.iphone b/misc/dist/ios_xcode/godot.iphone.debug.arm64 index e69de29bb2..e69de29bb2 100755 --- a/misc/dist/ios_xcode/godot_opt.iphone +++ b/misc/dist/ios_xcode/godot.iphone.debug.arm64 diff --git a/misc/dist/ios_xcode/godot.iphone.debug.fat b/misc/dist/ios_xcode/godot.iphone.debug.fat new file mode 100755 index 0000000000..e69de29bb2 --- /dev/null +++ b/misc/dist/ios_xcode/godot.iphone.debug.fat diff --git a/misc/dist/ios_xcode/godot.iphone.release.arm b/misc/dist/ios_xcode/godot.iphone.release.arm new file mode 100755 index 0000000000..e69de29bb2 --- /dev/null +++ b/misc/dist/ios_xcode/godot.iphone.release.arm diff --git a/misc/dist/ios_xcode/godot.iphone.release.arm64 b/misc/dist/ios_xcode/godot.iphone.release.arm64 new file mode 100755 index 0000000000..e69de29bb2 --- /dev/null +++ b/misc/dist/ios_xcode/godot.iphone.release.arm64 diff --git a/misc/dist/ios_xcode/godot.iphone.release.fat b/misc/dist/ios_xcode/godot.iphone.release.fat new file mode 100755 index 0000000000..e69de29bb2 --- /dev/null +++ b/misc/dist/ios_xcode/godot.iphone.release.fat diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj index bdba8488c8..3f2db94193 100644 --- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj @@ -7,18 +7,17 @@ objects = { /* Begin PBXBuildFile section */ - D07CD43F1C5D573600B7FB28 /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */; }; - D07CD4401C5D573600B7FB28 /* Default-667h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4341C5D573600B7FB28 /* Default-667h.png */; }; + 1F1575721F582BE20003B888 /* dylibs in Resources */ = {isa = PBXBuildFile; fileRef = 1F1575711F582BE20003B888 /* dylibs */; }; + 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1841F584E3F00A41E41 /* GameKit.framework */; }; + 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1861F584E5600A41E41 /* StoreKit.framework */; }; + D07CD43F1C5D573600B7FB28 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */; }; D07CD4411C5D573600B7FB28 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */; }; - D07CD4421C5D573600B7FB28 /* Default-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4361C5D573600B7FB28 /* Default-736h.png */; }; - D07CD4431C5D573600B7FB28 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */; }; - D07CD4441C5D573600B7FB28 /* Default-Landscape-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */; }; - D07CD4451C5D573600B7FB28 /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */; }; - D07CD4461C5D573600B7FB28 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */; }; - D07CD4471C5D573600B7FB28 /* Default-Portrait@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */; }; - D07CD4481C5D573600B7FB28 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */; }; - D07CD4491C5D573600B7FB28 /* Default@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */; }; - D07CD44A1C5D573600B7FB28 /* Default~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43E1C5D573600B7FB28 /* Default~iphone.png */; }; + D07CD4421C5D573600B7FB28 /* Default-Portrait-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */; }; + D07CD4441C5D573600B7FB28 /* Default-Landscape-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */; }; + D07CD4451C5D573600B7FB28 /* Default-Landscape@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */; }; + D07CD4461C5D573600B7FB28 /* Default-Landscape-1366h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */; }; + D07CD4471C5D573600B7FB28 /* Default-Portrait@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */; }; + D07CD4481C5D573600B7FB28 /* Default-Portrait-1366h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */; }; D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D07CD44D1C5D589C00B7FB28 /* Images.xcassets */; }; D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */; }; D0BCFE3A18AEBDA2004A7AAE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */; }; @@ -26,36 +25,36 @@ D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */; }; D0BCFE4018AEBDA2004A7AAE /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */; }; D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE4418AEBDA2004A7AAE /* InfoPlist.strings */; }; - D0BCFE7818AEBFEB004A7AAE /* data.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* data.pck */; }; - D0BCFE7A18AEC06A004A7AAE /* godot_opt.iphone in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */; }; + D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; }; + D0BCFE7A18AEC06A004A7AAE /* $binary.iphone in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7918AEC06A004A7AAE /* $binary.iphone */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; }; - D07CD4341C5D573600B7FB28 /* Default-667h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h.png"; sourceTree = "<group>"; }; + 1F1575711F582BE20003B888 /* dylibs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dylibs; path = dylibs; sourceTree = "<group>"; }; + 1FF4C1841F584E3F00A41E41 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; + 1FF4C1861F584E5600A41E41 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; + 1FF4C1881F584E6300A41E41 /* $binary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = $binary.entitlements; sourceTree = "<group>"; }; + D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; }; D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; }; - D07CD4361C5D573600B7FB28 /* Default-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h.png"; sourceTree = "<group>"; }; - D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; }; - D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h.png"; sourceTree = "<group>"; }; - D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; }; - D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; }; - D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x~ipad.png"; sourceTree = "<group>"; }; - D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; }; - D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x~iphone.png"; sourceTree = "<group>"; }; - D07CD43E1C5D573600B7FB28 /* Default~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default~iphone.png"; sourceTree = "<group>"; }; + D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait-736h@3x.png"; sourceTree = "<group>"; }; + D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h@3x.png"; sourceTree = "<group>"; }; + D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x.png"; sourceTree = "<group>"; }; + D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-1366h@2x.png"; sourceTree = "<group>"; }; + D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x.png"; sourceTree = "<group>"; }; + D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait-1366h@2x.png"; sourceTree = "<group>"; }; D07CD44D1C5D589C00B7FB28 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; - D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = godot_ios.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D0BCFE3418AEBDA2004A7AAE /* $binary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = $binary.app; sourceTree = BUILT_PRODUCTS_DIR; }; D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - D0BCFE4318AEBDA2004A7AAE /* godot_ios-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "godot_ios-Info.plist"; sourceTree = "<group>"; }; + D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "$binary-Info.plist"; sourceTree = "<group>"; }; D0BCFE4518AEBDA2004A7AAE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - D0BCFE4918AEBDA2004A7AAE /* godot_ios-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "godot_ios-Prefix.pch"; sourceTree = "<group>"; }; + D0BCFE4918AEBDA2004A7AAE /* $binary-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "$binary-Prefix.pch"; sourceTree = "<group>"; }; D0BCFE6118AEBDA3004A7AAE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - D0BCFE7718AEBFEB004A7AAE /* data.pck */ = {isa = PBXFileReference; lastKnownFileType = text; path = data.pck; sourceTree = "<group>"; }; - D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = godot_opt.iphone; sourceTree = "<group>"; }; + D0BCFE7718AEBFEB004A7AAE /* $binary.pck */ = {isa = PBXFileReference; lastKnownFileType = file; path = $binary.pck; sourceTree = "<group>"; }; + D0BCFE7918AEC06A004A7AAE /* $binary.iphone */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = $binary.iphone; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -64,8 +63,10 @@ buildActionMask = 2147483647; files = ( D0BCFE4018AEBDA2004A7AAE /* OpenGLES.framework in Frameworks */, + 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */, D0BCFE3A18AEBDA2004A7AAE /* CoreGraphics.framework in Frameworks */, D0BCFE3C18AEBDA2004A7AAE /* UIKit.framework in Frameworks */, + 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */, D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */, D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */, ); @@ -77,9 +78,10 @@ D0BCFE2B18AEBDA2004A7AAE = { isa = PBXGroup; children = ( - D0BCFE7918AEC06A004A7AAE /* godot_opt.iphone */, - D0BCFE7718AEBFEB004A7AAE /* data.pck */, - D0BCFE4118AEBDA2004A7AAE /* godot_ios */, + 1F1575711F582BE20003B888 /* dylibs */, + D0BCFE7918AEC06A004A7AAE /* $binary.iphone */, + D0BCFE7718AEBFEB004A7AAE /* $binary.pck */, + D0BCFE4118AEBDA2004A7AAE /* $binary */, D0BCFE3618AEBDA2004A7AAE /* Frameworks */, D0BCFE3518AEBDA2004A7AAE /* Products */, ); @@ -88,7 +90,7 @@ D0BCFE3518AEBDA2004A7AAE /* Products */ = { isa = PBXGroup; children = ( - D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */, + D0BCFE3418AEBDA2004A7AAE /* $binary.app */, ); name = Products; sourceTree = "<group>"; @@ -96,6 +98,8 @@ D0BCFE3618AEBDA2004A7AAE /* Frameworks */ = { isa = PBXGroup; children = ( + 1FF4C1861F584E5600A41E41 /* StoreKit.framework */, + 1FF4C1841F584E3F00A41E41 /* GameKit.framework */, D0BCFE3718AEBDA2004A7AAE /* Foundation.framework */, D0BCFE3918AEBDA2004A7AAE /* CoreGraphics.framework */, D0BCFE3B18AEBDA2004A7AAE /* UIKit.framework */, @@ -106,33 +110,30 @@ name = Frameworks; sourceTree = "<group>"; }; - D0BCFE4118AEBDA2004A7AAE /* godot_ios */ = { + D0BCFE4118AEBDA2004A7AAE /* $binary */ = { isa = PBXGroup; children = ( - D07CD4331C5D573600B7FB28 /* Default-568h@2x~iphone.png */, - D07CD4341C5D573600B7FB28 /* Default-667h.png */, + 1FF4C1881F584E6300A41E41 /* $binary.entitlements */, + D07CD4331C5D573600B7FB28 /* Default-568h@2x.png */, D07CD4351C5D573600B7FB28 /* Default-667h@2x.png */, - D07CD4361C5D573600B7FB28 /* Default-736h.png */, - D07CD4371C5D573600B7FB28 /* Default-736h@3x.png */, - D07CD4381C5D573600B7FB28 /* Default-Landscape-736h.png */, - D07CD4391C5D573600B7FB28 /* Default-Landscape@2x~ipad.png */, - D07CD43A1C5D573600B7FB28 /* Default-Landscape~ipad.png */, - D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x~ipad.png */, - D07CD43C1C5D573600B7FB28 /* Default-Portrait~ipad.png */, - D07CD43D1C5D573600B7FB28 /* Default@2x~iphone.png */, - D07CD43E1C5D573600B7FB28 /* Default~iphone.png */, + D07CD4361C5D573600B7FB28 /* Default-Portrait-736h@3x.png */, + D07CD4381C5D573600B7FB28 /* Default-Landscape-736h@3x.png */, + D07CD4391C5D573600B7FB28 /* Default-Landscape@2x.png */, + D07CD43A1C5D573600B7FB28 /* Default-Landscape-1366h@2x.png */, + D07CD43B1C5D573600B7FB28 /* Default-Portrait@2x.png */, + D07CD43C1C5D573600B7FB28 /* Default-Portrait-1366h@2x.png */, D07CD44D1C5D589C00B7FB28 /* Images.xcassets */, D0BCFE4218AEBDA2004A7AAE /* Supporting Files */, ); - path = godot_ios; + path = $binary; sourceTree = "<group>"; }; D0BCFE4218AEBDA2004A7AAE /* Supporting Files */ = { isa = PBXGroup; children = ( - D0BCFE4318AEBDA2004A7AAE /* godot_ios-Info.plist */, + D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */, D0BCFE4418AEBDA2004A7AAE /* InfoPlist.strings */, - D0BCFE4918AEBDA2004A7AAE /* godot_ios-Prefix.pch */, + D0BCFE4918AEBDA2004A7AAE /* $binary-Prefix.pch */, ); name = "Supporting Files"; sourceTree = "<group>"; @@ -140,9 +141,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - D0BCFE3318AEBDA2004A7AAE /* godot_ios */ = { + D0BCFE3318AEBDA2004A7AAE /* $binary */ = { isa = PBXNativeTarget; - buildConfigurationList = D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "godot_ios" */; + buildConfigurationList = D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "$binary" */; buildPhases = ( D0BCFE3018AEBDA2004A7AAE /* Sources */, D0BCFE3118AEBDA2004A7AAE /* Frameworks */, @@ -152,9 +153,9 @@ ); dependencies = ( ); - name = godot_ios; - productName = godot_ios; - productReference = D0BCFE3418AEBDA2004A7AAE /* godot_ios.app */; + name = "$binary"; + productName = "$name"; + productReference = D0BCFE3418AEBDA2004A7AAE /* $binary.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -165,8 +166,24 @@ attributes = { LastUpgradeCheck = 0500; ORGANIZATIONNAME = GodotEngine; + TargetAttributes = { + D0BCFE3318AEBDA2004A7AAE = { + DevelopmentTeam = $team_id; + SystemCapabilities = { + com.apple.GameCenter = { + enabled = 1; + }; + com.apple.InAppPurchase = { + enabled = 1; + }; + com.apple.Push = { + enabled = 1; + }; + }; + }; + }; }; - buildConfigurationList = D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "godot_ios" */; + buildConfigurationList = D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "$binary" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -179,7 +196,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - D0BCFE3318AEBDA2004A7AAE /* godot_ios */, + D0BCFE3318AEBDA2004A7AAE /* $binary */, ); }; /* End PBXProject section */ @@ -189,22 +206,19 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - D07CD4471C5D573600B7FB28 /* Default-Portrait@2x~ipad.png in Resources */, + 1F1575721F582BE20003B888 /* dylibs in Resources */, D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */, - D0BCFE7818AEBFEB004A7AAE /* data.pck in Resources */, - D07CD4461C5D573600B7FB28 /* Default-Landscape~ipad.png in Resources */, + D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */, + D07CD4471C5D573600B7FB28 /* Default-Portrait@2x.png in Resources */, + D07CD4461C5D573600B7FB28 /* Default-Landscape-1366h@2x.png in Resources */, D07CD4411C5D573600B7FB28 /* Default-667h@2x.png in Resources */, - D07CD4401C5D573600B7FB28 /* Default-667h.png in Resources */, - D07CD4431C5D573600B7FB28 /* Default-736h@3x.png in Resources */, - D07CD43F1C5D573600B7FB28 /* Default-568h@2x~iphone.png in Resources */, - D07CD4451C5D573600B7FB28 /* Default-Landscape@2x~ipad.png in Resources */, - D07CD44A1C5D573600B7FB28 /* Default~iphone.png in Resources */, - D07CD4491C5D573600B7FB28 /* Default@2x~iphone.png in Resources */, - D07CD4441C5D573600B7FB28 /* Default-Landscape-736h.png in Resources */, - D07CD4421C5D573600B7FB28 /* Default-736h.png in Resources */, + D07CD43F1C5D573600B7FB28 /* Default-568h@2x.png in Resources */, + D07CD4451C5D573600B7FB28 /* Default-Landscape@2x.png in Resources */, + D07CD4441C5D573600B7FB28 /* Default-Landscape-736h@3x.png in Resources */, + D07CD4421C5D573600B7FB28 /* Default-Portrait-736h@3x.png in Resources */, + D07CD4481C5D573600B7FB28 /* Default-Portrait-1366h@2x.png in Resources */, D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */, - D0BCFE7A18AEC06A004A7AAE /* godot_opt.iphone in Resources */, - D07CD4481C5D573600B7FB28 /* Default-Portrait~ipad.png in Resources */, + D0BCFE7A18AEC06A004A7AAE /* $binary.iphone in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -249,7 +263,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -265,7 +279,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -289,7 +303,8 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = "$code_sign_identity_release"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release"; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -299,7 +314,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -311,13 +326,22 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = $binary/$binary.entitlements; + CODE_SIGN_IDENTITY = "$code_sign_identity_debug"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_debug"; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + DEVELOPMENT_TEAM = $team_id; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "godot_ios/godot_ios-Prefix.pch"; - INFOPLIST_FILE = "godot_ios/godot_ios-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - PRODUCT_BUNDLE_IDENTIFIER = org.godotengine.game.ios; + GCC_PREFIX_HEADER = "$binary/$binary-Prefix.pch"; + INFOPLIST_FILE = "$binary/$binary-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/dylibs", + ); + PRODUCT_BUNDLE_IDENTIFIER = $identifier; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "$provisioning_profile_uuid_debug"; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 armv7s"; WRAPPER_EXTENSION = app; @@ -329,14 +353,22 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Distribution: Ariel Manzur (BYC57PA2Q5)"; + CODE_SIGN_ENTITLEMENTS = $binary/$binary.entitlements; + CODE_SIGN_IDENTITY = "$code_sign_identity_release"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "$code_sign_identity_release"; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + DEVELOPMENT_TEAM = $team_id; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "godot_ios/godot_ios-Prefix.pch"; - INFOPLIST_FILE = "godot_ios/godot_ios-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - PRODUCT_BUNDLE_IDENTIFIER = org.godotengine.game.ios; + GCC_PREFIX_HEADER = "$binary/$binary-Prefix.pch"; + INFOPLIST_FILE = "$binary/$binary-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/dylibs", + ); + PRODUCT_BUNDLE_IDENTIFIER = $identifier; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = "$provisioning_profile_uuid_release"; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 armv7s"; WRAPPER_EXTENSION = app; @@ -346,7 +378,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "godot_ios" */ = { + D0BCFE2F18AEBDA2004A7AAE /* Build configuration list for PBXProject "$binary" */ = { isa = XCConfigurationList; buildConfigurations = ( D0BCFE6F18AEBDA3004A7AAE /* Debug */, @@ -355,7 +387,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "godot_ios" */ = { + D0BCFE7118AEBDA3004A7AAE /* Build configuration list for PBXNativeTarget "$binary" */ = { isa = XCConfigurationList; buildConfigurations = ( D0BCFE7218AEBDA3004A7AAE /* Debug */, diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 3c9ba38bbe..c9c19829f4 100644 --- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ <Workspace version = "1.0"> <FileRef - location = "self:godot_ios.xcodeproj"> + location = "self:$binary.xcodeproj"> </FileRef> </Workspace> diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme b/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme new file mode 100644 index 0000000000..3f0df5c437 --- /dev/null +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0710" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A340BDFEBCA49239A941883D" + BuildableName = "$binary.app" + BlueprintName = "$binary" + ReferencedContainer = "container:$binary.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Development" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A340BDFEBCA49239A941883D" + BuildableName = "$binary.app" + BlueprintName = "$binary" + ReferencedContainer = "container:$binary.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + buildConfiguration = "Development" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A340BDFEBCA49239A941883D" + BuildableName = "$binary.app" + BlueprintName = "$binary" + ReferencedContainer = "container:$binary.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + <CommandLineArguments> + </CommandLineArguments> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + buildConfiguration = "Development" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A340BDFEBCA49239A941883D" + BuildableName = "$binary.app" + BlueprintName = "$binary" + ReferencedContainer = "container:$binary.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Development"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Development" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default-568h@2x.png Binary files differindex 1d5e472665..1d5e472665 100644 --- a/misc/dist/ios_xcode/godot_ios/Default-568h@2x~iphone.png +++ b/misc/dist/ios_xcode/godot_ios/Default-568h@2x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-667h.png b/misc/dist/ios_xcode/godot_ios/Default-667h.png Binary files differdeleted file mode 100644 index b13a399c83..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default-667h.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png b/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png Binary files differdeleted file mode 100644 index 33847ac136..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default-736h@3x.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png Binary files differnew file mode 100644 index 0000000000..ec5b4f7888 --- /dev/null +++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape-1366h@2x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h@3x.png Binary files differindex 2a025b745b..2a025b745b 100644 --- a/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h.png +++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape-736h@3x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x.png Binary files differindex 7099f3e18d..7099f3e18d 100644 --- a/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x~ipad.png +++ b/misc/dist/ios_xcode/godot_ios/Default-Landscape@2x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png Binary files differdeleted file mode 100644 index 4a761c339a..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default-Landscape~ipad.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png Binary files differnew file mode 100644 index 0000000000..a6d054ba2a --- /dev/null +++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait-1366h@2x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-736h.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait-736h@3x.png Binary files differindex 8c44edbccd..8c44edbccd 100644 --- a/misc/dist/ios_xcode/godot_ios/Default-736h.png +++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait-736h@3x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png Binary files differnew file mode 100644 index 0000000000..a6d054ba2a --- /dev/null +++ b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x.png diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png Binary files differdeleted file mode 100644 index b09cf21186..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default-Portrait@2x~ipad.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png b/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png Binary files differdeleted file mode 100644 index fa698eb70c..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default-Portrait~ipad.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png b/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png Binary files differdeleted file mode 100644 index ddf2861f4d..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default@2x~iphone.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Default~iphone.png b/misc/dist/ios_xcode/godot_ios/Default~iphone.png Binary files differdeleted file mode 100644 index c485a33b03..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Default~iphone.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a458b67873..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "1x", - "filename": "Icon-29.png", - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x", - "filename": "Icon-58.png", - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x", - "filename": "icon-87.png", - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x", - "filename": "Icon-80.png", - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x", - "filename": "Icon-120.png", - }, - { - "idiom" : "iphone", - "size" : "57x57", - "scale" : "1x", - "filename": "Icon-57.png", - }, - { - "idiom" : "iphone", - "size" : "57x57", - "scale" : "2x", - "filename": "Icon-114.png", - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x", - "filename": "Icon-120.png", - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x", - "filename": "Icon-180.png", - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x", - "filename": "Icon-29.png", - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x", - "filename": "Icon-58.png", - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x", - "filename": "Icon-40.png", - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x", - "filename": "Icon-80.png", - }, - { - "idiom" : "ipad", - "size" : "50x50", - "scale" : "1x", - "filename": "Icon-50.png", - }, - { - "idiom" : "ipad", - "size" : "50x50", - "scale" : "2x", - "filename": "Icon-100.png", - }, - { - "idiom" : "ipad", - "size" : "72x72", - "scale" : "1x", - "filename": "Icon-72.png", - }, - { - "idiom" : "ipad", - "size" : "72x72", - "scale" : "2x", - "filename": "Icon-144.png", - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x", - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x", - "filename": "Icon-152.png", - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x", - "filename": "icon-167.png", - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png Binary files differdeleted file mode 100644 index 165f4423b3..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png Binary files differdeleted file mode 100644 index 2e205e920c..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png Binary files differdeleted file mode 100644 index 6245f83f48..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png Binary files differdeleted file mode 100644 index 7b24e01bc6..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png Binary files differdeleted file mode 100644 index 344b470fa3..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png Binary files differdeleted file mode 100644 index 0dcebbc3f2..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png Binary files differdeleted file mode 100644 index 9ae94e9aaf..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png Binary files differdeleted file mode 100644 index 569f24df91..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png Binary files differdeleted file mode 100644 index 9e69ed3121..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png Binary files differdeleted file mode 100644 index b970fa3067..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png Binary files differdeleted file mode 100644 index 6097a6c73b..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png Binary files differdeleted file mode 100644 index 21b9622eb6..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png Binary files differdeleted file mode 100644 index 34dea8e6ad..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png Binary files differdeleted file mode 100644 index f72eb0b345..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png Binary files differdeleted file mode 100644 index 793c9b1f5f..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png Binary files differdeleted file mode 100644 index 7cd0e054ab..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png Binary files differdeleted file mode 100644 index e9b2429754..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png +++ /dev/null diff --git a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes b/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes deleted file mode 100644 index e328a62cb6..0000000000 --- a/misc/dist/ios_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes +++ /dev/null @@ -1,17 +0,0 @@ -100 -114 -120 -144 -152 -167 -180 -29 -40 -50 -57 -58 -60 -72 -76 -80 -87 diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist index f97b0fca36..1531a41bd0 100644 --- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist @@ -5,32 +5,33 @@ <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> - <string>Insert Name Here</string> + <string>$name</string> <key>CFBundleExecutable</key> - <string>godot_opt.iphone</string> + <string>$binary.iphone</string> <key>CFBundleIcons</key> <dict/> <key>CFBundleIcons~ipad</key> <dict/> <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <string>$identifier</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> + <string>$name</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>1.0</string> + <string>$short_version</string> <key>CFBundleSignature</key> - <string>????</string> + <string>$signature</string> <key>CFBundleVersion</key> - <string>1.0</string> + <string>$version</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> + <string>gamekit</string> </array> <key>UIRequiresFullScreen</key> <true/> diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements new file mode 100644 index 0000000000..903def2af5 --- /dev/null +++ b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>aps-environment</key> + <string>development</string> +</dict> +</plist> diff --git a/modules/enet/SCsub b/modules/enet/SCsub index 42a933a66d..4790c5099f 100644 --- a/modules/enet/SCsub +++ b/modules/enet/SCsub @@ -7,7 +7,7 @@ Import('env_modules') env_enet = env_modules.Clone() -if (env['builtin_enet'] != 'no'): +if env['builtin_enet']: thirdparty_dir = "#thirdparty/enet/" thirdparty_sources = [ "godot.cpp", diff --git a/modules/etc/config.py b/modules/etc/config.py index 4b0b01b78e..7dc2cb59c1 100644 --- a/modules/etc/config.py +++ b/modules/etc/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): - env["module_etc_enabled"] = "no" + if not env['tools']: + env['module_etc_enabled'] = False env.disabled_modules.append("etc") diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index f22df4407c..19e384af73 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -6,7 +6,7 @@ from compat import isbasestring # Not building in a separate env as scene needs it # Thirdparty source files -if (env['builtin_freetype'] != 'no'): +if env['builtin_freetype']: thirdparty_dir = "#thirdparty/freetype/" thirdparty_sources = [ "src/autofit/autofit.c", @@ -65,7 +65,7 @@ if (env['builtin_freetype'] != 'no'): env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"]) # also requires libpng headers - if (env['builtin_libpng'] != 'no'): + if env['builtin_libpng']: env.Append(CPPPATH=["#thirdparty/libpng"]) lib = env.Library("freetype_builtin", thirdparty_sources) diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index f386f2b542..39f5ec5378 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -11,7 +11,7 @@ gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp") gdn_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) gdn_env.Append(CPPPATH=['#modules/gdnative/include/']) -if "platform" in env and env["platform"] == "x11": # there has to be a better solution? +if "platform" in env and env["platform"] in ["x11", "iphone"]: env.Append(LINKFLAGS=["-rdynamic"]) env.use_ptrcall = True diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 93a9bac11c..11856e4ffb 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -234,8 +234,11 @@ bool GDNative::initialize() { ERR_PRINT("No library set for this platform"); return false; } - +#ifdef IPHONE_ENABLED + String path = lib_path.replace("res://", "dylibs/"); +#else String path = ProjectSettings::get_singleton()->globalize_path(lib_path); +#endif Error err = OS::get_singleton()->open_dynamic_library(path, native_handle); if (err != OK) { return false; diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 18d51daeb3..19dd030637 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -49,8 +49,8 @@ extern "C" { #elif defined(__APPLE__) #include "TargetConditionals.h" #if TARGET_OS_IPHONE -#define GDCALLINGCONV -#define GDAPI +#define GDCALLINGCONV __attribute__((visibility("default"))) +#define GDAPI GDCALLINGCONV #elif TARGET_OS_MAC #define GDCALLINGCONV __attribute__((sysv_abi)) #define GDAPI GDCALLINGCONV diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 96f213ead7..5095b7a83e 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -51,8 +51,8 @@ extern "C" { #elif defined(__APPLE__) #include "TargetConditionals.h" #if TARGET_OS_IPHONE -#define GDCALLINGCONV -#define GDAPI +#define GDCALLINGCONV __attribute__((visibility("default"))) +#define GDAPI GDCALLINGCONV #elif TARGET_OS_MAC #define GDCALLINGCONV __attribute__((sysv_abi)) #define GDAPI GDCALLINGCONV diff --git a/modules/gdnative/nativescript/SCsub b/modules/gdnative/nativescript/SCsub index e980e40e8e..178afec64a 100644 --- a/modules/gdnative/nativescript/SCsub +++ b/modules/gdnative/nativescript/SCsub @@ -7,4 +7,7 @@ mod_env.add_source_files(env.modules_sources, "*.cpp") mod_env.Append(CPPPATH='#modules/gdnative') mod_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) +if "platform" in env and env["platform"] in ["x11", "iphone"]: + env.Append(LINKFLAGS=["-rdynamic"]) + Export('mod_env') diff --git a/modules/ogg/SCsub b/modules/ogg/SCsub index 5eabaf6f2b..5e559bd4db 100644 --- a/modules/ogg/SCsub +++ b/modules/ogg/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_ogg = env_modules.Clone() # Thirdparty source files -if (env['builtin_libogg'] != 'no'): +if env['builtin_libogg']: thirdparty_dir = "#thirdparty/libogg/" thirdparty_sources = [ "bitwise.c", diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub index eb3c0e64d8..84c5e68439 100644 --- a/modules/openssl/SCsub +++ b/modules/openssl/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_openssl = env_modules.Clone() # Thirdparty source files -if (env['builtin_openssl'] != 'no'): +if env['builtin_openssl']: thirdparty_dir = "#thirdparty/openssl/" thirdparty_sources = [ diff --git a/modules/opus/SCsub b/modules/opus/SCsub index 4d3053c7ec..fee06bd267 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_opus = env_modules.Clone() # Thirdparty source files -if (env['builtin_opus'] != 'no'): +if env['builtin_opus']: thirdparty_dir = "#thirdparty/opus/" thirdparty_sources = [ @@ -209,7 +209,7 @@ if (env['builtin_opus'] != 'no'): env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) # also requires libogg - if (env['builtin_libogg'] != 'no'): + if env['builtin_libogg']: env_opus.Append(CPPPATH=["#thirdparty/libogg"]) # Module files diff --git a/modules/recast/SCsub b/modules/recast/SCsub index 349bd22efb..500c0ec055 100644 --- a/modules/recast/SCsub +++ b/modules/recast/SCsub @@ -5,7 +5,7 @@ Import('env') # Not building in a separate env as core needs it # Thirdparty source files -if (env['builtin_recast'] != 'no'): +if env['builtin_recast']: thirdparty_dir = "#thirdparty/recastnavigation/Recast/" thirdparty_sources = [ "Source/Recast.cpp", @@ -24,10 +24,6 @@ if (env['builtin_recast'] != 'no'): env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"]) - # also requires recast headers - if (env['builtin_recast'] != 'no'): - env.Append(CPPPATH=["#thirdparty/recastnavigation/Recast"]) - lib = env.Library("recast_builtin", thirdparty_sources) env.Append(LIBS=[lib]) diff --git a/modules/regex/SCsub b/modules/regex/SCsub index 2dfc2739e9..2bab144a28 100644 --- a/modules/regex/SCsub +++ b/modules/regex/SCsub @@ -7,7 +7,7 @@ env_regex = env_modules.Clone() env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"]) env_regex.add_source_files(env.modules_sources, "*.cpp") -if (env['builtin_pcre2'] != 'no'): +if env['builtin_pcre2']: jit_blacklist = ['javascript'] thirdparty_dir = '#thirdparty/pcre2/src/' thirdparty_flags = ['-DPCRE2_STATIC', '-DHAVE_CONFIG_H'] diff --git a/modules/squish/SCsub b/modules/squish/SCsub index cca7c038f1..127f22d798 100644 --- a/modules/squish/SCsub +++ b/modules/squish/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_squish = env_modules.Clone() # Thirdparty source files -if (env['builtin_squish'] != 'no'): +if env['builtin_squish']: thirdparty_dir = "#thirdparty/squish/" thirdparty_sources = [ "alpha.cpp", diff --git a/modules/squish/config.py b/modules/squish/config.py index cc8f098010..9b7729bda4 100644 --- a/modules/squish/config.py +++ b/modules/squish/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): - env["module_squish_enabled"] = "no" + if not env['tools']: + env['module_squish_enabled'] = False env.disabled_modules.append("squish") diff --git a/modules/theora/SCsub b/modules/theora/SCsub index 2de4d29640..9015c2c354 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_theora = env_modules.Clone() # Thirdparty source files -if (env['builtin_libtheora'] != 'no'): +if env['builtin_libtheora']: thirdparty_dir = "#thirdparty/libtheora/" thirdparty_sources = [ #"analyze.c", @@ -74,9 +74,9 @@ if (env['builtin_libtheora'] != 'no'): env_theora.Append(CPPPATH=[thirdparty_dir]) # also requires libogg and libvorbis - if (env['builtin_libogg'] != 'no'): + if env['builtin_libogg']: env_theora.Append(CPPPATH=["#thirdparty/libogg"]) - if (env['builtin_libvorbis'] != 'no'): + if env['builtin_libvorbis']: env_theora.Append(CPPPATH=["#thirdparty/libvorbis"]) # Godot source files diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py index 2e4b96a6b0..3e16fd725e 100644 --- a/modules/tinyexr/config.py +++ b/modules/tinyexr/config.py @@ -6,6 +6,6 @@ def can_build(platform): def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that - if (env["tools"] == "no"): - env["module_tinyexr_enabled"] = "no" + if not env['tools']: + env['module_tinyexr_enabled'] = False env.disabled_modules.append("tinyexr") diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index f02e797fe6..c17265d275 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -42,7 +42,7 @@ int VisualScriptFunctionCall::get_output_sequence_port_count() const { - if (method_cache.flags & METHOD_FLAG_CONST || call_mode == CALL_MODE_BASIC_TYPE) + if (method_cache.flags & METHOD_FLAG_CONST || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function))) return 0; else return 1; @@ -50,7 +50,7 @@ int VisualScriptFunctionCall::get_output_sequence_port_count() const { bool VisualScriptFunctionCall::has_input_sequence_port() const { - if (method_cache.flags & METHOD_FLAG_CONST || call_mode == CALL_MODE_BASIC_TYPE) + if (method_cache.flags & METHOD_FLAG_CONST || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function))) return false; else return true; diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub index d3e4f7e15a..9d2d0feb92 100644 --- a/modules/vorbis/SCsub +++ b/modules/vorbis/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_vorbis = env_modules.Clone() # Thirdparty source files -if (env['builtin_libvorbis'] != 'no'): +if env['builtin_libvorbis']: thirdparty_dir = "#thirdparty/libvorbis/" thirdparty_sources = [ #"analysis.c", @@ -42,7 +42,7 @@ if (env['builtin_libvorbis'] != 'no'): env_vorbis.Append(CPPPATH=[thirdparty_dir]) # also requires libogg - if (env['builtin_libogg'] != 'no'): + if env['builtin_libogg']: env_vorbis.Append(CPPPATH=["#thirdparty/libogg"]) # Godot source files diff --git a/modules/webm/SCsub b/modules/webm/SCsub index 889f5e83aa..2f1a28a54c 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -19,14 +19,14 @@ env_webm.add_source_files(env.modules_sources, thirdparty_libsimplewebm_sources) env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"]) # also requires libogg, libvorbis and libopus -if (env['builtin_libogg'] != 'no'): +if env['builtin_libogg']: env_webm.Append(CPPPATH=["#thirdparty/libogg"]) -if (env['builtin_libvorbis'] != 'no'): +if env['builtin_libvorbis']: env_webm.Append(CPPPATH=["#thirdparty/libvorbis"]) -if (env['builtin_opus'] != 'no'): +if env['builtin_opus']: env_webm.Append(CPPPATH=["#thirdparty/opus"]) -if (env['builtin_libvpx'] != 'no'): +if env['builtin_libvpx']: Export('env_webm') SConscript("libvpx/SCsub") diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 0ee2ed45b8..fd8d762a5e 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -265,7 +265,7 @@ if env["platform"] == 'uwp': else: import platform is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and platform.machine().startswith('arm')) - is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"] == "yes") + is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"]) is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86') if is_android_x86: cpu_bits = '32' diff --git a/modules/webp/SCsub b/modules/webp/SCsub index aa3486a2c5..f9295fed47 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_webp = env_modules.Clone() # Thirdparty source files -if (env['builtin_libwebp'] != 'no'): +if env['builtin_libwebp']: thirdparty_dir = "#thirdparty/libwebp/" thirdparty_sources = [ "dec/alpha_dec.c", diff --git a/platform/android/detect.py b/platform/android/detect.py index c1ac54c587..13fc4ee810 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -18,20 +18,21 @@ def can_build(): def get_opts(): + from SCons.Variables import BoolVariable, EnumVariable return [ ('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)), ('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"), - ('android_arch', 'Target architecture (armv7/armv6/arm64v8/x86)', "armv7"), - ('android_neon', 'Enable NEON support (armv7 only)', "yes"), - ('android_stl', 'Enable Android STL support (for modules)', "no") + EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')), + BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True), + BoolVariable('android_stl', 'Enable Android STL support (for modules)', False), ] def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ] @@ -93,7 +94,7 @@ def configure(env): env['android_arch'] = 'armv7' neon_text = "" - if env["android_arch"] == "armv7" and env['android_neon'] == 'yes': + if env["android_arch"] == "armv7" and env['android_neon']: neon_text = " (with NEON)" print("Building for Android (" + env['android_arch'] + ")" + neon_text) @@ -117,7 +118,7 @@ def configure(env): target_subpath = "arm-linux-androideabi-4.9" abi_subpath = "arm-linux-androideabi" arch_subpath = "armeabi-v7a" - if env['android_neon'] == 'yes': + if env['android_neon']: env.extra_suffix = ".armv7.neon" + env.extra_suffix else: env.extra_suffix = ".armv7" + env.extra_suffix @@ -199,7 +200,7 @@ def configure(env): elif env["android_arch"] == "armv7": target_opts = ['-target', 'armv7-none-linux-androideabi'] env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split()) - if env['android_neon'] == 'yes': + if env['android_neon']: env['neon_enabled'] = True env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__']) else: @@ -213,7 +214,7 @@ def configure(env): env.Append(CPPFLAGS=target_opts) env.Append(CPPFLAGS=common_opts) - if (env['android_stl'] == 'yes'): + if env['android_stl']: env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/include"]) env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath + "/include"]) env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/" + arch_subpath]) @@ -243,7 +244,7 @@ def configure(env): env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) env.opus_fixed_point = "yes" diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index 61ee32d2dd..50f9783dd2 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -19,9 +19,10 @@ def can_build(): def get_opts(): + from SCons.Variables import EnumVariable return [ - ('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes') + EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')), ] diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 0b81422fa3..dd4db0b1cd 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -20,24 +20,24 @@ def can_build(): def get_opts(): - + from SCons.Variables import BoolVariable return [ ('IPHONEPLATFORM', 'Name of the iPhone platform', 'iPhoneOS'), ('IPHONEPATH', 'Path to iPhone toolchain', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'), ('IPHONESDK', 'Path to the iPhone SDK', '/Applications/Xcode.app/Contents/Developer/Platforms/${IPHONEPLATFORM}.platform/Developer/SDKs/${IPHONEPLATFORM}.sdk/'), - ('game_center', 'Support for game center', 'yes'), - ('store_kit', 'Support for in-app store', 'yes'), - ('icloud', 'Support for iCloud', 'yes'), - ('ios_exceptions', 'Enable exceptions', 'no'), + BoolVariable('game_center', 'Support for game center', True), + BoolVariable('store_kit', 'Support for in-app store', True), + BoolVariable('icloud', 'Support for iCloud', True), + BoolVariable('ios_exceptions', 'Enable exceptions', False), ('ios_triple', 'Triple for ios toolchain', ''), - ('ios_sim', 'Build simulator binary', 'no'), + BoolVariable('ios_sim', 'Build simulator binary', False), ] def get_flags(): return [ - ('tools', 'no'), + ('tools', False), ] @@ -58,7 +58,7 @@ def configure(env): ## Architecture - if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator + if env["ios_sim"] or env["arch"] == "x86": # i386, simulator env["arch"] = "x86" env["bits"] = "32" elif (env["arch"] == "arm" or env["arch"] == "arm32" or env["arch"] == "armv7" or env["bits"] == "32"): # arm @@ -91,7 +91,7 @@ def configure(env): env.Append(CPPFLAGS=['-DNEED_LONG_INT']) env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON']) - if env['ios_exceptions'] == 'yes': + if env['ios_exceptions']: env.Append(CPPFLAGS=['-fexceptions']) else: env.Append(CPPFLAGS=['-fno-exceptions']) @@ -129,15 +129,15 @@ def configure(env): ]) # Feature options - if env['game_center'] == 'yes': + if env['game_center']: env.Append(CPPFLAGS=['-DGAME_CENTER_ENABLED']) env.Append(LINKFLAGS=['-framework', 'GameKit']) - if env['store_kit'] == 'yes': + if env['store_kit']: env.Append(CPPFLAGS=['-DSTOREKIT_ENABLED']) env.Append(LINKFLAGS=['-framework', 'StoreKit']) - if env['icloud'] == 'yes': + if env['icloud']: env.Append(CPPFLAGS=['-DICLOUD_ENABLED']) env.Append(CPPPATH=['$IPHONESDK/usr/include', @@ -151,7 +151,7 @@ def configure(env): env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: env.opus_fixed_point = "yes" if (env["arch"] == "arm"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 8bb7f23ead..c91781ce1d 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -52,7 +52,14 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Ref<ImageTexture> logo; - void _fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary); + typedef Error (*FileHandler)(String p_file, void *p_userdata); + static Error _walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata); + static Error _codesign(String p_file, void *p_userdata); + + void _fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary, bool p_debug); + static Error _export_dylibs(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total); + Error _export_loading_screens(const Ref<EditorExportPreset> &p_preset, const String &p_dest_dir); + Error _export_icons(const Ref<EditorExportPreset> &p_preset, const String &p_iconset_dir); protected: virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features); @@ -63,7 +70,7 @@ public: virtual String get_os_name() const { return "iOS"; } virtual Ref<Texture> get_logo() const { return logo; } - virtual String get_binary_extension() const { return "xcodeproj"; } + virtual String get_binary_extension() const { return "ipa"; } virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0); virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const; @@ -96,16 +103,44 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/app_store_team_id"), "")); + + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/provisioning_profile_uuid_debug"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/code_sign_identity_debug"), "iPhone Developer")); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_method_debug", PROPERTY_HINT_ENUM, "App Store,Development,Ad-Hoc,Enterprise"), 1)); + + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/provisioning_profile_uuid_release"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/code_sign_identity_release"), "iPhone Distribution")); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_method_release", PROPERTY_HINT_ENUM, "App Store,Development,Ad-Hoc,Enterprise"), 0)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine")); - // r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "png"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier"), "org.godotengine.iosgame")); - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "godotiosgame")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "????")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits"), 1)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "required_icons/iphone_120x120", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPhone/iPod Touch with retina display + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "required_icons/ipad_76x76", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad + + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/iphone_180x180", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPhone with retina HD display + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/ipad_152x152", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad with retina display + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/ipad_167x167", PROPERTY_HINT_FILE, "png"), "")); // Home screen on iPad Pro + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_40x40", PROPERTY_HINT_FILE, "png"), "")); // Spotlight + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_80x80", PROPERTY_HINT_FILE, "png"), "")); // Spotlight on devices with retina display + + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/iphone_2208x1242", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6 Plus, 6s Plus, 7 Plus + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/ipad_2732x2048", PROPERTY_HINT_FILE, "png"), "")); // 12.9-inch iPad Pro + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "landscape_launch_screens/ipad_2048x1536", PROPERTY_HINT_FILE, "png"), "")); // Other iPads + + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_640x1136", PROPERTY_HINT_FILE, "png"), "")); // iPhone 5, 5s, SE + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_750x1334", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6, 6s, 7 + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/iphone_1242x2208", PROPERTY_HINT_FILE, "png"), "")); // iPhone 6 Plus, 6s Plus, 7 Plus + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/ipad_2048x2732", PROPERTY_HINT_FILE, "png"), "")); // 12.9-inch iPad Pro + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "portrait_launch_screens/ipad_1536x2048", PROPERTY_HINT_FILE, "png"), "")); // Other iPads + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true)); @@ -113,11 +148,17 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) /* probably need some more info */ } -void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary) { - +void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &pfile, const String &p_name, const String &p_binary, bool p_debug) { + static const String export_method_string[] = { + "app-store", + "development", + "ad-hoc", + "enterprise" + }; String str; String strnew; str.parse_utf8((const char *)pfile.ptr(), pfile.size()); + print_line(str); Vector<String> lines = str.split("\n"); for (int i = 0; i < lines.size(); i++) { if (lines[i].find("$binary") != -1) { @@ -136,6 +177,19 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_ strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n"; } else if (lines[i].find("$copyright") != -1) { strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n"; + } else if (lines[i].find("$team_id") != -1) { + strnew += lines[i].replace("$team_id", p_preset->get("application/app_store_team_id")) + "\n"; + } else if (lines[i].find("$export_method") != -1) { + int export_method = p_preset->get(p_debug ? "application/export_method_debug" : "application/export_method_release"); + strnew += lines[i].replace("$export_method", export_method_string[export_method]) + "\n"; + } else if (lines[i].find("$provisioning_profile_uuid_release") != -1) { + strnew += lines[i].replace("$provisioning_profile_uuid_release", p_preset->get("application/provisioning_profile_uuid_release")) + "\n"; + } else if (lines[i].find("$provisioning_profile_uuid_debug") != -1) { + strnew += lines[i].replace("$provisioning_profile_uuid_debug", p_preset->get("application/provisioning_profile_uuid_debug")) + "\n"; + } else if (lines[i].find("$code_sign_identity_debug") != -1) { + strnew += lines[i].replace("$code_sign_identity_debug", p_preset->get("application/code_sign_identity_debug")) + "\n"; + } else if (lines[i].find("$code_sign_identity_release") != -1) { + strnew += lines[i].replace("$code_sign_identity_release", p_preset->get("application/code_sign_identity_release")) + "\n"; } else { strnew += lines[i] + "\n"; } @@ -150,12 +204,214 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_ } } +Error EditorExportPlatformIOS::_export_dylibs(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { + if (!p_path.ends_with(".dylib")) return OK; + const String &dest_dir = *(String *)p_userdata; + String rel_path = p_path.replace_first("res://", "dylibs/"); + DirAccess *dest_dir_access = DirAccess::open(dest_dir); + ERR_FAIL_COND_V(!dest_dir_access, ERR_CANT_OPEN); + + String base_dir = rel_path.get_base_dir(); + Error make_dir_err = OK; + if (!dest_dir_access->dir_exists(base_dir)) { + make_dir_err = dest_dir_access->make_dir_recursive(base_dir); + } + if (make_dir_err != OK) { + memdelete(dest_dir_access); + return make_dir_err; + } + + Error copy_err = dest_dir_access->copy(p_path, dest_dir + rel_path); + memdelete(dest_dir_access); + + return copy_err; +} + +struct IconInfo { + const char *preset_key; + const char *idiom; + const char *export_name; + const char *actual_size_side; + const char *scale; + const char *unscaled_size; + bool is_required; +}; + +static const IconInfo icon_infos[] = { + { "required_icons/iphone_120x120", "iphone", "Icon-120.png", "120", "2x", "60x60", true }, + { "required_icons/iphone_120x120", "iphone", "Icon-120.png", "120", "3x", "40x40", true }, + + { "required_icons/ipad_76x76", "ipad", "Icon-76.png", "76", "1x", "76x76", false }, + + { "optional_icons/iphone_180x180", "iphone", "Icon-180.png", "180", "3x", "60x60", false }, + + { "optional_icons/ipad_152x152", "ipad", "Icon-152.png", "152", "2x", "76x76", false }, + + { "optional_icons/ipad_167x167", "ipad", "Icon-167.png", "167", "2x", "83.5x83.5", false }, + + { "optional_icons/spotlight_40x40", "ipad", "Icon-40.png", "40", "1x", "40x40", false }, + + { "optional_icons/spotlight_80x80", "iphone", "Icon-80.png", "80", "2x", "40x40", false }, + { "optional_icons/spotlight_80x80", "ipad", "Icon-80.png", "80", "2x", "40x40", false } + +}; + +Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_preset, const String &p_iconset_dir) { + String json_description = "{\"images\":["; + String sizes; + + DirAccess *da = DirAccess::open(p_iconset_dir); + ERR_FAIL_COND_V(!da, ERR_CANT_OPEN); + + for (int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) { + IconInfo info = icon_infos[i]; + String icon_path = p_preset->get(info.preset_key); + if (icon_path.length() == 0) { + if (info.is_required) { + ERR_PRINT("Required icon is not specified in the preset"); + return ERR_UNCONFIGURED; + } + continue; + } + Error err = da->copy(icon_path, p_iconset_dir + info.export_name); + if (err) { + memdelete(da); + String err_str = String("Failed to export icon: ") + icon_path; + ERR_PRINT(err_str.utf8().get_data()); + return err; + } + sizes += String(info.actual_size_side) + "\n"; + if (i > 0) { + json_description += ","; + } + json_description += String("{"); + json_description += String("\"idiom\":") + "\"" + info.idiom + "\","; + json_description += String("\"size\":") + "\"" + info.unscaled_size + "\","; + json_description += String("\"scale\":") + "\"" + info.scale + "\","; + json_description += String("\"filename\":") + "\"" + info.export_name + "\""; + json_description += String("}"); + } + json_description += "]}"; + memdelete(da); + + FileAccess *json_file = FileAccess::open(p_iconset_dir + "Contents.json", FileAccess::WRITE); + ERR_FAIL_COND_V(!json_file, ERR_CANT_CREATE); + CharString json_utf8 = json_description.utf8(); + json_file->store_buffer((const uint8_t *)json_utf8.get_data(), json_utf8.length()); + memdelete(json_file); + + FileAccess *sizes_file = FileAccess::open(p_iconset_dir + "sizes", FileAccess::WRITE); + ERR_FAIL_COND_V(!sizes_file, ERR_CANT_CREATE); + CharString sizes_utf8 = sizes.utf8(); + sizes_file->store_buffer((const uint8_t *)sizes_utf8.get_data(), sizes_utf8.length()); + memdelete(sizes_file); + + return OK; +} + +struct LoadingScreenInfo { + const char *preset_key; + const char *export_name; +}; + +static const LoadingScreenInfo loading_screen_infos[] = { + { "landscape_launch_screens/iphone_2208x1242", "Default-Landscape-736h@3x.png" }, + { "landscape_launch_screens/ipad_2732x2048", "Default-Landscape-1366h@2x.png" }, + { "landscape_launch_screens/ipad_2048x1536", "Default-Landscape@2x.png" }, + + { "portrait_launch_screens/iphone_640x1136", "Default-568h@2x.png" }, + { "portrait_launch_screens/iphone_750x1334", "Default-667h@2x.png" }, + { "portrait_launch_screens/iphone_1242x2208", "Default-Portrait-736h@3x.png" }, + { "portrait_launch_screens/ipad_2048x2732", "Default-Portrait-1366h@2x.png" }, + { "portrait_launch_screens/ipad_1536x2048", "Default-Portrait@2x.png" } +}; + +Error EditorExportPlatformIOS::_export_loading_screens(const Ref<EditorExportPreset> &p_preset, const String &p_dest_dir) { + DirAccess *da = DirAccess::open(p_dest_dir); + ERR_FAIL_COND_V(!da, ERR_CANT_OPEN); + + for (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) { + LoadingScreenInfo info = loading_screen_infos[i]; + String loading_screen_file = p_preset->get(info.preset_key); + Error err = da->copy(loading_screen_file, p_dest_dir + info.export_name); + if (err) { + memdelete(da); + String err_str = String("Failed to export loading screen: ") + loading_screen_file; + ERR_PRINT(err_str.utf8().get_data()); + return err; + } + } + memdelete(da); + + return OK; +} + +Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata) { + Vector<String> dirs; + String path; + String current_dir = p_da->get_current_dir(); + p_da->list_dir_begin(); + while ((path = p_da->get_next()).length() != 0) { + if (p_da->current_is_dir()) { + if (path != "." && path != "..") { + dirs.push_back(path); + } + } else { + Error err = p_handler(current_dir + "/" + path, p_userdata); + if (err) { + p_da->list_dir_end(); + return err; + } + } + } + p_da->list_dir_end(); + + for (int i = 0; i < dirs.size(); ++i) { + String dir = dirs[i]; + p_da->change_dir(dir); + Error err = _walk_dir_recursive(p_da, p_handler, p_userdata); + p_da->change_dir(".."); + if (err) { + return err; + } + } + + return OK; +} + +struct CodesignData { + const Ref<EditorExportPreset> &preset; + bool debug; + + CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) + : preset(p_preset), debug(p_debug) { + } +}; + +Error EditorExportPlatformIOS::_codesign(String p_file, void *p_userdata) { + if (p_file.ends_with(".dylib")) { + CodesignData *data = (CodesignData *)p_userdata; + print_line(String("Signing ") + p_file); + List<String> codesign_args; + codesign_args.push_back("-f"); + codesign_args.push_back("-s"); + codesign_args.push_back(data->preset->get(data->debug ? "application/code_sign_identity_debug" : "application/code_sign_identity_release")); + codesign_args.push_back(p_file); + return OS::get_singleton()->execute("/usr/bin/codesign", codesign_args, true); + } + return OK; +} + Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { String src_pkg_name; String dest_dir = p_path.get_base_dir() + "/"; String binary_name = p_path.get_file().get_basename(); - EditorProgress ep("export", "Exporting for iOS", 3); + EditorProgress ep("export", "Exporting for iOS", 5); + + String team_id = p_preset->get("application/app_store_team_id"); + ERR_EXPLAIN("App Store Team ID not specified - cannot configure the project."); + ERR_FAIL_COND_V(team_id.length() == 0, ERR_CANT_OPEN); if (p_debug) src_pkg_name = p_preset->get("custom_package/debug"); @@ -206,6 +462,15 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p bool found_binary = false; int total_size = 0; + Set<String> files_to_parse; + files_to_parse.insert("godot_ios/godot_ios-Info.plist"); + files_to_parse.insert("godot_ios.xcodeproj/project.pbxproj"); + files_to_parse.insert("export_options.plist"); + files_to_parse.insert("godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata"); + files_to_parse.insert("godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme"); + + print_line("Unzipping..."); + while (ret == UNZ_OK) { bool is_execute = false; @@ -229,12 +494,9 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p file = file.replace_first("iphone/", ""); - if (file == "godot_ios.xcodeproj/project.pbxproj") { - print_line("parse pbxproj"); - _fix_config_file(p_preset, data, pkg_name, binary_name); - } else if (file == "godot_ios/godot_ios-Info.plist") { - print_line("parse plist"); - _fix_config_file(p_preset, data, pkg_name, binary_name); + if (files_to_parse.has(file)) { + print_line(String("parse ") + file); + _fix_config_file(p_preset, data, pkg_name, binary_name, p_debug); } else if (file.begins_with("godot.iphone")) { if (file != binary_to_use) { ret = unzGoToNextFile(src_pkg_zip); @@ -264,6 +526,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p if (dir_err) { ERR_PRINTS("Can't create '" + dir_name + "'."); unzClose(src_pkg_zip); + memdelete(tmp_app_path); return ERR_CANT_CREATE; } } @@ -273,6 +536,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p if (!f) { ERR_PRINTS("Can't write '" + file + "'."); unzClose(src_pkg_zip); + memdelete(tmp_app_path); return ERR_CANT_CREATE; }; f->store_buffer(data.ptr(), data.size()); @@ -295,26 +559,79 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p if (!found_binary) { ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive."); - unzClose(src_pkg_zip); + memdelete(tmp_app_path); return ERR_FILE_NOT_FOUND; } - ep.step("Making PKG", 1); + String iconset_dir = dest_dir + binary_name + "/Images.xcassets/AppIcon.appiconset/"; + Error err = OK; + if (!tmp_app_path->dir_exists(iconset_dir)) { + Error err = tmp_app_path->make_dir_recursive(iconset_dir); + } + memdelete(tmp_app_path); + if (err) + return err; + + err = _export_icons(p_preset, iconset_dir); + if (err) + return err; + + err = _export_loading_screens(p_preset, dest_dir + binary_name + "/"); + if (err) + return err; + + ep.step("Making .pck", 1); String pack_path = dest_dir + binary_name + ".pck"; - Error err = save_pack(p_preset, pack_path); + err = save_pack(p_preset, pack_path); + if (err) + return err; - if (err) { + err = export_project_files(p_preset, _export_dylibs, &dest_dir); + if (err) return err; - } #ifdef OSX_ENABLED - /* and open up xcode with our new project.... */ - List<String> args; - args.push_back(p_path); - err = OS::get_singleton()->execute("/usr/bin/open", args, false); + ep.step("Making .xcarchive", 2); + String archive_path = p_path.get_basename() + ".xcarchive"; + List<String> archive_args; + archive_args.push_back("-project"); + archive_args.push_back(dest_dir + binary_name + ".xcodeproj"); + archive_args.push_back("-scheme"); + archive_args.push_back(binary_name); + archive_args.push_back("-sdk"); + archive_args.push_back("iphoneos"); + archive_args.push_back("-configuration"); + archive_args.push_back(p_debug ? "Debug" : "Release"); + archive_args.push_back("-destination"); + archive_args.push_back("generic/platform=iOS"); + archive_args.push_back("archive"); + archive_args.push_back("-archivePath"); + archive_args.push_back(archive_path); + err = OS::get_singleton()->execute("/usr/bin/xcodebuild", archive_args, true); ERR_FAIL_COND_V(err, err); + ep.step("Code-signing dylibs", 3); + DirAccess *dylibs_dir = DirAccess::open(archive_path + "/Products/Applications/" + binary_name + ".app/dylibs"); + ERR_FAIL_COND_V(!dylibs_dir, ERR_CANT_OPEN); + CodesignData codesign_data(p_preset, p_debug); + err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data); + memdelete(dylibs_dir); + ERR_FAIL_COND_V(err, err); + + ep.step("Making .ipa", 4); + List<String> export_args; + export_args.push_back("-exportArchive"); + export_args.push_back("-archivePath"); + export_args.push_back(archive_path); + export_args.push_back("-exportOptionsPlist"); + export_args.push_back(dest_dir + "export_options.plist"); + export_args.push_back("-exportPath"); + export_args.push_back(dest_dir); + err = OS::get_singleton()->execute("/usr/bin/xcodebuild", export_args, true); + ERR_FAIL_COND_V(err, err); +#else + print_line(".ipa can only be built on macOS. Leaving XCode project without building the package."); #endif return OK; diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index e282041745..f01d9367d2 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -29,7 +29,7 @@ zip_dir = target_dir.Dir('.javascript_zip') zip_files = env.InstallAs(zip_dir.File('godot.html'), '#misc/dist/html/default.html') implicit_targets = [] -if env['wasm'] == 'yes': +if env['wasm']: wasm = target_dir.File(basename + '.wasm') implicit_targets.append(wasm) zip_files.append(InstallAs(zip_dir.File('godot.wasm'), wasm)) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index bea8f156af..cc29ad8956 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -17,18 +17,18 @@ def can_build(): def get_opts(): - + from SCons.Variables import BoolVariable return [ - ['wasm', 'Compile to WebAssembly', 'no'], - ['javascript_eval', 'Enable JavaScript eval interface', 'yes'], + BoolVariable('wasm', 'Compile to WebAssembly', False), + BoolVariable('javascript_eval', 'Enable JavaScript eval interface', True), ] def get_flags(): return [ - ('tools', 'no'), - ('module_theora_enabled', 'no'), + ('tools', False), + ('module_theora_enabled', False), ] @@ -95,7 +95,7 @@ def configure(env): # These flags help keep the file size down env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti']) - if env['javascript_eval'] == 'yes': + if env['javascript_eval']: env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED']) ## Link flags @@ -103,7 +103,7 @@ def configure(env): env.Append(LINKFLAGS=['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS="[\'FS\']"']) env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1']) - if (env['wasm'] == 'yes'): + if env['wasm']: env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) # In contrast to asm.js, enabling memory growth on WebAssembly has no # major performance impact, and causes only a negligible increase in @@ -116,5 +116,5 @@ def configure(env): env.Append(LINKFLAGS=['--memory-init-file', '1']) # TODO: Move that to opus module's config - if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): + if 'module_opus_enabled' in env and env['module_opus_enabled']: env.opus_fixed_point = "yes" diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 24302b5ff9..51da000712 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -19,10 +19,11 @@ def can_build(): def get_opts(): + from SCons.Variables import EnumVariable return [ ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'), - ('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes'), + EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')), ] @@ -96,7 +97,7 @@ def configure(env): ## Dependencies - if (env['builtin_libtheora'] != 'no'): + if env['builtin_libtheora']: env["x86_libtheora_opt_gcc"] = True ## Flags diff --git a/platform/server/detect.py b/platform/server/detect.py index 5c13297bc6..04b38f280d 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -19,9 +19,9 @@ def can_build(): def get_opts(): - + from SCons.Variables import BoolVariable return [ - ('use_llvm', 'Use the LLVM compiler', 'no'), + BoolVariable('use_llvm', 'Use the LLVM compiler', False), ] @@ -52,7 +52,7 @@ def configure(env): ## Compiler configuration - if (env["use_llvm"] == "yes"): + if env['use_llvm']: if ('clang++' not in env['CXX']): env["CC"] = "clang" env["CXX"] = "clang++" @@ -64,60 +64,60 @@ def configure(env): # FIXME: Check for existence of the libs before parsing their flags with pkg-config - if (env['builtin_openssl'] == 'no'): + if not env['builtin_openssl']: env.ParseConfig('pkg-config openssl --cflags --libs') - if (env['builtin_libwebp'] == 'no'): + if not env['builtin_libwebp']: env.ParseConfig('pkg-config libwebp --cflags --libs') # freetype depends on libpng and zlib, so bundling one of them while keeping others # as shared libraries leads to weird issues - if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'): - env['builtin_freetype'] = 'yes' - env['builtin_libpng'] = 'yes' - env['builtin_zlib'] = 'yes' + if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']: + env['builtin_freetype'] = True + env['builtin_libpng'] = True + env['builtin_zlib'] = True - if (env['builtin_freetype'] == 'no'): + if not env['builtin_freetype']: env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env['builtin_libpng'] == 'no'): + if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') - if (env['builtin_enet'] == 'no'): + if not env['builtin_enet']: env.ParseConfig('pkg-config libenet --cflags --libs') - if (env['builtin_squish'] == 'no' and env["tools"] == "yes"): + if not env['builtin_squish'] and env['tools']: env.ParseConfig('pkg-config libsquish --cflags --libs') - if env['builtin_zstd'] == 'no': + if not env['builtin_zstd']: env.ParseConfig('pkg-config libzstd --cflags --libs') # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) - if (env['builtin_libtheora'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libtheora - env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora + if not env['builtin_libtheora']: + env['builtin_libogg'] = False # Needed to link against system libtheora + env['builtin_libvorbis'] = False # Needed to link against system libtheora env.ParseConfig('pkg-config theora theoradec --cflags --libs') - if (env['builtin_libvpx'] == 'no'): + if not env['builtin_libvpx']: env.ParseConfig('pkg-config vpx --cflags --libs') - if (env['builtin_libvorbis'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libvorbis + if not env['builtin_libvorbis']: + env['builtin_libogg'] = False # Needed to link against system libvorbis env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs') - if (env['builtin_opus'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system opus + if not env['builtin_opus']: + env['builtin_libogg'] = False # Needed to link against system opus env.ParseConfig('pkg-config opus opusfile --cflags --libs') - if (env['builtin_libogg'] == 'no'): + if not env['builtin_libogg']: env.ParseConfig('pkg-config ogg --cflags --libs') ## Flags # Linkflags below this line should typically stay the last ones - if (env['builtin_zlib'] == 'no'): + if not env['builtin_zlib']: env.ParseConfig('pkg-config zlib --cflags --libs') env.Append(CPPPATH=['#platform/server']) diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index 23929dd804..af53f97446 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -33,8 +33,8 @@ def get_opts(): def get_flags(): return [ - ('tools', 'no'), - ('xaudio2', 'yes'), + ('tools', False), + ('xaudio2', True), ] diff --git a/platform/windows/SCsub b/platform/windows/SCsub index fd041e096e..d3c160f052 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -30,7 +30,7 @@ common_win.append(obj) binary = env.Program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) # Microsoft Visual Studio Project Generation -if (env['vsproj']) == "yes": +if env['vsproj']: env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)] diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 053ea466f3..92f2e078c8 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -49,6 +49,7 @@ def can_build(): def get_opts(): + from SCons.Variables import BoolVariable, EnumVariable mingw32 = "" mingw64 = "" @@ -64,8 +65,8 @@ def get_opts(): return [ ('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32), ('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64), - ('use_lto', 'Use link time optimization (when using MingW)', 'no'), - ('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes') + BoolVariable('use_lto', 'Use link time optimization (when using MingW)', False), + EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')), ] @@ -262,7 +263,7 @@ def configure(env): env['LD'] = mingw_prefix + "g++" env["x86_libtheora_opt_gcc"] = True - if (env["use_lto"] == "yes"): + if env['use_lto']: env.Append(CCFLAGS=['-flto']) env.Append(LINKFLAGS=['-flto']) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index b9b4ad8201..c8d9930af1 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -45,26 +45,27 @@ def can_build(): return True def get_opts(): + from SCons.Variables import BoolVariable, EnumVariable return [ - ('use_llvm', 'Use the LLVM compiler', 'no'), - ('use_static_cpp', 'Link stdc++ statically', 'no'), - ('use_sanitizer', 'Use LLVM compiler address sanitizer', 'no'), - ('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', 'no'), - ('use_lto', 'Use link time optimization', 'no'), - ('pulseaudio', 'Detect & use pulseaudio', 'yes'), - ('udev', 'Use udev for gamepad connection callbacks', 'no'), - ('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes') + BoolVariable('use_llvm', 'Use the LLVM compiler', False), + BoolVariable('use_static_cpp', 'Link stdc++ statically', False), + BoolVariable('use_sanitizer', 'Use LLVM compiler address sanitizer', False), + BoolVariable('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', False), + BoolVariable('use_lto', 'Use link time optimization', False), + BoolVariable('pulseaudio', 'Detect & use pulseaudio', True), + BoolVariable('udev', 'Use udev for gamepad connection callbacks', False), + EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')), ] def get_flags(): return [ - ('builtin_freetype', 'no'), - ('builtin_libpng', 'no'), - ('builtin_openssl', 'no'), - ('builtin_zlib', 'no'), + ('builtin_freetype', False), + ('builtin_libpng', False), + ('builtin_openssl', False), + ('builtin_zlib', False), ] @@ -100,7 +101,7 @@ def configure(env): ## Compiler configuration - if (env["use_llvm"] == "yes"): + if env['use_llvm']: if ('clang++' not in env['CXX']): env["CC"] = "clang" env["CXX"] = "clang++" @@ -109,18 +110,18 @@ def configure(env): env.extra_suffix = ".llvm" + env.extra_suffix # leak sanitizer requires (address) sanitizer - if (env["use_sanitizer"] == "yes" or env["use_leak_sanitizer"] == "yes"): + if env['use_sanitizer'] or env['use_leak_sanitizer']: env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer']) env.Append(LINKFLAGS=['-fsanitize=address']) env.extra_suffix += "s" - if (env["use_leak_sanitizer"] == "yes"): + if env['use_leak_sanitizer']: env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) - if (env["use_lto"] == "yes"): + if env['use_lto']: env.Append(CCFLAGS=['-flto']) env.Append(LINKFLAGS=['-flto']) - if (env["use_llvm"] == "no"): + if not env['use_llvm']: env['RANLIB'] = 'gcc-ranlib' env['AR'] = 'gcc-ar' @@ -136,64 +137,64 @@ def configure(env): # FIXME: Check for existence of the libs before parsing their flags with pkg-config - if (env['builtin_openssl'] == 'no'): + if not env['builtin_openssl']: env.ParseConfig('pkg-config openssl --cflags --libs') - if (env['builtin_libwebp'] == 'no'): + if not env['builtin_libwebp']: env.ParseConfig('pkg-config libwebp --cflags --libs') # freetype depends on libpng and zlib, so bundling one of them while keeping others # as shared libraries leads to weird issues - if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'): - env['builtin_freetype'] = 'yes' - env['builtin_libpng'] = 'yes' - env['builtin_zlib'] = 'yes' + if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']: + env['builtin_freetype'] = True + env['builtin_libpng'] = True + env['builtin_zlib'] = True - if (env['builtin_freetype'] == 'no'): + if not env['builtin_freetype']: env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env['builtin_libpng'] == 'no'): + if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') - if (env['builtin_enet'] == 'no'): + if not env['builtin_enet']: env.ParseConfig('pkg-config libenet --cflags --libs') - if (env['builtin_squish'] == 'no' and env["tools"] == "yes"): + if not env['builtin_squish'] and env['tools']: env.ParseConfig('pkg-config libsquish --cflags --libs') - if env['builtin_zstd'] == 'no': + if not env['builtin_zstd']: env.ParseConfig('pkg-config libzstd --cflags --libs') # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) - if (env['builtin_libtheora'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libtheora - env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora + if not env['builtin_libtheora']: + env['builtin_libogg'] = False # Needed to link against system libtheora + env['builtin_libvorbis'] = False # Needed to link against system libtheora env.ParseConfig('pkg-config theora theoradec --cflags --libs') - if (env['builtin_libvpx'] == 'no'): + if not env['builtin_libvpx']: env.ParseConfig('pkg-config vpx --cflags --libs') - if (env['builtin_libvorbis'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libvorbis + if not env['builtin_libvorbis']: + env['builtin_libogg'] = False # Needed to link against system libvorbis env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs') - if (env['builtin_opus'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system opus + if not env['builtin_opus']: + env['builtin_libogg'] = False # Needed to link against system opus env.ParseConfig('pkg-config opus opusfile --cflags --libs') - if (env['builtin_libogg'] == 'no'): + if not env['builtin_libogg']: env.ParseConfig('pkg-config ogg --cflags --libs') - if (env['builtin_libtheora'] != 'no'): + if env['builtin_libtheora']: list_of_x86 = ['x86_64', 'x86', 'i386', 'i586'] if any(platform.machine() in s for s in list_of_x86): env["x86_libtheora_opt_gcc"] = True # On Linux wchar_t should be 32-bits # 16-bit library shouldn't be required due to compiler optimisations - if (env['builtin_pcre2'] == 'no'): + if not env['builtin_pcre2']: env.ParseConfig('pkg-config libpcre2-32 --cflags --libs') ## Flags @@ -205,7 +206,7 @@ def configure(env): else: print("ALSA libraries not found, disabling driver") - if (env["pulseaudio"] == "yes"): + if env['pulseaudio']: if (os.system("pkg-config --exists libpulse-simple") == 0): # 0 means found print("Enabling PulseAudio") env.Append(CPPFLAGS=["-DPULSEAUDIO_ENABLED"]) @@ -216,7 +217,7 @@ def configure(env): if (platform.system() == "Linux"): env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) - if (env["udev"] == "yes"): + if env['udev']: if (os.system("pkg-config --exists libudev") == 0): # 0 means found print("Enabling udev support") env.Append(CPPFLAGS=["-DUDEV_ENABLED"]) @@ -225,7 +226,7 @@ def configure(env): print("libudev development libraries not found, disabling udev support") # Linkflags below this line should typically stay the last ones - if (env['builtin_zlib'] == 'no'): + if not env['builtin_zlib']: env.ParseConfig('pkg-config zlib --cflags --libs') env.Append(CPPPATH=['#platform/x11']) @@ -244,5 +245,5 @@ def configure(env): env.Append(CPPFLAGS=['-m64']) env.Append(LINKFLAGS=['-m64', '-L/usr/lib/i686-linux-gnu']) - if (env["use_static_cpp"] == "yes"): + if env['use_static_cpp']: env.Append(LINKFLAGS=['-static-libstdc++']) diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 90e78ba8d3..72739b527e 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -3,7 +3,7 @@ Import('env') -if (env["disable_3d"] == "yes"): +if env['disable_3d']: env.scene_sources.append("3d/spatial.cpp") env.scene_sources.append("3d/skeleton.cpp") diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 7493ea95a8..aa5ae089bf 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -534,7 +534,7 @@ void LineEdit::_notification(int p_what) { switch (p_what) { #ifdef TOOLS_ENABLED case NOTIFICATION_ENTER_TREE: { - if (Engine::get_singleton()->is_editor_hint()) { + if (!get_tree()->is_node_being_edited(this)) { cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 41f4beb1c9..6044b86ef5 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -343,7 +343,7 @@ void ScrollBar::_notification(int p_what) { double dist = sqrt(target * target); double vel = ((target / dist) * 500) * get_fixed_process_delta_time(); - if (vel >= dist) { + if (Math::abs(vel) >= dist) { set_value(target_scroll); } else { set_value(get_value() + vel); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 8d6eb0f8e2..822136820e 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2135,8 +2135,15 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (selected_item->get_children() != NULL && !selected_item->is_collapsed()) { selected_item->set_collapsed(true); } else { - selected_col = columns.size() - 1; - dobreak = false; // fall through to key_up + if (columns.size() == 1) { // goto parent with one column + TreeItem *parent = selected_item->get_parent(); + if (selected_item != get_root() && parent && parent->is_selectable(selected_col) && !(hide_root && parent == get_root())) { + select_single_item(parent, get_root(), selected_col); + } + } else { + selected_col = columns.size() - 1; + dobreak = false; // fall through to key_up + } } } else { if (select_mode == SELECT_MULTI) { @@ -2149,6 +2156,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { } update(); accept_event(); + ensure_cursor_is_visible(); if (dobreak) { break; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 4f62d88934..5a1388458b 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -650,7 +650,7 @@ void SceneTree::set_quit_on_go_back(bool p_enable) { bool SceneTree::is_node_being_edited(const Node *p_node) const { - return Engine::get_singleton()->is_editor_hint() && edited_scene_root && edited_scene_root->is_a_parent_of(p_node); + return Engine::get_singleton()->is_editor_hint() && edited_scene_root && (edited_scene_root->is_a_parent_of(p_node) || edited_scene_root == p_node); } #endif @@ -2216,6 +2216,7 @@ void SceneTree::_bind_methods() { BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP); BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP_WIDTH); BIND_ENUM_CONSTANT(STRETCH_ASPECT_KEEP_HEIGHT); + BIND_ENUM_CONSTANT(STRETCH_ASPECT_EXPAND); } SceneTree *SceneTree::singleton = NULL; diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index 76dd585ffa..32631beb2c 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -182,9 +182,8 @@ Ref<AudioEffectInstance> AudioEffectChorus::instance() { void AudioEffectChorus::set_voice_count(int p_voices) { - ERR_FAIL_COND(p_voices < 1 || p_voices >= MAX_VOICES); + ERR_FAIL_COND(p_voices < 1 || p_voices > MAX_VOICES); voice_count = p_voices; - _change_notify(); } int AudioEffectChorus::get_voice_count() const { diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index 9787ba8109..c50dd804f2 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -110,7 +110,7 @@ void AudioEffectLimiter::set_soft_clip_ratio(float p_soft_clip) { } float AudioEffectLimiter::get_soft_clip_ratio() const { - return soft_clip; + return soft_clip_ratio; } void AudioEffectLimiter::_bind_methods() { diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index a4e6abfd45..f8f3b620d4 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -109,16 +109,13 @@ void Physics2DServerWrapMT::init() { if (create_thread) { step_sem = Semaphore::create(); - print_line("CREATING PHYSICS 2D THREAD"); //OS::get_singleton()->release_rendering_thread(); if (create_thread) { thread = Thread::create(_thread_callback, this); - print_line("STARTING PHYISICS 2D THREAD"); } while (!step_thread_up) { OS::get_singleton()->delay_usec(1000); } - print_line("DONE PHYSICS 2D THREAD"); } else { physics_2d_server->init(); |