Skip to content

Commit

Permalink
Merge pull request #17 from Maaack/doc-comments
Browse files Browse the repository at this point in the history
Doc comments
  • Loading branch information
Maaack authored Dec 23, 2023
2 parents 1331511 + 06dda4d commit 917b8b2
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 7 deletions.
1 change: 1 addition & 0 deletions App/Scripts/AppLog.gd
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion App/Scripts/AppSettings.gd
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 9 additions & 0 deletions App/Scripts/CaptureFocus.gd
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 2 additions & 1 deletion App/Scripts/Config.gd
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 6 additions & 1 deletion App/Scripts/InGameMenuController.gd
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion App/Scripts/InputHelper.gd
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion App/Scripts/PauseMenuController.gd
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions App/Scripts/SceneLoader.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extends Node
## Autoload class for loading scenes while showing a progress bar.

signal scene_loaded

Expand Down
8 changes: 7 additions & 1 deletion App/Scripts/UISoundController.gd
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions Extras/Scripts/CaptureMouse.gd
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 1 addition & 0 deletions Extras/Scripts/GameLevelLog.gd
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions Extras/Scripts/GameLog.gd
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion Extras/Scripts/LevelLoader.gd
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Extras/Scripts/SceneLister.gd
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 917b8b2

Please sign in to comment.