-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split into view, viewmodel, and factorio-blueprint #48
Changes from 1 commit
154f9b7
0d58e35
4b1232b
00ae993
b5d96ff
55f1bf6
76fea93
e44cbb9
02d3637
2a6aef3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Factorio</title> | ||
<link rel="shortcut icon" href="icons/atomic-bomb.png"> | ||
<link rel="shortcut icon" href="vendor/factorio/icons/atomic-bomb.png"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
</head> | ||
|
||
|
@@ -40,8 +40,7 @@ | |
|
||
<script src="https://unpkg.com/[email protected]/dist/tinyemitter.js"></script> | ||
<script src="vendor/factorio-blueprint.min.js"></script> | ||
<script src="vendor/pako.js"></script> | ||
<script src="vendor/base64.js"></script> | ||
|
||
<script src="js/view.js"></script> | ||
<script src="js/viewmodel.js"></script> | ||
<script src="js/script.js"></script> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ window.FBE = window.FBE || {}; | |
|
||
function loadEntity(placeables, entity) { | ||
var items = placeables | ||
.filter(function (p) { return p.name === entity.name; }), | ||
.filter(function (p) { return p.name === entity.name; }), | ||
item; | ||
|
||
if (items.length === 2) { | ||
|
@@ -157,7 +157,12 @@ window.FBE = window.FBE || {}; | |
}, | ||
rawEntities[name], | ||
// fix bad data in factorio-blueprint | ||
name === 'steam_turbine' && {width: 5, height: 3} | ||
name === 'steam_turbine' && { width: 5, height: 3 }, | ||
name === 'boiler' && { width: 3, height: 2 }, | ||
// fix spots where height/width are swapped | ||
name === 'pump' && { width: 2, height: 1 }, | ||
name === 'decider_combinator' && { width: 2, height: 1 }, | ||
name === 'arithmetic_combinator' && { width: 2, height: 1 } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we move these into a switch statement? It took me a while to understand what these && were doing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do |
||
); | ||
}) | ||
.filter(isPlaceable) | ||
|
@@ -166,7 +171,8 @@ window.FBE = window.FBE || {}; | |
} | ||
|
||
function isPlaceable(entity) { | ||
return (entity.type === "item" && entity.width); | ||
return (entity.type === "item" && entity.width) | ||
&& entity.name !== 'curved_rail'; // curved rail is strange | ||
// TODO: support tiles | ||
// || entity.type === "tile" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"name": "factorio_blueprint_editor", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Online Editor for Elxeno's Factorio Blueprint Editor", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "./node_modules/.bin/eslint js/**/*.js" | ||
"lint": "eslint js/**/*.js" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should keep using the project's version of eslint instead of relying on a globally specified version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. npm handles this already, the It basically puts The official docs are very terse on this: https://docs.npmjs.com/misc/scripts#path There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh. I did not know that. Nvm then |
||
}, | ||
"repository": { | ||
"type": "git", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this onto the previous line, or give
item
there it's ownvar
statement.