Added code to fill in menus for the bug report form and display it when placing a marker.

This commit is contained in:
Jamie Greunbaum
2024-05-23 01:36:00 -04:00
parent 5c37903872
commit 64f6193701
11 changed files with 447 additions and 118 deletions
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://c6kmp4h12yvqo"
path="res://.godot/imported/OpenSans-Regular.ttf-86254fbb6aac993f6e9803d3243471d1.fontdata"
[deps]
source_file="res://addons/Bugbot/UI/OpenSans-Regular.ttf"
dest_files=["res://.godot/imported/OpenSans-Regular.ttf-86254fbb6aac993f6e9803d3243471d1.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=true
multichannel_signed_distance_field=true
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=false
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://da7rc0rvin4l7"
path="res://.godot/imported/RobotoMono-Regular.ttf-be94330586b1027deda8b4a414498596.fontdata"
[deps]
source_file="res://addons/Bugbot/UI/RobotoMono-Regular.ttf"
dest_files=["res://.godot/imported/RobotoMono-Regular.ttf-be94330586b1027deda8b4a414498596.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=true
multichannel_signed_distance_field=true
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=false
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}
+50
View File
@@ -0,0 +1,50 @@
class_name BugReportForm
extends ColorRect
@onready var __version_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/VersionButton
@onready var __hardware_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/HardwareButton
@onready var __os_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/OSButton
@onready var __component_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/ComponentButton
@onready var __severity_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/SeverityButton
var __version_items : Array
var __hardware_items : Array
var __os_items : Array
var __component_items : Array
var __severity_items : Array
var __stored_mouse_mode : int
func _enter_tree():
__stored_mouse_mode = Input.mouse_mode
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
func _exit_tree():
Input.mouse_mode = __stored_mouse_mode
func fill_tags(tag_list:Array):
var version_menu : PopupMenu = __version_button.get_popup()
var version_list : Array = tag_list[0]
for i in version_list.size():
version_menu.add_item(version_list[i]["name"], i)
var hardware_menu : PopupMenu = __hardware_button.get_popup()
var hardware_list : Array = tag_list[1]
for i in hardware_list.size():
hardware_menu.add_item(hardware_list[i]["name"], i)
var os_menu : PopupMenu = __os_button.get_popup()
var os_list : Array = tag_list[2]
for i in os_list.size():
os_menu.add_item(os_list[i]["name"], i)
var component_menu : PopupMenu = __component_button.get_popup()
var component_list : Array = tag_list[3]
for i in component_list.size():
component_menu.add_item(component_list[i]["name"], i)
var severity_menu : PopupMenu = __severity_button.get_popup()
var severity_list : Array = tag_list[4]
for i in severity_list.size():
severity_menu.add_item(severity_list[i]["name"], i)
Binary file not shown.
+153
View File
@@ -0,0 +1,153 @@
[gd_scene load_steps=3 format=3 uid="uid://bi8xv7a5k3wuu"]
[ext_resource type="Theme" uid="uid://cw07kl24clcs0" path="res://addons/Bugbot/UI/bug_report_form.theme" id="1_rwv2x"]
[ext_resource type="Script" path="res://addons/Bugbot/UI/bug_report_form.gd" id="2_w8fc6"]
[node name="BugReportForm" type="ColorRect"]
process_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_rwv2x")
color = Color(0, 0, 0, 0.25)
script = ExtResource("2_w8fc6")
[node name="Form" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.1
anchor_top = 0.45
anchor_right = 0.9
anchor_bottom = 0.9
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainerLeft" type="VBoxContainer" parent="Form"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.67
[node name="GridContainer" type="GridContainer" parent="Form/VBoxContainerLeft"]
layout_mode = 2
size_flags_vertical = 3
columns = 2
[node name="ProductNameLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "Product Name:"
horizontal_alignment = 2
[node name="ProductName" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "NameOfProductHere"
clip_text = true
[node name="VersionLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "Version:"
horizontal_alignment = 2
[node name="VersionButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
focus_mode = 2
action_mode = 1
text = "Select Version"
flat = false
alignment = 0
clip_text = true
[node name="HardwareLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "Hardware:"
horizontal_alignment = 2
[node name="HardwareButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
focus_mode = 2
action_mode = 1
text = "Select Hardware"
flat = false
alignment = 0
clip_text = true
[node name="OSLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "OS:"
horizontal_alignment = 2
[node name="OSButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
focus_mode = 2
action_mode = 1
text = "Select OS"
flat = false
alignment = 0
clip_text = true
[node name="ComponentLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "Component:"
horizontal_alignment = 2
[node name="ComponentButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
focus_mode = 2
action_mode = 1
text = "Select Component"
flat = false
alignment = 0
clip_text = true
[node name="SeverityLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
text = "Severity:"
horizontal_alignment = 2
[node name="SeverityButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"]
layout_mode = 2
focus_mode = 2
action_mode = 1
text = "Select Severity"
flat = false
alignment = 0
clip_text = true
[node name="CancelButton" type="Button" parent="Form/VBoxContainerLeft"]
layout_mode = 2
text = "Cancel"
[node name="VBoxContainerRight" type="VBoxContainer" parent="Form"]
layout_mode = 2
size_flags_horizontal = 3
[node name="GridContainer" type="GridContainer" parent="Form/VBoxContainerRight"]
layout_mode = 2
size_flags_vertical = 3
columns = 2
[node name="SummaryLabel" type="Label" parent="Form/VBoxContainerRight/GridContainer"]
layout_mode = 2
text = "Summary:"
horizontal_alignment = 2
[node name="SummaryText" type="LineEdit" parent="Form/VBoxContainerRight/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="DescriptionLabel" type="Label" parent="Form/VBoxContainerRight/GridContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Description:"
horizontal_alignment = 2
[node name="DescriptionText" type="TextEdit" parent="Form/VBoxContainerRight/GridContainer"]
layout_mode = 2
size_flags_vertical = 3
wrap_mode = 1
[node name="SubmitButton" type="Button" parent="Form/VBoxContainerRight"]
layout_mode = 2
text = "Submit"