Initial commit

This commit is contained in:
Jamie Greunbaum 2024-05-13 18:52:32 -04:00 committed by Jamie Greunbaum
commit 9ab5751fac
42 changed files with 278 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Inputs/Joystick/move_up.res Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Inputs/Joystick/tilt_up.res Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Inputs/Keyboard/move_up.res Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Inputs/Keyboard/tilt_up.res Normal file

Binary file not shown.

Binary file not shown.

BIN
Inputs/Mouse/pan_left.res Normal file

Binary file not shown.

BIN
Inputs/Mouse/pan_right.res Normal file

Binary file not shown.

Binary file not shown.

BIN
Inputs/Mouse/speed_down.res Normal file

Binary file not shown.

BIN
Inputs/Mouse/speed_up.res Normal file

Binary file not shown.

BIN
Inputs/Mouse/tilt_down.res Normal file

Binary file not shown.

BIN
Inputs/Mouse/tilt_up.res Normal file

Binary file not shown.

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2024 BattyBovine
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Bugbot
Bug reporting toolset for Godot Engine. Allows placement of markers inside the game during playtesting to indicate locations where issues need to be corrected. Will eventually support as many issue reporting backends as I can manage, with Gitea, Jira, and Bugzilla being the priority.

162
Scenes/bugbot_player.gd Normal file
View File

@ -0,0 +1,162 @@
extends CharacterBody3D
@export_group("Movement")
@export var movement_speed : float = 5.0
@export var movement_speed_change_delta : float = 0.5
@export_group("Inputs")
@export_subgroup("Keyboard")
@export var keyboard_move_forward : InputEventKey
@export var keyboard_move_backward : InputEventKey
@export var keyboard_move_left : InputEventKey
@export var keyboard_move_right : InputEventKey
@export var keyboard_move_up : InputEventKey
@export var keyboard_move_down : InputEventKey
@export var keyboard_tilt_up : InputEventKey
@export var keyboard_tilt_down : InputEventKey
@export var keyboard_pan_left : InputEventKey
@export var keyboard_pan_right : InputEventKey
@export var keyboard_movement_speed_up : InputEventKey
@export var keyboard_movement_speed_down : InputEventKey
@export var keyboard_place_marker : InputEventKey
@export var keyboard_exit_placement : InputEventKey
@export_subgroup("Mouse")
@export var mouse_tilt_up : InputEventMouseMotion
@export var mouse_tilt_down : InputEventMouseMotion
@export var mouse_pan_left : InputEventMouseMotion
@export var mouse_pan_right : InputEventMouseMotion
@export var mouse_movement_speed_up : InputEventMouseButton
@export var mouse_movement_speed_down : InputEventMouseButton
@export_subgroup("Joystick")
@export var joypad_move_forward : InputEventJoypadMotion
@export var joypad_move_backward : InputEventJoypadMotion
@export var joypad_move_left : InputEventJoypadMotion
@export var joypad_move_right : InputEventJoypadMotion
@export var joypad_move_up : InputEventJoypadMotion
@export var joypad_move_down : InputEventJoypadMotion
@export var joypad_tilt_up : InputEventJoypadMotion
@export var joypad_tilt_down : InputEventJoypadMotion
@export var joypad_pan_left : InputEventJoypadMotion
@export var joypad_pan_right : InputEventJoypadMotion
@export var joypad_movement_speed_up : InputEventJoypadButton
@export var joypad_movement_speed_down : InputEventJoypadButton
@export var joypad_place_marker : InputEventJoypadButton
@export var joypad_exit_placement : InputEventJoypadButton
@onready var input_change_timer : Timer = $InputChangeTimer
var stored_mouse_mode : int = Input.MOUSE_MODE_CAPTURED
func _enter_tree() -> void:
get_tree().paused = true
stored_mouse_mode = Input.mouse_mode
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
InputMap.add_action(&"bugbot_move_forward")
InputMap.action_add_event(&"bugbot_move_forward", keyboard_move_forward)
InputMap.action_add_event(&"bugbot_move_forward", joypad_move_forward)
InputMap.add_action(&"bugbot_move_backward")
InputMap.action_add_event(&"bugbot_move_backward", keyboard_move_backward)
InputMap.action_add_event(&"bugbot_move_backward", joypad_move_backward)
InputMap.add_action(&"bugbot_move_left")
InputMap.action_add_event(&"bugbot_move_left", keyboard_move_left)
InputMap.action_add_event(&"bugbot_move_left", joypad_move_left)
InputMap.add_action(&"bugbot_move_right")
InputMap.action_add_event(&"bugbot_move_right", keyboard_move_right)
InputMap.action_add_event(&"bugbot_move_right", joypad_move_right)
InputMap.add_action(&"bugbot_move_down")
InputMap.action_add_event(&"bugbot_move_down", keyboard_move_down)
InputMap.action_add_event(&"bugbot_move_down", joypad_move_down)
InputMap.add_action(&"bugbot_move_up")
InputMap.action_add_event(&"bugbot_move_up", keyboard_move_up)
InputMap.action_add_event(&"bugbot_move_up", joypad_move_up)
InputMap.add_action(&"bugbot_tilt_up")
InputMap.action_add_event(&"bugbot_tilt_up", keyboard_tilt_up)
InputMap.action_add_event(&"bugbot_tilt_up", joypad_tilt_up)
InputMap.add_action(&"bugbot_tilt_down")
InputMap.action_add_event(&"bugbot_tilt_down", keyboard_tilt_down)
InputMap.action_add_event(&"bugbot_tilt_down", joypad_tilt_down)
InputMap.add_action(&"bugbot_pan_left")
InputMap.action_add_event(&"bugbot_pan_left", keyboard_pan_left)
InputMap.action_add_event(&"bugbot_pan_left", joypad_pan_left)
InputMap.add_action(&"bugbot_pan_right")
InputMap.action_add_event(&"bugbot_pan_right", keyboard_pan_right)
InputMap.action_add_event(&"bugbot_pan_right", joypad_pan_right)
InputMap.add_action(&"bugbot_movement_speed_up")
InputMap.action_add_event(&"bugbot_movement_speed_up", keyboard_movement_speed_up)
InputMap.action_add_event(&"bugbot_movement_speed_up", mouse_movement_speed_up)
InputMap.action_add_event(&"bugbot_movement_speed_up", joypad_movement_speed_up)
InputMap.add_action(&"bugbot_movement_speed_down")
InputMap.action_add_event(&"bugbot_movement_speed_down", keyboard_movement_speed_down)
InputMap.action_add_event(&"bugbot_movement_speed_down", mouse_movement_speed_down)
InputMap.action_add_event(&"bugbot_movement_speed_down", joypad_movement_speed_down)
func _exit_tree() -> void:
InputMap.action_erase_event(&"bugbot_move_forward", keyboard_move_forward)
InputMap.action_erase_event(&"bugbot_move_forward", joypad_move_forward)
InputMap.action_erase_event(&"bugbot_move_backward", keyboard_move_backward)
InputMap.action_erase_event(&"bugbot_move_backward", joypad_move_backward)
InputMap.action_erase_event(&"bugbot_move_left", keyboard_move_left)
InputMap.action_erase_event(&"bugbot_move_left", joypad_move_left)
InputMap.action_erase_event(&"bugbot_move_right", keyboard_move_right)
InputMap.action_erase_event(&"bugbot_move_right", joypad_move_right)
InputMap.action_erase_event(&"bugbot_move_down", keyboard_move_down)
InputMap.action_erase_event(&"bugbot_move_down", joypad_move_down)
InputMap.action_erase_event(&"bugbot_move_up", keyboard_move_up)
InputMap.action_erase_event(&"bugbot_move_up", joypad_move_up)
InputMap.action_erase_event(&"bugbot_movement_speed_up", keyboard_movement_speed_up)
InputMap.action_erase_event(&"bugbot_movement_speed_up", mouse_movement_speed_up)
InputMap.action_erase_event(&"bugbot_movement_speed_up", joypad_movement_speed_up)
InputMap.action_erase_event(&"bugbot_movement_speed_down", keyboard_movement_speed_down)
InputMap.action_erase_event(&"bugbot_movement_speed_down", mouse_movement_speed_down)
InputMap.action_erase_event(&"bugbot_movement_speed_down", joypad_movement_speed_down)
Input.mouse_mode = stored_mouse_mode
get_tree().paused = false
func _process(_delta:float) -> void:
_calculate_movement_speed()
var rotation_velocity : Vector2 = Vector2(
Input.get_axis(&"bugbot_tilt_down", &"bugbot_tilt_up"),
Input.get_axis(&"bugbot_pan_right", &"bugbot_pan_left"))
var mouse_velocity : Vector2 = Input.get_last_mouse_velocity()
rotation_velocity.x += mouse_velocity.y * -0.0025
rotation_velocity.y += mouse_velocity.x * -0.0025
rotation.x = clampf(rotation.x + (rotation_velocity.x * _delta), -PI/2.0 + 0.0001, PI/2.0 - 0.0001)
rotation.y += rotation_velocity.y * _delta
var movement_vector_lateral : Vector2 = Input.get_vector(&"bugbot_move_left", &"bugbot_move_right", &"bugbot_move_forward", &"bugbot_move_backward")
var movement_azimuth : float = Input.get_axis(&"bugbot_move_down", &"bugbot_move_up")
velocity = transform.basis * Vector3(movement_vector_lateral.x, movement_azimuth, movement_vector_lateral.y) * movement_speed
func _physics_process(_delta:float) -> void:
move_and_slide()
func _calculate_movement_speed():
if Input.is_action_pressed(&"bugbot_movement_speed_down") or Input.is_action_just_pressed(&"bugbot_movement_speed_down"):
if input_change_timer.is_stopped():
movement_speed -= movement_speed_change_delta
input_change_timer.start()
elif Input.is_action_pressed(&"bugbot_movement_speed_up") or Input.is_action_just_pressed(&"bugbot_movement_speed_up"):
if input_change_timer.is_stopped():
movement_speed += movement_speed_change_delta
input_change_timer.start()
else:
input_change_timer.stop()
movement_speed = clampf(movement_speed, 0.25, 50.0)

85
Scenes/bugbot_player.tscn Normal file
View File

@ -0,0 +1,85 @@
[gd_scene load_steps=33 format=3 uid="uid://dvgain3s4xa4r"]
[ext_resource type="Script" path="res://addons/bugbot/Scenes/bugbot_player.gd" id="1_0w1su"]
[ext_resource type="InputEventKey" uid="uid://di5q6d4wt12et" path="res://addons/bugbot/Inputs/Keyboard/move_forward.res" id="2_4xsm8"]
[ext_resource type="InputEventJoypadMotion" uid="uid://dvfivmwsi3fua" path="res://addons/bugbot/Inputs/Joystick/move_forward.res" id="2_ib0o8"]
[ext_resource type="InputEventJoypadMotion" uid="uid://bslmd7psb8fxj" path="res://addons/bugbot/Inputs/Joystick/move_backward.res" id="3_f3wgw"]
[ext_resource type="InputEventKey" uid="uid://dq5h1k8r7qc8e" path="res://addons/bugbot/Inputs/Keyboard/move_backward.res" id="3_t3c17"]
[ext_resource type="InputEventJoypadMotion" uid="uid://81iwh4jprsvg" path="res://addons/bugbot/Inputs/Joystick/move_left.res" id="4_fjxg2"]
[ext_resource type="InputEventKey" uid="uid://cll7mf8252ygb" path="res://addons/bugbot/Inputs/Keyboard/move_left.res" id="4_jrc8e"]
[ext_resource type="InputEventJoypadMotion" uid="uid://dgxujj8rm83ms" path="res://addons/bugbot/Inputs/Joystick/move_right.res" id="5_l00mx"]
[ext_resource type="InputEventKey" uid="uid://7bd7qoj1d3if" path="res://addons/bugbot/Inputs/Keyboard/move_right.res" id="5_xjrx0"]
[ext_resource type="InputEventKey" uid="uid://cxms65i1ajl84" path="res://addons/bugbot/Inputs/Keyboard/move_up.res" id="6_8kaqn"]
[ext_resource type="InputEventJoypadMotion" uid="uid://dxeo2l03mfag8" path="res://addons/bugbot/Inputs/Joystick/move_up.res" id="6_rw5gh"]
[ext_resource type="InputEventJoypadMotion" uid="uid://clplko5i2fjfg" path="res://addons/bugbot/Inputs/Joystick/move_down.res" id="7_asamw"]
[ext_resource type="InputEventKey" uid="uid://bv3rhr5nb770i" path="res://addons/bugbot/Inputs/Keyboard/move_down.res" id="7_awoo8"]
[ext_resource type="InputEventKey" uid="uid://cll5bqmbaide7" path="res://addons/bugbot/Inputs/Keyboard/place_marker.res" id="8_4no4m"]
[ext_resource type="InputEventJoypadButton" uid="uid://bc2q8kry856bq" path="res://addons/bugbot/Inputs/Joystick/place_marker.res" id="8_a8xs2"]
[ext_resource type="InputEventKey" uid="uid://b2368i5gabwe4" path="res://addons/bugbot/Inputs/Keyboard/tilt_up.res" id="8_itpt0"]
[ext_resource type="InputEventKey" uid="uid://sj40g81evgwp" path="res://addons/bugbot/Inputs/Keyboard/exit_placement.res" id="9_62i1v"]
[ext_resource type="InputEventJoypadButton" uid="uid://8tu5a8nlxgsj" path="res://addons/bugbot/Inputs/Joystick/exit_placement.res" id="9_64pej"]
[ext_resource type="InputEventKey" uid="uid://c778uo6xncv8" path="res://addons/bugbot/Inputs/Keyboard/tilt_down.res" id="9_idsj8"]
[ext_resource type="InputEventKey" uid="uid://b1jle0pubrtd5" path="res://addons/bugbot/Inputs/Keyboard/pan_left.res" id="10_7s4mn"]
[ext_resource type="InputEventKey" uid="uid://b7cakmjeiw6ww" path="res://addons/bugbot/Inputs/Keyboard/pan_right.res" id="11_7rtm5"]
[ext_resource type="InputEventKey" uid="uid://dg3voh0vrvttt" path="res://addons/bugbot/Inputs/Keyboard/speed_up.res" id="12_vqtae"]
[ext_resource type="InputEventKey" uid="uid://bsuakshn5uf5q" path="res://addons/bugbot/Inputs/Keyboard/speed_down.res" id="13_umxce"]
[ext_resource type="InputEventMouseButton" uid="uid://cri3v62of5r8q" path="res://addons/bugbot/Inputs/Mouse/speed_up.res" id="14_kyasb"]
[ext_resource type="InputEventMouseButton" uid="uid://xjdbqccjrdv6" path="res://addons/bugbot/Inputs/Mouse/speed_down.res" id="15_64bwo"]
[ext_resource type="InputEventJoypadMotion" uid="uid://1r555cp6na2j" path="res://addons/bugbot/Inputs/Joystick/tilt_up.res" id="16_037yq"]
[ext_resource type="InputEventJoypadMotion" uid="uid://ceq7h0j71rdbj" path="res://addons/bugbot/Inputs/Joystick/tilt_down.res" id="17_v3d4v"]
[ext_resource type="InputEventJoypadMotion" uid="uid://cwekj3w1gwt6s" path="res://addons/bugbot/Inputs/Joystick/pan_left.res" id="18_t1llp"]
[ext_resource type="InputEventJoypadMotion" uid="uid://coqroda2l61k4" path="res://addons/bugbot/Inputs/Joystick/pan_right.res" id="19_boyi2"]
[ext_resource type="InputEventJoypadButton" uid="uid://busy4w43xnjni" path="res://addons/bugbot/Inputs/Joystick/speed_up.res" id="28_j37cx"]
[ext_resource type="InputEventJoypadButton" uid="uid://biuae513qxxf2" path="res://addons/bugbot/Inputs/Joystick/speed_down.res" id="29_ywpxq"]
[sub_resource type="SphereShape3D" id="SphereShape3D_6gwao"]
[node name="BugbotPlayer" type="CharacterBody3D"]
process_mode = 3
collision_layer = 4294967295
collision_mask = 0
input_ray_pickable = false
motion_mode = 1
platform_on_leave = 2
platform_floor_layers = 0
script = ExtResource("1_0w1su")
keyboard_move_forward = ExtResource("2_4xsm8")
keyboard_move_backward = ExtResource("3_t3c17")
keyboard_move_left = ExtResource("4_jrc8e")
keyboard_move_right = ExtResource("5_xjrx0")
keyboard_move_up = ExtResource("6_8kaqn")
keyboard_move_down = ExtResource("7_awoo8")
keyboard_tilt_up = ExtResource("8_itpt0")
keyboard_tilt_down = ExtResource("9_idsj8")
keyboard_pan_left = ExtResource("10_7s4mn")
keyboard_pan_right = ExtResource("11_7rtm5")
keyboard_movement_speed_up = ExtResource("12_vqtae")
keyboard_movement_speed_down = ExtResource("13_umxce")
keyboard_place_marker = ExtResource("8_4no4m")
keyboard_exit_placement = ExtResource("9_62i1v")
mouse_movement_speed_up = ExtResource("14_kyasb")
mouse_movement_speed_down = ExtResource("15_64bwo")
joypad_move_forward = ExtResource("2_ib0o8")
joypad_move_backward = ExtResource("3_f3wgw")
joypad_move_left = ExtResource("4_fjxg2")
joypad_move_right = ExtResource("5_l00mx")
joypad_move_up = ExtResource("6_rw5gh")
joypad_move_down = ExtResource("7_asamw")
joypad_tilt_up = ExtResource("16_037yq")
joypad_tilt_down = ExtResource("17_v3d4v")
joypad_pan_left = ExtResource("18_t1llp")
joypad_pan_right = ExtResource("19_boyi2")
joypad_movement_speed_up = ExtResource("28_j37cx")
joypad_movement_speed_down = ExtResource("29_ywpxq")
joypad_place_marker = ExtResource("8_a8xs2")
joypad_exit_placement = ExtResource("9_64pej")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_6gwao")
debug_color = Color(0.5, 0.7, 1, 1)
[node name="Camera3D" type="Camera3D" parent="CollisionShape3D"]
[node name="InputChangeTimer" type="Timer" parent="."]
wait_time = 0.05
one_shot = true

12
bugbot.gd Normal file
View File

@ -0,0 +1,12 @@
@tool
extends EditorPlugin
func _enter_tree() -> void:
# This is where we should initialise options for showing bug markers
pass
func _exit_tree() -> void:
# This is where we should remove any visible bug markers
pass

7
plugin.cfg Normal file
View File

@ -0,0 +1,7 @@
[plugin]
name="Bugbot"
description=""
author="Jamie Greunbaum"
version="0.1"
script="bugbot.gd"