simple rarity colors, probably ready to send to maxie as prototype
This commit is contained in:
parent
d5fec421a9
commit
573111f67a
6 changed files with 44 additions and 2 deletions
|
|
@ -4,3 +4,4 @@ class_name ItemData
|
||||||
@export var item_name : String
|
@export var item_name : String
|
||||||
@export var icon : Texture2D
|
@export var icon : Texture2D
|
||||||
@export var value : String
|
@export var value : String
|
||||||
|
@export var custom_panel_style : StyleBox
|
||||||
|
|
|
||||||
13
inv_system/item_panels/default.tres
Normal file
13
inv_system/item_panels/default.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[gd_resource type="StyleBoxFlat" format=3 uid="uid://hgjmkwj0dbqr"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
content_margin_left = 0.0
|
||||||
|
content_margin_top = 0.0
|
||||||
|
content_margin_right = 0.0
|
||||||
|
content_margin_bottom = 0.0
|
||||||
|
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||||
|
corner_radius_top_left = 3
|
||||||
|
corner_radius_top_right = 3
|
||||||
|
corner_radius_bottom_right = 3
|
||||||
|
corner_radius_bottom_left = 3
|
||||||
|
corner_detail = 5
|
||||||
19
inv_system/item_panels/epic.tres
Normal file
19
inv_system/item_panels/epic.tres
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_resource type="StyleBoxFlat" format=3 uid="uid://c563rid4b4fho"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
content_margin_left = 0.0
|
||||||
|
content_margin_top = 0.0
|
||||||
|
content_margin_right = 0.0
|
||||||
|
content_margin_bottom = 0.0
|
||||||
|
bg_color = Color(0.1, 0.1, 0.1, 0.6)
|
||||||
|
border_width_left = 3
|
||||||
|
border_width_top = 3
|
||||||
|
border_width_right = 3
|
||||||
|
border_width_bottom = 3
|
||||||
|
border_color = Color(0.5058824, 0, 0.8, 1)
|
||||||
|
border_blend = true
|
||||||
|
corner_radius_top_left = 3
|
||||||
|
corner_radius_top_right = 3
|
||||||
|
corner_radius_bottom_right = 3
|
||||||
|
corner_radius_bottom_left = 3
|
||||||
|
corner_detail = 5
|
||||||
|
|
@ -13,8 +13,13 @@ func update_ui():
|
||||||
if not item:
|
if not item:
|
||||||
icon.texture = null
|
icon.texture = null
|
||||||
label.text = ""
|
label.text = ""
|
||||||
|
remove_theme_stylebox_override("panel")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if item.custom_panel_style:
|
||||||
|
add_theme_stylebox_override("panel",item.custom_panel_style)
|
||||||
|
else:
|
||||||
|
remove_theme_stylebox_override("panel")
|
||||||
icon.texture = item.icon
|
icon.texture = item.icon
|
||||||
#tooltip_text = item.item_name
|
#tooltip_text = item.item_name
|
||||||
label.text = item.value
|
label.text = item.value
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://dgqs20xf7l8c"]
|
[gd_scene load_steps=5 format=3 uid="uid://dgqs20xf7l8c"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cpd04flfh5nlc" path="res://inv_system/item_slot.gd" id="1_m11ft"]
|
[ext_resource type="Script" uid="uid://cpd04flfh5nlc" path="res://inv_system/item_slot.gd" id="1_m11ft"]
|
||||||
|
[ext_resource type="StyleBox" uid="uid://hgjmkwj0dbqr" path="res://inv_system/item_panels/default.tres" id="1_mkcpq"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b7jp850fqpa0j" path="res://icon.svg" id="3_0tnt0"]
|
[ext_resource type="Texture2D" uid="uid://b7jp850fqpa0j" path="res://icon.svg" id="3_0tnt0"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_ab1u2"]
|
[sub_resource type="LabelSettings" id="LabelSettings_ab1u2"]
|
||||||
|
|
@ -9,6 +10,7 @@ outline_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
[node name="ItemSlot" type="Panel" node_paths=PackedStringArray("icon", "label")]
|
[node name="ItemSlot" type="Panel" node_paths=PackedStringArray("icon", "label")]
|
||||||
custom_minimum_size = Vector2(64, 64)
|
custom_minimum_size = Vector2(64, 64)
|
||||||
|
theme_override_styles/panel = ExtResource("1_mkcpq")
|
||||||
script = ExtResource("1_m11ft")
|
script = ExtResource("1_m11ft")
|
||||||
icon = NodePath("Icon")
|
icon = NodePath("Icon")
|
||||||
label = NodePath("Icon/Label")
|
label = NodePath("Icon/Label")
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
[gd_resource type="Resource" script_class="ItemData" load_steps=3 format=3 uid="uid://8vw85c1qrypm"]
|
[gd_resource type="Resource" script_class="ItemData" load_steps=4 format=3 uid="uid://8vw85c1qrypm"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://b2vn26davyrou" path="res://assets/item images/computer.png" id="1_e0dbh"]
|
[ext_resource type="Texture2D" uid="uid://b2vn26davyrou" path="res://assets/item images/computer.png" id="1_e0dbh"]
|
||||||
|
[ext_resource type="StyleBox" uid="uid://c563rid4b4fho" path="res://inv_system/item_panels/epic.tres" id="1_x7wm3"]
|
||||||
[ext_resource type="Script" uid="uid://dccraom7a7e8d" path="res://inv_system/item_data.gd" id="2_x7wm3"]
|
[ext_resource type="Script" uid="uid://dccraom7a7e8d" path="res://inv_system/item_data.gd" id="2_x7wm3"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("2_x7wm3")
|
script = ExtResource("2_x7wm3")
|
||||||
item_name = "Computer"
|
item_name = "Computer"
|
||||||
icon = ExtResource("1_e0dbh")
|
icon = ExtResource("1_e0dbh")
|
||||||
|
custom_panel_style = ExtResource("1_x7wm3")
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue