-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for korlibs 6.0.0-beta1 (#2273)
* Prepare for korlibs 6.0.0-beta1 * Do not scope to views.mouse.coroutineContext by default. Create new onClickSuspend*/onMouseStuffSuspend* variants allowing suspending, while making the older ones non-suspending so we don't have problem with the coroutineContext Job scope Unify QView and View mouse events * Fixes SyncEventLoop * Upgrades xcodeGen * Use .korge folder instead of .korlibs folder * Some ios fixes * Send KeyEvent.Type.TYPE events too on iOS * Some iOS Key mapping improvements * Add CoroutineName to several coroutines * Avoid double initialization of scenes in korge-sandbox * Enable corutine debug in korge-sandbox * Allow to debug coroutines via flag * Update MainAudioScene to test more things * Update gradle.properties with configureondemand and configuration-cache * More work * Moved AudioChannel to Korge * Minor * Updated to 6.0.0-beta1 * Fix tests * Fix tests * Use Java 21
- Loading branch information
Showing
44 changed files
with
314 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
korge-core/src@wasmJs/korlibs/datastructure/event/WasmJsEventLoop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,17 +12,21 @@ class Demo(val sceneBuilder: () -> Scene, val name: String = sceneBuilder()::cla | |
suspend fun Stage.demoSelector(default: Demo, all: List<Demo>) { | ||
val container = sceneContainer(size = Size(width, height - 48f)) { }.xy(0, 48) | ||
val containerFocus = container.makeFocusable() | ||
var currentDemo: Demo? = null | ||
|
||
lateinit var comboBox: UIComboBox<Demo> | ||
|
||
suspend fun setDemo(demo: Demo?) { | ||
if (currentDemo != demo) currentDemo = demo else return | ||
|
||
//container.removeChildren() | ||
//println("setDemo: demo=$demo") | ||
if (demo != null) { | ||
comboBox.selectedItem = demo | ||
views.clearColor = DEFAULT_KORGE_BG_COLOR | ||
container.changeTo { | ||
containerFocus.focus() | ||
demo.sceneBuilder().also { it.init(this) } | ||
demo.sceneBuilder() | ||
} | ||
} | ||
} | ||
|
@@ -33,6 +37,7 @@ suspend fun Stage.demoSelector(default: Demo, all: List<Demo>) { | |
this.viewportHeight = 600 | ||
this.onSelectionUpdate.add { | ||
//println(it) | ||
//CoroutineScope([email protected]).launchImmediately { setDemo(it.selectedItem!!) } | ||
launchImmediately { setDemo(it.selectedItem!!) } | ||
} | ||
} | ||
|
Oops, something went wrong.