Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | start123 |
Instead of not letting the icon change, if this icon already exists, it simply passes.
What has been done wrong?
Here is the code:
select = "0"
apply1 = "0"
apply2 = "0"
apply3 = "0"
func _on_orange_pressed():
select = "orange"
func _on_apple_pressed():
select = "apple"
func _on_pear_pressed():
select = "pear"
func _on_apply1_pressed():
if apply2 or apply3 == select:
pass
else:
if select == "orange":
$icons/icon1.texture = game.orange
apply1 = "orange"
elif select == "apple":
$icons/icon1.texture = game.apple
apply1 = "apple"
elif select == "pear":
$icons/icon1.texture = game.pear
apply1 = "pear"
func _on_apply2_pressed():
if apply1 or apply3 == select:
pass
else:
if select == "orange":
$icons/icon2.texture = game.orange
apply2 = "orange"
elif select == "apple":
$icons/icon2.texture = game.apple
apply2 = "apple"
elif select == "pear":
$icons/icon2.texture = game.pear
apply2 = "pear"
func _on_apply3_pressed():
if apply1 or apply2 == select:
pass
else:
if select == "orange":
$icons/icon3.texture = game.orange
apply3 = "orange"
elif select == "apple":
$icons/icon3.texture = game.apple
apply3 = "apple"
elif select == "pear":
$icons/icon3.texture = game.pear
apply3 = "pear"