mirror of
https://github.com/CrispyPin/ovr-utils.git
synced 2024-11-21 23:20:25 +01:00
overlay instances use defaults if a setting is missing
This commit is contained in:
parent
dd28bdcb54
commit
9a5e58351f
2 changed files with 13 additions and 9 deletions
|
@ -69,17 +69,21 @@ func add_grab():
|
||||||
func load_settings():
|
func load_settings():
|
||||||
if Settings.s.overlays.has(name):
|
if Settings.s.overlays.has(name):
|
||||||
var loaded = Settings.s.overlays[name]
|
var loaded = Settings.s.overlays[name]
|
||||||
|
|
||||||
if loaded.has("fallback"):
|
if loaded.has("fallback"):
|
||||||
fallback = loaded.fallback
|
fallback = loaded.fallback
|
||||||
set_target(loaded.target)
|
if loaded.has("target"):
|
||||||
|
set_target(loaded.target)
|
||||||
|
|
||||||
set_width_in_meters(loaded.width)
|
if loaded.has("offsets"):
|
||||||
|
for t_key in loaded.offsets:
|
||||||
for t_key in loaded.offsets:
|
var t_offset = loaded.offsets[t_key]
|
||||||
var t_offset = loaded.offsets[t_key]
|
_offsets[t_key].pos = t_offset.pos
|
||||||
_offsets[t_key].pos = t_offset.pos
|
_offsets[t_key].rot = t_offset.rot
|
||||||
_offsets[t_key].rot = t_offset.rot
|
|
||||||
update_offset()
|
update_offset()
|
||||||
|
|
||||||
|
if loaded.has("width"):
|
||||||
|
set_width_in_meters(loaded.width)
|
||||||
if loaded.has("visible"):
|
if loaded.has("visible"):
|
||||||
set_overlay_visible(loaded.visible)
|
set_overlay_visible(loaded.visible)
|
||||||
if loaded.has("alpha"):
|
if loaded.has("alpha"):
|
||||||
|
|
|
@ -7,11 +7,11 @@ func _ready() -> void:
|
||||||
overlay = OverlayManager.get_node(overlay_name)
|
overlay = OverlayManager.get_node(overlay_name)
|
||||||
$MoreOptions/Container/List/SetSize/PanelContainer.visible = false
|
$MoreOptions/Container/List/SetSize/PanelContainer.visible = false
|
||||||
$MoreOptions/Container/List/SetAlpha/PanelContainer.visible = false
|
$MoreOptions/Container/List/SetAlpha/PanelContainer.visible = false
|
||||||
$MoreOptions/Container/List/SetSize/PanelContainer/SizeSlider.value = Settings.s.overlays[overlay_name].width
|
$MoreOptions/Container/List/SetSize/PanelContainer/SizeSlider.value = overlay.width_meters
|
||||||
$MoreOptions.visible = false
|
$MoreOptions.visible = false
|
||||||
$BasicOptions/Label.text = overlay_name
|
$BasicOptions/Label.text = overlay_name
|
||||||
name = overlay_name
|
name = overlay_name
|
||||||
$MoreOptions/Container/List/Target.selected = overlay.TARGETS.find(Settings.s.overlays[overlay_name].target)
|
$MoreOptions/Container/List/Target.selected = overlay.TARGETS.find(overlay.target)
|
||||||
overlay.connect("overlay_visibility_changed", self, "_overlay_visibility_changed")
|
overlay.connect("overlay_visibility_changed", self, "_overlay_visibility_changed")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue