mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-27 06:53:08 -04:00
send palette change update
(cherry picked from commit f74af9cafe257dea80fadaa52d41d63654ae2a81)
This commit is contained in:
parent
21ce8b11cb
commit
50f5713bfd
@ -308,6 +308,9 @@ class TextBuffer(val host: EnvironmentHost) extends prefab.ManagedEnvironment wi
|
||||
colorDepthChanged
|
||||
}
|
||||
|
||||
override def onBufferPaletteChange(index: Int): Unit =
|
||||
proxy.onBufferPaletteChange(index)
|
||||
|
||||
override def onBufferColorChange(): Unit =
|
||||
proxy.onBufferColorChange()
|
||||
|
||||
|
@ -20,9 +20,12 @@ trait TextBufferProxy extends api.internal.TextBuffer {
|
||||
|
||||
override def getColorDepth: TextBuffer.ColorDepth = data.format.depth
|
||||
|
||||
def onBufferPaletteChange(index: Int): Unit = {}
|
||||
|
||||
override def setPaletteColor(index: Int, color: Int): Unit = data.format match {
|
||||
case palette: PackedColor.MutablePaletteFormat =>
|
||||
palette(index) = color
|
||||
onBufferPaletteChange(index)
|
||||
case _ => throw new Exception("palette not available")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user