Replace toRGB/toARGB with toBGR/toBGRA
This commit is contained in:
parent
4e54cc7d67
commit
dc47b3a13e
@ -372,5 +372,5 @@ fun IMatteryEnergyStorage.getBarColor(): Int {
|
|||||||
if (!maxBatteryLevel.isPositive)
|
if (!maxBatteryLevel.isPositive)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return RGBAColor.LOW_POWER.linearInterpolation((batteryLevel / maxBatteryLevel).toFloat(), RGBAColor.FULL_POWER).toRGB()
|
return RGBAColor.LOW_POWER.linearInterpolation((batteryLevel / maxBatteryLevel).toFloat(), RGBAColor.FULL_POWER).toBGR()
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ fun IMatterStorage.getBarWidth(): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun IMatterStorage.getBarColor(): Int {
|
fun IMatterStorage.getBarColor(): Int {
|
||||||
return RGBAColor.LOW_MATTER.linearInterpolation((storedMatter / maxStoredMatter).toFloat(), RGBAColor.FULL_MATTER).toRGB()
|
return RGBAColor.LOW_MATTER.linearInterpolation((storedMatter / maxStoredMatter).toFloat(), RGBAColor.FULL_MATTER).toBGR()
|
||||||
}
|
}
|
||||||
|
|
||||||
val ICapabilityProvider.matter: IMatterStorage? get() = getCapability(MatteryCapability.MATTER).orNull()
|
val ICapabilityProvider.matter: IMatterStorage? get() = getCapability(MatteryCapability.MATTER).orNull()
|
||||||
|
@ -73,7 +73,7 @@ fun IPatternStorage.getBarWidth(): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun IPatternStorage.getBarColor(): Int {
|
fun IPatternStorage.getBarColor(): Int {
|
||||||
return RGBAColor.LOW_PATTERNS.linearInterpolation((storedPatterns / patternCapacity).toFloat(), RGBAColor.FULL_PATTERNS).toRGB()
|
return RGBAColor.LOW_PATTERNS.linearInterpolation((storedPatterns / patternCapacity).toFloat(), RGBAColor.FULL_PATTERNS).toBGR()
|
||||||
}
|
}
|
||||||
|
|
||||||
val ICapabilityProvider.patterns: IPatternStorage? get() = getCapability(MatteryCapability.PATTERN).orNull()
|
val ICapabilityProvider.patterns: IPatternStorage? get() = getCapability(MatteryCapability.PATTERN).orNull()
|
||||||
|
@ -168,7 +168,7 @@ private fun Font.drawInternal(
|
|||||||
text,
|
text,
|
||||||
(x + shadowX) * inv,
|
(x + shadowX) * inv,
|
||||||
(y + shadowY) * inv,
|
(y + shadowY) * inv,
|
||||||
shadowColor.toRGB(),
|
shadowColor.toBGR(),
|
||||||
false,
|
false,
|
||||||
poseStack.last().pose(),
|
poseStack.last().pose(),
|
||||||
buffer,
|
buffer,
|
||||||
@ -192,7 +192,7 @@ private fun Font.drawInternal(
|
|||||||
text,
|
text,
|
||||||
x * inv + _x,
|
x * inv + _x,
|
||||||
y * inv + _y,
|
y * inv + _y,
|
||||||
outlineColor.toRGB(),
|
outlineColor.toBGR(),
|
||||||
drawShadow,
|
drawShadow,
|
||||||
poseStack.last().pose(),
|
poseStack.last().pose(),
|
||||||
buffer,
|
buffer,
|
||||||
@ -211,7 +211,7 @@ private fun Font.drawInternal(
|
|||||||
text,
|
text,
|
||||||
x * inv,
|
x * inv,
|
||||||
y * inv,
|
y * inv,
|
||||||
color.toRGB(),
|
color.toBGR(),
|
||||||
drawShadow,
|
drawShadow,
|
||||||
poseStack.last().pose(),
|
poseStack.last().pose(),
|
||||||
buffer,
|
buffer,
|
||||||
|
@ -55,7 +55,7 @@ object MatterBottlerProvider : IBlockComponentProvider, IServerDataProvider<Bloc
|
|||||||
elementHelper.progress(
|
elementHelper.progress(
|
||||||
data.getFloat("workProgress"),
|
data.getFloat("workProgress"),
|
||||||
null,
|
null,
|
||||||
elementHelper.progressStyle().color(RGBAColor.WHITE.toARGB()),
|
elementHelper.progressStyle().color(RGBAColor.WHITE.toBGRA()),
|
||||||
BoxStyle.getNestedBox(),
|
BoxStyle.getNestedBox(),
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
@ -56,7 +56,7 @@ object MatterReconstructorProvider : IBlockComponentProvider, IServerDataProvide
|
|||||||
damage,
|
damage,
|
||||||
maxDamage
|
maxDamage
|
||||||
),
|
),
|
||||||
elementHelper.progressStyle().color(RGBAColor.DARK_GREEN.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
|
elementHelper.progressStyle().color(RGBAColor.DARK_GREEN.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
|
||||||
BoxStyle.getNestedBox(),
|
BoxStyle.getNestedBox(),
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
@ -68,7 +68,7 @@ object MatterStorageProvider : IBlockComponentProvider, IServerDataProvider<Bloc
|
|||||||
storedMatter.formatMatter(),
|
storedMatter.formatMatter(),
|
||||||
maxStoredMatter.formatMatter()
|
maxStoredMatter.formatMatter()
|
||||||
),
|
),
|
||||||
elementHelper.progressStyle().color(JadeColors.MATTER_COLOR.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
|
elementHelper.progressStyle().color(JadeColors.MATTER_COLOR.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
|
||||||
BoxStyle.getNestedBox(),
|
BoxStyle.getNestedBox(),
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
@ -66,7 +66,7 @@ object MatteryEnergyProvider : IBlockComponentProvider, IServerDataProvider<Bloc
|
|||||||
batteryLevel.formatPower(),
|
batteryLevel.formatPower(),
|
||||||
maxBatteryLevel.formatPower()
|
maxBatteryLevel.formatPower()
|
||||||
),
|
),
|
||||||
elementHelper.progressStyle().color(JadeColors.ENERGY_COLOR.toARGB(), JadeColors.ENERGY_COLOR2.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
|
elementHelper.progressStyle().color(JadeColors.ENERGY_COLOR.toBGRA(), JadeColors.ENERGY_COLOR2.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
|
||||||
BoxStyle.getNestedBox(),
|
BoxStyle.getNestedBox(),
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
@ -55,8 +55,8 @@ object MatteryWorkerProvider : IBlockComponentProvider, IServerDataProvider<Bloc
|
|||||||
val workerData = data.getCompound(JadeTagKeys.MATTERY_WORKER_DATA)
|
val workerData = data.getCompound(JadeTagKeys.MATTERY_WORKER_DATA)
|
||||||
|
|
||||||
val elementHelper = IElementHelper.get()
|
val elementHelper = IElementHelper.get()
|
||||||
val style = elementHelper.progressStyle().color(RGBAColor.WHITE.toARGB())
|
val style = elementHelper.progressStyle().color(RGBAColor.WHITE.toBGRA())
|
||||||
val styleError = elementHelper.progressStyle().color(RGBAColor.REDDISH.toARGB())
|
val styleError = elementHelper.progressStyle().color(RGBAColor.REDDISH.toBGRA())
|
||||||
|
|
||||||
for (job in workerData.getCompoundList("jobs")) {
|
for (job in workerData.getCompoundList("jobs")) {
|
||||||
val progress = job.getFloat("workProgress")
|
val progress = job.getFloat("workProgress")
|
||||||
|
@ -82,7 +82,7 @@ class TritaniumArmorItem(slot: Type) : DyeableArmorItem(TritaniumArmorMaterial,
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val TRITANIUM_COLOR = RGBAColor(157, 187, 204).toARGB()
|
val TRITANIUM_COLOR = RGBAColor(157, 187, 204).toBGRA()
|
||||||
const val TEXTURE_LOCATION_BASE = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_base.png"
|
const val TEXTURE_LOCATION_BASE = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_base.png"
|
||||||
const val TEXTURE_LOCATION_OVERLAY = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_overlay.png"
|
const val TEXTURE_LOCATION_OVERLAY = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_overlay.png"
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ object MBlockColors {
|
|||||||
return DEFAULT_HOLO_SIGN_TINT
|
return DEFAULT_HOLO_SIGN_TINT
|
||||||
|
|
||||||
val blockEntity = light.getBlockEntity(pos) as? HoloSignBlockEntity ?: return DEFAULT_HOLO_SIGN_TINT
|
val blockEntity = light.getBlockEntity(pos) as? HoloSignBlockEntity ?: return DEFAULT_HOLO_SIGN_TINT
|
||||||
return RGBAColor(blockEntity.textRed, blockEntity.textGreen, blockEntity.textBlue, blockEntity.textAlpha).toRGB()
|
return RGBAColor(blockEntity.textRed, blockEntity.textGreen, blockEntity.textBlue, blockEntity.textAlpha).toBGR()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getColor(itemStack: ItemStack, index: Int): Int {
|
override fun getColor(itemStack: ItemStack, index: Int): Int {
|
||||||
|
@ -415,7 +415,7 @@ object MRegistry : IBlockItemRegistryAcceptor {
|
|||||||
event.register({ stack, layer -> if (layer == 0) (stack.item as DyeableArmorItem).getColor(stack) else -1 },
|
event.register({ stack, layer -> if (layer == 0) (stack.item as DyeableArmorItem).getColor(stack) else -1 },
|
||||||
*MItems.TRITANIUM_ARMOR.toTypedArray()
|
*MItems.TRITANIUM_ARMOR.toTypedArray()
|
||||||
)
|
)
|
||||||
event.register({ _, layer -> if (layer == 1) RGBAColor.AQUA.toARGB() else -1 },
|
event.register({ _, layer -> if (layer == 1) RGBAColor.AQUA.toBGRA() else -1 },
|
||||||
*MItems.MachineUpgrades.Creative.LIST.toTypedArray())
|
*MItems.MachineUpgrades.Creative.LIST.toTypedArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user