diff --git a/editor/src/main/com/mbrlabs/mundus/editor/ui/UI.kt b/editor/src/main/com/mbrlabs/mundus/editor/ui/UI.kt index ab9a67fca..498cd4375 100644 --- a/editor/src/main/com/mbrlabs/mundus/editor/ui/UI.kt +++ b/editor/src/main/com/mbrlabs/mundus/editor/ui/UI.kt @@ -130,4 +130,8 @@ object UI : Stage(ScreenViewport()) { dialog.show(this) } + override fun act() { + super.act() + docker.update(); + } } diff --git a/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/DockBar.kt b/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/DockBar.kt index bf5686ab7..5baead4bb 100644 --- a/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/DockBar.kt +++ b/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/DockBar.kt @@ -73,4 +73,8 @@ class DockBar(private val splitPane: MundusSplitPane) : VisTable(), TabbedPaneLi // user can't do that } + fun update() { + tabbedPane.updateTabTitle(logBar) + } + } diff --git a/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/LogBar.kt b/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/LogBar.kt index 97a249f12..9d979e12f 100644 --- a/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/LogBar.kt +++ b/editor/src/main/com/mbrlabs/mundus/editor/ui/modules/dock/LogBar.kt @@ -30,6 +30,9 @@ class LogBar : Tab(false, false), LogEvent.LogEventListener { private val maxLogSize = 75 private val dateFormat = SimpleDateFormat("HH:mm:ss") + // True when new entries are in the log and log is not the active tab + var newEntries = false + init { Mundus.registerEventListener(this) initUi() @@ -79,7 +82,15 @@ class LogBar : Tab(false, false), LogEvent.LogEventListener { }) } + override fun onShow() { + super.onShow() + newEntries = false + } + override fun getTabTitle(): String { + if (newEntries) + return "Log*" + return "Log" } @@ -96,6 +107,9 @@ class LogBar : Tab(false, false), LogEvent.LogEventListener { * removes old entries. */ private fun addLogMessage(message : String) { + if (!isActiveTab) + newEntries = true + val timeStamp = dateFormat.format(Date()) val logString = buildString {