diff --git a/MxValheim/KillFeed/Patch.cs b/MxValheim/KillFeed/Patch.cs
index 64f37c1..c3131d6 100644
--- a/MxValheim/KillFeed/Patch.cs
+++ b/MxValheim/KillFeed/Patch.cs
@@ -2,8 +2,10 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection.Emit;
using System.Threading;
+using TMPro;
using UnityEngine;
using UnityEngine.Diagnostics;
using UnityEngine.UI;
@@ -25,6 +27,7 @@ namespace MxValheim.KillFeed
{
ZNet zn = new ZNet();
if (zn.IsDedicated()) return;
+ if (attacker == "The World") return;
float distance = (encodedType / 1000) / 10.0f;
int remainder = encodedType % 1000;
@@ -42,11 +45,48 @@ namespace MxValheim.KillFeed
if (c != null) localizedVictim = c.m_name;
}
- if (attacker == "The World") return;
+ // Message Format Variables
+ string type1Separator = " a été tué par ";
+ string type2Separator = " a tué ";
+ string finalMsg = "";
+ string attackerFormat = "";
+ string victimFormat = "";
+ string distanceFormat = "";
+ string starFormat = "";
+ // Format Message in Divided Section
+ starFormat = "★";
+ attackerFormat = $"{attacker.ToUpper()}";
+ if(type == 1)
+ {
+ victimFormat = $"{victim.ToUpper()}";
+ } else if(type == 2)
+ {
+ switch (level)
+ {
+ case 1:
+ victimFormat = $"{victim.ToUpper()}";
+ break;
+ case 2:
+ victimFormat = $"{starFormat} {victim.ToUpper()}";
+ break;
+ case 3:
+ victimFormat = $"{starFormat}{starFormat} {victim.ToUpper()}";
+ break;
+ case 4:
+ victimFormat = $"{starFormat}{starFormat}{starFormat} {victim.ToUpper()}";
+ break;
+ }
+ }
+ distanceFormat = $" à {distance:F1}m de distance.";
- string finalMsg = (type == 1) ? $"☠ {victim.ToUpper()} a été tué par {attacker.ToUpper()} à {distance:F1}m de distance." :
+ finalMsg =
+ (type == 1) ? $"{victimFormat}{type1Separator}{attackerFormat}{distanceFormat}":
+ (type == 2) ? $"{attackerFormat}{type2Separator}{victimFormat}{distanceFormat}" :
+ $"{attackerFormat}{type2Separator}{victimFormat}{distanceFormat}";
+
+ /*string finalMsg = (type == 1) ? $"☠ {victim.ToUpper()} a été tué par {attacker.ToUpper()} à {distance:F1}m de distance." :
(type == 2) ? $"{attacker.ToUpper()} a tué {victim.ToUpper()} à {distance:F1}m de distance." :
- $"{attacker.ToUpper()} a tué {victim.ToUpper()} à {distance:F1}m de distance.";
+ $"{attacker.ToUpper()} a tué {victim.ToUpper()} à {distance:F1}m de distance.";*/
Sprite weaponIcon = null;
@@ -137,7 +177,8 @@ namespace MxValheim.KillFeed
// List of common trophies that don't follow the exact pattern if needed
// But for most (Boar, Greyling, Neck, Deer), this works:
- string trophyName = "Trophy" + cleanName;
+ string replace = cleanName.Replace("_","");
+ string trophyName = "Trophy" + replace;
GameObject trophyObj = ObjectDB.instance.GetItemPrefab(trophyName);
if (trophyObj != null)
@@ -349,6 +390,7 @@ namespace MxValheim.KillFeed
_killText.supportRichText = true;
_killText.color = Color.white;
+
// 4. Victim Portrait Slot
GameObject victimObj = new GameObject("VictimIcon", typeof(RectTransform), typeof(Image));
victimObj.transform.SetParent(panel.transform, false);
diff --git a/MxValheim/MxValheim.cs b/MxValheim/MxValheim.cs
index 0e2b83b..54847e1 100644
--- a/MxValheim/MxValheim.cs
+++ b/MxValheim/MxValheim.cs
@@ -6,8 +6,10 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Threading;
using System.Xml;
+using TMPro;
using UnityEngine;
using UnityEngine.UI;
@@ -19,7 +21,7 @@ public class MxValheimMod : BaseUnityPlugin
private const string ModGUID = "ovh.mxdev.mxvalheim";
private const string ModName = "MxValheim";
- private const string ModVersion = "1.5.2";
+ private const string ModVersion = "1.5.3";
public static ConfigEntry Config_Locked;
public static ConfigEntry Config_OreMultiplier;
@@ -77,6 +79,45 @@ public class MxValheimMod : BaseUnityPlugin
harmony.PatchAll();
}
+ // --- TEST COMMAND: Type 'testkill' in F5 console ---
+ [HarmonyPatch(typeof(Terminal), nameof(Terminal.InputText))]
+ public static class ConsoleInputPatch
+ {
+ static void Postfix(Terminal __instance)
+ {
+ string text = __instance.m_input.text;
+ if (text.ToLower() == "listiconsstore")
+ {
+ var spriteAsset = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "store_icons"); ;
+
+ if (spriteAsset != null)
+ {
+ Debug.Log($"--- Listing all sprites in {spriteAsset.name} ---");
+ for (int i = 0; i < spriteAsset.spriteCharacterTable.Count; i++)
+ {
+ var sprite = spriteAsset.spriteCharacterTable[i];
+ Debug.Log($"Index: {i} | Name: {sprite.name}");
+ }
+ }
+ }
+
+ if (text.ToLower() == "listicons")
+ {
+ var spriteAsset = Resources.FindObjectsOfTypeAll().FirstOrDefault(x => x.name == "icons"); ;
+
+ if (spriteAsset != null)
+ {
+ Debug.Log($"--- Listing all sprites in {spriteAsset.name} ---");
+ for (int i = 0; i < spriteAsset.spriteCharacterTable.Count; i++)
+ {
+ var sprite = spriteAsset.spriteCharacterTable[i];
+ Debug.Log($"Index: {i} | Name: {sprite.name}");
+ }
+ }
+ }
+ }
+ }
+
[HarmonyPatch(typeof(Game), nameof(Game.Start))]
public static class GameStartPatch
{