Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 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

- 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.
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -79,6 +79,7 @@ public class PraetorisClientPlugin : BaseUnityPlugin
internal static ConfigEntry<bool> TombstoneAdminAccessEnabled = null!;
internal static ConfigEntry<bool> TombstoneGroupAccessEnabled = null!;
internal static ConfigEntry<bool> AllowGroupTombstoneAccess = null!;
internal static ConfigEntry<bool> ShowAlternateBiomeName = null!;
internal static ConfigEntry<bool> SpawnTempleTrophiesEnabled = null!;
internal static ConfigEntry<bool> SpawnIslandWardsEnabled = null!;
internal static ConfigEntry<string> SpawnIslandWardBoundary = null!;
Expand Down Expand Up @@ -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."));
Expand Down
52 changes: 52 additions & 0 deletions Source/Minimap/AlternateBiomeLabel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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)
{
if (__instance.m_mode != Minimap.MapMode.Small || player == null) return;

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<string> names = new List<string>();
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) + ")";
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 (text.text != label) text.text = label;
}
}
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading