checheche/Robo-Bus-A31-HMI/code/main.gd
2024-12-11 23:26:40 +08:00

64 lines
2.6 KiB
GDScript

extends BaseControl
@onready var main_3d_vehicle: MarginContainer = %Main3DVehicle
@onready var main_3d_vehicle_texture: BaseControl = %Main3DVehicleTexture
@onready var data_panel: HBoxContainer = %DataPanel
@onready var _3d_vehicle: BaseControl = $"HBoxContainer/MarginContainer/DataPanel/MediumMenu/VBoxContainer/CarInfoDisplay/3DVehicle"
@onready var main_3d_vehicle_background: NinePatchRect = %Main3DVehicleBackground
@onready var main_3d_vehicle_information: MarginContainer = %Main3DVehicleInformation
@onready var _3d_vehicle_information: MarginContainer = %"3DVehicleInformation"
@onready var pretend_main_3d_vehicle_information: MarginContainer = %PretendMain3DVehicleInformation
var isVolumeSettings = false:
set(value):
isVolumeSettings = value
await get_tree().create_timer(0.5).timeout
isVolumeSettings = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Engine.time_scale = 0.01
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func OnClick3DVehicle(_node: Variant) -> void:
if !isVolumeSettings:
isVolumeSettings = true
main_3d_vehicle.visible = true
#main_3d_vehicle_background.visible = false
pretend_main_3d_vehicle_information.modulate.a = 1
main_3d_vehicle_background.modulate.a = 0
main_3d_vehicle_information.modulate.a = 0
data_panel.modulate.a = 1
_3d_vehicle.modulate.a = 0
_3d_vehicle_information.modulate.a = 1
main_3d_vehicle_texture.modulate.a = 0
await get_tree().process_frame
await get_tree().process_frame
#main_3d_vehicle.self_modulate.a = 0
main_3d_vehicle_texture.modulate.a = 255
main_3d_vehicle_texture.onStart()
var tween0 = create_tween()
tween0.set_parallel()
tween0.tween_property(_3d_vehicle_information, "modulate", Color(1,1,1,0), 0.1)
tween0.tween_property(pretend_main_3d_vehicle_information, "modulate", Color(1,1,1,0), 0.1)
await get_tree().create_timer(0.3).timeout
#main_3d_vehicle_background.visible = true
var tween = create_tween()
tween.set_parallel()
tween.tween_property(main_3d_vehicle_background, "modulate", Color(1,1,1,1), 0.1)
tween.tween_property(main_3d_vehicle_information, "modulate", Color(1,1,1,1), 0.05)
tween.tween_property(data_panel, "modulate", Color(1,1,1,0), 0.1)
main_3d_vehicle_information
_3d_vehicle.modulate.a = 1
await get_tree().create_timer(0.1).timeout
_3d_vehicle_information.modulate.a = 1
data_panel.visible = false
#main_3d_vehicle.self_modulate.a = 1
pass # Replace with function body.""