more work on the ui theme and changing the hud
This commit is contained in:
21
UI/FeatureUI/feature_ui.gd
Normal file
21
UI/FeatureUI/feature_ui.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name FeatureUI
|
||||
extends VBoxContainer
|
||||
|
||||
@export var icon: TextureRect
|
||||
@export var name_label: Label
|
||||
|
||||
var feature: Feature
|
||||
|
||||
|
||||
func set_feature(new_feature: Feature) -> void:
|
||||
feature = new_feature
|
||||
icon.texture = feature.icon
|
||||
name_label.text = tr(feature.display_name)
|
||||
|
||||
|
||||
func show_title() -> void:
|
||||
name_label.visible = true
|
||||
|
||||
|
||||
func hide_title() -> void:
|
||||
name_label.visible = false
|
||||
1
UI/FeatureUI/feature_ui.gd.uid
Normal file
1
UI/FeatureUI/feature_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://o668c5lfhgm5
|
||||
28
UI/FeatureUI/feature_ui.tscn
Normal file
28
UI/FeatureUI/feature_ui.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c8xdsg6gtwvh3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o668c5lfhgm5" path="res://UI/FeatureUI/feature_ui.gd" id="1_tms0v"]
|
||||
[ext_resource type="Texture2D" uid="uid://cps7onfe2s1gi" path="res://Scripts/Features/Radar/radar_icon.png" id="2_w6jf0"]
|
||||
|
||||
[node name="FeatureUI" type="VBoxContainer" node_paths=PackedStringArray("icon", "name_label")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
script = ExtResource("1_tms0v")
|
||||
icon = NodePath("TextureRect")
|
||||
name_label = NodePath("Label")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("2_w6jf0")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Radar"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
Reference in New Issue
Block a user