Add new PNG assets for time and speed UI components

This commit is contained in:
Kirill
2026-08-20 20:09:14 +03:00
parent 8513bf0313
commit 777ec2907b
211 changed files with 41 additions and 41 deletions
+44
View File
@@ -0,0 +1,44 @@
extends Control
class_name OwniverseItem
signal item_activated(item)
const ENTITY_WIDTH = 216
const ENTITY_HEIGHT = 256
@onready var texture_button: TextureButton = $TextureButton
@onready var description: Label = $Description
@onready var selection: TextureRect = $Selection
var item_id: String = ""
var item_name: String = ""
var item_page: int = -1
var item_sub_page: int = -1
var item_type = ""
func set_label(value: float) -> void:
description.text = Global.format_number(value)
#description.text = str(value)
func set_selection(flag: bool) -> void:
selection.visible = flag
func init_button(properties: Dictionary):
var image_path = "res://" + properties.image + properties.name + ".png"
texture_button.texture_normal = load(image_path)
position = Vector2i(int(properties.col) * ENTITY_WIDTH, int(properties.row) * ENTITY_HEIGHT)
item_id = properties.id
item_name = properties.name
item_page = int(properties.page)
item_sub_page = int(properties.sub_page)
name = properties.id
func _on_button_up() -> void:
set_selection(true)
item_activated.emit(self)
+1
View File
@@ -0,0 +1 @@
uid://bxxllddlgurus
+38
View File
@@ -0,0 +1,38 @@
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_d5xam"]
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/selected.png" id="2_pbv1j"]
[node name="Button" type="Control" unique_id=667620208]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 216.0
offset_bottom = 260.0
mouse_filter = 1
script = ExtResource("1_d5xam")
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
visible = false
layout_mode = 0
offset_right = 216.0
offset_bottom = 216.0
mouse_filter = 2
texture = ExtResource("2_pbv1j")
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
custom_minimum_size = Vector2(216, 216)
layout_mode = 0
offset_right = 216.0
offset_bottom = 216.0
[node name="Description" type="Label" parent="." unique_id=1488477178]
custom_minimum_size = Vector2(216, 40)
layout_mode = 0
offset_top = 220.0
offset_right = 216.0
offset_bottom = 260.0
theme_override_font_sizes/font_size = 31
horizontal_alignment = 1
[connection signal="pressed" from="TextureButton" to="." method="_on_button_up"]
Binary file not shown.