diff --git a/components/Feeds/Egg.tscn b/components/Feeds/Egg.tscn new file mode 100644 index 0000000..9c33dbb --- /dev/null +++ b/components/Feeds/Egg.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://bkm51am35af20"] + +[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_pda12"] +[ext_resource type="Texture2D" uid="uid://dhu2npe2hdg6m" path="res://resources/feeds/egg-a.svg" id="2_4crt5"] +[ext_resource type="Texture2D" uid="uid://b7vxserbhskol" path="res://resources/feeds/banana.svg" id="2_4g6dr"] + +[node name="Egg" instance=ExtResource("1_pda12")] +avatarTexture = ExtResource("2_4crt5") +displayName = "鸡蛋" +quality = 2 +topic = 3 +fields = Array[int]([3, 7]) +fieldValues = Array[float]([0.25, 10.0]) +costs = Array[int]([0, 1]) +costCounts = Array[int]([200, 100]) + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_4g6dr") + +[node name="name" parent="container/info" index="1"] +displayName = "香蕉" +topic = 3 diff --git a/components/UI/FieldShow.tscn b/components/UI/FieldShow.tscn index 8597028..13756a2 100644 --- a/components/UI/FieldShow.tscn +++ b/components/UI/FieldShow.tscn @@ -4,7 +4,7 @@ [ext_resource type="Texture2D" uid="uid://iu5i8ullbhf6" path="res://resources/items/apple.svg" id="2_q02yi"] [ext_resource type="Theme" uid="uid://b6nox1qqh50ub" path="res://themes/smallText.tres" id="2_x62bb"] -[sub_resource type="LabelSettings" id="LabelSettings_ossj7"] +[sub_resource type="LabelSettings" id="LabelSettings_3ylui"] font_size = 13 [node name="FieldShow" type="HBoxContainer"] @@ -43,5 +43,5 @@ layout_mode = 2 size_flags_horizontal = 10 size_flags_vertical = 8 text = "0" -label_settings = SubResource("LabelSettings_ossj7") +label_settings = SubResource("LabelSettings_3ylui") horizontal_alignment = 1 diff --git a/resources/feeds/egg-a.svg b/resources/feeds/egg-a.svg new file mode 100644 index 0000000..bf9afde --- /dev/null +++ b/resources/feeds/egg-a.svg @@ -0,0 +1,13 @@ + + + + Slice 1 + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources/feeds/egg-a.svg.import b/resources/feeds/egg-a.svg.import new file mode 100644 index 0000000..b1f1a7b --- /dev/null +++ b/resources/feeds/egg-a.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhu2npe2hdg6m" +path="res://.godot/imported/egg-a.svg-6e44285b0f367ba5e92677b3cad582fa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/feeds/egg-a.svg" +dest_files=["res://.godot/imported/egg-a.svg-6e44285b0f367ba5e92677b3cad582fa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/scripts/Statemachine/FieldShow.gd b/scripts/Statemachine/FieldShow.gd index f572e0a..9970d8e 100644 --- a/scripts/Statemachine/FieldShow.gd +++ b/scripts/Statemachine/FieldShow.gd @@ -8,6 +8,7 @@ class_name FieldShow @export var entity: EntityBase = null @export var useViewCast: bool = false @export var maxed: bool = false +@export var showAdvantage: bool = false @onready var nameLabel: Label = $"%name" @onready var valueLabel: Label = $"%value" @@ -33,6 +34,11 @@ func _ready(): if maxed: valueLabel.label_settings.font_color = Color(1, 0.3, 0.3) valueLabel.text = "MAX%s" % valueLabel.text + elif showAdvantage: + if field in FieldStore.entityNegativeFields: + valueLabel.label_settings.font_color = Color.RED if value > 0 else Color.GREEN + else: + valueLabel.label_settings.font_color = Color.GREEN if value > 0 else Color.RED else: valueLabel.label_settings.font_color = Color(1, 1, 1) diff --git a/scripts/Structs/Feed.gd b/scripts/Structs/Feed.gd index eccd24f..eacb04b 100644 --- a/scripts/Structs/Feed.gd +++ b/scripts/Structs/Feed.gd @@ -86,6 +86,7 @@ func rebuildInfo(): var fieldShow: FieldShow = ComponentManager.getUIComponent("FieldShow").instantiate() fieldShow.field = field fieldShow.value = value + fieldShow.showAdvantage = true if is_instance_valid(UIState.player): fieldShow.maxed = value + UIState.player.fields[field] > FieldStore.entityMaxValueMap.get(field, INF) fieldsBox.add_child(fieldShow) diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index c397d84..8363250 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -3,7 +3,7 @@ extends PanelContainer class_name Weapon @export var avatarTexture: Texture2D = null -@export var displayName: String = "未命名饲料" +@export var displayName: String = "未命名武器" @export var quality: WeaponName.Quality = WeaponName.Quality.COMMON @export var typeTopic: WeaponName.TypeTopic = WeaponName.TypeTopic.IMPACT @export var soulLevel: int = 1 diff --git a/scripts/Tools/FieldStore.gd b/scripts/Tools/FieldStore.gd index 9279a20..60be641 100644 --- a/scripts/Tools/FieldStore.gd +++ b/scripts/Tools/FieldStore.gd @@ -118,4 +118,7 @@ static var entityViewCastMap = { Entity.EXTRA_APPLE_MAX: func(entity, _value): return entity.inventoryMax[ItemStore.ItemType.APPLE] , -} \ No newline at end of file +} +static var entityNegativeFields: Array[Entity] = [ + Entity.OFFSET_SHOOT +] \ No newline at end of file