diff options
-rw-r--r-- | client/global.gd | 4 | ||||
-rw-r--r-- | client/map/tiles/book.gd | 3 | ||||
-rw-r--r-- | client/menu/book/book.gd | 3 | ||||
-rw-r--r-- | client/menu/book/book.tscn | 1 |
4 files changed, 9 insertions, 2 deletions
diff --git a/client/global.gd b/client/global.gd index a9df1329..691a85c7 100644 --- a/client/global.gd +++ b/client/global.gd @@ -213,3 +213,7 @@ func interpolate_angle(current, target, dt): else: target -= PI * 2 return target + (current - target) * exp(-dt) + +func find_menu(node: Node) -> Menu: + if node is Menu: return node + else: return find_menu(node.get_parent()) diff --git a/client/map/tiles/book.gd b/client/map/tiles/book.gd index 11bd6592..44a6ebdb 100644 --- a/client/map/tiles/book.gd +++ b/client/map/tiles/book.gd @@ -21,5 +21,4 @@ func _init(rename: String, neighbors: Array): base.add_child(load("res://map/tiles/book.tscn").instantiate()) func interact(): - # the book is supposed to be opened here - pass + Global.find_menu(self).submenu("res://menu/book/book.tscn") diff --git a/client/menu/book/book.gd b/client/menu/book/book.gd index 5c5723c9..1e0620af 100644 --- a/client/menu/book/book.gd +++ b/client/menu/book/book.gd @@ -21,3 +21,6 @@ func _ready(): var texture = TextureRect.new() texture.texture = load("res://menu/book/book_%d.svg" % i) $ScrollContainer/VBoxContainer.add_child(texture) + +func menu_anim_open(): pass +func menu_anim_exit(): pass diff --git a/client/menu/book/book.tscn b/client/menu/book/book.tscn index 2a908c54..baacf099 100644 --- a/client/menu/book/book.tscn +++ b/client/menu/book/book.tscn @@ -10,6 +10,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_gyisx") +support_anim = false [node name="ScrollContainer" type="ScrollContainer" parent="."] layout_mode = 1 |