Added a builder for elements and made the buttons and damage bursts reflect the elemental color

This commit is contained in:
James Daly
2019-06-23 21:25:08 -04:00
parent 11b03b02d2
commit 4d456d7e5d
10 changed files with 1003 additions and 170 deletions

View File

@@ -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 {

View File

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