diff --git a/src/Marble.hx b/src/Marble.hx index 33de9020..d03b880b 100644 --- a/src/Marble.hx +++ b/src/Marble.hx @@ -1134,9 +1134,10 @@ class Marble extends GameObject { // else // gain = (contactVel - minVelocityBounceSoft) / (hardBounceSpeed - minVelocityBounceSoft) * (1.0 - gain) + gain; - if (this.connection != null) - AudioManager.playSound(snd, this.getAbsPos().getPosition()); - else + if (this.connection != null) { + var distFromUs = @:privateAccess this.level.marble.lastRenderPos.distanceSq(this.lastRenderPos); + snd.play(false, Settings.optionsSettings.soundVolume * gain / Math.max(1, distFromUs)); + } else snd.play(false, Settings.optionsSettings.soundVolume * gain); } } @@ -2546,7 +2547,7 @@ class Marble extends GameObject { if (this.blastTicks < 156) return; var blastAmt = this.blastTicks / (25000 >> 5); - var impulse = this.currentUp.multiply(Math.max(Math.sqrt(blastAmt), blastAmt) * 10); + var impulse = this.currentUp.multiply((blastAmt > 1.0 ? blastAmt : Math.sqrt(blastAmt)) * 10); this.applyImpulse(impulse); if (!isNetUpdate && this.controllable) AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources)); @@ -2583,7 +2584,7 @@ class Marble extends GameObject { } else { if (this.blastAmount < 0.2 || this.level.game != "ultra") return; - var impulse = this.currentUp.multiply(Math.max(Math.sqrt(this.blastAmount), this.blastAmount) * 10); + var impulse = this.currentUp.multiply((this.blastAmount > 1.0 ? this.blastAmount : Math.sqrt(this.blastAmount)) * 10); this.applyImpulse(impulse); AudioManager.playSound(ResourceLoader.getResource('data/sound/blast.wav', ResourceLoader.getAudio, this.soundResources)); this.level.particleManager.createEmitter(this.blastAmount > 1 ? blastMaxParticleOptions : blastParticleOptions, diff --git a/src/MarbleGame.hx b/src/MarbleGame.hx index 4d59d7db..07ba56d2 100644 --- a/src/MarbleGame.hx +++ b/src/MarbleGame.hx @@ -42,7 +42,7 @@ class MarbleGame { static var instance:MarbleGame; - static var currentVersion = "1.5.4"; + static var currentVersion = "1.6.0"; var world:MarbleWorld; diff --git a/src/gui/MPPlayMissionGui.hx b/src/gui/MPPlayMissionGui.hx index 7c222163..8b8ca85c 100644 --- a/src/gui/MPPlayMissionGui.hx +++ b/src/gui/MPPlayMissionGui.hx @@ -70,8 +70,8 @@ class MPPlayMissionGui extends GuiImage { currentSelectionStatic = 0; } - currentSelection = currentSelectionStatic; - currentCategory = currentCategoryStatic; + // currentSelection = currentSelectionStatic; + // currentCategory = currentCategoryStatic; MarbleGame.instance.toRecord = false; @@ -416,11 +416,19 @@ class MPPlayMissionGui extends GuiImage { chatInput = new GuiTextInput(markerFelt18); chatInput.text.textColor = 0x000000; chatInput.horizSizing = Width; - chatInput.position = new Vector(0, 0); - chatInput.extent = new Vector(402, 30); + chatInput.position = new Vector(50, 0); + chatInput.extent = new Vector(352, 30); chatInputContainer.addChild(chatInput); @:privateAccess chatInput.text.interactive.forceAnywherefocus = true; + var chatInputFocusTxt = new GuiText(markerFelt18); + chatInputFocusTxt.position = new Vector(0, 0); + chatInputFocusTxt.extent = new Vector(50, 30); + chatInputFocusTxt.text.text = "Chat:"; + chatInputFocusTxt.text.textColor = 0x000000; + chatInputFocusTxt.justify = Center; + chatInputContainer.addChild(chatInputFocusTxt); + chatInput.text.onKeyDown = (e) -> { if (e.keyCode == Key.ENTER) { if (StringTools.trim(chatInput.text.text) != "") { diff --git a/src/mis/MisParser.hx b/src/mis/MisParser.hx index d3414449..fd1c0b9a 100644 --- a/src/mis/MisParser.hx +++ b/src/mis/MisParser.hx @@ -68,13 +68,13 @@ class MisParser { startText = marbleAttributesRegEx.matchedRight(); } - var activatedPackages = []; + // var activatedPackages = []; startText = outsideText; - while (activatePackageRegEx.match(startText)) { - activatedPackages.push(this.resolveExpression(activatePackageRegEx.matched(1))); - startText = marbleAttributesRegEx.matchedRight(); - } + // while (activatePackageRegEx.match(startText)) { + // activatedPackages.push(this.resolveExpression(activatePackageRegEx.matched(1))); + // startText = marbleAttributesRegEx.matchedRight(); + // } if (objectWriteBeginIndex != -1 && objectWriteEndIndex != -1) { this.text = this.text.substring(objectWriteBeginIndex, objectWriteEndIndex); @@ -127,7 +127,6 @@ class MisParser { var mf = new MisFile(); mf.root = cast elements[0]; mf.marbleAttributes = marbleAttributes; - mf.activatedPackages = activatedPackages; return mf; } diff --git a/src/net/NetCommands.hx b/src/net/NetCommands.hx index 1a7abde8..bb0a560f 100644 --- a/src/net/NetCommands.hx +++ b/src/net/NetCommands.hx @@ -28,6 +28,8 @@ class NetCommands { MPPlayMissionGui.currentCategoryStatic = category; MPPlayMissionGui.currentSelectionStatic = i; } else { + MPPlayMissionGui.currentCategoryStatic = category; + MPPlayMissionGui.currentSelectionStatic = i; MPPlayMissionGui.setLevelFn(category, i); } }