<commit_before>package rpgboss.editor.dialog.db

import com.badlogic.gdx._
import rpgboss.editor.uibase._
import rpgboss.model._
import rpgboss.lib._

object AnimationPlayerGdxPanel {
  def battleback = "defaultrc/battlebg/sys/crownlesswish_rrr.jpg"
  def battlerTarget = "defaultrc/battler/sys/lg/goblinrider.png"

  def width = 640
  def height = 320
}

class AnimationPlayerGdxPanel(project: Project, initial: Encounter)
  extends GdxPanel(AnimationPlayerGdxPanel.width,
                   AnimationPlayerGdxPanel.height) {
  override lazy val gdxListener = new ApplicationAdapter {
    def updateAnimation(animation: Animation) = {

    }

    override def create() = {

    }

    override def render() = {

    }
  }

  def updateAnimation(animation: Animation) = GdxUtils.asyncRun {
    // Make a defensive copy, as we are sending it to a different thread
    gdxListener.updateAnimation(Utils.deepCopy(animation))
  }
}
<commit_msg>Flesh out AnimationPlayerPanel a bit<commit_after>package rpgboss.editor.dialog.db

import com.badlogic.gdx._
import rpgboss.editor.uibase._
import rpgboss.model._
import rpgboss.lib._
import scala.swing._

object AnimationPlayerGdxPanel {
  def battleback = "defaultrc/battlebg/sys/crownlesswish_rrr.jpg"
  def battlerTarget = "defaultrc/battler/sys/lg/goblinrider.png"

  def width = 640
  def height = 320
}

case class AnimationPlayerStatus(
  playing: Boolean, currentTime: Float, totalTime: Float)

class AnimationPlayerGdxPanel(
  project: Project,
  onStatusUpdate: AnimationPlayerStatus => Unit)
  extends GdxPanel(AnimationPlayerGdxPanel.width,
    AnimationPlayerGdxPanel.height) {
  override lazy val gdxListener = new ApplicationAdapter {
    def updateAnimation(animation: Animation) = {

    }

    def play() = {

    }

    private def sendStatusUpdate() = {

    }

    override def create() = {

    }

    override def render() = {

    }
  }

  def updateAnimation(animation: Animation) = GdxUtils.asyncRun {
    // Make a defensive copy, as we are sending it to a different thread
    gdxListener.updateAnimation(Utils.deepCopy(animation))
  }

  def play() = GdxUtils.asyncRun { gdxListener.play() }
}

class AnimationPlayerPanel(project: Project, animation: Animation)
  extends BoxPanel(Orientation.Vertical){

  val gdxPanel = new AnimationPlayerGdxPanel(project, onStatusUpdate)
  val btnPlay = new Button(Action("Play") { gdxPanel.play() })

  val lblStatus = new Label

  def onStatusUpdate(status: AnimationPlayerStatus): Unit = {
    btnPlay.enabled = !status.playing
    btnPlay.text = if (status.playing) "Playing" else "Play"

    lblStatus.text = "%f / %f s".format(status.currentTime, status.totalTime)
  }

  contents += gdxPanel
  contents += new BoxPanel(Orientation.Horizontal) {
    contents += btnPlay
    contents += lblStatus
  }
}
{'fraction_non_alphanumeric': 0.09484902309058614, 'fraction_numerical': 0.004262877442273535, 'mean_word_length': 3.9316987740805605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3633982', 'n_tokens_mistral': 933, 'n_tokens_neox': 864, 'n_words': 203}