bottle service
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var bottle_service = $Control/BottleService
|
||||
var timer = 0
|
||||
const clear_time = 5
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
func message(msg: String, title: String = ""):
|
||||
var popup = RichTextLabel.new()
|
||||
popup.custom_minimum_size = Vector2(200,100)
|
||||
popup.threaded = true
|
||||
popup.push_bold()
|
||||
popup.append_text(title)
|
||||
popup.pop()
|
||||
popup.newline()
|
||||
popup.append_text(msg)
|
||||
var close = Button.new()
|
||||
close.text = "✕"
|
||||
close.size = Vector2(20, 31)
|
||||
close.position = Vector2(175, 0)
|
||||
close.pressed.connect(_on_close_pressed.bind(close))
|
||||
popup.add_child(close)
|
||||
bottle_service.add_child(popup)
|
||||
timer = 0
|
||||
|
||||
func _process(delta):
|
||||
timer += delta
|
||||
|
||||
func _on_bottle_service_child_entered_tree(node):
|
||||
pass # Replace with function body.
|
||||
|
||||
func _on_close_pressed(node):
|
||||
node.get_parent().queue_free()
|
||||
+1
-5
@@ -2,8 +2,4 @@ extends Node3D
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
$Gui.message("Use TAB to go into select mode and click on objects to interact.", "Hello world")
|
||||
|
||||
@@ -56,5 +56,6 @@ func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
|
||||
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
||||
$Pivot/Camera/FlashLight.visible = true
|
||||
has_flashlight = true
|
||||
$".."/Gui.message("You can toggle the flashlight with right-mouse", "Flashlight")
|
||||
if flashlight:
|
||||
flashlight.visible = false
|
||||
|
||||
Reference in New Issue
Block a user