Repository navigation
Improve report a problem flow #2990 - #3010
BFoster-BF wants to merge 3 commits into
Conversation
|
Play this branch at https://play.threadbare.game/branches/BFoster-BF/Improve-Report-a-Problem-flow-%232990/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
manuq
left a comment
There was a problem hiding this comment.
This is looking good! I'm requesting format changes.
| url += ( | ||
| "&location=" | ||
| + ( | ||
| ("%s,%s" % [player.get_global_position().x, player.get_global_position().y]) |
There was a problem hiding this comment.
You can use the player.global_position property instead of player.get_global_position().
Also why is this Vector2 being encoded with uri_encode(), and the game_resolution (which is also a Vector2) isn't? I would expect either both be encoded, or none. I think both should be encoded for safety.
Also you are doing custom formatting on each, the resolution Vector2 has a x separator, and the global position Vector2 has a , separator. I think it will be better if both have the same formatting, for parsing them in the future. What about using the default formatting? calling str(vector) outputs: "(100.5, 21)" if vector = Vector2(100.5, 21.0).
There was a problem hiding this comment.
The reason it is being url encoded is to do with the format. currently game_resolution only ever returns integers separated by an x separator. therefore no url encoding is necessary.
It was formatted this way to be more readable but maybe I was just trying to be too clever.
The format of player_location however contains a , separator so I thought it would be necessary to url encode() this to avoid problems with the url string,
I can see how this might be confusing though.
I'll amend to use default formatting as suggested.
There was a problem hiding this comment.
Yes, consider that at one point we will want to decode them. So is easier to do the same for both. Something like:
prints("&resolution=" + str(Vector2(1920, 1080)).uri_encode())
prints(("&resolution=" + str(Vector2(1920, 1080)).uri_encode()).uri_decode())
Which outputs:
&resolution=%281920.0%2C%201080.0%29
&resolution=(1920.0, 1080.0)
There was a problem hiding this comment.
@BFoster-BF actually, after reading some more it looks like it's better to use str_to_var and var_to_str.
There was a problem hiding this comment.
@BFoster-BF use this for encoding:
var s := "&resolution=" + var_to_str(Vector2(1920, 1080)).uri_encode()
prints(s)And we will be able to decode it like this in the future:
var v: Vector2 = str_to_var(s.split("=")[1].uri_decode())
prints(v)| If you report a problem from within the game, this will have been filled automatically with the current resolution. | ||
|
|
||
| You can change this if you are reporting a problem you saw in a different resolution. |
| Provide the player's coordinates in the format `X,Y` (integers only, no spaces). If reporting from within the game, | ||
| this will have been filled automatically with the player's current location. | ||
|
|
||
| Leave blank if location is irrelevant to the issue. |
There was a problem hiding this comment.
This one too, nice explanation!
@BFoster-BF keep in mind that the correct format of this line is as documented here: https://github.com/endlessm/threadbare/wiki/Contributing#pull-request-descriptions It matters that the format is the word and the number, just that. If you add anything in the middle like "improve..." it doesn't work. |
The existing
.github/ISSUE_TEMPLATE/bug.ymlbug report template has been updated to include 2 new text inputs for both the game resolution and the player location.res://scenes/globals/pause/report_bug_button.gdhas been modified to include both the current window size usingDisplayServer.window_get_size(), and the player's global position usingget_tree().get_first_node_in_group("player")together with theget_global_position()This data is used in the url query string which is used to automatically populate the GitHub issue form.
Resolves Improve "Report a Problem" flow #2990