unity of scores (closes #196)

This commit is contained in:
Haze Weathers 2023-10-14 09:52:45 -04:00
parent eda2db4a3a
commit 481edb15b7
3 changed files with 53 additions and 35 deletions

View file

@ -45,6 +45,8 @@ func _ready() -> void:
# reload scores from newgrounds
func reload_scores() -> void:
_set_tag()
print(_scoreboard_tag)
scoreboard_tabs.current_tab = 1
# attempt the thing
if _scoreboard_id >= 0 and Ngio.keys_loaded:
@ -52,6 +54,7 @@ func reload_scores() -> void:
id = _scoreboard_id,
limit = scores.get_child_count(),
skip = 0,
period = "A",
tag = _scoreboard_tag,
}), "completed")
if Ngio.has_result(response) and response.result.data.success:
@ -90,11 +93,12 @@ func _set_tag() -> void:
_scoreboard_tag = "spicy"
Game.Difficulty.PUNGENT:
_scoreboard_tag = "pungent"
match selected_completion:
Completion.ANY:
_scoreboard_tag += "-any%"
Completion.FULL:
_scoreboard_tag += "-100%"
if selected_type == ScoreType.TIME:
match selected_completion:
Completion.ANY:
_scoreboard_tag += "-any%"
Completion.FULL:
_scoreboard_tag += "-100%"
# show arrows when level is focused
func _on_LevelTitle_focus_entered() -> void:
@ -139,7 +143,6 @@ func _on_Difficulty_pressed() -> void:
return
selected_difficulty = posmod(selected_difficulty + 1, 4)
difficulty.text = Game.DIFFICULTY_NAMES[selected_difficulty]
_set_tag()
reload_scores()
# completion amount selector
@ -148,7 +151,6 @@ func _on_Completion_pressed() -> void:
return
selected_completion = posmod(selected_completion + 1, 2)
completion.text = COMPLETION_NAMES[selected_completion]
_set_tag()
reload_scores()
# score type selector
@ -159,7 +161,9 @@ func _on_Type_pressed() -> void:
match selected_type:
ScoreType.SCORE:
_scoreboard_id = LevelData.levels[selected_level].scores_id
completion.visible = false
ScoreType.TIME:
_scoreboard_id = LevelData.levels[selected_level].times_id
completion.visible = true
type.text = SCORE_TYPE_NAMES[selected_type]
reload_scores()