Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gdlint errors #691

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions assets/3dmodelscc0/models/scenes/scope_display.gd
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
@tool
extends Node3D


@export var player_camera : Camera3D


@export_range(1.0, 10.0, 0.1) var fov : float = 10.0:
set(value):
fov = value
if is_inside_tree():
_update_fov()

@export_range(0.005, 1.000, 0.005) var radius : float = 0.025:
set(value):
radius = value
if is_inside_tree():
_update_radius()

@export_range(0.001, 0.500, 0.001) var offset : float = 0.35:
set(value):
offset = value
if is_inside_tree():
_update_offset()


func _update_radius():
var mesh : QuadMesh = $DisplayMesh.mesh
if mesh:
Expand All @@ -19,11 +34,6 @@ func _update_radius():
if material:
material.set_shader_parameter("radius", radius)

@export_range(0.001, 0.500, 0.001) var offset : float = 0.35:
set(value):
offset = value
if is_inside_tree():
_update_offset()

func _update_offset():
$ScopeAnchor.position.z = -offset
Expand All @@ -35,11 +45,6 @@ func _update_offset():
if material:
material.set_shader_parameter("depth", offset)

@export_range(1.0, 10.0, 0.1) var fov : float = 10.0:
set(value):
fov = value
if is_inside_tree():
_update_fov()

func _update_fov():
$SubViewport/Camera3D.fov = fov
Expand Down
5 changes: 3 additions & 2 deletions assets/3dmodelscc0/models/sniper_rifle/firearm_trigger.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ extends Node

@export var handle_grabpoints : Array[XRToolsGrabPoint]

@onready var _parent : XRToolsPickable = get_parent()
var triggered : bool = false

# Current controller holding this object
var _current_controller : XRController3D

var triggered : bool = false
@onready var _parent : XRToolsPickable = get_parent()


# Add support for is_xr_class on XRTools classes
Expand All @@ -30,6 +30,7 @@ func _ready() -> void:
for handle_grabpoint in handle_grabpoints:
handle_grabpoint.enabled = false


func _physics_process(_delta):
if is_instance_valid(_parent):
# toggle handle grabpoints if parent got grabbed/released
Expand Down
2 changes: 1 addition & 1 deletion assets/meshes/control_pad/control_pad_display.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func _on_body_scale_slider_value_changed(value : float) -> void:
# Kill any current tween
if _tween:
_tween.kill()

# Tween the world scale over the next 1/2 second
_tween = get_tree().create_tween()
_tween.tween_method(
Expand Down
5 changes: 3 additions & 2 deletions assets/meshes/teleport/teleport.gd
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ func _set_inactive_beam_visible(value):


func _update_teleport():
var mat = $teleport/Cylinder.get_surface_override_material(0)
if active:
$teleport/Cylinder.get_surface_override_material(0).set_shader_parameter("beam_color", active_beam_color)
mat.set_shader_parameter("beam_color", active_beam_color)
$teleport/Cylinder.visible = true
else:
$teleport/Cylinder.get_surface_override_material(0).set_shader_parameter("beam_color", inactive_beam_color)
mat.set_shader_parameter("beam_color", inactive_beam_color)
$teleport/Cylinder.visible = inactive_beam_visible
33 changes: 18 additions & 15 deletions scenes/audio_demo/objects/arcade_hoops_ctrl.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
extends Node3D


## Signal indicating a target has been passed through
signal target_passed()
signal count_down(number)


## Optional audio stream to play when the player jumps on this surface
@export var start_sound : AudioStream
Expand All @@ -20,9 +24,20 @@ extends Node3D
@export var start_text : String = ""
@export var game_over_text : String = ""
@export var scored_text : String= ""

var ejected_token = preload ("res://scenes/audio_demo/objects/token.tscn")
var score
var tween
var _count

# Flag indicating when ball is inside the area
var _ball_inside := false

# Flag indicating if timer is running
var _running := false

## Audio streams to play when the player walks on this surface
@onready var player := $AudioStreamPlayer3D

@onready var score_label := $Score_Text
@onready var timer := $Timer
@onready var timer_label := $Timer_Text
Expand All @@ -31,19 +46,8 @@ extends Node3D
@onready var info_label := $Start_Text
@onready var zone : XRToolsSnapZone = $SnapZone
@onready var holder : Node3D = $TokenHolder
var ejected_token = preload ("res://scenes/audio_demo/objects/token.tscn")
var _count
var score
var tween

# Flag indicating when ball is inside the area
var _ball_inside := false

# Flag indicating if timer is running
var _running := false
## Signal indicating a target has been passed through
signal target_passed()
signal count_down(number)



Expand All @@ -59,7 +63,7 @@ func _ready() -> void:
zone.has_picked_up.connect(_on_token_insert)


func _process(delta):
func _process(_delta):
if !_running:
zone.enabled = true
else:
Expand Down Expand Up @@ -93,11 +97,10 @@ func _on_token_insert(_what : Node3D) -> void:
zone.enabled = false
tween = get_tree().create_tween()
tween.tween_callback(_what.queue_free).set_delay(0.15)
tween.kill


func _on_token_eject(_button) -> void:
var token_to_eject = ejected_token.instantiate()
var token_to_eject = ejected_token.instantiate()
if token > 0:
holder.add_child(token_to_eject)
token -= 1
Expand Down
Loading