From 0f3d52e787c417483c4568f038e2c0441714aac0 Mon Sep 17 00:00:00 2001 From: jneb802 <73610029+jneb802@users.noreply.github.com> Date: Thu, 15 Oct 2026 14:24:52 -0700 Subject: [PATCH 1/2] Show alternate biome names on the minimap --- CHANGELOG.md | 4 ++++ Properties/AssemblyInfo.cs | 4 ++-- README.md | 1 + Source/Core/Plugin.cs | 4 +++- Source/Minimap/AlternateBiomeLabel.cs | 34 +++++++++++++++++++++++++++ manifest.json | 2 +- 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Source/Minimap/AlternateBiomeLabel.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 828a3cc..6e4dae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.100 + +- Append active alternate biome names to the biome label beside the small minimap. The local `[Minimap] ShowAlternateBiomeName` setting defaults to true. + ## 0.1.99 - Fix tombstone access in local games and for the host of a multiplayer game. Reset locally delivered message data before reading requests and access decisions. diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 8b3bdd5..476bd1c 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.99")] -[assembly: AssemblyFileVersion("0.1.99")] +[assembly: AssemblyVersion("0.1.100")] +[assembly: AssemblyFileVersion("0.1.100")] diff --git a/README.md b/README.md index e07c9aa..2b455c4 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ PraetorisClient is the shared client-and-server mod for Praetoris-specific gamep #### World and display changes +- Shows active alternate biome names beside the small minimap, for example `Meadows (Mushroom)`. Set `[Minimap] ShowAlternateBiomeName = false` in `warpalicious.PraetorisClient.cfg` to disable it. This local setting defaults to true. Restart the game if your system does not reload the file change. - Automatically marks your ordinary wards on both maps with a banded shield icon. Includes disabled and distant wards, but excludes wards built by other players and special network or creature wards. - Refreshes ward pins automatically, including after destruction or reconnecting. These pins are not shared through the cartography table or saved as manual pins. Requires the updated mod on the server and client. See [ward map pin behavior and validation](docs/ward-map-pins.md). - Prevents building in selected Hildir locations, crypts, caves, and Mistlands Dvergr entrances. diff --git a/Source/Core/Plugin.cs b/Source/Core/Plugin.cs index e454b4e..74c5384 100644 --- a/Source/Core/Plugin.cs +++ b/Source/Core/Plugin.cs @@ -31,7 +31,7 @@ namespace PraetorisClient public class PraetorisClientPlugin : BaseUnityPlugin { private const string ModName = "PraetorisClient"; - private const string ModVersion = "0.1.99"; + private const string ModVersion = "0.1.100"; private const string Author = "warpalicious"; private const string ModGUID = Author + "." + ModName; private const string EpicLootGuid = "randyknapp.mods.epicloot"; @@ -79,6 +79,7 @@ public class PraetorisClientPlugin : BaseUnityPlugin internal static ConfigEntry TombstoneAdminAccessEnabled = null!; internal static ConfigEntry TombstoneGroupAccessEnabled = null!; internal static ConfigEntry AllowGroupTombstoneAccess = null!; + internal static ConfigEntry ShowAlternateBiomeName = null!; internal static ConfigEntry SpawnTempleTrophiesEnabled = null!; internal static ConfigEntry SpawnIslandWardsEnabled = null!; internal static ConfigEntry SpawnIslandWardBoundary = null!; @@ -315,6 +316,7 @@ private void BindConfig() MeasurementDisableNetworkMetrics = Config.Bind("Measurement", "DisableNetworkMetrics", false, "Local measurement override. When true, disables PraetorisClient RPC probe and socket metric capture even if synced config enables it."); MeasurementDisableNetworkMetricHttpUpload = Config.Bind("Measurement", "DisableNetworkMetricHttpUpload", false, "Local measurement override. When true, keeps network metrics on disk and does not upload them over HTTP."); DisableBoatWaterImpactDamage = Config.Bind("Ships", "DisableBoatWaterImpactDamage", true, SyncedDescription("Prevents boats from losing health when Valheim's water-force impact handling applies boat impact damage. Other boat damage sources still apply normally.")); + ShowAlternateBiomeName = Config.Bind("Minimap", "ShowAlternateBiomeName", true, "Append active alternate biome names to the biome label beside the small minimap. This is a local display setting."); TombstoneOwnerAccessEnabled = Config.Bind("Tombstones", "OwnerAccessOnly", true, SyncedDescription("Restricts tombstone access to its creator and enabled exceptions. Install PraetorisClient on the server and all clients. Remove the old Expand World Prefabs tombstone restriction script when enabling this feature.")); TombstoneAdminAccessEnabled = Config.Bind("Tombstones", "AdminAccess", true, SyncedDescription("Allows authenticated server administrators to access any tombstone.")); TombstoneGroupAccessEnabled = Config.Bind("Tombstones", "GroupAccess", true, SyncedDescription("Allows group access when the tombstone creator enables AllowGroupTombstoneAccess. Checks current Smoothbrain Groups membership when a player accesses a tombstone. Both players must be connected and confirm membership.")); diff --git a/Source/Minimap/AlternateBiomeLabel.cs b/Source/Minimap/AlternateBiomeLabel.cs new file mode 100644 index 0000000..09777ab --- /dev/null +++ b/Source/Minimap/AlternateBiomeLabel.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using HarmonyLib; + +namespace PraetorisClient.Map +{ + [HarmonyPatch(typeof(Minimap), "UpdateBiome")] + internal static class AlternateBiomeLabel + { + [HarmonyPriority(Priority.Last)] + private static void Postfix(Minimap __instance, Player player) + { + if (__instance.m_mode != Minimap.MapMode.Small || player == null) return; + + BiomeSector sector = player.GetCurrentBiomeData(); + if (sector == null) return; + + string label = sector.GetName(); + if (PraetorisClientPlugin.ShowAlternateBiomeName.Value && sector.AltBiomes.Count > 0) + { + List names = new List(); + foreach (AltBiome biome in sector.AltBiomes) + { + if (biome == null || string.IsNullOrWhiteSpace(biome.m_name)) continue; + string name = Localization.instance.Localize(biome.m_name).Trim(); + if (name.Length > 0 && !names.Contains(name)) names.Add(name); + } + if (names.Count > 0) label += " (" + string.Join(", ", names) + ")"; + } + + // Rebuild from the game's biome name so toggling the setting removes the suffix. + if (__instance.m_biomeNameSmall.text != label) __instance.m_biomeNameSmall.text = label; + } + } +} diff --git a/manifest.json b/manifest.json index 3293a0c..1e4c606 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "PraetorisClient", "description": "Client-side Praetoris tools for Discord linking, creative server bridges, RPC tracing, socket metrics, and RPC probes.", - "version_number": "0.1.99", + "version_number": "0.1.100", "website_url": "https://discord.gg/3aaru2VyHJ", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", From 40151b1960b0125e83659a414196f25aea147be0 Mon Sep 17 00:00:00 2001 From: jneb802 <73610029+jneb802@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:01:12 -0700 Subject: [PATCH 2/2] Keep wrapped biome labels inside the minimap border --- CHANGELOG.md | 1 + Source/Minimap/AlternateBiomeLabel.cs | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4dae6..594f7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.1.100 - Append active alternate biome names to the biome label beside the small minimap. The local `[Minimap] ShowAlternateBiomeName` setting defaults to true. +- Align alternate biome labels to the top so wrapped lines extend down inside the minimap border. Preserve the normal label alignment when no alternate name is shown. ## 0.1.99 diff --git a/Source/Minimap/AlternateBiomeLabel.cs b/Source/Minimap/AlternateBiomeLabel.cs index 09777ab..f82f1e0 100644 --- a/Source/Minimap/AlternateBiomeLabel.cs +++ b/Source/Minimap/AlternateBiomeLabel.cs @@ -1,11 +1,15 @@ using System.Collections.Generic; using HarmonyLib; +using TMPro; namespace PraetorisClient.Map { [HarmonyPatch(typeof(Minimap), "UpdateBiome")] internal static class AlternateBiomeLabel { + private static TMP_Text? _label; + private static VerticalAlignmentOptions _originalVerticalAlignment; + [HarmonyPriority(Priority.Last)] private static void Postfix(Minimap __instance, Player player) { @@ -14,7 +18,15 @@ private static void Postfix(Minimap __instance, Player player) BiomeSector sector = player.GetCurrentBiomeData(); if (sector == null) return; + TMP_Text text = __instance.m_biomeNameSmall; + if (_label != text) + { + _label = text; + _originalVerticalAlignment = text.verticalAlignment; + } + string label = sector.GetName(); + bool hasAlternateName = false; if (PraetorisClientPlugin.ShowAlternateBiomeName.Value && sector.AltBiomes.Count > 0) { List names = new List(); @@ -24,11 +36,17 @@ private static void Postfix(Minimap __instance, Player player) string name = Localization.instance.Localize(biome.m_name).Trim(); if (name.Length > 0 && !names.Contains(name)) names.Add(name); } - if (names.Count > 0) label += " (" + string.Join(", ", names) + ")"; + if (names.Count > 0) + { + label += " (" + string.Join(", ", names) + ")"; + hasAlternateName = true; + } } + // Keep the first line inside the map; wrapped lines must extend downward. + text.verticalAlignment = hasAlternateName ? VerticalAlignmentOptions.Top : _originalVerticalAlignment; // Rebuild from the game's biome name so toggling the setting removes the suffix. - if (__instance.m_biomeNameSmall.text != label) __instance.m_biomeNameSmall.text = label; + if (text.text != label) text.text = label; } } }