Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor numerous areas and tokenize string literals where possible; also fixes some small bugs #487

Merged
merged 6 commits into from
Feb 4, 2022

Conversation

BHSDuncan
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@dploeger dploeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome work. Thanks a lot! Added some smaller remarks and ideas.

@@ -4,6 +4,17 @@ extends Node
class_name ESCBaseCommand


# Regex for creating command name based on the script's filename
const COMMAND_NAME_REGEX = "(.+)\/([^.]+)(\\.[^.]*$|$)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a named group here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. (?<path>.+)\/(?<file>[^.]+)(?<extension>\\.[^.]*$|$)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still valid

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it is, and my push from yesterday addresses it. I think that's why GH marks it as "outdated".

var files = "- %s" % log_file.get_path_absolute()
var message = ProjectSettings.get_setting(
"escoria/debug/crash_message"
var files = "- %s" % log_file.get_path_absolute()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks as if there's some whitespace at the end of this line.

dialog_managers
)


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the whitespace in this line.

# UI-related Escoria project settings
const _UI_ROOT = "ui"

const DEFAULT_DIALOG_TYPE = "%s/%s/default_dialog_type" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the settings descriptions here as well? That would make it easy to document it, because this file would be API-documented anyway.

(Doesn't need to be in this PR, we can add them in a separate issue)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. I agree re adding a new issue.

var inventory_file = "%s/%s.tscn" % [
ProjectSettings.get_setting(
"escoria/ui/items_autoregister_path"
var inventory_file = "%s/%s.tscn" % [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the whitespace on this line

if name.empty():
name = ProjectSettings.get_setting(
"escoria/ui/default_transition"
if name.empty():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the whitespace on this line

@@ -37,85 +37,86 @@ func _ready():

# Prepare the settings in the Escoria UI category
func set_escoria_ui_settings():
escoria.register_setting(
"escoria/ui/default_dialog_type",
escoria.project_settings_manager.register_setting(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should move all this into ESCProjectManager and just call escoria.project_settings_manager.initialize_settings()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up for discussion on that. :) I guess that depends on how fine-grained we want to get with breaking up settings (I think).

@dploeger
Copy link
Collaborator

dploeger commented Feb 2, 2022

It's confusing for me to comment in the middle of the development. I'd say, you're on the right track here, so I'll just review when you're done.

@BHSDuncan BHSDuncan requested a review from dploeger February 2, 2022 21:13
Copy link
Collaborator

@dploeger dploeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional smaller comments. And the unanswered comments also still stand.

[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the closing bracket on line 290 and align it with line 288.

[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See line 289

@@ -4,6 +4,17 @@ extends Node
class_name ESCBaseCommand


# Regex for creating command name based on the script's filename
const COMMAND_NAME_REGEX = "(.+)\/([^.]+)(\\.[^.]*$|$)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still valid

@BHSDuncan BHSDuncan requested a review from dploeger February 3, 2022 18:44
Copy link
Collaborator

@dploeger dploeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff. Thanks a lot! 🎁

@BHSDuncan BHSDuncan requested a review from StraToN February 4, 2022 15:39
@StraToN
Copy link
Collaborator

StraToN commented Feb 4, 2022

Incredible work!! Thanks a lot!! !

@StraToN StraToN merged commit 99dc1e0 into develop Feb 4, 2022
@StraToN StraToN deleted the issue-90 branch February 4, 2022 16:10
balloonpopper pushed a commit to balloonpopper/escoria-demo-game that referenced this pull request Feb 13, 2022
…ible; also fixes some small bugs (godot-escoria#487)

Co-authored-by: Duncan Brown <[email protected]>
BHSDuncan pushed a commit that referenced this pull request Feb 14, 2022
BHSDuncan added a commit that referenced this pull request Feb 28, 2022
BHSDuncan added a commit that referenced this pull request Mar 14, 2022
BHSDuncan added a commit that referenced this pull request Mar 26, 2022
BHSDuncan added a commit that referenced this pull request Mar 30, 2022
BHSDuncan added a commit that referenced this pull request Apr 8, 2022
StraToN pushed a commit that referenced this pull request Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants