Adding documentation and smoothing out formatting for non-UI code.#10
Adding documentation and smoothing out formatting for non-UI code.#10BeowulfDragon wants to merge 12 commits into
Conversation
Tweaking the documentation of archipelago.gd and adding/changing spacing and indentation (per the GDScript style guide suggested in the Godot docs) to make it less of a wall of code.
ap_location.gd also has a super broken call, but I'm exclusively doing documentation and formatting currently.
Finished writing documentation for all the classes in ap_files. Also fixed some stuff in archipelago.gd. Finished the documentation of command_manager.gd too. Also I was wrong in a previous commit message about an error in APLocation, I just didn't notice the conn member ~300 lines deep into the source for AP.
With an asterisk, since there's a lot of UI in the domain code, so there has been documentation of UI code.
Still need to do one last big read through before submitting a PR.
Making continuation lines more consistent, enforcing spacing around operators, and more spacing in single-line dictionaries.
Also added documentation to SaveFile, as the docs for APSaveManager wouldn't generate without that having documentation to generate.
EmilyV99
left a comment
There was a problem hiding this comment.
did not review archipelago.gd, command_manager.gd, console_command.gd, or connection_info.gd yet (my brain is not prepared for those files atm).
Also didn't actually look at the generated docs in Godot from this yet.
Gonna drop this with the review comments I have so far though, will need to look deeper later (and probably remove the trackerpack stuff from config.gd on my end, which you noticed wasn't being used at all, as it was entirely outdated 😅)
Feel free to bump this in the discord thread if I don't look at it further soon and you have everything I've commented on here cleaned up
Co-authored-by: Emily <35015090+EmilyV99@users.noreply.github.com>
For Network[Thing]s, Create -> Deserialize. While it's maybe technically demarshalling rather than deserialization, deserialization gets the point across enough. Also not using "create" makes it clear that nothing is happening on the server or other clients.
EmilyV99
left a comment
There was a problem hiding this comment.
looked through the command code, still gotta check the two big main files.
| # Commands currently available to use, indexed by name. | ||
| var _commands_by_name: Dictionary[String, ConsoleCommand] | ||
|
|
||
| ## Controls if debug commands should be hidden. |
There was a problem hiding this comment.
| ## Controls if debug commands should be hidden. | |
| ## Controls if debug commands should be hidden. | |
| ## Cannot be modified in non-debug builds. |
|
|
||
|
|
||
| ## Get the autofilled parameters for a command message, up to the number of arguments specified in | ||
| ## [param capacity]. |
There was a problem hiding this comment.
| ## [param capacity]. | |
| ## [param capacity]. A capacity of 0 is unlimited. |
| return | ||
| var cmd := get_command(msg.split(" ", true, 1)[0]) | ||
| if cmd and cmd.call_proc: | ||
| if cmd.is_disabled(): |
There was a problem hiding this comment.
| if cmd.is_disabled(): | |
| if cmd.is_disabled() or (cmd.is_debug() and debug_disabled()): |
just noticed this issue on my end 😅
|
|
||
| # Check if [param cmd] is enabled. | ||
| static func _cmd_is_enabled(cmd: ConsoleCommand) -> bool: | ||
| return not cmd.is_disabled() |
There was a problem hiding this comment.
| return not cmd.is_disabled() | |
| return not (cmd.is_disabled() or (cmd.is_debug() and debug_disabled())) |
same error on my end from above 😅
|
|
||
| ## Set [member autofill_proc]. | ||
| func set_autofill(caller: Variant) -> ConsoleCommand: | ||
| assert(caller is bool or caller is Callable) |
There was a problem hiding this comment.
| assert(caller is bool or caller is Callable) | |
| assert(caller is Callable) |
caller being a bool here seems to be an error . . . huh. Another me issue 😅
EmilyV99
left a comment
There was a problem hiding this comment.
finally done reviewing 😅 lmk if you have any follow-up questions on anything I commented on
| var serv_version: Version | ||
| ## The generator's Archipelago version. | ||
| var gen_version: Version | ||
| ## The seed name received from the server. |
There was a problem hiding this comment.
| ## The seed name received from the server. | |
| ## The seed_name received from the server. |
seed_name is the specific key the server sends, naming it the same in the comment here was intentional
| var seed_name: String | ||
| ## The ID of your player. | ||
| var player_id: int | ||
| ## The ID of your team (unimplemented). |
There was a problem hiding this comment.
| ## The ID of your team (unimplemented). | |
| ## The ID of your team. |
teams are being implemented soon™ re: Silvris' teams PR, probably correct to remove this note now
| var player_id: int | ||
| ## The ID of your team (unimplemented). | ||
| var team_id: int | ||
| ## The slot data from the server. |
There was a problem hiding this comment.
| ## The slot data from the server. | |
| ## The slot_data from the server. |
same reasoning as seed_name
| return hints | ||
|
|
||
| ## All locations, by ID | ||
| ## All locations, by ID. |
There was a problem hiding this comment.
| ## All locations, by ID. | |
| ## All locations, by ID. |
extra line after getter/setter seems more correct to me for readability?
| ## Emitted for each item [i]packet[/i] received. | ||
| signal obtained_items(items: Array[NetworkItem]) | ||
| ## Emitted when the server re-sends ALL obtained items | ||
| ## Emitted when the server re-sends ALL obtained items. |
There was a problem hiding this comment.
| ## Emitted when the server re-sends ALL obtained items. | |
| ## Emitted when the server re-sends ALL obtained items, after | |
| ## [signal obtained_items] fires. |
| ## The node is needed, as the representation can depend on the node's 'Theme'. | ||
|
|
||
|
|
||
| ## Get the color represented by this complex color for the proviced [param node]. |
There was a problem hiding this comment.
| ## Get the color represented by this complex color for the proviced [param node]. | |
| ## Get the color represented by this complex color for the provided [param node]. |
| ## Gets a RichColor from a string. 'RichColor.NIL' is returned if the string is invalid. | ||
|
|
||
|
|
||
| ## Gets a [enum RichColor] from [param s]. [code]NIL[/code] is returned if the string is invalid. |
There was a problem hiding this comment.
| ## Gets a [enum RichColor] from [param s]. [code]NIL[/code] is returned if the string is invalid. | |
| ## Gets a [enum RichColor] from [param s]. [member RichColor.NIL] is returned if the string is invalid. |
this should be a reference to the specific member, shouldn't it?
| ## Null unless a node inheriting from [APSaveManager] is added to to | ||
| ## [code]godot_ap/autoloads/archipelago.tscn[/code]. | ||
| ## [br][br] | ||
| ## Can be [code]null[/code] if not provided in [code]godot_ap/autoloads/archipelago.tscn[/code]. |
There was a problem hiding this comment.
Huh. The problem was present before, but this appears to be just saying the same thing twice in a row redundantly. Should reword to not repeat itself
| ## Changes this connection's DeathLink group | ||
| ## Will only send/receive deaths with other clients in the same group | ||
|
|
||
| ## Changes this connection's DeathLink group. |
There was a problem hiding this comment.
| ## Changes this connection's DeathLink group. | |
| ## Changes this connection's DeathLink group name. |
match comment on function below
|
|
||
| ## Set the current Archipelago status. | ||
| ## Set to 'CLIENT_GOAL' when the player has 'won'. | ||
| ## Set to [code]CLIENT_GOAL[/code] when the player has won. |
There was a problem hiding this comment.
could this reference ClientStatus.CLIENT_GOAL with some syntax, rather than a generic code tag?
I was fiddling around with something and wanted to use this library, but found it hard to understand and read, so I have added a bunch of documentation and made the formatting more consistent and readable. I mainly followed the recommended GDScript style guide, except where an alternative style was consistently used and readable. I also broke up as many lines that went over 100 characters as I could, excluding some long strings.
This PR doesn't include documentation for the main UI and app code, only for the files in the
ap_files,autoloads, andmanagersdirectories, andsave_file.gd. Any non-documentation changes should have no functional differences, only changes to formatting.No AI was used in the work done here, I'm just like this.