-
Notifications
You must be signed in to change notification settings - Fork 289
Add “Report a Problem” button to pause screen #2081
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://c76eh40rjua1l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://gntvq01vvati |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjt yes, well explained!