diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-08 20:05:39 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-08 20:05:39 +0200 |
commit | 3a93493437182a20040cd50cf83a3d3196b046fc (patch) | |
tree | ba561e6e5438c5570a56bf6342b8d315c24e29dc /client | |
parent | c0d4eb9da614c02dc5dc4a15db420014f592ba45 (diff) | |
download | hurrycurry-3a93493437182a20040cd50cf83a3d3196b046fc.tar hurrycurry-3a93493437182a20040cd50cf83a3d3196b046fc.tar.bz2 hurrycurry-3a93493437182a20040cd50cf83a3d3196b046fc.tar.zst |
open book menu when interacting with the tile
Diffstat (limited to 'client')
-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 |