20 lines
470 B
GDScript3
Raw Normal View History

2024-02-05 22:42:04 +00:00
extends OptionButton
var fsrQuality: Array[float] = [0.50, 0.59, 0.67, 0.77, 1.0]
func _ready():
2024-02-06 14:51:48 +00:00
var viewport_scale := Global.viewport.scaling_3d_scale
2024-02-05 22:42:04 +00:00
var closest := -1
var closest_diff := 999.0
for index in range(item_count):
var diff: float = abs(viewport_scale - fsrQuality[index])
if diff < closest_diff:
closest = index
closest_diff = diff
selected = closest
func on_item_selected(index):
2024-02-06 14:51:48 +00:00
Global.viewport.scaling_3d_scale = fsrQuality[index]