From 099100d3e02a96c62153b25453065fef9b7d28a1 Mon Sep 17 00:00:00 2001 From: Daniel Inkpen Date: Wed, 9 Nov 2022 21:52:54 +0000 Subject: [PATCH] Reverse most obvious mistakes from Godot 4 automatic changes --- .../terminal/editor_terminal.gd | 2 +- .../editor_plugins/terminal/terminal_panel.gd | 4 +- addons/godot_xterm/nodes/pty/pty_native.gd | 2 +- addons/godot_xterm/nodes/pty/unix/pty_unix.gd | 6 +- addons/godot_xterm/pty.gd | 8 +- addons/godot_xterm/util/tput.gd | 2 +- addons/gut/diff_tool.gd | 2 +- addons/gut/doubler.gd | 4 +- addons/gut/gui/GutRunner.gd | 6 +- addons/gut/gut.gd | 26 +++---- addons/gut/gut_cmdln.gd | 6 +- addons/gut/gut_config.gd | 2 +- addons/gut/input_sender.gd | 2 +- addons/gut/logger.gd | 2 +- addons/gut/method_maker.gd | 6 +- addons/gut/optparse.gd | 4 +- addons/gut/plugin_control.gd | 4 +- addons/gut/signal_watcher.gd | 14 ++-- addons/gut/strutils.gd | 2 +- addons/gut/stub_params.gd | 2 +- addons/gut/stubber.gd | 2 +- addons/gut/test.gd | 46 +++++------ addons/gut/test_collector.gd | 2 +- addons/gut/utils.gd | 6 +- examples/menu/menu.gd | 4 +- examples/retro_term/retro_term.tscn | 76 +++++++++---------- examples/web_console/web_console.gd | 2 +- 27 files changed, 122 insertions(+), 122 deletions(-) diff --git a/addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd b/addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd index 80d8ff4..b46903f 100644 --- a/addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd +++ b/addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd @@ -25,7 +25,7 @@ func _ready(): # Get colors from TextEdit theme. Created using the default (Adaptive) theme # for reference, but will probably cause strange results if using another theme - # better to use a dedicated terminal theme, rather than relying checked this. + # better to use a dedicated terminal theme, rather than relying on this. _set_terminal_colors( { "black": "caret_background_color", diff --git a/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd b/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd index 57966aa..e36e828 100644 --- a/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd +++ b/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd @@ -23,7 +23,7 @@ enum TerminalPopupMenuOptions { } # Has access to the EditorSettings singleton so it can dynamically generate the -# terminal color scheme based checked editor theme settings. +# terminal color scheme based on editor theme settings. var editor_plugin: EditorPlugin var editor_interface: EditorInterface @@ -108,7 +108,7 @@ func _update_terminal_tabs(): await get_tree().idle_frame if tabs.get_offset_buttons_visible(): - # Move add button to fixed position checked the tabbar. + # Move add button to fixed position on the tabbar. if add_button.get_parent() == tabs: add_button.position = Vector2.ZERO tabs.remove_child(add_button) diff --git a/addons/godot_xterm/nodes/pty/pty_native.gd b/addons/godot_xterm/nodes/pty/pty_native.gd index 3c4689f..a7d263f 100644 --- a/addons/godot_xterm/nodes/pty/pty_native.gd +++ b/addons/godot_xterm/nodes/pty/pty_native.gd @@ -20,5 +20,5 @@ func _not_implemented() -> int: if stack.size() >= 2 and "function" in stack[1]: method = "%s()" % stack[1].function - push_error("Method %s not implemented checked the current platform (%s)." % [method, OS.get_name()]) + push_error("Method %s not implemented on the current platform (%s)." % [method, OS.get_name()]) return ERR_METHOD_NOT_FOUND diff --git a/addons/godot_xterm/nodes/pty/unix/pty_unix.gd b/addons/godot_xterm/nodes/pty/unix/pty_unix.gd index a9d100d..a87c174 100644 --- a/addons/godot_xterm/nodes/pty/unix/pty_unix.gd +++ b/addons/godot_xterm/nodes/pty/unix/pty_unix.gd @@ -18,7 +18,7 @@ const DEFAULT_ENV := {TERM = DEFAULT_NAME, COLORTERM = "truecolor"} const FALLBACK_FILE = "sh" ## Default messages to indicate PAUSE/RESUME for automatic flow control. -## To avoid conflicts with rebound XON/XOFF control codes (such as checked-my-zsh), +## To avoid conflicts with rebound XON/XOFF control codes (such as on-my-zsh), ## the sequences can be customized in IPtyForkOptions. #const FLOW_CONTROL_PAUSE = char(0x13) # defaults to XOFF #const FLOW_CONTROL_RESUME = char(0x11) # defaults to XON @@ -35,7 +35,7 @@ enum Signal { SIGFPE = 8, # Erroneous arithmetic operation SIGKILL = 9, # Kill (cannot be caught or ignored) SIGSEGV = 11, # Invalid memory reference - SIGPIPE = 13, # Write checked a pipe with no one to read it + SIGPIPE = 13, # Write on a pipe with no one to read it SIGALRM = 14, # Alarm clock SIGTERM = 15, # Termination signal } @@ -126,7 +126,7 @@ func fork( file = FALLBACK_FILE # Environment variables. - # If we are using OS env vars, sanitize them to remove_at variables that might confuse our terminal. + # If we are using OS env vars, sanitize them to remove variables that might confuse our terminal. var final_env := _sanitize_env(LibuvUtils.get_os_environ()) if use_os_env else {} for key in env.keys(): final_env[key] = env[key] diff --git a/addons/godot_xterm/pty.gd b/addons/godot_xterm/pty.gd index 0d188a3..eb66bf1 100644 --- a/addons/godot_xterm/pty.gd +++ b/addons/godot_xterm/pty.gd @@ -25,13 +25,13 @@ signal exited(exit_code, signum) @export var terminal_path: NodePath := NodePath() : get: - return terminal_path # TODOConverter40 Non existent get function + return terminal_path # TODOConverter40 Non existent get function set(mod_value): mod_value # TODOConverter40 Copy here content of set_terminal_path var _terminal: _Terminal = null : get: - return _terminal # TODOConverter40 Non existent get function + return _terminal # TODOConverter40 Non existent get function set(mod_value): mod_value # TODOConverter40 Copy here content of _set_terminal @@ -68,7 +68,7 @@ func _init(): "X11", "Server", "OSX": _pty_native = _PTYUnix.new() _: - push_error("PTY is not support checked current platform (%s)." % os_name) + push_error("PTY is not support on current platform (%s)." % os_name) _pty_native.connect("data_received",Callable(self,"_on_pty_native_data_received")) _pty_native.connect("exited",Callable(self,"_on_pty_native_exited")) @@ -154,7 +154,7 @@ func resizev(size: Vector2) -> void: # Kill the pty. # sigint: The signal to send. By default this is SIGHUP. -# This is not supported checked Windows. +# This is not supported on Windows. func kill(signum: int = Signal.SIGHUP) -> void: _pty_native.kill(signum) diff --git a/addons/godot_xterm/util/tput.gd b/addons/godot_xterm/util/tput.gd index bc595af..23787c6 100644 --- a/addons/godot_xterm/util/tput.gd +++ b/addons/godot_xterm/util/tput.gd @@ -62,7 +62,7 @@ func write_string(string: String, color: Color = Color.WHITE) -> void: terminal.write("\u001b[0m".to_utf8_buffer()) -# tput_* functions based checked the tput command. +# tput_* functions based on the tput command. # See: https://man7.org/linux/man-pages/man1/tput.1.html for more info. diff --git a/addons/gut/diff_tool.gd b/addons/gut/diff_tool.gd index 530c20c..bc67f67 100644 --- a/addons/gut/diff_tool.gd +++ b/addons/gut/diff_tool.gd @@ -74,7 +74,7 @@ func _invalidate(): differences = null -func _init(v1,v2,diff_type = DEEP): +func _init(v1, v2 ,diff_type = DEEP): _value_1 = v1 _value_2 = v2 _diff_type = diff_type diff --git a/addons/gut/doubler.gd b/addons/gut/doubler.gd index 0088605..31ac68c 100644 --- a/addons/gut/doubler.gd +++ b/addons/gut/doubler.gd @@ -120,7 +120,7 @@ class ObjectInfo: var _singleton_instance = null var _singleton_name = null - func _init(path,subpath = null): + func _init(path, subpath = null): _path = path if subpath != null: _subpaths = Array(subpath.split("/")) @@ -723,7 +723,7 @@ func clear_output_directory(): var d = Directory.new() var result = d.open(_output_dir) # BIG GOTCHA HERE. If it cannot open the dir w/ erro 31, then the - # directory becomes res:// and things go checked normally and gut clears out + # directory becomes res:// and things go on normally and gut clears out # out res:// which is SUPER BAD. if result == OK: d.list_dir_begin() # TODOGODOT4 fill missing arguments https://github.com/godotengine/godot/pull/40547 diff --git a/addons/gut/gui/GutRunner.gd b/addons/gut/gui/GutRunner.gd index ad824cb..2e765e5 100644 --- a/addons/gut/gui/GutRunner.gd +++ b/addons/gut/gui/GutRunner.gd @@ -24,8 +24,8 @@ func _ready(): _gut_config = GutConfig.new() _gut_config.load_options(RUNNER_JSON_PATH) - # The command line will call run_tests checked its own. When used from the panel - # we have to kick unchecked the tests ourselves b/c there's no way I know of to + # The command line will call run_tests on its own. When used from the panel + # we have to kick off the tests ourselves b/c there's no way I know of to # interact with the scene that was run via play_custom_scene. if !_cmdln_mode: call_deferred("run_tests") @@ -58,7 +58,7 @@ func run_tests(): func _write_results(): - # text appears to be empty. I'm not 100% sure why. Until that is + # bbcode_text appears to be empty. I'm not 100% sure why. Until that is # figured out we have to just get the text which stinks. var content = _gut.get_gui().get_text_box().text diff --git a/addons/gut/gut.gd b/addons/gut/gut.gd index aae743b..52c4d77 100644 --- a/addons/gut/gut.gd +++ b/addons/gut/gut.gd @@ -183,14 +183,14 @@ const SIGNAL_STOP_YIELD_BEFORE_TEARDOWN = "stop_yield_before_teardown" # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ -var _should_print_versions = true # used to cut down checked output in tests. +var _should_print_versions = true # used to cut down on output in tests. func _init(): _before_all_test_obj.name = "before_all" _after_all_test_obj.name = "after_all" # When running tests for GUT itself, _utils has been setup to always return - # a new logger so this does not set the gut instance checked the base logger + # a new logger so this does not set the gut instance on the base logger # when creating test instances of GUT. _lgr.set_gut(self) @@ -204,7 +204,7 @@ func _init(): _doubler.set_spy(_spy) _doubler.set_gut(self) - # TODO remove_at these, universal logger should fix this. + # TODO remove these, universal logger should fix this. _doubler.set_logger(_lgr) _spy.set_logger(_lgr) _stubber.set_logger(_lgr) @@ -369,8 +369,8 @@ func _on_log_level_changed(value): # with set_yield_time() # # signal_watcher._on_watched_signal supports up to 9 additional arguments. -# This is the most number of parameters GUT supports checked signals. The comment -# checked _on_watched_signal explains reasoning. +# This is the most number of parameters GUT supports on signals. The comment +# on _on_watched_signal explains reasoning. # ------------------------------------------------------------------------------ func _yielding_callback( from_obj = false, @@ -640,7 +640,7 @@ func _print_script_heading(script): # ------------------------------------------------------------------------------ # Just gets more logic out of _test_the_scripts. Decides if we should yield after -# this test based checked flags and counters. +# this test based on flags and counters. # ------------------------------------------------------------------------------ func _should_yield_now(): var should = ( @@ -762,7 +762,7 @@ func _run_parameterized_test(test_script, test_name): _lgr.warn("Test did not assert") if _is_function_state(script_result): - # _run_tests does _wait_for_done so just wait checked it to complete + # _run_tests does _wait_for_done so just wait on it to complete await script_result.COMPLETED if _parameter_handler == null: @@ -785,7 +785,7 @@ func _run_parameterized_test(test_script, test_name): var cur_assert_count = _current_test.assert_count script_result = _run_test(test_script, test_name) if _is_function_state(script_result): - # _run_tests does _wait_for_done so just wait checked it to complete + # _run_tests does _wait_for_done so just wait on it to complete await script_result.COMPLETED if _current_test.assert_count == cur_assert_count and !_current_test.pending: @@ -850,7 +850,7 @@ func _run_test(script_inst, test_name): # ------------------------------------------------------------------------------ -# Calls after_all checked the passed in test script and takes care of settings so all +# Calls after_all on the passed in test script and takes care of settings so all # logger output appears indented and with a proper heading # # Calls both pre-all-tests methods until prerun_setup is removed @@ -874,7 +874,7 @@ func _call_before_all(test_script): # ------------------------------------------------------------------------------ -# Calls after_all checked the passed in test script and takes care of settings so all +# Calls after_all on the passed in test script and takes care of settings so all # logger output appears indented and with a proper heading # # Calls both post-all-tests methods until postrun_teardown is removed. @@ -1146,7 +1146,7 @@ func _get_files(path, prefix, suffix): # ------------------------------------------------------------------------------ -# Conditionally prints the text to the console/results variable based checked the +# Conditionally prints the text to the console/results variable based on the # current log level and what level is passed in. Whenever currently in a test, # the text will be indented under the test. It can be further indented if # desired. @@ -1461,7 +1461,7 @@ func get_yield_between_tests(): # ------------------------------------------------------------------------------ -# Call _process or _fixed_process, if they exist, checked obj and all it's children +# Call _process or _fixed_process, if they exist, on obj and all it's children # and their children and so and so forth. Delta will be passed through to all # the _process or _fixed_process methods. # ------------------------------------------------------------------------------ @@ -1479,7 +1479,7 @@ func simulate(obj, times, delta): # ------------------------------------------------------------------------------ # Starts an internal timer with a timeout of the passed in time. A 'timeout' # signal will be sent when the timer ends. Returns itself so that it can be -# used in a call to yield...cutting down checked lines of code. +# used in a call to yield...cutting down on lines of code. # # Example, yield to the Gut object for 10 seconds: # await gut.set_yield_time(10).timeout diff --git a/addons/gut/gut_cmdln.gd b/addons/gut/gut_cmdln.gd index 2ec9081..db645f5 100644 --- a/addons/gut/gut_cmdln.gd +++ b/addons/gut/gut_cmdln.gd @@ -122,7 +122,7 @@ class OptionResolver: # ------------------------------------------------------------------------------ -# Here starts the actual script that uses the Options class to kick unchecked Gut +# Here starts the actual script that uses the Options class to kick off Gut # and run your tests. # ------------------------------------------------------------------------------ var _utils = load("res://addons/gut/utils.gd").get_instance() @@ -293,7 +293,7 @@ option (option priority: command-line, super.gutconfig, default).""" resolved.erase("show_help") print( - "Here's a config with all the properties set based unchecked of your current command and config." + "Here's a config with all the properties set based off of your current command and config." ) print(JSON.stringify(resolved, " ")) @@ -332,7 +332,7 @@ func _run_gut(): ( "All command line options and where they are specified. " + 'The "final" value shows which value will actually be used ' - + "based checked order of precedence (default < super.gutconfig < cmd line)." + + "based on order of precedence (default < super.gutconfig < cmd line)." + "\n" ) ) diff --git a/addons/gut/gut_config.gd b/addons/gut/gut_config.gd index de6e046..4f08751 100644 --- a/addons/gut/gut_config.gd +++ b/addons/gut/gut_config.gd @@ -2,7 +2,7 @@ var Gut = load("res://addons/gut/gut.gd") # Do not want a ref to _utils here due to use by editor plugin. # _utils needs to be split so that constants and what not do not -# have to rely checked the weird singleton thing I made. +# have to rely on the weird singleton thing I made. enum DOUBLE_STRATEGY { FULL, PARTIAL } var valid_fonts = ["AnonymousPro", "CourierPro", "LobsterTwo", "Default"] diff --git a/addons/gut/input_sender.gd b/addons/gut/input_sender.gd index 99a4b9a..bbad211 100644 --- a/addons/gut/input_sender.gd +++ b/addons/gut/input_sender.gd @@ -71,7 +71,7 @@ class InputQueueItem: if _waited_frames >= frame_delay: emit_signal("event_ready") - func _init(t_delay,f_delay): + func _init(t_delay, f_delay): time_delay = t_delay frame_delay = f_delay _is_ready = time_delay == 0 and frame_delay == 0 diff --git a/addons/gut/logger.gd b/addons/gut/logger.gd index 7137c5b..2cc366b 100644 --- a/addons/gut/logger.gd +++ b/addons/gut/logger.gd @@ -90,7 +90,7 @@ func _init(): _printers.console = _utils.Printers.ConsolePrinter.new() # There were some problems in the timing of disabling this at the right # time in gut_cmdln so it is disabled by default. This is enabled - # by plugin_control.gd based checked settings. + # by plugin_control.gd based on settings. _printers.console.set_disabled(true) diff --git a/addons/gut/method_maker.gd b/addons/gut/method_maker.gd index c3ae3b3..e3fb4ad 100644 --- a/addons/gut/method_maker.gd +++ b/addons/gut/method_maker.gd @@ -2,13 +2,13 @@ class CallParameters: var p_name = null var default = null - func _init(n,d): + func _init(n, d): p_name = n default = d # ------------------------------------------------------------------------------ -# This class will generate method declaration lines based checked method meta +# This class will generate method declaration lines based on method meta # data. It will create defaults that match the method data. # # -------------------- @@ -253,7 +253,7 @@ func _get_spy_call_parameters_text(args): # ############### -# Creates a delceration for a function based unchecked of function metadata. All +# Creates a delceration for a function based off of function metadata. All # types whose defaults are supported will have their values. If a datatype # is not supported and the parameter has a default, a warning message will be # printed and the declaration will return null. diff --git a/addons/gut/optparse.gd b/addons/gut/optparse.gd index bbd604c..1bc92fc 100644 --- a/addons/gut/optparse.gd +++ b/addons/gut/optparse.gd @@ -40,7 +40,7 @@ #------------------------------------------------------------------------------- # Parses the command line arguments supplied into an array that can then be -# examined and parsed based checked how the gut options work. +# examined and parsed based on how the gut options work. #------------------------------------------------------------------------------- class CmdLineParser: var _used_options = [] @@ -149,7 +149,7 @@ class Option: var default = null var description = "" - func _init(name,default_value,desc = ""): + func _init(name, default_value, desc = ""): option_name = name default = default_value description = desc diff --git a/addons/gut/plugin_control.gd b/addons/gut/plugin_control.gd index 75821a8..cb3902b 100644 --- a/addons/gut/plugin_control.gd +++ b/addons/gut/plugin_control.gd @@ -52,7 +52,7 @@ extends Control @export var _inner_class_name: String = "" # Start running tests when the scene finishes loading @export var _run_on_load = false -# Maximize the GUT control checked startup +# Maximize the GUT control on startup @export var _should_maximize = false # Print output to the consol as well @export var _should_print_to_console = true @@ -244,7 +244,7 @@ func _is_ready_to_go(action): str( "GUT is not ready for ", action, - " yet. Perform actions checked GUT in/after the gut_ready signal." + " yet. Perform actions on GUT in/after the gut_ready signal." ) ) return _gut != null diff --git a/addons/gut/signal_watcher.gd b/addons/gut/signal_watcher.gd index a4754d2..379b83e 100644 --- a/addons/gut/signal_watcher.gd +++ b/addons/gut/signal_watcher.gd @@ -25,7 +25,7 @@ # ############################################################################## # Some arbitrary string that should never show up by accident. If it does, then -# shame checked you. +# shame on you. const ARG_NOT_SET = "_*_argument_*_is_*_not_set_*_" # This hash holds the objects that are being watched, the signals that are being @@ -46,11 +46,11 @@ const ARG_NOT_SET = "_*_argument_*_is_*_not_set_*_" # } # # In this sample: -# - signal1 checked the ref1 object was emitted 3 times and each time, zero +# - signal1 on the ref1 object was emitted 3 times and each time, zero # parameters were passed. -# - signal3 checked ref1 was emitted once and passed a single parameter -# - some_signal checked ref2 was never emitted. -# - other_signal checked ref2 was emitted 3 times, each time with 3 parameters. +# - signal3 on ref1 was emitted once and passed a single parameter +# - some_signal on ref2 was never emitted. +# - other_signal on ref2 was emitted 3 times, each time with 3 parameters. var _watched_signals = {} var _utils = load("res://addons/gut/utils.gd").get_instance() @@ -73,7 +73,7 @@ func _add_watched_signal(obj, name): # parameters when dynamically calling a method via call (per the Godot # documentation, i.e. some_object.call('some_method', 1, 2, 3...)). # -# Based checked the documentation of emit_signal, it appears you can only pass up +# Based on the documentation of emit_signal, it appears you can only pass up # to 4 parameters when firing a signal. I haven't verified this, but this should # future proof this some if the value ever grows. func _on_watched_signal( @@ -91,7 +91,7 @@ func _on_watched_signal( ): var args = [arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11] - # strip unchecked any unused vars. + # strip off any unused vars. var idx = args.size() - 1 while str(args[idx]) == ARG_NOT_SET: args.remove_at(idx) diff --git a/addons/gut/strutils.gd b/addons/gut/strutils.gd index f96e15e..f12c37d 100644 --- a/addons/gut/strutils.gd +++ b/addons/gut/strutils.gd @@ -82,7 +82,7 @@ func _get_obj_filename(thing): pass elif NativeScriptClass != null and thing.get_script() is NativeScriptClass: # Work with GDNative scripts: - # inst_to_dict fails with "Not a script with an instance" checked GDNative script instances + # inst_to_dict fails with "Not a script with an instance" on GDNative script instances filename = _get_filename(thing.get_script().resource_path) elif !_utils.is_native_class(thing): var dict = inst_to_dict(thing) diff --git a/addons/gut/stub_params.gd b/addons/gut/stub_params.gd index 7fddba3..6005180 100644 --- a/addons/gut/stub_params.gd +++ b/addons/gut/stub_params.gd @@ -1,7 +1,7 @@ var return_val = null var stub_target = null var target_subpath = null -# the parameter values to match method call checked. +# the parameter values to match method call on. var parameters = null var stub_method = null var call_super = false diff --git a/addons/gut/stubber.gd b/addons/gut/stubber.gd index d72d2dc..20f6835 100644 --- a/addons/gut/stubber.gd +++ b/addons/gut/stubber.gd @@ -28,7 +28,7 @@ func _make_key_from_metadata(doubled): return to_return -# Creates they key for the returns hash based checked the type of object passed in +# Creates they key for the returns hash based on the type of object passed in # obj could be a string of a path to a script with an optional subpath or # it could be an instance of a doubled object. func _make_key_from_variant(obj, subpath = null): diff --git a/addons/gut/test.gd b/addons/gut/test.gd index e078de8..d88e4c2 100644 --- a/addons/gut/test.gd +++ b/addons/gut/test.gd @@ -62,7 +62,7 @@ class DoubleInfo: # (object_to_double, subpath) # (object_to_double, strategy) # (object_to_double, subpath, strategy) - func _init(thing,p2 = null,p3 = null): + func _init(thing, p2 = null, p3 = null): strategy = p2 # short-circuit and ensure that is_valid @@ -218,7 +218,7 @@ func _do_datatypes_match__fail_if_not(got, expected, text): # ------------------------------------------------------------------------------ -# Create a string that lists all the methods that were called checked an spied +# Create a string that lists all the methods that were called on an spied # instance. # ------------------------------------------------------------------------------ func _get_desc_of_calls_to_instance(inst): @@ -228,7 +228,7 @@ func _get_desc_of_calls_to_instance(inst): calls = BULLET + calls.replace("\n", "\n" + BULLET) # remove_at trailing newline and bullet calls = calls.substr(0, calls.length() - BULLET.length() - 1) - return "Calls made checked " + str(inst) + "\n" + calls + return "Calls made on " + str(inst) + "\n" + calls # ------------------------------------------------------------------------------ @@ -747,7 +747,7 @@ func _can_make_signal_assertions(object, signal_name): # ------------------------------------------------------------------------------ -# Check if an object is connected to a signal checked another object. Returns True +# Check if an object is connected to a signal on another object. Returns True # if it is and false otherwise # ------------------------------------------------------------------------------ func _is_connected(signaler_obj, connect_to_obj, signal_name, method_name = ""): @@ -770,10 +770,10 @@ func watch_signals(object): # ------------------------------------------------------------------------------ -# Asserts that an object is connected to a signal checked another object +# Asserts that an object is connected to a signal on another object # # This will fail with specific messages if the target object is not connected -# to the specified signal checked the source object. +# to the specified signal on the source object. # ------------------------------------------------------------------------------ func assert_connected(signaler_obj, connect_to_obj, signal_name, method_name = ""): pass @@ -785,7 +785,7 @@ func assert_connected(signaler_obj, connect_to_obj, signal_name, method_name = " _str(signaler_obj), " to be connected to signal: [", signal_name, - "] checked ", + "] on ", _str(connect_to_obj), method_disp ) @@ -796,10 +796,10 @@ func assert_connected(signaler_obj, connect_to_obj, signal_name, method_name = " # ------------------------------------------------------------------------------ -# Asserts that an object is not connected to a signal checked another object +# Asserts that an object is not connected to a signal on another object # # This will fail with specific messages if the target object is connected -# to the specified signal checked the source object. +# to the specified signal on the source object. # ------------------------------------------------------------------------------ func assert_not_connected(signaler_obj, connect_to_obj, signal_name, method_name = ""): var method_disp = "" @@ -810,7 +810,7 @@ func assert_not_connected(signaler_obj, connect_to_obj, signal_name, method_name _str(signaler_obj), " to not be connected to signal: [", signal_name, - "] checked ", + "] on ", _str(connect_to_obj), method_disp ) @@ -1116,21 +1116,21 @@ func assert_string_ends_with(text, search, match_case = true): # ------------------------------------------------------------------------------ -# Assert that a method was called checked an instance of a doubled class. If +# Assert that a method was called on an instance of a doubled class. If # parameters are supplied then the params passed in when called must match. # TODO make 3rd parameter "param_or_text" and add fourth parameter of "text" and # then work some magic so this can have a "text" parameter without being # annoying. # ------------------------------------------------------------------------------ func assert_called(inst, method_name, parameters = null): - var disp = str("Expected [", method_name, "] to have been called checked ", _str(inst)) + var disp = str("Expected [", method_name, "] to have been called on ", _str(inst)) if _fail_if_parameters_not_array(parameters): return if !_utils.is_double(inst): _fail( - "You must pass a doubled instance to assert_called. Check the wiki for info checked using double." + "You must pass a doubled instance to assert_called. Check the wiki for info on using double." ) else: if gut.get_spy().was_called(inst, method_name, parameters): @@ -1142,19 +1142,19 @@ func assert_called(inst, method_name, parameters = null): # ------------------------------------------------------------------------------ -# Assert that a method was not called checked an instance of a doubled class. If +# Assert that a method was not called on an instance of a doubled class. If # parameters are specified then this will only fail if it finds a call that was # sent matching parameters. # ------------------------------------------------------------------------------ func assert_not_called(inst, method_name, parameters = null): - var disp = str("Expected [", method_name, "] to NOT have been called checked ", _str(inst)) + var disp = str("Expected [", method_name, "] to NOT have been called on ", _str(inst)) if _fail_if_parameters_not_array(parameters): return if !_utils.is_double(inst): _fail( - "You must pass a doubled instance to assert_not_called. Check the wiki for info checked using double." + "You must pass a doubled instance to assert_not_called. Check the wiki for info on using double." ) else: if gut.get_spy().was_called(inst, method_name, parameters): @@ -1166,7 +1166,7 @@ func assert_not_called(inst, method_name, parameters = null): # ------------------------------------------------------------------------------ -# Assert that a method checked an instance of a doubled class was called a number +# Assert that a method on an instance of a doubled class was called a number # of times. If parameters are specified then only calls with matching # parameter values will be counted. # ------------------------------------------------------------------------------ @@ -1179,12 +1179,12 @@ func assert_call_count(inst, method_name, expected_count, parameters = null): var param_text = "" if parameters: param_text = " with parameters " + str(parameters) - var disp = "Expected [%s] checked %s to be called [%s] times%s. It was called [%s] times." + var disp = "Expected [%s] on %s to be called [%s] times%s. It was called [%s] times." disp = disp % [method_name, _str(inst), expected_count, param_text, count] if !_utils.is_double(inst): _fail( - "You must pass a doubled instance to assert_call_count. Check the wiki for info checked using double." + "You must pass a doubled instance to assert_call_count. Check the wiki for info on using double." ) else: if count == expected_count: @@ -1698,7 +1698,7 @@ func ignore_method_when_doubling(thing, method_name): # ------------------------------------------------------------------------------ func stub(thing, p2, p3 = null): if _utils.is_instance(thing) and !_utils.is_double(thing): - _lgr.error(str("You cannot use stub checked ", _str(thing), " because it is not a double.")) + _lgr.error(str("You cannot use stub on ", _str(thing), " because it is not a double.")) return _utils.StubParams.new() var method_name = p2 @@ -1791,7 +1791,7 @@ func autofree(thing): # ------------------------------------------------------------------------------ -# Works the same as autofree except queue_free will be called checked the object +# Works the same as autofree except queue_free will be called on the object # instead. This also imparts a brief pause after the test finishes so that # the queued object has time to free. # ------------------------------------------------------------------------------ @@ -1869,7 +1869,7 @@ func fail_test(text): # ------------------------------------------------------------------------------ -# Peforms a deep compare checked both values, a CompareResult instnace is returned. +# Peforms a deep compare on both values, a CompareResult instnace is returned. # The optional max_differences paramter sets the max_differences to be displayed. # ------------------------------------------------------------------------------ func compare_deep(v1, v2, max_differences = null): @@ -1880,7 +1880,7 @@ func compare_deep(v1, v2, max_differences = null): # ------------------------------------------------------------------------------ -# Peforms a shallow compare checked both values, a CompareResult instnace is returned. +# Peforms a shallow compare on both values, a CompareResult instnace is returned. # The optional max_differences paramter sets the max_differences to be displayed. # ------------------------------------------------------------------------------ func compare_shallow(v1, v2, max_differences = null): diff --git a/addons/gut/test_collector.gd b/addons/gut/test_collector.gd index faa641e..eb34d9c 100644 --- a/addons/gut/test_collector.gd +++ b/addons/gut/test_collector.gd @@ -31,7 +31,7 @@ class TestScript: var _utils = null var _lgr = null - func _init(utils = null,logger = null): + func _init(utils = null, logger = null): _utils = utils _lgr = logger diff --git a/addons/gut/utils.gd b/addons/gut/utils.gd index 4a9a862..423a023 100644 --- a/addons/gut/utils.gd +++ b/addons/gut/utils.gd @@ -108,7 +108,7 @@ var req_godot = [3, 2, 0] # Used for doing file manipulation stuff so as to not keep making File instances. # could be a bit of overkill but who cares. var _file_checker = File.new() -# Online fetch of the latest version available checked github +# Online fetch of the latest version available on github var latest_version = null var should_display_latest_version = false @@ -280,7 +280,7 @@ func is_gdscript(obj): # ------------------------------------------------------------------------------ -# Returns an array of values by calling get(property) checked each element in source +# Returns an array of values by calling get(property) on each element in source # ------------------------------------------------------------------------------ func extract_property_from_array(source, property): var to_return = [] @@ -354,7 +354,7 @@ func get_file_as_text(path): # ------------------------------------------------------------------------------ -# Loops through an array of things and calls a method or checks a property checked +# Loops through an array of things and calls a method or checks a property on # each element until it finds the returned value. The item in the array is # returned or null if it is not found. # ------------------------------------------------------------------------------ diff --git a/examples/menu/menu.gd b/examples/menu/menu.gd index 0f5cc76..2bd207d 100644 --- a/examples/menu/menu.gd +++ b/examples/menu/menu.gd @@ -148,9 +148,9 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void: ( "Psuedoterminal node currently" + " uses pty.h but needs to use either winpty or conpty" - + " to work checked Windows." + + " to work on Windows." ), - "Terminal not Supported checked Windows" + "Terminal not Supported on Windows" ) var scene = item.scene.instantiate() var pty = scene if OS.has_feature("JavaScript") else scene.get_node("PTY") diff --git a/examples/retro_term/retro_term.tscn b/examples/retro_term/retro_term.tscn index 36ada8d..bbc6710 100644 --- a/examples/retro_term/retro_term.tscn +++ b/examples/retro_term/retro_term.tscn @@ -8,26 +8,26 @@ code = "/* Shader from Godot Shaders - the free shader library. godotshaders.com/shader/VHS-and-CRT-monitor-effect -This shader is under CC0 license. Feel free to use, improve and -change this shader according to your needs and consider sharing +This shader is under CC0 license. Feel free to use, improve and +change this shader according to your needs and consider sharing the modified result to godotshaders.com. */ shader_type canvas_item; -//*** IMPORTANT! ***/ +//*** IMPORTANT! ***/ // - If you are using this shader to affect the node it is applied to set 'overlay' to false (unchecked in the instepctor). // - If you are using this shader as an overlay, and want the shader to affect the nodes below in the Scene hierarchy, // set 'overlay' to true (checked in the inspector). // On Mac there is potentially a bug causing this to not work properly. If that is the case and you want to use the shader as an overlay -// change all \"overlay ? SCREEN_TEXTURE : TEXTURE\" to only \"SCREEN_TEXTURE\" checked lines 129-140, and \"vec2 uv = overlay ? warp(SCREEN_UV) : warp(UV);\" -// to \"vec2 uv = warp(SCREEN_UV);\" checked line 98. +// change all \"overlay ? SCREEN_TEXTURE : TEXTURE\" to only \"SCREEN_TEXTURE\" on lines 129-140, and \"vec2 uv = overlay ? warp(SCREEN_UV) : warp(UV);\" +// to \"vec2 uv = warp(SCREEN_UV);\" on line 98. uniform bool overlay = false; uniform float scanlines_opacity : hint_range(0.0, 1.0) = 0.4; uniform float scanlines_width : hint_range(0.0, 0.5) = 0.25; uniform float grille_opacity : hint_range(0.0, 1.0) = 0.3; -uniform vec2 resolution = vec2(640.0, 480.0); // Set the number of rows and columns the texture will be divided in. Scanlines and grille will make a square based checked these values +uniform vec2 resolution = vec2(640.0, 480.0); // Set the number of rows and columns the texture will be divided in. Scanlines and grille will make a square based on these values uniform bool pixelate = true; // Fill each square (\"pixel\") with a sampled color, creating a pixel look and a more accurate representation of how a CRT monitor would work. @@ -42,7 +42,7 @@ uniform float noise_speed = 5.0; // There is a movement in the noise pattern tha uniform float static_noise_intensity : hint_range(0.0, 1.0) = 0.06; -uniform float aberration : hint_range(-1.0, 1.0) = 0.03; // Chromatic aberration, a distortion checked each color channel. +uniform float aberration : hint_range(-1.0, 1.0) = 0.03; // Chromatic aberration, a distortion on each color channel. uniform float brightness = 1.4; // When adding scanline gaps and grille the image can get very dark. Brightness tries to compensate for that. uniform bool discolor = true; // Add a discolor effect simulating a VHS @@ -78,7 +78,7 @@ vec2 warp(vec2 uv){ float delta2 = dot(delta.xy, delta.xy); float delta4 = delta2 * delta2; float delta_offset = delta4 * warp_amount; - + return uv + delta * delta_offset; } @@ -105,14 +105,14 @@ void fragment() vec2 text_uv = uv; vec2 roll_uv = vec2(0.0); float time = roll ? TIME : 0.0; - - // Pixelate the texture based checked the given resolution. + + // Pixelate the texture based on the given resolution. if (pixelate) { text_uv = ceil(uv * resolution) / resolution; } - + // Create the rolling effect. We need roll_line a bit later to make the noise effect. // That is why this runs if roll is true OR noise_opacity is over 0. float roll_line = 0.0; @@ -125,11 +125,11 @@ void fragment() // Distort the UV where where the lines are roll_uv = vec2(( roll_line * distort_intensity * (1.-UV.x)), 0.0); } - + vec4 text; if (roll) { - // If roll is true distort the texture with roll_uv. The texture is split up into RGB to + // If roll is true distort the texture with roll_uv. The texture is split up into RGB to // make some chromatic aberration. We apply the aberration to the red and green channels accorging to the aberration parameter // and intensify it a bit in the roll distortion. text.r = texture(SCREEN_TEXTURE, text_uv + roll_uv * 0.8 + vec2(aberration, 0.0) * .1).r; @@ -139,43 +139,43 @@ void fragment() } else { - // If roll is false only apply the aberration without any distorion. The aberration values are very small so the .1 is only + // If roll is false only apply the aberration without any distorion. The aberration values are very small so the .1 is only // to make the slider in the Inspector less sensitive. text.r = texture(SCREEN_TEXTURE, text_uv + vec2(aberration, 0.0) * .1).r; text.g = texture(SCREEN_TEXTURE, text_uv - vec2(aberration, 0.0) * .1).g; text.b = texture(SCREEN_TEXTURE, text_uv).b; text.a = 1.0; } - + float r = text.r; float g = text.g; float b = text.b; - + uv = warp(UV); - - // CRT monitors don't have pixels but groups of red, green and blue dots or lines, called grille. We isolate the texture's color channels + + // CRT monitors don't have pixels but groups of red, green and blue dots or lines, called grille. We isolate the texture's color channels // and divide it up in 3 offsetted lines to show the red, green and blue colors next to each other, with a small black gap between. if (grille_opacity > 0.0){ - + float g_r = smoothstep(0.85, 0.95, abs(sin(uv.x * (resolution.x * 3.14159265)))); r = mix(r, r * g_r, grille_opacity); - + float g_g = smoothstep(0.85, 0.95, abs(sin(1.05 + uv.x * (resolution.x * 3.14159265)))); g = mix(g, g * g_g, grille_opacity); - + float b_b = smoothstep(0.85, 0.95, abs(sin(2.1 + uv.x * (resolution.x * 3.14159265)))); b = mix(b, b * b_b, grille_opacity); - + } - + // Apply the grille to the texture's color channels and apply Brightness. Since the grille and the scanlines (below) make the image very dark you // can compensate by increasing the brightness. text.r = clamp(r * brightness, 0.0, 1.0); text.g = clamp(g * brightness, 0.0, 1.0); text.b = clamp(b * brightness, 0.0, 1.0); - - // Scanlines are the horizontal lines that make up the image checked a CRT monitor. - // Here we are actual setting the black gap between each line, which I guess is not the right definition of the word, but you get the idea + + // Scanlines are the horizontal lines that make up the image on a CRT monitor. + // Here we are actual setting the black gap between each line, which I guess is not the right definition of the word, but you get the idea float scanlines = 0.5; if (scanlines_opacity > 0.0) { @@ -183,39 +183,39 @@ void fragment() scanlines = smoothstep(scanlines_width, scanlines_width + 0.5, abs(sin(uv.y * (resolution.y * 3.14159265)))); text.rgb = mix(text.rgb, text.rgb * vec3(scanlines), scanlines_opacity); } - + // Apply the banded noise. if (noise_opacity > 0.0) { // Generate a noise pattern that is very stretched horizontally, and animate it with noise_speed float noise = smoothstep(0.4, 0.5, noise(uv * vec2(2.0, 200.0) + vec2(10.0, (TIME * (noise_speed))) ) ); - - // We use roll_line (set above) to define how big the noise should be vertically (multiplying cuts unchecked all black parts). - // We also add in some basic noise with random() to break up the noise pattern above. The noise is sized according to - // the resolution value set in the inspector. If you don't like this look you can + + // We use roll_line (set above) to define how big the noise should be vertically (multiplying cuts off all black parts). + // We also add in some basic noise with random() to break up the noise pattern above. The noise is sized according to + // the resolution value set in the inspector. If you don't like this look you can // change \"ceil(uv * resolution) / resolution\" to only \"uv\" to make it less pixelated. Or multiply resolution with som value // greater than 1.0 to make them smaller. roll_line *= noise * scanlines * clamp(random((ceil(uv * resolution) / resolution) + vec2(TIME * 0.8, 0.0)).x + 0.8, 0.0, 1.0); - // Add it to the texture based checked noise_opacity + // Add it to the texture based on noise_opacity text.rgb = clamp(mix(text.rgb, text.rgb + roll_line, noise_opacity), vec3(0.0), vec3(1.0)); } - + // Apply static noise by generating it over the whole screen in the same way as above if (static_noise_intensity > 0.0) { text.rgb += clamp(random((ceil(uv * resolution) / resolution) + fract(TIME)).x, 0.0, 1.0) * static_noise_intensity; } - + // Apply a black border to hide imperfections caused by the warping. // Also apply the vignette text.rgb *= border(uv); text.rgb *= vignette(uv); - // Hides the black border and make that area transparent. Good if you want to add the the texture checked top an image of a TV or monitor. + // Hides the black border and make that area transparent. Good if you want to add the the texture on top an image of a TV or monitor. if (clip_warp) { text.a = border(uv); } - + // Apply discoloration to get a VHS look (lower saturation and higher contrast) // You can play with the values below or expose them in the Inspector. float saturation = 0.5; @@ -225,12 +225,12 @@ void fragment() // Saturation vec3 greyscale = vec3(text.r + text.g + text.b) / 3.; text.rgb = mix(text.rgb, greyscale, saturation); - + // Contrast float midpoint = pow(0.5, 2.2); text.rgb = (text.rgb - vec3(midpoint)) * contrast + midpoint; } - + COLOR = text; }" diff --git a/examples/web_console/web_console.gd b/examples/web_console/web_console.gd index 90aefd1..916981a 100644 --- a/examples/web_console/web_console.gd +++ b/examples/web_console/web_console.gd @@ -42,7 +42,7 @@ func _on_Terminal_key_pressed(_data, event: InputEventKey): if not event: return - # For some reason, data String is malformed checked HTML5, so only use event.unicode. + # For some reason, data String is malformed on HTML5, so only use event.unicode. var data = char(event.unicode) match event.scancode: