You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Accept non-default main packs in engine.js startGame()
Allows using startGame() with main packs exported as .zip, but also any other custom extension, for example if a web game host does not allow the .pck filename extension.
This commit is contained in:
@@ -130,13 +130,17 @@
|
||||
this.startGame = function(mainPack) {
|
||||
|
||||
executableName = getBaseName(mainPack);
|
||||
var mainArgs = [];
|
||||
if (!getPathLeaf(mainPack).endsWith('.pck')) {
|
||||
mainArgs = ['--main-pack', getPathLeaf(mainPack)];
|
||||
}
|
||||
return Promise.all([
|
||||
// Load from directory,
|
||||
this.init(getBasePath(mainPack)),
|
||||
// ...but write to root where the engine expects it.
|
||||
this.preloadFile(mainPack, getPathLeaf(mainPack))
|
||||
]).then(
|
||||
Function.prototype.apply.bind(synchronousStart, this, [])
|
||||
Function.prototype.apply.bind(synchronousStart, this, mainArgs)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user