GUI.gd

Main system that handle all GUI elements in game

@onready var sv_effects_subviewport : SubViewportContainer = $"../../sv"
@onready var subviewport : SubViewport = $"../../sv/EffectDither"
@onready var frame : Control = $GAME/frame # game frame on the screen
@onready var hint: Label = $GAME/frame/screen_hint
@onready var ammo_clip : Label = $GAME/frame/ammo_frame/ammo_clip
@onready var ammo_all : Label = $GAME/frame/ammo_frame/ammo_all
@onready var belt_0_icon : TextureRect = $GAME/frame/ammo_frame/belt_0
@onready var belt_1_icon : TextureRect = $GAME/frame/ammo_frame/belt_1
@onready var belt_2_icon : TextureRect = $GAME/frame/ammo_frame/belt_2
@onready var belt_3_icon : TextureRect = $GAME/frame/ammo_frame/belt_3
@onready var weapon_icon : TextureRect = $GAME/frame/ammo_frame/weapon_icon
@onready var health_bar : TextureProgressBar = $GAME/frame/hp_bar
@onready var rad_bar : TextureProgressBar = $GAME/frame/rad_bar_frame/rad_bar
@onready var health_bar_inv : TextureProgressBar = $GAME/Inventory/hp_bar_inv
@onready var crosshair : TextureRect = $GAME/frame/cross
@onready var fps : Label = $GAME/frame/fps
@onready var pos : Label = $GAME/frame/pos
@onready var rot : Label = $GAME/frame/rot
@onready var camera_rotations : Label = $GAME/frame/rot2
@onready var pda_icon : TextureRect = $GAME/frame/pda_icon
@onready var rad_icon : TextureRect = $GAME/frame/radiation_icon
@onready var save_icon : TextureRect = $GAME/frame/save_icon
@onready var timers_text : Label = $GAME/frame/timers
@onready var message : Label = $GAME/frame/message
@export var loading_screen : Control
@onready var scope : TextureRect = $GAME/frame/lr_scope
@onready var main_menu : MainMenu = $GAME/MainMenu
@onready var damage_l : TextureRect = $GAME/frame/DamageLeft
@onready var damage_r : TextureRect = $GAME/frame/DamageRight
@onready var medkit_count : Label = $GAME/frame/medkit_icon/medkit_count
@onready var medkit_army_count : Label = $GAME/frame/medkit2_icon/medkit2_count
@onready var antirad_count : Label = $GAME/frame/antirad_icon/antirad_count
@onready var medkit_icon : TextureRect = $GAME/frame/medkit_icon
@onready var medkit_army_icon : TextureRect = $GAME/frame/medkit2_icon
@onready var antirad_icon : TextureRect = $GAME/frame/antirad_icon
@onready var weapon_hud : Sprite3D = $"../../sv/EffectDither/World/Player/Head/PlayerCamera/HUD"
@onready var casual_icon = $GAME/frame/casual_icon
@onready var press_f_text : Label = $GAME/frame/press_f
@onready var death_screen = $DeathScreen
@onready var final_image = $GAME/FinalImage

@onready var game_gui_root : Control = $GAME
@onready var vignette : TextureRect = $GAME/Vignette

@onready var InventoryWindow : Inventory = $GAME/Inventory as Inventory
@onready var InventoryMoney : Label = $GAME/Inventory/money
@onready var JournalWindow : Journal = $GAME/Journal as Journal
@onready var PauseWindow : PauseMenu = $GAME/Pause as PauseMenu
@onready var DialogueWindow : DialogueSystem = $GAME/Dialogue as DialogueSystem
@onready var TradingWindow : TradingSystem = $GAME/Trading as TradingSystem
@onready var MapWindow : Map = $GAME/Map as Map
@onready var ConsoleWindow : Console = $GAME/Console as Console
@onready var TipWindow : Control = $GAME/HelpMessage
@onready var SkillWindow : SkillSystem = $GAME/Statistic as SkillSystem
@onready var IntroWindow : Control = $GAME/IntroMessage
@onready var MainMenuWindow : MainMenu = $GAME/MainMenu as MainMenu
@onready var SpawnMenuWindow = $GAME/SpawnMenu

@onready var GUI_ROOT : Control = $"."
@onready var GUI_GAME : Control = $GAME

@export var translation_labels : Array[Label] = []
@export var translation_buttons : Array[Button] = []
@export var textures_loader_elements = []

@onready var Loot : LootWindow = $GAME/Loot
@onready var TradingMessage = $GAME/TradingMessage

var is_tutorial_tip = false
var belt_ui : Array

# timer for message show
var message_showtime = 1.5
@onready var message_timer = Timer.new()
var intro_scroll_timer = 1.0
var messages_queue = []

var splash_timer = 3.0
var fade_time = 1.0

var viewport_init_size = Vector2()

var last_scale = 0
# templates of crosshair textures for quick changing
var crosshair_gun_texture
var crosshair_use_texture
var crosshair_lock_texture
var crosshair_hit_texture
var crosshair_headshot_texture

signal on_gui_init_finished

# functions
func on_message_timer_timeout()
func resize_cursor()
func search_image_nodes()
func search_ui_text_nodes()
func search_buttons_text_nodes()
func SetWeaponHUD()
func SetHUD()
func SetCausalIcon()
func UpdateHUDAmounts()
func PressF()
func ShowMessage()
func ShowTradingMessage()
func _on_bug_button_ok_pressed()
func show_hint()
func clear_hint()
func UpdateTexts()
func ShowIntroMessage()
func HideIntroMessage()
func ShowIntroMessageCustom()
func LoadHelpTipJson()
func ShowRad()
func HideRad()

Last updated