using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DetailedLevels.Features;
using DetailedLevels.Tools;
using HarmonyLib;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
[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
{
public enum SkillsSortOrder
{
None,
AlphabeticalAscending,
AlphabeticalDescending,
LevelAscending,
LevelDescending
}
public enum SkillValuesFormat
{
Decimals,
Percentage
}
public enum KillStatsGroupingFormat
{
ByInitialLetter,
AllTogether
}
public enum SkillBuffValuePosition
{
Above,
Below
}
internal class ConfigurationFile
{
private static ConfigEntry<bool> _serverConfigLocked = null;
public static ConfigEntry<bool> debug;
public static ConfigEntry<KeyCode> hotKey;
public static ConfigEntry<int> numberOfDecimals;
public static ConfigEntry<SkillBuffValuePosition> skillBuffValuePosition;
public static ConfigEntry<int> skillUpMessageAfterMultipleLevel;
public static ConfigEntry<int> skillUpBigMessageAfterMultipleLevel;
public static ConfigEntry<Color> colorSkillBackground;
public static ConfigEntry<bool> saveSkillBuffs;
public static ConfigEntry<bool> saveSkillsOrder;
public static ConfigEntry<SkillsSortOrder> saveSkillsOrderValue;
public static ConfigEntry<SkillValuesFormat> skillValuesFormat;
public static ConfigEntry<KillStatsGroupingFormat> killStatsGroupingFormat;
public static ConfigEntry<string> deathPenaltyText;
public static ConfigEntry<string> reloadAfterDyingText;
public static ConfigEntry<string> skillValuePositionText;
public static ConfigEntry<string> numberOfDecimalsText;
public static ConfigEntry<string> skillValuesFormatText;
public static ConfigEntry<string> skillUpMessageText;
public static ConfigEntry<string> skillUpBigMessageText;
public static ConfigEntry<string> skillUpValueText;
public static ConfigEntry<string> skillsOrderText;
public static ConfigEntry<string> statsText;
public static ConfigEntry<string> statsDeathTypesText;
public static ConfigEntry<string> statsProgressionText;
public static ConfigEntry<string> statsTravellingText;
public static ConfigEntry<string> statsOthersText;
private static ConfigFile configFile;
private static readonly string ConfigFileName = "Turbero.DetailedLevels.cfg";
private static readonly string ConfigFileFullPath;
private static readonly ConfigSync ConfigSync;
internal static void LoadConfig(BaseUnityPlugin plugin)
{
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
configFile = plugin.Config;
_serverConfigLocked = config("1 - General", "Lock Configuration", value: true, "If on, the configuration is locked and can be changed by server admins only.");
ConfigSync.AddLockingConfigEntry<bool>(_serverConfigLocked);
debug = config("1 - General", "DebugMode", value: false, "Enabling/Disabling the debugging in the console (default = false)", synchronizedSetting: false);
hotKey = config<KeyCode>("1 - General", "HotKey", (KeyCode)285, "Hot Key to show the skills tab without opening the inventory first (default = F4)", synchronizedSetting: false);
numberOfDecimals = config("2 - Levels Data", "NumberOfDecimals", 2, "Number of decimals to show in your levels information (default = 2, min = 0, max = 15)", synchronizedSetting: false);
skillBuffValuePosition = config("2 - Levels Data", "Skill Buff Value Position", SkillBuffValuePosition.Below, "Choose the position of the skill value on the buff icon (default = BelowBuffIcon)", synchronizedSetting: false);
skillUpMessageAfterMultipleLevel = config("2 - Levels Data", "SkillUpMessageAfterMultipleLevel", 5, "Shows skill up message after the new level is multiple of the indicated level (0 = disabled, default = 5)", synchronizedSetting: false);
skillUpBigMessageAfterMultipleLevel = config("2 - Levels Data", "SkillUpBigMessageAfterMultipleLevel", 10, "Shows skill up big message after the new level is multiple of the indicated level (0 = disabled, default = 20)", synchronizedSetting: false);
colorSkillBackground = config<Color>("3 - Config", "ColorSkillBackground", Color.cyan, "Choose the color background for selected skills in the skills dialog: red, green, blue, white, black, yellow, cyan, magenta, gray or grey (default = cyan)", synchronizedSetting: false);
saveSkillBuffs = config("3 - Config", "SaveSkillBuffs", value: false, "Enable/disable the option to reload tracked skills after dying (default = false)", synchronizedSetting: false);
saveSkillsOrder = config("3 - Config", "Save Skills Order", value: false, "Enable/disable the option to save the order selected in the skills dialog (default = false)", synchronizedSetting: false);
saveSkillsOrderValue = config("3 - Config", "Skills Order Value", SkillsSortOrder.None, "Skills Order to use when skills dialog is opened and the save option is enabled (default = None)", synchronizedSetting: false);
skillValuesFormat = config("3 - Config", "Skill Values Format", SkillValuesFormat.Decimals, "Show the skill number values with decimals or percentage (default = Decimals)", synchronizedSetting: false);
killStatsGroupingFormat = config("3 - Config", "Kill Stats Grouping Format", KillStatsGroupingFormat.ByInitialLetter, "Show kill stats grouped by initial letter or all together (default = InitialLetter)", synchronizedSetting: false);
deathPenaltyText = config("4 - Language", "DeathPenaltyText", "Death Penalty", "Translation for <Death Penalty> text");
reloadAfterDyingText = config("4 - Language", "ReloadAfterDyingText", "Reload after dying", "Translation for <Reload after dying> text");
skillValuePositionText = config("4 - Language", "SkillValuePositionText", "Skill value position", "Translation for <Skill value position> text");
numberOfDecimalsText = config("4 - Language", "NumberOfDecimalsText", "Number of decimals", "Translation for <Number of decimals> text");
skillValuesFormatText = config("4 - Language", "Skill Values Format Text", "Skill Values Format", "Translation for <Skill Values Format> text");
skillUpMessageText = config("4 - Language", "SkillUpMessageText", "Skill up message", "Translation for <Skill up message> text");
skillUpBigMessageText = config("4 - Language", "SkillUpBigMessageText", "Skill up big message", "Translation for <Skill up big message> text");
skillUpValueText = config("4 - Language", "SkillUpValueText", "Each {0} levels", "Translation for <Each X levels> text");
skillsOrderText = config("4 - Language", "SkillsOrderText", "Save Skills Order", "Translation for <Save Skills Order> text");
statsText = config("4 - Language", "StatsText", "Stats", "Translation for <Stats> text");
statsDeathTypesText = config("4 - Language", "Stats Death Types", "Death Types", "Translation for <Death Types> text (restart game after change)");
statsProgressionText = config("4 - Language", "StatsProgressionText", "Progression", "Translation for <Progression> text (restart game after change)");
statsTravellingText = config("4 - Language", "StatsTravellingText", "Travelling", "Translation for <Travelling> text (restart game after change)");
statsOthersText = config("4 - Language", "StatsOthersText", "Others", "Translation for <Others> text (restart game after change)");
SetupWatcher();
}
private static void SetupWatcher()
{
FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName);
fileSystemWatcher.Changed += ReadConfigValues;
fileSystemWatcher.Created += ReadConfigValues;
fileSystemWatcher.Renamed += ReadConfigValues;
fileSystemWatcher.IncludeSubdirectories = true;
fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
fileSystemWatcher.EnableRaisingEvents = true;
}
private static void ReadConfigValues(object sender, FileSystemEventArgs e)
{
if (!File.Exists(ConfigFileFullPath))
{
return;
}
try
{
Logger.Log("Attempting to reload configuration...");
configFile.Reload();
SettingsChanged(null, null);
}
catch (Exception arg)
{
Logger.LogError($"There was an issue loading {ConfigFileName}, {arg}");
}
}
private static void SettingsChanged(object sender, EventArgs e)
{
PlayerSkillupOptionsPatch.updateOptionsTexts();
PlayerSkillupOptionsPatch.reloadTexts();
SkillTypeCraftStationDescriptionsPatch.updated = false;
if (!((Object)(object)Player.m_localPlayer != (Object)null))
{
return;
}
PlayerColorBuffs.refreshAllBlueColors(Player.m_localPlayer);
foreach (KeyValuePair<SkillType, int> skillStatusEffect in PlayerUtils.skillStatusEffects)
{
if (((Character)Player.m_localPlayer).GetSEMan().GetStatusEffect(skillStatusEffect.Value) is SE_SkillBuff sE_SkillBuff)
{
sE_SkillBuff.Refresh();
}
}
}
private static ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting);
}
private static ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
ConfigEntry<T> val2 = configFile.Bind<T>(group, name, value, val);
SyncedConfigEntry<T> syncedConfigEntry = ConfigSync.AddConfigEntry<T>(val2);
syncedConfigEntry.SynchronizedConfig = synchronizedSetting;
return val2;
}
static ConfigurationFile()
{
string configPath = Paths.ConfigPath;
char directorySeparatorChar = Path.DirectorySeparatorChar;
ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName;
ConfigSync = new ConfigSync("Turbero.DetailedLevels")
{
DisplayName = "Detailed Levels",
CurrentVersion = "2.0.1",
MinimumRequiredVersion = "2.0.1"
};
}
}
public class ControllerUtils
{
public static void BindGamePad(Transform buttonGo, KeyCode gamepadKeyCode, InventoryGui inventoryGui = null)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
UIGamePad val = null;
if (((Component)buttonGo).TryGetComponent<UIGamePad>(ref val))
{
string text = KeyCodeToString(gamepadKeyCode);
if (ZInput.instance != null)
{
((TMP_Text)val.m_hint.GetComponentInChildren<TextMeshProUGUI>(true)).text = ZInput.instance.GetBoundKeyString(text, true);
}
else
{
ZInput.Initialize();
TextMeshProUGUI componentInChildren = val.m_hint.GetComponentInChildren<TextMeshProUGUI>(true);
ZInput instance = ZInput.instance;
((TMP_Text)componentInChildren).text = ((instance != null) ? instance.GetBoundKeyString(text, true) : null);
}
val.m_zinputKey = text;
val.m_keyCode = gamepadKeyCode;
UIGroupHandler value = default(UIGroupHandler);
if ((Object)(object)inventoryGui != (Object)null && ((Component)inventoryGui.m_crafting).TryGetComponent<UIGroupHandler>(ref value))
{
SetPrivateValue(val, "m_group", value);
}
}
}
private static void SetPrivateValue(object obj, string name, object value, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
{
obj.GetType().GetField(name, bindingAttr)?.SetValue(obj, value);
}
public static string KeyCodeToString(KeyCode keyCode)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Expected I4, but got Unknown
int num = keyCode - 330;
if (1 == 0)
{
}
string result = num switch
{
1 => "JoyButtonB",
2 => "JoyButtonX",
3 => "JoyButtonY",
4 => "JoyLBumper",
5 => "JoyRBumper",
6 => "JoyBack",
7 => "JoyStart",
8 => "JoyLStick",
9 => "JoyRStick",
10 => "JoyDPadLeft",
11 => "JoyDPadRight",
12 => "JoyDPadUp",
13 => "JoyDPadDown",
14 => "JoyLTrigger",
15 => "JoyRTrigger",
16 => "JoyButtonA",
17 => "JoyButtonB",
18 => "JoyButtonX",
19 => "JoyButtonY",
_ => "JoyButtonA",
};
if (1 == 0)
{
}
return result;
}
}
public class ReflectionUtils
{
public static object GetPrivateValue(object obj, string name, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
{
return obj.GetType().GetField(name, bindingAttr)?.GetValue(obj);
}
public static void SetPrivateValue(object obj, string name, object value, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
{
obj.GetType().GetField(name, bindingAttr)?.SetValue(obj, value);
}
public static object GetPrivateMethod(object obj, string name, object[] parameters = null, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
{
return obj.GetType().GetMethod(name, bindingAttr)?.Invoke(obj, parameters);
}
public static void RunPrivateMethod(object obj, string name, object[] parameters = null, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
{
obj.GetType().GetMethod(name, bindingAttr)?.Invoke(obj, parameters);
}
}
[BepInPlugin("Turbero.DetailedLevels", "Detailed Levels", "2.0.1")]
public class DetailedLevels : BaseUnityPlugin
{
public const string GUID = "Turbero.DetailedLevels";
public const string NAME = "Detailed Levels";
public const string VERSION = "2.0.1";
private readonly Harmony harmony = new Harmony("Turbero.DetailedLevels");
private void Awake()
{
ConfigurationFile.LoadConfig((BaseUnityPlugin)(object)this);
harmony.PatchAll();
}
private void onDestroy()
{
harmony.UnpatchSelf();
}
private void Update()
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)Player.m_localPlayer) || !Object.op_Implicit((Object)(object)InventoryGui.instance))
{
return;
}
if (Input.GetKeyDown((KeyCode)27) || Input.GetKeyDown((KeyCode)9) || ((Character)Player.m_localPlayer).IsDead())
{
hideCustomPanelAndSkillsDialog();
}
if (Input.GetKeyDown(ConfigurationFile.hotKey.Value) && Time.timeScale > 0f)
{
if (((Component)InventoryGui.instance.m_skillsDialog).gameObject.activeSelf)
{
hideCustomPanelAndSkillsDialog();
InventoryGui.instance.Hide();
}
else
{
InventoryGui.instance.Show((Container)null, 1);
WaitForSecondsAsync(0.15f);
}
}
}
private static void hideCustomPanelAndSkillsDialog()
{
if (!((Object)(object)InventoryGui.instance.m_skillsDialog == (Object)null))
{
((Component)InventoryGui.instance.m_skillsDialog).gameObject.SetActive(false);
if (!((Object)(object)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/CustomSkillOptionsPanel") == (Object)null))
{
((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/CustomSkillOptionsPanel")).gameObject.SetActive(false);
((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("TabStatsButton")).gameObject.SetActive(false);
((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("TabKillStatsButton")).gameObject.SetActive(false);
}
}
}
private static async Task WaitForSecondsAsync(float seconds)
{
await Task.Delay((int)(Math.Max(0f, seconds) * 1000f));
InventoryGui.instance.m_skillsDialog.Setup(Player.m_localPlayer);
((Component)InventoryGui.instance.m_skillsDialog).gameObject.SetActive(true);
}
}
[HarmonyPatch]
public class NoWarnings
{
[HarmonyPatch(typeof(Debug), "LogWarning", new Type[]
{
typeof(object),
typeof(Object)
})]
[HarmonyPrefix]
private static bool LogWarning(object message, Object context)
{
if (message.ToString().Contains("The LiberationSans SDF Font Asset was not found") || message.ToString().Contains("The character used for Ellipsis is not available in font asset") || message.ToString().Contains("lacks a proper counterpart in the GamepadButton enum"))
{
return false;
}
return true;
}
}
[HarmonyPatch(typeof(Localization), "SetLanguage")]
public class Localization_SetLanguage_Patch
{
private static void Postfix(string language)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
Logger.Log("Language changed to: " + language);
foreach (SkillType key in PlayerUtils.skillStatusEffects.Keys)
{
int valueSafe = GeneralExtensions.GetValueSafe<SkillType, int>(PlayerUtils.skillStatusEffects, key);
Player_RaiseSkill_Patch.updateSkillTypeBuff(Player.m_localPlayer, key, valueSafe, forceUpdate: true);
}
}
}
public static class Logger
{
public static ManualLogSource logger = Logger.CreateLogSource("Detailed Levels");
internal static void Log(object s)
{
if (ConfigurationFile.debug.Value)
{
logger.LogInfo((object)s?.ToString());
}
}
internal static void LogInfo(object s)
{
logger.LogInfo((object)s?.ToString());
}
internal static void LogWarning(object s)
{
string text = "Detailed Levels 2.0.1: " + ((s != null) ? s.ToString() : "null");
Debug.LogWarning((object)text);
}
internal static void LogError(object s)
{
string text = "Detailed Levels 2.0.1: " + ((s != null) ? s.ToString() : "null");
Debug.LogError((object)text);
}
}
}
namespace DetailedLevels.Tools
{
public class CustomSkillOptionsPanel
{
private GameObject panel;
private TextMeshProUGUI titleText;
private TMP_Text buttonText;
public CustomSkillOptionsPanel(Transform copyForCloseButton)
{
Init(copyForCloseButton);
}
private void Init(Transform copyForCloseButton)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Expected O, but got Unknown
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Expected O, but got Unknown
Transform transform = ((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame")).transform;
panel = new GameObject("CustomSkillOptionsPanel", new Type[1] { typeof(RectTransform) });
panel.SetActive(false);
panel.transform.SetParent(transform, false);
RectTransform component = panel.GetComponent<RectTransform>();
component.sizeDelta = new Vector2(512f, 512f);
component.anchoredPosition = new Vector2(0f, 0f);
Image component2 = ((Component)transform.Find("bkg")).GetComponent<Image>();
Image val = Object.Instantiate<Image>(component2, panel.transform);
((Object)val).name = "bkg_customskills";
GameObject gameObject = ((Component)transform.Find("topic")).gameObject;
GameObject val2 = Object.Instantiate<GameObject>(gameObject, panel.transform);
((Object)val2).name = "Title";
titleText = val2.GetComponent<TextMeshProUGUI>();
((TMP_Text)titleText).text = Localization.instance.Localize("$button_ps_start");
RectTransform component3 = val2.GetComponent<RectTransform>();
component3.anchoredPosition = new Vector2(0f, -30f);
Transform val3 = ((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton");
GameObject val4 = Object.Instantiate<GameObject>(((Component)val3).gameObject, copyForCloseButton);
((Object)val4).name = "DLOptionsCloseButton";
val4.transform.SetParent(panel.transform, false);
ControllerUtils.BindGamePad(val4.transform, (KeyCode)332, InventoryGui.instance);
RectTransform component4 = val4.GetComponent<RectTransform>();
component4.anchoredPosition = new Vector2(0f, 40f);
buttonText = val4.GetComponentInChildren<TMP_Text>();
Button component5 = val4.GetComponent<Button>();
component5.onClick = new ButtonClickedEvent();
((UnityEvent)component5.onClick).AddListener((UnityAction)delegate
{
panel.SetActive(false);
InventoryGui.instance.m_skillsDialog.Setup(Player.m_localPlayer);
});
reloadTexts();
}
public GameObject getPanel()
{
if ((Object)(object)panel == (Object)null)
{
Logger.Log("Recreating gameObject panel...");
Transform val = ((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton");
Button component = ((Component)val).GetComponent<Button>();
Init(((Component)component).transform.parent);
Logger.Log("gameObject panel recreated.");
}
return panel;
}
public void reloadTexts()
{
((TMP_Text)titleText).text = Localization.instance.Localize("$button_ps_start");
buttonText.text = Localization.instance.Localize("$menu_close");
}
}
public class CustomSlider
{
private readonly GameObject sliderObject;
private readonly Slider slider;
private readonly TextMeshProUGUI sliderValue;
public TextMeshProUGUI sliderLabelDescription;
public CustomSlider(string name, int maxValue, Vector2 sizeDelta, Vector2 position, int posXIcon, string spriteName, int posXDescription, string description, int posXValue, int initValue, string valueDesc)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Expected O, but got Unknown
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Expected O, but got Unknown
//IL_021e: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_029c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Expected O, but got Unknown
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Expected O, but got Unknown
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_037d: Unknown result type (might be due to invalid IL or missing references)
//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
//IL_03c4: Expected O, but got Unknown
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0486: Unknown result type (might be due to invalid IL or missing references)
//IL_048d: Expected O, but got Unknown
//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
sliderObject = new GameObject(name, new Type[1] { typeof(RectTransform) });
RectTransform component = sliderObject.GetComponent<RectTransform>();
component.sizeDelta = sizeDelta;
component.anchoredPosition = position;
slider = sliderObject.AddComponent<Slider>();
((Object)slider).name = name;
slider.minValue = 0f;
slider.maxValue = maxValue;
slider.value = initValue;
ReflectionUtils.SetPrivateValue(slider, "m_WholeNumbers", true);
GameObject val = new GameObject("Background", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val.transform.SetParent(sliderObject.transform, false);
RectTransform component2 = val.GetComponent<RectTransform>();
component2.anchorMin = new Vector2(0f, 0f);
component2.anchorMax = new Vector2(1f, 1f);
component2.sizeDelta = new Vector2(0f, 0f);
((Graphic)val.GetComponent<Image>()).color = Color.gray;
GameObject val2 = new GameObject("Fill Area", new Type[1] { typeof(RectTransform) });
val2.transform.SetParent(sliderObject.transform, false);
RectTransform component3 = val2.GetComponent<RectTransform>();
component3.anchorMin = new Vector2(0f, 0.25f);
component3.anchorMax = new Vector2(1f, 0.75f);
component3.sizeDelta = new Vector2(0f, 0f);
GameObject val3 = new GameObject("Fill", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val3.transform.SetParent(val2.transform, false);
RectTransform component4 = val3.GetComponent<RectTransform>();
component4.anchorMin = new Vector2(0f, 0f);
component4.anchorMax = new Vector2(1f, 1f);
component4.sizeDelta = new Vector2(0f, 0f);
((Graphic)val3.GetComponent<Image>()).color = Color.green;
slider.fillRect = component4;
GameObject val4 = new GameObject("Handle", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val4.transform.SetParent(sliderObject.transform, false);
RectTransform component5 = val4.GetComponent<RectTransform>();
component5.sizeDelta = new Vector2(10f, 10f);
((Graphic)val4.GetComponent<Image>()).color = Color.white;
((Selectable)slider).targetGraphic = (Graphic)(object)val4.GetComponent<Image>();
slider.handleRect = component5;
if (spriteName != null)
{
GameObject val5 = new GameObject("Icon");
Image val6 = val5.AddComponent<Image>();
val6.sprite = PlayerUtils.getSprite(spriteName);
RectTransform component6 = val5.GetComponent<RectTransform>();
((Transform)component6).SetParent(sliderObject.transform, false);
component6.sizeDelta = new Vector2(25f, 25f);
component6.anchoredPosition = new Vector2((float)posXIcon, 0f);
}
if (description != null)
{
GameObject val7 = new GameObject("SliderLabel", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val7.transform.SetParent(sliderObject.transform, false);
RectTransform component7 = val7.GetComponent<RectTransform>();
component7.anchoredPosition = new Vector2((float)posXDescription, 0f);
sliderLabelDescription = val7.GetComponent<TextMeshProUGUI>();
((TMP_Text)sliderLabelDescription).text = description;
((TMP_Text)sliderLabelDescription).fontSize = 18f;
((TMP_Text)sliderLabelDescription).alignment = (TextAlignmentOptions)516;
((TMP_Text)sliderLabelDescription).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
}
if (initValue >= 0)
{
GameObject val8 = new GameObject("SliderValue", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val8.transform.SetParent(sliderObject.transform, false);
RectTransform component8 = val8.GetComponent<RectTransform>();
component8.anchoredPosition = new Vector2((float)posXValue, 0f);
sliderValue = val8.GetComponent<TextMeshProUGUI>();
((TMP_Text)sliderValue).fontSize = 18f;
((TMP_Text)sliderValue).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
((TMP_Text)sliderValue).alignment = (TextAlignmentOptions)513;
((TMP_Text)sliderValue).text = valueDesc;
}
}
public GameObject getGameObject()
{
return sliderObject;
}
public void OnValueChanged(UnityAction<float> call)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
slider.onValueChanged = new SliderEvent();
((UnityEvent<float>)(object)slider.onValueChanged).AddListener(call);
}
public void updateTextValue(string value)
{
((TMP_Text)sliderValue).text = value;
}
public void updateValue(float value)
{
slider.value = value;
}
public float getValue()
{
return slider.value;
}
}
public class CustomStatsPanel
{
private readonly GameObject panel;
private readonly TextMeshProUGUI statsTopicText;
private readonly CustomStatsPanelScroll scrollPanel;
public CustomStatsPanel()
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Expected O, but got Unknown
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Expected O, but got Unknown
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_0342: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0414: Unknown result type (might be due to invalid IL or missing references)
//IL_0446: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Unknown result type (might be due to invalid IL or missing references)
//IL_0488: Unknown result type (might be due to invalid IL or missing references)
//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0517: Unknown result type (might be due to invalid IL or missing references)
//IL_0538: Unknown result type (might be due to invalid IL or missing references)
//IL_0559: Unknown result type (might be due to invalid IL or missing references)
//IL_058b: Unknown result type (might be due to invalid IL or missing references)
//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
//IL_060f: Unknown result type (might be due to invalid IL or missing references)
//IL_0641: Unknown result type (might be due to invalid IL or missing references)
//IL_0662: Unknown result type (might be due to invalid IL or missing references)
//IL_0683: Unknown result type (might be due to invalid IL or missing references)
//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0718: Unknown result type (might be due to invalid IL or missing references)
//IL_0739: Unknown result type (might be due to invalid IL or missing references)
//IL_0786: Unknown result type (might be due to invalid IL or missing references)
//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
//IL_081b: Unknown result type (might be due to invalid IL or missing references)
//IL_083c: Unknown result type (might be due to invalid IL or missing references)
//IL_085d: Unknown result type (might be due to invalid IL or missing references)
//IL_087e: Unknown result type (might be due to invalid IL or missing references)
//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0913: Unknown result type (might be due to invalid IL or missing references)
//IL_0945: Unknown result type (might be due to invalid IL or missing references)
//IL_0966: Unknown result type (might be due to invalid IL or missing references)
//IL_0987: Unknown result type (might be due to invalid IL or missing references)
//IL_09a8: Unknown result type (might be due to invalid IL or missing references)
//IL_09da: Unknown result type (might be due to invalid IL or missing references)
//IL_09fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a8a: Unknown result type (might be due to invalid IL or missing references)
//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
//IL_0b2e: Unknown result type (might be due to invalid IL or missing references)
//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
//IL_0b91: Unknown result type (might be due to invalid IL or missing references)
//IL_0bba: Unknown result type (might be due to invalid IL or missing references)
//IL_0bda: Unknown result type (might be due to invalid IL or missing references)
//IL_0c0b: Unknown result type (might be due to invalid IL or missing references)
//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb6: Unknown result type (might be due to invalid IL or missing references)
//IL_0cd7: Unknown result type (might be due to invalid IL or missing references)
//IL_0cf8: Unknown result type (might be due to invalid IL or missing references)
//IL_0d19: Unknown result type (might be due to invalid IL or missing references)
//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8d: Unknown result type (might be due to invalid IL or missing references)
//IL_0dae: Unknown result type (might be due to invalid IL or missing references)
//IL_0dcf: Unknown result type (might be due to invalid IL or missing references)
//IL_0e01: Unknown result type (might be due to invalid IL or missing references)
//IL_0e22: Unknown result type (might be due to invalid IL or missing references)
//IL_0e43: Unknown result type (might be due to invalid IL or missing references)
//IL_0e64: Unknown result type (might be due to invalid IL or missing references)
//IL_0e85: Unknown result type (might be due to invalid IL or missing references)
//IL_0eb7: Unknown result type (might be due to invalid IL or missing references)
//IL_0ed8: Unknown result type (might be due to invalid IL or missing references)
//IL_0ef9: Unknown result type (might be due to invalid IL or missing references)
//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
//IL_0f4c: Unknown result type (might be due to invalid IL or missing references)
//IL_0f6d: Unknown result type (might be due to invalid IL or missing references)
//IL_0f8e: Unknown result type (might be due to invalid IL or missing references)
//IL_0faf: Unknown result type (might be due to invalid IL or missing references)
//IL_0ff6: Unknown result type (might be due to invalid IL or missing references)
//IL_1015: Unknown result type (might be due to invalid IL or missing references)
//IL_1035: Unknown result type (might be due to invalid IL or missing references)
//IL_1056: Unknown result type (might be due to invalid IL or missing references)
//IL_1088: Unknown result type (might be due to invalid IL or missing references)
//IL_10a9: Unknown result type (might be due to invalid IL or missing references)
//IL_10db: Unknown result type (might be due to invalid IL or missing references)
//IL_10fc: Unknown result type (might be due to invalid IL or missing references)
//IL_111d: Unknown result type (might be due to invalid IL or missing references)
//IL_114f: Unknown result type (might be due to invalid IL or missing references)
//IL_1170: Unknown result type (might be due to invalid IL or missing references)
//IL_1191: Unknown result type (might be due to invalid IL or missing references)
//IL_11b2: Unknown result type (might be due to invalid IL or missing references)
//IL_11ff: Unknown result type (might be due to invalid IL or missing references)
//IL_1220: Unknown result type (might be due to invalid IL or missing references)
GameObject trophiesPanel = InventoryGui.instance.m_trophiesPanel;
if (!((Object)(object)trophiesPanel == (Object)null))
{
SkillsDialog skillsDialog = InventoryGui.instance.m_skillsDialog;
panel = Object.Instantiate<GameObject>(trophiesPanel, ((Component)skillsDialog).transform);
((Object)panel).name = "PlayerStatsFrame";
panel.SetActive(false);
RectTransform component = panel.GetComponent<RectTransform>();
component.anchoredPosition = new Vector2(0f, 0f);
((Object)panel.transform.Find("TrophiesFrame")).name = "MainFrame";
Transform val = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/topic");
statsTopicText = ((Component)val).GetComponent<TextMeshProUGUI>();
((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Trophies")).name = "Stats";
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyListScroll")).name = "StatsListScroll";
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyList")).name = "StatList";
Transform val2 = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Closebutton");
ControllerUtils.BindGamePad(val2, (KeyCode)332, InventoryGui.instance);
Button component2 = ((Component)val2).GetComponent<Button>();
component2.onClick = new ButtonClickedEvent();
((UnityEvent)component2.onClick).AddListener((UnityAction)delegate
{
Logger.Log("statsCloseButtonButton clicked.");
panel.SetActive(false);
PlayerSkillupOptionsPatch.HideTabButtons();
});
scrollPanel = new CustomStatsPanelScroll(((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/StatList"));
Dictionary<PlayerStatType, float> playerDictionaryStats = getPlayerDictionaryStats();
CustomStatsPanelScroll customStatsPanelScroll = scrollPanel;
Dictionary<string, float> dictionary = new Dictionary<string, float>();
PlayerStatType val3 = (PlayerStatType)26;
dictionary.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)26));
val3 = (PlayerStatType)4;
dictionary.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)4));
customStatsPanelScroll.AddRowToScrollList(dictionary);
scrollPanel.AddHeaderToScrollList("$menu_combat", (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll2 = scrollPanel;
Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
val3 = (PlayerStatType)0;
dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)0));
val3 = (PlayerStatType)10;
dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)10));
val3 = (PlayerStatType)11;
dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)11));
val3 = (PlayerStatType)51;
dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)51));
val3 = (PlayerStatType)50;
dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)50));
customStatsPanelScroll2.AddRowToScrollList(dictionary2);
CustomStatsPanelScroll customStatsPanelScroll3 = scrollPanel;
Dictionary<string, float> dictionary3 = new Dictionary<string, float>();
val3 = (PlayerStatType)5;
dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)5));
val3 = (PlayerStatType)6;
dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)6));
val3 = (PlayerStatType)7;
dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)7));
val3 = (PlayerStatType)8;
dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)8));
val3 = (PlayerStatType)9;
dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)9));
customStatsPanelScroll3.AddRowToScrollList(dictionary3);
CustomStatsPanelScroll customStatsPanelScroll4 = scrollPanel;
Dictionary<string, float> dictionary4 = new Dictionary<string, float>();
val3 = (PlayerStatType)52;
dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)52));
val3 = (PlayerStatType)53;
dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)53));
val3 = (PlayerStatType)54;
dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)54));
customStatsPanelScroll4.AddRowToScrollList(dictionary4);
CustomStatsPanelScroll customStatsPanelScroll5 = scrollPanel;
Dictionary<string, float> dictionary5 = new Dictionary<string, float>();
val3 = (PlayerStatType)15;
dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)15));
val3 = (PlayerStatType)83;
dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)83));
val3 = (PlayerStatType)84;
dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)84));
customStatsPanelScroll5.AddRowToScrollList(dictionary5);
scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsDeathTypesText.Value, (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll6 = scrollPanel;
Dictionary<string, float> dictionary6 = new Dictionary<string, float>();
val3 = (PlayerStatType)56;
dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)56));
val3 = (PlayerStatType)57;
dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)57));
val3 = (PlayerStatType)58;
dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)58));
val3 = (PlayerStatType)59;
dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)59));
val3 = (PlayerStatType)60;
dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)60));
customStatsPanelScroll6.AddRowToScrollList(dictionary6);
CustomStatsPanelScroll customStatsPanelScroll7 = scrollPanel;
Dictionary<string, float> dictionary7 = new Dictionary<string, float>();
val3 = (PlayerStatType)61;
dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)61));
val3 = (PlayerStatType)62;
dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)62));
val3 = (PlayerStatType)63;
dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)63));
val3 = (PlayerStatType)64;
dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)64));
val3 = (PlayerStatType)65;
dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)65));
customStatsPanelScroll7.AddRowToScrollList(dictionary7);
CustomStatsPanelScroll customStatsPanelScroll8 = scrollPanel;
Dictionary<string, float> dictionary8 = new Dictionary<string, float>();
val3 = (PlayerStatType)66;
dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)66));
val3 = (PlayerStatType)67;
dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)67));
val3 = (PlayerStatType)68;
dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)68));
val3 = (PlayerStatType)69;
dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)69));
val3 = (PlayerStatType)70;
dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)70));
customStatsPanelScroll8.AddRowToScrollList(dictionary8);
CustomStatsPanelScroll customStatsPanelScroll9 = scrollPanel;
Dictionary<string, float> dictionary9 = new Dictionary<string, float>();
val3 = (PlayerStatType)71;
dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)71));
val3 = (PlayerStatType)72;
dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)72));
val3 = (PlayerStatType)73;
dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)73));
customStatsPanelScroll9.AddRowToScrollList(dictionary9);
scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsProgressionText.Value, (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll10 = scrollPanel;
Dictionary<string, float> dictionary10 = new Dictionary<string, float>();
val3 = (PlayerStatType)85;
dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)85));
val3 = (PlayerStatType)86;
dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)86));
val3 = (PlayerStatType)87;
dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)87));
val3 = (PlayerStatType)96;
dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)96));
customStatsPanelScroll10.AddRowToScrollList(dictionary10);
CustomStatsPanelScroll customStatsPanelScroll11 = scrollPanel;
Dictionary<string, float> dictionary11 = new Dictionary<string, float>();
val3 = (PlayerStatType)88;
dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)88));
val3 = (PlayerStatType)97;
dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)97));
val3 = (PlayerStatType)89;
dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)89));
val3 = (PlayerStatType)98;
dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)98));
customStatsPanelScroll11.AddRowToScrollList(dictionary11);
CustomStatsPanelScroll customStatsPanelScroll12 = scrollPanel;
Dictionary<string, float> dictionary12 = new Dictionary<string, float>();
val3 = (PlayerStatType)90;
dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)90));
val3 = (PlayerStatType)99;
dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)99));
val3 = (PlayerStatType)91;
dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)91));
val3 = (PlayerStatType)100;
dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)100));
customStatsPanelScroll12.AddRowToScrollList(dictionary12);
CustomStatsPanelScroll customStatsPanelScroll13 = scrollPanel;
Dictionary<string, float> dictionary13 = new Dictionary<string, float>();
val3 = (PlayerStatType)92;
dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)92));
val3 = (PlayerStatType)101;
dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)101));
val3 = (PlayerStatType)93;
dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)93));
val3 = (PlayerStatType)102;
dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)102));
customStatsPanelScroll13.AddRowToScrollList(dictionary13);
CustomStatsPanelScroll customStatsPanelScroll14 = scrollPanel;
Dictionary<string, float> dictionary14 = new Dictionary<string, float>();
val3 = (PlayerStatType)94;
dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)94));
val3 = (PlayerStatType)103;
dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)103));
val3 = (PlayerStatType)95;
dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)95));
val3 = (PlayerStatType)104;
dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)104));
customStatsPanelScroll14.AddRowToScrollList(dictionary14);
scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsTravellingText.Value, (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll15 = scrollPanel;
Dictionary<string, float> dictionary15 = new Dictionary<string, float>();
val3 = (PlayerStatType)16;
dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)16), 2));
val3 = (PlayerStatType)17;
dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)17), 2));
val3 = (PlayerStatType)18;
dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)18), 2));
val3 = (PlayerStatType)19;
dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)19), 2));
val3 = (PlayerStatType)20;
dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)20), 2));
customStatsPanelScroll15.AddRowToScrollList(dictionary15);
CustomStatsPanelScroll customStatsPanelScroll16 = scrollPanel;
Dictionary<string, float> dictionary16 = new Dictionary<string, float>();
val3 = (PlayerStatType)21;
dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)21), 2));
val3 = (PlayerStatType)22;
dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)22), 2));
val3 = (PlayerStatType)23;
dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)23));
val3 = (PlayerStatType)3;
dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)3));
customStatsPanelScroll16.AddRowToScrollList(dictionary16);
CustomStatsPanelScroll customStatsPanelScroll17 = scrollPanel;
Dictionary<string, float> dictionary17 = new Dictionary<string, float>();
val3 = (PlayerStatType)45;
dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)45));
val3 = (PlayerStatType)46;
dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)46));
val3 = (PlayerStatType)47;
dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)47));
customStatsPanelScroll17.AddRowToScrollList(dictionary17);
scrollPanel.AddHeaderToScrollList("$menu_resources", (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll18 = scrollPanel;
Dictionary<string, float> dictionary18 = new Dictionary<string, float>();
val3 = (PlayerStatType)35;
dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)35));
val3 = (PlayerStatType)36;
dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)36));
val3 = (PlayerStatType)27;
dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)27));
val3 = (PlayerStatType)28;
dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)28));
val3 = (PlayerStatType)29;
dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)29));
customStatsPanelScroll18.AddRowToScrollList(dictionary18);
CustomStatsPanelScroll customStatsPanelScroll19 = scrollPanel;
Dictionary<string, float> dictionary19 = new Dictionary<string, float>();
val3 = (PlayerStatType)30;
dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)30));
val3 = (PlayerStatType)31;
dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)31));
val3 = (PlayerStatType)32;
dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)32));
val3 = (PlayerStatType)33;
dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)33));
val3 = (PlayerStatType)34;
dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)34));
customStatsPanelScroll19.AddRowToScrollList(dictionary19);
CustomStatsPanelScroll customStatsPanelScroll20 = scrollPanel;
Dictionary<string, float> dictionary20 = new Dictionary<string, float>();
val3 = (PlayerStatType)37;
dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)37));
val3 = (PlayerStatType)38;
dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)38));
val3 = (PlayerStatType)39;
dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)39));
val3 = (PlayerStatType)40;
dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)40));
val3 = (PlayerStatType)41;
dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)41));
customStatsPanelScroll20.AddRowToScrollList(dictionary20);
CustomStatsPanelScroll customStatsPanelScroll21 = scrollPanel;
Dictionary<string, float> dictionary21 = new Dictionary<string, float>();
val3 = (PlayerStatType)42;
dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)42));
val3 = (PlayerStatType)43;
dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)43));
val3 = (PlayerStatType)44;
dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)44));
customStatsPanelScroll21.AddRowToScrollList(dictionary21);
CustomStatsPanelScroll customStatsPanelScroll22 = scrollPanel;
Dictionary<string, float> dictionary22 = new Dictionary<string, float>();
val3 = (PlayerStatType)12;
dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)12));
val3 = (PlayerStatType)48;
dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)48));
val3 = (PlayerStatType)49;
dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)49));
val3 = (PlayerStatType)76;
dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)76));
val3 = (PlayerStatType)77;
dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)77));
customStatsPanelScroll22.AddRowToScrollList(dictionary22);
scrollPanel.AddHeaderToScrollList("$hud_building", (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll23 = scrollPanel;
Dictionary<string, float> dictionary23 = new Dictionary<string, float>();
val3 = (PlayerStatType)2;
dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)2));
val3 = (PlayerStatType)1;
dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)1));
val3 = (PlayerStatType)13;
dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)13));
val3 = (PlayerStatType)14;
dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)14));
customStatsPanelScroll23.AddRowToScrollList(dictionary23);
CustomStatsPanelScroll customStatsPanelScroll24 = scrollPanel;
Dictionary<string, float> dictionary24 = new Dictionary<string, float>();
val3 = (PlayerStatType)25;
dictionary24.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)25));
val3 = (PlayerStatType)24;
dictionary24.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)24));
customStatsPanelScroll24.AddRowToScrollList(dictionary24);
CustomStatsPanelScroll customStatsPanelScroll25 = scrollPanel;
Dictionary<string, float> dictionary25 = new Dictionary<string, float>();
val3 = (PlayerStatType)74;
dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)74));
val3 = (PlayerStatType)75;
dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)75));
val3 = (PlayerStatType)82;
dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)82));
customStatsPanelScroll25.AddRowToScrollList(dictionary25);
CustomStatsPanelScroll customStatsPanelScroll26 = scrollPanel;
Dictionary<string, float> dictionary26 = new Dictionary<string, float>();
val3 = (PlayerStatType)78;
dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)78));
val3 = (PlayerStatType)79;
dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)79));
val3 = (PlayerStatType)80;
dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)80));
val3 = (PlayerStatType)81;
dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)81));
customStatsPanelScroll26.AddRowToScrollList(dictionary26);
scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsOthersText.Value, (TextAlignmentOptions)514);
CustomStatsPanelScroll customStatsPanelScroll27 = scrollPanel;
Dictionary<string, float> dictionary27 = new Dictionary<string, float>();
val3 = (PlayerStatType)55;
dictionary27.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)55));
val3 = (PlayerStatType)105;
dictionary27.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)105));
customStatsPanelScroll27.AddRowToScrollList(dictionary27);
}
}
private static Dictionary<PlayerStatType, float> getPlayerDictionaryStats()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
PlayerProfile val = (PlayerProfile)ReflectionUtils.GetPrivateValue(Game.instance, "m_playerProfile");
return ((int)val != 0) ? val.m_playerStats.m_stats : null;
}
public GameObject getPanel()
{
return panel;
}
public void reloadTexts()
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
Dictionary<PlayerStatType, float> playerDictionaryStats = getPlayerDictionaryStats();
foreach (KeyValuePair<string, TextMeshProUGUI> statsText in scrollPanel.statsTexts)
{
((TMP_Text)statsText.Value).text = statsText.Key + ": " + GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)Enum.Parse(typeof(PlayerStatType), statsText.Key));
}
scrollPanel.reloadHeaderTitles();
}
}
public class CustomStatsPanelKills
{
private static readonly List<string> MONSTERS_EXCEPTIONS = new List<string> { "TrainingDummy", "Root", "T.W.I.G." };
private readonly GameObject panel;
private readonly TextMeshProUGUI statsTopicText;
private readonly CustomStatsPanelScroll scrollPanel;
public CustomStatsPanelKills()
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Expected O, but got Unknown
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Expected O, but got Unknown
GameObject trophiesPanel = InventoryGui.instance.m_trophiesPanel;
if (!((Object)(object)trophiesPanel == (Object)null))
{
SkillsDialog skillsDialog = InventoryGui.instance.m_skillsDialog;
panel = Object.Instantiate<GameObject>(trophiesPanel, ((Component)skillsDialog).transform);
((Object)panel).name = "PlayerStatsFrameKills";
panel.SetActive(false);
RectTransform component = panel.GetComponent<RectTransform>();
component.anchoredPosition = new Vector2(0f, 0f);
((Object)panel.transform.Find("TrophiesFrame")).name = "MainFrame";
Transform val = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/topic");
statsTopicText = ((Component)val).GetComponent<TextMeshProUGUI>();
((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Trophies")).name = "Stats";
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyListScroll")).name = "StatsListScroll";
((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyList")).name = "StatList";
scrollPanel = new CustomStatsPanelScroll(((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/StatList"));
LoadKillStats();
Transform val2 = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Closebutton");
ControllerUtils.BindGamePad(val2, (KeyCode)332, InventoryGui.instance);
Button component2 = ((Component)val2).GetComponent<Button>();
component2.onClick = new ButtonClickedEvent();
((UnityEvent)component2.onClick).AddListener((UnityAction)delegate
{
panel.SetActive(false);
PlayerSkillupOptionsPatch.HideTabButtons();
});
}
}
private void LoadKillStats()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
Dictionary<string, float> enemyStats = ((PlayerProfile)ReflectionUtils.GetPrivateValue(Game.instance, "m_playerProfile")).m_enemyStats;
Dictionary<string, float> dictionary = new Dictionary<string, float>();
foreach (KeyValuePair<string, float> item in enemyStats)
{
if (!MONSTERS_EXCEPTIONS.Contains(item.Key))
{
string translation = Localization.instance.Localize(item.Key).Replace("<color=orange>", "").Replace("</color>", "");
int count = dictionary.Keys.ToList().FindAll((string key) => key.Equals(translation) || key.StartsWith(translation + " (")).Count;
if (count > 0)
{
translation = translation + " (" + (count + 1) + ")";
}
dictionary.Add(translation, item.Value);
}
}
List<string> list = dictionary.Keys.ToList();
if (list.Count == 0)
{
return;
}
list.Sort();
Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
if (ConfigurationFile.killStatsGroupingFormat.Value == KillStatsGroupingFormat.AllTogether)
{
for (int i = 0; i < list.Count; i++)
{
float valueSafe = GeneralExtensions.GetValueSafe<string, float>(dictionary, list[i]);
if (valueSafe > 0f)
{
dictionary2.Add(list[i], valueSafe);
if (dictionary2.Count == 5)
{
scrollPanel.AddRowToScrollList(dictionary2);
dictionary2 = new Dictionary<string, float>();
}
}
}
if (dictionary2.Count > 0)
{
scrollPanel.AddRowToScrollList(dictionary2);
}
return;
}
string text = list[0].ToCharArray()[0].ToString() ?? "";
scrollPanel.AddHeaderToScrollList(" " + text, (TextAlignmentOptions)513);
for (int j = 0; j < list.Count; j++)
{
string text2 = list[j].ToCharArray()[0].ToString() ?? "";
if (!text2.Equals(text))
{
if (dictionary2.Count > 0)
{
scrollPanel.AddRowToScrollList(dictionary2);
dictionary2 = new Dictionary<string, float>();
}
text = text2;
scrollPanel.AddHeaderToScrollList(" " + text, (TextAlignmentOptions)513);
}
float valueSafe2 = GeneralExtensions.GetValueSafe<string, float>(dictionary, list[j]);
if (valueSafe2 > 0f)
{
dictionary2.Add(list[j], valueSafe2);
if (dictionary2.Count == 5)
{
scrollPanel.AddRowToScrollList(dictionary2);
dictionary2 = new Dictionary<string, float>();
}
}
}
if (dictionary2.Count > 0)
{
scrollPanel.AddRowToScrollList(dictionary2);
}
}
public GameObject getPanel()
{
return panel;
}
public void reloadTexts()
{
((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
scrollPanel.ClearAll();
LoadKillStats();
scrollPanel.reloadHeaderTitles();
}
}
public class CustomStatsPanelScroll
{
private readonly GameObject content;
public readonly Dictionary<string, TextMeshProUGUI> statsTexts = new Dictionary<string, TextMeshProUGUI>();
private readonly Dictionary<string, TextMeshProUGUI> titleTranslations = new Dictionary<string, TextMeshProUGUI>();
public CustomStatsPanelScroll(Transform parent)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Expected O, but got Unknown
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0249: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Expected O, but got Unknown
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Expected O, but got Unknown
//IL_034f: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_037d: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Unknown result type (might be due to invalid IL or missing references)
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
//IL_03f3: Expected O, but got Unknown
//IL_0452: Unknown result type (might be due to invalid IL or missing references)
//IL_0469: Unknown result type (might be due to invalid IL or missing references)
//IL_0480: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
InventoryGui instance = InventoryGui.instance;
GameObject val = new GameObject("CustomStatsPanelScroll", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val.transform.SetParent(((Component)parent).transform, false);
Object.Destroy((Object)(object)val.GetComponent<Image>());
RectTransform component = val.GetComponent<RectTransform>();
component.anchorMin = new Vector2(0.5f, 0.5f);
component.anchorMax = new Vector2(0.5f, 0.5f);
component.pivot = new Vector2(0.5f, 0.5f);
component.anchoredPosition = new Vector2(0f, -30f);
component.sizeDelta = new Vector2(1260f, 590f);
Image component2 = val.GetComponent<Image>();
((Graphic)component2).color = new Color(0f, 0f, 0f, 0.6f);
GameObject val2 = new GameObject("ScrollView", new Type[3]
{
typeof(RectTransform),
typeof(ScrollRect),
typeof(Image)
});
val2.transform.SetParent(val.transform, false);
Object.Destroy((Object)(object)val2.GetComponent<Image>());
RectTransform component3 = val2.GetComponent<RectTransform>();
component3.anchorMin = new Vector2(0f, 0f);
component3.anchorMax = new Vector2(1f, 1f);
component3.offsetMin = new Vector2(0f, 0f);
component3.offsetMax = new Vector2(0f, 0f);
((Graphic)val2.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.05f);
ScrollRect component4 = val2.GetComponent<ScrollRect>();
component4.horizontal = false;
component4.scrollSensitivity = 2000f;
component4.movementType = (MovementType)2;
GameObject val3 = new GameObject("Viewport", new Type[3]
{
typeof(RectTransform),
typeof(Mask),
typeof(Image)
});
val3.transform.SetParent(val2.transform, false);
RectTransform component5 = val3.GetComponent<RectTransform>();
component5.anchorMin = Vector2.zero;
component5.anchorMax = Vector2.one;
component5.offsetMin = Vector2.zero;
component5.offsetMax = Vector2.zero;
((Graphic)val3.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.05f);
val3.GetComponent<Mask>().showMaskGraphic = false;
component4.viewport = component5;
content = new GameObject("Content", new Type[3]
{
typeof(RectTransform),
typeof(VerticalLayoutGroup),
typeof(ContentSizeFitter)
});
content.transform.SetParent(val3.transform, false);
RectTransform component6 = content.GetComponent<RectTransform>();
component6.anchorMin = new Vector2(0f, 1f);
component6.anchorMax = new Vector2(1f, 1f);
component6.pivot = new Vector2(0.5f, 1f);
component6.anchoredPosition = Vector2.zero;
component6.sizeDelta = new Vector2(0f, 0f);
VerticalLayoutGroup component7 = content.GetComponent<VerticalLayoutGroup>();
((HorizontalOrVerticalLayoutGroup)component7).childForceExpandHeight = false;
((HorizontalOrVerticalLayoutGroup)component7).childForceExpandWidth = true;
((LayoutGroup)component7).childAlignment = (TextAnchor)0;
((HorizontalOrVerticalLayoutGroup)component7).spacing = 25f;
((LayoutGroup)component7).padding = new RectOffset(0, 0, 20, 20);
ContentSizeFitter component8 = content.GetComponent<ContentSizeFitter>();
component8.verticalFit = (FitMode)2;
component4.content = component6;
GameObject gameObject = ((Component)instance.m_recipeListScroll).gameObject;
GameObject val4 = Object.Instantiate<GameObject>(gameObject, val.transform);
((Object)val4).name = "Scrollbar";
RectTransform component9 = val4.GetComponent<RectTransform>();
component9.anchorMin = new Vector2(1f, 0f);
component9.anchorMax = new Vector2(1f, 1f);
component9.pivot = new Vector2(1f, 1f);
component9.sizeDelta = new Vector2(11f, 0f);
component9.anchoredPosition = Vector2.zero;
Scrollbar component10 = val4.GetComponent<Scrollbar>();
component10.direction = (Direction)2;
component4.verticalScrollbar = component10;
component4.verticalScrollbarVisibility = (ScrollbarVisibility)2;
}
public void AddHeaderToScrollList(string title, TextAlignmentOptions textAlignment = 514)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Expected O, but got Unknown
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("GroupHeader", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val.transform.SetParent(content.transform, false);
RectTransform component = val.GetComponent<RectTransform>();
component.anchorMin = new Vector2(0.5f, 1f);
component.anchorMax = new Vector2(0.5f, 1f);
component.pivot = new Vector2(0.5f, 1f);
component.anchoredPosition = new Vector2(0f, -10f);
component.sizeDelta = new Vector2(300f, 30f);
TextMeshProUGUI component2 = val.GetComponent<TextMeshProUGUI>();
((TMP_Text)component2).text = Localization.instance.Localize(title);
titleTranslations.Add(title, component2);
((TMP_Text)component2).font = InventoryGui.instance.m_recipeName.font;
((TMP_Text)component2).fontSize = 24f;
((TMP_Text)component2).alignment = textAlignment;
((Graphic)component2).color = Color.yellow;
}
public void AddRowToScrollList(Dictionary<string, float> entries)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Expected O, but got Unknown
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("StatsRow", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(content.transform, false);
RectTransform component = val.GetComponent<RectTransform>();
component.anchorMin = new Vector2(0f, 1f);
component.anchorMax = new Vector2(1f, 1f);
component.pivot = new Vector2(0f, 1f);
component.sizeDelta = new Vector2(0f, 30f);
float num = 250f;
float num2 = 40f;
int num3 = 0;
foreach (KeyValuePair<string, float> entry in entries)
{
GameObject val2 = new GameObject("Stat", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val2.transform.SetParent(val.transform, false);
RectTransform component2 = val2.GetComponent<RectTransform>();
component2.anchorMin = new Vector2(0f, 0.5f);
component2.anchorMax = new Vector2(0f, 0.5f);
component2.pivot = new Vector2(0f, 0.5f);
component2.anchoredPosition = new Vector2(num2 + num * (float)num3, 0f);
component2.sizeDelta = new Vector2(240f, 25f);
TextMeshProUGUI component3 = val2.GetComponent<TextMeshProUGUI>();
((TMP_Text)component3).text = entry.Key + ": " + entry.Value;
((TMP_Text)component3).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
((TMP_Text)component3).fontSize = 18f;
((Graphic)component3).color = Color.white;
((TMP_Text)component3).alignment = (TextAlignmentOptions)513;
statsTexts.Add(entry.Key, component3);
num3++;
}
}
public void reloadHeaderTitles()
{
foreach (KeyValuePair<string, TextMeshProUGUI> titleTranslation in titleTranslations)
{
((TMP_Text)titleTranslation.Value).text = Localization.instance.Localize(titleTranslation.Key);
}
}
public void ClearAll()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Expected O, but got Unknown
Logger.Log("Cleaning scroll content to repaint...");
foreach (Transform item in content.transform)
{
Transform val = item;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
statsTexts.Clear();
titleTranslations.Clear();
}
}
}
namespace DetailedLevels.Features
{
internal static class CampfireCheck
{
[HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[]
{
typeof(StatusEffect),
typeof(bool),
typeof(int),
typeof(float)
})]
public class SEManAddStatusPatch1
{
[HarmonyPrefix]
public static void Postfix(StatusEffect statusEffect, bool resetTime, int itemLevel, float skillLevel, ref Character ___m_character)
{
if (SEMan.s_statusEffectCampFire == ((object)statusEffect).GetHashCode() && !campfireCheckActive)
{
campfireCheckActive = true;
}
Logger.Log("SEMan.AddStatusEffect - SEManAddStatusPatch1");
Character obj = ___m_character;
PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
}
}
[HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[]
{
typeof(int),
typeof(bool),
typeof(int),
typeof(float)
})]
public class SEManAddStatusPatch2
{
[HarmonyPrefix]
public static void Postfix(int nameHash, bool resetTime, int itemLevel, float skillLevel, ref Character ___m_character)
{
if (nameHash == SEMan.s_statusEffectCampFire && !campfireCheckActive)
{
campfireCheckActive = true;
Logger.Log("SEMan.AddStatusEffect - SEManAddStatusPatch2");
Character obj = ___m_character;
PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
}
}
}
[HarmonyPatch(typeof(SEMan), "RemoveStatusEffect", new Type[]
{
typeof(StatusEffect),
typeof(bool)
})]
public class SEManRemoveStatusPatch1
{
[HarmonyPrefix]
public static void Postfix(StatusEffect se, bool quiet, ref Character ___m_character, ref bool __result)
{
if (SEMan.s_statusEffectCampFire == ((object)se).GetHashCode() && campfireCheckActive)
{
campfireCheckActive = false;
}
Logger.Log("SEMan.RemoveStatusEffect - SEManRemoveStatusPatch1");
Character obj = ___m_character;
PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
}
}
[HarmonyPatch(typeof(SEMan), "RemoveStatusEffect", new Type[]
{
typeof(int),
typeof(bool)
})]
public class SEManRemoveStatusPatch2
{
[HarmonyPrefix]
public static void Postfix(int nameHash, bool quiet, ref Character ___m_character, ref bool __result)
{
if (nameHash == SEMan.s_statusEffectCampFire && campfireCheckActive)
{
campfireCheckActive = false;
Logger.Log("SEMan.RemoveStatusEffect - SEManRemoveStatusPatch2");
Character obj = ___m_character;
PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
}
}
}
private static bool campfireCheckActive;
}
internal static class PlayerColorBuffs
{
public static void refreshAllBlueColors(Player player)
{
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
foreach (Skill value in PlayerBuffs.skills.Values)
{
string text = Localization.instance.Localize("$skill_" + ((object)(SkillType)(ref value.m_info.m_skill)).ToString().ToLower());
for (int i = 0; i < ((Transform)Hud.instance.m_statusEffectListRoot).childCount; i++)
{
TextMeshProUGUI[] componentsInChildren = ((Component)((Transform)Hud.instance.m_statusEffectListRoot).GetChild(i)).GetComponentsInChildren<TextMeshProUGUI>(true);
TextMeshProUGUI val = componentsInChildren[0];
TextMeshProUGUI val2 = componentsInChildren[1];
Logger.Log("Finding text " + text + " in " + ((TMP_Text)val).text);
if (!((TMP_Text)val).text.Contains(text))
{
continue;
}
float num = PlayerUtils.FindActiveModifierValue(player, value.m_info.m_skill);
Logger.Log($"{value.m_info.m_skill} - {num}");
if (num > 0f)
{
if (ConfigurationFile.skillBuffValuePosition.Value == SkillBuffValuePosition.Above)
{
((Graphic)val).color = new Color(0f, 0.741f, 1f, 1f);
((TMP_Text)val).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
((Graphic)val2).color = new Color(1f, 0.7176f, 0.3603f, 1f);
((TMP_Text)val2).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
}
else
{
((Graphic)val).color = new Color(1f, 1f, 1f, 1f);
((TMP_Text)val).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
((Graphic)val2).color = new Color(0f, 0.741f, 1f, 1f);
((TMP_Text)val2).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
}
}
else
{
((Graphic)val).color = new Color(1f, 1f, 1f, 1f);
((TMP_Text)val).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
((Graphic)val2).color = new Color(1f, 0.7176f, 0.3603f, 1f);
((TMP_Text)val2).faceColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
}
break;
}
}
}
}
public class SE_SkillBuff : SE_Stats
{
public SkillType skillType;
public string skillValue;
public override string GetIconText()
{
return (ConfigurationFile.skillBuffValuePosition.Value == SkillBuffValuePosition.Below) ? skillValue : "";
}
public void UpdateBuffText(string value)
{
skillValue = value;
if (ConfigurationFile.skillBuffValuePosition.Value == SkillBuffValuePosition.Above)
{
((StatusEffect)this).m_name = "$skill_" + ((object)(SkillType)(ref skillType)).ToString().ToLower() + ": " + skillValue;
return;
}
((StatusEffect)this).m_name = "$skill_" + ((object)(SkillType)(ref skillType)).ToString().ToLower();
skillValue = value;
}
public string Print()
{
return "$skill_" + ((object)(SkillType)(ref skillType)).ToString().ToLower() + ": " + skillValue;
}
public void Refresh()
{
UpdateBuffText(skillValue);
}
}
[HarmonyPatch(typeof(InventoryGui), "Show")]
public static class SkillTypeCraftStationDescriptionsPatch
{
public static bool updated;
public static void Prefix(Container container, int activeGroup)
{
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Invalid comparison between Unknown and I4
if (updated)
{
return;
}
foreach (Recipe recipe in ObjectDB.instance.m_recipes)
{
ItemDrop item = recipe.m_item;
if ((Object)(object)item != (Object)null && (item.m_itemData.HavePrimaryAttack() || item.m_itemData.HaveSecondaryAttack()) && !isInToolList(((Object)item).name))
{
SkillType skillType = item.m_itemData.m_shared.m_skillType;
if ((int)skillType > 0)
{
string text = item.m_itemData.m_shared.m_description.Split(new char[1] { '\n' })[0];
item.m_itemData.m_shared.m_description = text + "\nSkill: $skill_" + ((object)(SkillType)(ref skillType)).ToString().ToLower();
}
}
}
updated = true;
}
private static bool isInToolList(string itemDropName)
{
return new List<string> { "Cultivator", "Hoe", "Tankard", "TankardAnniversary", "Tankard_dvergr" }.Contains(itemDropName);
}
}
public static class PlayerBuffs
{
public static readonly Dictionary<SkillType, Sprite> sprites = new Dictionary<SkillType, Sprite>();
public static readonly Dictionary<SkillType, Skill> skills = new Dictionary<SkillType, Skill>();
public static void AddSkillBuff(Player player, Skill skill, Sprite skillIcon)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
SEMan sEMan = ((Character)player).GetSEMan();
float currentSkillLevelProgress = PlayerUtils.GetCurrentSkillLevelProgress(skill);
float skillLevelModifier = PlayerUtils.FindActiveModifierValue(player, skill.m_info.m_skill);
Logger.Log("Skill current value: " + currentSkillLevelProgress + ". modifier: " + skillLevelModifier);
SE_SkillBuff sE_SkillBuff = ScriptableObject.CreateInstance<SE_SkillBuff>();
((Object)sE_SkillBuff).name = PlayerUtils.GetValueForNameHash(skill);
sE_SkillBuff.skillType = skill.m_info.m_skill;
((StatusEffect)sE_SkillBuff).m_tooltip = "$skill_" + ((object)(SkillType)(ref skill.m_info.m_skill)).ToString().ToLower() + "_description";
((StatusEffect)sE_SkillBuff).m_icon = skillIcon;
sE_SkillBuff.UpdateBuffText(PlayerUtils.GetSkillValueToShow(currentSkillLevelProgress, skillLevelModifier));
int num = ((StatusEffect)sE_SkillBuff).NameHash();
Logger.Log($"name: {((Object)sE_SkillBuff).name}, m_name: {((StatusEffect)sE_SkillBuff).m_name}, nameHash: {num}");
sEMan.AddStatusEffect((StatusEffect)(object)sE_SkillBuff, false, 0, 0f);
if (PlayerUtils.skillStatusEffects.ContainsKey(skill.m_info.m_skill))
{
PlayerUtils.skillStatusEffects.Remove(skill.m_info.m_skill);
}
PlayerUtils.skillStatusEffects.Add(skill.m_info.m_skill, num);
Logger.Log("Added buff: " + ((StatusEffect)sE_SkillBuff).m_name);
if (!sprites.ContainsKey(skill.m_info.m_skill))
{
sprites.Add(skill.m_info.m_skill, skillIcon);
Logger.Log("Cached sprite for " + ((StatusEffect)sE_SkillBuff).m_name + " with sprite.name " + ((Object)skillIcon).name);
}
if (!skills.ContainsKey(skill.m_info.m_skill))
{
skills.Add(skill.m_info.m_skill, skill);
Logger.Log("Cached skill for " + ((StatusEffect)sE_SkillBuff).m_name);
}
refreshAllBlueColorsAsync(player, 0.1f);
}
public static void RemoveSkillBuff(Player player, Skill skill)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
SEMan sEMan = ((Character)player).GetSEMan();
int valueSafe = GeneralExtensions.GetValueSafe<SkillType, int>(PlayerUtils.skillStatusEffects, skill.m_info.m_skill);
StatusEffect statusEffect = sEMan.GetStatusEffect(valueSafe);
if ((Object)(object)statusEffect != (Object)null)
{
sEMan.RemoveStatusEffect(statusEffect, false);
PlayerUtils.skillStatusEffects.Remove(skill.m_info.m_skill);
Logger.Log("Deleted buff: " + statusEffect.m_name);
sprites.Remove(skill.m_info.m_skill);
skills.Remove(skill.m_info.m_skill);
refreshAllBlueColorsAsync(player, 0.1f);
}
}
private static async Task refreshAllBlueColorsAsync(Player player, float seconds)
{
await Task.Delay((int)(Math.Max(0f, seconds) * 1000f));
PlayerColorBuffs.refreshAllBlueColors(player);
}
}
[HarmonyPatch(typeof(SkillsDialog), "Awake")]
public class PlayerSkillupOptionsPatch
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static UnityAction <>9__17_0;
public static UnityAction <>9__17_1;
public static UnityAction<float> <>9__23_0;
public static UnityAction<float> <>9__24_0;
public static UnityAction<float> <>9__25_0;
public static UnityAction<float> <>9__26_0;
public static UnityAction<float> <>9__28_0;
public static UnityAction<float> <>9__29_0;
public static UnityAction<float> <>9__30_0;
internal void <Postfix>b__17_0()
{
statsPanel.reloadTexts();
statsPanel.getPanel().SetActive(true);
statsPanelKills.reloadTexts();
statsPanelKills