Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator into burg-groups

This commit is contained in:
Azgaar 2024-09-27 13:32:51 +02:00
commit e53c3a7773
4 changed files with 29 additions and 35 deletions

View file

@ -1511,20 +1511,6 @@ div.states > .burgCulture {
width: 6em; width: 6em;
} }
div.states .burgPopulation {
width: 4.8em;
}
div.states .burgType {
width: 3em;
}
div.states .burgType > span {
padding: 0 1px;
color: #6e5e66;
transition: 0.2s;
}
div.states span.inactive { div.states span.inactive {
color: #c6c2c2; color: #c6c2c2;
} }

View file

@ -138,7 +138,7 @@
} }
</style> </style>
<link rel="preload" href="index.css?v=1.105.0" as="style" onload="this.onload=null; this.rel='stylesheet'" /> <link rel="preload" href="index.css?v=1.105.7" as="style" onload="this.onload=null; this.rel='stylesheet'" />
<link rel="preload" href="icons.css" as="style" onload="this.onload=null; this.rel='stylesheet'" /> <link rel="preload" href="icons.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
<link rel="preload" href="libs/jquery-ui.css" as="style" onload="this.onload=null; this.rel='stylesheet'" /> <link rel="preload" href="libs/jquery-ui.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
</head> </head>
@ -5280,7 +5280,7 @@
</div> </div>
<div id="burgsOverview" class="dialog stable" style="display: none"> <div id="burgsOverview" class="dialog stable" style="display: none">
<div id="burgsHeader" class="header" style="grid-template-columns: 8em 6em 6em 7em 7em 4em 2em"> <div id="burgsHeader" class="header" style="grid-template-columns: 8em 6em 6em 6em 8em 6em">
<div data-tip="Click to sort by burg name" class="sortable alphabetically" data-sortby="name">Burg</div> <div data-tip="Click to sort by burg name" class="sortable alphabetically" data-sortby="name">Burg</div>
<div data-tip="Click to sort by province name" class="sortable alphabetically" data-sortby="province"> <div data-tip="Click to sort by province name" class="sortable alphabetically" data-sortby="province">
Province Province
@ -5296,7 +5296,7 @@
> >
Population Population
</div> </div>
<div data-tip="Click to sort by burg type" class="sortable alphabetically" data-sortby="type">Type&nbsp;</div> <div data-tip="Click to sort by burg features" class="sortable alphabetically" data-sortby="features">Features&nbsp;</div>
</div> </div>
<div id="burgsBody" class="table"></div> <div id="burgsBody" class="table"></div>
@ -8068,7 +8068,7 @@
<script src="modules/biomes.js?v=1.99.00"></script> <script src="modules/biomes.js?v=1.99.00"></script>
<script src="modules/names-generator.js?v=1.87.14"></script> <script src="modules/names-generator.js?v=1.87.14"></script>
<script src="modules/cultures-generator.js?v=1.99.05"></script> <script src="modules/cultures-generator.js?v=1.99.05"></script>
<script src="modules/burgs-and-states.js?v=1.104.0"></script> <script src="modules/burgs-and-states.js?v=1.105.7"></script>
<script src="modules/provinces-generator.js?v=1.104.0"></script> <script src="modules/provinces-generator.js?v=1.104.0"></script>
<script src="modules/routes-generator.js?v=1.104.10"></script> <script src="modules/routes-generator.js?v=1.104.10"></script>
<script src="modules/religions-generator.js?v=1.99.05"></script> <script src="modules/religions-generator.js?v=1.99.05"></script>
@ -8116,7 +8116,7 @@
<script defer src="modules/ui/ai-generator.js?v=1.99.09"></script> <script defer src="modules/ui/ai-generator.js?v=1.99.09"></script>
<script defer src="modules/ui/diplomacy-editor.js?v=1.99.00"></script> <script defer src="modules/ui/diplomacy-editor.js?v=1.99.00"></script>
<script defer src="modules/ui/zones-editor.js?v=1.100.00"></script> <script defer src="modules/ui/zones-editor.js?v=1.100.00"></script>
<script defer src="modules/ui/burgs-overview.js?v=1.100.00"></script> <script defer src="modules/ui/burgs-overview.js?v=1.105.7"></script>
<script defer src="modules/ui/routes-overview.js?v=1.104.3"></script> <script defer src="modules/ui/routes-overview.js?v=1.104.3"></script>
<script defer src="modules/ui/rivers-overview.js?v=1.99.00"></script> <script defer src="modules/ui/rivers-overview.js?v=1.99.00"></script>
<script defer src="modules/ui/military-overview.js?v=1.99.00"></script> <script defer src="modules/ui/military-overview.js?v=1.99.00"></script>

View file

@ -239,16 +239,23 @@ window.BurgsAndStates = (() => {
return [x, y]; return [x, y];
} }
const getType = (i, port) => { const getType = (cellId, port) => {
const cells = pack.cells; const {cells, features, burgs} = pack;
if (port) return "Naval";
if (cells.haven[i] && pack.features[cells.f[cells.haven[i]]].type === "lake") return "Lake";
if (cells.h[i] > 60) return "Highland";
if (cells.r[i] && cells.r[i].length > 100 && cells.r[i].length >= pack.rivers[0].length) return "River";
if (!cells.burg[i] || pack.burgs[cells.burg[i]].population < 6) { if (port) return "Naval";
if (population < 5 && [1, 2, 3, 4].includes(cells.biome[i])) return "Nomadic";
if (cells.biome[i] > 4 && cells.biome[i] < 10) return "Hunting"; const haven = cells.haven[cellId];
if (haven !== undefined && features[cells.f[haven]].type === "lake") return "Lake";
if (cells.h[cellId] > 60) return "Highland";
if (cells.r[cellId] && cells.fl[cellId] >= 100) return "River";
const biome = cells.biome[cellId];
const population = cells.pop[cellId];
if (!cells.burg[cellId] || population <= 5) {
if (population < 5 && [1, 2, 3, 4].includes(biome)) return "Nomadic";
if (biome > 4 && biome < 10) return "Hunting";
} }
return "Generic"; return "Generic";

View file

@ -75,7 +75,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) {
for (const b of filtered) { for (const b of filtered) {
const population = b.population * populationRate * urbanization; const population = b.population * populationRate * urbanization;
totalPopulation += population; totalPopulation += population;
const type = b.capital && b.port ? "a-capital-port" : b.capital ? "c-capital" : b.port ? "p-port" : "z-burg"; const features = b.capital && b.port ? "a-capital-port" : b.capital ? "c-capital" : b.port ? "p-port" : "z-burg";
const state = pack.states[b.state].name; const state = pack.states[b.state].name;
const prov = pack.cells.province[b.cell]; const prov = pack.cells.province[b.cell];
const province = prov ? pack.provinces[prov].name : ""; const province = prov ? pack.provinces[prov].name : "";
@ -89,7 +89,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) {
data-province="${province}" data-province="${province}"
data-culture="${culture}" data-culture="${culture}"
data-population=${population} data-population=${population}
data-type="${type}" data-features="${features}"
> >
<span data-tip="Click to zoom into view" class="icon-dot-circled pointer"></span> <span data-tip="Click to zoom into view" class="icon-dot-circled pointer"></span>
<input data-tip="Burg name. Click and type to change" class="burgName" value="${ <input data-tip="Burg name. Click and type to change" class="burgName" value="${
@ -101,15 +101,16 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) {
${getCultureOptions(b.culture)} ${getCultureOptions(b.culture)}
</select> </select>
<span data-tip="Burg population" class="icon-male"></span> <span data-tip="Burg population" class="icon-male"></span>
<input data-tip="Burg population. Type to change" class="burgPopulation" value=${si(population)} /> <input data-tip="Burg population. Type to change" value=${si(
<div class="burgType"> population
)} class="burgPopulation" style="width: 5em" />
<div style="width: 3em">
<span <span
data-tip="${b.capital ? " This burg is a state capital" : "Click to assign a capital status"}" data-tip="${b.capital ? " This burg is a state capital" : "Click to assign a capital status"}"
class="icon-star-empty${b.capital ? "" : " inactive pointer"}" class="icon-star-empty${b.capital ? "" : " inactive pointer"}" style="padding: 0 1px;"></span>
></span>
<span data-tip="Click to toggle port status" class="icon-anchor pointer${ <span data-tip="Click to toggle port status" class="icon-anchor pointer${
b.port ? "" : " inactive" b.port ? "" : " inactive"
}" style="font-size:.9em"></span> }" style="font-size: .9em; padding: 0 1px;"></span>
</div> </div>
<span data-tip="Edit burg" class="icon-pencil"></span> <span data-tip="Edit burg" class="icon-pencil"></span>
<span class="locks pointer ${ <span class="locks pointer ${