Skip to content

Commit

Permalink
Added delay to "gotoLine" call when error is detected, fixed "let gmr…
Browse files Browse the repository at this point in the history
…n = gmrn =", removed rogue console.log, updated version number
  • Loading branch information
nommiin committed Mar 25, 2019
1 parent dc330a7 commit 4f4660b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 11 additions & 9 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@ Builder.Parse = function(bString, bType) {
}

if ($gmedit["ui.OpenDeclaration"].openLocal(bAsset, 0) == true) {
let bOffset = 0;
if (eName != "") {
for(let i = 0; i < aceEditor.session.getLength(); i++) {
if (aceEditor.session.getLine(i).includes("#event " + eName) == true) {
bOffset = ++i;
break;
setTimeout(() => {
let bOffset = 0;
if (eName != "") {
for(let i = 0; i < aceEditor.session.getLength(); i++) {
if (aceEditor.session.getLine(i).includes("#event " + eName) == true) {
bOffset = ++i;
break;
}
}
}
}
aceEditor.gotoLine(bOffset + bLine);
aceEditor.gotoLine(bOffset + bLine);
}, 500);
}

}
Expand Down Expand Up @@ -123,7 +125,7 @@ Builder.Run = function() {
return;
}

let gmrn = gmrn = (Builder.Platform == "win" ? cmd.exec(`${runtimepath}/windows/Runner.exe -game "${outpath}/${projectname}.win"`) : cmd.exec(`"${runtimepath}/mac/YoYo Runner.app/Contents/MacOS/Mac_Runner" --args -game "${outpath}/${projectname}.win"`));
let gmrn = (Builder.Platform == "win" ? cmd.exec(`${runtimepath}/windows/Runner.exe -game "${outpath}/${projectname}.win"`) : cmd.exec(`"${runtimepath}/mac/YoYo Runner.app/Contents/MacOS/Mac_Runner" --args -game "${outpath}/${projectname}.win"`));
gmrn.addListener("close", function() {
if (Builder.Platform == "win") {
gmout.write(`Removing virtual drive: ${Builder.Drive}\n`);
Expand Down
3 changes: 1 addition & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$gmedit["gml.Project"].current
*/
Builder = {Platform: require("os").type()};
console.log(Builder.Platform);
if (Builder.Platform.includes("Windows") == true) Builder.Platform = "win";
if (Builder.Platform.includes("Darwin") == true) {
Builder.Platform = "mac";
Expand Down Expand Up @@ -96,7 +95,7 @@ if (Builder.Platform.includes("Darwin") == true) {
preferences.setMenu(preferences.menuMain);
Builder.Save();
});
preferences.addText(Builder.Settings, "builder v0.4 (" + Builder.Platform + ") - nommiin")
preferences.addText(Builder.Settings, "builder v0.5 (" + Builder.Platform + ") - nommiin")

// Hook into preferences menu
let buildMain = preferences.buildMain;
Expand Down

0 comments on commit 4f4660b

Please sign in to comment.