using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using TMPro;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DetailedLevels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DetailedLevels")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f302fe77-1481-495a-84b9-5ba829a4cf2b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DetailedLevels;
[BepInPlugin("Turbero.DetailedLevels", "Detailed Levels", "1.0.0")]
public class DetailedLevels : BaseUnityPlugin
{
[HarmonyPatch(typeof(SkillsDialog), "Setup")]
private class SkillValue_Patch
{
private static void Postfix(ref Player player, ref List<GameObject> ___m_elements)
{
List<Skill> skillList = ((Character)player).GetSkills().GetSkillList();
for (int i = 0; i < skillList.Count; i++)
{
GameObject val = ___m_elements[i];
Skill val2 = skillList[i];
if (val2.m_accumulator > 0f)
{
float levelPercentage = val2.GetLevelPercentage();
double num = Math.Round(val2.m_level);
double num2 = Math.Round(num + (double)levelPercentage, 2);
((Component)Utils.FindChild(val.transform, "leveltext", (IterativeSearchType)0)).GetComponent<TMP_Text>().text = num2.ToString();
}
}
}
}
private readonly Harmony harmony = new Harmony("Turbero.DetailedLevels");
private void Awake()
{
harmony.PatchAll();
}
}