perf: harden runtime for weaker hardware

This commit is contained in:
Rijad Zuzo
2026-08-12 10:02:45 +02:00
parent cd29da95e0
commit 34428d836a
47 changed files with 2164 additions and 243 deletions
+9 -1
View File
@@ -3,6 +3,7 @@ extends Control
const ENTER_OFFSET := 9.0
const EXIT_OFFSET := 4.0
const PROBE_INTERVAL_SECONDS := 0.1
@export var player: Node
@export var simulation_manager: Node
@@ -21,6 +22,7 @@ var current_context_key := ""
var motion_tween: Tween
var motion_version := 0
var is_hiding := false
var _probe_elapsed := 0.0
func _ready() -> void:
@@ -32,11 +34,17 @@ func _ready() -> void:
call_deferred("refresh_note", true)
func _process(_delta: float) -> void:
func _process(delta: float) -> void:
_probe_elapsed += delta
if _probe_elapsed < PROBE_INTERVAL_SECONDS:
return
_probe_elapsed = fmod(_probe_elapsed, PROBE_INTERVAL_SECONDS)
refresh_note()
func refresh_note(force: bool = false) -> void:
if force:
_probe_elapsed = 0.0
if player == null or not player.has_method("get_nearby_villager_inspection"):
current_context_key = ""
_hide_note()