From f387e206d578d3d39f4789d65dda301d23914031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Sat, 6 Sep 2025 19:29:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0FieldShow=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84maxed=E5=B1=9E=E6=80=A7=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=9C=80=E5=A4=A7=E5=80=BC=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/UI/FieldShow.tscn | 7 +++++-- scripts/Contents/Panels/MakeFeed.gd | 1 + scripts/Statemachine/EntityBase.gd | 2 +- scripts/Statemachine/FieldShow.gd | 7 +++++++ scripts/Structs/Feed.gd | 2 ++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/components/UI/FieldShow.tscn b/components/UI/FieldShow.tscn index 082195d..8597028 100644 --- a/components/UI/FieldShow.tscn +++ b/components/UI/FieldShow.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=4 format=3 uid="uid://cw5ip3rw4r3pp"] +[gd_scene load_steps=5 format=3 uid="uid://cw5ip3rw4r3pp"] [ext_resource type="Script" path="res://scripts/Statemachine/FieldShow.gd" id="1_gwocj"] [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"] +font_size = 13 + [node name="FieldShow" type="HBoxContainer"] offset_right = 144.0 offset_bottom = 18.0 @@ -39,6 +42,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 10 size_flags_vertical = 8 -theme = ExtResource("2_x62bb") text = "0" +label_settings = SubResource("LabelSettings_ossj7") horizontal_alignment = 1 diff --git a/scripts/Contents/Panels/MakeFeed.gd b/scripts/Contents/Panels/MakeFeed.gd index 0007379..7da1cd8 100644 --- a/scripts/Contents/Panels/MakeFeed.gd +++ b/scripts/Contents/Panels/MakeFeed.gd @@ -60,6 +60,7 @@ func regenerateCards(): var feeds = generateCardByQuality() for feed in feeds: feed.show() + feed.rebuildInfo() avaliableFeeds.remove_child(feed) feedCards.add_child(feed) func generateCardByQuality(): diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index cf25962..baaf707 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -32,7 +32,7 @@ var fields = { FieldStore.Entity.MOVEMENT_SPEED: 1, "伤害": TITLE_FLAG, FieldStore.Entity.DAMAGE_MULTIPILER: 1, - FieldStore.Entity.CRIT_RATE: 0.05, + FieldStore.Entity.CRIT_RATE: 0.8, FieldStore.Entity.CRIT_DAMAGE: 1, "概率": TITLE_FLAG, FieldStore.Entity.LUCK_VALUE: 1, diff --git a/scripts/Statemachine/FieldShow.gd b/scripts/Statemachine/FieldShow.gd index 2695753..28ef114 100644 --- a/scripts/Statemachine/FieldShow.gd +++ b/scripts/Statemachine/FieldShow.gd @@ -7,6 +7,7 @@ class_name FieldShow @export var showSign: bool = true @export var entity: EntityBase = null @export var useViewCast: bool = false +@export var maxed: bool = false @onready var nameLabel: Label = $"%name" @onready var valueLabel: Label = $"%value" @@ -27,7 +28,13 @@ func _ready(): formattedValue = "%s°" % (MathTool.signBeforeStr(value) if showSign else str(value)) elif dataType == FieldStore.DataType.PERCENT: formattedValue = (MathTool.signBeforeStr(value * 100) if showSign else str(value * 100)) + "%" + valueLabel.label_settings = valueLabel.label_settings.duplicate() valueLabel.text = formattedValue + if maxed: + valueLabel.label_settings.font_color = Color(1, 0.3, 0.3) + valueLabel.text = "MAX%s" % valueLabel.text + else: + valueLabel.label_settings.font_color = Color(1, 1, 1) static func create(newField: FieldStore.Entity, newValue: float, newShowSign: bool, newEntity: EntityBase, newUseViewCast: bool) -> FieldShow: var fieldShow = preload("res://components/UI/FieldShow.tscn").instantiate() diff --git a/scripts/Structs/Feed.gd b/scripts/Structs/Feed.gd index 98313e5..46b9c46 100644 --- a/scripts/Structs/Feed.gd +++ b/scripts/Structs/Feed.gd @@ -72,6 +72,8 @@ func rebuildInfo(): var fieldShow: FieldShow = preload("res://components/UI/FieldShow.tscn").instantiate() fieldShow.field = field fieldShow.value = value + if is_instance_valid(UIState.player): + fieldShow.maxed = value + UIState.player.fields[field] > FieldStore.entityMaxValueMap.get(field, INF) fieldsBox.add_child(fieldShow) if noField: fieldsBox.add_child(QuickUI.smallText("无词条"))