From 32dbaa3673456c00f568498c282e9c9d0a7b18a0 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 10 Feb 2024 19:21:10 +0100 Subject: [PATCH] Removed unnecessary globals --- client/Global.gd | 6 +----- client/ui/settings/RenderScale.gd | 4 ++-- client/ui/settings/ScaleMode.gd | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/client/Global.gd b/client/Global.gd index 468a1ca..aaca3fe 100644 --- a/client/Global.gd +++ b/client/Global.gd @@ -5,8 +5,6 @@ extends Node var camera: Camera3D var player: Player -var viewport: Viewport -var window: Window var players: PlayerManager var account_id: String var auth_token: String @@ -16,6 +14,4 @@ var username: String func _enter_tree(): instance_id = OS.get_process_id() % 4 - username = "user%d" % instance_id - viewport = get_viewport() - window = get_window() \ No newline at end of file + username = "user%d" % instance_id \ No newline at end of file diff --git a/client/ui/settings/RenderScale.gd b/client/ui/settings/RenderScale.gd index 94bbe6f..7021731 100644 --- a/client/ui/settings/RenderScale.gd +++ b/client/ui/settings/RenderScale.gd @@ -3,7 +3,7 @@ extends OptionButton var fsrQuality: Array[float] = [0.50, 0.59, 0.67, 0.77, 1.0] func _ready(): - var viewport_scale := Global.viewport.scaling_3d_scale + var viewport_scale := get_viewport().scaling_3d_scale var closest := -1 var closest_diff := 999.0 @@ -17,4 +17,4 @@ func _ready(): selected = closest func on_item_selected(index): - Global.viewport.scaling_3d_scale = fsrQuality[index] \ No newline at end of file + get_viewport().scaling_3d_scale = fsrQuality[index] \ No newline at end of file diff --git a/client/ui/settings/ScaleMode.gd b/client/ui/settings/ScaleMode.gd index 4cd827e..1032c94 100644 --- a/client/ui/settings/ScaleMode.gd +++ b/client/ui/settings/ScaleMode.gd @@ -1,7 +1,7 @@ extends OptionButton func _ready(): - match Global.viewport.scaling_3d_mode: + match get_viewport().scaling_3d_mode: Viewport.SCALING_3D_MODE_BILINEAR: selected = 0 Viewport.SCALING_3D_MODE_FSR: @@ -12,8 +12,8 @@ func _ready(): func on_item_selected(index: int): match index: 0: - Global.viewport.scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_BILINEAR 1: - Global.viewport.scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR 2: - Global.viewport.scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2 + get_viewport().scaling_3d_mode = Viewport.SCALING_3D_MODE_FSR2