context menu added
player can find food and eat it
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
extends Node
|
||||
|
||||
func get_context_buttons():
|
||||
var buttons = Array()
|
||||
# go eat
|
||||
var go_eat_button = Button.new()
|
||||
go_eat_button.text = "Go Eat"
|
||||
go_eat_button.pressed.connect(go_eat)
|
||||
buttons.append(go_eat_button)
|
||||
|
||||
return buttons
|
||||
|
||||
func go_eat():
|
||||
print("I will go eat")
|
||||
print(Global.object_selected)
|
||||
var selected_person = Global.object_selected
|
||||
selected_person.target_action = "eat"
|
||||
var result = ItemManager.set_person_target_item(selected_person, "food")
|
||||
if result == null:
|
||||
print("I cant find food")
|
||||
else:
|
||||
print("I found food")
|
||||
Global.hide_context_menu.emit()
|
||||
|
||||
func sleep(person, object, action):
|
||||
person.action = action
|
||||
person.timer.wait_time = 2.0
|
||||
|
||||
Reference in New Issue
Block a user