simple rarity colors, probably ready to send to maxie as prototype

This commit is contained in:
Tabby 2026-01-12 01:04:17 +11:00
parent d5fec421a9
commit 573111f67a
6 changed files with 44 additions and 2 deletions

View file

@ -4,3 +4,4 @@ class_name ItemData
@export var item_name : String
@export var icon : Texture2D
@export var value : String
@export var custom_panel_style : StyleBox

View 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

View 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

View file

@ -13,8 +13,13 @@ func update_ui():
if not item:
icon.texture = null
label.text = ""
remove_theme_stylebox_override("panel")
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
#tooltip_text = item.item_name
label.text = item.value

View file

@ -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="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"]
[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")]
custom_minimum_size = Vector2(64, 64)
theme_override_styles/panel = ExtResource("1_mkcpq")
script = ExtResource("1_m11ft")
icon = NodePath("Icon")
label = NodePath("Icon/Label")