1.0.1 mod compatibility
This commit is contained in:
parent
bbee23bb18
commit
d3236256fa
|
|
@ -3,6 +3,10 @@
|
||||||
+ Explosives Update
|
+ Explosives Update
|
||||||
+ Machines Update
|
+ Machines Update
|
||||||
|
|
||||||
|
[Version 1.0.1]
|
||||||
|
~ Slowed down Udder
|
||||||
|
+ Technical: runAfterLoad() function, pass a function to run after all mods load. See example_mod.js
|
||||||
|
|
||||||
[Version 1.0 - Full Steam Ahead!]
|
[Version 1.0 - Full Steam Ahead!]
|
||||||
+ Radiation
|
+ Radiation
|
||||||
+ Uranium
|
+ Uranium
|
||||||
|
|
|
||||||
12
index.html
12
index.html
|
|
@ -339,6 +339,11 @@
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
runAfterLoadList = [];
|
||||||
|
// runAfterLoad() takes a function and adds it to the runAfterLoadList.
|
||||||
|
function runAfterLoad(func) {
|
||||||
|
runAfterLoadList.push(func);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -1514,7 +1519,7 @@
|
||||||
behavior: [
|
behavior: [
|
||||||
"XX|XX|XX",
|
"XX|XX|XX",
|
||||||
"XX|XX|XX",
|
"XX|XX|XX",
|
||||||
"XX|CR:milk%5|XX",
|
"XX|CR:milk%2.5|XX",
|
||||||
],
|
],
|
||||||
category:"special",
|
category:"special",
|
||||||
},
|
},
|
||||||
|
|
@ -5303,6 +5308,11 @@ for (var k = 0; k < b0.split(" AND ").length; k++) {
|
||||||
function focusGame() { document.getElementById("game").focus(); if(showingMenu) { closeMenu(); } }
|
function focusGame() { document.getElementById("game").focus(); if(showingMenu) { closeMenu(); } }
|
||||||
//on window load
|
//on window load
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
// Loop through runAfterLoadList and run each function
|
||||||
|
for (var i = 0; i < runAfterLoadList.length; i++) {
|
||||||
|
runAfterLoadList[i]();
|
||||||
|
}
|
||||||
|
|
||||||
// Loop through behaviors and each behavior, if it is a string, split the items and replace the value with the array
|
// Loop through behaviors and each behavior, if it is a string, split the items and replace the value with the array
|
||||||
for (var behavior in behaviors) {
|
for (var behavior in behaviors) {
|
||||||
if (typeof behaviors[behavior][0] === "string") {
|
if (typeof behaviors[behavior][0] === "string") {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,12 @@ if (!elements.water.reactions) { // Include this block once
|
||||||
elements.water.reactions.mayo = { "elem1":null, "elem2":"mayo_water" }
|
elements.water.reactions.mayo = { "elem1":null, "elem2":"mayo_water" }
|
||||||
elements.water.reactions.soap = { "elem1":null, "elem2":"soapy_water" }
|
elements.water.reactions.soap = { "elem1":null, "elem2":"soapy_water" }
|
||||||
|
|
||||||
|
// Run after all mods are loaded, for cross-mod compatibility
|
||||||
|
runAfterLoad(function() {
|
||||||
|
// Your code here
|
||||||
|
console.log("Hello World!");
|
||||||
|
});
|
||||||
|
|
||||||
// Creating eLists:
|
// Creating eLists:
|
||||||
eLists.CONDIMENT = ["ketchup","melted_cheese","mayo"];
|
eLists.CONDIMENT = ["ketchup","melted_cheese","mayo"];
|
||||||
// Adding elements to eLists:
|
// Adding elements to eLists:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue