about summary refs log tree commit diff stats
path: root/apworld/client/manager.gd
diff options
context:
space:
mode:
Diffstat (limited to 'apworld/client/manager.gd')
-rw-r--r--apworld/client/manager.gd16
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
75var strict_purple_ending = false 75var strict_purple_ending = false
76var victory_condition = -1 76var victory_condition = -1
77 77
78var color_by_material_path = {}
79
78signal could_not_connect 80signal could_not_connect
79signal connect_status 81signal connect_status
80signal ap_connected 82signal 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
116func _ready(): 132func _ready():
117 client = SCRIPT_client.new() 133 client = SCRIPT_client.new()