@@ -44,11 +44,11 @@ const MOD_LOG_PATH = "user://mods.log"
44
44
const UNPACKED_DIR = "res://mods-unpacked/"
45
45
46
46
# These 2 files are always required by mods.
47
- # ModMain .gd = The main init file for the mod
48
- # _meta .json = Meta data for the mod, including its dependancies
49
- const REQUIRED_MOD_FILES = ["ModMain .gd" , "_meta .json" ]
47
+ # mod_main .gd = The main init file for the mod
48
+ # manifest .json = Meta data for the mod, including its dependancies
49
+ const REQUIRED_MOD_FILES = ["mod_main .gd" , "manifest .json" ]
50
50
51
- # Required keys in a mod's _meta .json file
51
+ # Required keys in a mod's manifest .json file
52
52
const REQUIRED_META_TAGS = [
53
53
"id" ,
54
54
"name" ,
@@ -101,7 +101,7 @@ func _init():
101
101
102
102
# Loop over all loaded mods via their entry in mod_data. Verify that they
103
103
# have all the required files (REQUIRED_MOD_FILES), load their meta data
104
- # (from their _meta .json file), and verify that the meta JSON has all
104
+ # (from their manifest .json file), and verify that the meta JSON has all
105
105
# required properties (REQUIRED_META_TAGS)
106
106
for mod_id in mod_data :
107
107
var mod = mod_data [mod_id ]
@@ -314,8 +314,8 @@ func _init_mod_data(mod_folder_path):
314
314
315
315
for required_filename in REQUIRED_MOD_FILES :
316
316
# Eg:
317
- # "modmain .gd": local_mod_path + "/ModMain .gd",
318
- # "_meta .json": local_mod_path + "/_meta .json"
317
+ # "mod_main .gd": local_mod_path + "/mod_main .gd",
318
+ # "manifest .json": local_mod_path + "/manifest .json"
319
319
mod_data [mod_id ].required_files_path [required_filename ] = local_mod_path + "/" + required_filename
320
320
321
321
@@ -336,21 +336,21 @@ func _check_mod_files(mod_id):
336
336
mod_log (str ("ERROR - " , mod_id , " cannot be loaded due to missing required files" ), LOG_NAME )
337
337
338
338
339
- # Load meta data into mod_data, from a mod's _meta .json file
339
+ # Load meta data into mod_data, from a mod's manifest .json file
340
340
func _load_meta_data (mod_id ):
341
341
mod_log (str ("Loading meta_data for -> " , mod_id ), LOG_NAME )
342
342
var mod = mod_data [mod_id ]
343
343
344
344
# Load meta data file
345
- var meta_path = mod .required_files_path ["_meta .json" ]
345
+ var meta_path = mod .required_files_path ["manifest .json" ]
346
346
var meta_data = _get_json_as_dict (meta_path )
347
347
348
348
dev_log (str (mod_id , " loaded meta data -> " , meta_data ), LOG_NAME )
349
349
350
350
# Check if the meta data has all required fields
351
351
var missing_fields = _check_meta_file (meta_data )
352
352
if (missing_fields .size () > 0 ):
353
- mod_log (str ("ERROR - " , mod_id , " " , missing_fields , " are required in _meta .json." ), LOG_NAME )
353
+ mod_log (str ("ERROR - " , mod_id , " " , missing_fields , " are required in manifest .json." ), LOG_NAME )
354
354
# Flag mod - so it's not loaded later
355
355
mod .is_loadable = false
356
356
# Continue with the next mod
@@ -373,7 +373,7 @@ func _check_meta_file(meta_data):
373
373
374
374
375
375
# Run dependency checks on a mod, checking any dependencies it lists in its
376
- # meta_data (ie. its _meta .json file). If a mod depends on another mod that
376
+ # meta_data (ie. its manifest .json file). If a mod depends on another mod that
377
377
# hasn't been loaded, the dependent mod won't be loaded.
378
378
func _check_dependencies (mod_id :String , deps :Array ):
379
379
dev_log (str ("Checking dependencies - mod_id: " , mod_id , " dependencies: " , deps ), LOG_NAME )
@@ -438,7 +438,7 @@ func _compare_Importance(a, b):
438
438
# Instance every mod and add it as a node to the Mod Loader.
439
439
# Runs mods in the order stored in mod_load_order.
440
440
func _init_mod (mod ):
441
- var mod_main_path = mod .required_files_path ["ModMain .gd" ]
441
+ var mod_main_path = mod .required_files_path ["mod_main .gd" ]
442
442
dev_log (str ("Loading script from -> " , mod_main_path ), LOG_NAME )
443
443
var mod_main_script = ResourceLoader .load (mod_main_path )
444
444
dev_log (str ("Loaded script -> " , mod_main_script ), LOG_NAME )
0 commit comments