Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.0.1 #123

Merged
merged 91 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f855719
set more static types, follow style guide more closely, improve reada…
Qubus0 Jan 20, 2023
6245723
fix missing %s in format strings
Qubus0 Jan 21, 2023
cdc0962
upgrade semver validation to disallow leading zeros and overly long v…
Qubus0 Jan 21, 2023
f0fcc55
replace printerr with log_fatal
Qubus0 Jan 21, 2023
e36724b
Merge pull request #71 from Qubus0/no_leading_zero_semver
Qubus0 Jan 21, 2023
81ce17e
Merge pull request #72 from Qubus0/fix_missing_logging_in_mod_manifest
Qubus0 Jan 21, 2023
1bb3df1
Merge branch 'develop' into improve_static_typing_and_style
Qubus0 Jan 21, 2023
7ab5ff7
use PoolStringArray where applicable
Qubus0 Jan 21, 2023
3430715
✔ added file and dir existence check utils
KANAjetzt Jan 22, 2023
01828e5
✅ added overwrite handling
KANAjetzt Jan 22, 2023
c9d5af4
add simple loader self setup through script flag
Qubus0 Jan 23, 2023
11db012
don't attempt setup if the autoload already exists
Qubus0 Jan 23, 2023
71899a6
fix mods dir path not being overridden
Qubus0 Jan 23, 2023
c46abe7
Merge pull request #76 from Qubus0/fix_mods_dir_override
Qubus0 Jan 23, 2023
2d503e8
Merge pull request #75 from Qubus0/self_setup
Qubus0 Jan 23, 2023
6afe7ea
Merge branch 'develop' into improve_static_typing_and_style
Qubus0 Jan 23, 2023
2ef464b
Merge pull request #69 from Qubus0/improve_static_typing_and_style
Qubus0 Jan 23, 2023
758feee
🔨 renamed functions to be more semantic
KANAjetzt Jan 24, 2023
0cb0d51
🔨 2 blank lines after functions
KANAjetzt Jan 24, 2023
f3591b5
🔨 static typing
KANAjetzt Jan 24, 2023
074d9db
fix type inference of game_mod_folder_path
Qubus0 Jan 24, 2023
08f4571
Merge pull request #77 from Qubus0/fix_mod_folder_path_typing
Qubus0 Jan 24, 2023
28cecee
remove run.gd, as it's no longer needed
Qubus0 Jan 24, 2023
415a727
Merge pull request #78 from Qubus0/remove_run_gd
Qubus0 Jan 24, 2023
0c14dd1
Merge branch 'develop' into 14-add-overwrite-functionality
KANAjetzt Jan 24, 2023
65446d1
🔨 removed unnecessary blank lines
KANAjetzt Jan 24, 2023
182e14d
🔨 fill the void
KANAjetzt Jan 24, 2023
1f1cbef
Merge pull request #74 from KANAjetzt/14-add-overwrite-functionality
KANAjetzt Jan 24, 2023
14dd517
Add credits
otDan Jan 25, 2023
d6780da
fix typo in setup where `ModLoaderUtils` should be `modloaderutils`
ithinkandicode Jan 28, 2023
be7861e
Merge pull request #84 from ithinkandicode/fix-modloaderutils-typo
ithinkandicode Jan 28, 2023
db85341
lint - fix not storing returned value in a variable for certain methods
ithinkandicode Jan 28, 2023
3591ccf
lint - fix var type set not being able to be inferred
ithinkandicode Jan 28, 2023
9d76b26
fix errors due to func args having the same name as local vars
ithinkandicode Jan 28, 2023
ad497a1
Merge branch 'develop' into fix-modloaderutils-typo
ithinkandicode Jan 28, 2023
a26c7e2
revert non-inferred var type fix
ithinkandicode Jan 28, 2023
e28c73f
Merge pull request #85 from ithinkandicode/fix-modloaderutils-typo
ithinkandicode Jan 28, 2023
0ff19cf
✔ added reorder_autoloads()
KANAjetzt Feb 3, 2023
0ffb2f1
✔ added file data setup
KANAjetzt Feb 3, 2023
629f707
✔ added project.binary injection
KANAjetzt Feb 3, 2023
91df28c
✔ added godotPckTool
KANAjetzt Feb 3, 2023
70d1696
Merge branch 'develop' into 'project_binary_injection'
KANAjetzt Feb 3, 2023
4bac7cf
✔ cleanup project.binary file after injection
KANAjetzt Feb 3, 2023
9022911
fix typo in `_handle_missing_dependency`
ithinkandicode Feb 4, 2023
a50f01c
✔ added --only-setup cli arg
KANAjetzt Feb 4, 2023
00990c8
validate dependencies and incompatibilities (closes #23)
ithinkandicode Feb 4, 2023
a330c86
Merge pull request #90 from ithinkandicode/fix-missing-deps-typo
ithinkandicode Feb 4, 2023
24196d6
Merge branch 'develop' into validate-dependencies-and-incompatibilities
ithinkandicode Feb 4, 2023
a085597
remove old version from the intro comment
ithinkandicode Feb 4, 2023
aedd826
add constant for version (`MODLOADER_VERSION`)
ithinkandicode Feb 4, 2023
39cd5d6
Merge pull request #93 from ithinkandicode/add-version-number
ithinkandicode Feb 4, 2023
7894de6
Merge branch 'develop' into validate-dependencies-and-incompatibilities
ithinkandicode Feb 4, 2023
87b44cc
Merge pull request #89 from KANAjetzt/project_binary_injection
KANAjetzt Feb 4, 2023
c312784
fix: prevent duplicate global class registration
Qubus0 Feb 4, 2023
5082dfa
refactor: utils global class registration does not save anymore, mod_…
Qubus0 Feb 4, 2023
4195e65
log info instead of warning
Qubus0 Feb 4, 2023
fb10b40
dependency validation: use `get_mod_id`
ithinkandicode Feb 5, 2023
6c5a156
shorten `is_dependency_or_incompatibility_valid` to `is_mod_id_valid`…
ithinkandicode Feb 5, 2023
c87b589
assert that ModLoader is the first autoload
ithinkandicode Feb 5, 2023
6eaf052
Merge pull request #95 from Qubus0/fix_global_class_registration
Qubus0 Feb 5, 2023
c38e2bf
rename var to `is_mod_loader_first`
ithinkandicode Feb 5, 2023
e066e4e
Merge pull request #96 from ithinkandicode/assert-modlaoder-is-first-…
ithinkandicode Feb 5, 2023
3decb33
Merge pull request #91 from ithinkandicode/validate-dependencies-and-…
ithinkandicode Feb 5, 2023
cad3397
Merge pull request #94 from KANAjetzt/only_setup_cmd_arg
KANAjetzt Feb 5, 2023
32150e0
✔ added --setup-create-override-cfg cli arg
KANAjetzt Feb 6, 2023
a064bba
store log backups and rotate them like godot
Qubus0 Feb 6, 2023
d4192ac
Merge pull request #100 from Qubus0/log_backups
Qubus0 Feb 7, 2023
911de38
🔨 fixed the double log
KANAjetzt Feb 7, 2023
fbc97bf
don't log the full manifest by default, add option to do this
ithinkandicode Feb 8, 2023
b412fed
fixes `log_fatal` to add the missing log to file
ithinkandicode Feb 8, 2023
d545ac0
Merge pull request #101 from ithinkandicode/reduce-json-log-length
ithinkandicode Feb 8, 2023
af1c47a
Merge pull request #102 from ithinkandicode/log-fatal-add-missing-fil…
ithinkandicode Feb 8, 2023
adff642
✔ added --setup-create-override-cfg cli arg
KANAjetzt Feb 6, 2023
6eb52eb
🔨 fixed the double log
KANAjetzt Feb 7, 2023
b0b94fd
Merge branch 'setup_create_override_cfg_cli_arg' of https://github.co…
KANAjetzt Feb 8, 2023
5e3c9a6
✔ added get_autoload_array and get_autoload_index
KANAjetzt Feb 8, 2023
64653cf
✔ updated `_check_first_autoload` to use utils
KANAjetzt Feb 8, 2023
0d1b1c8
🔨 added back autoload order logging
KANAjetzt Feb 8, 2023
6a2c22b
🔨 .trim_prefix("autoload/") instead of .split('/')[1]
KANAjetzt Feb 8, 2023
f6181cf
🔨 might as well just use an array
KANAjetzt Feb 8, 2023
2cdbe71
🔨 trim prefix "autoload/" in get_autoload_array()
KANAjetzt Feb 8, 2023
6d7d00f
🧹 removed unnecessary var value in get_autoload_array()
KANAjetzt Feb 8, 2023
10b03ab
Merge pull request #99 from KANAjetzt/setup_create_override_cfg_cli_arg
KANAjetzt Feb 9, 2023
47b75e2
Merge pull request #104 from KANAjetzt/get_mod_loader_position_index
KANAjetzt Feb 9, 2023
0b76416
fix: properly parse all types of command line arg values (#103)
Qubus0 Feb 9, 2023
903cbeb
✔ run setup based on position in autoloads (#105)
KANAjetzt Feb 10, 2023
e984b57
downgrade the missing "mods" dir error to a warning (#107)
ithinkandicode Feb 11, 2023
52104d5
Config JSON Tweaks (#108)
ithinkandicode Feb 13, 2023
a3ff6c4
✔ added checks for override.cfg setup (#110)
KANAjetzt Feb 14, 2023
a6c7ee8
Validate file exists for `add_translation_from_resource` (#118)
ithinkandicode Feb 15, 2023
48b2e3c
chore: updated version const to 5.0.1
KANAjetzt Feb 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions addons/mod_loader/mod_data.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ class_name ModData

const LOG_NAME := "ModLoader:ModData"

# Controls how manifest.json data is logged for each mod
# true = Full JSON contents (floods the log)
# false = Single line (default)
const USE_EXTENDED_DEBUGLOG := false

# These 2 files are always required by mods.
# [i]mod_main.gd[/i] = The main init file for the mod
# [i]manifest.json[/i] = Meta data for the mod, including its dependencies
Expand All @@ -14,12 +19,18 @@ enum required_mod_files {
MANIFEST,
}

enum optional_mod_files {
OVERWRITES
}

# Directory of the mod. Has to be identical to [method ModManifest.get_mod_id]
var dir_name := ""
# Path to the Mod's Directory
var dir_path := ""
# False if any data is invalid
var is_loadable := true
# True if overwrites.gd exists
var is_overwrite := false
# Is increased for every mod depending on this mod. Highest importance is loaded first
var importance := 0
# Contents of the manifest
Expand All @@ -28,7 +39,7 @@ var manifest: ModManifest
var config := {}

# only set if DEBUG_ENABLE_STORING_FILEPATHS is enabled
var file_paths := []
var file_paths: PoolStringArray = []


func _init(_dir_path: String) -> void:
Expand All @@ -45,7 +56,11 @@ func load_manifest() -> void:
# Load meta data file
var manifest_path := get_required_mod_file_path(required_mod_files.MANIFEST)
var manifest_dict := ModLoaderUtils.get_json_as_dict(manifest_path)
ModLoaderUtils.log_debug_json_print("%s loaded manifest data -> " % dir_name, manifest_dict, LOG_NAME)

if USE_EXTENDED_DEBUGLOG:
ModLoaderUtils.log_debug_json_print("%s loaded manifest data -> " % dir_name, manifest_dict, LOG_NAME)
else:
ModLoaderUtils.log_debug(str("%s loaded manifest data -> " % dir_name, manifest_dict), LOG_NAME)

var mod_manifest := ModManifest.new(manifest_dict)

Expand Down Expand Up @@ -95,6 +110,11 @@ func get_required_mod_file_path(required_file: int) -> String:
return dir_path.plus_file("manifest.json")
return ""

func get_optional_mod_file_path(optional_file: int) -> String:
match optional_file:
optional_mod_files.OVERWRITES:
return dir_path.plus_file("overwrites.gd")
return ""

#func _to_string() -> String:
# todo if we want it pretty printed
Expand Down
Loading