2021-11-22 02:47:41 +00:00
|
|
|
extends AcceptDialog
|
|
|
|
|
2022-05-28 15:23:52 +00:00
|
|
|
onready var hslider: HSlider = $VBoxContainer/HBoxContainer/HSlider
|
|
|
|
onready var spinbox: SpinBox = $VBoxContainer/HBoxContainer/SpinBox
|
|
|
|
onready var fullscreen_warning: Label = $VBoxContainer/FullscreenWarning
|
2021-11-22 02:47:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_WindowOpacityDialog_about_to_show() -> void:
|
2022-05-28 14:29:38 +00:00
|
|
|
OS.window_per_pixel_transparency_enabled = true
|
2021-11-22 02:47:41 +00:00
|
|
|
hslider.editable = !OS.window_fullscreen
|
|
|
|
spinbox.editable = hslider.editable
|
2022-05-28 15:23:52 +00:00
|
|
|
fullscreen_warning.visible = !spinbox.editable
|
2021-11-22 02:47:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_value_changed(value: float) -> void:
|
2021-11-25 12:48:30 +00:00
|
|
|
set_window_opacity(value)
|
|
|
|
|
|
|
|
|
|
|
|
func set_window_opacity(value: float) -> void:
|
2021-11-22 02:47:41 +00:00
|
|
|
if OS.window_fullscreen:
|
|
|
|
value = 100.0
|
|
|
|
hslider.value = value
|
|
|
|
spinbox.value = value
|
|
|
|
|
|
|
|
value = value / 100.0
|
2022-01-29 22:47:25 +00:00
|
|
|
for container in Global.control.ui._panel_container.get_children():
|
|
|
|
container.self_modulate.a = value
|
2021-11-22 02:47:41 +00:00
|
|
|
Global.transparent_checker.transparency(value)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_WindowOpacityDialog_popup_hide() -> void:
|
|
|
|
Global.dialog_open(false)
|