diff --git a/sharedPlugins/remoteMap/index.js b/sharedPlugins/remoteMap/index.js index 47c3bd02..9c03cc08 100644 --- a/sharedPlugins/remoteMap/index.js +++ b/sharedPlugins/remoteMap/index.js @@ -13,8 +13,8 @@ class remoteMap { // initialize chunk database this.chunkMap = new chunkStore(this.config.unique, 64, "./database/chunkStore/"); this.chunkMap.onEntityChange(entity => { - this.messageInterface("Entity changed: ") - this.messageInterface(entity); + // this.messageInterface("Entity changed: ") + // this.messageInterface(entity); // check valid coordinates (dunno what could go wrong, but can never be too sure) if(entity && entity.x !== undefined && !isNaN(Number(entity.x)) && entity.y !== undefined && !isNaN(Number(entity.y))){ this.socket.emit("sendEntity", entity); @@ -57,6 +57,7 @@ class remoteMap { this.messageInterface("placing "+JSON.stringify(req)); if(req.name && typeof req.name == "string" && req.position && !isNaN(Number(req.position.x)) && !isNaN(Number(req.position.y))){ if(req.name == "deleted"){ // {{'+req.position.x+','+req.position.y+'},{'+req.position.x+','+req.position.y+'}} + // delete entity from game world using LUA command this.messageInterface('/silent-command local toDelete = game.surfaces[1].find_entities({{'+req.position.x+','+req.position.y+'},{'+(req.position.x+1)+','+(req.position.y+1)+'}}) for i, entity in pairs(toDelete) do entity.die() end'); // this position is now empty, delete whatever was there from DB this.deleteEntity(req.position.x, req.position.y); @@ -87,7 +88,7 @@ class remoteMap { deleteEntity(x,y){ // remove entity from database // this position is now empty, delete whatever was there from DB this.chunkMap.setEntity(x, y, "delete this entity").then(() => { - this.messageInterface("Deleted data "+x+", "+y); + this.messageInterface("Deleted entity at "+x+", "+y); }).catch((err)=>this.messageInterface(err)); } scriptOutput(data){ diff --git a/static/lib/entityDrawRules.js b/static/lib/entityDrawRules.js index 671a3f6f..6e6e8e0e 100644 --- a/static/lib/entityDrawRules.js +++ b/static/lib/entityDrawRules.js @@ -118,7 +118,7 @@ export var entityDrawRules = { x:-1, y:-1, } - } + }, }; let template3x3entity = { sizeInTiles: { @@ -332,4 +332,24 @@ entityDrawRules["oil-refinery"].spritesheet.forEach(object => { y:-2.7, } }); - +// tree sizes +["tree-02", +"tree-02-red", +"tree-03", +"tree-04", +"tree-05", +"tree-07", +"tree-09", +"tree-09-brown", +"tree-09-red"].forEach(tree => { + entityDrawRules[tree] = { + sizeInTiles: { + x: 3, + y: 4, + }, + positionOffset: { + x: -0.6, + y: -2.6, + } + } +}); diff --git a/static/main.js b/static/main.js index 633bbb47..a1b805f1 100644 --- a/static/main.js +++ b/static/main.js @@ -169,7 +169,7 @@ $.getJSON("/api/getFactorioLocale", (locale) => { // image data // key is the name of the item in the database, value is the name of the image on wiki.factorio.com/images/* // this list has to include all entities that doesn't just follow the simple capitalize first letter convention -/* Notice: All icon images hosted on this Wiki have been renamed to use their in-game names, with underscores. If your external tool references these icons, please correct your links. */ +/* Notice from bilka: All icon images hosted on this Wiki have been renamed to use their in-game names, with underscores. If your external tool references these icons, please correct your links. */ var imagedata = { "put-combinator": "Decider_combinator", "smart-train-stop": "Train_stop", @@ -177,6 +177,19 @@ var imagedata = { "solar-panel-equipment": "Portable_solar_panel", "diesel-locomotive": "Locomotive", // pre 0.15 loco name "small-lamp": "Lamp", + "tree-02": "Green_tree", + "tree-02-red": "Green_tree", + "tree-03": "Green_tree", + "tree-04": "Green_tree", + "tree-05": "Green_tree", + "tree-07": "Green_tree", + "tree-09": "Green_tree", + "tree-09-brown": "Green_tree", + "tree-09-red": "Green_tree", + "dead-tree-desert": "Dead_tree_desert", + "sand-rock-big": "Rock_big", + // "biter-spawner" missing, but can't find png for it on wiki + // "spitter-spawner" } @@ -199,6 +212,5 @@ var imagelinks = { "piercing-shotgun-shell": "/pictures/piercing_shotgun_shells.png", "energy-shield-mk2-equipment": "/pictures/Energy_shield_MK2.png", "battery-mk2-equipment": "/pictures/Battery_MK2.png", - "personal-roboport-mk2-equipment": "/pictures/Personal_roboport_MK2.png" - + "personal-roboport-mk2-equipment": "/pictures/Personal_roboport_MK2.png", }