send palette change update

(cherry picked from commit f74af9cafe257dea80fadaa52d41d63654ae2a81)
This commit is contained in:
payonel 2020-06-06 21:05:37 -07:00 committed by DreamMasterXXL
parent 21ce8b11cb
commit 50f5713bfd
2 changed files with 6 additions and 0 deletions

View File

@ -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()

View File

@ -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")
}