update
This commit is contained in:
@@ -7,7 +7,17 @@ func get_context_buttons():
|
||||
go_eat_button.text = "Go Eat"
|
||||
go_eat_button.pressed.connect(go_eat)
|
||||
buttons.append(go_eat_button)
|
||||
# go sleep
|
||||
var go_sleep_button = Button.new()
|
||||
go_sleep_button.text = "Go Sleep"
|
||||
go_sleep_button.pressed.connect(go_sleep)
|
||||
buttons.append(go_sleep_button)
|
||||
|
||||
# go cook
|
||||
var go_cook_button = Button.new()
|
||||
go_cook_button.text = "Go Cook"
|
||||
go_cook_button.pressed.connect(go_cook)
|
||||
buttons.append(go_cook_button)
|
||||
return buttons
|
||||
|
||||
func go_eat():
|
||||
@@ -22,9 +32,31 @@ func go_eat():
|
||||
print("I found food")
|
||||
Global.hide_context_menu.emit()
|
||||
|
||||
func go_sleep():
|
||||
print("I will go to sleep")
|
||||
var selected_person = Global.object_selected
|
||||
selected_person.target_action = "sleep"
|
||||
var result = BuildManager.set_person_target_build("bed", true)
|
||||
print(result)
|
||||
if result != null:
|
||||
selected_person.set_target(result.ActionNode)
|
||||
else:
|
||||
print("I cant find free bed")
|
||||
|
||||
func sleep(person, object, action):
|
||||
person.action = action
|
||||
person.action = action
|
||||
person.timer.wait_time = 2.0
|
||||
person.timer.one_shot = true
|
||||
person.timer.start()
|
||||
person.timer.timeout.connect(person._on_timer_timeout)
|
||||
|
||||
|
||||
func go_cook():
|
||||
print("I will go cooking")
|
||||
var selected_person = Global.object_selected
|
||||
var result = BuildManager.set_person_target_build("pot", true)
|
||||
if result != null:
|
||||
selected_person.set_target(result)
|
||||
else:
|
||||
print("I cant find free pot")
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user