Skip to content

Commit

Permalink
minor js fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomityGuy committed Jul 22, 2023
1 parent b0dc369 commit 19522a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Settings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ class Settings {
optionsSettings.reflectionDetail = 2;
if (controlsSettings.controllerVerticalCenter == null)
controlsSettings.controllerVerticalCenter = true;
if (controlsSettings.huntRandom == null)
controlsSettings.huntRandom = false;
if (controlsSettings.fastLoad == null)
controlsSettings.fastLoad = false;
if (optionsSettings.huntRandom == null)
optionsSettings.huntRandom = false;
if (optionsSettings.fastLoad == null)
optionsSettings.fastLoad = false;
#end
if (optionsSettings.maxPixelRatio == 0 #if js || optionsSettings.maxPixelRatio == null #end)
optionsSettings.maxPixelRatio = 1;
Expand Down
2 changes: 2 additions & 0 deletions src/fs/TorqueFileSystem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package fs;
import hxd.fs.LocalFileSystem;
import src.Settings;

#if hl
class TorqueFileEntry extends LocalEntry {
override function load(?onReady:Void->Void):Void {
#if macro
Expand All @@ -17,6 +18,7 @@ class TorqueFileEntry extends LocalEntry {
#end
}
}
#end

class TorqueFileSystem extends LocalFileSystem {
#if hl
Expand Down
4 changes: 4 additions & 0 deletions src/gui/MarblePickerGui.hx
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,20 @@ class MarblePickerGui extends GuiImage {
mbOpt.position = new Vector(380, yPos);
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;
Settings.optionsSettings.marbleCategoryIndex = 0;
Settings.optionsSettings.marbleSkin = selectedMarble.skin;
Settings.optionsSettings.marbleModel = selectedMarble.dts;
Settings.optionsSettings.marbleShader = selectedMarble.shader;
var changeToken = curToken++;
ResourceLoader.load(Settings.optionsSettings.marbleModel).entry.load(() -> {
@:privateAccess MarbleGame.instance.previewWorld.removeMarble(myMarb);
@:privateAccess MarbleGame.instance.previewWorld.spawnMarble(marb -> {
if (changeToken + 1 != curToken)
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));
Expand Down

0 comments on commit 19522a1

Please sign in to comment.