broken_seals/game/ui/crafting/RecipeSelector.gd

18 lines
493 B
GDScript3
Raw Normal View History

2019-11-20 14:30:34 +01:00
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
var _recipe : CraftRecipe
var _crafting_window : Node
func set_recipe(recipe : CraftRecipe, crafting_window : Node) -> void:
_recipe = recipe
_crafting_window = crafting_window
text = recipe.item.item.text_name
func _pressed():
_crafting_window.select_recipe(_recipe)