midori-school/levels/ui/pause.gd

61 lines
2 KiB
GDScript3
Raw Normal View History

2024-06-09 00:09:54 +02:00
extends Control
var cff
var cnf
var chealthf
2024-06-11 23:36:12 +02:00
var clevel
2024-09-06 02:16:49 +02:00
var warpmenu
2024-06-09 00:09:54 +02:00
# Called when the node enters the scene tree for the first time.
func _ready():
2024-09-06 02:16:49 +02:00
warpmenu = $CanvasLayer/HBoxContainer2/VBoxContainer/Warp
2024-06-09 00:09:54 +02:00
cff = $CanvasLayer/HBoxContainer/TextureRect
cnf = $CanvasLayer/HBoxContainer/VBoxContainer/Cname
chealthf = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer/Label2
2024-06-11 23:36:12 +02:00
clevel = $CanvasLayer/HBoxContainer/VBoxContainer/HBoxContainer2/Label2
2024-06-15 23:11:43 +02:00
$CanvasLayer/HBoxContainer2/VBoxContainer2/Exit.grab_focus()
2024-06-17 23:08:25 +02:00
_fetchdata()
2024-06-09 00:09:54 +02:00
#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():
2024-09-06 02:16:49 +02:00
if Global.debug:
if Global.dplace != [1, 11, 19] && (Global.dplace[0] == 1 || Global.dplace[0] == 2):
warpmenu.visible = true
else:
warpmenu.visible = false
else:
if Global.cplace != [1, 11, 19] && (Global.cplace[0] == 1 || Global.dplace[0] == 2):
warpmenu.visible = true
else:
warpmenu.visible = false
2024-06-09 00:09:54 +02:00
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]))
2024-06-11 23:36:12 +02:00
clevel.set_text(str(Global.dlevel[Global.dparty[Global.dcpchar][0]]))
2024-06-09 00:09:54 +02:00
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]))
2024-06-11 23:36:12 +02:00
clevel.set_text(str(Global.level[Global.party[Global.cpchar][0]]))
2024-06-15 23:11:43 +02:00
func _on_exit_pressed():
2024-07-05 18:53:41 +02:00
Global.live = 6
2024-06-15 23:11:43 +02:00
#pass # Replace with function body.
2024-09-06 02:16:49 +02:00
func _on_warp_pressed() -> void:
if Global.debug:
Global.dplace = [0, 0, 0]
else:
Global.cplace = [0, 0, 0]
Global.live = 5