various reported bugfixes

This commit is contained in:
RandomityGuy 2024-07-14 02:04:06 +05:30
parent 2610a72257
commit 296c7e893b
8 changed files with 53 additions and 21 deletions

Binary file not shown.

View file

@ -416,7 +416,7 @@ class DtsObject extends GameObject {
dtsshader.normalizeNormals = false; // These arent normalized dtsshader.normalizeNormals = false; // These arent normalized
if (this.identifier != null && StringTools.startsWith(this.identifier, "GemBeam")) { if (this.identifier != null && StringTools.startsWith(this.identifier, "GemBeam")) {
dtsshader.usePremultipliedAlpha = true; dtsshader.usePremultipliedAlpha = true;
dtsshader.opacityMult = 0.5; // Hardcoded dtsshader.opacityMult = 3.0; // Hardcoded
} }
material.mainPass.removeShader(material.textureShader); material.mainPass.removeShader(material.textureShader);
material.mainPass.addShader(dtsshader); material.mainPass.addShader(dtsshader);

View file

@ -792,7 +792,8 @@ class MarbleWorld extends Scheduler {
this.setUp(this.marble, startquat.up, this.timeState, true); this.setUp(this.marble, startquat.up, this.timeState, true);
this.deselectPowerUp(this.marble); this.deselectPowerUp(this.marble);
AudioManager.playSound(ResourceLoader.getResource('data/sound/spawn.wav', ResourceLoader.getAudio, this.soundResources)); if (!this.isMultiplayer)
AudioManager.playSound(ResourceLoader.getResource('data/sound/spawn.wav', ResourceLoader.getAudio, this.soundResources));
Console.log("State Start"); Console.log("State Start");
this.clearSchedule(); this.clearSchedule();
@ -844,6 +845,10 @@ class MarbleWorld extends Scheduler {
this.setUp(marble, respawnUp, this.timeState, true); this.setUp(marble, respawnUp, this.timeState, true);
var store = marble.heldPowerup;
marble.heldPowerup = null;
haxe.Timer.delay(() -> marble.heldPowerup = store, 500); // This bs
if (marble == this.marble) if (marble == this.marble)
this.playGui.setCenterText('none'); this.playGui.setCenterText('none');
if (!this.isMultiplayer) if (!this.isMultiplayer)
@ -2836,7 +2841,7 @@ class MarbleWorld extends Scheduler {
offset.x = -offset.x; offset.x = -offset.x;
} }
var mpos = this.currentCheckpoint.obj.getAbsPos().getPosition().add(offset); var mpos = this.currentCheckpoint.obj.getAbsPos().getPosition().add(offset);
this.marble.setPosition(mpos.x, mpos.y, mpos.z); this.marble.setMarblePosition(mpos.x, mpos.y, mpos.z);
marble.velocity.load(new Vector(0, 0, 0)); marble.velocity.load(new Vector(0, 0, 0));
marble.omega.load(new Vector(0, 0, 0)); marble.omega.load(new Vector(0, 0, 0));
Console.log('Respawn:'); Console.log('Respawn:');

View file

@ -53,6 +53,9 @@ class Radar {
radarTileRedGem, radarTileYellowGem, radarTileBlueGem, radarTileGreenGem, radarTileOrangeGem, radarTilePinkGem, radarTilePurpleGem, radarTileRedGem, radarTileYellowGem, radarTileBlueGem, radarTileGreenGem, radarTileOrangeGem, radarTilePinkGem, radarTilePurpleGem,
radarTileTurquoiseGem, radarTileBlackGem, radarTilePlatinumGem, radarTileEndPad radarTileTurquoiseGem, radarTileBlackGem, radarTilePlatinumGem, radarTileEndPad
]; ];
for (tile in radarTiles) {
tile.scaleToSize(tile.width * Settings.uiScale, tile.height * Settings.uiScale);
}
} }
public function init() { public function init() {

View file

@ -259,8 +259,8 @@ class MPServerDlg extends GuiImage {
playerPlus.position = new Vector(359, 9 + 29 * 5); playerPlus.position = new Vector(359, 9 + 29 * 5);
playerPlus.extent = new Vector(31, 31); playerPlus.extent = new Vector(31, 31);
playerPlus.pressedAction = (sender) -> { playerPlus.pressedAction = (sender) -> {
Settings.serverSettings.maxPlayers = Std.int(Math.min(8, Settings.serverSettings.maxPlayers + 1)); curServerMaxPlayers = Std.int(Math.min(8, curServerMaxPlayers + 1));
maxPlayers.text.text = "Max Players: " + Settings.serverSettings.maxPlayers; maxPlayers.text.text = "Max Players: " + curServerMaxPlayers;
}; };
serverSettingsContainer.addChild(playerPlus); serverSettingsContainer.addChild(playerPlus);

View file

@ -632,19 +632,23 @@ class PlayGui {
this.playGuiCtrl.addChild(playerListContainer); this.playGuiCtrl.addChild(playerListContainer);
var imgLoader = (s:String) -> { var imgLoader = (s:String) -> {
switch (s) { var t = switch (s) {
case "high": case "high":
return ResourceLoader.getResource("data/ui/mp/play/connection-high.png", ResourceLoader.getImage, this.imageResources).toTile(); ResourceLoader.getResource("data/ui/mp/play/connection-high.png", ResourceLoader.getImage, this.imageResources).toTile();
case "medium": case "medium":
return ResourceLoader.getResource("data/ui/mp/play/connection-medium.png", ResourceLoader.getImage, this.imageResources).toTile(); ResourceLoader.getResource("data/ui/mp/play/connection-medium.png", ResourceLoader.getImage, this.imageResources).toTile();
case "low": case "low":
return ResourceLoader.getResource("data/ui/mp/play/connection-low.png", ResourceLoader.getImage, this.imageResources).toTile(); ResourceLoader.getResource("data/ui/mp/play/connection-low.png", ResourceLoader.getImage, this.imageResources).toTile();
case "matanny": case "matanny":
return ResourceLoader.getResource("data/ui/mp/play/connection-matanny.png", ResourceLoader.getImage, this.imageResources).toTile(); ResourceLoader.getResource("data/ui/mp/play/connection-matanny.png", ResourceLoader.getImage, this.imageResources).toTile();
case "unknown": case "unknown":
return ResourceLoader.getResource("data/ui/mp/play/connection-unknown.png", ResourceLoader.getImage, this.imageResources).toTile(); ResourceLoader.getResource("data/ui/mp/play/connection-unknown.png", ResourceLoader.getImage, this.imageResources).toTile();
} default:
return null; null;
};
if (t != null)
t.scaleToSize(t.width * (Settings.uiScale), t.height * (Settings.uiScale));
return t;
} }
playerListCtrl = new GuiMLTextListCtrl(bfont, [], imgLoader, { playerListCtrl = new GuiMLTextListCtrl(bfont, [], imgLoader, {

View file

@ -99,11 +99,11 @@ class MisParser {
else if (!lineMatch || (blockMatch && lineMatch && blockCommentRegEx.matchedPos().pos < lineCommentRegEx.matchedPos().pos)) { else if (!lineMatch || (blockMatch && lineMatch && blockCommentRegEx.matchedPos().pos < lineCommentRegEx.matchedPos().pos)) {
this.text = this.text.substring(0, blockCommentRegEx.matchedPos().pos) this.text = this.text.substring(0, blockCommentRegEx.matchedPos().pos)
+ this.text.substring(blockCommentRegEx.matchedPos().pos + blockCommentRegEx.matchedPos().len); + this.text.substring(blockCommentRegEx.matchedPos().pos + blockCommentRegEx.matchedPos().len);
currentIndex += blockCommentRegEx.matchedPos().pos; currentIndex = blockCommentRegEx.matchedPos().pos + blockCommentRegEx.matchedPos().len;
} else { } else {
this.text = this.text.substring(0, lineCommentRegEx.matchedPos().pos) this.text = this.text.substring(0, lineCommentRegEx.matchedPos().pos)
+ this.text.substring(lineCommentRegEx.matchedPos().pos + lineCommentRegEx.matchedPos().len); + this.text.substring(lineCommentRegEx.matchedPos().pos + lineCommentRegEx.matchedPos().len);
currentIndex += lineCommentRegEx.matchedPos().pos; currentIndex = lineCommentRegEx.matchedPos().pos + lineCommentRegEx.matchedPos().len;
} }
} }
@ -294,13 +294,30 @@ class MisParser {
function readPath(name:String) { function readPath(name:String) {
var sg:MissionElementSimGroup = cast this.readSimGroup(name); var sg:MissionElementSimGroup = cast this.readSimGroup(name);
var obj = new MissionElementPath(); var allMarkers = true;
obj._type = MissionElementType.Path; // Verify if they are all markers
obj._name = name; for (e in sg.elements) {
obj.markers = sg.elements.map(x -> cast x); if (e._type != MissionElementType.Marker) {
obj.markers.sort((a, b) -> cast MisParser.parseNumber(a.seqnum) - MisParser.parseNumber(b.seqnum)); allMarkers = false;
break;
}
}
if (allMarkers) {
var obj = new MissionElementPath();
obj._type = MissionElementType.Path;
obj._name = name;
obj.markers = sg.elements.map(x -> cast x);
obj.markers.sort((a, b) -> cast MisParser.parseNumber(a.seqnum) - MisParser.parseNumber(b.seqnum));
return obj; return obj;
} else {
var obj = new MissionElementPath();
obj._type = MissionElementType.Path;
obj._name = name;
obj.markers = sg.elements.filter(x -> x._type == MissionElementType.Marker).map(x -> cast x);
obj.markers.sort((a, b) -> cast MisParser.parseNumber(a.seqnum) - MisParser.parseNumber(b.seqnum));
return obj;
}
} }
/** Resolves a TorqueScript rvalue expression. Currently only supports the concatenation @ operator. */ /** Resolves a TorqueScript rvalue expression. Currently only supports the concatenation @ operator. */

View file

@ -18,6 +18,8 @@ import src.Console;
import src.Marbleland; import src.Marbleland;
import src.Settings; import src.Settings;
import src.Util; import src.Util;
import src.AudioManager;
import src.ResourceLoader;
@:build(net.RPCMacro.build()) @:build(net.RPCMacro.build())
class NetCommands { class NetCommands {
@ -248,6 +250,7 @@ class NetCommands {
MarbleGame.instance.touchInput.setControlsEnabled(true); MarbleGame.instance.touchInput.setControlsEnabled(true);
} }
MarbleGame.instance.world.marble.camera.stopOverview(); MarbleGame.instance.world.marble.camera.stopOverview();
AudioManager.playSound(ResourceLoader.getAudio('data/sound/spawn.wav').resource);
} }
if (Net.clientSpectate || Net.hostSpectate) { if (Net.clientSpectate || Net.hostSpectate) {