Skip to content
Snippets Groups Projects
Commit 934e4a1d authored by Arkerthan's avatar Arkerthan
Browse files

add invisible filler cell for special layouts

parent 252f3c38
No related branches found
No related tags found
1 merge request!6365Fully integrate arcology building preset system
...@@ -23,7 +23,7 @@ div.building div.outerCell { ...@@ -23,7 +23,7 @@ div.building div.outerCell {
flex-direction: row; flex-direction: row;
} }
div.building div.innerCell { div.building div.innerCell:not(.filler) {
margin: 3px; margin: 3px;
border: 5px solid; border: 5px solid;
padding: 2px; padding: 2px;
...@@ -154,3 +154,7 @@ div.building div.row div.transportHub { ...@@ -154,3 +154,7 @@ div.building div.row div.transportHub {
div.building div.row div.weaponsManufacturing { div.building div.row div.weaponsManufacturing {
border-color: springgreen; border-color: springgreen;
} }
div.building div.row div.filler {
border-color: transparent;
}
...@@ -26,7 +26,7 @@ App.Arcology.cellUpgrade = function(building, cellClass, cellType, newType, key ...@@ -26,7 +26,7 @@ App.Arcology.cellUpgrade = function(building, cellClass, cellType, newType, key
* Updates V.arcologies[0].ownership. * Updates V.arcologies[0].ownership.
*/ */
App.Arcology.updateOwnership = function() { App.Arcology.updateOwnership = function() {
const allCells = V.building.findCells(() => true); const allCells = V.building.findCells(cell => !(cell instanceof App.Arcology.Cell.Filler));
const ownedCells = allCells.filter(cell => cell.owner === 1); const ownedCells = allCells.filter(cell => cell.owner === 1);
const ratio = ownedCells.length / allCells.length; const ratio = ownedCells.length / allCells.length;
......
App.Arcology.Cell.Filler = class extends App.Arcology.Cell.BaseCell {
constructor(width) {
super(1);
this._width = width;
}
get width() {
return this._width;
}
get colorClass() {
return "filler";
}
get className() { return "App.Arcology.Cell.Filler"; }
static _cleanupConfigScheme(config) {
super._cleanupConfigScheme(config);
// BC code
}
clone() {
return (new App.Arcology.Cell.Filler())._init(this);
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment