mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 01:54:04 +09:00
new world ui to where it should be
This commit is contained in:
Binary file not shown.
@@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.Camera
|
|||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
import net.torvald.terrarum.*
|
import net.torvald.terrarum.*
|
||||||
|
import net.torvald.terrarum.App.printdbg
|
||||||
import net.torvald.terrarum.App.printdbgerr
|
import net.torvald.terrarum.App.printdbgerr
|
||||||
import net.torvald.terrarum.serialise.WriteConfig
|
import net.torvald.terrarum.serialise.WriteConfig
|
||||||
import net.torvald.terrarum.ui.Toolkit
|
import net.torvald.terrarum.ui.Toolkit
|
||||||
@@ -39,13 +40,17 @@ open class UIRemoCon(val parent: TitleScreen, treeRepresentation: QNDTreeNode<St
|
|||||||
init {
|
init {
|
||||||
remoConTray = generateNewRemoCon(currentRemoConContents)
|
remoConTray = generateNewRemoCon(currentRemoConContents)
|
||||||
|
|
||||||
treeRepresentation.traversePreorder { node, _ ->
|
registerUIclasses(treeRepresentation)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerUIclasses(tree: QNDTreeNode<String>) {
|
||||||
|
tree.traversePreorder { node, _ ->
|
||||||
val splittedNodeName = node.data?.split(yamlSep)
|
val splittedNodeName = node.data?.split(yamlSep)
|
||||||
|
|
||||||
if (splittedNodeName?.size == 2 && node.data != null) {
|
if (splittedNodeName?.size == 2 && node.data != null) {
|
||||||
try {
|
try {
|
||||||
val attachedClass = loadClass(splittedNodeName[1]) // check existance
|
val attachedClass = loadClass(splittedNodeName[1]) // check existence
|
||||||
screenNames[node.data!!] = splittedNodeName[1]
|
screenNames[node.data!!] = splittedNodeName[1] // actual loading will by dynamic as some UIs need to be re-initialised as they're called
|
||||||
}
|
}
|
||||||
catch (e: java.lang.ClassNotFoundException) {
|
catch (e: java.lang.ClassNotFoundException) {
|
||||||
printdbgerr(this, "class '${splittedNodeName[1]}' was not found, skipping")
|
printdbgerr(this, "class '${splittedNodeName[1]}' was not found, skipping")
|
||||||
@@ -128,6 +133,7 @@ open class UIRemoCon(val parent: TitleScreen, treeRepresentation: QNDTreeNode<St
|
|||||||
openUI?.setAsClose()
|
openUI?.setAsClose()
|
||||||
openUI?.dispose()
|
openUI?.dispose()
|
||||||
|
|
||||||
|
printdbg(this, "$currentlySelectedRemoConItem has screen: ${screenNames.containsKey(currentlySelectedRemoConItem)}")
|
||||||
screenNames[currentlySelectedRemoConItem]?.let {
|
screenNames[currentlySelectedRemoConItem]?.let {
|
||||||
val ui = loadClass(it)
|
val ui = loadClass(it)
|
||||||
ui.setPosition(0,0)
|
ui.setPosition(0,0)
|
||||||
@@ -164,6 +170,8 @@ open class UIRemoCon(val parent: TitleScreen, treeRepresentation: QNDTreeNode<St
|
|||||||
currentRemoConContents = newCurrentRemoConContents
|
currentRemoConContents = newCurrentRemoConContents
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerUIclasses(newCurrentRemoConContents)
|
||||||
|
|
||||||
currentlySelectedRemoConItem = newCurrentRemoConContents.data
|
currentlySelectedRemoConItem = newCurrentRemoConContents.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ object UITitleRemoConYaml {
|
|||||||
- MENU_LABEL_GRAPHICS : net.torvald.terrarum.modulebasegame.ui.GraphicsControlPanel
|
- MENU_LABEL_GRAPHICS : net.torvald.terrarum.modulebasegame.ui.GraphicsControlPanel
|
||||||
- MENU_OPTIONS_CONTROLS : net.torvald.terrarum.modulebasegame.ui.UIKeyboardControlPanel
|
- MENU_OPTIONS_CONTROLS : net.torvald.terrarum.modulebasegame.ui.UIKeyboardControlPanel
|
||||||
- MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage
|
- MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage
|
||||||
- TEST : net.torvald.terrarum.modulebasegame.ui.UINewWorld
|
|
||||||
- MENU_MODULES : net.torvald.terrarum.ModOptionsHost
|
- MENU_MODULES : net.torvald.terrarum.ModOptionsHost
|
||||||
- MENU_LABEL_RETURN+WRITETOCONFIG
|
- MENU_LABEL_RETURN+WRITETOCONFIG
|
||||||
- MENU_LABEL_CREDITS
|
- MENU_LABEL_CREDITS
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user