Files
bl/common/data/color.go
xinian d0cf598ced
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 将物品和货币相关字段从uint32改为int64以支持更大数值范围
2026-02-12 04:28:20 +08:00

59 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package data
// 1. 质量枚举常量(保持不变)
const (
BitmapFilterQualityLow = 1 // LOW应用1次滤镜
BitmapFilterQualityMedium = 2 // MEDIUM应用2次滤镜
BitmapFilterQualityHigh = 3 // HIGH应用3次滤镜最大值
)
// 2. 调整取值范围常量为 uint8 类型(贴合 0-255 范围)
const (
alphaMin = 0.0
alphaMax = 1.0
blurMin uint8 = 0 // BlurX/BlurY 最小值
blurMax uint8 = 255 // BlurX/BlurY 最大值uint8上限
strengthMin uint8 = 0 // Strength 最小值
strengthMax uint8 = 255 // Strength 最大值uint8上限
qualityMin = BitmapFilterQualityLow
qualityMax = BitmapFilterQualityHigh
colorMax = 0xFFFFFF // 颜色值最大值0xRRGGBB
)
// 精灵加shinylen字段
// 3. 核心结构体BlurX/BlurY/Strength 改为 uint8
type GlowFilter struct {
// Color 光晕颜色,十六进制格式 0xRRGGBB默认值 0xFF0000红色
Color uint32 `json:"color,omitempty"`
// Alpha 透明度0.0~1.0浮点型无法用uint8保留float64
Alpha float32 `json:"alpha,omitempty"`
// BlurX 水平模糊量0~255uint8默认值 6
BlurX uint8 `json:"blurX,omitempty"`
// BlurY 垂直模糊量0~255uint8默认值 6
BlurY uint8 `json:"blurY,omitempty"`
// Strength 发光强度0~255uint8默认值 2
Strength uint8 `json:"strength,omitempty"`
// Quality 滤镜应用次数1~3默认值 1
Quality int `json:"quality,omitempty"`
// Inner 是否内侧发光,默认 false
Inner bool `json:"inner,omitempty"`
// Knockout 是否挖空,默认 false
Knockout bool `json:"knockout,omitempty"`
ColorMatrixFilter [20]float32 `json:"matrix,omitempty"`
Level uint8 `json:"level,omitempty"` //等级
}
// ItemInfo
// 用于表示发放物品的信息
type ItemInfo struct {
ItemId int64 `struc:"uint32"`
ItemCnt int64 `struc:"uint32"`
}