Render v6 biome names on diagram

This commit is contained in:
Wuzzy 2023-10-27 22:44:38 +02:00
parent 2441c6b997
commit 4da33da71c

View File

@ -96,8 +96,8 @@ const CELL_COLOR_NEUTRAL = "#888888";
const CELL_COLOR_V6_NORMAL = "#6b7f5c"; const CELL_COLOR_V6_NORMAL = "#6b7f5c";
const CELL_COLOR_V6_JUNGLE = "#345644"; const CELL_COLOR_V6_JUNGLE = "#345644";
const CELL_COLOR_V6_DESERT = "#a7822c"; const CELL_COLOR_V6_DESERT = "#a7822c";
const CELL_COLOR_V6_TAIGA = "#ccccff"; const CELL_COLOR_V6_TAIGA = "#548583";
const CELL_COLOR_V6_TUNDRA = "#aaaaff"; const CELL_COLOR_V6_TUNDRA = "#6371b4";
// Mapgen v6 biome thresholds // Mapgen v6 biome thresholds
const MGV6_FREQ_HOT = 0.4 const MGV6_FREQ_HOT = 0.4
@ -1304,9 +1304,6 @@ function drawV6() {
context.closePath(); context.closePath();
context.stroke(); context.stroke();
} else {
// TODO;
}
if (showGrid) { if (showGrid) {
putGrid(context, GRID_STEP_V6); putGrid(context, GRID_STEP_V6);
@ -1315,7 +1312,42 @@ function drawV6() {
putAxes(context); putAxes(context);
} }
// Biome names
if (showNames) {
context.font = "120% sans-serif";
context.fillStyle = "#FFFFFFBB";
context.textAlign = "center";
context.textBaseline = "middle";
if (v6_flag_snowbiomes) {
context.fillText("Taiga", cx_snow/2, cy_snow2/2);
context.fillText("Tundra", cx_snow/2, cy_snow2+((h-cy_snow2)/2));
context.fillText("Jungle", cx_hot + (w-cx_hot)/2, cy_hot2/2);
} else if (v6_flag_jungles) {
context.fillText("Jungle", cx_hot + (w-cx_hot)/2, cy_hot2/2);
}
if (v6_flag_snowbiomes) {
context.fillText("Desert", cx_hot + (w-cx_hot)/2, cy_hot2+((h-cy_hot2)/2));
} else {
if (v6_flag_jungles) {
context.fillText("Desert", cx_hot + (w-cx_hot)/2, cy_hot2+((h-cy_hot2)/2));
} else {
context.fillText("Desert", cx_hot + (w-cx_hot)/2, h/2);
}
}
if (v6_flag_snowbiomes) {
context.fillText("Normal", cx_snow + (cx_hot-cx_snow)/2, h-h/4);
} else {
if (v6_flag_jungles) {
context.fillText("Normal", cx_hot/2, cy_hot2 + (h-cy_hot2)/2);
} else {
context.fillText("Normal", cx_hot/2, h/2);
}
}
}
putResizeCorner(context); putResizeCorner(context);
}
} }
function draw(recalculate) { function draw(recalculate) {