Skip to content

Asset Manager

NebSeniah edited this page Jun 12, 2026 · 16 revisions

System Summary

The asset manager is a menu that allows the user to import and use their own assets.


Connected Systems

Connecting Systems:

Subsystems:

  • None

Related Controls

Key(s): (Asset Manager button press)

  • Opens the Asset Manager and pauses background functionality

Key(s): (Close button press)

  • Closes the Asset Manager and resumes background functionality

Key(s): (Asset list item press)

  • Selects an asset item and shows its preview

Key(s): (Load button press)

  • Opens the file dialog and allows the user to select a file to replace the currently selected asset

Key(s): (Reset button press)

  • Resets the selected asset to its default image

Bugs

  • None.

Feature List / Breakdown of Features

Asset tabs:

  • Tabs containing the different asset lists
  • Images, animations, audio

Asset list:

  • List of all assets of the tab type
  • Each list item is selectable

Load functionality:

  • Ability for the player to load a file and replace the selected asset
  • If the player is missing even a default texture, it will be replaced by a missing texture.

Reset functionality:

  • Ability for the user to reset the selected asset to its default asset

Asset image preview:

  • A preview of what the selected asset's current image is

Error Messages:

  • Pop up error messages show for unsuccessful processes

Important Variables

  • filePath: String = A file path containing where assets will be stored and retrieved.

  • mainTileMap: TileMapLayer = A reference to the main tile map.

  • previewTileSet: TileMapLayer = A reference to the preview tile set and tile map.

  • tileTypes: Array[String] = An array of all the tile names/types. Set immediately.

  • entityTypes: Array[String] = An array of all the entity names/types. Set immediately.

  • animations: Array[String] = An array of all the animations. Set immediately.

Important Functions

  • func generate_buttons(folder: String, container: VBoxContainer, type: AssetItem.AssetType) -> void: Generates a button per asset type that is specified.

  • func find_image(imageName: String, currentDirectory: String) -> Image: Finds an imageName from the currentDirectory.

  • func find_image_in_folder(folderPath: String) -> Image: Returns the first image found in folderPath.

  • func validate_image(image: Image) -> bool: Determines if image is valid based on multiple criteria.

  • func get_animation_from_folder(folderPath: String) -> Array[Image]: Returns an array with all images in the folder, expected to be a series of sprites for an animation, within the given folderPath.

  • func clear_imagae() -> DirAccess: Clears all stored image assets.

  • func replace_image(newImagePath: String) -> void: Replaces the currently selected image at the given newImagePath.

  • func find_file_by_name(targetFileName: String, currentDirectory: String = filePath) -> String: Searches for a targetFileName in currentDirectory.

  • func find_directory_by_name(targetDirectoryName: String, currentDirectory: String = filePath) -> String: Searches for the targetDirectoryName within a currentDirectory.


Future Work / Risks

Future Work:

  1. Adding functionality for audio files to be replaced

Risks:

  • None.

Miscellaneous Notes

  • None.

Clone this wiki locally