Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized existing functions.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dg15dpxiepicb"]
|
||||
[gd_scene format=3 uid="uid://dg15dpxiepicb"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://chxxghyul1im7" path="res://UI/Border/border-2px.png" id="1_6kaf8"]
|
||||
[ext_resource type="Texture2D" uid="uid://chxxghyul1im7" path="res://ui/border/border-2px.png" id="1_6kaf8"]
|
||||
|
||||
[node name="Border" type="TextureRect"]
|
||||
texture = ExtResource("1_6kaf8")
|
||||
|
||||
@@ -11,10 +11,12 @@ const ENTITY_HEIGHT = 256
|
||||
@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_selection(flag: bool) -> void:
|
||||
@@ -30,7 +32,6 @@ func init_button(properties: Dictionary):
|
||||
item_page = int(properties.page)
|
||||
item_sub_page = int(properties.sub_page)
|
||||
name = properties.id
|
||||
set_selection(false)
|
||||
|
||||
|
||||
func _on_button_up() -> void:
|
||||
@@ -1,15 +1,25 @@
|
||||
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://UI/ItemButton/item_button.gd" id="1_e6ro1"]
|
||||
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://UI/ItemButton/Selected.png" id="2_eurq3"]
|
||||
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_e6ro1"]
|
||||
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/Selected.png" id="2_eurq3"]
|
||||
|
||||
[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_e6ro1")
|
||||
|
||||
[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_eurq3")
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
|
||||
custom_minimum_size = Vector2(216, 216)
|
||||
layout_mode = 0
|
||||
@@ -22,11 +32,7 @@ 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
|
||||
|
||||
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = ExtResource("2_eurq3")
|
||||
|
||||
[connection signal="button_up" from="TextureButton" to="." method="_on_button_up"]
|
||||
[connection signal="pressed" from="TextureButton" to="." method="_on_button_up"]
|
||||
Reference in New Issue
Block a user