diff --git a/SConstruct b/SConstruct index 3ea40489be9..8a3a7c45653 100644 --- a/SConstruct +++ b/SConstruct @@ -117,7 +117,7 @@ if profile: opts=Variables(customs, ARGUMENTS) opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug") -opts.Add('bits', 'Compile Target Bits (default/32/64).', "default") +opts.Add('bits', 'Compile Target Bits (default/32/64/fat).', "default") opts.Add('platform','Platform: '+str(platform_list)+'.',"") opts.Add('p','Platform (same as platform=).',"") opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes') @@ -276,6 +276,8 @@ if selected_platform in platform_list: suffix+=".32" elif (env["bits"]=="64"): suffix+=".64" + elif (env["bits"]=="fat"): + suffix+=".fat" suffix+=env.extra_suffix diff --git a/bin/tests/test_python.cpp b/bin/tests/test_python.cpp index 26fb4bdafbc..f4a3d7a3a2a 100644 --- a/bin/tests/test_python.cpp +++ b/bin/tests/test_python.cpp @@ -53,4 +53,4 @@ void test() { } -#endif \ No newline at end of file +#endif diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 45d089599b7..e8703dccca1 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -500,9 +500,9 @@ void _OS::set_icon(const Image& p_icon) { } /** - * Get current datetime with consideration for utc and + * Get current datetime with consideration for utc and * dst - */ + */ Dictionary _OS::get_datetime(bool utc) const { Dictionary dated = get_date(utc); @@ -564,17 +564,17 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { // Get all time values from the dictionary, set to zero if it doesn't exist. // Risk incorrect calculation over throwing errors - unsigned int second = ((datetime.has(SECOND_KEY))? + unsigned int second = ((datetime.has(SECOND_KEY))? static_cast(datetime[SECOND_KEY]): 0); - unsigned int minute = ((datetime.has(MINUTE_KEY))? + unsigned int minute = ((datetime.has(MINUTE_KEY))? static_cast(datetime[MINUTE_KEY]): 0); - unsigned int hour = ((datetime.has(HOUR_KEY))? + unsigned int hour = ((datetime.has(HOUR_KEY))? static_cast(datetime[HOUR_KEY]): 0); - unsigned int day = ((datetime.has(DAY_KEY))? + unsigned int day = ((datetime.has(DAY_KEY))? static_cast(datetime[DAY_KEY]): 0); - unsigned int month = ((datetime.has(MONTH_KEY))? + unsigned int month = ((datetime.has(MONTH_KEY))? static_cast(datetime[MONTH_KEY]) -1: 0); - unsigned int year = ((datetime.has(YEAR_KEY))? + unsigned int year = ((datetime.has(YEAR_KEY))? static_cast(datetime[YEAR_KEY]):0); /// How many days come before each month (0-12) @@ -604,7 +604,7 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { ERR_FAIL_COND_V( day > MONTH_DAYS_TABLE[LEAPYEAR(year)][month], 0); // Calculate all the seconds from months past in this year - uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR = + uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR = DAYS_PAST_THIS_YEAR_TABLE[LEAPYEAR(year)][month] * SECONDS_PER_DAY; uint64_t SECONDS_FROM_YEARS_PAST = 0; @@ -614,13 +614,13 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { SECONDS_PER_DAY; } - uint64_t epoch = - second + - minute * SECONDS_PER_MINUTE + + uint64_t epoch = + second + + minute * SECONDS_PER_MINUTE + hour * SECONDS_PER_HOUR + // Subtract 1 from day, since the current day isn't over yet // and we cannot count all 24 hours. - (day-1) * SECONDS_PER_DAY + + (day-1) * SECONDS_PER_DAY + SECONDS_FROM_MONTHS_PAST_THIS_YEAR + SECONDS_FROM_YEARS_PAST; return epoch; @@ -631,7 +631,7 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { * Get a dictionary of time values when given epoch time * * Dictionary Time values will be a union if values from #get_time - * and #get_date dictionaries (with the exception of dst = + * and #get_date dictionaries (with the exception of dst = * day light standard time, as it cannot be determined from epoch) * * @param unix_time_val epoch time to convert @@ -660,14 +660,14 @@ Dictionary _OS::get_datetime_from_unix_time( uint64_t unix_time_val) const { time.hour = dayclock / 3600; /* day 0 was a thursday */ - date.weekday = static_cast((dayno + 4) % 7); + date.weekday = static_cast((dayno + 4) % 7); while (dayno >= YEARSIZE(year)) { dayno -= YEARSIZE(year); year++; } - date.year = year; + date.year = year; size_t imonth = 0; diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 680e0ef7f93..11f9536243a 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -116,7 +116,7 @@ Error HTTPClient::request_raw( Method p_method, const String& p_url, const Vecto } request+="\r\n"; CharString cs=request.utf8(); - + DVector data; //Maybe this goes faster somehow? diff --git a/core/ustring.cpp b/core/ustring.cpp index c2520a7a86d..a039ba11cda 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3635,7 +3635,7 @@ String String::percent_decode() const { CharString cs = utf8(); for(int i=0;i - & key + & key ' key @@ -7268,12 +7268,14 @@ + Set rotation of the layer in degree. + Get rotation of the layer in degree. @@ -12250,18 +12252,21 @@ This approximation makes straight segments between each point, then subdivides t + Set the current working directory of the file dialog. + Set the current selected file name of the file dialog. + Set the current selected file path of the file dialog. @@ -12282,6 +12287,7 @@ This approximation makes straight segments between each point, then subdivides t + Return the vertical box container of the dialog, custom controls can be added to it. @@ -12314,6 +12320,7 @@ This approximation makes straight segments between each point, then subdivides t + Invalidate and update the current dialog content list. @@ -12351,6 +12358,7 @@ This approximation makes straight segments between each point, then subdivides t The dialog functions as a folder selector, disallowing the selection of any file. + The dialog allows the selection of a file or a directory. The dialog will warn when a file exists. @@ -21323,24 +21331,28 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8) + Set whether the window is minimized. + Return true if the window is minimized. + Set the window size to maximized. + Return true if the window is maximized. @@ -21578,6 +21590,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8) + Return the current unix timestamp. @@ -21740,6 +21753,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8) + Return the absolute directory path of user data path([user://]). @@ -41487,6 +41501,17 @@ This method controls whether the position between two cached points is interpola + + + + + Returns the VehicleBody's velocity vector. To get the absolute speed in scalar value, get the length of the return vector in pixels/second. Example: + [codeblock] + # vehicle is an instance of VehicleBody + var speed = vehicle.get_linear_velocity().length() + [/codeblock] + + diff --git a/drivers/SCsub b/drivers/SCsub index 63f37698fbb..7337482628c 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -1,9 +1,12 @@ Import('env') +env_drivers = env.Clone() + env.drivers_sources=[] #env.add_source_files(env.drivers_sources,"*.cpp") -env.Append(CPPPATH=["vorbis"]) -Export('env') +env_drivers.Append(CPPPATH=["vorbis"]) + +Export('env_drivers') SConscript('unix/SCsub'); SConscript('alsa/SCsub'); @@ -14,12 +17,9 @@ SConscript('gl_context/SCsub'); SConscript('pnm/SCsub'); if (env['openssl']!='no'): - env_ssl = env.Clone() - Export('env_ssl') - - env_ssl.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); + env_drivers.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); if (env['openssl']=="builtin"): - env_ssl.Append(CPPPATH=['#drivers/builtin_openssl2']) + env_drivers.Append(CPPPATH=['#drivers/builtin_openssl2']) SConscript("builtin_openssl2/SCsub"); SConscript('openssl/SCsub') @@ -47,7 +47,7 @@ if (env["vorbis"]=="yes" or env["speex"]=="yes" or env["theoralib"]=="yes" or en if (env["vorbis"]=="yes"): SConscript("vorbis/SCsub"); if (env["opus"]=="yes"): - SConscript('opus/SCsub'); + SConscript('opus/SCsub'); if (env["tools"]=="yes"): SConscript("convex_decomp/SCsub"); @@ -84,14 +84,14 @@ if (env.split_drivers): #split drivers, this used to be needed for windows until base = string.join(fname.split("/")[:2], "/") if base != cur_base and len(list) > max_src: if num > 0: - lib = env.Library("drivers"+str(num), list) + lib = env_drivers.Library("drivers"+str(num), list) lib_list.append(lib) list = [] num = num+1 cur_base = base list.append(f) - lib = env.Library("drivers"+str(num), list) + lib = env_drivers.Library("drivers"+str(num), list) lib_list.append(lib) if len(lib_list) > 0: @@ -99,15 +99,15 @@ if (env.split_drivers): #split drivers, this used to be needed for windows until if os.name=='posix' and sys.platform=='msys': env.Replace(ARFLAGS=['rcsT']) - lib = env.Library("drivers_collated", lib_list) + lib = env_drivers.Library("drivers_collated", lib_list) lib_list = [lib] drivers_base=[] - env.add_source_files(drivers_base,"*.cpp") - lib_list.insert(0, env.Library("drivers", drivers_base)) + env_drivers.add_source_files(drivers_base,"*.cpp") + lib_list.insert(0, env_drivers.Library("drivers", drivers_base)) env.Prepend(LIBS=lib_list) else: - env.add_source_files(env.drivers_sources,"*.cpp") - lib = env.Library("drivers",env.drivers_sources) + env_drivers.add_source_files(env.drivers_sources,"*.cpp") + lib = env_drivers.Library("drivers",env.drivers_sources) env.Prepend(LIBS=[lib]) diff --git a/drivers/builtin_openssl2/SCsub b/drivers/builtin_openssl2/SCsub index 06d6b07c116..bd0f428cfc4 100644 --- a/drivers/builtin_openssl2/SCsub +++ b/drivers/builtin_openssl2/SCsub @@ -1,5 +1,5 @@ Import('env') -Import('env_ssl') +Import('env_drivers') openssl_sources = [ "ssl/t1_lib.c", @@ -642,17 +642,17 @@ openssl_sources = [ #env.drivers_sources+=openssl_sources -env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/crypto"]) -env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/openssl"]) -env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/evp"]) -env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/asn1"]) -env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/modes"]) +env_drivers.Append(CPPPATH=["#drivers/builtin_openssl2/crypto"]) +env_drivers.Append(CPPPATH=["#drivers/builtin_openssl2/openssl"]) +env_drivers.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/evp"]) +env_drivers.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/asn1"]) +env_drivers.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/modes"]) #env_ssl.Append(CPPPATH=["#drivers/builtin_openssl2/crypto/store"]) -env_ssl.Append(CPPFLAGS=["-DOPENSSL_NO_ASM","-DOPENSSL_THREADS","-DL_ENDIAN"]) +env_drivers.Append(CPPFLAGS=["-DOPENSSL_NO_ASM","-DOPENSSL_THREADS","-DL_ENDIAN"]) # Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517) import os if not (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): # not Windows and not MSVC - env_ssl.Append(CFLAGS=["-Wno-error=implicit-function-declaration"]) + env_drivers.Append(CFLAGS=["-Wno-error=implicit-function-declaration"]) -env_ssl.add_source_files(env.drivers_sources,openssl_sources) +env_drivers.add_source_files(env.drivers_sources,openssl_sources) diff --git a/drivers/openssl/SCsub b/drivers/openssl/SCsub index b7a84cd122f..40e3d0c0f06 100644 --- a/drivers/openssl/SCsub +++ b/drivers/openssl/SCsub @@ -1,6 +1,6 @@ -Import('env_ssl') +Import('env_drivers') Import('env') -env_ssl.add_source_files(env.drivers_sources,"*.cpp") -env_ssl.add_source_files(env.drivers_sources,"*.c") +env_drivers.add_source_files(env.drivers_sources,"*.cpp") +env_drivers.add_source_files(env.drivers_sources,"*.c") diff --git a/drivers/png/SCsub b/drivers/png/SCsub index df521de3ebd..3f8e29c78ac 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -1,4 +1,5 @@ Import('env') +Import('env_drivers') png_sources = [ @@ -25,7 +26,7 @@ png_sources = [ # Currently .ASM filter_neon.S does not compile on NT. import os if ("neon_enabled" in env and env["neon_enabled"]) and os.name!="nt": - env.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"]) + env_drivers.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"]) env_neon = env.Clone(); if "S_compiler" in env: env_neon['CC'] = env['S_compiler'] @@ -33,7 +34,7 @@ if ("neon_enabled" in env and env["neon_enabled"]) and os.name!="nt": png_sources.append(env_neon.Object("#drivers/png/arm/arm_init.c")) png_sources.append(env_neon.Object("#drivers/png/arm/filter_neon.S")) else: - env.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"]) + env_drivers.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"]) env.drivers_sources+=png_sources diff --git a/platform/android/detect.py b/platform/android/detect.py index 7d7fd174e56..11b14eb9890 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -21,7 +21,6 @@ def get_opts(): return [ ('ANDROID_NDK_ROOT', 'the path to Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)), - ('NDK_TOOLCHAIN', 'toolchain to use for the NDK',"arm-eabi-4.4.0"), ('NDK_TARGET', 'toolchain to use for the NDK',os.environ.get("NDK_TARGET", "arm-linux-androideabi-4.9")), ('NDK_TARGET_X86', 'toolchain to use for the NDK x86',os.environ.get("NDK_TARGET_X86", "x86-4.9")), ('ndk_platform', 'compile for platform: (android- , example: android-15)',"android-15"), diff --git a/platform/android/globals/global_defaults.h b/platform/android/globals/global_defaults.h index 64eb26c4829..11617ddfd00 100644 --- a/platform/android/globals/global_defaults.h +++ b/platform/android/globals/global_defaults.h @@ -1,3 +1,3 @@ -void register_android_global_defaults(); \ No newline at end of file +void register_android_global_defaults(); diff --git a/platform/iphone/globals/global_defaults.h b/platform/iphone/globals/global_defaults.h index 25f1ae687e3..305b600b434 100644 --- a/platform/iphone/globals/global_defaults.h +++ b/platform/iphone/globals/global_defaults.h @@ -1,3 +1,3 @@ -void register_iphone_global_defaults(); \ No newline at end of file +void register_iphone_global_defaults(); diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h index 555c90a529a..282b632e93b 100644 --- a/platform/javascript/dom_keys.h +++ b/platform/javascript/dom_keys.h @@ -220,17 +220,17 @@ #define DOM_VK_WIN_OEM_CLEAR 0xFE int dom2godot_scancode(int dom_keycode) { - + if (DOM_VK_0 <= dom_keycode && dom_keycode <= DOM_VK_Z) { // ASCII intersection return dom_keycode; } - + if (DOM_VK_NUMPAD0 <= dom_keycode && dom_keycode <= DOM_VK_NUMPAD9) { // Numpad numbers return KEY_KP_0 + (dom_keycode - DOM_VK_NUMPAD0); } - + if (DOM_VK_F1 <= dom_keycode && dom_keycode <= DOM_VK_F16) { // F1-F16 return KEY_F1 + (dom_keycode - DOM_VK_F1); @@ -259,7 +259,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_PAUSE: return KEY_PAUSE; case DOM_VK_CAPS_LOCK: return KEY_CAPSLOCK; - + /* case DOM_VK_KANA: return KEY_UNKNOWN; case DOM_VK_HANGUL: return KEY_UNKNOWN; @@ -269,7 +269,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_HANJA: return KEY_UNKNOWN; case DOM_VK_KANJI: return KEY_UNKNOWN; */ - + case DOM_VK_ESCAPE: return KEY_ESCAPE; /* case DOM_VK_CONVERT: return KEY_UNKNOWN; @@ -277,8 +277,8 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_ACCEPT: return KEY_UNKNOWN; case DOM_VK_MODECHANGE: return KEY_UNKNOWN; */ - - case DOM_VK_SPACE: return KEY_SPACE; + + case DOM_VK_SPACE: return KEY_SPACE; case DOM_VK_PAGE_UP: return KEY_PAGEUP; case DOM_VK_PAGE_DOWN: return KEY_PAGEDOWN; case DOM_VK_END: return KEY_END; @@ -287,7 +287,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_UP: return KEY_UP; case DOM_VK_RIGHT: return KEY_RIGHT; case DOM_VK_DOWN: return KEY_DOWN; - + //case DOM_VK_SELECT: return KEY_UNKNOWN; case DOM_VK_PRINTSCREEN: // this is the usual printScreen key @@ -297,7 +297,7 @@ int dom2godot_scancode(int dom_keycode) { //case DOM_VK_EXECUTE: return KEY_UNKNOWN; case DOM_VK_INSERT: return KEY_INSERT; case DOM_VK_DELETE: return KEY_DELETE; - + case DOM_VK_META: case DOM_VK_WIN: return KEY_META; @@ -312,7 +312,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_SUBTRACT: return KEY_KP_SUBTRACT; case DOM_VK_DECIMAL: return KEY_KP_PERIOD; case DOM_VK_DIVIDE: return KEY_KP_DIVIDE; - + /* case DOM_VK_F17: return KEY_UNKNOWN; case DOM_VK_F18: return KEY_UNKNOWN; @@ -323,7 +323,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_F23: return KEY_UNKNOWN; case DOM_VK_F24: return KEY_UNKNOWN; */ - + case DOM_VK_NUM_LOCK: return KEY_NUMLOCK; case DOM_VK_SCROLL_LOCK: return KEY_SCROLLLOCK; @@ -352,11 +352,11 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_OPEN_CURLY_BRACKET: return KEY_BRACELEFT; case DOM_VK_CLOSE_CURLY_BRACKET: return KEY_BRACERIGHT; case DOM_VK_TILDE: return KEY_ASCIITILDE; - + case DOM_VK_VOLUME_MUTE: return KEY_VOLUMEMUTE; case DOM_VK_VOLUME_DOWN: return KEY_VOLUMEDOWN; case DOM_VK_VOLUME_UP: return KEY_VOLUMEUP; - + case DOM_VK_COMMA: return KEY_COMMA; case DOM_VK_PERIOD: return KEY_PERIOD; case DOM_VK_SLASH: return KEY_SLASH; @@ -365,9 +365,9 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_BACK_SLASH: return KEY_BACKSLASH; case DOM_VK_CLOSE_BRACKET: return KEY_BRACKETRIGHT; case DOM_VK_QUOTE: return KEY_APOSTROPHE; - + // rest is OEM/unusual - + default: return KEY_UNKNOWN; }; } diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 1f176dc22a1..28bc42f6bb9 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -68,9 +68,12 @@ def configure(env): if (env["bits"]=="64"): env.Append(CCFLAGS=['-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'x86_64']) - else: + elif (env["bits"]=="32"): env.Append(CCFLAGS=['-arch', 'i386']) env.Append(LINKFLAGS=['-arch', 'i386']) + else: + env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64']) + env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64']) else: #osxcross build root=os.environ.get("OSXCROSS_ROOT",0) diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index adea26308ff..810da1b3cd0 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -103,7 +103,7 @@ class OS_Windows : public OS { HDC hDC; // Private GDI Device Context HINSTANCE hInstance; // Holds The Instance Of The Application HWND hWnd; - + HCURSOR hCursor; Size2 window_rect; diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index cc0db2da779..6a74cb1d913 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -62,7 +62,7 @@ String CanvasModulate::get_configuration_warning() const { get_tree()->get_nodes_in_group("_canvas_modulate_"+itos(get_canvas().get_id()),&nodes); if (nodes.size()>1) { - return TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first one created will work, while the rest will be ignored."); + return TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first created one will work, while the rest will be ignored."); } return String(); diff --git a/scene/2d/canvas_modulate.h b/scene/2d/canvas_modulate.h index 73f920d5c7d..0445db27af4 100644 --- a/scene/2d/canvas_modulate.h +++ b/scene/2d/canvas_modulate.h @@ -16,7 +16,7 @@ public: void set_color(const Color& p_color); Color get_color() const; - String CanvasModulate::get_configuration_warning() const; + String get_configuration_warning() const; CanvasModulate(); ~CanvasModulate(); diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index dee67a829fd..41ca7b1d0f3 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -243,7 +243,7 @@ String PathFollow2D::get_configuration_warning() const { return String(); if (!get_parent() || !get_parent()->cast_to()) { - return TTR("PathFolow2D only works when set as a child of a Path2D node."); + return TTR("PathFollow2D only works when set as a child of a Path2D node."); } return String(); diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index aebb9a4c289..3e6384ea2ca 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -540,7 +540,7 @@ String ViewportSprite::get_configuration_warning() const { Viewport *vp = n->cast_to(); if (!vp->is_set_as_render_target()) { - return TTR("The Viewport set in the path property must be set as 'render taget' in order for this sprite to work"); + return TTR("The Viewport set in the path property must be set as 'render target' in order for this sprite to work."); } } } diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 2a5108c627c..12524a21924 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -347,11 +347,11 @@ void VisibilityEnabler2D::_node_removed(Node* p_node) { } String VisibilityEnabler2D::get_configuration_warning() const { - +#ifdef TOOLS_ENABLED if (is_inside_tree() && get_parent() && (get_parent()->get_filename()==String() && get_parent()!=get_tree()->get_edited_scene_root())) { return TTR("VisibilityEnable2D works best when used with the edited scene root directly as parent."); } - +#endif return String(); } diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index ba30c118f0a..e35ba11e849 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -936,7 +936,7 @@ void VehicleBody::_direct_state_changed(Object *p_state) { wheel.m_deltaRotation *= real_t(0.99);//damping of rotation when not in contact } - + linear_velocity = s->get_linear_velocity(); } void VehicleBody::set_mass(real_t p_mass) { @@ -990,6 +990,10 @@ float VehicleBody::get_steering() const{ return m_steeringValue; } +Vector3 VehicleBody::get_linear_velocity() +{ + return linear_velocity; +} void VehicleBody::_bind_methods(){ @@ -1008,6 +1012,8 @@ void VehicleBody::_bind_methods(){ ObjectTypeDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering); ObjectTypeDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering); + ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity); + ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed); ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force")); diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index 285cca142d9..b6ad88f15eb 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -178,6 +178,7 @@ public: void set_steering(float p_steering); float get_steering() const; + Vector3 get_linear_velocity(); VehicleBody(); }; diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index cecdd2bc408..2399bee5395 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1012,7 +1012,7 @@ void AnimationPlayer::play(const StringName& p_name, float p_custom_blend, float queued.clear(); _set_process(true); // always process when starting an animation playing = true; - + emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned); if (is_inside_tree() && get_tree()->is_editor_hint()) diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 90e37137994..328ad8fb26a 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -494,7 +494,7 @@ HTTPRequest::HTTPRequest() max_redirects=8; body_len=-1; got_response=false; - validate_ssl=false; + validate_ssl=false; use_ssl=false; response_code=0; request_sent=false; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index c9f61beba76..5ce53194a1e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1842,6 +1842,8 @@ void Viewport::_gui_input_event(InputEvent p_event) { if (gui.mouse_over) gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT); + _gui_cancel_tooltip(); + if (over) over->notification(Control::NOTIFICATION_MOUSE_ENTER); @@ -1849,8 +1851,6 @@ void Viewport::_gui_input_event(InputEvent p_event) { gui.mouse_over=over; - _gui_cancel_tooltip(); - if (gui.drag_preview) { gui.drag_preview->set_pos(mpos); } @@ -2407,7 +2407,7 @@ String Viewport::get_configuration_warning() const { if (get_parent() && !get_parent()->cast_to() && !render_target) { - return TTR("This viewport is not set as render target. If you intend for it to display it's contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign it's internal texture to some node for display."); + return TTR("This viewport is not set as render target. If you intend for it to display its contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign its internal texture to some node for display."); } return String(); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 516156c3150..88ff09e961f 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -544,7 +544,7 @@ void Curve2D::_bake() const { List pointlist; pointlist.push_back(pos); //start always from origin - + for(int i=0;ix1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); if (!z) return z; - + // round dx down to avoid overshooting if (dxdy < 0) z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); @@ -1769,7 +1769,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac } } } - + e = e->next; } } @@ -2441,7 +2441,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info { int ix0,iy0,ix1,iy1; stbtt__bitmap gbm; - stbtt_vertex *vertices; + stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); if (scale_x == 0) scale_x = scale_y; @@ -2464,7 +2464,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info if (height) *height = gbm.h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; - + if (gbm.w && gbm.h) { gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); if (gbm.pixels) { @@ -2475,7 +2475,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info } STBTT_free(vertices, info->userdata); return gbm.pixels; -} +} STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) { @@ -2487,7 +2487,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigne int ix0,iy0; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; + stbtt__bitmap gbm; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); gbm.pixels = output; @@ -2509,7 +2509,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char * STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) { @@ -2519,7 +2519,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, uns STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} +} STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { @@ -2644,7 +2644,7 @@ static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *no con->y = 0; con->bottom_y = 0; STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); + STBTT__NOTUSED(num_nodes); } static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) @@ -2996,7 +2996,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd n = 0; for (i=0; i < num_ranges; ++i) n += ranges[i].num_chars; - + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); if (rects == NULL) return 0; @@ -3007,7 +3007,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); stbtt_PackFontRangesPackRects(spc, rects, n); - + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); STBTT_free(rects, spc->user_allocator_context); @@ -3060,7 +3060,7 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, i // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; @@ -3099,7 +3099,7 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 return i; } -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) { return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((const stbtt_uint8*) s1, len1, (const stbtt_uint8*) s2, len2); } diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 20405a57b2c..8d0aedbf93c 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -374,7 +374,7 @@ void Theme::get_stylebox_types(List *p_list) const { const StringName *key=NULL; while((key=style_map.next(key))) { p_list->push_back(*key); - } + } } void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref& p_font) { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index cb9e96e284a..5abad863ee7 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -657,7 +657,7 @@ public: virtual RID texture_create(); virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=TEXTURE_FLAGS_DEFAULT); - virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT); + virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT); virtual Image texture_get_data(RID p_texture,CubeMapSide p_cube_side=CUBEMAP_LEFT) const; virtual void texture_set_flags(RID p_texture,uint32_t p_flags) ; virtual uint32_t texture_get_flags(RID p_texture) const; diff --git a/tools/editor/addon_editor_plugin.cpp b/tools/editor/addon_editor_plugin.cpp index 3b74330c1e9..ee0b4b595fd 100644 --- a/tools/editor/addon_editor_plugin.cpp +++ b/tools/editor/addon_editor_plugin.cpp @@ -1085,7 +1085,7 @@ EditorAddonLibrary::EditorAddonLibrary() { - search_hb->add_child( memnew( Label(TTR("Search: ")))); + search_hb->add_child( memnew( Label(TTR("Search:")+" "))); filter =memnew( LineEdit ); search_hb->add_child(filter); filter->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1112,7 +1112,7 @@ EditorAddonLibrary::EditorAddonLibrary() { HBoxContainer *search_hb2 = memnew( HBoxContainer ); library_main->add_child(search_hb2); - search_hb2->add_child( memnew( Label("Sort: "))); + search_hb2->add_child( memnew( Label(TTR("Sort:")+" "))); sort = memnew( OptionButton ); for(int i=0;iadd_item(sort_text[i]); @@ -1123,26 +1123,26 @@ EditorAddonLibrary::EditorAddonLibrary() { sort->set_h_size_flags(SIZE_EXPAND_FILL); reverse = memnew( CheckBox); - reverse->set_text("Reverse"); + reverse->set_text(TTR("Reverse")); search_hb2->add_child(reverse); search_hb2->add_child(memnew(VSeparator)); //search_hb2->add_spacer(); - search_hb2->add_child( memnew( Label("Category: "))); + search_hb2->add_child( memnew( Label(TTR("Category:")+" "))); categories = memnew( OptionButton ); - categories->add_item("All"); + categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); //search_hb2->add_spacer(); search_hb2->add_child(memnew(VSeparator)); - search_hb2->add_child( memnew( Label("Site: "))); + search_hb2->add_child( memnew( Label(TTR("Site:")+" "))); repository = memnew( OptionButton ); - repository->add_item(TTR("Godot")); + repository->add_item("Godot"); search_hb2->add_child(repository); repository->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1232,7 +1232,7 @@ EditorAddonLibrary::EditorAddonLibrary() { asset_open = memnew( EditorFileDialog ); asset_open->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - asset_open->add_filter("*.zip ; Assets ZIP File"); + asset_open->add_filter("*.zip ; "+TTR("Assets ZIP File")); asset_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(asset_open); asset_open->connect("file_selected",this,"_asset_file_selected"); diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index f4fda7ba6ec..08b90b54088 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -889,7 +889,7 @@ void AnimationKeyEditor::_menu_track(int p_type) { case TRACK_MENU_SET_ALL_TRANS_OUTIN: t=-2.0; break; } - undo_redo->create_action(TTR("Set Transitions to: ")+rtos(t)); + undo_redo->create_action(TTR("Set Transitions to:")+" "+rtos(t)); for(Map::Element *E=selection.back();E;E=E->prev()) { @@ -2096,7 +2096,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { /* if (ofsx < remove_icon->get_width()) { - undo_redo->create_action(TTR("Remove Anim Track")); + undo_redo->create_action("Remove Anim Track"); undo_redo->add_do_method(animation.ptr(),"remove_track",idx); undo_redo->add_undo_method(animation.ptr(),"add_track",animation->track_get_type(idx),idx); undo_redo->add_undo_method(animation.ptr(),"track_set_path",idx,animation->track_get_path(idx)); @@ -2129,7 +2129,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (ofsx < move_down_icon->get_width()) { if (idx < animation->get_track_count() -1) { - undo_redo->create_action(TTR("Move Anim Track Down")); + undo_redo->create_action("Move Anim Track Down"); undo_redo->add_do_method(animation.ptr(),"track_move_up",idx); undo_redo->add_undo_method(animation.ptr(),"track_move_down",idx+1); undo_redo->commit_action(); @@ -2142,7 +2142,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (ofsx < move_up_icon->get_width()) { if (idx >0) { - undo_redo->create_action(TTR("Move Anim Track Up")); + undo_redo->create_action("Move Anim Track Up"); undo_redo->add_do_method(animation.ptr(),"track_move_down",idx); undo_redo->add_undo_method(animation.ptr(),"track_move_up",idx-1); undo_redo->commit_action(); @@ -2893,7 +2893,7 @@ void AnimationKeyEditor::_notification(int p_what) { optimize_dialog->connect("confirmed",this,"_animation_optimize"); menu_track->get_popup()->add_child(tpp); - //menu_track->get_popup()->add_submenu_item(TTR("Set Transitions.."),"Transitions"); + //menu_track->get_popup()->add_submenu_item("Set Transitions..","Transitions"); //menu_track->get_popup()->add_separator(); menu_track->get_popup()->add_item(TTR("Optimize Animation"),TRACK_MENU_OPTIMIZE); menu_track->get_popup()->add_item(TTR("Clean-Up Animation"),TRACK_MENU_CLEAN_UP); @@ -3113,9 +3113,9 @@ void AnimationKeyEditor::_query_insert(const InsertData& p_id) { if (bool(EDITOR_DEF("animation/confirm_insert_track",true))) { //potential new key, does not exist if (insert_data.size()==1) - insert_confirm->set_text(TTR("Create NEW track for ")+p_id.query+TTR(" and insert key?")); + insert_confirm->set_text(vformat(TTR("Create NEW track for %s and insert key?"),p_id.query)); else - insert_confirm->set_text(TTR("Create ")+itos(insert_data.size())+TTR(" NEW tracks and insert keys?")); + insert_confirm->set_text(vformat(TTR("Create %d NEW tracks and insert keys?"),insert_data.size())); insert_confirm->get_ok()->set_text(TTR("Create")); insert_confirm->popup_centered_minsize(); @@ -3510,7 +3510,7 @@ void AnimationKeyEditor::_insert_delay() { return; } - undo_redo->create_action(TTR("Anim Insert")); + undo_redo->create_action(TTR("Anim Insert")); int last_track = animation->get_track_count(); bool advance=false; @@ -3818,7 +3818,7 @@ AnimationKeyEditor::AnimationKeyEditor() { hb->add_child( memnew( VSeparator ) ); Label *l = memnew( Label ); - l->set_text(TTR("Len(s):")); + l->set_text(TTR("Length (s):")); hb->add_child(l); length = memnew( SpinBox ); @@ -3833,7 +3833,7 @@ AnimationKeyEditor::AnimationKeyEditor() { length->connect("value_changed",this,"_animation_len_changed"); l = memnew( Label ); - l->set_text(TTR("Step(s):")); + l->set_text(TTR("Step (s):")); hb->add_child(l); step = memnew( SpinBox ); @@ -3929,7 +3929,7 @@ AnimationKeyEditor::AnimationKeyEditor() { /*keying = memnew( Button ); keying->set_toggle_mode(true); - //keying->set_text(TTR("Keys")); + //keying->set_text("Keys"); keying->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,60); keying->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,10); keying->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_BEGIN,55); @@ -3939,7 +3939,7 @@ AnimationKeyEditor::AnimationKeyEditor() { */ /* l = memnew( Label ); - l->set_text(TTR("Base: ")); + l->set_text("Base: "); l->set_pos(Point2(0,3)); // dr_panel->add_child(l);*/ @@ -4089,10 +4089,10 @@ AnimationKeyEditor::AnimationKeyEditor() { cleanup_vb->add_child(cleanup_tracks); cleanup_all = memnew( CheckButton ); - cleanup_all->set_text(TTR("Clean-Up all animations")); + cleanup_all->set_text(TTR("Clean-up all animations")); cleanup_vb->add_child(cleanup_all); - cleanup_dialog->set_title(TTR("Clean up Animation(s) (NO UNDO!)")); + cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)")); cleanup_dialog->get_ok()->set_text(TTR("Clean-Up")); cleanup_dialog->connect("confirmed",this,"_menu_track",varray(TRACK_MENU_CLEAN_UP_CONFIRM)); diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp index 2ab9a79d3b8..0c6c64a33bc 100644 --- a/tools/editor/call_dialog.cpp +++ b/tools/editor/call_dialog.cpp @@ -239,7 +239,7 @@ void CallDialog::set_object(Object *p_object,StringName p_selected) { return_value->clear(); _update_method_list(); - method_label->set_text(TTR("Method List For ' ")+p_object->get_type()+" ':"); + method_label->set_text(vformat(TTR("Method List For '%s':"),p_object->get_type())); } CallDialog::CallDialog() { @@ -323,7 +323,7 @@ CallDialog::CallDialog() { label->set_begin( Point2( 15,54) ); label->set_end( Point2( 16,44) ); - label->set_text(TTR("Parameters:")); + label->set_text("Parameters:"); add_child(label); */ diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 970a0477c19..c92b40628c6 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -216,7 +216,7 @@ void FindReplaceDialog::_replace() { text_edit->set_v_scroll(vsval); // text_edit->set_h_scroll(hsval); - error_label->set_text(TTR("Replaced ")+itos(rc)+TTR(" ocurrence(s).")); + error_label->set_text(vformat(TTR("Replaced %d ocurrence(s)."),rc)); //hide(); @@ -274,7 +274,7 @@ bool FindReplaceDialog::_search() { return true; } else { - set_error(TTR("Not Found!")); + set_error(TTR("Not found!")); return false; } @@ -498,7 +498,7 @@ FindReplaceDialog::FindReplaceDialog() { void CodeTextEditor::_line_col_changed() { - String text = String()+TTR("Line: ")+itos(text_editor->cursor_get_line()+1)+TTR(", Col: ")+itos(text_editor->cursor_get_column()); + String text = String()+TTR("Line:")+" "+itos(text_editor->cursor_get_line()+1)+", "+TTR("Col:")+" "+itos(text_editor->cursor_get_column()); line_col->set_text(text); } diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index 3795860472d..b99cd12f65a 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -294,8 +294,8 @@ void ConnectDialog::_bind_methods() { ConnectDialog::ConnectDialog() { - int margin = get_constant("margin",TTR("Dialogs")); - int button_margin = get_constant("button_margin",TTR("Dialogs")); + int margin = get_constant("margin","Dialogs"); + int button_margin = get_constant("button_margin","Dialogs"); Label * label = memnew( Label ); @@ -416,7 +416,7 @@ ConnectDialog::ConnectDialog() { /*dst_method_list = memnew( MenuButton ); - dst_method_list->set_text(TTR("List..")); + dst_method_list->set_text("List.."); dst_method_list->set_anchor( MARGIN_RIGHT, ANCHOR_END ); dst_method_list->set_anchor( MARGIN_LEFT, ANCHOR_END ); dst_method_list->set_anchor( MARGIN_TOP, ANCHOR_END ); @@ -429,7 +429,7 @@ ConnectDialog::ConnectDialog() { make_callback = memnew( CheckButton ); make_callback->set_toggle_mode(true); make_callback->set_pressed( EDITOR_DEF("text_editor/create_signal_callbacks",true)); - make_callback->set_text(TTR("Make Function ")); + make_callback->set_text(TTR("Make Function")); dstm_hb->add_child(make_callback); deferred = memnew( CheckButton ); @@ -447,7 +447,7 @@ ConnectDialog::ConnectDialog() { realtime->set_anchor( MARGIN_RIGHT, ANCHOR_END ); realtime->set_begin( Point2( 120, button_margin-10 ) ); realtime->set_end( Point2( 80, margin ) ); - realtime->set_text(TTR("Realtime")); + realtime->set_text("Realtime"); add_child(realtime); */ @@ -465,7 +465,7 @@ ConnectDialog::ConnectDialog() { add_child(error); error->get_ok()->set_text(TTR("Close")); get_ok()->set_text(TTR("Connect")); -// error->get_cancel()->set_text(TTR("Close")); +// error->get_cancel()->set_text("Close"); @@ -511,7 +511,7 @@ void ConnectionsDialog::_connect() { StringArray args = it->get_metadata(0).operator Dictionary()["args"]; int flags = CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0) | (oshot?CONNECT_ONESHOT:0); - undo_redo->create_action(TTR("Connect '")+signal+"' to '"+String(dst_method)+"'"); + undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"),signal,String(dst_method))); undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,flags); undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method); undo_redo->add_do_method(this,"update_tree"); @@ -610,7 +610,7 @@ void ConnectionsDialog::_remove_confirm() { Dictionary meta=selected->get_metadata(0); - undo_redo->create_action(TTR("Remove Subscription")); + undo_redo->create_action("Remove Subscription"); undo_redo->add_do_method(node,"unsubscribe_path_event",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String()); undo_redo->add_undo_method(node,"subscribe_path_event_persist",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String(),Array(),false); undo_redo->add_do_method(this,"update_tree"); diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index c156b1b2de3..151208ace0f 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -251,7 +251,7 @@ void CreateDialog::_notification(int p_what) { void CreateDialog::set_base_type(const String& p_base) { base_type=p_base; - set_title(TTR("Create New ")+p_base); + set_title(TTR("Create New")+" "+p_base); _update_search(); } @@ -541,7 +541,7 @@ void CreateDialog::_bind_methods() { void CreateDialog::set_base_type(const String& p_base) { - set_title(TTR("Create ")+p_base+" Type"); + set_title(vformat("Create %s Type",p_base)); if (base==p_base) return; @@ -562,14 +562,14 @@ CreateDialog::CreateDialog() { add_child(vbc); set_child_rect(vbc); - get_ok()->set_text(TTR("Create")); + get_ok()->set_text("Create"); tree = memnew( Tree ); - vbc->add_margin_child(TTR("Type:"),tree,true); + vbc->add_margin_child("Type:",tree,true); //tree->set_hide_root(true); filter = memnew( LineEdit ); - vbc->add_margin_child(TTR("Filter:"),filter); + vbc->add_margin_child("Filter:",filter); base="Node"; set_as_toplevel(true); diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index 784315522c2..633a414b072 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -27,7 +27,7 @@ void DependencyEditor::_load_pressed(Object* p_item,int p_cell,int p_button){ String fname = ti->get_text(0); replacing = ti->get_text(1); - search->set_title(TTR("Search Replacement For: ")+replacing.get_file()); + search->set_title(TTR("Search Replacement For:")+" "+replacing.get_file()); search->clear_filters(); List ext; @@ -180,7 +180,7 @@ void DependencyEditor::_update_list() { String name = path.get_file(); Ref icon; - if (has_icon(type,TTR("EditorIcons"))) { + if (has_icon(type,"EditorIcons")) { icon=get_icon(type,"EditorIcons"); } else { icon=get_icon("Object","EditorIcons"); @@ -209,15 +209,15 @@ void DependencyEditor::edit(const String& p_path) { editing=p_path; - set_title(TTR("Dependencies For: ")+p_path.get_file()); + set_title(TTR("Dependencies For:")+" "+p_path.get_file()); _update_list(); popup_centered_ratio(); if (EditorNode::get_singleton()->is_scene_open(p_path)) { - EditorNode::get_singleton()->show_warning(TTR("Scene '")+p_path.get_file()+"' is currently being edited.\nChanges will not take effect unless reloaded."); + EditorNode::get_singleton()->show_warning(vformat(TTR("Scene '%s' is currently being edited.\nChanges will not take effect unless reloaded."),p_path.get_file())); } else if (ResourceCache::has(p_path)) { - EditorNode::get_singleton()->show_warning(TTR("Resource '")+p_path.get_file()+"' is in use.\nChanges will take effect when reloaded."); + EditorNode::get_singleton()->show_warning(vformat(TTR("Resource '%s' is in use.\nChanges will take effect when reloaded."),p_path.get_file())); } } @@ -301,7 +301,7 @@ void DependencyEditorOwners::_fill_owners(EditorFileSystemDirectory *efsd) { Ref icon; String type=efsd->get_file_type(i); - if (!has_icon(type,TTR("EditorIcons"))) { + if (!has_icon(type,"EditorIcons")) { icon=get_icon("Object","EditorIcons"); } else { icon=get_icon(type,"EditorIcons"); @@ -319,7 +319,7 @@ void DependencyEditorOwners::show(const String& p_path) { _fill_owners(EditorFileSystem::get_singleton()->get_filesystem()); popup_centered_ratio(); - set_title(TTR("Owners Of: ")+p_path.get_file()); + set_title(TTR("Owners Of:")+" "+p_path.get_file()); } @@ -362,7 +362,7 @@ void DependencyRemoveDialog::_fill_owners(EditorFileSystemDirectory *efsd) { Ref icon; String type=efsd->get_file_type(i); - if (!has_icon(type,TTR("EditorIcons"))) { + if (!has_icon(type,"EditorIcons")) { icon=get_icon("Object","EditorIcons"); } else { icon=get_icon(type,"EditorIcons"); @@ -448,7 +448,7 @@ void DependencyErrorDialog::show(const String& p_for_file,const Vector & for_file=p_for_file; - set_title(TTR("Error loading: ")+p_for_file.get_file()); + set_title(TTR("Error loading:")+" "+p_for_file.get_file()); files->clear(); TreeItem *root = files->create_item(NULL); @@ -461,7 +461,7 @@ void DependencyErrorDialog::show(const String& p_for_file,const Vector & type=report[i].get_slice("::",1); Ref icon; - if (!has_icon(type,TTR("EditorIcons"))) { + if (!has_icon(type,"EditorIcons")) { icon=get_icon("Object","EditorIcons"); } else { icon=get_icon(type,"EditorIcons"); @@ -523,7 +523,7 @@ void OrphanResourcesDialog::ok_pressed() { if (paths.empty()) return; - delete_confirm->set_text(TTR("Permanently Delete ")+itos(paths.size())+" Item(s) ? (No Undo!!)"); + delete_confirm->set_text(vformat(TTR("Permanently delete %d item(s)? (No undo!)"),paths.size())); delete_confirm->popup_centered_minsize(); } @@ -580,7 +580,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd,HashMap String type=efsd->get_file_type(i); Ref icon; - if (has_icon(type,TTR("EditorIcons"))) { + if (has_icon(type,"EditorIcons")) { icon=get_icon(type,"EditorIcons"); } else { icon=get_icon("Object","EditorIcons"); diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 8c16955d9f4..b9d4949018a 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -677,7 +677,7 @@ void EditorFileDialog::update_filters() { if (max_filtersadd_item(TTR("All Recognized ( ")+all_filters+" )"); + filter->add_item(TTR("All Recognized")+" ( "+all_filters+" )"); } for(int i=0;ichange_dir(".."); } else { - ERR_PRINTS(TTR("Can't go into subdir: ")+E->get()); + ERR_PRINTS(TTR("Cannot go into subdir:")+" "+E->get()); } p_progress.update(idx,total); diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index a8cb1a57304..616037c5455 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -519,7 +519,7 @@ EditorHelpIndex::EditorHelpIndex() { search_box->connect("input_event", this, "_sbox_input"); class_list = memnew( Tree ); - vbc->add_margin_child(TTR("Class List: "), class_list, true); + vbc->add_margin_child(TTR("Class List:")+" ", class_list, true); class_list->set_v_size_flags(SIZE_EXPAND_FILL); class_list->connect("item_activated",this,"_tree_item_selected"); @@ -710,7 +710,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_font(doc_title_font); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); - class_desc->add_text(TTR("Class: ")); + class_desc->add_text(TTR("Class:")+" "); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color")); _add_text(p_class); class_desc->pop(); @@ -722,7 +722,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); class_desc->push_font(doc_title_font); - class_desc->add_text(TTR("Inherits: ")); + class_desc->add_text(TTR("Inherits:")+" "); class_desc->pop(); class_desc->pop(); @@ -756,7 +756,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (!found) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); class_desc->push_font(doc_title_font); - class_desc->add_text("Inherited by: "); + class_desc->add_text(TTR("Inherited by:")+" "); class_desc->pop(); class_desc->pop(); diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 91357e0f804..25dced4745e 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -240,12 +240,12 @@ static void _edit_files_with_filter(DirAccess *da,const List& p_filters, for(const List::Element *F=p_filters.front();F;F=F->next()) { if (fullpath.matchn(F->get())) { - String act = TTR("Added: "); + String act = TTR("Added:")+" "; if (!exclude) { r_list.insert(fullpath); } else { - act = TTR("Removed: "); + act = TTR("Removed:")+" "; r_list.erase(fullpath); } @@ -866,7 +866,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func Error err = plugin->import2(dst_file,imd,get_image_compression(),true); if (err) { - EditorNode::add_io_error(TTR("Error saving atlas! ")+dst_file.get_file()); + EditorNode::add_io_error(TTR("Error saving atlas:")+" "+dst_file.get_file()); return ERR_CANT_CREATE; } @@ -916,7 +916,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpatlas.atex"; Error err = ResourceSaver::save(path,atex); if (err!=OK) { - EditorNode::add_io_error(TTR("Could not save atlas subtexture: ")+path); + EditorNode::add_io_error(TTR("Could not save atlas subtexture:")+" "+path); return ERR_CANT_CREATE; } Vector data = FileAccess::get_file_as_array(path); @@ -1157,7 +1157,7 @@ Error EditorExportPlatform::save_pack_file(void *p_userdata,const String& p_path MD5Final(&ctx); pd->f->store_buffer(ctx.digest,16); } - pd->ep->step(TTR("Storing File: ")+p_path,2+p_file*100/p_total,false); + pd->ep->step(TTR("Storing File:")+" "+p_path,2+p_file*100/p_total,false); pd->count++; pd->ftmp->store_buffer(p_data.ptr(),p_data.size()); if (pd->alignment > 1) { @@ -1195,7 +1195,7 @@ Error EditorExportPlatform::save_zip_file(void *p_userdata,const String& p_path, zipWriteInFileInZip(zip,p_data.ptr(),p_data.size()); zipCloseFileInZip(zip); - zd->ep->step(TTR("Storing File: ")+p_path,2+p_file*100/p_total,false); + zd->ep->step(TTR("Storing File:")+" "+p_path,2+p_file*100/p_total,false); zd->count++; return OK; @@ -1309,7 +1309,7 @@ Error EditorExportPlatformPC::export_project(const String& p_path, bool p_debug, - EditorProgress ep("export",TTR("Exporting for ")+get_name(),102); + EditorProgress ep("export",vformat(TTR("Exporting for %s"),get_name()),102); const int BUFSIZE = 32768; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 25c854ce56a..eef148b405e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -432,7 +432,7 @@ void EditorNode::_rebuild_import_menu() { PopupMenu* p = import_menu->get_popup(); p->clear(); - p->add_item(TTR("Node from scene"), FILE_IMPORT_SUBSCENE); + p->add_item(TTR("Node From Scene"), FILE_IMPORT_SUBSCENE); p->add_separator(); for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) { p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i); @@ -606,15 +606,15 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) { case ERR_FILE_CANT_WRITE: { - accept->set_text(TTR("Can't open file for writing: ")+p_file.extension()); + accept->set_text(TTR("Can't open file for writing:")+" "+p_file.extension()); } break; case ERR_FILE_UNRECOGNIZED: { - accept->set_text(TTR("File format requested unknown: ")+p_file.extension()); + accept->set_text(TTR("Requested file format unknown:")+" "+p_file.extension()); } break; default: { - accept->set_text(TTR("Error Saving.")); + accept->set_text(TTR("Error while saving.")); }break; } @@ -1071,8 +1071,8 @@ void EditorNode::_import_action(const String& p_action) { current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("Ugh")); - accept->set_text(TTR("Error importing scene.")); + accept->get_ok()->set_text("Ugh"); + accept->set_text("Error importing scene."); accept->popup_centered(Size2(300,70));; return; } @@ -1087,8 +1087,8 @@ void EditorNode::_import_action(const String& p_action) { memdelete(src); //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("Ugh")); - accept->set_text(TTR("Error load scene to update.")); + accept->get_ok()->set_text("Ugh"); + accept->set_text("Error load scene to update."); accept->popup_centered(Size2(300,70));; return; } @@ -1128,8 +1128,8 @@ void EditorNode::_import(const String &p_file) { current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("Ugh")); - accept->set_text(TTR("Error importing scene.")); + accept->get_ok()->set_text("Ugh"); + accept->set_text("Error importing scene."); accept->popup_centered(Size2(300,70));; return; } @@ -1251,7 +1251,7 @@ void EditorNode::_dialog_action(String p_file) { current_option=-1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Can't load MeshLibrary for merging!.")); + accept->set_text(TTR("Can't load MeshLibrary for merging!")); accept->popup_centered_minsize(); return; } @@ -1268,7 +1268,7 @@ void EditorNode::_dialog_action(String p_file) { if (err) { accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Error saving MeshLibrary!.")); + accept->set_text(TTR("Error saving MeshLibrary!")); accept->popup_centered_minsize(); return; } @@ -1286,7 +1286,7 @@ void EditorNode::_dialog_action(String p_file) { current_option=-1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Can't load TileSet for merging!.")); + accept->set_text(TTR("Can't load TileSet for merging!")); accept->popup_centered_minsize(); return; } @@ -1304,7 +1304,7 @@ void EditorNode::_dialog_action(String p_file) { if (err) { accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Error saving TileSet!.")); + accept->set_text(TTR("Error saving TileSet!")); accept->popup_centered_minsize(); return; } @@ -1328,7 +1328,7 @@ void EditorNode::_dialog_action(String p_file) { } int ret = unzGoToFirstFile(pkg); - int fc=0; //coun them + int fc=0; //count them while(ret==UNZ_OK) { fc++; @@ -1368,7 +1368,7 @@ void EditorNode::_dialog_action(String p_file) { file=file.get_file(); - p.step(TTR("Importing: ")+file,fc); + p.step(TTR("Importing:")+" "+file,fc); print_line("IMPORT "+file); FileAccess *f = FileAccess::open(EditorSettings::get_singleton()->get_settings_path()+"/templates/"+file,FileAccess::WRITE); @@ -1454,7 +1454,7 @@ void EditorNode::_dialog_action(String p_file) { _update_layouts_menu(); if (p_file=="Default") { - show_warning(TTR("Restored Default layout to base settings.")); + show_warning(TTR("Restored default layout to base settings.")); } } break; @@ -1712,7 +1712,7 @@ void EditorNode::_edit_current() { _set_top_editors(sub_plugins); _set_editing_top_editors(current_obj); _display_top_editors(true); - + } else if (!editor_plugins_over->get_plugins_list().empty()) { _hide_top_editors(); @@ -1769,7 +1769,7 @@ void EditorNode::_edit_current() { } //p->add_separator(); - //p->add_item(TTR("All Methods"),OBJECT_CALL_METHOD); + //p->add_item("All Methods",OBJECT_CALL_METHOD); update_keying(); @@ -1832,7 +1832,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { current_option=-1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("No scene to run exists.")); + accept->set_text(TTR("There is no defined scene to run.")); accept->popup_centered_minsize(); return; } @@ -1896,7 +1896,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { current_option=-1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Current scene was never saved, please save scene before running.")); + accept->set_text(TTR("Current scene was never saved, please save it prior to running.")); accept->popup_centered_minsize(); return; } @@ -1998,11 +1998,12 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { switch( p_option ) { case FILE_NEW_SCENE: { + // TODO: Drop such obsolete commented code /* if (!p_confirmed) { - confirmation->get_ok()->set_text(TTR("Yes")); + confirmation->get_ok()->set_text("Yes"); //confirmation->get_cancel()->show(); - confirmation->set_text(TTR("Start a New Scene? (Current will be lost)")); + confirmation->set_text("Start a New Scene? (Current will be lost)"); confirmation->popup_centered_minsize(); break; }*/ @@ -2058,7 +2059,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { //quick_open->popup("Resource", false, true); - //quick_open->set_title(TTR("Quick Search File..")); + //quick_open->set_title("Quick Search File.."); scenes_dock->focus_on_filter(); } break; @@ -2221,7 +2222,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current_option=-1; //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); + accept->get_ok()->set_text("I see.."); accept->set_text("This operation can't be done without a tree root."); accept->popup_centered(Size2(300,70));; break; @@ -2243,8 +2244,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } else { current_option=-1; //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Please save the scene first.")); + accept->get_ok()->set_text("I see.."); + accept->set_text("Please save the scene first."); accept->popup_centered(Size2(300,70));; break; @@ -2259,7 +2260,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String target = export_db->get_current_platform(); Ref exporter = export_db->get_exporter(target); if (exporter.is_null()) { - accept->set_text(TTR("No exporter for platform '")+target+"' yet."); + accept->set_text("No exporter for platform '"+target+"' yet."); accept->popup_centered(Size2(300,70));; return; } @@ -2343,7 +2344,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { confirmation->get_ok()->set_text(TTR("Quit")); //confirmation->get_cancel()->show(); - confirmation->set_text(TTR("Exit the Editor?")); + confirmation->set_text(TTR("Exit the editor?")); confirmation->popup_centered(Size2(180,70)); break; } @@ -2411,7 +2412,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String filename = scene->get_filename(); if (filename==String()) { - show_warning(TTR("Can't reload a scene that was never saved..")); + show_warning(TTR("Can't reload a scene that was never saved.")); break; } @@ -2440,7 +2441,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); + accept->get_ok()->set_text("I see.."); accept->set_text("This operation can't be done without a selected node."); accept->popup_centered(Size2(300,70));; break; @@ -2452,7 +2453,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current_option=-1; //confirmation->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); + accept->get_ok()->set_text("I see.."); accept->set_text("This operation can't be done without a selected node."); accept->popup_centered(Size2(300,70));; break; @@ -2464,8 +2465,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("Ugh")); - accept->set_text(String(TTR("Error loading scene from "))+external_file); + accept->get_ok()->set_text("Ugh"); + accept->set_text("Error loading scene from "+external_file); accept->popup_centered(Size2(300,70));; return; } @@ -2473,7 +2474,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { instanced_scene->generate_instance_state(); instanced_scene->set_filename( Globals::get_singleton()->localize_path(external_file) ); - editor_data.get_undo_redo().create_action(TTR("Instance Scene")); + editor_data.get_undo_redo().create_action("Instance Scene"); editor_data.get_undo_redo().add_do_method(parent,"add_child",instanced_scene); editor_data.get_undo_redo().add_do_method(instanced_scene,"set_owner",edited_scene); editor_data.get_undo_redo().add_do_reference(instanced_scene); @@ -2703,11 +2704,11 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { if (ischecked) { file_server->stop(); //debug_button->set_icon(gui_base->get_icon("FileServer","EditorIcons")); - //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),TTR("Enable File Server")); + //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Enable File Server"); } else { file_server->start(); //debug_button->set_icon(gui_base->get_icon("FileServerActive","EditorIcons")); - //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),TTR("Disable File Server")); + //debug_button->get_popup()->set_item_text( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),"Disable File Server"); } debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),!ischecked); @@ -2819,9 +2820,9 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { if (!p_confirmed) { - confirmation->get_ok()->set_text(TTR("Open")); + confirmation->get_ok()->set_text("Open"); //confirmation->get_cancel()->show(); - confirmation->set_text(TTR("Current scene changed, save and re-import ?")); + confirmation->set_text("Current scene changed, save and re-import ?"); confirmation->popup_centered(Size2(300,70)); break; @@ -2834,8 +2835,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Can't import if edited scene was not saved.")); //i dont think this code will ever run + accept->get_ok()->set_text("I see.."); + accept->set_text("Can't import if edited scene was not saved."); //i dont think this code will ever run accept->popup_centered(Size2(300,70));; break; @@ -3251,7 +3252,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres if (!get_edited_scene()) { get_scene()->quit(); - ERR_EXPLAIN(TTR("No scene to optimize (loading failed?")); + ERR_EXPLAIN("No scene to optimize (loading failed?)"); ERR_FAIL_V(ERR_FILE_NOT_FOUND); } @@ -3276,10 +3277,10 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres if (!Globals::get_singleton()->has(preset)) { //accept->"()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Optimizer preset not found: ")+p_preset); + accept->get_ok()->set_text("I see.."); + accept->set_text("Optimizer preset not found: "+p_preset); accept->popup_centered(Size2(300,70));; - ERR_EXPLAIN(TTR("Optimizer preset not found: ")+p_preset); + ERR_EXPLAIN("Optimizer preset not found: "+p_preset); ERR_FAIL_V(ERR_INVALID_PARAMETER); } @@ -3299,7 +3300,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres } } - ERR_EXPLAIN(TTR("Preset '")+p_preset+"' references nonexistent saver: "+type); + ERR_EXPLAIN("Preset '"+p_preset+"' references nonexistent saver: "+type); ERR_FAIL_COND_V(saver.is_null(),ERR_INVALID_DATA); List keys; @@ -3334,8 +3335,8 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Couldn't save scene. Likely dependencies (instances) couldn't be satisfied.")); + accept->get_ok()->set_text("I see.."); + accept->set_text("Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."); accept->popup_centered(Size2(300,70));; return ERR_INVALID_DATA; @@ -3345,8 +3346,8 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres if (err) { //accept->"()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Error saving optimized scene: ")+path); + accept->get_ok()->set_text("I see.."); + accept->set_text("Error saving optimized scene: "+path); accept->popup_centered(Size2(300,70));; ERR_FAIL_COND_V(err,err); @@ -3635,7 +3636,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo for (Map >::Element *E=dependency_errors.front();E;E=E->next()) { - String txt=TTR("Scene '")+E->key()+"' has broken dependencies:\n"; + String txt=vformat(TTR("Scene '%s' has broken dependencies:"),E->key())+"\n"; for(Set::Element *F=E->get().front();F;F=F->next()) { txt+="\t"+F->get()+"\n"; } @@ -3916,8 +3917,8 @@ void EditorNode::_save_optimized() { if (err) { //accept->"()->hide(); - accept->get_ok()->set_text(TTR("I see..")); - accept->set_text(TTR("Error saving optimized scene: ")+path); + accept->get_ok()->set_text("I see.."); + accept->set_text("Error saving optimized scene: "+path); accept->popup_centered(Size2(300,70));; return; @@ -4949,7 +4950,7 @@ Variant EditorNode::drag_files(const Vector& p_files, Control *p_from){ if (p_files.size()>max_files) { Label* label=memnew( Label ); - label->set_text(itos(p_files.size()-max_files)+" "+TTR("More File(s)")); + label->set_text(vformat(TTR("%d more file(s)"), p_files.size()-max_files)); files->add_child(label); } @@ -4980,7 +4981,7 @@ Variant EditorNode::drag_files_and_dirs(const Vector& p_files, Control * if (p_files.size()>max_files) { Label* label=memnew( Label ); - label->set_text(itos(p_files.size()-max_files)+" "+TTR("More File(s) and/or Directory(s)")); + label->set_text(vformat(TTR("%d more file(s) or folder(s)"), p_files.size()-max_files)); files->add_child(label); } @@ -5151,7 +5152,7 @@ EditorNode::EditorNode() { ObjectTypeDB::set_type_enabled("CollisionShape",true); ObjectTypeDB::set_type_enabled("CollisionShape2D",true); ObjectTypeDB::set_type_enabled("CollisionPolygon2D",true); - //ObjectTypeDB::set_type_enabled(TTR("BodyVolumeConvexPolygon"),true); + //ObjectTypeDB::set_type_enabled("BodyVolumeConvexPolygon",true); gui_base = memnew( Panel ); add_child(gui_base); @@ -5512,20 +5513,20 @@ EditorNode::EditorNode() { menu_panel->add_child( node_menu ); p=node_menu->get_popup(); - p->add_item(TTR("Create"),NODE_CREATE); - p->add_item(TTR("Instance"),NODE_INSTANCE); + p->add_item("Create",NODE_CREATE); + p->add_item("Instance",NODE_INSTANCE); p->add_separator(); - p->add_item(TTR("Reparent"),NODE_REPARENT); - p->add_item(TTR("Move Up"),NODE_MOVE_UP); - p->add_item(TTR("Move Down"),NODE_MOVE_DOWN); + p->add_item("Reparent",NODE_REPARENT); + p->add_item("Move Up",NODE_MOVE_UP); + p->add_item("Move Down",NODE_MOVE_DOWN); p->add_separator(); - p->add_item(TTR("Duplicate"),NODE_DUPLICATE); + p->add_item("Duplicate",NODE_DUPLICATE); p->add_separator(); - p->add_item(TTR("Remove (Branch)"),NODE_REMOVE_BRANCH); - p->add_item(TTR("Remove (Element)"),NODE_REMOVE_ELEMENT); + p->add_item("Remove (Branch)",NODE_REMOVE_BRANCH); + p->add_item("Remove (Element)",NODE_REMOVE_ELEMENT); p->add_separator(); - p->add_item(TTR("Edit Subscriptions.."),NODE_CONNECTIONS); - p->add_item(TTR("Edit Groups.."),NODE_GROUPS); + p->add_item("Edit Subscriptions..",NODE_CONNECTIONS); + p->add_item("Edit Groups..",NODE_GROUPS); resource_menu = memnew( MenuButton ); resource_menu->set_text("Resource"); @@ -5543,7 +5544,7 @@ EditorNode::EditorNode() { p->connect("item_pressed",this,"_menu_option"); tool_menu = memnew( MenuButton ); - tool_menu->set_tooltip(TTR("Miscelaneous project or scene wide tools.")); + tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); tool_menu->set_text(TTR("Tools")); //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); @@ -5602,6 +5603,7 @@ EditorNode::EditorNode() { pause_button->set_disabled(true); play_hb->add_child(pause_button); + stop_button = memnew( ToolButton ); play_hb->add_child(stop_button); //stop_button->set_toggle_mode(true); @@ -5636,7 +5638,7 @@ EditorNode::EditorNode() { play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE); play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom","EditorIcons")); play_custom_scene_button->connect("pressed", this,"_menu_option",make_binds(RUN_PLAY_CUSTOM_SCENE)); - play_custom_scene_button->set_tooltip(TTR("Play custom scene (")+keycode_get_string(KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_F5)+")."); + play_custom_scene_button->set_tooltip(TTR("Play custom scene")+" ("+keycode_get_string(KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_F5)+")."); debug_button = memnew( MenuButton ); debug_button->set_flat(true); @@ -5645,7 +5647,7 @@ EditorNode::EditorNode() { debug_button->set_focus_mode(Control::FOCUS_NONE); debug_button->set_icon(gui_base->get_icon("Remote","EditorIcons")); //debug_button->connect("pressed", this,"_menu_option",make_binds(RUN_LIVE_DEBUG)); - debug_button->set_tooltip(TTR("Debug Options")); + debug_button->set_tooltip(TTR("Debug options")); p=debug_button->get_popup(); p->add_check_item(TTR("Live Editing"),RUN_LIVE_DEBUG); @@ -5723,9 +5725,9 @@ EditorNode::EditorNode() { right_menu_hb->add_child( settings_menu ); p=settings_menu->get_popup(); - //p->add_item(TTR("Export Settings"),SETTINGS_EXPORT_PREFERENCES); + //p->add_item("Export Settings",SETTINGS_EXPORT_PREFERENCES); p->add_item(TTR("Editor Settings"),SETTINGS_PREFERENCES); - //p->add_item(TTR("Optimization Presets"),SETTINGS_OPTIMIZED_PRESETS); + //p->add_item("Optimization Presets",SETTINGS_OPTIMIZED_PRESETS); p->add_separator(); editor_layouts = memnew( PopupMenu ); editor_layouts->set_name("Layouts"); @@ -5783,7 +5785,7 @@ EditorNode::EditorNode() { dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scene_tree_dock); #if 0 resources_dock = memnew( ResourcesDock(this) ); - resources_dock->set_name(TTR("Resources")); + resources_dock->set_name("Resources"); //top_pallete->add_child(resources_dock); dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(resources_dock); //top_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -5817,21 +5819,21 @@ EditorNode::EditorNode() { prop_editor_base->add_child(prop_editor_hb); resource_new_button = memnew( ToolButton ); - resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it")); + resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it.")); resource_new_button->set_icon(gui_base->get_icon("New","EditorIcons")); prop_editor_hb->add_child(resource_new_button); resource_new_button->connect("pressed",this,"_menu_option",varray(RESOURCE_NEW)); resource_new_button->set_focus_mode(Control::FOCUS_NONE); resource_load_button = memnew( ToolButton ); - resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it")); + resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it.")); resource_load_button->set_icon(gui_base->get_icon("Load","EditorIcons")); prop_editor_hb->add_child(resource_load_button); resource_load_button->connect("pressed",this,"_menu_option",varray(RESOURCE_LOAD)); resource_load_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button = memnew( MenuButton ); - resource_save_button->set_tooltip(TTR("Save the currently edited resource")); + resource_save_button->set_tooltip(TTR("Save the currently edited resource.")); resource_save_button->set_icon(gui_base->get_icon("Save","EditorIcons")); prop_editor_hb->add_child(resource_save_button); resource_save_button->get_popup()->add_item(TTR("Save"),RESOURCE_SAVE); @@ -5860,7 +5862,7 @@ EditorNode::EditorNode() { editor_history_menu = memnew( MenuButton ); - editor_history_menu->set_tooltip(TTR("History of recently edited objects")); + editor_history_menu->set_tooltip(TTR("History of recently edited objects.")); editor_history_menu->set_icon( gui_base->get_icon("History","EditorIcons")); prop_editor_hb->add_child(editor_history_menu); editor_history_menu->connect("about_to_show",this,"_prepare_history"); @@ -5896,7 +5898,7 @@ EditorNode::EditorNode() { prop_editor_base->add_child(search_bar); search_bar->hide(); - Label *l = memnew( Label(TTR("Search: ")) ); + Label *l = memnew( Label(TTR("Search:")+" ") ); search_bar->add_child(l); search_box = memnew( LineEdit ); @@ -6081,7 +6083,7 @@ EditorNode::EditorNode() { about = memnew( AcceptDialog ); - about->set_title(TTR("Thanks so Much!")); + about->set_title(TTR("Thanks from the Godot community!")); //about->get_cancel()->hide(); about->get_ok()->set_text(TTR("Thanks!")); about->set_hide_on_ok(true); @@ -6101,7 +6103,7 @@ EditorNode::EditorNode() { file_templates = memnew( FileDialog ); - file_templates->set_title(TTR("Import Templates from ZIP file")); + file_templates->set_title(TTR("Import Templates From ZIP File")); gui_base->add_child( file_templates ); file_templates->set_mode(FileDialog::MODE_OPEN_FILE); @@ -6396,7 +6398,7 @@ EditorNode::EditorNode() { EditorNode::~EditorNode() { - + memdelete( EditorHelp::get_doc_data() ); memdelete(editor_selection); memdelete(editor_plugins_over); @@ -6462,6 +6464,6 @@ EditorPluginList::EditorPluginList() { EditorPluginList::~EditorPluginList() { } - + diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 5bd6ef0bdfe..8c83d1b556e 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -451,7 +451,7 @@ private: void _display_top_editors(bool p_display); void _set_top_editors(Vector p_editor_plugins_over); void _set_editing_top_editors(Object * p_current_object); - + void _quick_opened(); void _quick_run(); @@ -748,7 +748,7 @@ public: EditorPluginList(); ~EditorPluginList(); -} ; +} ; struct EditorProgressBG { diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp index 244642b7a69..b6311a76040 100644 --- a/tools/editor/editor_reimport_dialog.cpp +++ b/tools/editor/editor_reimport_dialog.cpp @@ -32,7 +32,7 @@ void EditorReImportDialog::popup_reimport() { if (EditorFileSystem::get_singleton()->is_scanning()) { - error->set_text(TTR("Please wait for scan to complete")); + error->set_text(TTR("Please wait for scan to complete.")); error->popup_centered_minsize(); return; } @@ -92,7 +92,7 @@ void EditorReImportDialog::popup_reimport() { void EditorReImportDialog::ok_pressed() { if (EditorFileSystem::get_singleton()->is_scanning()) { - error->set_text(TTR("Please wait for scan to complete")); + error->set_text(TTR("Please wait for scan to complete.")); error->popup_centered_minsize(); return; } diff --git a/tools/editor/editor_run_script.cpp b/tools/editor/editor_run_script.cpp index 65aaf3d7342..d34cac1530a 100644 --- a/tools/editor/editor_run_script.cpp +++ b/tools/editor/editor_run_script.cpp @@ -9,12 +9,12 @@ void EditorScript::add_root_node(Node *p_node) { if (!editor) { - EditorNode::add_io_error(TTR("EditorScript::add_root_node : Write your logic in the _run() method.")); + EditorNode::add_io_error("EditorScript::add_root_node: "+TTR("Write your logic in the _run() method.")); return; } if (editor->get_edited_scene()) { - EditorNode::add_io_error(TTR("EditorScript::add_root_node : There is an edited scene already.")); + EditorNode::add_io_error("EditorScript::add_root_node: "+TTR("There is an edited scene already.")); return; } @@ -24,7 +24,7 @@ void EditorScript::add_root_node(Node *p_node) { Node *EditorScript::get_scene() { if (!editor) { - EditorNode::add_io_error(TTR("EditorScript::get_scene : Write your logic in the _run() method.")); + EditorNode::add_io_error("EditorScript::get_scene: "+TTR("Write your logic in the _run() method.")); return NULL; } @@ -36,7 +36,7 @@ void EditorScript::_run() { Ref