mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 00:11:54 +08:00
feat(音效): 添加物品收集音效并改进数值显示
为物品收集添加音效播放功能
在EntityBase.gd中调用playSound("collect")
添加Collect.wav音效文件及导入配置
改进数值显示格式:
- 在MathTool.gd中添加signBeforeStr方法
- 修改FieldShow.gd使用新方法显示带符号的数值
- 调整FieldShow.tscn的UI布局
同时修复MakeFeed.gd中feed显示问题
This commit is contained in:
@@ -71,6 +71,7 @@ func _ready():
|
||||
func(body):
|
||||
if body is ItemDropped:
|
||||
inventory[body.item] += body.stackCount
|
||||
playSound("collect")
|
||||
body.queue_free()
|
||||
)
|
||||
energyChanged.connect(
|
||||
|
||||
@@ -13,9 +13,9 @@ func _ready():
|
||||
var formattedValue: String
|
||||
var dataType = FieldStore.entityMapType[field]
|
||||
if dataType == FieldStore.DataType.VALUE:
|
||||
formattedValue = str(value)
|
||||
formattedValue = MathTool.signBeforeStr(value)
|
||||
elif dataType == FieldStore.DataType.ANGLE:
|
||||
formattedValue = str(value) + "°"
|
||||
formattedValue = MathTool.signBeforeStr(value) + "°"
|
||||
elif dataType == FieldStore.DataType.PERCENT:
|
||||
formattedValue = "%.1f" % (value * 100) + "%"
|
||||
formattedValue = MathTool.signBeforeStr(float("%.1f" % (value * 100))) + "%"
|
||||
valueLabel.text = formattedValue
|
||||
|
||||
Reference in New Issue
Block a user