Skip to content
Merged
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
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ body:
label: Affected scene
placeholder: e.g. Fray's End, quests/lore_quests/quest_002/3_void_grappling/void_grappling_round_2.tscn
description: >
In which scene in the game is the problem? If it affects multiple
scenes, give an example. If you're not sure, describe the scene
visually, or leave it blank.
Give an example of a scene in the game where you see this problem. If
you're not sure, describe the scene visually, or leave this blank.

If you report a problem from within the game, this will have been filled
automatically with the current scene. You can change this if you are
reporting a problem you saw in a different scene.
Comment on lines +29 to +34
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manuq Do you think this change captures your point?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjt yes, well explained!

validations:
required: false

Expand Down
10 changes: 3 additions & 7 deletions addons/threadbare_git_describe/export.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: MPL-2.0
extends EditorExportPlugin

const Version = preload("./version.gd")


func _get_name() -> String:
return "threadbare_git_describe_exporter"
Expand All @@ -17,13 +19,7 @@ func set_version(version: Variant) -> void:
func _export_begin(
_features: PackedStringArray, _is_debug: bool, _path: String, _flags: int
) -> void:
var output: Array[String] = []
var ret := OS.execute("git", ["describe", "--tags"], output)
if ret != 0:
printerr("git describe --tags failed: %d" % ret)
else:
var version := output[0].strip_edges()
set_version(version)
set_version(Version.git_describe(true))


func _export_end() -> void:
Expand Down
35 changes: 35 additions & 0 deletions addons/threadbare_git_describe/version.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Object
## Functions to determine the game version

static var _initialized := false
static var _version: String


## Gets the project version based on [code]git describe[/code],
## or [code]""[/code] if this fails.
static func git_describe(warn_on_error: bool) -> String:
var output: Array[String] = []
var ret := OS.execute("git", ["describe", "--tags"], output)
if ret != 0:
if warn_on_error:
printerr("git describe --tags failed: %d" % ret)
return ""

var version := output[0].strip_edges()
return version


## Gets the game version from the project configuration, falling back to
## calling [member git_describe].
static func get_version() -> String:
if not _initialized:
_version = ProjectSettings.get(&"application/config/version")

if not _version:
_version = git_describe(false)

_initialized = true

return _version
1 change: 1 addition & 0 deletions addons/threadbare_git_describe/version.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c76eh40rjua1l
11 changes: 11 additions & 0 deletions addons/threadbare_git_describe/version_label.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Label
## A label which shows the project version
##
## The version is determined from the project configuration, falling back to
## [code]git describe[/code] if necessary.


func _ready() -> void:
text = preload("./version.gd").get_version()
26 changes: 26 additions & 0 deletions scenes/globals/pause/pause_overlay.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
[ext_resource type="Script" uid="uid://y88qplkioj1q" path="res://scenes/globals/pause/pause_overlay.gd" id="1_lf64b"]
[ext_resource type="Texture2D" uid="uid://lg5dl13njsg3" path="res://assets/first_party/tiles/Grass_And_Sand_Tiles.png" id="2_1tcw0"]
[ext_resource type="Theme" uid="uid://cvitou84ni7qe" path="res://scenes/ui_elements/components/theme.tres" id="2_sd5t1"]
[ext_resource type="Script" uid="uid://i4urwefxrrdt" path="res://addons/threadbare_git_describe/version_label.gd" id="3_m62bn"]
[ext_resource type="PackedScene" uid="uid://dkeb0yjgcfi86" path="res://scenes/menus/options/options.tscn" id="3_sd5t1"]
[ext_resource type="Script" uid="uid://gntvq01vvati" path="res://scenes/globals/pause/report_bug_button.gd" id="4_mjd51"]
[ext_resource type="PackedScene" uid="uid://56ja3m4283wa" path="res://scenes/menus/debug/debug_settings.tscn" id="5_ai8ue"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1tcw0"]
Expand All @@ -27,6 +29,22 @@ region_rect = Rect2(384, 64, 64, 64)
axis_stretch_horizontal = 1
axis_stretch_vertical = 1

[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1289064546]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -33.0
offset_top = -68.0
grow_horizontal = 0
grow_vertical = 0
theme = ExtResource("2_sd5t1")

[node name="VersionLabel" type="Label" parent="MarginContainer" unique_id=494777321]
layout_mode = 2
script = ExtResource("3_m62bn")

[node name="TabContainer" type="TabContainer" parent="." unique_id=877845808]
anchors_preset = 8
anchor_left = 0.5
Expand Down Expand Up @@ -89,6 +107,14 @@ size_flags_horizontal = 4
theme_type_variation = &"FlatButton"
text = "Debug Settings"

[node name="ReportBugButton" type="Button" parent="TabContainer/PauseMenu/VBoxContainer" unique_id=1750937607]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
theme_type_variation = &"FlatButton"
text = "Report a Problem"
script = ExtResource("4_mjd51")

[node name="TitleScreenButton" type="Button" parent="TabContainer/PauseMenu/VBoxContainer" unique_id=830702640]
unique_name_in_owner = true
layout_mode = 2
Expand Down
25 changes: 25 additions & 0 deletions scenes/globals/pause/report_bug_button.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Button
## Opens a bug report form in the web browser when clicked.

const Version := preload("res://addons/threadbare_git_describe/version.gd")
const URL_BASE := "https://github.com/endlessm/threadbare/issues/new?template=bug.yml"


func _ready() -> void:
pressed.connect(_on_pressed)


func _on_pressed() -> void:
var url := URL_BASE

var version := Version.get_version()
if version:
url += "&version=" + version.uri_encode()

var current_scene := get_tree().current_scene
if current_scene:
url += "&scene=" + current_scene.scene_file_path.uri_encode()

OS.shell_open(url)
1 change: 1 addition & 0 deletions scenes/globals/pause/report_bug_button.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://gntvq01vvati
4 changes: 2 additions & 2 deletions scenes/menus/title/components/main_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[ext_resource type="Theme" uid="uid://cvitou84ni7qe" path="res://scenes/ui_elements/components/theme.tres" id="1_vmxej"]
[ext_resource type="Script" uid="uid://bkl8j1as8ylag" path="res://scenes/menus/title/components/main_menu.gd" id="1_xuf5f"]
[ext_resource type="Script" uid="uid://dfx8s2ybd11mt" path="res://scenes/menus/storybook/components/animated_texture_rect.gd" id="4_rpgwp"]
[ext_resource type="Script" uid="uid://i4urwefxrrdt" path="res://scenes/menus/title/components/version_label.gd" id="4_snvmp"]
[ext_resource type="SpriteFrames" uid="uid://bg538lufloka6" path="res://scenes/menus/title/components/threadbare_logo_animation.tres" id="5_rpgwp"]
[ext_resource type="Script" uid="uid://i4urwefxrrdt" path="res://addons/threadbare_git_describe/version_label.gd" id="4_snvmp"]
[ext_resource type="SpriteFrames" uid="uid://bg538lufloka6" path="res://scenes/menus/title/components/logos/threadbare_logo_animation.tres" id="5_rpgwp"]

[node name="MainMenu" type="Control" unique_id=1449128276]
layout_mode = 3
Expand Down
7 changes: 0 additions & 7 deletions scenes/menus/title/components/version_label.gd

This file was deleted.

Loading