Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/gut/awaiter.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extends Node

class AwaitLogger:
class GutAwaiterLogger:
var _time_waited = 0.0
var logger = GutUtils.get_logger()
var waiting_on = "nothing"
Expand Down Expand Up @@ -31,7 +31,7 @@ class AwaitLogger:
signal timeout
signal wait_started

var await_logger = AwaitLogger.new()
var await_logger = GutAwaiterLogger.new()
var _wait_time := 0.0
var _wait_process_frames := 0
var _wait_physics_frames := 0
Expand Down
4 changes: 2 additions & 2 deletions addons/gut/cli/gut_cli.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var GutRunner = load('res://addons/gut/gui/GutRunner.tscn')
# hash with null values for the other types of values. Lower precedented hashes
# will punch through null values of higher precedented hashes.
# ------------------------------------------------------------------------------
class OptionResolver:
class GutCliOptionResolver:
var base_opts = {}
var cmd_opts = {}
var config_opts = {}
Expand Down Expand Up @@ -250,7 +250,7 @@ func _check_for_update():

# parse options and run Gut
func main():
var opt_resolver = OptionResolver.new()
var opt_resolver = GutCliOptionResolver.new()
opt_resolver.set_base_opts(_gut_config.default_options)

var cli_opts = setup_options(_gut_config.default_options, _gut_config.valid_fonts)
Expand Down
32 changes: 16 additions & 16 deletions addons/gut/cli/optparse.gd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
#
# value will return the default when it has not been set.
#-------------------------------------------------------------------------------
class Option:
class OptParseOption:
var _has_been_set = false
var _value = null
# REMEMBER that when this option is an array, you have to set the value
Expand Down Expand Up @@ -221,7 +221,7 @@ class Option:
#-------------------------------------------------------------------------------
# A struct for organizing options by a heading
#-------------------------------------------------------------------------------
class OptionHeading:
class OptParseOptionHeading:
var options = []
var display = 'default'

Expand All @@ -232,19 +232,19 @@ class OptionHeading:
# Organizes options by order, heading, position. Also responsible for all
# help related text generation.
#-------------------------------------------------------------------------------
class Options:
class OptParseOptions:
var options = []
var positional = []
var default_heading = OptionHeading.new()
var script_option = Option.new('-s', '?', 'script option provided by Godot')
var default_heading = OptParseOptionHeading.new()
var script_option = OptParseOption.new('-s', '?', 'script option provided by Godot')

var _options_by_name = {"--script": script_option, "-s": script_option}
var _options_by_heading = [default_heading]
var _cur_heading = default_heading


func add_heading(display):
var heading = OptionHeading.new()
var heading = OptParseOptionHeading.new()
heading.display = display
_cur_heading = heading
_options_by_heading.append(heading)
Expand Down Expand Up @@ -347,7 +347,7 @@ class Options:
#
#-------------------------------------------------------------------------------
## @ignore
var options := Options.new()
var options := OptParseOptions.new()
## Set the banner property to any text you want to appear before the usage and
## options sections when printing the options help.
var banner := ''
Expand Down Expand Up @@ -474,10 +474,10 @@ func is_option(arg) -> bool:
## If the option is not successfully added (e.g. a name collision with another
## option occurs), an error message will be printed and [code]null[/code]
## will be returned.
func add(op_names, default, desc: String) -> Option:
func add(op_names, default, desc: String) -> OptParseOption:
var op_name: String
var aliases: Array[String] = []
var new_op: Option = null
var new_op: OptParseOption = null

if(typeof(op_names) == TYPE_STRING):
op_name = op_names
Expand All @@ -494,7 +494,7 @@ func add(op_names, default, desc: String) -> Option:
elif bad_alias != -1:
push_error(str('Option [', aliases[bad_alias], '] already exists.'))
else:
new_op = Option.new(op_name, default, desc)
new_op = OptParseOption.new(op_name, default, desc)
options.add(new_op, aliases)

return new_op
Expand All @@ -514,7 +514,7 @@ func add(op_names, default, desc: String) -> Option:
## If the option is not successfully added (e.g. a name collision with another
## option occurs), an error message will be printed and [code]null[/code]
## will be returned.
func add_required(op_names, default, desc: String) -> Option:
func add_required(op_names, default, desc: String) -> OptParseOption:
var op := add(op_names, default, desc)
if(op != null):
op.required = true
Expand All @@ -535,12 +535,12 @@ func add_required(op_names, default, desc: String) -> Option:
## If the option is not successfully added (e.g. a name collision with another
## option occurs), an error message will be printed and [code]null[/code]
## will be returned.
func add_positional(op_name, default, desc: String) -> Option:
func add_positional(op_name, default, desc: String) -> OptParseOption:
var new_op = null
if(options.get_by_name(op_name) != null):
push_error(str('Positional option [', op_name, '] already exists.'))
else:
new_op = Option.new(op_name, default, desc)
new_op = OptParseOption.new(op_name, default, desc)
options.add_positional(new_op)
return new_op

Expand All @@ -561,7 +561,7 @@ func add_positional(op_name, default, desc: String) -> Option:
## If the option is not successfully added (e.g. a name collision with another
## option occurs), an error message will be printed and [code]null[/code]
## will be returned.
func add_positional_required(op_name, default, desc: String) -> Option:
func add_positional_required(op_name, default, desc: String) -> OptParseOption:
var op = add_positional(op_name, default, desc)
if(op != null):
op.required = true
Expand All @@ -582,7 +582,7 @@ func add_heading(display_text: String) -> void:
## If the option exists, the value assigned to it during parsing is returned.
## Otherwise, an error message is printed and [code]null[/code] is returned.
func get_value(name: String):
var found_param: Option = options.get_by_name(name)
var found_param: OptParseOption = options.get_by_name(name)

if(found_param != null):
return found_param.value
Expand All @@ -602,7 +602,7 @@ func get_value(name: String):
## then you do not want to get the default value for a command line option or
## it will overwrite the value in a config file.
func get_value_or_null(name: String):
var found_param: Option = options.get_by_name(name)
var found_param: OptParseOption = options.get_by_name(name)

if(found_param != null and found_param.has_been_set()):
return found_param.value
Expand Down
4 changes: 2 additions & 2 deletions addons/gut/gui/OutputText.gd
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func _add_other_ctrls():
var fname = GutUtils.gut_fonts.DEFAULT_CUSTOM_FONT_NAME
if(_user_prefs != null):
fname = _user_prefs.output_font_name.value
_font_name_pctrl = PanelControls.SelectControl.new('Font', fname, GutUtils.avail_fonts,
_font_name_pctrl = PanelControls.GpcSelect.new('Font', fname, GutUtils.avail_fonts,
"The font, you know, for the text below. Change it, see what it does.")
_font_name_pctrl.changed.connect(_on_font_name_changed)
_font_name_pctrl.label.size_flags_horizontal = SIZE_SHRINK_BEGIN
Expand All @@ -155,7 +155,7 @@ func _add_other_ctrls():
var fsize = 30
if(_user_prefs != null):
fsize = _user_prefs.output_font_size.value
_font_size_pctrl = PanelControls.NumberControl.new('Font Size', fsize , 5, 100,
_font_size_pctrl = PanelControls.GpcNumber.new('Font Size', fsize , 5, 100,
"The size of 'The Font'.")
_font_size_pctrl.changed.connect(_on_font_size_changed)
_font_size_pctrl.label.size_flags_horizontal = SIZE_SHRINK_BEGIN
Expand Down
8 changes: 4 additions & 4 deletions addons/gut/gui/ResultsTree.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://dls5r5f6157nq"]
[gd_scene format=3 uid="uid://dls5r5f6157nq"]

[ext_resource type="Script" uid="uid://dehdhn78qv5tr" path="res://addons/gut/gui/ResultsTree.gd" id="1_b4uub"]

[node name="ResultsTree" type="Tree"]
[node name="ResultsTree" type="Tree" unique_id=2083877882]
offset_right = 1082.0
offset_bottom = 544.0
size_flags_horizontal = 3
Expand All @@ -11,7 +11,7 @@ columns = 2
hide_root = true
script = ExtResource("1_b4uub")

[node name="TextOverlay" type="Label" parent="."]
[node name="TextOverlay" type="Label" parent="." unique_id=397271335]
visible = false
layout_mode = 1
anchors_preset = 15
Expand All @@ -20,7 +20,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="ResultsTree" type="VBoxContainer" parent="."]
[node name="ResultsTree" type="VBoxContainer" parent="." unique_id=1266326887]
custom_minimum_size = Vector2(10, 10)
layout_mode = 1
anchors_preset = 15
Expand Down
2 changes: 1 addition & 1 deletion addons/gut/gui/gut_config_gui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func _init(cont):


func _add_save_load():
var ctrl = PanelControls.SaveLoadControl.new('Config', '', '')
var ctrl = PanelControls.GpcSaveLoad.new('Config', '', '')

ctrl.save_path_chosen.connect(_on_save_path_chosen)
ctrl.load_path_chosen.connect(_on_load_path_chosen)
Expand Down
6 changes: 3 additions & 3 deletions addons/gut/gui/gut_logo.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@tool
extends Node2D

class Eyeball:
class GutEyeball:
extends Node2D

var _should_draw_laser = false
Expand Down Expand Up @@ -139,8 +139,8 @@ var GutEditorGlobals = load('res://addons/gut/gui/editor_globals.gd')

@onready var _reset_timer = $ResetTimer
@onready var _face_button = $FaceButton
@onready var left_eye : Eyeball = Eyeball.new($BaseLogo/LeftEye)
@onready var right_eye : Eyeball = Eyeball.new($BaseLogo/RightEye)
@onready var left_eye : GutEyeball = GutEyeball.new($BaseLogo/LeftEye)
@onready var right_eye : GutEyeball = GutEyeball.new($BaseLogo/RightEye)

var _no_shine = load("res://addons/gut/images/GutIconV2_no_shine.png")
var _normal = load("res://addons/gut/images/GutIconV2_base.png")
Expand Down
20 changes: 10 additions & 10 deletions addons/gut/gui/option_maker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,56 @@ func add_ctrl(key, ctrl):


func add_number(key, value, disp_text, v_min, v_max, hint=''):
var ctrl = PanelControls.NumberControl.new(disp_text, value, v_min, v_max, hint)
var ctrl = PanelControls.GpcNumber.new(disp_text, value, v_min, v_max, hint)
add_ctrl(key, ctrl)
return ctrl


func add_float(key, value, disp_text, step, v_min, v_max, hint=''):
var ctrl = PanelControls.FloatControl.new(disp_text, value, step, v_min, v_max, hint)
var ctrl = PanelControls.GpcFloat.new(disp_text, value, step, v_min, v_max, hint)
add_ctrl(key, ctrl)
return ctrl


func add_select(key, value, values, disp_text, hint=''):
var ctrl = PanelControls.SelectControl.new(disp_text, value, values, hint)
var ctrl = PanelControls.GpcSelect.new(disp_text, value, values, hint)
add_ctrl(key, ctrl)
return ctrl


func add_value(key, value, disp_text, hint=''):
var ctrl = PanelControls.StringControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcString.new(disp_text, value, hint)
add_ctrl(key, ctrl)
return ctrl

func add_multiline_text(key, value, disp_text, hint=''):
var ctrl = PanelControls.MultiLineStringControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcMultiLineString.new(disp_text, value, hint)
add_ctrl(key, ctrl)
return ctrl

func add_boolean(key, value, disp_text, hint=''):
var ctrl = PanelControls.BooleanControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcBoolean.new(disp_text, value, hint)
add_ctrl(key, ctrl)
return ctrl


func add_directory(key, value, disp_text, hint=''):
var ctrl = PanelControls.DirectoryControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcDirectory.new(disp_text, value, hint)
add_ctrl(key, ctrl)
ctrl.dialog.title = disp_text
return ctrl


func add_file(key, value, disp_text, hint=''):
var ctrl = PanelControls.DirectoryControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcDirectory.new(disp_text, value, hint)
add_ctrl(key, ctrl)
ctrl.dialog.file_mode = ctrl.dialog.FILE_MODE_OPEN_FILE
ctrl.dialog.title = disp_text
return ctrl


func add_save_file_anywhere(key, value, disp_text, hint=''):
var ctrl = PanelControls.DirectoryControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcDirectory.new(disp_text, value, hint)
add_ctrl(key, ctrl)
ctrl.dialog.file_mode = ctrl.dialog.FILE_MODE_SAVE_FILE
ctrl.dialog.access = ctrl.dialog.ACCESS_FILESYSTEM
Expand All @@ -85,7 +85,7 @@ func add_save_file_anywhere(key, value, disp_text, hint=''):


func add_color(key, value, disp_text, hint=''):
var ctrl = PanelControls.ColorControl.new(disp_text, value, hint)
var ctrl = PanelControls.GpcColor.new(disp_text, value, hint)
add_ctrl(key, ctrl)
return ctrl

Expand Down
Loading