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

More Code Cleaning #70

Open
2 of 6 tasks
miketvo opened this issue Dec 6, 2024 · 2 comments
Open
2 of 6 tasks

More Code Cleaning #70

miketvo opened this issue Dec 6, 2024 · 2 comments
Assignees
Labels
low priority This is not essential refactor This would make life easier

Comments

@miketvo
Copy link
Owner

miketvo commented Dec 6, 2024

  • @yoantran: Continue Refactor Object.connect() / Object.emit_signal() to Signal.connect() / Signal.emit() where applicable #47 at missed spots (hint: search for .connect(").
  • @yoantran: Update SfxController as follow:
    # ============================================================================ #
    #region Public methods
    
    ## Plays a child [AudioStreamPlayer].
    func play_sound(audio_stream_name: StringName) -> void:
        var audio_stream_player: AudioStreamPlayer = get_node("%s" % audio_stream_name)
        if audio_stream_player:
            audio_stream_player.play()
    
    
    ## Plays a child [AudioStreamPlayer2D].
    func play_sound_2d(audio_stream_name: StringName, position: Vector2, global: bool = true) -> void:
        var audio_stream_player: AudioStreamPlayer2D = get_node("%s" % audio_stream_name)
        if audio_stream_player:
            if global:
                audio_stream_player.global_position = position
            else:
                audio_stream_player.position = position
            audio_stream_player.play()
    
    #endregion
    # ============================================================================ #
  • @yoantran: Refactor .gdshader files to use spaces instead of tabs for indenting.
  • @miketvo: Fix incorrect value in default_bus_layout.tres: Bus Gameplay should be routed to GlobalEffects.
  • @miketvo: Update the signature of State overridable methods to have game_state_data = null default value.
  • @miketvo: Update ssssss/scripts/scenes/level_select/level_select.gd to also detect duplicated level .remap files as follow:
    func _load_levels() -> Error:
        ...
    
        levels = level_dir_list.filter(
                func (file_name: String): return (
                        file_name.ends_with(".tscn") or file_name.ends_with(".scn")
                )
        )
    
        # Remove duplicates using a set (Dictionary), in case some scenes are
        # exported as both 'scene.tscn' and 'scene.tscn.remap', which after trimming
        # 'remap' will leaves duplications.
        var file_names: Dictionary = {}
        for file_name in levels:
            file_names[file_name] = null
        levels = Array(file_names.keys(), TYPE_STRING, &"", null)
    
        levels = Array(levels.map(
                func (level_filename): return LEVEL_DIRECTORY.path_join(level_filename)
        ), TYPE_STRING, &"", null)
    
        ...

Convention:

  • Branch: feature/70-more-code-cleaning.
  • Commit message: [70-more-code-cleaning] <msg here>.
@miketvo miketvo added the feature New feature or request label Dec 6, 2024
@miketvo miketvo self-assigned this Dec 6, 2024
@miketvo miketvo added low priority This is not essential refactor This would make life easier and removed feature New feature or request labels Dec 6, 2024
@miketvo miketvo removed their assignment Dec 6, 2024
@yoantran yoantran self-assigned this Dec 7, 2024
@miketvo miketvo self-assigned this Dec 7, 2024
@yoantran
Copy link
Collaborator

Search pattern

(\w*)\.connect\("(.+)", ([\w\d\.\(\)\{\}\[\]:\s]+)\)

Replace pattern

$1.$2.connect($3)

Files to Include

*.gd

Files to Exclude

addons/*

@miketvo
Copy link
Owner Author

miketvo commented Dec 10, 2024

Item 1 and 2 done by @yoantran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority This is not essential refactor This would make life easier
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants