mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Working Animations
This commit is contained in:
parent
56cb69d856
commit
b7959b78fc
6 changed files with 126 additions and 69 deletions
|
|
@ -33,19 +33,28 @@ struct CustomIdleAnimation: Codable, Hashable, Equatable, Defaults.Serializable,
|
|||
var source: AnimationSource
|
||||
var speed: CGFloat = 1.0
|
||||
var isBuiltIn: Bool = false // Track if it's bundled vs user-added
|
||||
var transformConfig: AnimationTransformConfig = .default // Transform settings
|
||||
|
||||
init(id: UUID = UUID(), name: String, source: AnimationSource, speed: CGFloat = 1.0, isBuiltIn: Bool = false, transformConfig: AnimationTransformConfig = .default) {
|
||||
init(id: UUID = UUID(), name: String, source: AnimationSource, speed: CGFloat = 1.0, isBuiltIn: Bool = false) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.source = source
|
||||
self.speed = speed
|
||||
self.isBuiltIn = isBuiltIn
|
||||
self.transformConfig = transformConfig
|
||||
}
|
||||
|
||||
/// Get the effective transform config (override or default)
|
||||
func getTransformConfig() -> AnimationTransformConfig {
|
||||
let override = Defaults[.animationTransformOverrides][id.uuidString]
|
||||
if let override = override {
|
||||
print("📋 [CustomIdleAnimation] Found override for '\(name)': \(override)")
|
||||
} else {
|
||||
print("📋 [CustomIdleAnimation] No override for '\(name)', using default")
|
||||
}
|
||||
return override ?? .default
|
||||
}
|
||||
}
|
||||
|
||||
struct AnimationTransformConfig: Codable, Hashable, Equatable {
|
||||
struct AnimationTransformConfig: Codable, Hashable, Equatable, Defaults.Serializable {
|
||||
var scale: CGFloat = 1.0
|
||||
var offsetX: CGFloat = 0
|
||||
var offsetY: CGFloat = 0
|
||||
|
|
@ -299,6 +308,7 @@ extension Defaults.Keys {
|
|||
static let showNotHumanFace = Key<Bool>("showNotHumanFace", default: false)
|
||||
static let customIdleAnimations = Key<[CustomIdleAnimation]>("customIdleAnimations", default: [])
|
||||
static let selectedIdleAnimation = Key<CustomIdleAnimation?>("selectedIdleAnimation", default: nil)
|
||||
static let animationTransformOverrides = Key<[String: AnimationTransformConfig]>("animationTransformOverrides", default: [:])
|
||||
static let tileShowLabels = Key<Bool>("tileShowLabels", default: false)
|
||||
static let showCalendar = Key<Bool>("showCalendar", default: false)
|
||||
static let hideCompletedReminders = Key<Bool>("hideCompletedReminders", default: true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue