diff --git a/classes/deck/node_db.gd b/classes/deck/node_db.gd index e91e9ab..e12d0a9 100644 --- a/classes/deck/node_db.gd +++ b/classes/deck/node_db.gd @@ -13,6 +13,11 @@ const NODE_INDEX_CACHE_PATH := "user://nodes_index.json" ## Filepath where the the list of Favorite Nodes is stored. const FAVORITE_NODES_PATH := "user://favorite_nodes.json" +## A map of [code]snake_case[/code] category names for proper capitalization. +const CATEGORY_CAPITALIZATION := { + "obs": "OBS" +} + ## [Array] used for storing all the "Favorite" Nodes that were set in the [AddNodeMenu] var favorite_nodes: Array[String] @@ -128,6 +133,12 @@ func load_favorites() -> void: func is_node_favorite(node_type: String) -> bool: return node_type in favorite_nodes + +## Returns a capitalized category string. +func get_category_capitalization(category: String) -> String: + return CATEGORY_CAPITALIZATION.get(category, category.capitalize()) + + ## Used for storing the shorthand data of a [DeckNode]. ## ## Allows for more simply storing [DeckNode]s properties without needing to diff --git a/graph_node_renderer/add_node_menu.gd b/graph_node_renderer/add_node_menu.gd index 395c1ec..cd3e20f 100644 --- a/graph_node_renderer/add_node_menu.gd +++ b/graph_node_renderer/add_node_menu.gd @@ -25,7 +25,7 @@ func _ready() -> void: ## Add a new category to the menu. func add_category(category_name: String) -> void: - var c := Category.new(category_name.capitalize()) + var c := Category.new(NodeDB.get_category_capitalization(category_name)) categories[category_name] = c scroll_content_container.add_child(c) c.collapse_toggled.connect(_on_category_collapse_toggled.bind(category_name))