mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 02:59:19 +01:00
149 lines
5.4 KiB
Scala
149 lines
5.4 KiB
Scala
package ocelot.desktop.graphics
|
|
|
|
import ocelot.desktop.ui.widget.modal.notification.NotificationType.NotificationType
|
|
import totoro.ocelot.brain.util.DyeColor
|
|
import totoro.ocelot.brain.util.ExtendedTier.ExtendedTier
|
|
import totoro.ocelot.brain.util.Tier.Tier
|
|
|
|
case class IconSource(
|
|
path: String,
|
|
animation: Option[IconSource.Animation] = None
|
|
)
|
|
|
|
object IconSource {
|
|
type Animation = Array[(Int, Float)]
|
|
|
|
val CardIcon: IconSource = IconSource("icons/Card")
|
|
val CpuIcon: IconSource = IconSource("icons/CPU")
|
|
val HddIcon: IconSource = IconSource("icons/HDD")
|
|
val EepromIcon: IconSource = IconSource("icons/EEPROM")
|
|
val FloppyIcon: IconSource = IconSource("icons/Floppy")
|
|
val MemoryIcon: IconSource = IconSource("icons/Memory")
|
|
val ServerIcon: IconSource = IconSource("icons/Server")
|
|
val ComponentBusIcon: IconSource = IconSource("icons/ComponentBus")
|
|
|
|
val TierIcon: Tier => IconSource = { tier =>
|
|
IconSource(s"icons/Tier${tier.id}")
|
|
}
|
|
|
|
val Cpu: Tier => IconSource = { tier =>
|
|
IconSource(s"items/CPU${tier.id}")
|
|
}
|
|
|
|
val Apu: Tier => IconSource = { tier =>
|
|
IconSource(s"items/APU${tier.id}", animation = Some(Animations.Apu))
|
|
}
|
|
|
|
val GraphicsCard: Tier => IconSource = { tier =>
|
|
IconSource(s"items/GraphicsCard${tier.id}")
|
|
}
|
|
|
|
val NetworkCard: IconSource = IconSource("items/NetworkCard")
|
|
|
|
val WirelessNetworkCard: Tier => IconSource = { tier =>
|
|
IconSource(s"items/WirelessNetworkCard${tier.id}")
|
|
}
|
|
|
|
val LinkedCard: IconSource = IconSource("items/LinkedCard", animation = Some(Animations.LinkedCard))
|
|
|
|
val InternetCard: IconSource = IconSource("items/InternetCard", animation = Some(Animations.InternetCard))
|
|
|
|
val RedstoneCard: Tier => IconSource = { tier =>
|
|
IconSource(s"items/RedstoneCard${tier.id}")
|
|
}
|
|
|
|
val DataCard: Tier => IconSource = { tier =>
|
|
IconSource(s"items/DataCard${tier.id}", animation = Some(Animations.DataCard))
|
|
}
|
|
|
|
val SoundCard: IconSource = IconSource("items/SoundCard", animation = Some(Animations.DataCard))
|
|
|
|
val SelfDestructingCard: IconSource = IconSource("items/SelfDestructingCard", animation = Some(Animations.SelfDestructingCard))
|
|
|
|
val OcelotCard: IconSource = IconSource("items/OcelotCard", animation = Some(Animations.OcelotCard))
|
|
|
|
val HardDiskDrive: Tier => IconSource = { tier =>
|
|
IconSource(s"items/HardDiskDrive${tier.id}")
|
|
}
|
|
|
|
val Eeprom: IconSource = IconSource("items/EEPROM")
|
|
|
|
val FloppyDisk: DyeColor => IconSource = { color =>
|
|
IconSource(s"items/FloppyDisk_${color.name}")
|
|
}
|
|
|
|
val Memory: ExtendedTier => IconSource = { tier =>
|
|
IconSource(s"items/Memory${tier.id}")
|
|
}
|
|
|
|
val Server: Tier => IconSource = { tier =>
|
|
IconSource(s"items/Server${tier.id}")
|
|
}
|
|
|
|
val ComponentBus: Tier => IconSource = { tier =>
|
|
IconSource(s"items/ComponentBus${tier.id}")
|
|
}
|
|
|
|
val DiskDriveMountable: IconSource = IconSource("items/DiskDriveMountable")
|
|
|
|
//noinspection ScalaWeakerAccess
|
|
object Animations {
|
|
val Apu: Animation = Array(
|
|
(0, 3f), (1, 3f), (2, 3f), (3, 3f), (4, 3f), (5, 3f),
|
|
(4, 3f), (3, 3f), (2, 3f), (1, 3f), (0, 3f))
|
|
|
|
val LinkedCard: Animation =
|
|
Array((0, 3f), (1, 3f), (2, 3f), (3, 3f), (4, 3f), (5, 3f))
|
|
|
|
val InternetCard: Animation = Array(
|
|
(0, 2f), (1, 7f), (0, 5f), (1, 4f), (0, 7f), (1, 2f), (0, 8f),
|
|
(1, 9f), (0, 6f), (1, 4f))
|
|
|
|
val DataCard: Animation = Array(
|
|
(0, 4f), (1, 4f), (2, 4f), (3, 4f), (4, 4f), (5, 4f), (6, 4f), (7, 4f))
|
|
|
|
val SelfDestructingCard: Animation = Array((0, 4f), (1, 4f))
|
|
|
|
val OcelotCard: Animation = Array(
|
|
(0, 12f), (1, 4f), (2, 4f), (3, 4f), (4, 5f), (5, 6f), (0, 9f), (6, 4f), (7, 3f))
|
|
}
|
|
|
|
// ----------------------- Ocelot interface icons -----------------------
|
|
|
|
|
|
val Notification: NotificationType => IconSource = { notificationType =>
|
|
IconSource(s"icons/Notification$notificationType")
|
|
}
|
|
|
|
val SettingsSystem: IconSource = IconSource("icons/SettingsSystem")
|
|
val SettingsSound: IconSource = IconSource("icons/SettingsSound")
|
|
val SettingsUI: IconSource = IconSource("icons/SettingsUI")
|
|
val Delete: IconSource = IconSource("icons/Delete")
|
|
val Label: IconSource = IconSource("icons/Label")
|
|
val Copy: IconSource = IconSource("icons/Copy")
|
|
val AspectRatio: IconSource = IconSource("icons/AspectRatio")
|
|
val Eject: IconSource = IconSource("icons/Eject")
|
|
val Restart: IconSource = IconSource("icons/Restart")
|
|
val Edit: IconSource = IconSource("icons/Edit")
|
|
val Folder: IconSource = IconSource("icons/Folder")
|
|
val FolderSlash: IconSource = IconSource("icons/FolderSlash")
|
|
val Code: IconSource = IconSource("icons/Code")
|
|
val File: IconSource = IconSource("icons/File")
|
|
val Link: IconSource = IconSource("icons/Link")
|
|
val LinkSlash: IconSource = IconSource("icons/LinkSlash")
|
|
val Power: IconSource = IconSource("icons/Power")
|
|
val Save: IconSource = IconSource("icons/Save")
|
|
val SaveAs: IconSource = IconSource("icons/SaveAs")
|
|
val Plus: IconSource = IconSource("icons/Plus")
|
|
val Cross: IconSource = IconSource("icons/Cross")
|
|
val Microchip: IconSource = IconSource("icons/Microchip")
|
|
val Antenna: IconSource = IconSource("icons/Antenna")
|
|
val Window: IconSource = IconSource("icons/Window")
|
|
val Tiers: IconSource = IconSource("icons/Tiers")
|
|
val LinesHorizontal: IconSource = IconSource("icons/LinesHorizontal")
|
|
val ArrowRight: IconSource = IconSource("icons/ArrowRight")
|
|
val Book: IconSource = IconSource("icons/Book")
|
|
val Help: IconSource = IconSource("icons/Help")
|
|
val Ocelot: IconSource = IconSource("icons/Ocelot")
|
|
}
|