28 lines
444 B
GDScript
28 lines
444 B
GDScript
|
|
extends Button
|
||
|
|
class_name BuildButton
|
||
|
|
|
||
|
|
enum CreationAction {
|
||
|
|
Reservation,
|
||
|
|
Creation,
|
||
|
|
}
|
||
|
|
|
||
|
|
enum CursorStyle {
|
||
|
|
Single,
|
||
|
|
Area,
|
||
|
|
Line
|
||
|
|
}
|
||
|
|
|
||
|
|
#@export var building: Resource
|
||
|
|
@export var cursor_style: CursorStyle
|
||
|
|
@export var creation_action: CreationAction
|
||
|
|
@export var building: BuildingData
|
||
|
|
|
||
|
|
var menu: BuildMenu
|
||
|
|
|
||
|
|
func _ready():
|
||
|
|
menu = Util.find_parent_type(self, BuildMenu)
|
||
|
|
text = building.tile_name
|
||
|
|
|
||
|
|
func _pressed():
|
||
|
|
menu.build_button_pressed(self)
|