diff --git a/Materials/bug.dds b/Materials/BugMarker/bug.dds similarity index 100% rename from Materials/bug.dds rename to Materials/BugMarker/bug.dds diff --git a/Materials/bug_marker.gdshader b/Materials/BugMarker/bug_marker.gdshader similarity index 100% rename from Materials/bug_marker.gdshader rename to Materials/BugMarker/bug_marker.gdshader diff --git a/Materials/BugMarker/bug_marker_arrow.material.depren b/Materials/BugMarker/bug_marker_arrow.material.depren new file mode 100644 index 0000000..898251f Binary files /dev/null and b/Materials/BugMarker/bug_marker_arrow.material.depren differ diff --git a/Materials/BugMarker/bug_marker_arrow_in_progress.material b/Materials/BugMarker/bug_marker_arrow_in_progress.material new file mode 100644 index 0000000..ee23c34 Binary files /dev/null and b/Materials/BugMarker/bug_marker_arrow_in_progress.material differ diff --git a/Materials/BugMarker/bug_marker_arrow_neutral.material b/Materials/BugMarker/bug_marker_arrow_neutral.material new file mode 100644 index 0000000..5696da4 Binary files /dev/null and b/Materials/BugMarker/bug_marker_arrow_neutral.material differ diff --git a/Materials/BugMarker/bug_marker_arrow_resolved.material b/Materials/BugMarker/bug_marker_arrow_resolved.material new file mode 100644 index 0000000..04855bf Binary files /dev/null and b/Materials/BugMarker/bug_marker_arrow_resolved.material differ diff --git a/Materials/BugMarker/bug_marker_arrow_unresolved.material b/Materials/BugMarker/bug_marker_arrow_unresolved.material new file mode 100644 index 0000000..022f900 Binary files /dev/null and b/Materials/BugMarker/bug_marker_arrow_unresolved.material differ diff --git a/Materials/BugMarker/bug_marker_icon.material.depren b/Materials/BugMarker/bug_marker_icon.material.depren new file mode 100644 index 0000000..9e66fb9 Binary files /dev/null and b/Materials/BugMarker/bug_marker_icon.material.depren differ diff --git a/Materials/BugMarker/bug_marker_icon_in_progress.material b/Materials/BugMarker/bug_marker_icon_in_progress.material new file mode 100644 index 0000000..6aae6ab Binary files /dev/null and b/Materials/BugMarker/bug_marker_icon_in_progress.material differ diff --git a/Materials/BugMarker/bug_marker_icon_neutral.material b/Materials/BugMarker/bug_marker_icon_neutral.material new file mode 100644 index 0000000..2949471 Binary files /dev/null and b/Materials/BugMarker/bug_marker_icon_neutral.material differ diff --git a/Materials/BugMarker/bug_marker_icon_resolved.material b/Materials/BugMarker/bug_marker_icon_resolved.material new file mode 100644 index 0000000..112485f Binary files /dev/null and b/Materials/BugMarker/bug_marker_icon_resolved.material differ diff --git a/Materials/BugMarker/bug_marker_icon_unresolved.material b/Materials/BugMarker/bug_marker_icon_unresolved.material new file mode 100644 index 0000000..7a9b43b Binary files /dev/null and b/Materials/BugMarker/bug_marker_icon_unresolved.material differ diff --git a/Materials/BugMarker/bug_marker_in_progress.res b/Materials/BugMarker/bug_marker_in_progress.res new file mode 100644 index 0000000..82bbaa4 Binary files /dev/null and b/Materials/BugMarker/bug_marker_in_progress.res differ diff --git a/Materials/BugMarker/bug_marker_material_pack.gd b/Materials/BugMarker/bug_marker_material_pack.gd new file mode 100644 index 0000000..f509554 --- /dev/null +++ b/Materials/BugMarker/bug_marker_material_pack.gd @@ -0,0 +1,5 @@ +class_name BugMarkerMaterialPack +extends Resource + +@export var arrow : ShaderMaterial +@export var icon : ShaderMaterial diff --git a/Materials/BugMarker/bug_marker_neutral.res b/Materials/BugMarker/bug_marker_neutral.res new file mode 100644 index 0000000..8b8b0d3 Binary files /dev/null and b/Materials/BugMarker/bug_marker_neutral.res differ diff --git a/Materials/BugMarker/bug_marker_resolved.res b/Materials/BugMarker/bug_marker_resolved.res new file mode 100644 index 0000000..02eaac6 Binary files /dev/null and b/Materials/BugMarker/bug_marker_resolved.res differ diff --git a/Materials/BugMarker/bug_marker_unresolved.res b/Materials/BugMarker/bug_marker_unresolved.res new file mode 100644 index 0000000..9604645 Binary files /dev/null and b/Materials/BugMarker/bug_marker_unresolved.res differ diff --git a/Materials/bug_marker_arrow.material b/Materials/bug_marker_arrow.material deleted file mode 100644 index 4c61374..0000000 Binary files a/Materials/bug_marker_arrow.material and /dev/null differ diff --git a/Materials/bug_marker_icon.material b/Materials/bug_marker_icon.material deleted file mode 100644 index 035bbda..0000000 Binary files a/Materials/bug_marker_icon.material and /dev/null differ diff --git a/Meshes/arrow.res b/Meshes/arrow.res index d1c216e..0615a64 100644 Binary files a/Meshes/arrow.res and b/Meshes/arrow.res differ diff --git a/Meshes/laser_beam.res.depren b/Meshes/laser_beam.res.depren deleted file mode 100644 index 176e9c3..0000000 Binary files a/Meshes/laser_beam.res.depren and /dev/null differ diff --git a/Scenes/bug_marker.gd b/Scenes/bug_marker.gd index d214d7d..9cddafa 100644 --- a/Scenes/bug_marker.gd +++ b/Scenes/bug_marker.gd @@ -1,25 +1,23 @@ class_name BugMarker extends Node3D +@export_group("Marker", "marker_") enum BugStatus { NEUTRAL, UNRESOLVED, IN_PROGRESS, RESOLVED } @export var marker_status : BugStatus = BugStatus.NEUTRAL : set = __set_marker_status -const NEUTRAL_COLOUR = Color.CORNFLOWER_BLUE -const UNRESOLVED_COLOUR = Color(0.1, 0.0, 0.0) -const IN_PROGRESS_COLOUR = Color(0.5, 0.5, 0.0) -const RESOLVED_COLOUR = Color(0.0, 1.0, 0.0) +@export var marker_material_neutral : BugMarkerMaterialPack +@export var marker_material_unresolved : BugMarkerMaterialPack +@export var marker_material_in_progress : BugMarkerMaterialPack +@export var marker_material_resolved : BugMarkerMaterialPack +@export_group("") @export var enable_info : bool = true : set = set_info_enabled @onready var __arrow : MeshInstance3D = $Arrow as MeshInstance3D @onready var __billboard : MeshInstance3D = $Billboard as MeshInstance3D @onready var __info_collider : Area3D = $Billboard/Info as Area3D -var __arrow_material : ShaderMaterial -var __billboard_material : ShaderMaterial func _ready() -> void: - __arrow_material = __arrow.mesh.surface_get_material(0) as ShaderMaterial - __billboard_material = __billboard.mesh.surface_get_material(0) as ShaderMaterial set_info_enabled(enable_info) __set_marker_status(marker_status) @@ -35,19 +33,18 @@ func set_info_enabled(_enable:bool): func __set_marker_status(_status:BugStatus) -> void: - if __arrow_material and __billboard_material: - match _status: - BugStatus.NEUTRAL: - __arrow_material.set_shader_parameter("colour", NEUTRAL_COLOUR) - __billboard_material.set_shader_parameter("colour", NEUTRAL_COLOUR) - BugStatus.UNRESOLVED: - __arrow_material.set_shader_parameter("colour", UNRESOLVED_COLOUR) - __billboard_material.set_shader_parameter("colour", UNRESOLVED_COLOUR) - BugStatus.IN_PROGRESS: - __arrow_material.set_shader_parameter("colour", IN_PROGRESS_COLOUR) - __billboard_material.set_shader_parameter("colour", IN_PROGRESS_COLOUR) - BugStatus.RESOLVED: - __arrow_material.set_shader_parameter("colour", RESOLVED_COLOUR) - __billboard_material.set_shader_parameter("colour", RESOLVED_COLOUR) + match _status: + BugStatus.NEUTRAL: + __arrow.set_surface_override_material(0, marker_material_neutral.arrow) + __billboard.set_surface_override_material(0, marker_material_neutral.icon) + BugStatus.UNRESOLVED: + __arrow.set_surface_override_material(0, marker_material_unresolved.arrow) + __billboard.set_surface_override_material(0, marker_material_unresolved.icon) + BugStatus.IN_PROGRESS: + __arrow.set_surface_override_material(0, marker_material_in_progress.arrow) + __billboard.set_surface_override_material(0, marker_material_in_progress.icon) + BugStatus.RESOLVED: + __arrow.set_surface_override_material(0, marker_material_resolved.arrow) + __billboard.set_surface_override_material(0, marker_material_resolved.icon) marker_status = _status diff --git a/Scenes/bug_marker.tscn b/Scenes/bug_marker.tscn index 243b1d8..8bf2c02 100644 --- a/Scenes/bug_marker.tscn +++ b/Scenes/bug_marker.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=6 format=3 uid="uid://crr6cjploetps"] +[gd_scene load_steps=9 format=3 uid="uid://crr6cjploetps"] [ext_resource type="Script" path="res://addons/Bugbot/Scenes/bug_marker.gd" id="1_1adfi"] [ext_resource type="ArrayMesh" uid="uid://dtvea38mlpfla" path="res://addons/Bugbot/Meshes/arrow.res" id="1_65xos"] -[ext_resource type="Material" uid="uid://dkaq0ok73o5d4" path="res://addons/Bugbot/Materials/bug_marker_icon.material" id="3_px2dp"] +[ext_resource type="Resource" uid="uid://br7bd80u7vyid" path="res://addons/Bugbot/Materials/BugMarker/bug_marker_neutral.res" id="2_uwubq"] +[ext_resource type="Resource" uid="uid://dgsi0x8bj0twj" path="res://addons/Bugbot/Materials/BugMarker/bug_marker_unresolved.res" id="3_slhi1"] +[ext_resource type="Resource" uid="uid://qeog5ye8d64o" path="res://addons/Bugbot/Materials/BugMarker/bug_marker_in_progress.res" id="4_jrygt"] +[ext_resource type="Resource" uid="uid://bpog70fji227f" path="res://addons/Bugbot/Materials/BugMarker/bug_marker_resolved.res" id="5_yhhan"] [sub_resource type="QuadMesh" id="QuadMesh_dd1nc"] -material = ExtResource("3_px2dp") custom_aabb = AABB(-0.25, -0.25, -0.25, 0.5, 0.5, 0.5) size = Vector2(0.25, 0.25) @@ -14,6 +16,10 @@ radius = 0.125398 [node name="BugMarker" type="Node3D"] script = ExtResource("1_1adfi") +marker_material_neutral = ExtResource("2_uwubq") +marker_material_unresolved = ExtResource("3_slhi1") +marker_material_in_progress = ExtResource("4_jrygt") +marker_material_resolved = ExtResource("5_yhhan") [node name="Arrow" type="MeshInstance3D" parent="."] cast_shadow = 0