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

Remove unused var and fix index vs id. #8

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions TestCameraServer/main.gd
Expand Up @@ -3,7 +3,7 @@ extends Spatial
var camera_feeds = Array()
var current_camera_feed = null

func update_cameras(p_id):
func update_cameras():
var found = false

$CameraFeeds.clear()
Expand All @@ -17,14 +17,14 @@ func update_cameras(p_id):
print("Added " + name + " at " + str(id))

if (feed == current_camera_feed):
$CameraFeeds.selected = id
$CameraFeeds.selected = $CameraFeeds.get_item_index(id)
$CameraFeeds.text = name
found = true

# no active camera or our camera was unplugged
if (!found and camera_feeds.size() > 0):
current_camera_feed = camera_feeds[0]
$CameraFeeds.selected = 1
$CameraFeeds.selected = 0
$CameraFeeds.text = current_camera_feed.get_name()

# and make it active!
Expand Down Expand Up @@ -52,7 +52,7 @@ func _on_CameraFeeds_item_selected( id ):
print("Current camera: " + current_camera_feed.get_name() + ", " + str(current_camera_feed.get_transform()))

func _ready():
update_cameras(0)
update_cameras()

if current_camera_feed:
print("Current camera: " + current_camera_feed.get_name() + ", " + str(current_camera_feed.get_transform()))
Expand Down