Skip to content

Commit

Permalink
Merge pull request #38 from TaloDev/develop
Browse files Browse the repository at this point in the history
Release 0.12.0
  • Loading branch information
tudddorrr authored Oct 28, 2024
2 parents effad38 + 9cfc5a9 commit b42ba80
Show file tree
Hide file tree
Showing 33 changed files with 275 additions and 193 deletions.
2 changes: 1 addition & 1 deletion addons/talo/apis/api.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ class_name TaloAPI extends Node
var client: TaloClient

func _init(base_path: String):
name = "Talo%s" % [base_path]
name = "Talo%s" % base_path
client = TaloClient.new(base_path)
add_child(client)
4 changes: 2 additions & 2 deletions addons/talo/apis/feedback_api.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ func get_categories() -> Array:
_:
return []

func send(internal_name: String, comment: String) -> void:
func send(category_internal_name: String, comment: String) -> void:
if Talo.identity_check() != OK:
return

await client.make_request(HTTPClient.METHOD_POST, "/categories/%s" % internal_name, {
await client.make_request(HTTPClient.METHOD_POST, "/categories/%s" % category_internal_name, {
comment = comment
})
2 changes: 1 addition & 1 deletion addons/talo/apis/player_groups_api.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class_name PlayerGroupsAPI extends TaloAPI

func get_group(group_id: String) -> TaloPlayerGroup:
var res = await client.make_request(HTTPClient.METHOD_GET, "/%s" % [group_id])
var res = await client.make_request(HTTPClient.METHOD_GET, "/%s" % group_id)

match (res.status):
200:
Expand Down
6 changes: 6 additions & 0 deletions addons/talo/apis/players_api.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ func merge(player_id1: String, player_id2: String) -> TaloPlayer:
return TaloPlayer.new(res.body.player)
_:
return null

func generate_identifer() -> String:
var time_hash: String = String(TimeUtils.get_current_time_msec()).sha256_text()
var size = 12
var split_start: int = RandomNumberGenerator.new().randi_range(0, time_hash.length() - size)
return time_hash.substr(split_start, size)
4 changes: 2 additions & 2 deletions addons/talo/apis/saves_api.gd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func update_save(save: TaloGameSave, new_name: String = "") -> TaloGameSave:
if Talo.identity_check() != OK:
return

var res = await client.make_request(HTTPClient.METHOD_PATCH, "/%s" % [save.id], {
var res = await client.make_request(HTTPClient.METHOD_PATCH, "/%s" % save.id, {
name=save.display_name if new_name.is_empty() else new_name,
content=content
})
Expand All @@ -152,7 +152,7 @@ func delete_save(save: TaloGameSave) -> void:
if Talo.identity_check() != OK:
return

var res = await client.make_request(HTTPClient.METHOD_DELETE, "/%s" % [save.id])
var res = await client.make_request(HTTPClient.METHOD_DELETE, "/%s" % save.id)

match res.status:
_:
Expand Down
2 changes: 1 addition & 1 deletion addons/talo/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Talo Game Services"
description="Talo (https://trytalo.com) is an open-source game backend with services designed to help you build games faster. You can currently:\n\n- Identify and authenticate players\n- Store persistent data across players\n- Track events (levelling up, finding loot, etc)\n- Display high scores with leaderboards\n- Store and load player saves\n- Load game config options and flags from the cloud\n- Get feedback directly from your players"
author="trytalo"
version="0.11.0"
version="0.12.0"
script="talo_autoload.gd"
2 changes: 1 addition & 1 deletion addons/talo/samples/authentication/scripts/in_game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func _ready() -> void:
Talo.players.identified.connect(_on_player_identified)

func _on_player_identified(player: TaloPlayer) -> void:
username.text = "What would you like to do,\n%s?" % [Talo.current_alias.identifier]
username.text = "What would you like to do,\n%s?" % Talo.current_alias.identifier

func _on_change_password_pressed() -> void:
go_to_change_password.emit()
Expand Down
10 changes: 5 additions & 5 deletions addons/talo/samples/leaderboards/scripts/leaderboard.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func _ready() -> void:

func _set_entry_count():
if entries_container.get_child_count() == 0:
info_label.text = "No entries yet!" if not _entries_error else "Failed loading leaderboard %s. Does it exist?" % [leaderboard_internal_name]
info_label.text = "No entries yet!" if not _entries_error else "Failed loading leaderboard %s. Does it exist?" % leaderboard_internal_name
else:
info_label.text = "%s entries" % [entries_container.get_child_count()]
info_label.text = "%s entries" % entries_container.get_child_count()
if _filter != "All":
info_label.text += " (%s team)" % [_filter]
info_label.text += " (%s team)" % _filter

func _create_entry(entry: TaloLeaderboardEntry) -> void:
var entry_instance = entry_scene.instantiate()
Expand Down Expand Up @@ -82,7 +82,7 @@ func _on_filter_pressed() -> void:
_filter_idx += 1
_filter = _get_next_filter(_filter_idx)

info_label.text = "Filtering on %s" % [filter_button.text.to_lower()]
filter_button.text = "%s team scores" % [_get_next_filter(_filter_idx + 1)]
info_label.text = "Filtering on %s" % filter_button.text.to_lower()
filter_button.text = "%s team scores" % _get_next_filter(_filter_idx + 1)

_build_entries()
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func _set_score(score: int) -> void:

func _set_team(team: String) -> void:
if not team.is_empty():
text += " (%s team)" % [team]
text += " (%s team)" % team

func set_data(entry: TaloLeaderboardEntry) -> void:
_set_pos(entry.position)
Expand Down
Loading

0 comments on commit b42ba80

Please sign in to comment.