[orx-gui] Add support for alwaysOnTop WindowedGUI. Forward program produceAssets events
This commit is contained in:
@@ -13,6 +13,7 @@ class WindowedGUI(
|
|||||||
val appearance: GUIAppearance = GUIAppearance(),
|
val appearance: GUIAppearance = GUIAppearance(),
|
||||||
val defaultStyles: List<StyleSheet> = defaultStyles(),
|
val defaultStyles: List<StyleSheet> = defaultStyles(),
|
||||||
val windowClosable: Boolean = false,
|
val windowClosable: Boolean = false,
|
||||||
|
val windowAlwaysOntop: Boolean = false,
|
||||||
) : Extension {
|
) : Extension {
|
||||||
override var enabled: Boolean = true
|
override var enabled: Boolean = true
|
||||||
|
|
||||||
@@ -37,12 +38,15 @@ class WindowedGUI(
|
|||||||
window.program.keyboard.keyRepeat.listeners.clear()
|
window.program.keyboard.keyRepeat.listeners.clear()
|
||||||
window.program.keyboard.character.listeners.clear()
|
window.program.keyboard.character.listeners.clear()
|
||||||
window.program.extensions.clear()
|
window.program.extensions.clear()
|
||||||
|
window.program.produceAssets.listeners.clear()
|
||||||
|
window.program.requestAssets.listeners.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
val cw = childWindows.getOrPut(Driver.instance.contextID) {
|
val cw = childWindows.getOrPut(Driver.instance.contextID) {
|
||||||
program.window(
|
program.window(
|
||||||
WindowConfiguration(
|
WindowConfiguration(
|
||||||
closable = windowClosable,
|
closable = windowClosable,
|
||||||
|
alwaysOnTop = windowAlwaysOntop,
|
||||||
width = appearance.barWidth,
|
width = appearance.barWidth,
|
||||||
height = program.height,
|
height = program.height,
|
||||||
position = program.window.position.toInt() - IntVector2(200, 0)
|
position = program.window.position.toInt() - IntVector2(200, 0)
|
||||||
@@ -59,6 +63,9 @@ class WindowedGUI(
|
|||||||
gui.add(o.first, o.second)
|
gui.add(o.first, o.second)
|
||||||
}
|
}
|
||||||
cw.program.extend(gui)
|
cw.program.extend(gui)
|
||||||
|
program.produceAssets.listen {
|
||||||
|
cw.program.produceAssets.trigger(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user