diff --git a/levels/ui/credits.tscn b/levels/ui/credits.tscn index 5929191..8fe760f 100644 --- a/levels/ui/credits.tscn +++ b/levels/ui/credits.tscn @@ -581,6 +581,9 @@ For inspiring my own art My father For let me know that humanity is awful +Kuro Games +For creating Yinlin as a tribute to my best character: Kimberly arch + Hans Asperger For let me know that i'm not alone in this universe diff --git a/levels/ui/gameplay.gd b/levels/ui/gameplay.gd index c3c98f5..ef4ee83 100644 --- a/levels/ui/gameplay.gd +++ b/levels/ui/gameplay.gd @@ -7,6 +7,8 @@ var sfx1 := AudioStreamPlayer.new() var musictrack var bhud = load("res://levels/bottomhud.tscn").instantiate() var thud = load("res://levels/ui/tophud.tscn").instantiate() +var pmenu = load("res://levels/ui/pause.tscn").instantiate() +var ispaused = false var ishud = true # Called when the node enters the scene tree for the first time. @@ -66,13 +68,14 @@ func _process(delta): func _input(event): if (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)) && Global.cdialog == []: - Global.live = 0 + ishud = false Global.bossready = false Global.cboss = [null, null, null] get_tree().root.remove_child(thud) get_tree().root.remove_child(bhud) get_tree().root.remove_child(player) get_tree().root.remove_child(level) + Global.live = 0 if Global.debug: get_tree().change_scene_to_file("res://levels/ui/scene.tscn") else: @@ -110,10 +113,10 @@ func _input(event): sfx1.stream = load(Global.sfxtracks[1]) sfx1.play(0) bgsound.play(0) - if Global.cdialog.size() != 0 && ishud: + if Global.live != 1 && ishud: get_tree().root.remove_child(thud) ishud = false - elif Global.cdialog.size() == 0&& !ishud: + elif Global.live == 1 && !ishud: get_tree().root.add_child.call_deferred(thud) ishud = true func _statrebase(): diff --git a/levels/ui/pause.gd b/levels/ui/pause.gd new file mode 100644 index 0000000..78ee738 --- /dev/null +++ b/levels/ui/pause.gd @@ -0,0 +1,30 @@ +extends Control +var cff +var cnf +var chealthf + +# Called when the node enters the scene tree for the first time. +func _ready(): + cff = $CanvasLayer/HBoxContainer/TextureRect + cnf = $CanvasLayer/HBoxContainer/VBoxContainer/Cname + chealthf = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer/Label2 + _fetchdata() + #pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _input(event): + _fetchdata() + +func _fetchdata(): + if Global.debug: + cnf.set_text(Global.pcnames[Global.dparty[Global.dcpchar][0]]) + cff.texture = load(Global.hudfaces[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]]) + chealthf.set_text(str(Global.dstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.dcpchar][0]][0])) + else: + cnf.set_text(Global.pcnames[Global.party[Global.cpchar][0]]) + cff.texture = load(Global.hudfaces[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]]) + chealthf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][0])+"/"+str(Global.mstats[Global.dparty[Global.cpchar][0]][0])) diff --git a/levels/ui/pause.tscn b/levels/ui/pause.tscn new file mode 100644 index 0000000..1b6cf2a --- /dev/null +++ b/levels/ui/pause.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=2 format=3 uid="uid://5ilscynpg61o"] + +[ext_resource type="Script" path="res://levels/ui/pause.gd" id="1_x3t1h"] + +[node name="Pause" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_x3t1h") + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] +custom_minimum_size = Vector2(1280, 720) +offset_right = 1280.0 +offset_bottom = 720.0 +color = Color(0, 0, 0, 1) + +[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer"] +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="TextureRect" type="TextureRect" parent="CanvasLayer/HBoxContainer"] +custom_minimum_size = Vector2(116, 116) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/HBoxContainer"] +layout_mode = 2 + +[node name="Cname" type="Label" parent="CanvasLayer/HBoxContainer/VBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/HBoxContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="Label2" type="Label" parent="CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(123, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2