Skip to content

Commit 702ec89

Browse files
committed
go back to normal comments since the vscode addon does not parse them properly
1 parent 64efef4 commit 702ec89

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

addons/mod_loader/mod_data.gd

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
extends Resource
22
class_name ModData
33

4-
## Stores and validates all Data required to load a mod successfully
5-
## If some of the data is invalid, [member is_loadable] will be false
4+
# Stores and validates all Data required to load a mod successfully
5+
# If some of the data is invalid, [member is_loadable] will be false
66

77
const LOG_NAME := "ModLoader:ModData"
88

9-
## These 2 files are always required by mods.
10-
## [i]mod_main.gd[/i] = The main init file for the mod
11-
## [i]manifest.json[/i] = Meta data for the mod, including its dependencies
9+
# These 2 files are always required by mods.
10+
# [i]mod_main.gd[/i] = The main init file for the mod
11+
# [i]manifest.json[/i] = Meta data for the mod, including its dependencies
1212
enum required_mod_files {
1313
MOD_MAIN,
1414
MANIFEST,
1515
}
1616

17-
## Directory of the mod. Has to be identical to [method ModManifest.get_mod_id]
17+
# Directory of the mod. Has to be identical to [method ModManifest.get_mod_id]
1818
var dir_name := ""
19-
## Path to the Mod's Directory
19+
# Path to the Mod's Directory
2020
var dir_path := ""
21-
## False if any data is invalid
21+
# False if any data is invalid
2222
var is_loadable := true
23-
## Is increased for every mod depending on this mod. Highest importance is loaded first
23+
# Is increased for every mod depending on this mod. Highest importance is loaded first
2424
var importance := 0
25-
## Contents of the manifest
25+
# Contents of the manifest
2626
var manifest: ModManifest
27-
## Updated in _load_mod_configs
27+
# Updated in _load_mod_configs
2828
var config := {}
2929

30-
## only set if DEBUG_ENABLE_STORING_FILEPATHS is enabled
30+
# only set if DEBUG_ENABLE_STORING_FILEPATHS is enabled
3131
var file_paths := []
3232

3333

3434
func _init(_dir_path: String) -> void:
3535
dir_path = _dir_path
3636

3737

38-
## Load meta data from a mod's manifest.json file
38+
# Load meta data from a mod's manifest.json file
3939
func load_manifest() -> void:
4040
if not has_required_files():
4141
return
@@ -57,7 +57,7 @@ func load_manifest() -> void:
5757
manifest = mod_manifest
5858

5959

60-
## Validates if [member dir_name] matches [method ModManifest.get_mod_id]
60+
# Validates if [member dir_name] matches [method ModManifest.get_mod_id]
6161
func is_mod_dir_name_same_as_id() -> bool:
6262
var manifest_id = manifest.get_mod_id()
6363
if dir_name != manifest_id:
@@ -67,7 +67,7 @@ func is_mod_dir_name_same_as_id() -> bool:
6767
return true
6868

6969

70-
## Confirms that all files from [member required_mod_files] exist
70+
# Confirms that all files from [member required_mod_files] exist
7171
func has_required_files() -> bool:
7272
var file_check = File.new()
7373

@@ -80,12 +80,12 @@ func has_required_files() -> bool:
8080
return is_loadable
8181

8282

83-
## Validates if manifest is set
83+
# Validates if manifest is set
8484
func has_manifest() -> bool:
8585
return not manifest == null
8686

8787

88-
## Converts enum indices [member required_mod_files] into their respective file paths
88+
# Converts enum indices [member required_mod_files] into their respective file paths
8989
func get_required_mod_file_path(required_file: int) -> String:
9090
match required_file:
9191
required_mod_files.MOD_MAIN:
@@ -95,8 +95,8 @@ func get_required_mod_file_path(required_file: int) -> String:
9595
return ""
9696

9797

98-
## Parses JSON from a given file path and returns a dictionary.
99-
## Returns an empty dictionary if no file exists (check with size() < 1)
98+
# Parses JSON from a given file path and returns a dictionary.
99+
# Returns an empty dictionary if no file exists (check with size() < 1)
100100
static func _get_json_as_dict(path:String) -> Dictionary: # todo move to utils
101101
var file = File.new()
102102

addons/mod_loader/mod_manifest.gd

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
extends Resource
2-
## Stores and validates contents of the manifest set by the user
2+
# Stores and validates contents of the manifest set by the user
33
class_name ModManifest
44

55

6-
## Mod name.
7-
## Validated by [method is_name_or_namespace_valid]
6+
# Mod name.
7+
# Validated by [method is_name_or_namespace_valid]
88
var name := ""
9-
## Mod namespace, most commonly the main author.
10-
## Validated by [method is_name_or_namespace_valid]
9+
# Mod namespace, most commonly the main author.
10+
# Validated by [method is_name_or_namespace_valid]
1111
var namespace := ""
12-
## Semantic version. Not a number, but required to be named like this by Thunderstore
13-
## Validated by [method is_semver_valid]
12+
# Semantic version. Not a number, but required to be named like this by Thunderstore
13+
# Validated by [method is_semver_valid]
1414
var version_number := "0.0.0"
1515
var description := ""
1616
var website_url := ""
17-
## Used to determine mod load order
17+
# Used to determine mod load order
1818
var dependencies := [] # Array[String]
1919

2020
var authors := [] # Array[String]
21-
## only used for information
21+
# only used for information
2222
var compatible_game_version := [] # Array[String]
23-
## only used for information
23+
# only used for information
2424
var incompatibilities := [] # Array[String]
2525
var tags := [] # Array[String]
2626
var description_rich := ""
2727
var image: StreamTexture
2828

2929

30-
## Required keys in a mod's manifest.json file
30+
# Required keys in a mod's manifest.json file
3131
const REQUIRED_MANIFEST_KEYS_ROOT = [
3232
"name",
3333
"namespace",
@@ -38,7 +38,7 @@ const REQUIRED_MANIFEST_KEYS_ROOT = [
3838
"extra",
3939
]
4040

41-
## Required keys in manifest's `json.extra.godot`
41+
# Required keys in manifest's `json.extra.godot`
4242
const REQUIRED_MANIFEST_KEYS_EXTRA = [
4343
"authors",
4444
"compatible_mod_loader_version",
@@ -48,8 +48,8 @@ const REQUIRED_MANIFEST_KEYS_EXTRA = [
4848
]
4949

5050

51-
## Takes the manifest as [Dictionary] and validates everything.
52-
## Will return null if something is invalid.
51+
# Takes the manifest as [Dictionary] and validates everything.
52+
# Will return null if something is invalid.
5353
func _init(manifest: Dictionary) -> void:
5454
if (not dict_has_fields(manifest, REQUIRED_MANIFEST_KEYS_ROOT) or
5555
not dict_has_fields(manifest.extra, ["godot"]) or
@@ -79,21 +79,21 @@ func _init(manifest: Dictionary) -> void:
7979
# image StreamTexture
8080

8181

82-
## Mod ID used in the mod loader
83-
## Format: {namespace}-{name}
82+
# Mod ID used in the mod loader
83+
# Format: {namespace}-{name}
8484
func get_mod_id() -> String:
8585
return "%s-%s" % [namespace, name]
8686

8787

88-
## Package ID used by Thunderstore
89-
## Format: {namespace}-{name}-{version_number}
88+
# Package ID used by Thunderstore
89+
# Format: {namespace}-{name}-{version_number}
9090
func get_package_id() -> String:
9191
return "%s-%s-%s" % [namespace, name, version_number]
9292

9393

94-
## A valid namespace may only use letters (any case), numbers and underscores
95-
## and has to be longer than 3 characters
96-
## /^[a-zA-Z0-9_]{3,}$/
94+
# A valid namespace may only use letters (any case), numbers and underscores
95+
# and has to be longer than 3 characters
96+
# /^[a-zA-Z0-9_]{3,}$/
9797
static func is_name_or_namespace_valid(name: String) -> bool:
9898
var re := RegEx.new()
9999
re.compile("^[a-zA-Z0-9_]*$") # alphanumeric and _
@@ -110,9 +110,9 @@ static func is_name_or_namespace_valid(name: String) -> bool:
110110
return true
111111

112112

113-
## A valid semantic version should follow this format: {mayor}.{minor}.{patch}
114-
## reference https://semver.org/ for details
115-
## /^[0-9]+\\.[0-9]+\\.[0-9]+$/
113+
# A valid semantic version should follow this format: {mayor}.{minor}.{patch}
114+
# reference https://semver.org/ for details
115+
# /^[0-9]+\\.[0-9]+\\.[0-9]+$/
116116
static func is_semver_valid(version_number: String) -> bool:
117117
var re := RegEx.new()
118118
re.compile("^[0-9]+\\.[0-9]+\\.[0-9]+$")
@@ -125,22 +125,22 @@ static func is_semver_valid(version_number: String) -> bool:
125125
return true
126126

127127

128-
## Returns an empty String if the key does not exist
128+
# Returns an empty String if the key does not exist
129129
static func _get_string_from_dict(dict: Dictionary, key: String) -> String:
130130
if not dict.has(key):
131131
return ""
132132
return dict[key]
133133

134134

135-
## Returns an empty Array if the key does not exist
135+
# Returns an empty Array if the key does not exist
136136
static func _get_array_from_dict(dict: Dictionary, key: String) -> Array:
137137
if not dict.has(key):
138138
return []
139139
return dict[key]
140140

141141

142-
## Works like [method Dictionary.has_all],
143-
## but allows for more specific errors if a field is missing
142+
# Works like [method Dictionary.has_all],
143+
# but allows for more specific errors if a field is missing
144144
static func dict_has_fields(dict: Dictionary, required_fields: Array) -> bool:
145145
var missing_fields := required_fields
146146

0 commit comments

Comments
 (0)