-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapPopup.gd
53 lines (44 loc) · 1.2 KB
/
MapPopup.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
extends Control
var active = false
var quick_mode = false
var wait_a_bit = false
func show_me() -> bool:
var can_pause = get_node("/root/GlobalData").get_pause_focus('goal-popup')
if not can_pause:
return false
active = true
visible = true
get_tree().paused = true
wait_a_bit = true
return true
func set_job_goal(new_tilemap : TileMap) -> void:
for c in get_children():
if c is TileMap:
c.queue_free()
new_tilemap.get_parent().remove_child(new_tilemap)
add_child(new_tilemap)
new_tilemap.set_owner(self)
new_tilemap.visible = true
func show_quick():
if show_me():
quick_mode = true
func hide():
active = false
visible = false
get_tree().paused = false
#find_parent("Root").find_node("Player").hide_map_popup()
get_node("/root/GlobalData").release_pause_focus('goal-popup')
# warning-ignore:unused_argument
func _process(delta):
if not active:
if Input.is_action_pressed("action_quick_job_view"):
if get_node("/root/GlobalData").is_at_job():
show_quick()
return
if quick_mode:
if not Input.is_action_pressed("action_quick_job_view"):
call_deferred('hide')
if wait_a_bit:
wait_a_bit = false
elif Input.is_action_just_pressed("action_dismiss"):
call_deferred('hide')