Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,29 @@ function addSquareToKey(tr, nodeType) {
tr.appendChild(td);
}

function getColourForNodeType(nodeType) {
switch (nodeType) {
case 'BuildingTech':
case 'BuildingNonTech':
return '#b54e18';
case 'RegionalBuilding':
return '#cc4422';
case 'UniqueBuilding':
return '#d43652';
case 'Unit':
case 'UnitUpgrade':
return '#00739c';
case 'RegionalUnit':
return '#515ae3';
case 'UniqueUnit':
return '#703b7a';
case 'Technology':
return '#397139';
default:
return '#ff0000';
}
}

function changeLocale() {
const newLocale = document.getElementById('localeselect').value;
setLocaleInUrl(newLocale);
Expand Down
23 changes: 0 additions & 23 deletions js/techtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,29 +740,6 @@ function getColour(id, itemtype) {
return getColourForNodeType(nodeType);
}

function getColourForNodeType(nodeType) {
switch (nodeType) {
case 'BuildingTech':
case 'BuildingNonTech':
return '#b54e18';
case 'RegionalBuilding':
return '#cc4422';
case 'UniqueBuilding':
return '#d43652';
case 'Unit':
case 'UnitUpgrade':
return '#00739c';
case 'RegionalUnit':
return '#515ae3';
case 'UniqueUnit':
return '#703b7a';
case 'Technology':
return '#397139';
default:
return '#ff0000';
}
}

function building(id) {
return new Caret(TYPES.BUILDING, getName(id, 'buildings'), id, getColour(id, 'buildings'));
}
Expand Down
Loading