Refactor cutscene queue
This commit is contained in:
26
battle/ui/ActionBox.gd
Normal file
26
battle/ui/ActionBox.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
class_name ActionBox extends GridContainer
|
||||
const BattleMove = preload("res://battle/fighter/BattleMove.gd")
|
||||
|
||||
@export var btnAttack:Button
|
||||
@export var btnMagic:Button
|
||||
@export var btnItem:Button
|
||||
|
||||
signal decisionMade(move:BattleMove)
|
||||
|
||||
func _ready() -> void:
|
||||
btnAttack.pressed.connect(onAttackPressed)
|
||||
btnMagic.pressed.connect(onMagicPressed)
|
||||
btnItem.pressed.connect(onItemPressed)
|
||||
self.visible = false
|
||||
|
||||
func onAttackPressed() -> void:
|
||||
print("Attack button pressed")
|
||||
decisionMade.emit(null)
|
||||
|
||||
func onMagicPressed() -> void:
|
||||
print("Magic button pressed")
|
||||
decisionMade.emit(null)
|
||||
|
||||
func onItemPressed() -> void:
|
||||
print("Item button pressed")
|
||||
decisionMade.emit(null)
|
||||
1
battle/ui/ActionBox.gd.uid
Normal file
1
battle/ui/ActionBox.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://27274005hbgh
|
||||
36
battle/ui/ActionBox.tscn
Normal file
36
battle/ui/ActionBox.tscn
Normal file
@@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ktmvnapibv2q"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://27274005hbgh" path="res://battle/ui/ActionBox.gd" id="1_w5s71"]
|
||||
|
||||
[node name="ActionBox" type="GridContainer" node_paths=PackedStringArray("btnAttack", "btnMagic", "btnItem")]
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -86.0
|
||||
offset_top = -44.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
columns = 2
|
||||
script = ExtResource("1_w5s71")
|
||||
btnAttack = NodePath("Attack")
|
||||
btnMagic = NodePath("Magic")
|
||||
btnItem = NodePath("Items")
|
||||
metadata/_custom_type_script = "uid://27274005hbgh"
|
||||
|
||||
[node name="Attack" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Attack"
|
||||
|
||||
[node name="Magic" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Magic"
|
||||
|
||||
[node name="Items" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Items"
|
||||
|
||||
[node name="idk" type="Button" parent="."]
|
||||
layout_mode = 2
|
||||
text = "idk"
|
||||
Reference in New Issue
Block a user