diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-07 18:24:54 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-07 18:24:54 -0400 |
commit | 1ea81f593eda16e9ae93731041a9b7c7f77f8d8b (patch) | |
tree | 149f798f54667d3136d321a7a72573b0ed8eca29 /apworld/client/manager.gd | |
parent | 01c5e5bb28cb751b6c493c4f03b29b2a74b450ad (diff) | |
download | lingo2-archipelago-1ea81f593eda16e9ae93731041a9b7c7f77f8d8b.tar.gz lingo2-archipelago-1ea81f593eda16e9ae93731041a9b7c7f77f8d8b.tar.bz2 lingo2-archipelago-1ea81f593eda16e9ae93731041a9b7c7f77f8d8b.zip |
Fix minimap colors when using a texture pack
Diffstat (limited to 'apworld/client/manager.gd')
-rw-r--r-- | apworld/client/manager.gd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index 4f5018f..dac09b2 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
@@ -75,6 +75,8 @@ var strict_cyan_ending = false | |||
75 | var strict_purple_ending = false | 75 | var strict_purple_ending = false |
76 | var victory_condition = -1 | 76 | var victory_condition = -1 |
77 | 77 | ||
78 | var color_by_material_path = {} | ||
79 | |||
78 | signal could_not_connect | 80 | signal could_not_connect |
79 | signal connect_status | 81 | signal connect_status |
80 | signal ap_connected | 82 | signal ap_connected |
@@ -112,6 +114,20 @@ func _init(): | |||
112 | if data.size() > 6: | 114 | if data.size() > 6: |
113 | show_minimap = data[6] | 115 | show_minimap = data[6] |
114 | 116 | ||
117 | # We need to create a mapping from material paths to the original colors of | ||
118 | # those materials. We force reload the materials, overwriting any custom | ||
119 | # textures, and create the mapping. We then reload the textures in case the | ||
120 | # player had a custom one enabled. | ||
121 | var directory = DirAccess.open("res://assets/materials") | ||
122 | for material_name in directory.get_files(): | ||
123 | var material = ResourceLoader.load( | ||
124 | "res://assets/materials/" + material_name, "", ResourceLoader.CACHE_MODE_REPLACE | ||
125 | ) | ||
126 | |||
127 | color_by_material_path[material.resource_path] = Color(material.albedo_color) | ||
128 | |||
129 | settings.load_user_textures() | ||
130 | |||
115 | 131 | ||
116 | func _ready(): | 132 | func _ready(): |
117 | client = SCRIPT_client.new() | 133 | client = SCRIPT_client.new() |