Giter Club home page Giter Club logo

factorio-blueprint-editor's Introduction

Joined Github 7 years ago.

Since then I pushed 2441 commits, opened 215 issues, submitted 368 pull requests, received 919 stars across 11 personal projects and contributed to 8 public repositories.

Most used languages across my projects:

TypeScript Rust Julia JavaScript HTML Lua CSS Other

Generated using teoxoy/profile-readme-stats

factorio-blueprint-editor's People

Contributors

bartduisters avatar cryhot avatar dependabot-preview[bot] avatar dependabot[bot] avatar disparity avatar ilmtitan avatar jnf27170 avatar joelverhagen avatar kencoder avatar motlin avatar sips1980 avatar smithtad avatar teoxoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

factorio-blueprint-editor's Issues

Copy and delete selections

Copy selection (ctrl + left click to start) - this would behave as the other paint containers
Delete selection (ctrl + right click to start)
Clear selections with Q

More entity settings

  • item filters
  • splitter settings
  • entity preview
  • requester chest
  • buffer chest
  • storage chest
  • beacon editor
  • electric mining drill

Blueprint Tools

  • Rotate
  • Flip - with warnings if it contains entities that are not rotationally symmetric

Regenerate entity numbers at export

TL;DR

If you ever delete entities (say, because you made a mistake) and then place more, then copying and pasting the generated string into the app and working on it further will make you overwrite entities.

Repro

Here's a simple repro (link to app with blueprint loaded):

0eJyV0sGKwjAQBuB3+c8paNVdyXFfY5ElrYMOJNOSRNlS8u6mLSyyoq2nkEzyzSSZHpW9UOtZInQPrhsJ0N89Ap/E2GEtdi1BgyM5KIhxwyx6I6FtfCwqshFJgeVIv9DrpGYPmxDIVZblVDhTn1moKO+IMh0USCJHpqmYcdL9yMVV5HOOZ2UotE3IxxoZcmeq2Ch0edhm/cie6im2Gor8h+6Wo+sRXc2bH4vNxeT23bsvMD9f/8yjXI7yZl7evyk/gXM/jB2k77pV4Uo+TBsUrMmPkONff/GUblwi9Wg=

I placed 6 transport belts, deleted 2, then placed 2 assemblers. The assemblers have entity_numbers 7 (left) and 8 (right), but there are only 6 entities in the blueprint. Adding a 7th entity after loading this blueprint will overwrite the left assembler (you can verify by pipetting it). Deleting the new 7th entity (not the assembler) will remove entry 7 from the blueprint's rawEntities map, and cause errors whenever you try to do anything with the "ghost" assembler.

Longer explanation

When a blueprint is pasted in, next_entity_number is set to the number of entities in the blueprint + 1. This works fine if all the entity_numbers in the blueprint are consecutive, with no gaps. But it's easy to end up with gaps, and entity_numbers larger than the number of entities.

The blueprint next_entity_number is monotonically increasing. Deleting entities removes them from the rawEntities map, but doesn't change next_entity_number. So any blueprint built in the app where the user deleted an entity and then added more will have this property (and run into this problem).

Thoughts on fix

  • When generating a blueprint string, "compress" the entity numbers to remove all gaps.
  • In order for old blueprints made with this app (and any other source with nonconsecutive entity numbers) to work, when importing a blueprint string, set next_entity_number to the largest entity number + 1 instead of the length + 1.

Add Editors for Train related Entities

Add editors for train related entities

  • Include adding circuit network settings (where applicable
  • Include adding logistic network settings

Entities:

  • Train Station
  • Rail Signal
  • Rail Chain Signal

Add Logistic Settings to Editors

Logistic Editor for:

  • Inserters
  • Belts
  • mining drills
  • pump
  • offshore pump
  • lamp
  • power switch
  • pumpjack

Note: the graphic for the button to open the logistic editor can be found here

Add Remaining Editors

Add editors for following entities:

  • Lab
  • Electric Furnace
  • Pumpjack
  • Oil Refinery
  • Chemical Plant
  • Centrifuge
  • Rocket Silo
  • Arithmetic Combinator
  • Decider Combinator
  • Constant Combinator
  • Programmable Speaker

Add snackbars for actions

Currently errors are just logged in the console.
Improve the UX by showing errors and other kind of useful messages.

Steel furnace placement off-by-one

0.16.51 36654 win64

Blueprints with steel furnaces, which went through the editor, might have their placement positions off by one. I observed y+1 (upwards) and x-1, y-1 (down,left). Editor shows it fine, placement preview also looks fine, but actual placement is off.

editor
placed
placementpreview

Paste doesn't work in Firefox

navigator.clipboard.readText() doesn't work on the web in Firefox, according to MDN.

This results in an error on the console when trying to paste a blueprint string:

TypeError: navigator.clipboard.readText is not a function (app.ts:360:8)

As a workaround, you could use the older execCommand based API. It would be good to feature detect that navigator.clipboard.readText is undefined, and fallback to the older API.

Another workaround could be to pop up a text box that a user could put text into and then click a button. Not great, but again better than not working.

Add Circuit Settings to Editors

Circuit Editor for:

  • Inserters
  • Chests
  • Belts
  • mining drills
  • storage tank
  • pump
  • offshore pump
  • roboport
  • accumulator
  • lamp
  • wall
  • power switch
  • pumpjack

Note: the graphic for the button to open the logistic editor can be found here

ADD TESTS!

Add a testing framework and start testing stuff!

Empty request slots crash parser

TL;DR

Requester chests edited by hand get a 12-length request filter array regardless of how many slots are actually set. When parsing these empty slots, the parser expects them to have a name property, but they do not.

Steps to reproduce

  1. Place a logistic requester chest.
  2. Edit the filter and request something, like transport belts.
  3. Copy the blueprint string.
  4. Paste the blueprint string.

Expected

Blueprint string should be parsed and reloaded.

Actual

Parsing fails with an error logged to the console:

0: {keyword: "required", dataPath: ".blueprint.entities[0].request_filters[1]", schemaPath: "#/properties/entities/items/properties/request_filters/items/required", params: {…}, message: "should have required property 'name'"}
1: {keyword: "additionalProperties", dataPath: "", schemaPath: "#/oneOf/1/additionalProperties", params: {…}, message: "should NOT have additional properties"}
2: {keyword: "oneOf", dataPath: "", schemaPath: "#/oneOf", params: {…}, message: "should match exactly one schema in oneOf"}

Simple repro:
https://teoxoy.github.io/factorio-blueprint-editor/?source=0eJyFUdFuwyAM/Bc/Eylka5PyuN+YqiqhXmeJQApkWhTl3+s0XeS3vcAZznc+mKFzIw6RfAYzA9ngE5jPGRLdfOvWszwNCAYoYw8KfNuvlQs3SplsYb8x5SLifeQdIywKyF/xF4xezgrQZ8qEm+Z/vQqGkJge/OrLEqWCiVfWvFJEu92UL9Xp4se+4zajFbxELl/kWGmz+5tjHzrH1qchxFx06DLb2TCuuXXJFju/EvhN4HeBDwIfBa4FbgQ+CaylmdayqJbz+mjPpzbiZxT8cKhn+mNTV1WjT2VdKXAtB2Hmx85clgdjypxR
(will crash and not render)

Can't remove entities

Steps to reproduce:

  1. Load blueprint:
0eNqN0dEOgiAUBuB3OdfkFAONV2mtqTGjFBlgyznePTRrbnLhFRzG+fjZGaFseq60kBbYCKLqpAF2HsGIWhbNdGYHxYGBsLwFBLJop0r1rXoU1RMcAiFv/A0scRcEXFphBf8aczFcZd+WXPsL224EqjO+oZPTSx45JBFBMPgNjYhzaIPgP2KsLkR9twe/NAGJLk5ISXdEIb8kaTjJcc934gXBYYPsMNKFIGGC7iDomvBTmmfJVqNH8OLazA00zzDOk1OcYec+t3Cwig==
  1. Try to remove any entity via right-click.

Outcome:
Nothing happens and console contains:

2 - Deleted entity
Uncaught TypeError: Cannot read property 'connections' of undefined
    at e.withMutations.e (VM59 app.db2b6a5a.js:492)
    at r.Cr [as withMutations] (VM59 app.db2b6a5a.js:392)
    at operation.e (VM59 app.db2b6a5a.js:492)
    at c.operation (VM59 app.db2b6a5a.js:492)
    at c.removeEntity (VM59 app.db2b6a5a.js:492)
    at s.removeContainer (VM59 app.db2b6a5a.js:420)
    at P.default.mine.bind (VM59 app.db2b6a5a.js:704)
    at s.e (VM59 app.db2b6a5a.js:659)
    at s._applyBindings (VM59 app.db2b6a5a.js:653)
    at s.pressKey (VM59 app.db2b6a5a.js:653)

Add Inserter Stack Size to Editors

Possibility to override stack size for inserters:

  • Burner Inserter
  • Inserter
  • Long Handed Inserter
  • Fast Inserter
  • Filter Inserter
  • Stack Inserter
  • Stack Filter Inserter

Add Toolbelt / Quickbar

Hello Teoxoy,

While I'm not sure if the tool belt was meant to be developed and integrated with #28 though I thought I give it a shot - here is the result (I know the belt loop on top doesn't make a lot of sense...):
image

The tool belt also supports already 2 rows which if a some point a setting is implemented to have 2 rows only the method ".setRows()" needs to be called accordingly. Also, the key bindings for number 1 to 5 (including shift) are available.

This time around I had to change 2 files and created 1 more in order to make it work - find therefore in the attached ZIP file the following:

  • New Container File: "toolbelt.ts"
  • Changed Files: "app.ts" and "globals.ts"

One issue is still open which would most likely be a more major change to solve it is when rolling over with the mouse above the tool belt the icon in the mouse hand is not shown anymore. I have already some ideas on how to fix this though nothing practical at this point.
Toolbelt.zip

Cheers

Power Switch with copper connections breaks the render

I had an issue with a blueprint book not rendering, after narrowing it down to which blueprint was causing the issue, I went through and found a two item combo that breaks rendering.

A powerswitch, with a substation, connected via a copper wire.

Example:
https://teoxoy.github.io/factorio-blueprint-editor/?source=https://pastebin.com/LbdUgad8

Image of the blueprint in the pastebin link above is attached.
The concrete is not in the blueprint.

editorbug

Error:
Array(3) [ {…}, {…}, {…} ] main.js:43:4643

[
{
"keyword": "additionalProperties",
"dataPath": ".blueprint.entities[0].connections",
"schemaPath": "#/properties/entities/items/properties/connections/additionalProperties",
"params": {
"additionalProperty": "Cu1"
},
"message": "should NOT have additional properties"
},
{
"keyword": "additionalProperties",
"dataPath": "",
"schemaPath": "#/oneOf/1/additionalProperties",
"params": {
"additionalProperty": "blueprint"
},
"message": "should NOT have additional properties"
},
{
"keyword": "oneOf",
"dataPath": "",
"schemaPath": "#/oneOf",
"params": {
"passingSchemas": null
},
"message": "should match exactly one schema in oneOf"
}
]

Entity animations

Add passive animations for belts and rocket silo, roboport and radar antennas.

Resolution doubled on retina displays

I tried to use the app on my macbook and the app is drawn as if my screen was 4 times the size it actually is:

screenshot 2018-05-30 11 09 36

I'm pretty sure it's the retina display because I was able to use the app without this problem yesterday on an external non-retina monitor. The problem is also happening in Chrome and Firefox, so it's probably not browser-related.

If you accept pull requests, I can try to get a patch up.

Power pole cables

Power poles connect to other power poles via copper wires automatically (they also get rotated correspondingly)

Implement the other cursorBoxes

  • underground line pair cursorBox 0112333
  • copy/paste entity settings source entity cursorBox ab7412b
  • electricity cursor boxes
  • logistics cursor boxes (roboport and logistic chests)
  • beacon affected entities
  • inserter "connected" entities
  • red cursor boxes for blocked paint container

Add grid background pattern

Hey, first of thanks for this great tool :).

I am currently trying to improve demipixel's oil outpost generator and would love to use your blueprint editor to view my generated blueprints. But I find the current background options to both be quite noisy, which makes it hard to see what's going on in these spread-out blueprints. Here's an example

If you compare the same blueprint in trakos' fpbviewer, it looks a lot cleaner due to the less noisy background, even though the pipes are not as nice.

It would be great if you could add something similar, so we can have the best of both worlds :).

Inventory Dialog Style

Hello Teoxoy,

First: great job on your project so far - well done.

While I was checking it out I figured I could try to see if I can make the Inventory match the game itself (eat least closely) - here is the result:

image

If you like it feel free to change / alter and / or integrate it into your tool - In the attached ZIP are my changes which were only done to 'inventory.ts' file
inventory.zip

Cheers - keep up the awesome work

Adapt Editor Base Class to include common functionalities

As a prerequisite for integrating #46, #45, #42, #43 , and #47 integrate the controls below directly into the Editor Base Class. The goal is to be able to use the Editor Base Class for the most common Editors directly without having the need to create extended classes:

  • Recipes
  • Modules
  • Circuit Network
  • Logistic Network

The Editor Base Class shall only implement functionalities which are used at a minimum in 2 different entity types (entity.type)

If for any reason the standard supported controls are not sufficient for an entity type, a separate extension of the Editor Base Class shall be created

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.