mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix this lol
This commit is contained in:
parent
e9c948f6d0
commit
05f154d765
1 changed files with 9 additions and 1 deletions
|
|
@ -303,6 +303,7 @@ class MarblePickerGui extends GuiImage {
|
|||
mbOpt.extent = new Vector(815, 94);
|
||||
mbOpt.setCurrentOption(Settings.optionsSettings.marbleIndex);
|
||||
var curToken = 0;
|
||||
|
||||
mbOpt.onChangeFunc = (idx) -> {
|
||||
var selectedMarble = marbleData[idx];
|
||||
Settings.optionsSettings.marbleIndex = idx;
|
||||
|
|
@ -312,10 +313,14 @@ class MarblePickerGui extends GuiImage {
|
|||
Settings.optionsSettings.marbleShader = selectedMarble.shader;
|
||||
var changeToken = curToken++;
|
||||
ResourceLoader.load(Settings.optionsSettings.marbleModel).entry.load(() -> {
|
||||
if (changeToken + 1 != curToken)
|
||||
return;
|
||||
@:privateAccess MarbleGame.instance.previewWorld.removeMarble(myMarb);
|
||||
@:privateAccess MarbleGame.instance.previewWorld.spawnMarble(marb -> {
|
||||
if (changeToken + 1 != curToken)
|
||||
if (changeToken + 1 != curToken) {
|
||||
@:privateAccess MarbleGame.instance.previewWorld.removeMarble(marb);
|
||||
return;
|
||||
}
|
||||
var spawnPos = @:privateAccess MarbleGame.instance.scene.camera.pos.add(new Vector(0, 1, 1));
|
||||
var velAdd = new Vector((1 - 2 * Math.random()) * 2, (1 - 2 * Math.random()) * 1.5, (1 - 2 * Math.random()) * 1);
|
||||
velAdd = velAdd.add(new Vector(0, 3, 0));
|
||||
|
|
@ -343,6 +348,9 @@ class MarblePickerGui extends GuiImage {
|
|||
backButton.accelerators = [hxd.Key.ENTER];
|
||||
backButton.pressedAction = (e) -> {
|
||||
this.bmp.visible = true;
|
||||
mbOpt.onChangeFunc = (e) -> {
|
||||
return false;
|
||||
}; // Fix that marbug
|
||||
MarbleGame.instance.setPreviewMission(prevPreview, () -> {
|
||||
MarbleGame.canvas.setContent(new OptionsListGui());
|
||||
}, false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue