Skip to content

Commit

Permalink
style: 🎨 added and removed whitespace (#292)
Browse files Browse the repository at this point in the history
* style: 🎨 added and removed whitespace

* fix: ✏️ updated comment for profile and cache path

* style: 🎨 added space to params and return types
  • Loading branch information
KANAjetzt authored Jun 21, 2023
1 parent 97de024 commit 4a7b512
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addons/mod_loader/api/mod.gd
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ static func is_mod_loaded(mod_id: String) -> bool:
if not ModLoaderStore.mod_data.has(mod_id) or not ModLoaderStore.mod_data[mod_id].is_loadable:
return false

return true
return true
13 changes: 7 additions & 6 deletions addons/mod_loader/internal/script_extension.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,37 @@ static func handle_script_extensions() -> void:

# Inner class so the sort function can be called by handle_script_extensions()
class InheritanceSorting:
static func _check_inheritances(extension_a:ScriptExtensionData, extension_b:ScriptExtensionData)->bool:

static func _check_inheritances(extension_a: ScriptExtensionData, extension_b: ScriptExtensionData) -> bool:
var a_stack := []
var parent_script: Script = load(extension_a.extension_path)
while parent_script:
a_stack.push_front(parent_script.resource_path)
parent_script = parent_script.get_base_script()
a_stack.pop_back()

var b_stack := []
parent_script = load(extension_b.extension_path)
while parent_script:
b_stack.push_front(parent_script.resource_path)
parent_script = parent_script.get_base_script()
b_stack.pop_back()

var last_index: int
for index in a_stack.size():
if index >= b_stack.size():
return false
if a_stack[index] != b_stack[index]:
return a_stack[index] < b_stack[index]
last_index = index

if last_index < b_stack.size():
# 'a' has a shorter stack
return true

return extension_a.extension_path < extension_b.extension_path


static func apply_extension(extension_path: String) -> Script:
# Check path to file exists
if not File.new().file_exists(extension_path):
Expand Down
5 changes: 3 additions & 2 deletions addons/mod_loader/mod_loader_store.gd
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ var logged_messages := {

# Active user profile
var current_user_profile: ModUserProfile
# List of user profiles loaded from user://mods.json

# List of user profiles loaded from user://mod_user_profiles.json
var user_profiles := {}

# ModLoader cache is stored in user://ModLoaderCache.json
# ModLoader cache is stored in user://mod_loader_cache.json
var cache := {}

# These variables handle various options, which can be changed either via
Expand Down

0 comments on commit 4a7b512

Please sign in to comment.