mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-25 14:05:39 -04:00
Changed APU component support a bit, to fix tooltip
(Still a hack, but it's local and quite straightforward)
This commit is contained in:
parent
41a717fb2c
commit
8727571e95
@ -15,6 +15,7 @@ class APU(val parent: Delegator, val tier: Int) extends traits.Delegate with tra
|
||||
else super.rarity(stack)
|
||||
|
||||
override def cpuTier = math.min(Tier.Three, tier + 1)
|
||||
override def cpuTierForComponents = tier + 1
|
||||
|
||||
override def gpuTier = tier
|
||||
|
||||
|
@ -6,6 +6,7 @@ class CPU(val parent: Delegator, val tier: Int) extends traits.Delegate with tra
|
||||
override val unlocalizedName = super.unlocalizedName + tier
|
||||
|
||||
override def cpuTier = tier
|
||||
override def cpuTierForComponents = tier
|
||||
|
||||
override protected def tooltipName = Option(super.unlocalizedName)
|
||||
}
|
||||
|
@ -17,8 +17,9 @@ import scala.language.existentials
|
||||
|
||||
trait CPULike extends Delegate {
|
||||
def cpuTier: Int
|
||||
def cpuTierForComponents: Int // Creative APU provides components like T4 CPU, but there is no T4 CPU
|
||||
|
||||
override protected def tooltipData: Seq[Any] = Seq(Settings.get.cpuComponentSupport(cpuTier))
|
||||
override protected def tooltipData: Seq[Any] = Seq(Settings.get.cpuComponentSupport(cpuTierForComponents))
|
||||
|
||||
override protected def tooltipExtended(stack: ItemStack, tooltip: util.List[String]) {
|
||||
tooltip.addAll(Tooltip.get("CPU.Architecture", api.Machine.getArchitectureName(DriverCPU.architecture(stack))))
|
||||
|
@ -25,8 +25,7 @@ object DriverAPU extends DriverCPU with HostAware {
|
||||
}
|
||||
|
||||
override def supportedComponents(stack: ItemStack) = Delegator.subItem(stack) match {
|
||||
// have to use GPU tier here because CPU tier is limited by 3, creative tier is special
|
||||
case Some(apu: common.item.APU) => Settings.get.cpuComponentSupport(apu.gpuTier + 1)
|
||||
case Some(apu: common.item.APU) => Settings.get.cpuComponentSupport(apu.cpuTierForComponents)
|
||||
case _ => Settings.get.cpuComponentSupport(1)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user