Fix score selection issues and update score item options.
Changed large straight initialization to correct function, added missing score items, and used correct methods for score selections. Adjusted configuration in the scene file to align with the new item options setup.
This commit is contained in:
@ -37,11 +37,12 @@ func _ready():
|
||||
add_items(four_of_a_kind)
|
||||
full_house = get_node("ScrollContainer/VBoxContainer/Full_House/HBoxContainer/OptionButton")
|
||||
full_house.add_item("")
|
||||
full_house.add_item("-")
|
||||
full_house.add_item("25")
|
||||
small_straight = get_node("ScrollContainer/VBoxContainer/Small_Straight/HBoxContainer/OptionButton")
|
||||
add_items_to_small_straight(small_straight)
|
||||
large_straight = get_node("ScrollContainer/VBoxContainer/Large_Straight/HBoxContainer/OptionButton")
|
||||
add_items_to_small_straight(large_straight)
|
||||
add_items_to_large_straight(large_straight)
|
||||
yahtzee = get_node("ScrollContainer/VBoxContainer/yahtzee/HBoxContainer/ButtonYahtzee")
|
||||
bonus = get_node("ScrollContainer/VBoxContainer/Bonus/HBoxContainer/LabelScore")
|
||||
chance = get_node("ScrollContainer/VBoxContainer/chance/HBoxContainer/OptionButton")
|
||||
@ -113,7 +114,7 @@ func load_stats():
|
||||
small_straight.select(players[currentPlayer].small_straight)
|
||||
large_straight.select(players[currentPlayer].large_straight)
|
||||
yahtzee.text = str(players[currentPlayer].yahtzee)
|
||||
chance.set_item_text(0, str(players[currentPlayer].chance))
|
||||
chance.select(players[currentPlayer].chance)
|
||||
bonus.text = str(players[currentPlayer].bonus)
|
||||
pass
|
||||
|
||||
@ -132,6 +133,7 @@ func save():
|
||||
players[currentPlayer].large_straight = int(large_straight.get_selected_id())
|
||||
players[currentPlayer].yahtzee = int(yahtzee.text)
|
||||
players[currentPlayer].bonus = int(bonus.text)
|
||||
players[currentPlayer].chance = int(chance.get_selected_id())
|
||||
players[currentPlayer].score = players[currentPlayer].one + players[currentPlayer].two + players[currentPlayer].three + players[currentPlayer].four + players[currentPlayer].five + players[currentPlayer].six + players[currentPlayer].three_of_a_kind + players[currentPlayer].four_of_a_kind + players[currentPlayer].full_house + players[currentPlayer].small_straight + players[currentPlayer].large_straight + players[currentPlayer].yahtzee + players[currentPlayer].chance + players[currentPlayer].bonus
|
||||
pass
|
||||
|
||||
@ -147,15 +149,18 @@ func _on_button_left_pressed():
|
||||
|
||||
func add_items_to_small_straight(oButton: OptionButton):
|
||||
oButton.add_item("")
|
||||
oButton.add_item("-")
|
||||
oButton.add_item("30")
|
||||
pass # Replace with function body.
|
||||
|
||||
func add_items_to_large_straight(oButton: OptionButton):
|
||||
oButton.add_item("")
|
||||
oButton.add_item("-")
|
||||
oButton.add_item("40")
|
||||
pass # Replace with function body.
|
||||
func add_items(oButton: OptionButton):
|
||||
oButton.add_item("")
|
||||
oButton.add_item("-")
|
||||
oButton.add_item("0")
|
||||
oButton.add_item("1")
|
||||
oButton.add_item("2")
|
||||
|
Reference in New Issue
Block a user