Skip to content

Commit

Permalink
Fix a critical issue where a function was referring to Loggie while L…
Browse files Browse the repository at this point in the history
…oggie might not be present, causing a cascade of errors on fresh installation.
  • Loading branch information
Shiva-Shadowsong committed Oct 19, 2024
1 parent ee5813b commit 895a446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion addons/loggie/loggie_settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func to_dict() -> Dictionary:
"format_warning_msg", "format_notice_msg", "format_info_msg", "format_debug_msg",
"h_separator_symbol", "box_characters_mode", "box_symbols_compatible", "box_symbols_pretty",
]

for var_name in included:
dict[var_name] = Loggie.settings.get(var_name)
dict[var_name] = get(var_name)
return dict
13 changes: 13 additions & 0 deletions addons/loggie/tools/loggie_system_specs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,16 @@ func embed_input_specs() -> LoggieSystemSpecsMsg:
self.add(loggie.msg("Virtual keyboard height:").bold(), DisplayServer.virtual_keyboard_get_height())

return self

## Prints out a bunch of useful data about a given script.
## Useful for debugging.
func embed_script_data(script : Script):
var loggie = get_logger()
var msg = loggie.msg("Script Data for:", script.get_path()).color("pink")
msg.add(":").nl()
msg.add(loggie.msg("get_class():").color("slate_blue").bold()).add(script.get_class()).nl()
msg.add(loggie.msg("get_global_name():").color("slate_blue").bold()).add(script.get_global_name()).nl()
msg.add(loggie.msg("get_base_script():").color("slate_blue").bold()).add(script.get_base_script().resource_path if script.get_base_script() != null else "No base script.").nl()
msg.add(loggie.msg("get_instance_base_type():").color("slate_blue").bold()).add(script.get_instance_base_type()).nl()
msg.add(loggie.msg("get_script_property_list():").color("slate_blue").bold()).add(script.get_script_property_list()).nl()
return self
12 changes: 0 additions & 12 deletions addons/loggie/tools/loggie_tools.gd
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ static func extract_class_name_from_gd_script(path_or_script : Variant, proxy :

return _class_name

## Prints out a bunch of useful data about a given script.
## Useful for debugging.
static func print_script_data(script : Script):
var msg = Loggie.msg("Script Data for:", script.get_path()).color("pink")
msg.add(":").nl()
msg.add(Loggie.msg("get_class():").color("slate_blue").bold()).add(script.get_class()).nl()
msg.add(Loggie.msg("get_global_name():").color("slate_blue").bold()).add(script.get_global_name()).nl()
msg.add(Loggie.msg("get_base_script():").color("slate_blue").bold()).add(script.get_base_script().resource_path if script.get_base_script() != null else "No base script.").nl()
msg.add(Loggie.msg("get_instance_base_type():").color("slate_blue").bold()).add(script.get_instance_base_type()).nl()
msg.add(Loggie.msg("get_script_property_list():").color("slate_blue").bold()).add(script.get_script_property_list()).nl()
msg.info()

## A dictionary of named colors matching the constants from [Color] used to help with rich text coloring.
## There may be a way to obtain these Color values without this dictionary if one can somehow check for the
## existence and value of a constant on the Color class (since they're already there),
Expand Down

0 comments on commit 895a446

Please sign in to comment.