Skip to content

Commit

Permalink
Merge pull request #141 from klingbolt/godot_marker_category
Browse files Browse the repository at this point in the history
Godot marker category
  • Loading branch information
AsherGlick authored Jul 29, 2023
2 parents ad3bffe + 64d0c26 commit 53f8d5d
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 83 deletions.
4 changes: 4 additions & 0 deletions Icon.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
extends Sprite3D

const Waypoint = preload("res://waypoint.gd")

var texture_path
var waypoint: Waypoint.Icon

func set_icon_image(texture_path: String):
self.texture_path = texture_path

Expand Down
8 changes: 6 additions & 2 deletions Route.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
extends Spatial

var texture_path
const Waypoint = preload("res://waypoint.gd")

var texture_path
var color = Color(0.9, 0.1, 0.1)
var waypoint: Waypoint.Trail

var point_list := PoolVector3Array()

Expand All @@ -17,10 +19,12 @@ func refresh_mesh():
for point_index in range(len(point_list)-1):
var point:Vector3 = point_list[point_index]
var next_point:Vector3 = point_list[point_index+1]
# If the line starts or ends at map coordinates (0,0,0), don't draw the line.
if point == Vector3(0,0,0) or next_point == Vector3(0,0,0):
continue

var distance: float = point.distance_to(next_point)
var normal: Vector3 = (next_point - point).normalized()
#print(normal)
var horizontal_tangent:Vector3 = Vector3(normal.z, 0, -normal.x).normalized()

normal = Vector3(0,0,0)
Expand Down
8 changes: 6 additions & 2 deletions Settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Node
const CONFIG_PATH = "user://settings.json"

var _config_data = {}
var local_category_data = {}

var override_size_enabled: bool = false;
var override_size_height: int = 1080
Expand All @@ -22,7 +23,9 @@ func _ready():

if self._config_data == null:
self._config_data = {}


if "local_category_data" in self._config_data:
self.local_category_data = self._config_data["local_category_data"]
if "override_size_enabled" in self._config_data:
self.override_size_enabled = self._config_data["override_size_enabled"]
if "override_size_height" in self._config_data:
Expand All @@ -45,8 +48,9 @@ func save():
"burrito_link_auto_launch_enabled": burrito_link_auto_launch_enabled,
"burrito_link_wine_path": burrito_link_wine_path,
"burrito_link_env_args": burrito_link_env_args,
"local_category_data": local_category_data
}

var file = File.new()
file.open(CONFIG_PATH, File.WRITE)
file.store_string(JSON.print(self._config_data))
file.store_string(JSON.print(self._config_data, " "))
Loading

0 comments on commit 53f8d5d

Please sign in to comment.