state display
This commit is contained in:
parent
6949893fea
commit
5d410a02fb
3 changed files with 27 additions and 15 deletions
|
|
@ -8,6 +8,7 @@ class_name StateMachine extends Node
|
||||||
|
|
||||||
@onready var parent = get_parent()
|
@onready var parent = get_parent()
|
||||||
var previouseState = null
|
var previouseState = null
|
||||||
|
@onready var stateString: RichTextLabel = owner.get_node("StateLabel")
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -37,4 +38,5 @@ func transitionToNextState(targetStatePath: String, data: Dictionary = {}) -> vo
|
||||||
previouseState = state.name
|
previouseState = state.name
|
||||||
state.exit()
|
state.exit()
|
||||||
state = get_node(targetStatePath)
|
state = get_node(targetStatePath)
|
||||||
|
stateString.text = targetStatePath;
|
||||||
state.enter(previouseState, data)
|
state.enter(previouseState, data)
|
||||||
|
|
|
||||||
38
board.tscn
38
board.tscn
|
|
@ -22,6 +22,8 @@ layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
offset_right = -104.0
|
||||||
|
offset_bottom = -5.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_fkb2r")
|
script = ExtResource("1_fkb2r")
|
||||||
|
|
@ -40,9 +42,10 @@ layout_mode = 1
|
||||||
anchors_preset = 1
|
anchors_preset = 1
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
offset_left = -50.0
|
offset_left = 51.0
|
||||||
offset_top = 50.0
|
offset_top = 48.0
|
||||||
offset_bottom = 89.0
|
offset_right = 101.0
|
||||||
|
offset_bottom = 87.0
|
||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
|
|
||||||
[node name="Player2Points" type="RichTextLabel" parent="."]
|
[node name="Player2Points" type="RichTextLabel" parent="."]
|
||||||
|
|
@ -50,9 +53,10 @@ layout_mode = 1
|
||||||
anchors_preset = 1
|
anchors_preset = 1
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
offset_left = -48.0
|
offset_left = 54.0
|
||||||
offset_top = 100.0
|
offset_top = 96.0
|
||||||
offset_bottom = 140.0
|
offset_right = 102.0
|
||||||
|
offset_bottom = 136.0
|
||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
|
|
||||||
[node name="TurnIndicator" type="ColorRect" parent="."]
|
[node name="TurnIndicator" type="ColorRect" parent="."]
|
||||||
|
|
@ -61,16 +65,22 @@ layout_mode = 1
|
||||||
anchors_preset = 1
|
anchors_preset = 1
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
offset_left = -50.0
|
offset_left = 52.0
|
||||||
offset_bottom = 50.0
|
offset_top = -2.0
|
||||||
|
offset_right = 102.0
|
||||||
|
offset_bottom = 48.0
|
||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
|
|
||||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
[node name="StateLabel" type="RichTextLabel" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 1
|
||||||
offset_left = 1062.0
|
anchors_preset = 1
|
||||||
offset_top = 65.0
|
anchor_left = 1.0
|
||||||
offset_right = 1142.0
|
anchor_right = 1.0
|
||||||
offset_bottom = 104.0
|
offset_left = -78.0
|
||||||
|
offset_top = 1.0
|
||||||
|
offset_right = 51.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
grow_horizontal = 0
|
||||||
|
|
||||||
[node name="Hand" type="HBoxContainer" parent="."]
|
[node name="Hand" type="HBoxContainer" parent="."]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue