Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Draugrville UI v1.0.1
DraugrvilleUI.dll
Decompiled 12 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RingHUD { public enum NumberStyle { Off, Current, CurrentAndMax, Percent } public enum NumberFont { NewRocker, PirataOne, UncialAntiqua, Metamorphous } public enum FrameStyle { Bronze, Iron, Gold, Bone, Plain } public enum SlotEdge { Bronze, Corners, Shadow, Carved } public enum CapShape { None, Diamond, Boss, Axe, Rune } public enum HealthDisplay { Bar, Ring, Vial } internal sealed class ConfigurationManagerAttributes { public bool? Browsable; } [BepInPlugin("onslaught.ringhud", "Draugrville UI", "1.0.1")] public class RingHUDPlugin : BaseUnityPlugin { public const string GUID = "onslaught.ringhud"; public const string NAME = "Draugrville UI"; public const string VERSION = "1.0.1"; internal static ManualLogSource Log; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> Thickness; internal static ConfigEntry<float> Gap; internal static ConfigEntry<float> ArcDegrees; internal const float CenterAngle = 270f; internal static ConfigEntry<float> OffsetX; internal static ConfigEntry<float> OffsetY; internal static ConfigEntry<bool> Symmetric; internal static ConfigEntry<bool> GrowWithMax; internal static ConfigEntry<float> GrowReference; internal static ConfigEntry<float> MaxArcDegrees; internal static ConfigEntry<bool> HideVanillaBars; internal static ConfigEntry<string> VanillaFieldsToHide; internal static ConfigEntry<bool> ShowEitr; internal static ConfigEntry<bool> FadeStaminaWhenFull; internal static ConfigEntry<bool> FadeHealthWhenFull; internal static ConfigEntry<float> FadeDelay; internal static ConfigEntry<float> IdleAlpha; internal static ConfigEntry<float> LowHealthPulse; internal static ConfigEntry<bool> ShowTicks; internal static ConfigEntry<float> TickInterval; internal static ConfigEntry<float> TickWidth; internal static ConfigEntry<bool> TicksOnEitr; internal static ConfigEntry<NumberStyle> Numbers; internal static ConfigEntry<int> NumberSize; internal static ConfigEntry<NumberFont> Font; internal static ConfigEntry<float> LowHealthText; internal static ConfigEntry<Color> LowHealthTextColor; internal static ConfigEntry<Color> NumberColor; internal static ConfigEntry<Color> HealthColor; internal static ConfigEntry<float> HealthStep; internal static ConfigEntry<Color> StaminaColor; internal static ConfigEntry<Color> EitrColor; internal static ConfigEntry<Color> TrackColor; internal static ConfigEntry<Color> TrailColor; internal static ConfigEntry<float> DamageTrailHold; internal static ConfigEntry<float> DamageTrailDrain; internal static ConfigEntry<float> EmptySlotShade; internal static ConfigEntry<Color> RowHoverColor; internal static ConfigEntry<Color> HealthTrailColor; internal static ConfigEntry<Color> EmptySlotBorder; internal static ConfigEntry<Color> SilhouetteColor; internal static ConfigEntry<bool> ArmourSilhouettes; internal static ConfigEntry<bool> TooltipValuesRight; internal static ConfigEntry<bool> HoverTipsGameBox; internal static ConfigEntry<SlotEdge> SlotBorderStyle; internal static ConfigEntry<Color> TickColor; internal static ConfigEntry<HealthDisplay> HealthMode; internal static ConfigEntry<float> HealthBarMargin; internal static ConfigEntry<float> BottomMargin; internal static ConfigEntry<bool> MoveFood; internal static ConfigEntry<string> FoodField; internal static ConfigEntry<int> FoodSlotLevel; internal static ConfigEntry<int> FoodSlots; internal static ConfigEntry<float> FoodSpacing; internal static ConfigEntry<float> FoodRaise; internal static ConfigEntry<bool> RoundFood; internal static ConfigEntry<float> FoodIconScale; internal static ConfigEntry<bool> FoodTimerRing; internal static ConfigEntry<Color> FoodRingColor; internal static ConfigEntry<Color> FoodRingLowColor; internal static ConfigEntry<Color> FoodRingHighColor; internal static ConfigEntry<float> FoodSlotScale; internal static ConfigEntry<bool> RoundMinimap; internal static ConfigEntry<bool> MoveStatus; internal static ConfigEntry<bool> MoveCornerIcons; internal static ConfigEntry<string> CornerIcons; internal static ConfigEntry<float> CornerIconsX; internal static ConfigEntry<float> CornerIconsY; internal static ConfigEntry<float> CornerIconsGap; internal static ConfigEntry<string> StatusRootField; internal static ConfigEntry<float> StatusSpacing; internal static ConfigEntry<float> StatusTop; internal static ConfigEntry<float> StatusMargin; internal static ConfigEntry<bool> FoodTimerFont; internal static ConfigEntry<string> FoodTimerField; internal static ConfigEntry<float> FoodTimerSize; internal static ConfigEntry<float> FoodTimerX; internal static ConfigEntry<float> FoodTimerY; internal static ConfigEntry<float> StaminaThickness; internal static ConfigEntry<float> HotbarUnselectedScale; internal static ConfigEntry<Color> SelectedColor; internal static ConfigEntry<Color> SelectedStrokeColor; internal static ConfigEntry<bool> InventoryHideFilledBacks; internal static ConfigEntry<bool> InventoryHideEmptyBacks; internal static ConfigEntry<bool> InventoryGameWood; internal static ConfigEntry<bool> EquipmentSlots; internal static ConfigEntry<bool> ItemRadialOn; internal static ConfigEntry<float> ItemRadialHold; internal static ConfigEntry<float> ItemRadialSize; internal static ConfigEntry<float> ItemRadialText; internal static ConfigEntry<float> InventoryStatSize; internal static ConfigEntry<float> WeightWarnBelow; internal static ConfigEntry<float> StatDiscSize; internal static ConfigEntry<bool> TooltipColumns; internal static ConfigEntry<bool> IconGrids; internal static ConfigEntry<bool> CharacterViewer; internal static ConfigEntry<float> ViewerHeight; internal static ConfigEntry<float> ViewerWidth; internal static ConfigEntry<bool> ArmourPanelAbove; internal static ConfigEntry<bool> CraftingTab; internal static ConfigEntry<bool> PvpByName; internal static ConfigEntry<bool> CraftingTidy; internal static ConfigEntry<bool> CharacterSheet; internal static ConfigEntry<float> TabScale; internal static ConfigEntry<bool> BlockSlotSwap; internal static ConfigEntry<bool> SheetOnLeft; internal static ConfigEntry<bool> CentreBackpack; internal static ConfigEntry<bool> ChestPanel; internal static ConfigEntry<string> MenuTitle; internal static ConfigEntry<float> WoodShade; internal static ConfigEntry<float> SkillNameSize; internal static ConfigEntry<int> GridColumns; internal static ConfigEntry<float> GridNameSize; internal static ConfigEntry<bool> InventoryAmountGameFont; internal static ConfigEntry<float> TooltipColumnGap; internal static ConfigEntry<float> BackpackTooltipShrink; internal static ConfigEntry<float> TooltipTitleLarger; internal static ConfigEntry<float> BackpackTooltipOpacity; internal static ConfigEntry<float> MapScale; internal static ConfigEntry<bool> SkillsInCraftPanel; internal static ConfigEntry<float> SkillRowScale; internal static ConfigEntry<float> SkillBarScale; internal static ConfigEntry<float> SkillFontSmaller; internal static ConfigEntry<float> SkillLevelSize; internal static ConfigEntry<Color> SkillLevelColor; internal static ConfigEntry<float> SkillLevelGap; internal static ConfigEntry<float> SkillBarTextSize; internal static ConfigEntry<bool> SkillBarAmounts; internal static ConfigEntry<float> SkillScrollWidth; internal static ConfigEntry<float> SkillListMargin; internal static ConfigEntry<float> TabLabelSize; internal static ConfigEntry<float> EquipSlotSize; internal static ConfigEntry<float> BackpackVignette; internal static ConfigEntry<bool> BackpackTooltipPlate; internal static ConfigEntry<float> CraftRowScale; internal static ConfigEntry<float> InventoryDurabilityHeight; internal static ConfigEntry<bool> InventorySquareSlots; internal static ConfigEntry<float> InventoryAmountSize; internal static ConfigEntry<bool> DurabilityColors; internal static ConfigEntry<bool> QualityStars; internal static ConfigEntry<float> QualityStarSize; internal static ConfigEntry<float> FoodTimerShadow; internal static ConfigEntry<bool> HideKeyHints; internal static ConfigEntry<bool> HotbarBottomCenter; internal static ConfigEntry<bool> HotbarWood; internal static ConfigEntry<bool> NightWood; internal static ConfigEntry<bool> BiomeFont; internal static ConfigEntry<Color> MapRimColor; internal static ConfigEntry<bool> WindMarker; internal static ConfigEntry<float> WindSize; internal static ConfigEntry<float> WindRaise; internal static ConfigEntry<bool> HideSlotBackground; internal static ConfigEntry<float> HotbarGap; internal static ConfigEntry<float> HotbarSelectedScale; internal static ConfigEntry<float> HotbarCornerRadius; internal static ConfigEntry<bool> DurabilityAtBottom; internal static ConfigEntry<float> DurabilityLength; internal static ConfigEntry<float> DurabilityHeight; internal static ConfigEntry<float> DurabilityLowRed; internal static ConfigEntry<bool> SlotBevel; internal static ConfigEntry<bool> HotbarNumberFont; internal static ConfigEntry<float> HotbarNumberSize; internal static ConfigEntry<float> HotbarNumberX; internal static ConfigEntry<float> HotbarNumberY; internal static ConfigEntry<float> BiomeSize; internal static ConfigEntry<float> BiomeRaise; internal static ConfigEntry<bool> BiomeAtBottom; internal static ConfigEntry<bool> WindOnRim; internal static ConfigEntry<bool> EvenSegments; internal static ConfigEntry<bool> HideCornerIcons; internal static ConfigEntry<float> FoodRingGlow; internal static ConfigEntry<float> FoodRingSize; internal static ConfigEntry<float> VialTubeGrow; internal static ConfigEntry<bool> StatusChipsOn; internal static ConfigEntry<float> StatusChipsY; internal static ConfigEntry<float> StatusChipSize; internal static ConfigEntry<Color> StatusRingColor; internal static ConfigEntry<bool> ActionChip; internal static ConfigEntry<bool> InventorySplit; internal static ConfigEntry<float> InventoryRowGap; internal static ConfigEntry<float> InventoryStatsGap; internal static ConfigEntry<bool> InventoryNumberFont; internal static ConfigEntry<float> InventoryNumberSize; internal static ConfigEntry<bool> InventoryLogTree; internal static ConfigEntry<bool> HoverTips; internal static ConfigEntry<float> HoverTipSize; internal static ConfigEntry<bool> MapClickOpens; internal static ConfigEntry<bool> HotbarClickUses; internal static ConfigEntry<float> HotbarScale; internal static ConfigEntry<bool> MoveMinimap; internal static ConfigEntry<string> MinimapField; internal static ConfigEntry<float> MinimapMargin; internal static ConfigEntry<bool> DebugTiming; internal static ConfigEntry<bool> FpsTest; internal static ConfigEntry<bool> LogHudTree; internal static ConfigEntry<KeyCode> SkinReloadKey; internal static ConfigEntry<bool> WriteTemplates; internal static ConfigEntry<float> SkinFrameBorder; internal static ConfigEntry<bool> BuiltInArt; internal static ConfigEntry<KeyCode> FpsTestKey; internal static ConfigEntry<FrameStyle> Style; internal static ConfigEntry<float> FrameWidth; internal static ConfigEntry<bool> Shine; internal static ConfigEntry<bool> Grit; internal static ConfigEntry<float> ShineInterval; private static void Migrate(ConfigEntry<float> e, float oldDefault) { float num = (float)((ConfigEntryBase)e).DefaultValue; if (Mathf.Approximately(e.Value, oldDefault) && !Mathf.Approximately(num, oldDefault)) { e.Value = num; } } private static void Migrate<T>(ConfigEntry<T> e, T oldDefault) where T : struct, Enum { T value = (T)((ConfigEntryBase)e).DefaultValue; if (e.Value.Equals(oldDefault) && !value.Equals(oldDefault)) { e.Value = value; } } private void HideFromSettingsMenu() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown FieldInfo fieldInfo = AccessTools.Field(typeof(ConfigEntryBase), "<Description>k__BackingField"); if (fieldInfo == null) { Log.LogWarning((object)"Settings stay visible in-game: could not reach their descriptions."); return; } int num = 0; foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in ((BaseUnityPlugin)this).Config) { ConfigEntryBase value = item.Value; if (value != null) { ConfigDescription description = value.Description; ConfigDescription value2 = new ConfigDescription(((description != null) ? description.Description : null) ?? "", (description != null) ? description.AcceptableValues : null, new object[1] { new ConfigurationManagerAttributes { Browsable = false } }); try { fieldInfo.SetValue(value, value2); num++; } catch { } } } Log.LogInfo((object)("Draugrville UI: " + num + " settings hidden from in-game menus (edit the config file instead).")); } private static void Migrate(ConfigEntry<bool> e, bool oldDefault) { bool flag = (bool)((ConfigEntryBase)e).DefaultValue; if (e.Value == oldDefault && flag != oldDefault) { e.Value = flag; } } private static void Migrate(ConfigEntry<Color> e, Color oldDefault) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Color val = (Color)((ConfigEntryBase)e).DefaultValue; if (Near(e.Value, oldDefault) && !Near(val, oldDefault)) { e.Value = val; } static bool Near(Color x, Color y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(x.r - y.r) < 0.006f && Mathf.Abs(x.g - y.g) < 0.006f && Mathf.Abs(x.b - y.b) < 0.006f) { return Mathf.Abs(x.a - y.a) < 0.006f; } return false; } } internal static float Edge(ConfigEntry<float> side) { float num = side?.Value ?? (-1f); if (!(num < 0f)) { return num; } return BottomMargin.Value; } private void Awake() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_044c: 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) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Expected O, but got Unknown //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: 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_061c: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Expected O, but got Unknown //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Expected O, but got Unknown //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_092e: 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_099e: Unknown result type (might be due to invalid IL or missing references) //IL_0c10: Unknown result type (might be due to invalid IL or missing references) //IL_0c1a: Expected O, but got Unknown //IL_0cbc: Unknown result type (might be due to invalid IL or missing references) //IL_0cc6: Expected O, but got Unknown //IL_0cf9: Unknown result type (might be due to invalid IL or missing references) //IL_0d03: Expected O, but got Unknown //IL_0d36: Unknown result type (might be due to invalid IL or missing references) //IL_0d40: Expected O, but got Unknown //IL_0db7: Unknown result type (might be due to invalid IL or missing references) //IL_0dc1: Expected O, but got Unknown //IL_0df4: Unknown result type (might be due to invalid IL or missing references) //IL_0dfe: Expected O, but got Unknown //IL_0e31: Unknown result type (might be due to invalid IL or missing references) //IL_0e3b: Expected O, but got Unknown //IL_0f30: Unknown result type (might be due to invalid IL or missing references) //IL_0f72: Unknown result type (might be due to invalid IL or missing references) //IL_0f7c: Expected O, but got Unknown //IL_1387: Unknown result type (might be due to invalid IL or missing references) //IL_1391: Expected O, but got Unknown //IL_1411: Unknown result type (might be due to invalid IL or missing references) //IL_1785: Unknown result type (might be due to invalid IL or missing references) //IL_17a9: Unknown result type (might be due to invalid IL or missing references) //IL_17d6: Unknown result type (might be due to invalid IL or missing references) //IL_188f: Unknown result type (might be due to invalid IL or missing references) //IL_18d1: Unknown result type (might be due to invalid IL or missing references) //IL_18db: Expected O, but got Unknown //IL_1942: Unknown result type (might be due to invalid IL or missing references) //IL_19de: Unknown result type (might be due to invalid IL or missing references) //IL_1b4a: Unknown result type (might be due to invalid IL or missing references) //IL_1cdc: Unknown result type (might be due to invalid IL or missing references) //IL_1ce6: Expected O, but got Unknown //IL_1fc3: Unknown result type (might be due to invalid IL or missing references) //IL_1ff5: Unknown result type (might be due to invalid IL or missing references) //IL_21b4: Unknown result type (might be due to invalid IL or missing references) //IL_21d7: Unknown result type (might be due to invalid IL or missing references) //IL_22f6: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Radius = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "Radius", 105f, "Radius of the innermost ring (health), in pixels at 1080p."); Thickness = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "Thickness", 6f, "Thickness of each ring."); StaminaThickness = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "StaminaThickness", 1.2451172f, "How much thicker the stamina ring is than Thickness. 1 makes it the same as the others."); Gap = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "Gap", 13.75f, "Space between rings. Twice FrameWidth makes the frames touch; more leaves a gap."); ArcDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "ArcDegrees", 105f, new ConfigDescription("How much of the circle each ring covers.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(20f, 190f), Array.Empty<object>())); OffsetX = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "OffsetX", 0f, "Horizontal offset from screen center."); OffsetY = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "OffsetY", -250f, "Vertical offset of the ring center from screen center. -324 puts the rings low and centered where the vanilla stamina bar was."); Symmetric = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Layout", "SymmetricDrain", true, "True: rings shrink from both ends toward the middle. False: rings empty from the left end toward the right."); GrowWithMax = ((BaseUnityPlugin)this).Config.Bind<bool>("1. Layout", "GrowWithMax", true, "True: a ring gets longer as its max goes up from food, like the vanilla bars. False: rings stay the same size and show a fraction."); GrowReference = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "GrowReference", 150f, "With GrowWithMax, the max value at which a ring is exactly ArcDegrees long."); MaxArcDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "MaxArcDegrees", 135f, new ConfigDescription("With GrowWithMax, the longest a ring can get.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(20f, 190f), Array.Empty<object>())); HideVanillaBars = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Behavior", "HideVanillaBars", true, "Hide the vanilla health, stamina and eitr bars."); VanillaFieldsToHide = ((BaseUnityPlugin)this).Config.Bind<string>("2. Behavior", "VanillaFieldsToHide", "m_healthBarRoot,m_staminaBar2Root,m_eitrBarRoot", "Hud field names to hide (comma separated). Edit this if a game update renames them."); ShowEitr = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Behavior", "ShowEitr", true, "Show a third ring for eitr when you have any max eitr."); FadeStaminaWhenFull = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Behavior", "FadeStaminaWhenFull", true, "Fade the stamina and eitr rings out when full."); FadeHealthWhenFull = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Behavior", "FadeHealthWhenFull", false, "Fade the health ring out when full."); FadeDelay = ((BaseUnityPlugin)this).Config.Bind<float>("2. Behavior", "FadeDelay", 1.5f, "Seconds a ring must stay full before fading."); IdleAlpha = ((BaseUnityPlugin)this).Config.Bind<float>("2. Behavior", "IdleAlpha", 0f, new ConfigDescription("Opacity of a faded ring.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); LowHealthPulse = ((BaseUnityPlugin)this).Config.Bind<float>("2. Behavior", "LowHealthPulse", 0.25f, new ConfigDescription("Health ring pulses below this fraction. 0 disables.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); ShowTicks = ((BaseUnityPlugin)this).Config.Bind<bool>("3. Ticks", "ShowTicks", true, "Draw increment lines across the health and stamina rings."); TickInterval = ((BaseUnityPlugin)this).Config.Bind<float>("3. Ticks", "TickInterval", 25f, "Points between tick lines. More max health or stamina means more ticks."); TickWidth = ((BaseUnityPlugin)this).Config.Bind<float>("3. Ticks", "TickWidth", 1f, "Width of each tick line in pixels."); TicksOnEitr = ((BaseUnityPlugin)this).Config.Bind<bool>("3. Ticks", "TicksOnEitr", false, "Also draw tick lines on the eitr ring."); Numbers = ((BaseUnityPlugin)this).Config.Bind<NumberStyle>("4. Numbers", "Style", NumberStyle.Current, "Number shown centered on each ring: Off, Current, CurrentAndMax, Percent."); NumberSize = ((BaseUnityPlugin)this).Config.Bind<int>("4. Numbers", "Size", 17, "Number height."); LowHealthText = ((BaseUnityPlugin)this).Config.Bind<float>("4. Numbers", "LowHealthRedBelow", 15f, "Health number turns red, and stamina number turns yellow, below this value. 0 disables."); LowHealthTextColor = ((BaseUnityPlugin)this).Config.Bind<Color>("4. Numbers", "LowHealthColor", new Color(0.76f, 0.25f, 0.18f, 1f), "Color of the health number when low."); NumberColor = ((BaseUnityPlugin)this).Config.Bind<Color>("4. Numbers", "Color", new Color(0.84f, 0.81f, 0.76f, 1f), "Number color (bone white)."); Font = ((BaseUnityPlugin)this).Config.Bind<NumberFont>("4. Numbers", "Font", NumberFont.NewRocker, "Viking style number font: NewRocker, PirataOne, UncialAntiqua, Metamorphous."); HealthColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "Health", new Color(0.8f, 0.2f, 0.17f, 1f), "Health ring color."); HealthStep = ((BaseUnityPlugin)this).Config.Bind<float>("5. Colors", "HealthStep", 0.07f, new ConfigDescription("How much lighter and redder each 25 hp of the health bar is than the one before. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>())); StaminaColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "Stamina", new Color(0.93f, 0.72f, 0.22f, 1f), "Stamina ring color."); EitrColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "Eitr", new Color(0.55f, 0.38f, 0.86f, 1f), "Eitr ring color."); TrackColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "Track", new Color(0.047f, 0.035f, 0.027f, 0.9f), "Empty part of each ring in the Plain style. Framed styles use a deep shade of the bar color."); TrailColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "DamageTrail", new Color(0.86f, 0.78f, 0.67f, 0.32f), "Lagging trail that shows recent loss on the stamina and eitr rings."); Migrate(TrailColor, new Color(0.58f, 0.1f, 0.34f, 0.92f)); HealthTrailColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "HealthDamageTrail", new Color(0.58f, 0.1f, 0.34f, 0.92f), "Health only: the health a hit took, held a moment, then drained away."); DamageTrailHold = ((BaseUnityPlugin)this).Config.Bind<float>("5. Colors", "DamageTrailHold", 1.2f, new ConfigDescription("Seconds the health lost to a hit stays shown before it drains. Another hit restarts the wait.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); DamageTrailDrain = ((BaseUnityPlugin)this).Config.Bind<float>("5. Colors", "DamageTrailDrain", 0.6f, new ConfigDescription("Seconds the damage trail takes to drain down to your health.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 5f), Array.Empty<object>())); TickColor = ((BaseUnityPlugin)this).Config.Bind<Color>("5. Colors", "Ticks", new Color(0f, 0f, 0f, 0.6f), "Increment line color."); HealthMode = ((BaseUnityPlugin)this).Config.Bind<HealthDisplay>("7. Health and food", "Health", HealthDisplay.Vial, "Bar: bronze bar with a diamond plate in the bottom-left corner. Vial: a round bronze-rimmed flask of blood running into a riveted glass tube, in the same corner. Ring: a curved ring with the others."); HealthBarMargin = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "BarMargin", -1f, "Gap between the health bar and the left edge, at 1080p. -1 keeps it equal to BottomMargin so every edge has the same gap."); BottomMargin = ((BaseUnityPlugin)this).Config.Bind<float>("1. Layout", "BottomMargin", 24f, "The HUD's gap from the edge of the screen, at 1080p. The health bar, hotbar and minimap all sit this far in, on every edge they touch."); MoveFood = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "MoveFood", true, "Lay the vanilla food slots out in a row above the health bar."); FoodField = ((BaseUnityPlugin)this).Config.Bind<string>("7. Health and food", "FoodField", "m_foodIcons", "Hud field holding the food slot icons. Edit if a game update renames it."); FoodSlotLevel = ((BaseUnityPlugin)this).Config.Bind<int>("7. Health and food", "FoodSlotLevel", 1, "How many parents up from each icon is the whole food slot (icon, timer, background). 0 moves just the icon."); FoodSlots = ((BaseUnityPlugin)this).Config.Bind<int>("7. Health and food", "FoodSlots", 0, "How many food circles to show. 0 asks the game how many food slots you actually have (normally 3). Any slots past that are hidden."); FoodSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "FoodSpacing", 52f, "Distance between food slots in the row, at 1080p."); FoodTimerFont = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "TimerFont", true, "Draw the food timers in the same Viking font as the bars."); FoodTimerField = ((BaseUnityPlugin)this).Config.Bind<string>("7. Health and food", "TimerField", "m_foodTime", "Hud field holding the food timer texts. Edit if a game update renames it."); FoodTimerSize = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerSize", 18f, "Height of the food timer text at 1080p."); FoodTimerX = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerX", 16f, "Food timer text, sideways offset from the middle of the circle. Positive is right."); FoodTimerY = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerY", -16f, "Food timer text, vertical offset from the middle of the circle. Negative is down."); FoodTimerShadow = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerShadow", 2.5f, "How far the food timer's drop shadow is cast, for contrast against bright ground. 0 turns it off."); FoodIconScale = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "IconScale", 1.4674f, "Size of the food icons. Above 1 lets them spill past their circle."); FoodTimerRing = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "TimerRing", true, "Ring around each food circle showing time left, draining clockwise from the top."); FoodRingColor = ((BaseUnityPlugin)this).Config.Bind<Color>("7. Health and food", "TimerRingColor", new Color(0.85f, 0.7f, 0.37f, 1f), "Timer ring color between half and a quarter left."); FoodRingLowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("7. Health and food", "TimerRingLowColor", new Color(0.88f, 0.33f, 0.24f, 1f), "Timer ring color in the last quarter, blinking."); FoodRingHighColor = ((BaseUnityPlugin)this).Config.Bind<Color>("7. Health and food", "TimerRingHighColor", new Color(0.6f, 0.9f, 0.16f, 1f), "Timer ring color while more than half the time is left."); FoodRingSize = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerRingWidth", 1.725f, "Line width of the coloured timer ring around each food, compared with before. The ring stays on the food circle's edge and grows inward. Restart to apply."); VialTubeGrow = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "VialTubeOverlap", 1.25f, "Vial: how far the blood and glass reach under the bronze band's top and bottom edges, so no gap shows between them."); FoodSlotScale = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "FoodSlotScale", 0.85f, "Size of each food circle, icon and ring together. The timer text keeps its own size."); MoveStatus = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "MoveStatusEffects", true, "Lay status effects (Rested, Wet, Shelter and so on) out in a row in the top-right corner."); StatusRootField = ((BaseUnityPlugin)this).Config.Bind<string>("7. Health and food", "StatusRootField", "m_statusEffectListRoot", "Hud field holding the status effect list. Edit if a game update renames it."); MoveCornerIcons = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "MoveCornerIcons", true, "Move Valheim's own fork and health icons out of the bottom-left corner to the top right, under the status effects."); CornerIcons = ((BaseUnityPlugin)this).Config.Bind<string>("7. Health and food", "CornerIcons", "foodicon (1),healthicon", "Names of the icons under the game's health panel to move, comma separated."); CornerIconsX = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "CornerIconsX", 60f, "First icon, distance in from the right edge, at 1080p."); CornerIconsY = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "CornerIconsY", 130f, "Icons, distance down from the top edge, at 1080p."); CornerIconsGap = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "CornerIconsGap", 44f, "Space between the moved icons."); StatusSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "StatusSpacing", 70f, "Distance between status effects in the row, at 1080p."); StatusTop = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "StatusTop", -1f, "Distance from the top of the screen down to the middle of the status row, at 1080p. -1 keeps the gap equal to BottomMargin."); StatusMargin = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "StatusMargin", -1f, "Gap between the status row and the right edge, at 1080p. -1 keeps it equal to BottomMargin."); RoundFood = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "RoundFoodSlots", true, "Give the food slots round backgrounds instead of squares."); FoodRaise = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "FoodRaise", 12f, "Gap between the top of the health bar and the food row, at 1080p."); HideKeyHints = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "HideKeyHints", true, "Hide the control hints in the bottom-right corner (Attack, Secondary attack, Block, Dodge and so on)."); HotbarScale = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "HotbarSize", 0.82016f, new ConfigDescription("Overall size of the hotbar and its panel. Change this yourself to resize it, no new build needed.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 1.5f), Array.Empty<object>())); Migrate(HotbarScale, 0.7131797f); NightWood = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "NightWood", true, "At night the hotbar panel crossfades to the dark wood the game's own panels use after dark."); HotbarWood = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "WoodPanel", false, "Wooden plank panel behind the hotbar with an inset square under each slot."); HotbarBottomCenter = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "BottomCenter", true, "Move the hotbar from the top-left to the bottom center of the screen."); HotbarUnselectedScale = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "UnselectedScale", 0.85f, new ConfigDescription("Size of the hotbar slots that aren't equipped, so the equipped (gold) slot is always the largest. 1 turns this off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 1f), Array.Empty<object>())); HotbarCornerRadius = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "EquippedCornerRadius", 2f, new ConfigDescription("Rounded corners on the equipped (gold) slot, in HUD pixels. 0 = square.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 12f), Array.Empty<object>())); HotbarSelectedScale = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "SelectedScale", 1.35f, new ConfigDescription("Size of the equipped (gold) slot compared with the game's.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>())); HotbarGap = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "Gap", 1f, "Space between the item squares of neighbouring hotbar slots, in screen pixels at 1080p. -1 keeps the game's spacing."); DurabilityAtBottom = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "DurabilityAtBottom", true, "Sit each durability bar centred on the bottom edge of its slot."); DurabilityLength = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "DurabilityLength", 1f, new ConfigDescription("Length of the durability bars as a share of their slot's width.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 1f), Array.Empty<object>())); DurabilityHeight = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "DurabilityHeight", 0.478f, new ConfigDescription("Height of the durability bars compared with the game's.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 1.5f), Array.Empty<object>())); DurabilityLowRed = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "DurabilityLowRed", 0.25f, new ConfigDescription("Durability bars turn red below this share of the item's durability. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); SlotBevel = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "SlotBevel", false, "Draw a bevelled square around each slot. Off: just the item and its number on the wood."); HideSlotBackground = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "HideSlotBackground", true, "Hide Valheim's dark square behind each hotbar slot, so the items sit straight on the wood."); HotbarNumberFont = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "NumberFont", true, "Draw the slot numbers in the mod's Viking font instead of the game's."); HotbarNumberSize = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "NumberSize", 21f, "Height of the slot numbers, before the hotbar's own scale."); HotbarNumberX = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "NumberX", 9f, "Slot number: distance in from the slot's left edge."); HotbarNumberY = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "NumberY", 9f, "Slot number: distance down from the slot's top edge."); SelectedStrokeColor = ((BaseUnityPlugin)this).Config.Bind<Color>("9. Hotbar", "EquippedOutlineColor", new Color(1f, 0.88f, 0.2f, 1f), "Outline around the equipped item's slot: bright yellow at the top left, fading out to the bottom right like the gold behind it. Alpha 0 hides it."); BackpackVignette = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "Vignette", 0.55f, new ConfigDescription("Darkness of the soft vignette behind the backpack and menus while they are open. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); BackpackTooltipPlate = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "TooltipPlate", true, "Item tooltips in the backpack on the HUD's bronze plate."); CraftRowScale = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "CraftRowHeight", 1f, "Height of each row in the crafting list compared with the game's."); StatDiscSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "StatBadgeSize", 44f, "Height of the armour shield and weight badges."); InventoryAmountGameFont = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "InventoryAmountGameFont", true, "Stack counts (##/##) in the game's own Averia font instead of the mod's number font."); CharacterViewer = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "CharacterViewer", true, "A 3D view of your character above the armour slots: drag to turn, mouse wheel to zoom, middle button to move it."); ViewerHeight = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "ViewerHeight", 190f, "Smallest height of the character view (the panel grows to fit it)."); ChestPanel = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "ChestPanel", true, "Chest and container panel: its own wooden board behind the slots, name and buttons, and slots dressed like the backpack's."); SheetOnLeft = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "SheetOnLeft", true, "Put the character sheet to the left of the backpack (off: to the right)."); CentreBackpack = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "CentreBackpack", true, "Centre the backpack and the character sheet on the screen (kept clear of the crafting panel)."); BlockSlotSwap = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "BlockArmourSwap", true, "Refuse to put on armour when that slot is already worn (with a message), instead of swapping the pieces."); MenuTitle = ((BaseUnityPlugin)this).Config.Bind<string>("10. Inventory", "MenuTitle", "Menu", "Title over the character panel's icon row (empty: the game's own, your name)."); TabScale = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TabScale", 0.85f, "Size of the icons in the character panel's row (with the Crafting tab added they are made a little smaller to fit)."); CharacterSheet = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "CharacterSheet", true, "Armour panel as a character sheet to the right of the backpack: name and biome, slots either side of the full-body character, stats underneath. Off: the earlier panel."); CraftingTidy = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "CraftingTidy", true, "Crafting panel: recipes A to Z, names centred on icons, grey italic description, stats in two columns, no dark boxes."); PvpByName = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "PvpByName", false, "Put the PvP (friendly fire) switch beside your name at the top of the character panel, out of the icon row."); WoodShade = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "WoodShade", 0.85f, "Brightness of the wooden menu boards on the backpack screen (1 = the game's own)."); CraftingTab = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "CraftingTab", true, "A Crafting tab with a hammer at the start of the character panel's icon row; it shows the crafting list."); ArmourPanelAbove = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "ArmourPanelAbove", true, "Put the armour panel (character, slots, armour and weight) above the hotbar row, as wide as it. Off: to the right of the backpack."); SkillNameSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillNameSize", 18f, "Skills page: size of the skill names."); ViewerWidth = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "ViewerWidth", 220f, "Width of the character's column on the character sheet (between the two columns of slots)."); IconGrids = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "IconGrids", true, "Trophies and achievements as a grid of icons; descriptions show in the tooltip."); GridColumns = ((BaseUnityPlugin)this).Config.Bind<int>("10. Inventory", "GridColumns", 5, "Columns in the trophy and achievement grids."); GridNameSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "GridNameSize", 13f, "Largest size of the names under the grid icons (long names shrink to fit)."); TooltipColumns = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "TooltipColumns", true, "Item tooltips: labels on the left, all values lined up in one column."); TooltipColumnGap = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TooltipColumnGap", 14f, "Space between the widest label and the value column."); WeightWarnBelow = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "WeightWarnBelow", 50f, "The weight number turns orange when you are within this much of your carry limit, and red over it."); InventoryStatSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "StatTextSize", 20f, "Height of the armour and weight values in the mod's font."); TooltipTitleLarger = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TooltipTitleLarger", 2f, "Backpack tooltips: the item name this many points larger than the game's, left aligned."); BackpackTooltipShrink = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TooltipTextSmaller", 4f, "Backpack tooltips: text this many points smaller than the game's."); BackpackTooltipOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TooltipOpacity", 0.96f, new ConfigDescription("Backpack tooltips: how solid the dark background is. Restart to apply.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 1f), Array.Empty<object>())); SkillFontSmaller = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillFontSmaller", 8f, "Skills page: skill names this many points smaller than the game's."); SkillLevelSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillLevelSize", 17f, "Skills page: height of the level number on each bar, in the mod's font."); Migrate(SkillLevelSize, 16f); SkillLevelColor = ((BaseUnityPlugin)this).Config.Bind<Color>("10. Inventory", "SkillLevelColor", new Color(1f, 0.82f, 0.36f, 1f), "Skills page: colour of the level number."); SkillLevelGap = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillLevelGap", 14f, "Skills page: space between the longest skill name and the level column."); SkillBarAmounts = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "SkillBarAmounts", true, "Skills page: progress to the next level (gathered/needed) inside each bar."); SkillBarTextSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillBarTextSize", 13f, "Skills page: size of the progress numbers inside the bars."); SkillScrollWidth = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillScrollWidth", 0.375f, "Skills page: scroll bar width compared with the game's."); SkillListMargin = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillListMargin", 22f, "Skills page: space between the list and the page's sides."); SkillRowScale = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillRowHeight", 0.95f, "Skills page: height of each row compared with the game's."); SkillBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "SkillProgressHeight", 0.425f, "Skills page: height of the orange progress bar compared with the game's."); TabLabelSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "TabLabelSize", 16f, "Height of the names under the character panel's icons."); SkillsInCraftPanel = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "SkillsInCraftPanel", true, "The skills page opens in the crafting panel's place instead of as its own window."); MapScale = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "MapScale", 0.95f, "Size of the minimap with its rim, plate and marker, compared with the game's."); ItemRadialOn = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "ItemRadial", true, "Hold the left button on a backpack item (without moving) to open a ring of choices: Equip or Use, Split, Drop, Trash. Let go over one to do it."); ItemRadialHold = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "ItemRadialHold", 0.4f, "Seconds to hold before the ring opens."); ItemRadialText = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "ItemRadialTextSize", 20f, "Size of the words on the ring menu (in the game's Averia font)."); ItemRadialSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "ItemRadialSize", 62f, "Distance of the choices from the cursor."); EquipmentSlots = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "EquipmentSlots", true, "Worn armour (helmet, shoulders, chest, legs, trinket, belt) moves out of the backpack into its own slots beside armour and weight. The items stay in your inventory (weight, saving and death work as normal). Turn this off and open the backpack once before removing the mod, so the worn items move back into the backpack."); EquipSlotSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "EquipSlotSize", 69f, "Size of each equipment slot."); InventoryGameWood = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "UseGameWood", true, "Backpack panels use the same wooden board as the game's crafting panel. Off: the mod's own worn wood (backpack_panel.png)."); InventoryDurabilityHeight = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "DurabilityHeight", 0.4f, "Backpack: height of the durability bars compared with the game's; they sit on the bottom edge of their slot."); DurabilityColors = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "DurabilityColors", true, "Durability bars (toolbar and backpack) by condition: green 100-75%, yellow 74-50%, orange 49-25%, red below."); QualityStars = ((BaseUnityPlugin)this).Config.Bind<bool>("9. Hotbar", "QualityStars", true, "Item quality (upgrade level) as gold stars instead of a number, on the toolbar and in the backpack."); QualityStarSize = ((BaseUnityPlugin)this).Config.Bind<float>("9. Hotbar", "QualityStarSize", 11f, "Size of each quality star."); InventoryAmountSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "AmountSize", 15f, "Backpack: height of the stack counts (12/50) drawn in the mod's font. 0 keeps the game's text."); InventorySquareSlots = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "SquareSlots", true, "Backpack: square corners on the slots and on the equipped highlight, which also gets the hotbar's gold fade and yellow outline."); InventoryHideFilledBacks = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "HideFilledSlotBacks", true, "Backpack: a slot holding an item loses its dark square, so the item sits on the wood. Empty slots keep it."); RowHoverColor = ((BaseUnityPlugin)this).Config.Bind<Color>("10. Inventory", "RowHoverColor", new Color(0f, 0f, 0f, 0.3f), "The bar under the crafting or skills row the mouse is on (the same for both lists)."); EmptySlotBorder = ((BaseUnityPlugin)this).Config.Bind<Color>("10. Inventory", "EmptySlotBorder", Color.white, "With HideEmptySlotBacks on: tint of the carved edge round an empty slot (white = as drawn, alpha 0 = none)."); Migrate(EmptySlotBorder, new Color(0f, 0f, 0f, 0.45f)); TooltipValuesRight = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "TooltipValuesRight", true, "Tooltip rows: values right aligned on one edge (off: they start on one edge)."); HoverTipsGameBox = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "HoverTipsSameBox", true, "Food, status, health and map hover tips (backpack open) use the same tooltip box as items."); SlotBorderStyle = ((BaseUnityPlugin)this).Config.Bind<SlotEdge>("10. Inventory", "SlotBorderStyle", SlotEdge.Shadow, "The edge on every slot: Bronze (thin rim like the tooltips), Corners (bronze corner brackets with rivets), Shadow (soft sunken edge, no line), Carved (dark top, light bottom)."); Migrate(SlotBorderStyle, SlotEdge.Carved); ArmourSilhouettes = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "ArmourSilhouettes", true, "Empty armour slots show a dark outline of the piece that goes there instead of its name."); SilhouetteColor = ((BaseUnityPlugin)this).Config.Bind<Color>("10. Inventory", "SilhouetteColor", new Color(0f, 0f, 0f, 0.38f), "Colour of those outlines (black at low alpha reads as a shadow on the wood)."); EmptySlotShade = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "EmptySlotShade", 0.25f, new ConfigDescription("With HideEmptySlotBacks on: how dark the faint box on an empty slot is (0 = none).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.6f), Array.Empty<object>())); Migrate(EmptySlotShade, 0.1f); Migrate(EmptySlotShade, 0.17f); InventoryHideEmptyBacks = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "HideEmptySlotBacks", true, "Backpack and armour slots: empty slots lose their dark square too (armour slots keep their faint name)."); SelectedColor = ((BaseUnityPlugin)this).Config.Bind<Color>("9. Hotbar", "SelectedColor", new Color(0.93f, 0.76f, 0.33f, 0.95f), "Highlight on the slot you have selected. Gold by default, in place of Valheim's blue."); MoveMinimap = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "MoveToBottomRight", true, "Move the small minimap to the bottom-right corner, above the key hints."); MinimapField = ((BaseUnityPlugin)this).Config.Bind<string>("8. Minimap", "MinimapField", "m_smallRoot", "Minimap field holding the small map. Edit if a game update renames it."); RoundMinimap = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "RoundMap", true, "Clip the small minimap to a circle with a bronze rim."); MapRimColor = ((BaseUnityPlugin)this).Config.Bind<Color>("8. Minimap", "RimColor", new Color(0.33f, 0.27f, 0.18f, 1f), "Metal of the thin rim and rivets around the map. The health bar's aged bronze by default; it gets the same verdigris and pitting."); BiomeFont = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "BiomeFont", true, "Draw the biome name in the mod's font, centred on top of the map."); WindMarker = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "WindMarker", true, "Move the wind marker up above the biome name and draw it as a bronze arrow."); WindSize = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "WindSize", 30f, "Size of the wind marker."); WindRaise = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "WindRaise", 6f, "Gap between the top of the biome name and the wind marker."); BiomeSize = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "BiomeSize", 19f, "Height of the biome name."); StatusChipsOn = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "StatusChips", true, "Show status effects as round chips with a draining timer ring, in a row under the stamina and eitr rings, instead of the game's list in the corner."); StatusChipsY = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "StatusChipsY", 0f, "Move the row of status chips up (positive) or down (negative)."); StatusChipSize = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "StatusChipSize", 30.24f, "Diameter of each status chip."); ActionChip = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "ActionChip", true, "Equipping, eating and other timed actions show as a status chip with a filling ring and the action's name under it, instead of the game's bar."); StatusRingColor = ((BaseUnityPlugin)this).Config.Bind<Color>("7. Health and food", "StatusRingColor", new Color(1f, 1f, 1f, 0.95f), "Colour of the timer ring around each status chip."); InventorySplit = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "SplitPanels", true, "Backpack screen: put the hotbar row (slots 1-8) in its own panel, the rest of the backpack in a panel under it, and armour and weight in a third panel to the right."); InventoryRowGap = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "RowGap", 14f, "Space between the hotbar row panel and the backpack panel."); InventoryStatsGap = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "StatsGap", 10f, "Space between the backpack panels and the armour and weight panel."); InventoryNumberFont = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "NumberFont", true, "Draw the 1-8 slot numbers in the backpack in the mod's Viking font."); InventoryNumberSize = ((BaseUnityPlugin)this).Config.Bind<float>("10. Inventory", "NumberSize", 20f, "Height of the 1-8 slot numbers in the backpack."); InventoryLogTree = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Inventory", "LogPanelTree", true, "Write the backpack panel's layout to the log once, the first time it opens. Helps fix the split panels after a game update."); HoverTips = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Tooltips", "HoverTips", true, "While the backpack is open, hovering a status chip or a food shows its name and time left, and hovering the health bar shows current / max health."); HoverTipSize = ((BaseUnityPlugin)this).Config.Bind<float>("11. Tooltips", "TextSize", 19f, "Height of the tooltip text."); HotbarClickUses = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Tooltips", "HotbarClickEquips", true, "While the backpack is open, clicking a toolbar slot uses it, the same as pressing its number key (equips a weapon or tool, eats food)."); MapClickOpens = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Tooltips", "MapClickOpens", true, "While the backpack is open, clicking the minimap closes the backpack and opens the large map."); FoodRingGlow = ((BaseUnityPlugin)this).Config.Bind<float>("7. Health and food", "TimerRingGlow", 0f, new ConfigDescription("Strength of the soft glow around each food timer ring, in the ring's own colour. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); HideCornerIcons = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "HideCornerIcons", true, "Hide the game's small health knot and food fork icons, which sat beside its own bars."); EvenSegments = ((BaseUnityPlugin)this).Config.Bind<bool>("7. Health and food", "EvenSegments", true, "Vial: every TickInterval hp (25) of the bar is as long as the flask is wide, so the steps all read the same and the bar grows with max health."); WindOnRim = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "WindOnRim", true, "Sit the wind marker on the top middle of the map's rim, in white."); BiomeAtBottom = ((BaseUnityPlugin)this).Config.Bind<bool>("8. Minimap", "BiomeAtBottom", true, "Put the biome name on a bronze plate on the bottom of the round map, with the wind marker taking its old place above the map."); BiomeRaise = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "BiomeRaise", 8f, "Gap between the top of the map's rim and the bottom of the biome name."); MinimapMargin = ((BaseUnityPlugin)this).Config.Bind<float>("8. Minimap", "MapMargin", -1f, "Gap between the minimap and the right edge, at 1080p. -1 keeps it equal to BottomMargin so every edge has the same gap."); Style = ((BaseUnityPlugin)this).Config.Bind<FrameStyle>("6. Style", "Style", FrameStyle.Bronze, "Bronze: bronze band, riveted diamond caps. Iron: blackened iron, round shield-boss caps. Gold: gold with a braided rope pattern and axe-blade caps. Bone: carved bone with rune-stone caps. Plain: flat rings."); FrameWidth = ((BaseUnityPlugin)this).Config.Bind<float>("6. Style", "FrameWidth", 3f, "Width of the frame around each ring."); Grit = ((BaseUnityPlugin)this).Config.Bind<bool>("6. Style", "Grit", true, "Grainy grime texture over the rings for a dark, worn look."); Shine = ((BaseUnityPlugin)this).Config.Bind<bool>("6. Style", "Shine", true, "A glint of light sweeps across polished frames now and then."); ShineInterval = ((BaseUnityPlugin)this).Config.Bind<float>("6. Style", "ShineInterval", 6f, "Seconds between glints."); DebugTiming = ((BaseUnityPlugin)this).Config.Bind<bool>("Z. Debug", "LogTiming", false, "Log how many milliseconds per frame the mod spends, every 5 seconds, to the BepInEx log. For finding FPS problems."); FpsTest = ((BaseUnityPlugin)this).Config.Bind<bool>("Z. Debug", "FpsTest", false, "Self-running FPS test: turns the mod's features off one step at a time, 6 seconds per step, and logs the FPS of each step. The HUD visibly changes while this runs. Leave off for normal play."); SkinReloadKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("A. Your own textures", "ReloadKey", (KeyCode)0, "Press in game to re-read the PNGs in the textures folder next to the mod, so you can paint and see the result without restarting."); WriteTemplates = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Your own textures", "WriteTemplates", false, "Set to true to write fresh template PNGs of every piece into textures/templates on the next launch. Painted files in the textures folder itself are left alone. Switches itself back off."); BuiltInArt = ((BaseUnityPlugin)this).Config.Bind<bool>("A. Your own textures", "BuiltInArt", true, "Use the painted pieces built into the DLL (health bar fill, health plate, wind arrow). Off: the mod draws them itself. A PNG in the textures folder overrides either."); SkinFrameBorder = ((BaseUnityPlugin)this).Config.Bind<float>("A. Your own textures", "FrameBorder", 10f, "For healthbar_frame.png: how many pixels at each edge of the image are the frame and must not stretch."); LogHudTree = ((BaseUnityPlugin)this).Config.Bind<bool>("Z. Debug", "LogHudTree", false, "Write the game's minimap object tree and the bottom-left HUD contents to the log once, for debugging the mod."); FpsTestKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Z. Debug", "FpsTestKey", (KeyCode)0, "Press this key in game to start or stop the FPS test, with no config editing. Set to None to disable the key."); Migrate(FoodIconScale, 1.45f); Migrate(FoodSpacing, 58f); Migrate(OffsetY, -324f); Migrate(ArcDegrees, 100f); Migrate(ArcDegrees, 150f); Migrate(TickColor, new Color(0f, 0f, 0f, 0.28f)); Migrate(HotbarUnselectedScale, 0.98f); Migrate(MapRimColor, new Color(0.85f, 0.7f, 0.37f, 1f)); Migrate(HealthMode, HealthDisplay.Bar); Migrate(HotbarGap, 8f); Migrate(HotbarWood, oldDefault: true); Migrate(HotbarNumberSize, 16f); Migrate(FoodIconScale, 1.334f); Migrate(OffsetY, -312f); Migrate(OffsetY, -322f); Migrate(BiomeSize, 24f); Migrate(StatusChipSize, 28f); Migrate(BiomeSize, 22f); Migrate(BiomeSize, 21f); Migrate(InventoryAmountSize, 17f); Migrate(EquipSlotSize, 46f); Migrate(SkillFontSmaller, 4f); Migrate(SkillBarScale, 0.5f); Migrate(SkillRowScale, 0.75f); Migrate(BackpackTooltipShrink, 2f); Migrate(TabLabelSize, 14f); Migrate(SkillFontSmaller, 8f); Migrate(SkillRowScale, 0.65f); Migrate(Gap, 22f); Migrate(Gap, 11f); Migrate(StaminaThickness, 1.4648438f); Migrate(DurabilityLength, 0.75f); Migrate(DurabilityHeight, 0.85f); Migrate(DurabilityHeight, 0.6375f); Migrate(FoodRingSize, 1.2f); Migrate(FoodRingSize, 1.38f); Migrate(FoodRingHighColor, new Color(0.47f, 0.74f, 0.32f, 1f)); Migrate(FoodRingHighColor, new Color(0.22f, 0.46f, 0.14f, 1f)); Migrate(FoodRingGlow, 0.45f); Migrate(OffsetY, -275f); Migrate(StaminaThickness, 1.953125f); Migrate(Radius, 70f); Migrate(OffsetY, -287f); Migrate(MaxArcDegrees, 190f); Migrate(StatDiscSize, 58f); Migrate(SkillFontSmaller, 12f); Migrate(SkillFontSmaller, 10f); Migrate(SkillRowScale, 0.8f); Migrate(TabLabelSize, 20f); Migrate(TabLabelSize, 18f); Migrate(TabLabelSize, 17f); Migrate(PvpByName, oldDefault: true); Migrate(CraftRowScale, 0.75f); Migrate(ViewerWidth, 150f); Migrate<KeyCode>(SkinReloadKey, (KeyCode)292); Migrate<KeyCode>(FpsTestKey, (KeyCode)291); HideFromSettingsMenu(); new Harmony("onslaught.ringhud").PatchAll(); bool value = WriteTemplates.Value; if (value) { WriteTemplates.Value = false; } Skin.WriteTemplates(value); Log.LogInfo((object)"Draugrville UI 1.0.1 loaded"); } } internal struct StylePreset { public Color Frame; public Color Inner; public Color Accent; public CapShape Cap; public bool Rope; public float FillShade; public bool Studs; public bool Polished; public bool Aged; public Color Weather; public float[] FillProfile; private static readonly float[] GlossyFill = new float[10] { 0f, 0.5f, 0.45f, 0.88f, 0.72f, 1.08f, 0.86f, 1f, 1f, 0.76f }; public static float[] PolishedRims(float e, float gloss = 1.6f) { e = Mathf.Clamp(e, 0.02f, 0.45f); float[] obj = new float[16] { 0f, 0.4f, 0f, 0f, 0f, 1f, 0f, 0.6f, 0f, 0.6f, 0f, 1f, 0f, 0f, 1f, 0.42f }; obj[2] = e * 0.4f; obj[3] = gloss; obj[4] = e * 0.7f; obj[6] = e; obj[8] = 1f - e; obj[10] = 1f - e * 0.7f; obj[12] = 1f - e * 0.4f; obj[13] = gloss; return obj; } public static StylePreset Get(FrameStyle s) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) return s switch { FrameStyle.Iron => new StylePreset { Frame = new Color(0.36f, 0.36f, 0.38f), Inner = new Color(0.06f, 0.06f, 0.07f, 0.95f), Accent = new Color(0.78f, 0.78f, 0.8f), Cap = CapShape.Boss, FillShade = 0.55f }, FrameStyle.Gold => new StylePreset { Frame = new Color(0.86f, 0.66f, 0.24f), Inner = new Color(0.22f, 0.13f, 0.05f, 0.95f), Accent = new Color(1f, 0.88f, 0.55f), Cap = CapShape.Axe, Rope = true, FillShade = 0.62f }, FrameStyle.Bone => new StylePreset { Frame = new Color(0.86f, 0.82f, 0.7f), Inner = new Color(0.24f, 0.2f, 0.16f, 0.95f), Accent = new Color(0.95f, 0.92f, 0.82f), Cap = CapShape.Rune, FillShade = 0.65f }, FrameStyle.Plain => new StylePreset { Cap = CapShape.None, FillShade = 1f }, _ => new StylePreset { Frame = new Color(0.33f, 0.27f, 0.18f), Inner = new Color(0.055f, 0.043f, 0.031f, 0.96f), Accent = new Color(0.55f, 0.48f, 0.38f), Cap = CapShape.Diamond, FillShade = 0.62f, Studs = true, Polished = true, Aged = true, FillProfile = GlossyFill }, }; } } [HarmonyPatch(typeof(Hud), "Awake")] internal static class Hud_Awake_Patch { private static void Postfix() { RingHudController.Create(); } } [HarmonyPatch(typeof(Hud), "Update")] internal static class Hud_Update_Patch { private static void Postfix(Hud __instance) { int num; if (!RingHUDPlugin.DebugTiming.Value) { num = (Bisect.On ? 1 : 0); if (num == 0) { goto IL_001c; } } else { num = 1; } Perf.Begin(); goto IL_001c; IL_001c: VanillaHider.Apply(__instance, RingHUDPlugin.HideVanillaBars.Value && !Bisect.VanillaShown); if (num != 0) { Perf.End(0); } FoodLayout.Apply(__instance); if (num != 0) { Perf.End(1); } if (RingHUDPlugin.StatusChipsOn.Value && !Bisect.ChipsOff) { StatusChips.Apply(__instance); } else { StatusChips.Hide(); StatusLayout.Apply(__instance); } CornerIconMover.Apply(__instance); if (RingHUDPlugin.LogHudTree.Value) { CornerDump.Tick(__instance); } if (num != 0) { Perf.End(2); } MinimapMover.Apply(); if (num != 0) { Perf.End(3); } HotbarScaler.Apply(); if (num != 0) { Perf.End(4); } } } internal static class Skin { private class Binding { public Image Image; public string Name; public Func<Sprite> Fallback; public Vector4 Border; public Type Type; } internal static readonly string[] Names = new string[35] { "food_circle", "food_ring", "map_backdrop", "map_rim", "wind_arrow", "hotbar_wood", "hotbar_wood_night", "hotbar_inset", "hotbar_equipped", "grit", "healthbar_frame", "healthbar_track", "healthbar_fill", "healthbar_plate", "vial_mask", "vial_outline", "vial_track", "vial_fill", "map_plate", "hotbar_equipped", "hotbar_equipped_stroke", "backpack_panel", "chip_back", "chip_ring", "vial_flask_empty", "vial_flask_blood", "wind_arrow_white", "vial_fill_grey", "ring_mottle", "vial_rivet_0", "vial_rivet_1", "vial_rivet_2", "vial_rivet_3", "vial_rivet_4", "vial_rivet_5" }; private static readonly Dictionary<string, Sprite> Cache = new Dictionary<string, Sprite>(); private static Texture2D _atlas; private static readonly List<Binding> Bindings = new List<Binding>(); private static int _version; private const string FolderNote = "Draugrville UI textures\n================\n\nThis folder is read by the mod. Any PNG here with one of the template names replaces the mod's\nown drawing of that piece. The templates themselves are in the templates folder, with a README\nlisting what each one is. Copy one up into this folder, paint it, and press F11 in game.\n"; private const string ReadmeText = "Draugrville UI textures\n================\n\nThese are templates: the mod draws from code and never reads this folder. To replace a\npiece, copy its PNG one level up into the textures folder, paint over it in any image\neditor, save it, and press the reload key in game (F11 unless you changed it in the config).\nDelete the file from the textures folder and the mod goes back to drawing that piece itself.\n\nKeep the backgrounds transparent. Sizes are only suggestions: you can use any size, the\npiece is stretched to fit. The exceptions are the sliced ones, where the border (the outer\nN pixels of the image) keeps its thickness and only the middle stretches.\n\nhealthbar_frame.png The metal frame around the health bar. Sliced, border 10 px.\nhealthbar_track.png The empty part of the bar behind the fill. Stretched.\nhealthbar_fill.png The red fill. Revealed from the left as health drops, never squashed,\n so paint it as the full bar. The per-25-hp lightening does not apply\n to a painted fill.\nhealthbar_plate.png The diamond plate the number sits on. Square, drawn centred.\nfood_circle.png The round backdrop of each food slot. Square.\nfood_ring.png The timer ring around a food slot. Square, drains clockwise from the\n top. Paint it white: the mod tints it green, gold and red.\nmap_backdrop.png The parchment disc under the minimap. Square.\nmap_rim.png The ring around the minimap. Square, shown as painted. Built in: the\n Vial's dark bronze band, lit on top and shaded underneath. Its eight\n rivets are the vial_rivet pieces.\nwind_arrow_white.png The wind marker on top of the map's rim (WindOnRim): an anchor, light on its\n left half and shaded on its right. Ring end points with the wind.\nvial_fill_grey.png The Vial's blood, in grey: the mod colours it along the bar, deep purple-red\n to bright yellow-orange. A vial_fill.png here replaces it with a painted one.\nring_mottle.png The mottled texture on the stamina and eitr rings. Grey, repeats along them.\nchip_back.png A status chip's dark disc and bronze rim. Square; the disc fills 26 of 32.\nchip_ring.png A status chip's timer ring, white (tinted with StatusRingColor). Same frame.\nmap_plate.png The bronze plate under the biome name. Sliced: 20 px left and right,\n 10 px top and bottom keep their size.\nhotbar_equipped_stroke.png The outline around the equipped slot, white (tinted by\n EquippedOutlineColor), fading to clear at the bottom right.\nbackpack_panel.png The wooden panels behind the backpack (hotbar row, backpack, armour\n and weight). Sliced: 28 px on every side keep their size.\nwind_arrow.png The wind marker when WindOnRim is off. Square, shown as painted.\nhotbar_wood.png The hotbar panel by day. Border 14 px on every side; the middle repeats\n (tiles) rather than stretching. Built in: 412 x 128 of planks.\nhotbar_wood_night.png The hotbar panel at night, the same way.\nhotbar_inset.png The bevelled edge around each hotbar slot (the middle is clear).\n Sliced, border 8 px.\nhotbar_equipped.png The square behind the equipped item. Sliced, border 8 px. Paint it\n white, the mod tints it with SelectedColor.\ngrit.png The grainy grime laid over the rings and bar. Tiles. Needs a restart.\n\nThe Vial health bar (Health = Vial), all drawn at 2 pixels per HUD unit:\nvial_bulb.png Optional: a whole flask painted full of blood, shown instead of the two\n layers below (no template; the older look).\nvial_flask_empty.png The flask as empty glass and bronze, and\nvial_flask_blood.png its blood on its own: revealed from the left with the tube, so the flask\n and tube are one bar.\nvial_mask.png The tube's shape. Only its alpha is used: the blood and glass are clipped\n to it. Sliced: left 8 px and right 16 px (the rounded end) keep their size.\n The tube starts under the flask's centre, hidden by the flask.\nvial_outline.png The bronze band around the tube, middle and left end open (it carries on\n from the flask's neck). Left 8 px and right 24 px (the rounded end) keep\n their size; the 44 px between them repeats.\nvial_rivet_0..5.png Six rivets. The mod puts one over each 25 hp divider, top and bottom,\n each a little different in size, spot and turn.\nvial_fill.png turns from red to orange along its length (fully orange 300 units in), so a longer bar is more orange.\nvial_fill.png The blood. Shown at its painted size and revealed from the left. Its left\n end sits under the flask, so match the flask's neck there.\nvial_track.png The empty glass behind the blood.\n\nTo get fresh templates in this folder, set WriteTemplates = true in the config. That rewrites\nthis folder only; painted files in the textures folder are left alone.\n"; public static string Folder => Path.Combine(Path.GetDirectoryName(typeof(Skin).Assembly.Location) ?? ".", "textures"); public static string TemplateFolder => Path.Combine(Folder, "templates"); public static int Version => _version; private static Texture2D AtlasTexture() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if ((Object)(object)_atlas != (Object)null) { return _atlas; } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; if (ImageConversion.LoadImage(val, Convert.FromBase64String(BakedTextures.Atlas))) { _atlas = val; } else { RingHUDPlugin.Log.LogWarning((object)"Draugrville UI: the built-in texture atlas could not be decoded; pieces fall back to the mod's own drawing."); } return _atlas; } private static byte[] PiecePng(string name) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0069: Expected O, but got Unknown //IL_006f: Expected O, but got Unknown if (BakedTextures.Png.TryGetValue(name, out var value)) { return Convert.FromBase64String(value); } if (!BakedTextures.AtlasRects.TryGetValue(name, out var value2)) { return null; } Texture2D val = AtlasTexture(); if ((Object)(object)val == (Object)null) { return null; } Texture2D val2 = new Texture2D(value2[2], value2[3], (TextureFormat)4, false); val2.SetPixels(val.GetPixels(value2[0], value2[1], value2[2], value2[3])); val2.Apply(); byte[] result = ImageConversion.EncodeToPNG(val2); Object.Destroy((Object)val2); return result; } public static Sprite Load(string name, Vector4 border = default(Vector4)) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) if (Cache.TryGetValue(name, out var value)) { return value; } string text = Path.Combine(Folder, name + ".png"); value = null; if (File.Exists(text)) { try { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; if (ImageConversion.LoadImage(val, File.ReadAllBytes(text))) { value = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, border); } else { RingHUDPlugin.Log.LogWarning((object)("Draugrville UI textures: could not decode " + text)); } } catch (Exception ex) { RingHUDPlugin.Log.LogWarning((object)("Draugrville UI textures: could not read " + text + ": " + ex.Message)); } } if ((Object)(object)value == (Object)null && RingHUDPlugin.BuiltInArt.Value && BakedTextures.AtlasRects.TryGetValue(name, out var value2)) { Texture2D val2 = AtlasTexture(); if ((Object)(object)val2 != (Object)null) { value = Sprite.Create(val2, new Rect((float)value2[0], (float)value2[1], (float)value2[2], (float)value2[3]), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, border); } } if ((Object)(object)value == (Object)null && RingHUDPlugin.BuiltInArt.Value && BakedTextures.Png.TryGetValue(name, out var value3)) { Texture2D val3 = new Texture2D(2, 2, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; if (ImageConversion.LoadImage(val3, Convert.FromBase64String(value3))) { value = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, border); } } Cache[name] = value; return value; } public static void Bind(Image img, string name, Func<Sprite> fallback, Vector4 border = default(Vector4), Type type = (Type)0) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Binding binding = new Binding { Image = img, Name = name, Fallback = fallback, Border = border, Type = type }; Bindings.Add(binding); Apply(binding); } private static void Apply(Binding b) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)b.Image == (Object)null)) { Sprite val = Load(b.Name, b.Border) ?? b.Fallback(); if ((Object)(object)b.Image.sprite != (Object)(object)val) { b.Image.sprite = val; } if (b.Image.type != b.Type) { b.Image.type = b.Type; } } } public static void Reload() { foreach (Sprite value in Cache.Values) { if ((Object)(object)value != (Object)null) { if ((Object)(object)value.texture != (Object)null && (Object)(object)value.texture != (Object)(object)_atlas) { Object.Destroy((Object)(object)value.texture); } Object.Destroy((Object)(object)value); } } Cache.Clear(); _version++; Bindings.RemoveAll((Binding b) => (Object)(object)b.Image == (Object)null); foreach (Binding binding in Bindings) { Apply(binding); } RingHUDPlugin.Log.LogInfo((object)("Draugrville UI textures reloaded from " + Folder)); try { MessageHud instance = MessageHud.instance; if (instance != null) { instance.ShowMessage((MessageType)2, "Draugrville UI: textures reloaded", 0, (Sprite)null, false, true); } } catch { } } private static void Write(string name, Texture2D tex, bool force) { string path = Path.Combine(TemplateFolder, name + ".png"); if ((force || !File.Exists(path)) && !((Object)(object)tex == (Object)null)) { File.WriteAllBytes(path, ImageConversion.EncodeToPNG(tex)); } } public static void WriteTemplates(bool force) { try { Directory.CreateDirectory(Folder); MoveOldTemplates(); Directory.CreateDirectory(TemplateFolder); Write("food_circle", FoodLayout.SharedCircle().texture, force); Write("food_ring", FoodLayout.SharedRing().texture, force); Write("map_backdrop", FoodLayout.SharedCircle().texture, force); Write("hotbar_inset", WoodPanel.InsetSprite().texture, force); Write("grit", GritTexture.Get(), force); Write("healthbar_frame", BarTemplates.Frame(), force); Write("healthbar_track", BarTemplates.Track(), force); List<string> list = new List<string>(BakedTextures.AtlasRects.Keys); list.AddRange(BakedTextures.Png.Keys); foreach (string item in list) { string path = Path.Combine(TemplateFolder, item + ".png"); if (force || !File.Exists(path)) { byte[] array = PiecePng(item); if (array != null) { File.WriteAllBytes(path, array); } } } string path2 = Path.Combine(TemplateFolder, "README.txt"); if (force || !File.Exists(path2)) { File.WriteAllText(path2, "Draugrville UI textures\n================\n\nThese are templates: the mod draws from code and never reads this folder. To replace a\npiece, copy its PNG one level up into the textures folder, paint over it in any image\neditor, save it, and press the reload key in game (F11 unless you changed it in the config).\nDelete the file from the textures folder and the mod goes back to drawing that piece itself.\n\nKeep the backgrounds transparent. Sizes are only suggestions: you can use any size, the\npiece is stretched to fit. The exceptions are the sliced ones, where the border (the outer\nN pixels of the image) keeps its thickness and only the middle stretches.\n\nhealthbar_frame.png The metal frame around the health bar. Sliced, border 10 px.\nhealthbar_track.png The empty part of the bar behind the fill. Stretched.\nhealthbar_fill.png The red fill. Revealed from the left as health drops, never squashed,\n so paint it as the full bar. The per-25-hp lightening does not apply\n to a painted fill.\nhealthbar_plate.png The diamond plate the number sits on. Square, drawn centred.\nfood_circle.png The round backdrop of each food slot. Square.\nfood_ring.png The timer ring around a food slot. Square, drains clockwise from the\n top. Paint it white: the mod tints it green, gold and red.\nmap_backdrop.png The parchment disc under the minimap. Square.\nmap_rim.png The ring around the minimap. Square, shown as painted. Built in: the\n Vial's dark bronze band, lit on top and shaded underneath. Its eight\n rivets are the vial_rivet pieces.\nwind_arrow_white.png The wind marker on top of the map's rim (WindOnRim): an anchor, light on its\n left half and shaded on its right. Ring end points with the wind.\nvial_fill_grey.png The Vial's blood, in grey: the mod colours it along the bar, deep purple-red\n to bright yellow-orange. A vial_fill.png here replaces it with a painted one.\nring_mottle.png The mottled texture on the stamina and eitr rings. Grey, repeats along them.\nchip_back.png A status chip's dark disc and bronze rim. Square; the disc fills 26 of 32.\nchip_ring.png A status chip's timer ring, white (tinted with StatusRingColor). Same frame.\nmap_plate.png The bronze plate under the biome name. Sliced: 20 px left and right,\n 10 px top and bottom keep their size.\nhotbar_equipped_stroke.png The outline around the equipped slot, white (tinted by\n EquippedOutlineColor), fading to clear at the bottom right.\nbackpack_panel.png The wooden panels behind the backpack (hotbar row, backpack, armour\n and weight). Sliced: 28 px on every side keep their size.\nwind_arrow.png The wind marker when WindOnRim is off. Square, shown as painted.\nhotbar_wood.png The hotbar panel by day. Border 14 px on every side; the middle repeats\n (tiles) rather than stretching. Built in: 412 x 128 of planks.\nhotbar_wood_night.png The hotbar panel at night, the same way.\nhotbar_inset.png The bevelled edge around each hotbar slot (the middle is clear).\n Sliced, border 8 px.\nhotbar_equipped.png The square behind the equipped item. Sliced, border 8 px. Paint it\n white, the mod tints it with SelectedColor.\ngrit.png The grainy grime laid over the rings and bar. Tiles. Needs a restart.\n\nThe Vial health bar (Health = Vial), all drawn at 2 pixels per HUD unit:\nvial_bulb.png Optional: a whole flask painted full of blood, shown instead of the two\n layers below (no template; the older look).\nvial_flask_empty.png The flask as empty glass and bronze, and\nvial_flask_blood.png its blood on its own: revealed from the left with the tube, so the flask\n and tube are one bar.\nvial_mask.png The tube's shape. Only its alpha is used: the blood and glass are clipped\n to it. Sliced: left 8 px and right 16 px (the rounded end) keep their size.\n The tube starts under the flask's centre, hidden by the flask.\nvial_outline.png The bronze band around the tube, middle and left end open (it carries on\n from the flask's neck). Left 8 px and right 24 px (the rounded end) keep\n their size; the 44 px between them repeats.\nvial_rivet_0..5.png Six rivets. The mod puts one over each 25 hp divider, top and bottom,\n each a little different in size, spot and turn.\nvial_fill.png turns from red to orange along its length (fully orange 300 units in), so a longer bar is more orange.\nvial_fill.png The blood. Shown at its painted size and revealed from the left. Its left\n end sits under the flask, so match the flask's neck there.\nvial_track.png The empty glass behind the blood.\n\nTo get fresh templates in this folder, set WriteTemplates = true in the config. That rewrites\nthis folder only; painted files in the textures folder are left alone.\n"); } string path3 = Path.Combine(Folder, "README.txt"); if (!File.Exists(path3)) { File.WriteAllText(path3, "Draugrville UI textures\n================\n\nThis folder is read by the mod. Any PNG here with one of the template names replaces the mod's\nown drawing of that piece. The templates themselves are in the templates folder, with a README\nlisting what each one is. Copy one up into this folder, paint it, and press F11 in game.\n"); } RingHUDPlugin.Log.LogInfo((object)("Draugrville UI textures: templates are in " + TemplateFolder + "; PNGs placed in " + Folder + " replace the mod's drawing")); } catch (Exception ex) { RingHUDPlugin.Log.LogWarning((object)("Draugrville UI textures: could not write templates: " + ex.Message)); } } private static void MoveOldTemplates() { string path = Path.Combine(Folder, "README.txt"); if (!File.Exists(path) || Directory.Exists(TemplateFolder) || File.ReadAllText(path).IndexOf("Every PNG in this folder replaces", StringComparison.Ordinal) < 0) { return; } Directory.CreateDirectory(TemplateFolder); int num = 0; string[] names = Names; foreach (string text in names) { string text2 = Path.Combine(Folder, text + ".png"); string text3 = Path.Combine(TemplateFolder, text + ".png"); if (File.Exists(text2) && !File.Exists(text3)) { File.Move(text2, text3); num++; } } File.Delete(path); RingHUDPlugin.Log.LogInfo((object)("Draugrville UI textures: moved " + num + " template PNGs from " + Folder + " into " + TemplateFolder + " so they no longer replace the mod's own drawing. Copy a painted one back up to use it.")); } } internal static class BarTemplates { public static Texture2D Frame() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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) Texture2D val = New(192, 48); Color32[] array = (Color32[])(object)new Color32[9216]; Color frame = StylePreset.Get(FrameStyle.Bronze).Frame; for (int i = 0; i < 48; i++) { for (int j = 0; j < 192; j++) { int num = Mathf.Min(Mathf.Min(j, 191 - j), Mathf.Min(i, 47 - i)); if (num >= 10) { array[i * 192 + j] = new Color32((byte)0, (byte)0, (byte)0, (byte)0); continue; } float num2 = (float)num / 10f; float num3 = ((num2 < 0.15f) ? 0.45f : ((num2 < 0.4f) ? 1.35f : ((num2 < 0.7f) ? 1f : 0.6f))); Color val2 = ((num3 <= 1f) ? RingDecor.Shade(frame, num3) : Color.Lerp(frame, Color.white, num3 - 1f)); val2.a = 1f; array[i * 192 + j] = Color32.op_Implicit(val2); } } val.SetPixels32(array); val.Apply(); return val; } public static Texture2D Track() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Texture2D val = New(256, 32); Color32[] array = (Color32[])(object)new Color32[8192]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 256; j++) { array[i * 256 + j] = Color32.op_Implicit(new Color(0.16f, 0.04f, 0.035f, 0.92f)); } } val.SetPixels32(array); val.Apply(); return val; } private static Texture2D New(int w, int h) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return new Texture2D(w, h, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; } } internal static class Tx { private const float Eps = 0.01f; private static bool Same(Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(a.x - b.x) < 0.01f) { return Mathf.Abs(a.y - b.y) < 0.01f; } return false; } private static bool Same(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(a.x - b.x) < 0.01f && Mathf.Abs(a.y - b.y) < 0.01f) { return Mathf.Abs(a.z - b.z) < 0.01f; } return false; } public static void Scale(Transform t, Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!Same(t.localScale, v)) { t.localScale = v; } } public static void Pos(Transform t, Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!Same(t.position, v)) { t.position = v; } } public static void Anchored(RectTransform t, Vector2 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!Same(t.anchoredPosition, v)) { t.anchoredPosition = v; } } public static void Size(RectTransform t, Vector2 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!Same(t.sizeDelta, v)) { t.sizeDelta = v; } } public static void Anchors(RectTransform t, Vector2 min, Vector2 max, Vector2 pivot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (t.anchorMin != min) { t.anchorMin = min; } if (t.anchorMax != max) { t.anchorMax = max; } if (t.pivot != pivot) { t.pivot = pivot; } } public static void Active(GameObject g, bool on) { if (g.activeSelf != on) { g.SetActive(on); } } public static void Enabled(Behaviour b, bool on) { if (b.enabled != on) { b.enabled = on; } } public static void First(Transform t) { if (t.GetSiblingIndex() != 0) { t.SetAsFirstSibling(); } } public static void Last(Transform t) { if ((Object)(object)t.parent != (Object)null && t.GetSiblingIndex() != t.parent.childCount - 1) { t.SetAsLastSibling(); } } public static void Isolate(Component c) { if (!((Object)(object)c == (Object)null) && !((Object)(object)c.GetComponent<Canvas>() != (Object)null)) { c.gameObject.AddComponent<Canvas>(); } } } internal static class Perf { public const int Vanilla = 0; public const int Food = 1; public const int Status = 2; public const int Minimap = 3; public const int Hotbar = 4; public const int KeyHints = 5; public const int Rings = 6; public const int Count = 7; private static readonly string[] Names = new string[7] { "hideVanillaBars", "food", "statusEffects", "minimap", "hotbar", "keyHints", "ringsAndBar" }; private static readonly double[] Totals = new double[7]; private static readonly Stopwatch Watch = Stopwatch.StartNew(); private static long _last; private static int _frames; private static float _nextLog; public static void Begin() { _last = Watch.ElapsedTicks; } public static void End(int section) { long elapsedTicks = Watch.ElapsedTicks; Totals[section] += (double)(elapsedTicks - _last) * 1000.0 / (double)Stopwatch.Frequency; _last = elapsedTicks; } public static void Frame() { _frames++; if (!Bisect.On && !(Time.unscaledTime < _nextLog)) { _nextLog = Time.unscaledTime + 5f; RingHUDPlugin.Log.LogInfo((object)("Draugrville UI ms/frame:" + Report() + " fps=" + ((float)_frames / 5f).ToString("0"))); _frames = 0; } } public static string Report() { if (_frames == 0) {