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 Skald v0.3.1
plugins/Skald.dll
Decompiled a day 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.Runtime.Versioning; using System.Security.Cryptography; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GBV.Shared; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Guys Being Vikings")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.3.1.0")] [assembly: AssemblyInformationalVersion("0.3.1+ddce693f5475fe516062ca3436d198526f66ddd3")] [assembly: AssemblyProduct("Skald")] [assembly: AssemblyTitle("Skald")] [assembly: AssemblyVersion("0.3.1.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 GBV.Shared { internal static class Theme { public static readonly Color StoneDeep = Hex("0A0B0D"); public static readonly Color Stone = Hex("14161A"); public static readonly Color StoneHi = Hex("1F2329"); public static readonly Color StoneLit = Hex("2D323A"); public static readonly Color Carve = Hex("060708"); public static readonly Color Brass = Hex("C9A45C"); public static readonly Color BrassHi = Hex("F2D9A0"); public static readonly Color BrassDim = Hex("6B5630"); public static readonly Color BrassInk = Hex("17110478"); public static readonly Color TextHi = Hex("F7F4EE"); public static readonly Color Text = Hex("D8D4CC"); public static readonly Color Muted = Hex("9FA0A2"); public static readonly Color Faint = Hex("74767A"); public static readonly Color Good = Hex("A6C978"); public static readonly Color Bad = Hex("DD6A57"); public static readonly Color Warn = Hex("E8B25C"); public const float Pad = 30f; public const float Inlay = 9f; public const float TabH = 46f; public const float RowH = 30f; public const float FooterH = 44f; public static GUIStyle Blank; public static GUIStyle Wordmark; public static GUIStyle Title; public static GUIStyle Lead; public static GUIStyle TabOn; public static GUIStyle TabOff; public static GUIStyle Heading; public static GUIStyle Body; public static GUIStyle BodyHi; public static GUIStyle Dim; public static GUIStyle Small; public static GUIStyle SmallRight; public static GUIStyle Mono; public static GUIStyle MonoDim; public static GUIStyle MonoEcho; public static GUIStyle Search; public static GUIStyle Field; public static GUIStyle FieldText; public static GUIStyle FieldArea; public static GUIStyle Console_; public static GUIStyle Link; public static GUIStyle LinkOn; public static GUIStyle Chip; public static GUIStyle ChipOn; public static GUIStyle Row; public static GUIStyle Action; public static GUIStyle ActionKey; public static GUIStyle Danger; public static GUIStyle Btn; public static GUIStyle BtnOn; public static GUIStyle BtnPrimary; public static GUIStyle BtnDanger; public static GUIStyle BtnSmall; public static GUIStyle BtnSmallOn; public static GUIStyle DropItem; public static GUIStyle TileName; public static GUIStyle TileNameHot; public static GUIStyle Glyph; public static GUIStyle ScrollbarV; public static GUIStyle ScrollbarThumb; public static GUIStyle Scroll; public static Texture2D Grain; public static Texture2D Px; private static bool _built; public static void EnsureBuilt() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0039: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Expected O, but got Unknown //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Expected O, but got Unknown //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Expected O, but got Unknown //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Expected O, but got Unknown //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Expected O, but got Unknown //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Expected O, but got Unknown //IL_0685: Expected O, but got Unknown //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Expected O, but got Unknown //IL_06bd: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Expected O, but got Unknown //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Expected O, but got Unknown //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Expected O, but got Unknown //IL_0736: Expected O, but got Unknown //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Expected O, but got Unknown //IL_086d: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Expected O, but got Unknown //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Expected O, but got Unknown //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Expected O, but got Unknown //IL_08ca: Expected O, but got Unknown //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_0927: Expected O, but got Unknown //IL_0927: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_0941: Expected O, but got Unknown //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_0950: Expected O, but got Unknown //IL_0955: Expected O, but got Unknown //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Unknown result type (might be due to invalid IL or missing references) if (!_built) { _built = true; Px = Solid(Color.white); Grain = StoneGrain(128); Blank = new GUIStyle(); Wordmark = Label(28, (FontStyle)1, TextHi); Title = Label(22, (FontStyle)1, TextHi); Lead = Label(17, (FontStyle)0, Text); Heading = Label(11, (FontStyle)1, Brass); Body = Label(13, (FontStyle)0, Text); BodyHi = Label(13, (FontStyle)1, TextHi); Dim = Label(13, (FontStyle)0, Muted); Small = Label(11, (FontStyle)0, Muted); SmallRight = Label(11, (FontStyle)0, Muted); SmallRight.alignment = (TextAnchor)5; Mono = Label(12, (FontStyle)0, TextHi); MonoDim = Label(12, (FontStyle)0, Muted); MonoEcho = Label(12, (FontStyle)1, Brass); TabOff = Ghost(46f, 13, (FontStyle)0, Muted, TextHi); TabOn = Ghost(46f, 13, (FontStyle)1, BrassHi, BrassHi); TabOff.alignment = (TextAnchor)4; TabOn.alignment = (TextAnchor)4; Link = Ghost(30f, 13, (FontStyle)0, Text, BrassHi); LinkOn = Ghost(30f, 13, (FontStyle)1, BrassHi, BrassHi); Link.alignment = (TextAnchor)4; LinkOn.alignment = (TextAnchor)4; Chip = Ghost(26f, 12, (FontStyle)0, Muted, BrassHi); ChipOn = Ghost(26f, 12, (FontStyle)1, Brass, BrassHi); Chip.alignment = (TextAnchor)4; ChipOn.alignment = (TextAnchor)4; Row = Ghost(30f, 13, (FontStyle)0, Text, BrassHi); Row.alignment = (TextAnchor)3; Row.padding = new RectOffset(12, 12, 0, 0); Action = Ghost(34f, 13, (FontStyle)1, Brass, BrassHi); Action.alignment = (TextAnchor)4; ActionKey = Ghost(34f, 13, (FontStyle)1, BrassInk, BrassInk); ActionKey.alignment = (TextAnchor)4; Danger = Ghost(34f, 13, (FontStyle)1, Bad, Hex("FF8B78")); Danger.alignment = (TextAnchor)4; Btn = Plate(34, 4, Hex("1B1F25"), Hex("272D35"), Hex("3B434E"), Hex("262D36"), Hex("39424E"), Hex("6E5F3A"), Hex("14171C"), Hex("1B2027"), Brass, Text, 13); BtnOn = Plate(34, 4, Hex("312B18"), Hex("43391F"), Brass, Hex("3B3320"), Hex("4E4227"), BrassHi, Hex("2A2515"), Hex("352E1A"), BrassHi, BrassHi, 13); BtnPrimary = Plate(34, 4, Hex("A8873A"), Hex("D0A63A"), Hex("F2D9A0"), Hex("C09A38"), Hex("EBC97A"), Hex("F7E6BE"), Hex("8A6E2C"), Hex("A8873A"), Hex("F2D9A0"), Hex("151003"), 13); BtnPrimary.fontStyle = (FontStyle)1; BtnDanger = Plate(34, 4, Hex("5A2621"), Hex("7A332C"), Hex("A8453A"), Hex("7A332C"), Hex("9C4239"), Hex("DD6A57"), Hex("431B17"), Hex("5A2621"), Hex("DD6A57"), Hex("F3C8C0"), 13); BtnDanger.fontStyle = (FontStyle)1; BtnSmall = Plate(26, 3, Hex("1B1F25"), Hex("272D35"), Hex("3B434E"), Hex("262D36"), Hex("39424E"), Hex("6E5F3A"), Hex("14171C"), Hex("1B2027"), Brass, Text, 12); BtnSmallOn = Plate(26, 3, Hex("312B18"), Hex("43391F"), Brass, Hex("3B3320"), Hex("4E4227"), BrassHi, Hex("2A2515"), Hex("352E1A"), BrassHi, TextHi, 12); DropItem = Ghost(28f, 13, (FontStyle)0, Text, BrassHi); DropItem.alignment = (TextAnchor)3; DropItem.padding = new RectOffset(12, 12, 0, 0); GUIStyle val = new GUIStyle(GUI.skin.textField); val.normal.background = Solid(Carve); val.normal.textColor = TextHi; val.hover.background = Solid(StoneHi); val.hover.textColor = TextHi; val.focused.background = Solid(StoneLit); val.focused.textColor = TextHi; val.border = new RectOffset(0, 0, 0, 0); val.padding = new RectOffset(10, 10, 0, 0); val.margin = new RectOffset(0, 0, 0, 0); val.fontSize = 15; val.fixedHeight = 34f; val.alignment = (TextAnchor)3; Search = val; Field = new GUIStyle(Search) { fontSize = 13, fixedHeight = 26f, alignment = (TextAnchor)4, padding = new RectOffset(2, 2, 0, 0) }; FieldText = new GUIStyle(Search) { fontSize = 13, fixedHeight = 26f, alignment = (TextAnchor)3, padding = new RectOffset(8, 8, 0, 0) }; FieldArea = new GUIStyle(Search) { fontSize = 13, fixedHeight = 0f, alignment = (TextAnchor)0, padding = new RectOffset(10, 10, 8, 8), wordWrap = true }; Console_ = new GUIStyle(Search) { fontSize = 13, fixedHeight = 0f, alignment = (TextAnchor)3, padding = new RectOffset(4, 4, 0, 0) }; Console_.normal.textColor = TextHi; Console_.focused.textColor = TextHi; Console_.hover.textColor = TextHi; Texture2D background = Solid(new Color(0f, 0f, 0f, 0f)); Console_.normal.background = background; Console_.focused.background = background; Console_.hover.background = background; Console_.active.background = background; TileName = Label(11, (FontStyle)0, Text); TileName.alignment = (TextAnchor)1; TileName.wordWrap = true; TileName.clipping = (TextClipping)1; TileNameHot = Label(11, (FontStyle)1, TextHi); TileNameHot.alignment = (TextAnchor)1; TileNameHot.wordWrap = true; TileNameHot.clipping = (TextClipping)1; Glyph = Label(20, (FontStyle)0, Hex("4A3F33")); Glyph.alignment = (TextAnchor)4; Scroll = new GUIStyle(); GUIStyle val2 = new GUIStyle(GUI.skin.verticalScrollbar); val2.normal.background = Solid(Hex("0A0807")); val2.border = new RectOffset(0, 0, 0, 0); val2.fixedWidth = 3f; val2.margin = new RectOffset(10, 0, 0, 0); val2.padding = new RectOffset(0, 0, 0, 0); ScrollbarV = val2; GUIStyle val3 = new GUIStyle(GUI.skin.verticalScrollbarThumb); val3.normal.background = Solid(BrassDim); val3.hover.background = Solid(Brass); val3.active.background = Solid(BrassHi); val3.border = new RectOffset(0, 0, 0, 0); val3.fixedWidth = 3f; val3.margin = new RectOffset(0, 0, 0, 0); val3.padding = new RectOffset(0, 0, 0, 0); ScrollbarThumb = val3; GUI.skin.verticalScrollbarUpButton = GUIStyle.none; GUI.skin.verticalScrollbarDownButton = GUIStyle.none; GUI.skin.horizontalScrollbarLeftButton = GUIStyle.none; GUI.skin.horizontalScrollbarRightButton = GUIStyle.none; GUI.skin.verticalScrollbar = ScrollbarV; GUI.skin.verticalScrollbarThumb = ScrollbarThumb; GUI.skin.settings.selectionColor = new Color(Brass.r, Brass.g, Brass.b, 0.3f); GUI.skin.settings.cursorColor = BrassHi; } } public static void DrawSlab(Rect r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00c7: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) Fill(r, Stone); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.95f); GUI.DrawTextureWithTexCoords(r, (Texture)(object)Grain, new Rect(0f, 0f, ((Rect)(ref r)).width / (float)((Texture)Grain).width, ((Rect)(ref r)).height / (float)((Texture)Grain).height)); GUI.color = color; FillFade(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 34f), Carve, 0.6f, topDown: true); FillFade(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 34f, ((Rect)(ref r)).width, 34f), Carve, 0.6f, topDown: false); Outline(r, Hex("000000"), 1f); Fill(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width - 2f, 1f), new Color(StoneLit.r, StoneLit.g, StoneLit.b, 0.9f)); Fill(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, 1f, ((Rect)(ref r)).height - 2f), new Color(StoneLit.r, StoneLit.g, StoneLit.b, 0.7f)); Fill(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).yMax - 2f, ((Rect)(ref r)).width - 2f, 1f), new Color(0f, 0f, 0f, 0.65f)); Fill(new Rect(((Rect)(ref r)).xMax - 2f, ((Rect)(ref r)).y + 1f, 1f, ((Rect)(ref r)).height - 2f), new Color(0f, 0f, 0f, 0.5f)); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 9f, ((Rect)(ref r)).y + 9f, ((Rect)(ref r)).width - 18f, ((Rect)(ref r)).height - 18f); Outline(r2, new Color(Brass.r, Brass.g, Brass.b, 0.75f), 1f); Outline(new Rect(((Rect)(ref r2)).x + 1f, ((Rect)(ref r2)).y + 1f, ((Rect)(ref r2)).width - 2f, ((Rect)(ref r2)).height - 2f), new Color(0f, 0f, 0f, 0.55f), 1f); Rivet(((Rect)(ref r2)).x, ((Rect)(ref r2)).y); Rivet(((Rect)(ref r2)).xMax, ((Rect)(ref r2)).y); Rivet(((Rect)(ref r2)).x, ((Rect)(ref r2)).yMax); Rivet(((Rect)(ref r2)).xMax, ((Rect)(ref r2)).yMax); } private static void Rivet(float cx, float cy) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(cx - 3f, cy - 3f, 6f, 6f); Fill(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, ((Rect)(ref r)).width + 2f, ((Rect)(ref r)).height + 2f), new Color(0f, 0f, 0f, 0.6f)); Fill(r, BrassDim); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 2f), Brass); Fill(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, 2f, 2f), BrassHi); } public static void Fill(Rect r, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)Px); GUI.color = color; } private static void FillFade(Rect r, Color c, float alpha, bool topDown) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_005c: 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) int num = 8; for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num; float num3 = alpha * (topDown ? (1f - num2) : num2); float num4 = ((Rect)(ref r)).height / (float)num; Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + num4 * (float)i, ((Rect)(ref r)).width, num4 + 1f), new Color(c.r, c.g, c.b, num3)); } } public static void Outline(Rect r, Color c, float w) { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, w), c); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - w, ((Rect)(ref r)).width, w), c); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, w, ((Rect)(ref r)).height), c); Fill(new Rect(((Rect)(ref r)).xMax - w, ((Rect)(ref r)).y, w, ((Rect)(ref r)).height), c); } public static void Hairline(Rect r, float alpha = 0.28f) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1f), new Color(Brass.r, Brass.g, Brass.b, alpha)); } public static void Groove(Rect r) { //IL_001a: 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_0049: 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) Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1f), Carve); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, 1f), new Color(StoneLit.r, StoneLit.g, StoneLit.b, 0.8f)); } public static string Spaced(string s) { if (string.IsNullOrEmpty(s)) { return s; } StringBuilder stringBuilder = new StringBuilder(s.Length * 2); string text = s.ToUpperInvariant(); foreach (char value in text) { stringBuilder.Append(value).Append(' '); } return stringBuilder.ToString().TrimEnd(); } private static GUIStyle Label(int size, FontStyle style, Color colour) { //IL_000a: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //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_0047: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = size, fontStyle = style }; val.normal.textColor = colour; val.margin = new RectOffset(0, 0, 0, 0); val.padding = new RectOffset(0, 0, 0, 0); val.alignment = (TextAnchor)3; val.wordWrap = false; return val; } private static GUIStyle Ghost(float h, int size, FontStyle style, Color normal, Color hover) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d2: 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_00e1: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown Texture2D background = Solid(new Color(0f, 0f, 0f, 0f)); GUIStyle val = new GUIStyle(GUI.skin.button); val.normal.background = background; val.normal.textColor = normal; val.hover.background = background; val.hover.textColor = hover; val.active.background = background; val.active.textColor = hover; val.onNormal.background = background; val.onNormal.textColor = hover; val.onHover.background = background; val.onHover.textColor = hover; val.onActive.background = background; val.onActive.textColor = hover; val.border = new RectOffset(0, 0, 0, 0); val.padding = new RectOffset(8, 8, 0, 0); val.margin = new RectOffset(0, 0, 0, 0); val.fixedHeight = h; val.fontSize = size; val.fontStyle = style; val.alignment = (TextAnchor)3; val.wordWrap = false; val.clipping = (TextClipping)1; return val; } private static GUIStyle Plate(int h, int radius, Color nBot, Color nTop, Color nEdge, Color hBot, Color hTop, Color hEdge, Color aBot, Color aTop, Color aEdge, Color text, int fontSize) { //IL_000a: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0025: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_011e: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.button); val.normal.background = PlateTex(h, radius, nBot, nTop, nEdge); val.normal.textColor = text; val.hover.background = PlateTex(h, radius, hBot, hTop, hEdge); val.hover.textColor = text; val.active.background = PlateTex(h, radius, aBot, aTop, aEdge); val.active.textColor = text; val.onNormal.background = PlateTex(h, radius, aBot, aTop, aEdge); val.onNormal.textColor = text; val.onHover.background = PlateTex(h, radius, aBot, aTop, aEdge); val.onHover.textColor = text; val.onActive.background = PlateTex(h, radius, aBot, aTop, aEdge); val.onActive.textColor = text; val.border = new RectOffset(radius + 3, radius + 3, 0, 0); val.padding = new RectOffset(10, 10, 0, 0); val.margin = new RectOffset(0, 0, 0, 0); val.fixedHeight = h; val.fontSize = fontSize; val.alignment = (TextAnchor)4; val.wordWrap = false; val.clipping = (TextClipping)1; return val; } private static Texture2D PlateTex(int h, int radius, Color bottom, Color top, Color edge) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_002a: 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_002d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) int num = radius * 2 + 8; Texture2D val = new Texture2D(num, h, (TextureFormat)5, false); for (int i = 0; i < h; i++) { float num2 = ((h <= 1) ? 0f : ((float)i / (float)(h - 1))); Color val2 = Color.Lerp(bottom, top, num2); if (i >= h - 1) { val2 = Color.Lerp(val2, Color.white, 0.12f); } for (int j = 0; j < num; j++) { float num3 = Sdf(j, i, num, h, radius); float num4 = Mathf.Clamp01(0.5f - num3); if (num4 <= 0f) { val.SetPixel(j, i, new Color(0f, 0f, 0f, 0f)); continue; } float num5 = Mathf.Clamp01(0.5f - (num3 + 1.15f)); Color val3 = Color.Lerp(edge, val2, num5); val.SetPixel(j, i, new Color(val3.r, val3.g, val3.b, num4)); } } return Finish(val); } private static float Sdf(float x, float y, int w, int h, int radius) { float num = Mathf.Min((float)radius, (float)Mathf.Min(w, h) * 0.5f); float num2 = x + 0.5f; float num3 = y + 0.5f; float num4 = Mathf.Clamp(num2, num, (float)w - num); float num5 = Mathf.Clamp(num3, num, (float)h - num); float num6 = num2 - num4; float num7 = num3 - num5; return Mathf.Sqrt(num6 * num6 + num7 * num7) - num; } private static Color Hex(string hex) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) int num = Convert.ToInt32(hex.Substring(0, 2), 16); int num2 = Convert.ToInt32(hex.Substring(2, 2), 16); int num3 = Convert.ToInt32(hex.Substring(4, 2), 16); float num4 = ((hex.Length >= 8) ? ((float)Convert.ToInt32(hex.Substring(6, 2), 16) / 255f) : 1f); return new Color((float)num / 255f, (float)num2 / 255f, (float)num3 / 255f, num4); } private static Texture2D Finish(Texture2D t) { ((Object)t).hideFlags = (HideFlags)61; ((Texture)t).filterMode = (FilterMode)1; ((Texture)t).wrapMode = (TextureWrapMode)0; t.Apply(); return t; } private static Texture2D Solid(Color c) { //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_000c: 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_001e: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false); val.SetPixel(0, 0, c); ((Texture)val).wrapMode = (TextureWrapMode)1; return Finish(val); } private static Texture2D StoneGrain(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)5, false); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num = (0f + Tileable(j, i, size, 8f) * 0.5f + Tileable(j, i, size, 19f) * 0.32f + Tileable(j, i, size, 43f) * 0.18f - 0.5f) * 2f; float num2 = Mathf.Abs(num) * 0.55f; Color val2 = ((num >= 0f) ? new Color(StoneHi.r, StoneHi.g, StoneHi.b, num2) : new Color(Carve.r, Carve.g, Carve.b, num2 * 1.5f)); val.SetPixel(j, i, val2); } } return Finish(val); } private static float Tileable(int x, int y, int size, float freq) { float num = (float)x / (float)size; float num2 = (float)y / (float)size; float num3 = Mathf.PerlinNoise(num * freq, num2 * freq); float num4 = Mathf.PerlinNoise((num - 1f) * freq, num2 * freq); float num5 = Mathf.PerlinNoise(num * freq, (num2 - 1f) * freq); float num6 = Mathf.PerlinNoise((num - 1f) * freq, (num2 - 1f) * freq); return Mathf.Lerp(Mathf.Lerp(num3, num4, num), Mathf.Lerp(num5, num6, num), num2); } } public class JsonException : Exception { public JsonException(string message) : base(message) { } } public sealed class JsonValue { public enum Kind { Null, Bool, Number, String, Array, Object } private bool _bool; private double _number; private bool _isFloat; private string _string; private List<JsonValue> _array; private Dictionary<string, JsonValue> _object; public static readonly JsonValue Null = new JsonValue { ValueKind = Kind.Null }; private const int MaxDepth = 64; public Kind ValueKind { get; private set; } public bool IsNull => ValueKind == Kind.Null; public JsonValue this[string key] { get { if (ValueKind != Kind.Object) { return Null; } if (!_object.TryGetValue(key, out var value)) { return Null; } return value; } } public JsonValue this[int index] { get { if (ValueKind != Kind.Array || index < 0 || index >= _array.Count) { return Null; } return _array[index]; } } public int Count { get { if (ValueKind == Kind.Array) { return _array.Count; } if (ValueKind == Kind.Object) { return _object.Count; } return 0; } } public IEnumerable<KeyValuePair<string, JsonValue>> Members { get { if (ValueKind != Kind.Object) { return new KeyValuePair<string, JsonValue>[0]; } return _object; } } public IEnumerable<JsonValue> Items { get { if (ValueKind != Kind.Array) { return new JsonValue[0]; } return _array; } } private JsonValue() { } public static JsonValue Bool(bool v) { return new JsonValue { ValueKind = Kind.Bool, _bool = v }; } public static JsonValue Number(double v) { return new JsonValue { ValueKind = Kind.Number, _number = v }; } public static JsonValue Number(float v) { return new JsonValue { ValueKind = Kind.Number, _number = v, _isFloat = true }; } public static JsonValue String(string v) { if (v != null) { return new JsonValue { ValueKind = Kind.String, _string = v }; } return Null; } public static JsonValue NewArray() { return new JsonValue { ValueKind = Kind.Array, _array = new List<JsonValue>() }; } public static JsonValue NewObject() { return new JsonValue { ValueKind = Kind.Object, _object = new Dictionary<string, JsonValue>(StringComparer.Ordinal) }; } public JsonValue Add(JsonValue v) { if (ValueKind != Kind.Array) { throw new JsonException("Add called on a " + ValueKind); } _array.Add(v ?? Null); return this; } public JsonValue Set(string key, JsonValue v) { if (ValueKind != Kind.Object) { throw new JsonException("Set called on a " + ValueKind); } _object[key] = v ?? Null; return this; } public JsonValue Set(string key, string v) { return Set(key, String(v)); } public JsonValue Set(string key, double v) { return Set(key, Number(v)); } public JsonValue Set(string key, float v) { return Set(key, Number(v)); } public JsonValue Set(string key, int v) { return Set(key, Number((double)v)); } public JsonValue Set(string key, long v) { return Set(key, Number((double)v)); } public JsonValue Set(string key, bool v) { return Set(key, Bool(v)); } public string AsString(string fallback = null) { if (ValueKind != Kind.String) { return fallback; } return _string; } public double AsDouble(double fallback = 0.0) { if (ValueKind != Kind.Number) { return fallback; } return _number; } public float AsFloat(float fallback = 0f) { if (ValueKind != Kind.Number) { return fallback; } return (float)_number; } public int AsInt(int fallback = 0) { if (ValueKind != Kind.Number) { return fallback; } return (int)Math.Round(_number); } public long AsLong(long fallback = 0L) { if (ValueKind != Kind.Number) { return fallback; } return (long)Math.Round(_number); } public bool AsBool(bool fallback = false) { if (ValueKind != Kind.Bool) { return fallback; } return _bool; } public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); Write(stringBuilder, this, -1, 0); return stringBuilder.ToString(); } public string ToPrettyString() { StringBuilder stringBuilder = new StringBuilder(); Write(stringBuilder, this, 2, 0); return stringBuilder.ToString(); } private static void Write(StringBuilder sb, JsonValue v, int indent, int depth) { bool flag = indent >= 0; switch (v.ValueKind) { case Kind.Null: sb.Append("null"); break; case Kind.Bool: sb.Append(v._bool ? "true" : "false"); break; case Kind.Number: WriteNumber(sb, v._number, v._isFloat); break; case Kind.String: WriteString(sb, v._string); break; case Kind.Array: { if (v._array.Count == 0) { sb.Append("[]"); break; } sb.Append('['); for (int i = 0; i < v._array.Count; i++) { if (i > 0) { sb.Append(','); } if (flag) { NewLine(sb, indent, depth + 1); } Write(sb, v._array[i], indent, depth + 1); } if (flag) { NewLine(sb, indent, depth); } sb.Append(']'); break; } case Kind.Object: { if (v._object.Count == 0) { sb.Append("{}"); break; } sb.Append('{'); bool flag2 = true; foreach (KeyValuePair<string, JsonValue> item in v._object) { if (!flag2) { sb.Append(','); } flag2 = false; if (flag) { NewLine(sb, indent, depth + 1); } WriteString(sb, item.Key); sb.Append(':'); if (flag) { sb.Append(' '); } Write(sb, item.Value, indent, depth + 1); } if (flag) { NewLine(sb, indent, depth); } sb.Append('}'); break; } } } private static void NewLine(StringBuilder sb, int indent, int depth) { sb.Append('\n'); sb.Append(' ', indent * depth); } private static void WriteNumber(StringBuilder sb, double d, bool asFloat) { if (double.IsNaN(d) || double.IsInfinity(d)) { sb.Append('0'); } else { sb.Append(asFloat ? ((float)d).ToString("R", CultureInfo.InvariantCulture) : d.ToString("R", CultureInfo.InvariantCulture)); } } private static void WriteString(StringBuilder sb, string s) { sb.Append('"'); foreach (char c in s) { switch (c) { case '"': sb.Append("\\\""); continue; case '\\': sb.Append("\\\\"); continue; case '\b': sb.Append("\\b"); continue; case '\f': sb.Append("\\f"); continue; case '\n': sb.Append("\\n"); continue; case '\r': sb.Append("\\r"); continue; case '\t': sb.Append("\\t"); continue; } if (c < ' ') { StringBuilder stringBuilder = sb.Append("\\u"); int num = c; stringBuilder.Append(num.ToString("x4", CultureInfo.InvariantCulture)); } else { sb.Append(c); } } sb.Append('"'); } public static JsonValue Parse(string text) { if (text == null) { throw new JsonException("Cannot parse null."); } int pos = 0; JsonValue result = ParseValue(text, ref pos, 0); SkipWhitespace(text, ref pos); if (pos != text.Length) { throw new JsonException("Trailing content at offset " + pos + "."); } return result; } public static JsonValue TryParse(string text) { try { return Parse(text); } catch (JsonException) { return null; } } private static JsonValue ParseValue(string s, ref int pos, int depth) { if (depth > 64) { throw new JsonException("Nested too deeply."); } SkipWhitespace(s, ref pos); if (pos >= s.Length) { throw new JsonException("Unexpected end of input."); } switch (s[pos]) { case '{': return ParseObject(s, ref pos, depth); case '[': return ParseArray(s, ref pos, depth); case '"': return String(ParseString(s, ref pos)); case 't': Expect(s, ref pos, "true"); return Bool(v: true); case 'f': Expect(s, ref pos, "false"); return Bool(v: false); case 'n': Expect(s, ref pos, "null"); return Null; default: return Number(ParseNumber(s, ref pos)); } } private static JsonValue ParseObject(string s, ref int pos, int depth) { pos++; JsonValue jsonValue = NewObject(); SkipWhitespace(s, ref pos); if (pos < s.Length && s[pos] == '}') { pos++; return jsonValue; } while (true) { SkipWhitespace(s, ref pos); if (pos >= s.Length || s[pos] != '"') { throw new JsonException("Expected a member name at offset " + pos + "."); } string key = ParseString(s, ref pos); SkipWhitespace(s, ref pos); if (pos >= s.Length || s[pos] != ':') { throw new JsonException("Expected ':' at offset " + pos + "."); } pos++; jsonValue._object[key] = ParseValue(s, ref pos, depth + 1); SkipWhitespace(s, ref pos); if (pos >= s.Length) { throw new JsonException("Unterminated object."); } if (s[pos] != ',') { break; } pos++; } if (s[pos] == '}') { pos++; return jsonValue; } throw new JsonException("Expected ',' or '}' at offset " + pos + "."); } private static JsonValue ParseArray(string s, ref int pos, int depth) { pos++; JsonValue jsonValue = NewArray(); SkipWhitespace(s, ref pos); if (pos < s.Length && s[pos] == ']') { pos++; return jsonValue; } while (true) { jsonValue._array.Add(ParseValue(s, ref pos, depth + 1)); SkipWhitespace(s, ref pos); if (pos >= s.Length) { throw new JsonException("Unterminated array."); } if (s[pos] != ',') { break; } pos++; } if (s[pos] == ']') { pos++; return jsonValue; } throw new JsonException("Expected ',' or ']' at offset " + pos + "."); } private static string ParseString(string s, ref int pos) { pos++; StringBuilder stringBuilder = new StringBuilder(); while (pos < s.Length) { char c = s[pos++]; switch (c) { case '"': return stringBuilder.ToString(); default: stringBuilder.Append(c); break; case '\\': { if (pos >= s.Length) { throw new JsonException("Unterminated escape."); } char c2 = s[pos++]; switch (c2) { case '"': stringBuilder.Append('"'); break; case '\\': stringBuilder.Append('\\'); break; case '/': stringBuilder.Append('/'); break; case 'b': stringBuilder.Append('\b'); break; case 'f': stringBuilder.Append('\f'); break; case 'n': stringBuilder.Append('\n'); break; case 'r': stringBuilder.Append('\r'); break; case 't': stringBuilder.Append('\t'); break; case 'u': { if (pos + 4 > s.Length) { throw new JsonException("Truncated \\u escape."); } if (!int.TryParse(s.Substring(pos, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var result)) { throw new JsonException("Bad \\u escape at offset " + pos + "."); } stringBuilder.Append((char)result); pos += 4; break; } default: throw new JsonException("Unknown escape '\\" + c2 + "' at offset " + (pos - 1) + "."); } break; } } } throw new JsonException("Unterminated string."); } private static double ParseNumber(string s, ref int pos) { int num = pos; if (pos < s.Length && (s[pos] == '-' || s[pos] == '+')) { pos++; } while (pos < s.Length) { char c = s[pos]; if ((c < '0' || c > '9') && c != '.' && c != 'e' && c != 'E' && c != '-' && c != '+') { break; } pos++; } string text = s.Substring(num, pos - num); if (!double.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { throw new JsonException("Bad number '" + text + "' at offset " + num + "."); } return result; } private static void Expect(string s, ref int pos, string literal) { if (pos + literal.Length > s.Length || string.CompareOrdinal(s, pos, literal, 0, literal.Length) != 0) { throw new JsonException("Expected '" + literal + "' at offset " + pos + "."); } pos += literal.Length; } private static void SkipWhitespace(string s, ref int pos) { while (pos < s.Length) { switch (s[pos]) { case '\t': case '\n': case '\r': case ' ': pos++; break; case '/': if (pos + 1 < s.Length && s[pos + 1] == '/') { pos += 2; while (pos < s.Length && s[pos] != '\n') { pos++; } break; } return; default: return; } } } } } namespace GBV.Skald { internal static class Audio { private static bool _started; public static AudioClip Clip { get; private set; } public static IEnumerator Load() { if (_started) { yield break; } _started = true; string value = SkaldPlugin.MusicFile.Value; if (string.IsNullOrEmpty(value)) { yield break; } string path = Resolve(value); if (path == null) { Safety.Warn("Audio.Missing", "could not find '" + value + "'. Looked in " + Folder.Override + " and next to the plugin. The menu keeps Valheim's own music."); yield break; } AudioType val = TypeOf(path); if ((int)val == 0) { Safety.Warn("Audio.Format", "'" + path + "' is not an .ogg, .wav or .mp3, so it cannot be decoded."); yield break; } string absoluteUri; try { absoluteUri = new Uri(path).AbsoluteUri; } catch (Exception ex) { Safety.Failed("Audio.Uri", ex); yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(absoluteUri, val); try { if ((int)val != 20) { DownloadHandler downloadHandler = request.downloadHandler; DownloadHandlerAudioClip val2 = (DownloadHandlerAudioClip)(object)((downloadHandler is DownloadHandlerAudioClip) ? downloadHandler : null); if (val2 != null) { val2.compressed = true; } } yield return request.SendWebRequest(); if ((int)request.result != 1) { Safety.Warn("Audio.Request", "could not read '" + path + "': " + request.error); yield break; } AudioClip content; try { content = DownloadHandlerAudioClip.GetContent(request); } catch (Exception ex2) { Safety.Failed("Audio.Decode", ex2); yield break; } if ((Object)(object)content == (Object)null || content.length <= 0f) { Safety.Warn("Audio.Empty", "'" + path + "' decoded to an empty clip."); yield break; } ((Object)content).name = "SkaldMenuMusic"; ((Object)content).hideFlags = (HideFlags)61; Clip = content; SkaldPlugin.Log.LogInfo((object)("Skald: loaded menu music '" + Path.GetFileName(path) + "' (" + content.length.ToString("0.0") + "s, " + content.channels + "ch, " + content.frequency + "Hz).")); } finally { ((IDisposable)request)?.Dispose(); } Music.ApplyAndRestart(); } private static string Resolve(string name) { try { if (Path.IsPathRooted(name)) { return File.Exists(name) ? name : null; } string text = Path.Combine(Folder.Override, name); if (File.Exists(text)) { return text; } string plugin = Folder.Plugin; if (!string.IsNullOrEmpty(plugin)) { string text2 = Path.Combine(plugin, name); if (File.Exists(text2)) { return text2; } } } catch { } return null; } private static AudioType TypeOf(string path) { return (AudioType)(Path.GetExtension(path).ToLowerInvariant() switch { ".ogg" => 14, ".wav" => 20, ".mp3" => 13, _ => 0, }); } } internal static class Browser { private enum Page { Worlds, Servers } [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawWindow; } private const int WindowId = 1397443652; private const float G = 8f; private const float RailW = 210f; private const float ListW = 400f; private const float RowH = 44f; private const float HeaderH = 72f; private static Page _page = Page.Worlds; private static Rect _window; private static Vector2 _listScroll; private static string _search = ""; private static string _status; private static string _selectedServer; private static string _nickBuffer; private static string _noteBuffer; private static string _passBuffer; private static string _addBuffer = ""; private static bool _modifiers; private static bool _creating; private static bool _saves; private static string _confirmDelete; private static bool _removing; private static Vector2 _savesScroll; private static string _newName = ""; private static string _newSeed = ""; private static bool _openServer = true; private static bool _community; private static bool _crossplay = true; private static string _hostPassword = ""; private static bool _drawnOnce; private static bool _announced; private static GUIStyle _mid; private static GUIStyle _midHi; private static GUIStyle _capHead; internal static bool IsOpen { get; private set; } private static bool Suspended { get { FejdStartup instance = FejdStartup.instance; if ((Object)(object)instance == (Object)null) { return true; } if ((Object)(object)instance.m_createWorldPanel != (Object)null && instance.m_createWorldPanel.activeSelf) { return true; } if ((Object)(object)instance.m_serverOptions != (Object)null && ((Component)instance.m_serverOptions).gameObject.activeSelf) { return true; } if ((Object)(object)instance.m_removeWorldDialog != (Object)null && instance.m_removeWorldDialog.activeSelf) { return true; } if ((Object)(object)instance.m_manageSavesMenu != (Object)null && instance.m_manageSavesMenu.IsVisible()) { return true; } if (UnifiedPopup.IsVisible()) { return true; } return false; } } internal static void Open() { Layout(); IsOpen = true; _status = null; BrowserData.Opened(); } internal static void ForceClose() { IsOpen = false; _drawnOnce = false; _announced = false; _modifiers = false; _creating = false; _saves = false; _removing = false; _confirmDelete = null; _selectedServer = null; _nickBuffer = null; _noteBuffer = null; _passBuffer = null; _status = null; } private static void Veil(GameObject go, bool hidden) { if (!((Object)(object)go == (Object)null)) { CanvasGroup val = go.GetComponent<CanvasGroup>(); if ((Object)(object)val == (Object)null) { val = go.AddComponent<CanvasGroup>(); } val.alpha = (hidden ? 0f : 1f); val.interactable = !hidden; val.blocksRaycasts = !hidden; } } private static void Layout() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(1240f, (float)Screen.width - 80f); float num2 = Mathf.Min(720f, (float)Screen.height - 80f); float num3 = Mathf.Clamp((float)Screen.width * 0.34f - num * 0.5f, 32f, Mathf.Max(32f, (float)Screen.width - num - 32f)); _window = new Rect(Mathf.Round(num3), Mathf.Round(((float)Screen.height - num2) * 0.5f), num, num2); } private static void EnsureStyles() { //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_001e: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if (_mid == null) { _mid = new GUIStyle(Theme.Body) { alignment = (TextAnchor)4 }; _midHi = new GUIStyle(Theme.BodyHi) { alignment = (TextAnchor)4 }; _capHead = new GUIStyle(Theme.Small) { alignment = (TextAnchor)3 }; } } internal static void Tick() { try { if (!IsOpen) { return; } FejdStartup instance = FejdStartup.instance; if ((Object)(object)instance == (Object)null) { ForceClose(); return; } if ((Object)(object)instance.m_startGamePanel != (Object)null) { bool flag = _drawnOnce && !Suspended; Veil(instance.m_startGamePanel, flag); if (flag && !_announced) { _announced = true; ManualLogSource log = SkaldPlugin.Log; if (log != null) { log.LogInfo((object)"Skald: the browser has taken over the Start Game window."); } } else if (!flag && _announced) { Safety.Warn("Browser.NotDrawing", "the browser stopped rendering, so Valheim's own Start Game window is visible again. Nothing is lost. This is a bug in Skald; please report it."); } } if (Suspended) { return; } if (Input.GetKeyDown((KeyCode)27)) { if (_removing) { _removing = false; } else if (_creating) { _creating = false; } else if (_saves) { _saves = false; _confirmDelete = null; } else if (_modifiers) { Modifiers.Load(Worlds.Selected); _modifiers = false; } else { Back(); } } else { Worlds.Tick(); if (_page == Page.Servers) { BrowserData.Tick(); } } } catch (Exception ex) { Safety.Failed("Browser.Tick", ex); ForceClose(); } } internal static void Draw() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown try { if (IsOpen && !Suspended) { Theme.EnsureBuilt(); Chrome.EnsureBuilt(); EnsureStyles(); if (((Rect)(ref _window)).width < 100f) { Layout(); } GUI.color = Color.white; GUI.backgroundColor = Color.white; Rect window = _window; object obj = <>O.<0>__DrawWindow; if (obj == null) { WindowFunction val = DrawWindow; <>O.<0>__DrawWindow = val; obj = (object)val; } _window = GUI.Window(1397443652, window, (WindowFunction)obj, GUIContent.none, Theme.Blank); } } catch (Exception ex) { Safety.Failed("Browser.Draw", ex); ForceClose(); } } private static void DrawWindow(int id) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(0f, 0f, ((Rect)(ref _window)).width, ((Rect)(ref _window)).height); Chrome.Shadow(r, 22f, 0.9f); Theme.DrawSlab(r); float num = 30f; Rect inner = default(Rect); ((Rect)(ref inner))..ctor(num, num * 0.5f, ((Rect)(ref r)).width - num * 2f, ((Rect)(ref r)).height - num); float num2 = DrawMasthead(inner); float num3 = ((Rect)(ref inner)).yMax - 44f; Rule(new Rect(((Rect)(ref inner)).x, num3 - 16f, ((Rect)(ref inner)).width, 1f)); Rect body = default(Rect); ((Rect)(ref body))..ctor(((Rect)(ref inner)).x, num2, ((Rect)(ref inner)).width, num3 - num2 - 24f); if ((_modifiers || _creating || _saves || _removing) && _page == Page.Worlds) { if (_removing) { DrawRemoveWorld(body); } else if (_creating) { DrawNewWorld(body); } else if (_saves) { DrawSaves(body); } else { DrawModifiers(body); } } else if (_page == Page.Servers) { DrawServersPage(body); } else { DrawWorldsPage(body); } DrawFooter(new Rect(((Rect)(ref inner)).x, num3, ((Rect)(ref inner)).width, 44f)); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _window)).width, 72f)); _drawnOnce = true; } private static float DrawMasthead(Rect inner) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) float y = ((Rect)(ref inner)).y; GUI.Label(new Rect(((Rect)(ref inner)).x, y, 420f, 34f), "SKALD", Theme.Wordmark); GUI.Label(new Rect(((Rect)(ref inner)).x + 2f, y + 32f, 520f, 20f), (_page == Page.Servers) ? "Choose A Server To Join" : "Choose A World To Play Or Host", Theme.Small); float num = 150f; float num2 = 38f; Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref inner)).xMax - num * 2f, y + 4f, num * 2f, num2); Theme.Fill(r, Theme.StoneDeep); Theme.Outline(r, new Color(0f, 0f, 0f, 0.6f), 1f); Segment(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, num, num2), "Worlds", Page.Worlds); Segment(new Rect(((Rect)(ref r)).x + num, ((Rect)(ref r)).y, num, num2), "Servers", Page.Servers); Theme.Outline(r, new Color(Theme.Brass.r, Theme.Brass.g, Theme.Brass.b, 0.5f), 1f); y += 64f; Rule(new Rect(((Rect)(ref inner)).x, y, ((Rect)(ref inner)).width, 1f)); return y + 24f; } private static void Segment(Rect r, string label, Page page) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00ac: 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_00f0: Unknown result type (might be due to invalid IL or missing references) bool flag = _page == page; bool flag2 = ((Rect)(ref r)).Contains(Event.current.mousePosition); if (flag) { Theme.Fill(r, Theme.StoneHi); Theme.Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1f), new Color(Theme.BrassHi.r, Theme.BrassHi.g, Theme.BrassHi.b, 0.55f)); Theme.Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 2f, ((Rect)(ref r)).width, 2f), Theme.Brass); } else if (flag2) { Theme.Fill(r, new Color(Theme.StoneHi.r, Theme.StoneHi.g, Theme.StoneHi.b, 0.5f)); } GUI.Label(r, label, flag ? Theme.TabOn : Theme.TabOff); if (GUI.Button(r, GUIContent.none, Theme.Blank) && !flag) { SetPage(page); } } private static void SetPage(Page page) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (_page != page) { _page = page; _listScroll = Vector2.zero; _search = ""; _status = null; if (page == Page.Servers) { BrowserData.SetFilter("", isTyping: false); BrowserData.Refresh(); } } } private static void DrawServersPage(Rect body) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref body)).x, ((Rect)(ref body)).y, 210f, ((Rect)(ref body)).height); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).xMax + 16f, ((Rect)(ref body)).y, 400f, ((Rect)(ref body)).height); Rect area = new Rect(((Rect)(ref r2)).xMax + 24f, ((Rect)(ref body)).y, ((Rect)(ref body)).xMax - ((Rect)(ref r2)).xMax - 24f, ((Rect)(ref body)).height); DrawSourceRail(r); DrawServerList(r2); DrawServerDetail(area); } private static void DrawWorldsPage(Rect body) { //IL_0051: 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) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref body)).x, ((Rect)(ref body)).y, 626f, ((Rect)(ref body)).height); Rect area = new Rect(((Rect)(ref r)).xMax + 24f, ((Rect)(ref body)).y, ((Rect)(ref body)).xMax - ((Rect)(ref r)).xMax - 24f, ((Rect)(ref body)).height); DrawWorldList(r); DrawWorldDetail(area); } private static void DrawSourceRail(Rect r) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) SectionLabel(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 18f), "SOURCE"); float num = ((Rect)(ref r)).y + 26f; int tabCount = BrowserData.TabCount; Rect val = default(Rect); for (int i = 0; i < tabCount; i++) { ((Rect)(ref val))..ctor(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 38f); bool flag = BrowserData.Tab == i; bool flag2 = ((Rect)(ref val)).Contains(Event.current.mousePosition); if (flag) { Theme.Fill(val, Theme.StoneHi); Theme.Fill(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, 3f, ((Rect)(ref val)).height), Theme.Brass); } else if (flag2) { Theme.Fill(val, new Color(Theme.StoneHi.r, Theme.StoneHi.g, Theme.StoneHi.b, 0.45f)); } GUI.Label(new Rect(((Rect)(ref val)).x + 16f, ((Rect)(ref val)).y, ((Rect)(ref val)).width - 70f, ((Rect)(ref val)).height), BrowserData.TabName(i), flag ? Theme.BodyHi : Theme.Body); GUI.Label(new Rect(((Rect)(ref val)).xMax - 56f, ((Rect)(ref val)).y, 48f, ((Rect)(ref val)).height), BrowserData.TabTotal(i).ToString(), Theme.SmallRight); if (GUI.Button(val, GUIContent.none, Theme.Blank) && !flag) { BrowserData.Tab = i; _listScroll = Vector2.zero; _selectedServer = null; } num += 38f; } num += 16f; Rule(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 1f)); num += 16f; SectionLabel(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 18f), "SORT"); num += 26f; SortRow(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 30f), "Name", BrowserData.Column.Name); num += 32f; SortRow(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 30f), "Players", BrowserData.Column.Players); num += 32f; SortRow(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 30f), "Version", BrowserData.Column.Version); num += 32f; SortRow(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 30f), "Online", BrowserData.Column.Online); if (Button(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 38f, ((Rect)(ref r)).width, 34f), "Refresh", primary: false)) { BrowserData.Refresh(); _status = "Refreshing."; } } private static void SortRow(Rect r, string label, BrowserData.Column column) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) bool flag = BrowserData.SortBy == column; bool flag2 = ((Rect)(ref r)).Contains(Event.current.mousePosition); if (flag) { Theme.Fill(r, new Color(Theme.StoneHi.r, Theme.StoneHi.g, Theme.StoneHi.b, 0.7f)); } else if (flag2) { Theme.Fill(r, new Color(Theme.StoneHi.r, Theme.StoneHi.g, Theme.StoneHi.b, 0.35f)); } GUI.Label(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y, ((Rect)(ref r)).width - 50f, ((Rect)(ref r)).height), label, flag ? Theme.BodyHi : Theme.Dim); if (flag) { Chrome.Tri(new Rect(((Rect)(ref r)).xMax - 26f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.5f - 4f, 9f, 7f), !BrowserData.SortDescending, Theme.BrassHi); } if (GUI.Button(r, GUIContent.none, Theme.Blank)) { BrowserData.Sort(column); } } private static void DrawServerList(Rect r) { //IL_001c: 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) //IL_004e: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) float y = ((Rect)(ref r)).y; y = DrawSearch(new Rect(((Rect)(ref r)).x, y, ((Rect)(ref r)).width, 32f)); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref r)).x, y, ((Rect)(ref r)).width - 96f, 30f); Chrome.Field(val); _addBuffer = GUI.TextField(val, _addBuffer ?? "", 64, Chrome.Entry); if (string.IsNullOrEmpty(_addBuffer)) { GUI.Label(new Rect(((Rect)(ref val)).x + 17f, ((Rect)(ref val)).y, ((Rect)(ref val)).width, ((Rect)(ref val)).height), "Add By Address", Theme.Dim); } GUI.enabled = !string.IsNullOrWhiteSpace(_addBuffer); if (Button(new Rect(((Rect)(ref r)).xMax - 88f, y, 88f, 30f), "Add", primary: false)) { if (BrowserData.AddByAddress(_addBuffer)) { _status = "Added to Favourites."; _addBuffer = ""; } else { _status = "That address could not be read."; } } GUI.enabled = true; y += 46f; Servers.Entry entry = Servers.LastJoined(); if (entry != null && entry.CanReconnectDirectly) { Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x, y, ((Rect)(ref r)).width, 46f); DrawRejoin(r2, entry); y = ((Rect)(ref r2)).yMax + 16f; } Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref r)).x, y, ((Rect)(ref r)).width, ((Rect)(ref r)).yMax - y); Well(r3); List<BrowserData.Row> current = BrowserData.Current; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref r3)).x + 2f, ((Rect)(ref r3)).y + 2f, ((Rect)(ref r3)).width - 12f, ((Rect)(ref r3)).height - 4f); float num = (float)current.Count * 44f + 4f; _listScroll = GUI.BeginScrollView(val2, _listScroll, new Rect(0f, 0f, ((Rect)(ref val2)).width, num), GUIStyle.none, GUIStyle.none); float width = ((Rect)(ref val2)).width; for (int i = 0; i < current.Count; i++) { DrawServerRow(new Rect(0f, (float)i * 44f, width, 44f), current[i]); } GUI.EndScrollView(); _listScroll.y = Chrome.Scrollbar(new Rect(((Rect)(ref r3)).xMax - 9f, ((Rect)(ref r3)).y + 2f, 7f, ((Rect)(ref r3)).height - 4f), "srvbar".GetHashCode(), _listScroll.y, ((Rect)(ref val2)).height, num); if (current.Count == 0) { Empty(r3, BrowserData.Unavailable ? "This List Could Not Be Read" : "Nothing Here"); } } private static void DrawRejoin(Rect r, Servers.Entry last) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) Theme.Fill(r, Theme.StoneHi); Theme.Outline(r, new Color(Theme.Brass.r, Theme.Brass.g, Theme.Brass.b, 0.55f), 1f); Theme.Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, 3f, ((Rect)(ref r)).height), Theme.Brass); GUI.Label(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y + 4f, ((Rect)(ref r)).width - 110f, 18f), "LAST PLAYED", Theme.Small); GUI.Label(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y + 20f, ((Rect)(ref r)).width - 110f, 22f), last.Display, Theme.BodyHi); if (Button(new Rect(((Rect)(ref r)).xMax - 96f, ((Rect)(ref r)).y + 8f, 88f, 30f), "Rejoin", primary: true)) { Join(new ServerJoinData(new ServerJoinDataDedicated(last.Host, (ushort)last.Port)), last.RealName); } } private unsafe static void DrawServerRow(Rect r, BrowserData.Row row) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) bool flag = _selectedServer == row.Key; Chrome.Row(r, ("srv" + row.Key).GetHashCode(), flag); float num = ((Rect)(ref r)).xMax - 124f - 8f; float num2 = num - ((Rect)(ref r)).x - 32f - 6f; Dot(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y + 13f, 6f, 6f), ((ServerListEntryData)(ref row.Entry)).IsOnline ? Theme.Good : Theme.Faint); GUI.Label(new Rect(((Rect)(ref r)).x + 32f, ((Rect)(ref r)).y + 5f, num2, 20f), row.Display ?? "", flag ? Theme.BodyHi : Theme.Body); string text = row.Entry.m_playerCount + " / " + row.Entry.m_playerLimit; GUI.Label(new Rect(((Rect)(ref r)).x + 32f, ((Rect)(ref r)).y + 24f, num2, 18f), text, Theme.Small); if (((ServerListEntryData)(ref row.Entry)).IsPasswordProtected) { bool flag2 = row.Saved != null && row.Saved.HasPassword; Chrome.KeyMark(new Rect(((Rect)(ref r)).x + 32f + 44f, ((Rect)(ref r)).y + 27f, 17f, 9f), (Color)(flag2 ? Theme.BrassHi : new Color(Theme.Faint.r, Theme.Faint.g, Theme.Faint.b, 0.8f))); if (flag2) { GUI.Label(new Rect(((Rect)(ref r)).x + 32f + 66f, ((Rect)(ref r)).y + 24f, 90f, 18f), "Saved", Theme.Small); } } GameVersion gameVersion = row.Entry.m_gameVersion; object obj; if (!((GameVersion)(ref gameVersion)).IsValid()) { obj = "?"; } else { gameVersion = row.Entry.m_gameVersion; obj = ((object)(*(GameVersion*)(&gameVersion))/*cast due to .constrained prefix*/).ToString(); } string text2 = (string)obj; if (row.VersionMismatch) { Badge(new Rect(num, ((Rect)(ref r)).y + 6f, 124f, 17f), text2, Theme.Bad); } else { GUI.Label(new Rect(num, ((Rect)(ref r)).y + 5f, 124f, 18f), text2, Theme.SmallRight); } float frac = ((row.Entry.m_playerLimit != 0) ? Mathf.Clamp01((float)row.Entry.m_playerCount / (float)row.Entry.m_playerLimit) : 0f); Meter(new Rect(num + 124f - 96f, ((Rect)(ref r)).y + 28f, 96f, 5f), frac); if (GUI.Button(r, GUIContent.none, Theme.Blank)) { SelectServer(row); } } private static void DrawWorldList(Rect r) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) float num = DrawSearch(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 32f)); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, ((Rect)(ref r)).yMax - num - 46f); Well(r2); List<World> current = Worlds.Current; string text = (_search ?? "").Trim(); List<World> list = new List<World>(); for (int i = 0; i < current.Count; i++) { World val = current[i]; if (val != null && (text.Length <= 0 || val.m_name.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0)) { list.Add(val); } } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref r2)).x + 2f, ((Rect)(ref r2)).y + 2f, ((Rect)(ref r2)).width - 12f, ((Rect)(ref r2)).height - 4f); float num2 = (float)list.Count * 44f + 4f; _listScroll = GUI.BeginScrollView(val2, _listScroll, new Rect(0f, 0f, ((Rect)(ref val2)).width, num2), GUIStyle.none, GUIStyle.none); float width = ((Rect)(ref val2)).width; Rect val4 = default(Rect); for (int j = 0; j < list.Count; j++) { World val3 = list[j]; ((Rect)(ref val4))..ctor(0f, (float)j * 44f, width, 44f); bool flag = Worlds.Selected != null && Worlds.Selected.m_name == val3.m_name; Chrome.Row(val4, ("wld" + val3.m_name).GetHashCode(), flag); GUI.Label(new Rect(((Rect)(ref val4)).x + 16f, ((Rect)(ref val4)).y + 4f, ((Rect)(ref val4)).width - 100f, 20f), val3.m_name, flag ? Theme.BodyHi : Theme.Body); GUI.Label(new Rect(((Rect)(ref val4)).x + 16f, ((Rect)(ref val4)).y + 22f, ((Rect)(ref val4)).width - 100f, 18f), "seed " + Worlds.SeedOf(val3), Theme.Small); GUI.Label(new Rect(((Rect)(ref val4)).xMax - 88f, ((Rect)(ref val4)).y, 80f, ((Rect)(ref val4)).height), Worlds.SourceOf(val3), Theme.SmallRight); if (GUI.Button(val4, GUIContent.none, Theme.Blank)) { Worlds.Select(val3); } } GUI.EndScrollView(); _listScroll.y = Chrome.Scrollbar(new Rect(((Rect)(ref r2)).xMax - 9f, ((Rect)(ref r2)).y + 2f, 7f, (