Move some logic from the base plugin to the views as callbacks

This commit is contained in:
downthecrop 2025-09-09 13:24:52 -07:00
parent fec060626b
commit 4a053d5698
7 changed files with 295 additions and 130 deletions

View file

@ -31,7 +31,7 @@ import kotlin.math.ceil
*/
object ReflectiveEditorView {
object ReflectiveEditorView : View {
var reflectiveEditorView: JPanel? = null
private val loadedPlugins: MutableList<String> = mutableListOf()
const val VIEW_NAME = "REFLECTIVE_EDITOR_VIEW"
@ -72,6 +72,19 @@ object ReflectiveEditorView {
// Search text for filtering plugins
private var pluginSearchText: String = ""
override val name: String = VIEW_NAME
override val iconSpriteId: Int = KondoKit.plugin.WRENCH_ICON
override val panel: JPanel
get() = reflectiveEditorView ?: JPanel()
override fun createView() {
createReflectiveEditorView()
}
override fun registerFunctions() {
// Reflective editor functions are handled within the view itself
}
fun createReflectiveEditorView() {
// Load the cog icon once
loadCogIcon()
@ -749,4 +762,4 @@ object ReflectiveEditorView {
g2.fillRoundRect(x, y, width - 1, height - 1, radius, radius)
}
}
}
}