Skip to content

Commit 19522a1

Browse files
committed
minor js fixes
1 parent b0dc369 commit 19522a1

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Settings.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ class Settings {
367367
optionsSettings.reflectionDetail = 2;
368368
if (controlsSettings.controllerVerticalCenter == null)
369369
controlsSettings.controllerVerticalCenter = true;
370-
if (controlsSettings.huntRandom == null)
371-
controlsSettings.huntRandom = false;
372-
if (controlsSettings.fastLoad == null)
373-
controlsSettings.fastLoad = false;
370+
if (optionsSettings.huntRandom == null)
371+
optionsSettings.huntRandom = false;
372+
if (optionsSettings.fastLoad == null)
373+
optionsSettings.fastLoad = false;
374374
#end
375375
if (optionsSettings.maxPixelRatio == 0 #if js || optionsSettings.maxPixelRatio == null #end)
376376
optionsSettings.maxPixelRatio = 1;

src/fs/TorqueFileSystem.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package fs;
33
import hxd.fs.LocalFileSystem;
44
import src.Settings;
55

6+
#if hl
67
class TorqueFileEntry extends LocalEntry {
78
override function load(?onReady:Void->Void):Void {
89
#if macro
@@ -17,6 +18,7 @@ class TorqueFileEntry extends LocalEntry {
1718
#end
1819
}
1920
}
21+
#end
2022

2123
class TorqueFileSystem extends LocalFileSystem {
2224
#if hl

src/gui/MarblePickerGui.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,20 @@ class MarblePickerGui extends GuiImage {
302302
mbOpt.position = new Vector(380, yPos);
303303
mbOpt.extent = new Vector(815, 94);
304304
mbOpt.setCurrentOption(Settings.optionsSettings.marbleIndex);
305+
var curToken = 0;
305306
mbOpt.onChangeFunc = (idx) -> {
306307
var selectedMarble = marbleData[idx];
307308
Settings.optionsSettings.marbleIndex = idx;
308309
Settings.optionsSettings.marbleCategoryIndex = 0;
309310
Settings.optionsSettings.marbleSkin = selectedMarble.skin;
310311
Settings.optionsSettings.marbleModel = selectedMarble.dts;
311312
Settings.optionsSettings.marbleShader = selectedMarble.shader;
313+
var changeToken = curToken++;
312314
ResourceLoader.load(Settings.optionsSettings.marbleModel).entry.load(() -> {
313315
@:privateAccess MarbleGame.instance.previewWorld.removeMarble(myMarb);
314316
@:privateAccess MarbleGame.instance.previewWorld.spawnMarble(marb -> {
317+
if (changeToken + 1 != curToken)
318+
return;
315319
var spawnPos = @:privateAccess MarbleGame.instance.scene.camera.pos.add(new Vector(0, 1, 1));
316320
var velAdd = new Vector((1 - 2 * Math.random()) * 2, (1 - 2 * Math.random()) * 1.5, (1 - 2 * Math.random()) * 1);
317321
velAdd = velAdd.add(new Vector(0, 3, 0));

0 commit comments

Comments
 (0)