Skip to content

Commit db8cc03

Browse files
author
Saurav Tripathi
committed
added missing definitions for RoR; made RoR tree compact
1 parent 4fcf376 commit db8cc03

File tree

3 files changed

+293
-306
lines changed

3 files changed

+293
-306
lines changed

js/main.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,29 @@ function addSquareToKey(tr, nodeType) {
810810
tr.appendChild(td);
811811
}
812812

813+
function getColourForNodeType(nodeType) {
814+
switch (nodeType) {
815+
case 'BuildingTech':
816+
case 'BuildingNonTech':
817+
return '#b54e18';
818+
case 'RegionalBuilding':
819+
return '#cc4422';
820+
case 'UniqueBuilding':
821+
return '#d43652';
822+
case 'Unit':
823+
case 'UnitUpgrade':
824+
return '#00739c';
825+
case 'RegionalUnit':
826+
return '#515ae3';
827+
case 'UniqueUnit':
828+
return '#703b7a';
829+
case 'Technology':
830+
return '#397139';
831+
default:
832+
return '#ff0000';
833+
}
834+
}
835+
813836
function changeLocale() {
814837
const newLocale = document.getElementById('localeselect').value;
815838
setLocaleInUrl(newLocale);

js/techtree.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -740,29 +740,6 @@ function getColour(id, itemtype) {
740740
return getColourForNodeType(nodeType);
741741
}
742742

743-
function getColourForNodeType(nodeType) {
744-
switch (nodeType) {
745-
case 'BuildingTech':
746-
case 'BuildingNonTech':
747-
return '#b54e18';
748-
case 'RegionalBuilding':
749-
return '#cc4422';
750-
case 'UniqueBuilding':
751-
return '#d43652';
752-
case 'Unit':
753-
case 'UnitUpgrade':
754-
return '#00739c';
755-
case 'RegionalUnit':
756-
return '#515ae3';
757-
case 'UniqueUnit':
758-
return '#703b7a';
759-
case 'Technology':
760-
return '#397139';
761-
default:
762-
return '#ff0000';
763-
}
764-
}
765-
766743
function building(id) {
767744
return new Caret(TYPES.BUILDING, getName(id, 'buildings'), id, getColour(id, 'buildings'));
768745
}

0 commit comments

Comments
 (0)