Added a builder for elements and made the buttons and damage bursts reflect the elemental color
This commit is contained in:
@@ -97,7 +97,7 @@ class BattleUI extends SignalConsumer {
|
||||
numPlaying += 1
|
||||
def helper = {
|
||||
val r = 25
|
||||
val color = Color.AliceBlue
|
||||
val color = element.bgColor
|
||||
val center = findCenter(target)
|
||||
|
||||
val circle = new Circle {
|
||||
|
||||
@@ -5,6 +5,7 @@ import javafx.scene.{control => jfxsc}
|
||||
|
||||
import scalafx.Includes._
|
||||
import scalafx.scene.control._
|
||||
import scalafx.scene.paint.Color
|
||||
|
||||
import fmon.stat.Move
|
||||
|
||||
@@ -19,10 +20,16 @@ class MoveButton {
|
||||
move = mv
|
||||
moveName.text = mv.name
|
||||
moveUses.text = s"${move.pp}/${move.pp}"
|
||||
moveBtn.style = s"-fx-background-color: ${colorString(mv.element.bgColor)}; -fx-text-fill: ${colorString(mv.element.fontColor)}"
|
||||
this.callback = callback
|
||||
}
|
||||
|
||||
def moveActivate(): Unit = {
|
||||
callback(move)
|
||||
}
|
||||
|
||||
def colorString(color: Color): String = {
|
||||
val s = color.toString()
|
||||
s"#${s.split("x")(1)}"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user