diff --git a/App/Scripts/AppLog.gd b/App/Scripts/AppLog.gd index 68d01b3..1724709 100644 --- a/App/Scripts/AppLog.gd +++ b/App/Scripts/AppLog.gd @@ -1,5 +1,6 @@ class_name AppLog extends Node +## Logs application version and opened count through [Config]. const APP_LOG_SECTION = "AppLog" const APP_OPENED = "AppOpened" diff --git a/App/Scripts/AppSettings.gd b/App/Scripts/AppSettings.gd index 01cbdbd..490d693 100644 --- a/App/Scripts/AppSettings.gd +++ b/App/Scripts/AppSettings.gd @@ -1,5 +1,6 @@ -extends Node class_name AppSettings +extends Node +## Interface to read/write general application settings through [Config]. const INPUT_SECTION = 'InputSettings' const AUDIO_SECTION = 'AudioSettings' diff --git a/App/Scripts/CaptureFocus.gd b/App/Scripts/CaptureFocus.gd index 57a675d..deff66f 100644 --- a/App/Scripts/CaptureFocus.gd +++ b/App/Scripts/CaptureFocus.gd @@ -1,5 +1,14 @@ +class_name CaptureFocus extends Container +## Node that captures UI focus for joypad users. +## +## This script assists with capturing UI focus for joypad users when +## opening, closing, or switching between menus. +## When attached to a node, it will check if it was changed to visible +## and a joypad is being used. If both are true, it will capture focus +## on the first eligible node in its scene tree. +## Hierarchical depth to search in the scene tree. @export var search_depth : int = 1 func _focus_first_search(control_node : Control, levels : int = 1): diff --git a/App/Scripts/Config.gd b/App/Scripts/Config.gd index 6355b7e..2bc0926 100644 --- a/App/Scripts/Config.gd +++ b/App/Scripts/Config.gd @@ -1,5 +1,6 @@ -extends Node class_name Config +extends Node +## Interface for a single configuration file through [ConfigFile]. const CONFIG_FILE_LOCATION := "user://config.cfg" const DEFAULT_CONFIG_FILE_LOCATION := "res://default_config.cfg" diff --git a/App/Scripts/InGameMenuController.gd b/App/Scripts/InGameMenuController.gd index 03ce3fc..e783fb2 100644 --- a/App/Scripts/InGameMenuController.gd +++ b/App/Scripts/InGameMenuController.gd @@ -1,5 +1,10 @@ -extends Node class_name InGameMenuController +extends Node +## Interface for managing a single in-game menu at a time. +## +## This (static) class manages one in-game menu at a time. +## It can optionally safely pause and unpause the game for the menu. +## The scene_tree property must be set for the static methods to work. static var current_menu : CanvasLayer static var scene_tree : SceneTree diff --git a/App/Scripts/InputHelper.gd b/App/Scripts/InputHelper.gd index 9ec75cc..c291496 100644 --- a/App/Scripts/InputHelper.gd +++ b/App/Scripts/InputHelper.gd @@ -1,5 +1,6 @@ -extends Node class_name InputEventHelper +extends Node +## Helper class for organizing constants related to [InputEvent]. const JOYSTICK_LEFT_NAME = "Left Gamepad Joystick" const JOYSTICK_RIGHT_NAME = "Right Gamepad Joystick" diff --git a/App/Scripts/PauseMenuController.gd b/App/Scripts/PauseMenuController.gd index 946badf..40161df 100644 --- a/App/Scripts/PauseMenuController.gd +++ b/App/Scripts/PauseMenuController.gd @@ -1,5 +1,6 @@ -extends Node class_name PauseMenuController +extends Node +## Node for opening a pause menu when detecting a 'ui_cancel' event. @export var pause_menu_packed : PackedScene diff --git a/App/Scripts/SceneLoader.gd b/App/Scripts/SceneLoader.gd index 1427692..ad0bf32 100644 --- a/App/Scripts/SceneLoader.gd +++ b/App/Scripts/SceneLoader.gd @@ -1,4 +1,5 @@ extends Node +## Autoload class for loading scenes while showing a progress bar. signal scene_loaded diff --git a/App/Scripts/UISoundController.gd b/App/Scripts/UISoundController.gd index 0e04016..3ddc1c5 100644 --- a/App/Scripts/UISoundController.gd +++ b/App/Scripts/UISoundController.gd @@ -1,10 +1,16 @@ -extends Node class_name UISoundController +extends Node +## Controller for managing all UI sounds in a scene from one place. +## +## This node manages all of the UI sounds under the provided node path. +## When attached just below the root node of a scene tree, it will manage +## all of the UI sounds in that scene. const MAX_DEPTH = 16 @export var root_path : NodePath = ^".." @export var audio_bus : StringName = &"SFX" +## Continually check any new nodes added to the scene tree. @export var persistent : bool = true : set(value): persistent = value diff --git a/Extras/Scripts/CaptureMouse.gd b/Extras/Scripts/CaptureMouse.gd index 03588f2..115769a 100644 --- a/Extras/Scripts/CaptureMouse.gd +++ b/Extras/Scripts/CaptureMouse.gd @@ -1,4 +1,8 @@ +class_name CaptureMouse extends Control +## Control node that captures the mouse for games that require it. +## +## Used for games that use the mouse to move the camera (ex. FPS or third-person shooters). func _gui_input(event): if event is InputEventMouseButton and Input.mouse_mode != Input.MOUSE_MODE_CAPTURED: diff --git a/Extras/Scripts/GameLevelLog.gd b/Extras/Scripts/GameLevelLog.gd index 9445bb2..3cbdc13 100644 --- a/Extras/Scripts/GameLevelLog.gd +++ b/Extras/Scripts/GameLevelLog.gd @@ -1,5 +1,6 @@ class_name GameLevelLog extends GameLog +## Extends [GameLog] to log current and max level reached through [Config]. const MAX_LEVEL_REACHED = "MaxLevelReached" const CURRENT_LEVEL = "CurrentLevel" diff --git a/Extras/Scripts/GameLog.gd b/Extras/Scripts/GameLog.gd index 4b6dfc1..fbc477c 100644 --- a/Extras/Scripts/GameLog.gd +++ b/Extras/Scripts/GameLog.gd @@ -1,5 +1,6 @@ class_name GameLog extends Node +## Logs total count of games started through [Config]. const GAME_LOG_SECTION = "GameLog" const TOTAL_GAMES_STARTED = "TotalGamesStarted" diff --git a/Extras/Scripts/LevelLoader.gd b/Extras/Scripts/LevelLoader.gd index 6c0757c..65f6a64 100644 --- a/Extras/Scripts/LevelLoader.gd +++ b/Extras/Scripts/LevelLoader.gd @@ -1,6 +1,7 @@ @tool -extends SceneLister class_name LevelLoader +extends SceneLister +## Extends [SceneLister] to manage level advancement through [GameLevelLog]. signal level_loaded signal levels_finished diff --git a/Extras/Scripts/SceneLister.gd b/Extras/Scripts/SceneLister.gd index d045ae0..22543cd 100644 --- a/Extras/Scripts/SceneLister.gd +++ b/Extras/Scripts/SceneLister.gd @@ -1,6 +1,7 @@ @tool extends Node class_name SceneLister +## Helper class for listing all the scenes in a directory. ## List of paths to scene files. ## Prefilled in the editor by selecting a directory.