unity of scores (closes #196)
This commit is contained in:
parent
eda2db4a3a
commit
481edb15b7
3 changed files with 53 additions and 35 deletions
|
@ -15,7 +15,6 @@ onready var tab_container: TabContainer = $"%TabContainer"
|
|||
|
||||
func _ready() -> void:
|
||||
yield(get_tree(), "idle_frame")
|
||||
_set_tag()
|
||||
print(_scoreboard_tag)
|
||||
$"%YesScore".grab_focus()
|
||||
Fade.fade_in(0.4)
|
||||
|
@ -24,6 +23,7 @@ func _ready() -> void:
|
|||
func _on_YesScore_pressed() -> void:
|
||||
_scoreboard_id = LevelData.levels[Game.current_level].scores_id
|
||||
_score_value = Game.final_score
|
||||
_set_tag(false)
|
||||
tab_container.current_tab = 2
|
||||
if yield(_submit(), "completed"):
|
||||
tab_container.current_tab = 3
|
||||
|
@ -42,6 +42,7 @@ func _on_NoScore_pressed() -> void:
|
|||
func _on_YesTime_pressed() -> void:
|
||||
_scoreboard_id = LevelData.levels[Game.current_level].times_id
|
||||
_score_value = int(Game.time * 1000.0)
|
||||
_set_tag(true)
|
||||
tab_container.current_tab = 2
|
||||
if yield(_submit(), "completed"):
|
||||
tab_container.current_tab = 3
|
||||
|
@ -62,7 +63,7 @@ func _next_screen() -> void:
|
|||
SceneManager.change_scene(LevelSelect.instance())
|
||||
|
||||
|
||||
func _set_tag() -> void:
|
||||
func _set_tag(include_completion: bool = false) -> void:
|
||||
match Game.difficulty:
|
||||
Game.Difficulty.SWEET:
|
||||
_scoreboard_tag = "sweet"
|
||||
|
@ -72,10 +73,11 @@ func _set_tag() -> void:
|
|||
_scoreboard_tag = "spicy"
|
||||
Game.Difficulty.PUNGENT:
|
||||
_scoreboard_tag = "pungent"
|
||||
if Game.keys >= 50 and Game.shards >= 5:
|
||||
_scoreboard_tag += "-100%"
|
||||
else:
|
||||
_scoreboard_tag += "-any%"
|
||||
if include_completion:
|
||||
if Game.keys >= 50 and Game.shards >= 5:
|
||||
_scoreboard_tag += "-100%"
|
||||
else:
|
||||
_scoreboard_tag += "-any%"
|
||||
|
||||
|
||||
# returns true if the score was successfully submitted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue