mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
Refactor feed components and UI interactions
- Updated various feed components (Cake, Cupcake, Dango, Donut, FruitPlatter, FruitSalad, Milk, Orange, RedJam, Strawberry, Taco, WaterBottle, Xigua-Full, Xigua-Half, YellowJam) to correct names, textures, and display names. - Modified MakeFeed scene to improve feed selection and display logic, including the addition of skip functionality. - Enhanced UIState and EntityBase scripts to manage feed counts and selections more effectively. - Introduced DirTool for directory operations and improved file loading mechanisms. - Adjusted TickTool for frame-based operations.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
extends PanelContainer
|
||||
class_name Feed
|
||||
|
||||
signal selected(applied: bool)
|
||||
|
||||
@export var avatarTexture: Texture2D = preload("res://icon.svg")
|
||||
@export var displayName: String = "未命名饲料"
|
||||
@export var fields: Array[FieldStore.Entity] = []
|
||||
@@ -18,10 +20,7 @@ class_name Feed
|
||||
func _ready():
|
||||
selectButton.pressed.connect(
|
||||
func():
|
||||
if apply(UIState.player):
|
||||
UIState.setPanel()
|
||||
queue_free()
|
||||
Wave.next()
|
||||
apply(UIState.player)
|
||||
)
|
||||
avatarRect.texture = avatarTexture
|
||||
nameLabel.text = "[b]" + displayName + "[/b]"
|
||||
@@ -70,6 +69,8 @@ func apply(entity: EntityBase):
|
||||
var applier = FieldStore.entityApplier.get(field, null)
|
||||
if !applier or applier.call(entity, value):
|
||||
entity.fields[field] += value
|
||||
hide()
|
||||
selected.emit(allHave)
|
||||
return allHave
|
||||
func multipiler() -> float:
|
||||
if is_instance_valid(UIState.player):
|
||||
|
||||
Reference in New Issue
Block a user