refactor du code et ajouts des quotas, avec des récompense entre chaque quota #68
This commit is contained in:
37
gui/game/reward_choice/scripts/reward_choice.gd
Normal file
37
gui/game/reward_choice/scripts/reward_choice.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
extends Control
|
||||
|
||||
var planet: Planet
|
||||
var item1: Item
|
||||
var item2: Item
|
||||
|
||||
func show_rewards():
|
||||
get_tree().paused = true
|
||||
%AnimationPlayer.play("show")
|
||||
|
||||
func hide_rewards():
|
||||
get_tree().paused = false
|
||||
%AnimationPlayer.play_backwards("show")
|
||||
|
||||
func _on_planet_quota_reward_asked(_planet:Planet, _item1:Item, _item2:Item):
|
||||
planet = _planet
|
||||
item1 = _item1
|
||||
item2 = _item2
|
||||
|
||||
%Reward1Button.text = item1.name
|
||||
%Reward1Button.icon = item1.icon
|
||||
%Reward1Desc.text = item1.description
|
||||
|
||||
%Reward2Button.text = item2.name
|
||||
%Reward2Button.icon = item2.icon
|
||||
%Reward2Desc.text = item2.description
|
||||
show_rewards()
|
||||
|
||||
func _on_reward_1_button_pressed():
|
||||
if planet:
|
||||
planet.choose_quota_reward(item1)
|
||||
hide_rewards()
|
||||
|
||||
func _on_reward_2_button_pressed():
|
||||
if planet:
|
||||
planet.choose_quota_reward(item2)
|
||||
hide_rewards()
|
||||
1
gui/game/reward_choice/scripts/reward_choice.gd.uid
Normal file
1
gui/game/reward_choice/scripts/reward_choice.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://12kjdou2kp5y
|
||||
Reference in New Issue
Block a user