modules/ui/general.js
// get cell info on mouse move
get cell info on mouse move
get cell info on mouse move
function updateCellInfo(point, i, g) {
  const cells = pack.cells;
  const x = infoX.innerHTML = rn(point[0]);
  const y = infoY.innerHTML = rn(point[1]);
  infoLat.innerHTML = toDMS(mapCoordinates.latN - (y / graphHeight) * mapCoordinates.latT, "lat");
  infoLon.innerHTML = toDMS(mapCoordinates.lonW + (x / graphWidth) * mapCoordinates.lonT, "lon");
  infoCell.innerHTML = i;
  const unit = areaUnit.value === "square" ? " " + distanceUnitInput.value + "²" : " " + areaUnit.value;
  infoArea.innerHTML = cells.area[i] ? si(cells.area[i] * distanceScaleInput.value ** 2) + unit : "n/a";
  const h = pack.cells.h[i] < 20 ? grid.cells.h[pack.cells.g[i]] : pack.cells.h[i];
  infoHeight.innerHTML = getFriendlyHeight(point) + " (" + h + ")";
  infoTemp.innerHTML = convertTemperature(grid.cells.temp[g]);
  infoPrec.innerHTML = cells.h[i] >= 20 ? getFriendlyPrecipitation(i) : "n/a";
  infoRiver.innerHTML = cells.h[i] >= 20 && cells.r[i] ? getRiverInfo(cells.r[i]) : "no";
  infoState.innerHTML = cells.h[i] >= 20 ? cells.state[i] ? `${pack.states[cells.state[i]].fullName} (${cells.state[i]})` : "neutral lands (0)" : "no";
  infoProvince.innerHTML = cells.province[i] ? `${pack.provinces[cells.province[i]].fullName} (${cells.province[i]})` : "no";
  infoCulture.innerHTML = cells.culture[i] ? `${pack.cultures[cells.culture[i]].name} (${cells.culture[i]})` : "no";
  infoReligion.innerHTML = cells.religion[i] ? `${pack.religions[cells.religion[i]].name} (${cells.religion[i]})` : "no";
  infoPopulation.innerHTML = getFriendlyPopulation(i);
  infoBurg.innerHTML = cells.burg[i] ? pack.burgs[cells.burg[i]].name + " (" + cells.burg[i] + ")" : "no";
  const f = cells.f[i];
  infoFeature.innerHTML = f ? pack.features[f].group + " (" + f + ")" : "n/a";
  infoBiome.innerHTML = biomesData.name[cells.biome[i]];
}
function updateCellInfo ( point , i , g ) { const cells = pack . cells ; const x = infoX . innerHTML = rn ( point [ 0 ] ) ; const y = infoY . innerHTML = rn ( point [ 1 ] ) ; infoLat . innerHTML = toDMS ( mapCoordinates . latN - ( y / graphHeight ) * mapCoordinates . latT , "lat" ) ; infoLon . innerHTML = toDMS ( mapCoordinates . lonW + ( x / graphWidth ) * mapCoordinates . lonT , "lon" ) ; infoCell . innerHTML = i ; const unit = areaUnit . value === "square" ? " " + distanceUnitInput . value + "²"   "  reaUnit. v alue; infoArea . innerHTML = cells . area [ i ] ? si ( cells . area [ i ] * distanceScaleInput . value ** 2 ) + unit : "n/a" ; const h = pack . cells . h [ i ] < 20 ? grid . cells . h [ pack . cells . g [ i ] ] : pack . cells . h [ i ] ; infoHeight . innerHTML = getFriendlyHeight ( point ) + " (" + h + ")" ; infoTemp . innerHTML = convertTemperature ( grid . cells . temp [ g ] ) ; infoPrec . innerHTML = cells . h [ i ] >= 20 ? getFriendlyPrecipitation ( i ) : "n/a" ; infoRiver . innerHTML = cells . h [ i ] >= 20 && cells . r [ i ] ? getRiverInfo ( cells . r [ i ] ) : "no" ; infoState . innerHTML = cells . h [ i ] >= 20 ? cells . state [ i ] ? ` ${ pack . states [ cells . state [ i ] ] . fullName } ${ cells . state [ i ] } ` : "neutral lands (0)" : "no" ; infoProvince . innerHTML = cells . province [ i ] ? ` ${ pack . provinces [ cells . province [ i ] ] . fullName } ${ cells . province [ i ] } ` : "no" ; infoCulture . innerHTML = cells . culture [ i ] ? ` ${ pack . cultures [ cells . culture [ i ] ] . name } ${ cells . culture [ i ] } ` : "no" ; infoReligion . innerHTML = cells . religion [ i ] ? ` ${ pack . religions [ cells . religion [ i ] ] . name } ${ cells . religion [ i ] } ` : "no" ; infoPopulation . innerHTML = getFriendlyPopulation ( i ) ; infoBurg . innerHTML = cells . burg [ i ] ? pack . burgs [ cells . burg [ i ] ] . name + " (" + cells . burg [ i ] + ")" : "no" ; const f = cells . f [ i ] ; infoFeature . innerHTML = f ? pack . features [ f ] . group + " (" + f + ")" : "n/a" ; infoBiome . innerHTML = biomesData . name [ cells . biome [ i ] ] ; }
get cell info on mouse move
get cell info on mouse move