Bug markers' colours are now actually affected by project settings, including actively in the editor when changing the associated project settings.
This commit is contained in:
+21
-1
@@ -240,8 +240,11 @@ func _physics_process(_delta:float) -> void:
|
||||
static func instantiate(tree:SceneTree) -> void:
|
||||
tree.root.add_child(load("res://addons/Bugbot/Scenes/bugbot_player.tscn").instantiate() as CharacterBody3D)
|
||||
|
||||
static func load_bug_markers(marker_root:Node3D, bug_list:Array):
|
||||
static func load_bug_markers(marker_root:Node3D, bug_list:Array) -> void:
|
||||
var bug_marker_preload : PackedScene = preload("res://addons/Bugbot/Scenes/bug_marker.tscn")
|
||||
|
||||
Bugbot.adjust_bug_marker_colours()
|
||||
|
||||
for bugbot_data:Resource in bug_list:
|
||||
if bugbot_data is BugbotBugData:
|
||||
var bug_status : BugMarker.BugStatus = BugMarker.BugStatus.NEUTRAL
|
||||
@@ -261,6 +264,23 @@ static func load_bug_markers(marker_root:Node3D, bug_list:Array):
|
||||
bug_marker.global_position = bugbot_data.marker_position
|
||||
bug_marker.set_rotation_to_normal(bugbot_data.marker_normal)
|
||||
|
||||
static func adjust_bug_marker_colours() -> void:
|
||||
var unresolved_colour : Color = ProjectSettings.get_setting("bugbot/markers/unresolved/tint")
|
||||
var in_progress_colour : Color = ProjectSettings.get_setting("bugbot/markers/in_progress/tint")
|
||||
var resolved_colour : Color = ProjectSettings.get_setting("bugbot/markers/resolved/tint")
|
||||
|
||||
var unresolved_material : BugMarkerMaterialPack = load("res://addons/Bugbot/Materials/BugMarker/bug_marker_unresolved.res")
|
||||
(unresolved_material.arrow as ShaderMaterial).set_shader_parameter("colour", unresolved_colour)
|
||||
(unresolved_material.icon as ShaderMaterial).set_shader_parameter("colour", unresolved_colour)
|
||||
|
||||
var in_progress_material : BugMarkerMaterialPack = load("res://addons/Bugbot/Materials/BugMarker/bug_marker_in_progress.res")
|
||||
(in_progress_material.arrow as ShaderMaterial).set_shader_parameter("colour", in_progress_colour)
|
||||
(in_progress_material.icon as ShaderMaterial).set_shader_parameter("colour", in_progress_colour)
|
||||
|
||||
var resolved_material : BugMarkerMaterialPack = load("res://addons/Bugbot/Materials/BugMarker/bug_marker_resolved.res")
|
||||
(resolved_material.arrow as ShaderMaterial).set_shader_parameter("colour", resolved_colour)
|
||||
(resolved_material.icon as ShaderMaterial).set_shader_parameter("colour", resolved_colour)
|
||||
|
||||
|
||||
func __calculate_movement_speed() -> void:
|
||||
if Input.is_action_pressed(&"bugbot_movement_speed_down") or Input.is_action_just_pressed(&"bugbot_movement_speed_down"):
|
||||
|
||||
Reference in New Issue
Block a user