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 GlitnirMenu v0.1.0
GlitnirMenu.dll
Decompiled 2 days 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.IO; using System.Linq; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; 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("GlitnirMenu")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("GlitnirMenu")] [assembly: AssemblyTitle("GlitnirMenu")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace GlitnirMenu { internal static class TransformHelper { internal static Transform FindChild(Transform parent, string name) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if ((Object)(object)parent == (Object)null) { return null; } foreach (Transform item in parent) { Transform val = item; if (((Object)val).name == name) { return val; } Transform val2 = FindChild(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } } [BepInPlugin("Padilha.GlitnirMenu", "GlitnirMenu", "1.2.0")] public class GlitnirMenuPlugin : BaseUnityPlugin { public enum Toggle { On = 1, Off = 0 } private const string ModGUID = "Padilha.GlitnirMenu"; private static readonly string ConfigFileFullPath; public static readonly string AssetRoot; public static readonly string LoadingArtFolder; public static readonly string TeleportArtFolder; private readonly Harmony _harmony = new Harmony("Padilha.GlitnirMenu"); internal static TMP_FontAsset CapturedMenuFont; private static ConfigEntry<Toggle> _modEnabled; private static ConfigEntry<string> _mainLogoFile; public static ConfigEntry<float> MainLogoWidth; public static ConfigEntry<float> MainLogoHeight; public static ConfigEntry<float> MainLogoOffsetY; private static Sprite _mainLogoSprite; public static ConfigEntry<string> DiscordInviteUrl; public static ConfigEntry<Toggle> DiscordPanelEnabled; public static ConfigEntry<float> DiscordLogoWidth; public static ConfigEntry<float> DiscordLogoHeight; public static ConfigEntry<float> DiscordPosX; public static ConfigEntry<float> DiscordPosY; private static GameObject _discordPanel; private static Image _discordLogoImage; public static ConfigEntry<Toggle> LoadingScreenEnabled; public static ConfigEntry<Toggle> SlideshowEnabled; public static ConfigEntry<float> SlideshowInterval; public static ConfigEntry<Toggle> TeleportScreenEnabled; public static ConfigEntry<Toggle> HideChangelog; public static ConfigEntry<Toggle> HideMerchStore; public static ConfigEntry<Toggle> HideModdedWarning; public static ConfigEntry<string> WelcomePanelTitle; public static ConfigEntry<string> WelcomePanelMessage; public static ConfigEntry<int> WelcomeServerMaxPlayers; public static ConfigEntry<string> WelcomeServerIP; public static ConfigEntry<int> WelcomeServerQueryPort; public static ConfigEntry<Toggle> WelcomePanelEnabled; public static ConfigEntry<float> WelcomePanelWidth; public static ConfigEntry<float> WelcomePanelHeight; public static ConfigEntry<float> WelcomePanelPosX; public static ConfigEntry<float> WelcomePanelPosY; public static ConfigEntry<Toggle> UsePreset; public static ConfigEntry<Toggle> UseVanilla; public static ConfigEntry<Vector3> CharacterCameraMarker_Position; public static ConfigEntry<Vector3> CreditsCameraMarker_Position; public static ConfigEntry<Vector3> GameCameraMarker_Position; public static ConfigEntry<Vector3> MainCameraMarker_Position; public static ConfigEntry<Vector3> StartCameraMarker_Position; public static ConfigEntry<Vector3> SavesCameraMarker_Position; public static ConfigEntry<Vector3> CharacterCameraMarker_Rotation; public static ConfigEntry<Vector3> CreditsCameraMarker_Rotation; public static ConfigEntry<Vector3> GameCameraMarker_Rotation; public static ConfigEntry<Vector3> MainCameraMarker_Rotation; public static ConfigEntry<Vector3> StartCameraMarker_Rotation; public static ConfigEntry<Vector3> SavesCameraMarker_Rotation; public static ConfigEntry<Vector3> MPlayerPosition; public static ConfigEntry<Vector3> MPlayerRotation; public static ConfigEntry<Vector3> MFirePosition; internal static Vector3 DefaultCharPos; internal static Vector3 DefaultCredPos; internal static Vector3 DefaultGamePos; internal static Vector3 DefaultMainPos; internal static Vector3 DefaultStartPos; internal static Vector3 DefaultSavesPos; internal static Vector3 DefaultCharRot; internal static Vector3 DefaultCredRot; internal static Vector3 DefaultGameRot; internal static Vector3 DefaultMainRot; internal static Vector3 DefaultStartRot; internal static Vector3 DefaultSavesRot; internal static Transform DefaultPlayerPreviewPoint; internal static Vector3 DefaultPlayerPos; internal static Vector3 DefaultPlayerRot; private static readonly Vector3 PresetCharPos; private static readonly Vector3 PresetCharRot; private static readonly Vector3 PresetCredPos; private static readonly Vector3 PresetCredRot; private static readonly Vector3 PresetMainPos; private static readonly Vector3 PresetMainRot; private static readonly Vector3 PresetGamePos; private static readonly Vector3 PresetGameRot; private static readonly Vector3 PresetSavesPos; private static readonly Vector3 PresetSavesRot; private static readonly Vector3 PresetPlayerPos; private static ConfigFile _cfg; private static GameObject _welcomePanel; private static TextMeshProUGUI _welcomePlayersText; private static TextMeshProUGUI _welcomeStatusText; private static int _cachedPlayerCount; internal static GameObject _overlayRoot; private static Image _wolfFillImage; private static Text _progressLegacyText; private static TextMeshProUGUI _progressTmpText; internal static float _progressValue; private static RawImage _overlayRawImage; private static CanvasGroup _overlayGroup; private static CanvasCoroutineRunner _overlayRunner; private static Texture2D _overlayTexture; internal static float TargetProgress; private static readonly (float threshold, string message)[] LoadingMessages; private static readonly (float threshold, string message)[] TeleportMessages; internal static bool DeathRespawnHappened; public static ManualLogSource Log { get; private set; } public static GlitnirMenuPlugin Instance { get; private set; } internal static bool IsTeleportOverlay { get { if ((Object)(object)_overlayRoot != (Object)null) { return ((Object)_overlayRoot).name == "GlitnirMenu_TeleportOverlay"; } return false; } } public void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; EnsureFolders(); _cfg = new ConfigFile(ConfigFileFullPath, true); _modEnabled = Cfg("1 - Geral", "Mod Ativado", Toggle.On, "Ativa ou desativa o GlitnirMenu."); _mainLogoFile = Cfg("2 - Logo", "Logo Principal", "GlitnirMenu_Logo.png", "Nome do arquivo PNG da logo. Coloque em BepInEx/config/GlitnirMenu/images/menu/"); MainLogoWidth = Cfg("2 - Logo", "Logo Largura", 700f, "Largura em pixels da logo no menu principal. 0 = tamanho original."); MainLogoHeight = Cfg("2 - Logo", "Logo Altura", 700f, "Altura em pixels da logo no menu principal. 0 = tamanho original."); MainLogoOffsetY = Cfg("2 - Logo", "Logo Posicao Y", 550f, "Desloca a logo verticalmente em pixels. Positivo = sobe, negativo = desce."); _modEnabled.SettingChanged += delegate { TryReloadLogos(); }; MainLogoWidth.SettingChanged += delegate { TryReloadLogos(); }; MainLogoHeight.SettingChanged += delegate { TryReloadLogos(); }; MainLogoOffsetY.SettingChanged += delegate { TryReloadLogos(); }; DiscordPanelEnabled = Cfg("4 - Discord", "Painel Ativado", Toggle.On, "Mostra o painel do Discord no menu principal."); DiscordInviteUrl = Cfg("4 - Discord", "Link do Servidor", "", "Link de convite do Discord (https://discord.gg/...). Deixe vazio para desativar o botão."); DiscordLogoWidth = Cfg("4 - Discord", "Logo Largura", 400f, "Largura em pixels da imagem do Discord no menu."); DiscordLogoHeight = Cfg("4 - Discord", "Logo Altura", 200f, "Altura em pixels da imagem do Discord no menu."); DiscordPosX = Cfg("4 - Discord", "Posicao X", 50f, "Posição horizontal (negativo = da borda direita)."); DiscordPosY = Cfg("4 - Discord", "Posicao Y", 50f, "Posição vertical (positivo = sobe da base)."); Action rebuildDiscord = delegate { if ((Object)(object)_discordPanel != (Object)null) { Object.Destroy((Object)(object)_discordPanel); _discordPanel = null; } if ((Object)(object)FejdStartup.instance != (Object)null) { CreateOrRefreshDiscordPanel(FejdStartup.instance); } }; DiscordLogoWidth.SettingChanged += delegate { rebuildDiscord(); }; DiscordLogoHeight.SettingChanged += delegate { rebuildDiscord(); }; DiscordPanelEnabled.SettingChanged += delegate { rebuildDiscord(); }; DiscordPosX.SettingChanged += delegate { rebuildDiscord(); }; DiscordPosY.SettingChanged += delegate { rebuildDiscord(); }; LoadingScreenEnabled = Cfg("3 - Loading Screen", "Ativado", Toggle.On, "Exibe uma imagem personalizada durante o carregamento do mundo. Coloque PNGs em BepInEx/config/GlitnirMenu/images/loading/"); TeleportScreenEnabled = Cfg("3 - Loading Screen", "Tela de Teleporte", Toggle.On, "Exibe uma imagem personalizada durante o teleporte. Coloque PNGs em BepInEx/config/GlitnirMenu/images/teleport/"); SlideshowEnabled = Cfg("3 - Loading Screen", "Slideshow Ativado", Toggle.On, "Troca as imagens automaticamente durante o carregamento."); SlideshowInterval = Cfg("3 - Loading Screen", "Slideshow Intervalo", 4f, "Segundos entre cada troca de imagem no slideshow."); HideChangelog = Cfg("5 - Esconder", "Esconder Changelog", Toggle.On, "Esconde o painel de notas de atualização do menu."); HideMerchStore = Cfg("5 - Esconder", "Esconder Merch Store", Toggle.On, "Esconde o link da loja de produtos oficiais."); HideModdedWarning = Cfg("5 - Esconder", "Esconder Aviso de Mod", Toggle.On, "Esconde o aviso 'Você está jogando uma versão modificada'."); WelcomePanelTitle = Cfg("11 - Painel Boas-vindas", "Titulo", "⚔ GLITNIR FANTASY ⚔", "Título exibido no painel de boas-vindas."); WelcomePanelMessage = Cfg("11 - Painel Boas-vindas", "Mensagem", "O eco das trombetas de guerra ressoa e os corvos de Odin trazem a notícia: sua jornada em Valheim começou! Você acaba de atracar em Glitnir, um reino moldado pelo aço, pela magia e pela glória. Aqui, não somos apenas sobreviventes; somos construtores de impérios, caçadores de feras lendárias e irmãos de armas. Seja você um mestre construtor que ergue fortalezas impenetráveis, um guerreiro implacável pronto para encarar os piores perigos dos biomas mais sombrios, ou um alquimista focado em poções e estratégias avançadas, o seu lugar é aqui", "Mensagem de boas-vindas."); WelcomeServerMaxPlayers = Cfg("11 - Painel Boas-vindas", "Max Players", 100, "Capacidade máxima do servidor."); WelcomeServerIP = Cfg("11 - Painel Boas-vindas", "Servidor IP", "177.54.147.114", "IP do servidor Valheim."); WelcomeServerQueryPort = Cfg("11 - Painel Boas-vindas", "Servidor Porta Query", 24445, "Porta de query Steam (geralmente porta do jogo + 1)."); WelcomePanelEnabled = Cfg("11 - Painel Boas-vindas", "Ativado", Toggle.On, "Ativa ou desativa o painel de boas-vindas."); WelcomePanelWidth = Cfg("11 - Painel Boas-vindas", "Largura", 320f, "Largura do painel em pixels."); WelcomePanelHeight = Cfg("11 - Painel Boas-vindas", "Altura", 500f, "Altura do painel em pixels."); WelcomePanelPosX = Cfg("11 - Painel Boas-vindas", "Posicao X", 5f, "Posição horizontal do painel (pixels da borda esquerda)."); WelcomePanelPosY = Cfg("11 - Painel Boas-vindas", "Posicao Y", 130f, "Posição vertical do painel (pixels da base da tela)."); UsePreset = Cfg("6 - Presets", "Usar Preset", Toggle.On, "Usa as posições de câmera do preset Glitnir."); UseVanilla = Cfg("6 - Presets", "Usar Vanilla", Toggle.Off, "Usa as posições de câmera originais do Valheim."); UsePreset.SettingChanged += delegate { if (UsePreset.Value == Toggle.On) { UseVanilla.Value = Toggle.Off; } SceneFunctions.UpdateAndSet(); }; UseVanilla.SettingChanged += delegate { if (UseVanilla.Value == Toggle.On) { UsePreset.Value = Toggle.Off; } SceneFunctions.UpdateAndSet(); }; CharacterCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Character", new Vector3(-161.89f, 55.97f, 230.13f), ""); CreditsCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Credits", new Vector3(-156.86f, 78.89f, 225.68f), ""); GameCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Game", new Vector3(-157.85f, 56.59f, 229.93f), ""); MainCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Main", new Vector3(-142.53f, 59f, 227.72f), ""); StartCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Start", new Vector3(-137.63f, 54.78f, 227.44f), ""); SavesCameraMarker_Position = Cfg<Vector3>("7 - Câmeras Posição", "Saves", new Vector3(-163.02f, 60.34f, 228.74f), ""); CharacterCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Character", new Vector3(13.79f, -84.748f, 0f), ""); CreditsCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Credits", new Vector3(-2.197f, -48.48f, 0f), ""); GameCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Game", new Vector3(-187.257f, 77.72f, 180f), ""); MainCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Main", new Vector3(1.241f, -84.232f, 0f), ""); StartCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Start", new Vector3(41.028f, -84.232f, 0f), ""); SavesCameraMarker_Rotation = Cfg<Vector3>("8 - Câmeras Rotação", "Saves", new Vector3(185.79f, 81.743f, -180f), ""); Action onCamChange = delegate { SceneFunctions.UpdateCameraValues(); }; CharacterCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; CreditsCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; GameCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; MainCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; StartCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; SavesCameraMarker_Position.SettingChanged += delegate { onCamChange(); }; CharacterCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; CreditsCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; GameCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; MainCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; StartCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; SavesCameraMarker_Rotation.SettingChanged += delegate { onCamChange(); }; MPlayerPosition = Cfg<Vector3>("9 - Player", "Posição", new Vector3(-204.51f, 36.5f, 157.53f), ""); MPlayerRotation = Cfg<Vector3>("9 - Player", "Rotação", new Vector3(13.79f, -84.748f, 0f), ""); MFirePosition = Cfg<Vector3>("10 - Fogo", "Posição", new Vector3(-203.51f, 36.5f, 158.53f), ""); MPlayerPosition.SettingChanged += delegate { SceneFunctions.UpdatePlayerValues(); }; MPlayerRotation.SettingChanged += delegate { SceneFunctions.UpdatePlayerValues(); }; MFirePosition.SettingChanged += delegate { SceneFunctions.UpdateFirePosition(); }; WolfBarAssets.Load(); TryReloadLogos(); _harmony.PatchAll(Assembly.GetExecutingAssembly()); SetupWatcher(); } private void OnDestroy() { _cfg.Save(); } private ConfigEntry<T> Cfg<T>(string group, string name, T value, string desc) { return _cfg.Bind<T>(group, name, value, desc); } private static void EnsureFolders() { Directory.CreateDirectory(AssetRoot); Directory.CreateDirectory(LoadingArtFolder); Directory.CreateDirectory(Path.Combine(AssetRoot, "discord")); Directory.CreateDirectory(TeleportArtFolder); Directory.CreateDirectory(Path.Combine(AssetRoot, "menu")); } internal static void TryReloadLogos() { if (IsStartScene() && _modEnabled.Value == Toggle.On) { _mainLogoSprite = LoadSprite(_mainLogoFile.Value); ApplyLogos(); } } private static Sprite LoadSprite(string filename) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Texture2D val = LoadTexture(filename); if ((Object)(object)val == (Object)null) { return null; } return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero); } private static Texture2D LoadTexture(string filename) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown Texture2D val = new Texture2D(0, 0); try { string path = Path.Combine(AssetRoot, "menu"); List<string> list = Directory.GetFiles(path, "*.png", SearchOption.AllDirectories).OrderBy(Path.GetFileName).ToList(); string text = list.Find((string f) => Path.GetFileName(f) == filename); if (text == null) { Log.LogWarning((object)("[GlitnirMenu] Imagem não encontrada: " + filename)); return null; } ImageConversion.LoadImage(val, File.ReadAllBytes(text)); return val; } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] Erro ao carregar " + filename + ": " + ex.Message)); return null; } } internal static Sprite LoadSpriteFromPath(string fullPath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_002e: 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) try { Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(fullPath)); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] Erro ao carregar sprite: " + ex.Message)); return null; } } internal static void ApplyLogos() { //IL_00b2: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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) if ((Object)(object)_mainLogoSprite == (Object)null || (Object)(object)FejdStartup.instance == (Object)null) { return; } try { Transform val = TransformHelper.FindChild(FejdStartup.instance.m_mainMenu.transform, "Logo"); if ((Object)(object)val == (Object)null) { Log.LogError((object)"[GlitnirMenu] Transform 'Logo' não encontrado."); return; } Transform val2 = TransformHelper.FindChild(val, "LOGO"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).GetComponent<Image>().sprite = _mainLogoSprite; RectTransform component = ((Component)val2).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null) { float value = MainLogoWidth.Value; float value2 = MainLogoHeight.Value; component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); if (value > 0f || value2 > 0f) { component.sizeDelta = new Vector2((value > 0f) ? value : component.sizeDelta.x, (value2 > 0f) ? value2 : component.sizeDelta.y); } component.anchoredPosition = new Vector2(component.anchoredPosition.x, MainLogoOffsetY.Value); } } string[] array = new string[9] { "Ashlands", "AshlandsLogo", "Heat Distortion", "AshlandsLogo_Glow", "Embers", "Embers (1)", "Embers (2)", "Embers (3)", "Ash" }; string[] array2 = array; foreach (string name in array2) { Transform obj = TransformHelper.FindChild(val, name); if (obj != null) { ((Component)obj).gameObject.SetActive(false); } } Log.LogInfo((object)"[GlitnirMenu] Logo aplicada."); } catch (Exception ex) { Log.LogError((object)("[GlitnirMenu] Erro ao aplicar logo: " + ex.Message)); } } internal static TMP_FontAsset GetMenuFont() { TextMeshProUGUI val = Object.FindFirstObjectByType<TextMeshProUGUI>(); if ((Object)(object)val != (Object)null && (Object)(object)((TMP_Text)val).font != (Object)null) { return ((TMP_Text)val).font; } TMP_FontAsset val2 = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF"); if ((Object)(object)val2 != (Object)null) { return val2; } TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>(); if (array != null && array.Length != 0) { return array[0]; } return null; } internal static void CreateOrRefreshDiscordPanel(FejdStartup fejd) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_007c: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_012d: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) if (DiscordPanelEnabled.Value != Toggle.On || (Object)(object)fejd == (Object)null) { return; } if ((Object)(object)_discordPanel != (Object)null) { RefreshDiscordPanelVisibility(fejd); return; } try { Canvas val = Object.FindFirstObjectByType<Canvas>(); if ((Object)(object)val == (Object)null) { return; } _discordPanel = new GameObject("GlitnirDiscordPanel"); _discordPanel.transform.SetParent(((Component)val).transform, false); RectTransform val2 = _discordPanel.AddComponent<RectTransform>(); val2.anchorMin = new Vector2(1f, 0f); val2.anchorMax = new Vector2(1f, 0f); val2.pivot = new Vector2(1f, 0f); val2.anchoredPosition = new Vector2(DiscordPosX.Value, DiscordPosY.Value); val2.sizeDelta = new Vector2(DiscordLogoWidth.Value + 20f, DiscordLogoHeight.Value + 20f); GameObject val3 = new GameObject("DiscordLogo"); val3.transform.SetParent(_discordPanel.transform, false); RectTransform val4 = val3.AddComponent<RectTransform>(); val4.anchorMin = new Vector2(0f, 0f); val4.anchorMax = new Vector2(1f, 1f); val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; _discordLogoImage = val3.AddComponent<Image>(); _discordLogoImage.preserveAspect = true; ((Graphic)_discordLogoImage).color = Color.white; string text = Path.Combine(AssetRoot, "discord", "discord_logo.png"); if (File.Exists(text)) { Sprite val5 = LoadSpriteFromPath(text); if ((Object)(object)val5 != (Object)null) { _discordLogoImage.sprite = val5; } } if (!string.IsNullOrWhiteSpace(DiscordInviteUrl.Value)) { Button val6 = val3.AddComponent<Button>(); string url = DiscordInviteUrl.Value; ((UnityEvent)val6.onClick).AddListener((UnityAction)delegate { Application.OpenURL(url); }); ColorBlock colors = ((Selectable)val6).colors; ((ColorBlock)(ref colors)).normalColor = Color.white; ((ColorBlock)(ref colors)).highlightedColor = new Color(0.8f, 0.8f, 0.8f, 1f); ((ColorBlock)(ref colors)).pressedColor = new Color(0.6f, 0.6f, 0.6f, 1f); ((Selectable)val6).colors = colors; ((Selectable)val6).targetGraphic = (Graphic)(object)_discordLogoImage; } RefreshDiscordPanelVisibility(fejd); Log.LogInfo((object)"[GlitnirMenu] Painel do Discord criado."); } catch (Exception ex) { Log.LogError((object)("[GlitnirMenu] Erro ao criar painel Discord: " + ex.Message)); } } internal static void RefreshDiscordPanelVisibility(FejdStartup fejd) { if (!((Object)(object)_discordPanel == (Object)null)) { bool active = (Object)(object)fejd != (Object)null && (Object)(object)fejd.m_mainMenu != (Object)null && fejd.m_mainMenu.activeInHierarchy; _discordPanel.SetActive(active); } } internal static void CreateOrRefreshWelcomePanel(FejdStartup fejd) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0090: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Expected O, but got Unknown //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fejd == (Object)null) { return; } ConfigEntry<Toggle> welcomePanelEnabled = WelcomePanelEnabled; if (welcomePanelEnabled != null && welcomePanelEnabled.Value == Toggle.Off) { return; } if ((Object)(object)_welcomePanel != (Object)null) { RefreshWelcomePanelVisibility(fejd); UpdateWelcomePlayers(); return; } try { Canvas val = Object.FindFirstObjectByType<Canvas>(); if (!((Object)(object)val == (Object)null)) { TMP_FontAsset capturedMenuFont = CapturedMenuFont; _welcomePanel = new GameObject("GlitnirWelcomePanel"); _welcomePanel.transform.SetParent(((Component)val).transform, false); RectTransform val2 = _welcomePanel.AddComponent<RectTransform>(); val2.anchorMin = new Vector2(0f, 0f); val2.anchorMax = new Vector2(0f, 0f); val2.pivot = new Vector2(0f, 0f); val2.anchoredPosition = new Vector2(WelcomePanelPosX?.Value ?? 5f, WelcomePanelPosY?.Value ?? 75f); val2.sizeDelta = new Vector2(WelcomePanelWidth?.Value ?? 320f, WelcomePanelHeight?.Value ?? 500f); Image val3 = _welcomePanel.AddComponent<Image>(); val3.sprite = MakeSprite(WolfBarAssets.WelcomePanel); val3.type = (Type)0; val3.preserveAspect = false; ((Graphic)val3).color = Color.white; GameObject val4 = MakeText("Title", _welcomePanel.transform, new Vector2(0f, -44f), new Vector2(-30f, 32f)); if ((Object)(object)capturedMenuFont != (Object)null) { TextMeshProUGUI val5 = val4.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val5).text = WelcomePanelTitle?.Value ?? "⚔ GLITNIR FANTASY"; ((TMP_Text)val5).font = capturedMenuFont; ((TMP_Text)val5).fontSize = 19f; ((TMP_Text)val5).fontStyle = (FontStyles)1; ((TMP_Text)val5).alignment = (TextAlignmentOptions)514; ((Graphic)val5).color = new Color(0.95f, 0.78f, 0.22f, 1f); ((TMP_Text)val5).margin = new Vector4(0f, 0f, 0f, 0f); ApplyShadow(val5); } GameObject val6 = new GameObject("Separator"); val6.transform.SetParent(_welcomePanel.transform, false); Image val7 = val6.AddComponent<Image>(); RectTransform component = val6.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -80f); component.sizeDelta = new Vector2(-20f, 10f); Sprite val8 = FindVanillaSeparatorSprite(); if ((Object)(object)val8 != (Object)null) { val7.sprite = val8; val7.type = (Type)1; ((Graphic)val7).color = Color.white; } else { ((Graphic)val7).color = new Color(0.85f, 0.65f, 0.15f, 0.5f); } GameObject val9 = MakeText("Message", _welcomePanel.transform, new Vector2(0f, -112f), new Vector2(-30f, 255f)); if ((Object)(object)capturedMenuFont != (Object)null) { TextMeshProUGUI val10 = val9.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val10).text = WelcomePanelMessage?.Value ?? "Bem-vindo às terras de Glitnir!"; ((TMP_Text)val10).font = capturedMenuFont; ((TMP_Text)val10).fontSize = 18f; ((TMP_Text)val10).fontStyle = (FontStyles)0; ((TMP_Text)val10).alignment = (TextAlignmentOptions)513; ((Graphic)val10).color = new Color(0.8f, 0.78f, 0.72f, 1f); ((TMP_Text)val10).margin = new Vector4(10f, 0f, 10f, 0f); ((TMP_Text)val10).textWrappingMode = (TextWrappingModes)1; ((TMP_Text)val10).wordSpacing = 9f; } GameObject val11 = new GameObject("Separator2"); val11.transform.SetParent(_welcomePanel.transform, false); Image val12 = val11.AddComponent<Image>(); RectTransform component2 = val11.GetComponent<RectTransform>(); component2.anchorMin = new Vector2(0f, 1f); component2.anchorMax = new Vector2(1f, 1f); component2.pivot = new Vector2(0.5f, 1f); component2.anchoredPosition = new Vector2(0f, -378f); component2.sizeDelta = new Vector2(-20f, 10f); if ((Object)(object)val8 != (Object)null) { val12.sprite = val8; val12.type = (Type)1; ((Graphic)val12).color = Color.white; } else { ((Graphic)val12).color = new Color(0.85f, 0.65f, 0.15f, 0.5f); } GameObject val13 = MakeText("PlayersOnline", _welcomePanel.transform, new Vector2(0f, -395f), new Vector2(-30f, 24f)); if ((Object)(object)capturedMenuFont != (Object)null) { _welcomePlayersText = val13.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_welcomePlayersText).text = "● Online: -- / --"; ((TMP_Text)_welcomePlayersText).font = capturedMenuFont; ((TMP_Text)_welcomePlayersText).fontSize = 15f; ((TMP_Text)_welcomePlayersText).fontStyle = (FontStyles)0; ((TMP_Text)_welcomePlayersText).alignment = (TextAlignmentOptions)513; ((Graphic)_welcomePlayersText).color = new Color(0.35f, 0.85f, 0.35f, 1f); ((TMP_Text)_welcomePlayersText).margin = new Vector4(10f, 0f, 0f, 0f); } GameObject val14 = MakeText("ServerStatus", _welcomePanel.transform, new Vector2(0f, -420f), new Vector2(-30f, 24f)); if ((Object)(object)capturedMenuFont != (Object)null) { _welcomeStatusText = val14.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_welcomeStatusText).text = "◌ Verificando servidor..."; ((TMP_Text)_welcomeStatusText).font = capturedMenuFont; ((TMP_Text)_welcomeStatusText).fontSize = 15f; ((TMP_Text)_welcomeStatusText).fontStyle = (FontStyles)0; ((TMP_Text)_welcomeStatusText).alignment = (TextAlignmentOptions)513; ((Graphic)_welcomeStatusText).color = new Color(0.7f, 0.7f, 0.7f, 1f); ((TMP_Text)_welcomeStatusText).margin = new Vector4(10f, 0f, 0f, 0f); } RefreshWelcomePanelVisibility(fejd); UpdateWelcomePlayers(); Log.LogInfo((object)"[GlitnirMenu] Painel de boas-vindas criado."); ((MonoBehaviour)Instance).StartCoroutine(PollServerPlayers()); } } catch (Exception ex) { Log.LogError((object)("[GlitnirMenu] Erro ao criar painel boas-vindas: " + ex.Message)); } } private static GameObject MakeText(string name, Transform parent, Vector2 anchoredPos, Vector2 sizeDelta) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_002d: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.AddComponent<RectTransform>(); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = anchoredPos; component.sizeDelta = sizeDelta; return val; } private static void ApplyShadow(TextMeshProUGUI tmp) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(((TMP_Text)tmp).fontSharedMaterial); val.EnableKeyword("UNDERLAY_ON"); val.SetColor("_UnderlayColor", new Color(0f, 0f, 0f, 0.9f)); val.SetFloat("_UnderlayOffsetX", 1.5f); val.SetFloat("_UnderlayOffsetY", -1.5f); val.SetFloat("_UnderlaySoftness", 0.2f); ((TMP_Text)tmp).fontMaterial = val; } private static Sprite FindVanillaSeparatorSprite() { try { if ((Object)(object)FejdStartup.instance == (Object)null) { return null; } Image[] componentsInChildren = ((Component)FejdStartup.instance).GetComponentsInChildren<Image>(true); Image[] array = componentsInChildren; foreach (Image val in array) { string text = ((Object)((Component)val).gameObject).name.ToLowerInvariant(); if ((text.Contains("divider") || text.Contains("separator") || text.Contains("ornament") || text.Contains("line")) && (Object)(object)val.sprite != (Object)null && (Object)(object)val.sprite.texture != (Object)null && ((Texture)val.sprite.texture).width > 50) { Log.LogInfo((object)("[GlitnirMenu] Separador vanilla encontrado: " + ((Object)((Component)val).gameObject).name)); return val.sprite; } } Image[] array2 = componentsInChildren; foreach (Image val2 in array2) { if ((Object)(object)val2.sprite != (Object)null) { string text2 = ((Object)val2.sprite).name.ToLowerInvariant(); if (text2.Contains("divider") || text2.Contains("separator") || text2.Contains("ornament")) { Log.LogInfo((object)("[GlitnirMenu] Separador vanilla (sprite): " + ((Object)val2.sprite).name)); return val2.sprite; } } } } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] FindVanillaSeparatorSprite: " + ex.Message)); } return null; } private static IEnumerator PollServerPlayers() { while (IsStartScene()) { string serverIp = WelcomeServerIP?.Value ?? "177.54.147.114"; int num = WelcomeServerQueryPort?.Value ?? 24445; int[] ports = ((num != 24445) ? new int[3] { num, num + 1, num - 1 } : new int[2] { 24445, 24444 }); int players = -1; bool done = false; ThreadPool.QueueUserWorkItem(delegate { int[] array = ports; foreach (int num2 in array) { try { byte[] array2 = new byte[25] { 255, 255, 255, 255, 84, 83, 111, 117, 114, 99, 101, 32, 69, 110, 103, 105, 110, 101, 32, 81, 117, 101, 114, 121, 0 }; using UdpClient udpClient = new UdpClient(); udpClient.Client.SendTimeout = 5000; udpClient.Client.ReceiveTimeout = 5000; udpClient.Connect(serverIp, num2); udpClient.Send(array2, array2.Length); IPEndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0); byte[] array3 = udpClient.Receive(ref remoteEP); Log.LogInfo((object)$"[GlitnirMenu] A2S_INFO {serverIp}:{num2} — {array3.Length} bytes, type=0x{array3[4]:X2}"); if (array3.Length >= 9 && array3[4] == 65) { byte[] array4 = new byte[20] { 83, 111, 117, 114, 99, 101, 32, 69, 110, 103, 105, 110, 101, 32, 81, 117, 101, 114, 121, 0 }; byte[] array5 = new byte[5 + array4.Length + 4]; array5[0] = byte.MaxValue; array5[1] = byte.MaxValue; array5[2] = byte.MaxValue; array5[3] = byte.MaxValue; array5[4] = 84; Array.Copy(array4, 0, array5, 5, array4.Length); array5[^4] = array3[5]; array5[^3] = array3[6]; array5[^2] = array3[7]; array5[^1] = array3[8]; udpClient.Send(array5, array5.Length); array3 = udpClient.Receive(ref remoteEP); Log.LogInfo((object)$"[GlitnirMenu] A2S_INFO pós-challenge: {array3.Length} bytes"); } int num3 = 6; for (int j = 0; j < 4; j++) { if (num3 >= array3.Length) { break; } while (num3 < array3.Length && array3[num3++] != 0) { } } num3 += 2; if (num3 < array3.Length) { players = array3[num3]; Log.LogInfo((object)$"[GlitnirMenu] A2S_INFO OK porta {num2}: players={players}"); break; } } catch (Exception ex) { Log.LogWarning((object)$"[GlitnirMenu] A2S_INFO porta {num2} falhou: {ex.Message}"); } } done = true; }); float waited = 0f; while (!done && waited < 12f) { waited += Time.unscaledDeltaTime; yield return null; } if (players >= 0) { SetWelcomePlayers(players); } else { SetServerOffline(); } yield return (object)new WaitForSecondsRealtime(60f); } } internal static void UpdateWelcomePlayers() { if ((Object)(object)_welcomePlayersText == (Object)null) { return; } try { int num = (((Object)(object)ZNet.instance != (Object)null) ? ZNet.instance.GetNrOfPlayers() : _cachedPlayerCount); int num2 = WelcomeServerMaxPlayers?.Value ?? 100; ((TMP_Text)_welcomePlayersText).text = $"● Online: {num} / {num2}"; } catch { } } internal static void SetWelcomePlayers(int count) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) _cachedPlayerCount = count; int num = WelcomeServerMaxPlayers?.Value ?? 100; if ((Object)(object)_welcomePlayersText != (Object)null) { ((TMP_Text)_welcomePlayersText).text = $"● Online: {count} / {num}"; } if ((Object)(object)_welcomeStatusText != (Object)null) { ((TMP_Text)_welcomeStatusText).text = "● Servidor Online"; ((Graphic)_welcomeStatusText).color = new Color(0.2f, 0.85f, 0.3f, 1f); } } internal static void SetServerOffline() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_welcomePlayersText != (Object)null) { ((TMP_Text)_welcomePlayersText).text = "● Online: -- / --"; } if ((Object)(object)_welcomeStatusText != (Object)null) { ((TMP_Text)_welcomeStatusText).text = "● Servidor Offline"; ((Graphic)_welcomeStatusText).color = new Color(0.85f, 0.2f, 0.2f, 1f); } } internal static void RefreshWelcomePanelVisibility(FejdStartup fejd) { if (!((Object)(object)_welcomePanel == (Object)null)) { bool active = (Object)(object)fejd != (Object)null && (Object)(object)fejd.m_mainMenu != (Object)null && fejd.m_mainMenu.activeInHierarchy; _welcomePanel.SetActive(active); } } internal static void HideClutter(FejdStartup fejd) { if ((Object)(object)fejd == (Object)null) { return; } Transform[] componentsInChildren = ((Component)fejd).GetComponentsInChildren<Transform>(true); Transform[] array = componentsInChildren; foreach (Transform val in array) { GameObject gameObject = ((Component)val).gameObject; string text = (((Object)gameObject).name ?? "").ToLowerInvariant(); string text2 = GetGoText(gameObject).ToLowerInvariant(); if (HideChangelog.Value == Toggle.On) { switch (text) { default: if (!text2.Contains("patch note") && !text2.Contains("notas de atualiza")) { break; } goto case "canvas changelog"; case "canvas changelog": case "changelog": case "patchlogscroll": case "topic": gameObject.SetActive(false); continue; } } if (HideMerchStore.Value == Toggle.On && (text.Contains("merch") || text == "valheim.shop" || text2.Contains("valheim.shop") || text2.Contains("merch"))) { gameObject.SetActive(false); } else if (HideModdedWarning.Value == Toggle.On && (text == "modded_text" || text2.Contains("modded version") || text2.Contains("versão modificada") || text2.Contains("módosított"))) { gameObject.SetActive(false); } } } private static string GetGoText(GameObject go) { TextMeshProUGUI component = go.GetComponent<TextMeshProUGUI>(); if ((Object)(object)component != (Object)null && !string.IsNullOrWhiteSpace(((TMP_Text)component).text)) { return ((TMP_Text)component).text.Trim(); } Text component2 = go.GetComponent<Text>(); if ((Object)(object)component2 != (Object)null && !string.IsNullOrWhiteSpace(component2.text)) { return component2.text.Trim(); } return ""; } internal static string GetRandomArtPath(string folder) { if (!Directory.Exists(folder)) { return null; } string[] array = (from f in Directory.GetFiles(folder) where f.EndsWith(".png", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) select f).ToArray(); if (array.Length == 0) { return null; } return array[Random.Range(0, array.Length)]; } internal static void ShowLoadingOverlay() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (LoadingScreenEnabled.Value != Toggle.On) { return; } TargetProgress = 0f; _progressValue = 0f; string randomArtPath = GetRandomArtPath(LoadingArtFolder); if (string.IsNullOrEmpty(randomArtPath)) { return; } Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(randomArtPath)); if (((Texture)val).width <= 2) { Object.Destroy((Object)(object)val); return; } HideLoadingOverlay(); _overlayTexture = val; _overlayRoot = new GameObject("GlitnirMenu_LoadingOverlay"); Object.DontDestroyOnLoad((Object)(object)_overlayRoot); Canvas val2 = _overlayRoot.AddComponent<Canvas>(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 9999; _overlayRoot.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1; _overlayRoot.AddComponent<GraphicRaycaster>(); GameObject val3 = new GameObject("BG"); val3.transform.SetParent(_overlayRoot.transform, false); RectTransform val4 = val3.AddComponent<RectTransform>(); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; ((Graphic)val3.AddComponent<Image>()).color = Color.black; GameObject val5 = new GameObject("Art"); val5.transform.SetParent(_overlayRoot.transform, false); RectTransform val6 = val5.AddComponent<RectTransform>(); val6.anchorMin = Vector2.zero; val6.anchorMax = Vector2.one; val6.offsetMin = Vector2.zero; val6.offsetMax = Vector2.zero; _overlayRawImage = val5.AddComponent<RawImage>(); _overlayRawImage.texture = (Texture)(object)val; _overlayRawImage.uvRect = CalcUvRect(val); _overlayGroup = val5.AddComponent<CanvasGroup>(); _overlayGroup.alpha = 0f; _overlayRunner = _overlayRoot.AddComponent<CanvasCoroutineRunner>(); ((MonoBehaviour)_overlayRunner).StartCoroutine(FadeOverlay(0f, 1f, 0.5f)); ((MonoBehaviour)_overlayRunner).StartCoroutine(SimulateLoadingProgress()); ((MonoBehaviour)_overlayRunner).StartCoroutine(HideVanillaLoadingGuiCoroutine()); ConfigEntry<Toggle> slideshowEnabled = SlideshowEnabled; if (slideshowEnabled != null && slideshowEnabled.Value == Toggle.On) { ((MonoBehaviour)_overlayRunner).StartCoroutine(SlideshowCoroutine(LoadingArtFolder)); } AddProgressBar(_overlayRoot); Log.LogInfo((object)("[GlitnirMenu] Loading overlay exibido: " + randomArtPath)); } internal static void SetLoadingCheckpoint(float target, string label) { if (target > TargetProgress) { TargetProgress = target; Log.LogInfo((object)$"[GlitnirMenu] Checkpoint: {label} ({Mathf.RoundToInt(target * 100f)}%)"); } } private static IEnumerator SimulateLoadingProgress() { TargetProgress = 0.05f; while ((Object)(object)_overlayRoot != (Object)null && (Object)(object)Player.m_localPlayer == (Object)null) { _progressValue = Mathf.MoveTowards(_progressValue, TargetProgress, Time.unscaledDeltaTime * 0.04f); UpdateProgressBar(_progressValue); yield return null; } TargetProgress = 1f; while ((Object)(object)_overlayRoot != (Object)null && _progressValue < 1f) { _progressValue = Mathf.MoveTowards(_progressValue, 1f, Time.unscaledDeltaTime * 0.5f); UpdateProgressBar(_progressValue); yield return null; } UpdateProgressBar(1f); } private static IEnumerator SimulateTeleportProgress() { TargetProgress = 0.1f; while ((Object)(object)_overlayRoot != (Object)null && TargetProgress < 1f) { _progressValue = Mathf.MoveTowards(_progressValue, TargetProgress, Time.unscaledDeltaTime * 0.04f); UpdateProgressBar(_progressValue); yield return null; } while ((Object)(object)_overlayRoot != (Object)null && _progressValue < 1f) { _progressValue = Mathf.MoveTowards(_progressValue, 1f, Time.unscaledDeltaTime * 0.5f); UpdateProgressBar(_progressValue); yield return null; } UpdateProgressBar(1f); } internal static IEnumerator SlideshowCoroutine(string folder) { while ((Object)(object)_overlayRoot != (Object)null) { float num = SlideshowInterval?.Value ?? 4f; yield return (object)new WaitForSecondsRealtime(num); if ((Object)(object)_overlayRoot == (Object)null) { break; } ConfigEntry<Toggle> slideshowEnabled = SlideshowEnabled; if (slideshowEnabled == null || slideshowEnabled.Value != Toggle.On) { break; } string randomArtPath = GetRandomArtPath(folder); if (string.IsNullOrEmpty(randomArtPath)) { continue; } Texture2D tex = new Texture2D(2, 2); ImageConversion.LoadImage(tex, File.ReadAllBytes(randomArtPath)); if (((Texture)tex).width <= 2) { Object.Destroy((Object)(object)tex); continue; } if ((Object)(object)_overlayGroup != (Object)null) { float t = 0f; while (t < 0.4f && (Object)(object)_overlayGroup != (Object)null) { _overlayGroup.alpha = Mathf.Lerp(1f, 0f, t / 0.4f); t += Time.deltaTime; yield return null; } } if ((Object)(object)_overlayRawImage != (Object)null) { if ((Object)(object)_overlayTexture != (Object)null) { Object.Destroy((Object)(object)_overlayTexture); } _overlayTexture = tex; _overlayRawImage.texture = (Texture)(object)tex; _overlayRawImage.uvRect = CalcUvRect(tex); } if ((Object)(object)_overlayGroup != (Object)null) { float t = 0f; while (t < 0.4f && (Object)(object)_overlayGroup != (Object)null) { _overlayGroup.alpha = Mathf.Lerp(0f, 1f, t / 0.4f); t += Time.deltaTime; yield return null; } if ((Object)(object)_overlayGroup != (Object)null) { _overlayGroup.alpha = 1f; } } } } private static IEnumerator HideVanillaLoadingGuiCoroutine() { while ((Object)(object)_overlayRoot != (Object)null) { if ((Object)(object)Hud.instance != (Object)null) { Transform val = TransformHelper.FindChild(((Component)Hud.instance).transform, "LoadingGUI"); if ((Object)(object)val != (Object)null) { CanvasGroup val2 = ((Component)val).gameObject.GetComponent<CanvasGroup>() ?? ((Component)val).gameObject.AddComponent<CanvasGroup>(); val2.alpha = 0f; val2.blocksRaycasts = false; } } yield return (object)new WaitForSecondsRealtime(0.1f); } } private static void AddProgressBar(GameObject root) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0034: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0111: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) try { WolfBarAssets.Load(); GameObject val = new GameObject("WolfBarContainer"); val.transform.SetParent(root.transform, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = new Vector2(0.5f, 0f); val2.anchorMax = new Vector2(0.5f, 0f); val2.pivot = new Vector2(0.5f, 0f); val2.anchoredPosition = new Vector2(0f, 10f); val2.sizeDelta = new Vector2(480f, 80f); GameObject val3 = new GameObject("WolfBar"); val3.transform.SetParent(val.transform, false); Image val4 = val3.AddComponent<Image>(); val4.sprite = MakeSprite(WolfBarAssets.WolfBarFull); val4.preserveAspect = false; RectTransform component = val3.GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; GameObject val5 = new GameObject("Fill"); val5.transform.SetParent(val.transform, false); _wolfFillImage = val5.AddComponent<Image>(); _wolfFillImage.sprite = MakeSprite(WolfBarAssets.FillBar); _wolfFillImage.type = (Type)3; _wolfFillImage.fillMethod = (FillMethod)0; _wolfFillImage.fillOrigin = 0; _wolfFillImage.fillAmount = 0f; _wolfFillImage.preserveAspect = false; RectTransform component2 = val5.GetComponent<RectTransform>(); component2.anchorMin = new Vector2(0.007f, 0.056f); component2.anchorMax = new Vector2(0.993f, 0.969f); component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; GameObject val6 = new GameObject("ProgressText"); val6.transform.SetParent(val.transform, false); RectTransform val7 = val6.AddComponent<RectTransform>(); val7.anchorMin = new Vector2(0.058f, 0.72f); val7.anchorMax = new Vector2(0.938f, 1.1f); val7.pivot = new Vector2(0.5f, 0.5f); val7.anchoredPosition = Vector2.zero; val7.sizeDelta = Vector2.zero; if ((Object)(object)CapturedMenuFont != (Object)null) { TextMeshProUGUI val8 = val6.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val8).text = "Acendendo as forjas de Glitnir... 0%"; ((TMP_Text)val8).font = CapturedMenuFont; ((TMP_Text)val8).fontSize = 14.4f; ((TMP_Text)val8).fontStyle = (FontStyles)0; ((TMP_Text)val8).alignment = (TextAlignmentOptions)514; ((Graphic)val8).color = new Color(0.95f, 0.93f, 0.88f, 1f); Material val9 = new Material(((TMP_Text)val8).fontSharedMaterial); val9.EnableKeyword("UNDERLAY_ON"); val9.SetColor("_UnderlayColor", new Color(0f, 0f, 0f, 0.95f)); val9.SetFloat("_UnderlayOffsetX", 2f); val9.SetFloat("_UnderlayOffsetY", -2f); val9.SetFloat("_UnderlaySoftness", 0.2f); ((TMP_Text)val8).fontMaterial = val9; ((TMP_Text)val8).textWrappingMode = (TextWrappingModes)0; _progressTmpText = val8; _progressLegacyText = null; } else { Text val10 = val6.AddComponent<Text>(); val10.text = "Acendendo as forjas de Glitnir... 0%"; val10.font = Resources.GetBuiltinResource<Font>("Arial.ttf"); val10.fontSize = 13; val10.fontStyle = (FontStyle)0; val10.alignment = (TextAnchor)4; ((Graphic)val10).color = new Color(0.95f, 0.93f, 0.88f, 1f); Shadow val11 = val6.AddComponent<Shadow>(); val11.effectColor = new Color(0f, 0f, 0f, 0.85f); val11.effectDistance = new Vector2(1.5f, -1.5f); _progressLegacyText = val10; _progressTmpText = null; } _progressValue = 0f; } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] AddProgressBar: " + ex.Message)); } } private static Sprite MakeSprite(Texture2D tex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)tex == (Object)null) { return null; } return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 100f); } private static string GetThematicMessage(float progress) { (float, string)[] array = (IsTeleportOverlay ? TeleportMessages : LoadingMessages); string result = array[0].Item2; (float, string)[] array2 = array; for (int i = 0; i < array2.Length; i++) { var (num, text) = array2[i]; if (!(progress >= num)) { break; } result = text; } return result; } internal static void UpdateProgressBar(float progress) { try { _progressValue = Mathf.Clamp01(progress); if ((Object)(object)_wolfFillImage != (Object)null) { _wolfFillImage.fillAmount = _progressValue; } int num = Mathf.RoundToInt(_progressValue * 100f); string text = $"{GetThematicMessage(_progressValue)} {num}%"; if ((Object)(object)_progressTmpText != (Object)null) { ((TMP_Text)_progressTmpText).text = text; } if ((Object)(object)_progressLegacyText != (Object)null) { _progressLegacyText.text = text; } } catch { } } internal static void HideVanillaLoadingGui(Hud hud) { try { Transform val = TransformHelper.FindChild(((Component)hud).transform, "LoadingGUI"); if ((Object)(object)val != (Object)null) { CanvasGroup val2 = ((Component)val).gameObject.GetComponent<CanvasGroup>() ?? ((Component)val).gameObject.AddComponent<CanvasGroup>(); val2.alpha = 0f; val2.blocksRaycasts = false; } } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] HideVanillaLoadingGui: " + ex.Message)); } } internal static void RestoreVanillaLoadingGui() { try { if ((Object)(object)Hud.instance == (Object)null) { return; } Transform val = TransformHelper.FindChild(((Component)Hud.instance).transform, "LoadingGUI"); if ((Object)(object)val != (Object)null) { CanvasGroup component = ((Component)val).gameObject.GetComponent<CanvasGroup>(); if ((Object)(object)component != (Object)null) { component.alpha = 1f; component.blocksRaycasts = true; } } } catch { } } internal static void ShowDeathOverlay() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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) if (LoadingScreenEnabled.Value != Toggle.On) { return; } string randomArtPath = GetRandomArtPath(LoadingArtFolder); if (string.IsNullOrEmpty(randomArtPath)) { return; } Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(randomArtPath)); if (((Texture)val).width <= 2) { Object.Destroy((Object)(object)val); return; } HideLoadingOverlay(); DeathRespawnHappened = false; _overlayTexture = val; _overlayRoot = new GameObject("GlitnirMenu_DeathOverlay"); Object.DontDestroyOnLoad((Object)(object)_overlayRoot); Canvas val2 = _overlayRoot.AddComponent<Canvas>(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 9999; _overlayRoot.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1; _overlayRoot.AddComponent<GraphicRaycaster>(); GameObject val3 = new GameObject("BG"); val3.transform.SetParent(_overlayRoot.transform, false); RectTransform val4 = val3.AddComponent<RectTransform>(); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; ((Graphic)val3.AddComponent<Image>()).color = Color.black; GameObject val5 = new GameObject("Art"); val5.transform.SetParent(_overlayRoot.transform, false); RectTransform val6 = val5.AddComponent<RectTransform>(); val6.anchorMin = Vector2.zero; val6.anchorMax = Vector2.one; val6.offsetMin = Vector2.zero; val6.offsetMax = Vector2.zero; _overlayRawImage = val5.AddComponent<RawImage>(); _overlayRawImage.texture = (Texture)(object)val; _overlayRawImage.uvRect = CalcUvRect(val); _overlayGroup = val5.AddComponent<CanvasGroup>(); _overlayGroup.alpha = 0f; _overlayRunner = _overlayRoot.AddComponent<CanvasCoroutineRunner>(); ((MonoBehaviour)_overlayRunner).StartCoroutine(FadeOverlay(0f, 1f, 0.5f)); ((MonoBehaviour)_overlayRunner).StartCoroutine(SimulateDeathProgress()); ConfigEntry<Toggle> slideshowEnabled = SlideshowEnabled; if (slideshowEnabled != null && slideshowEnabled.Value == Toggle.On) { ((MonoBehaviour)_overlayRunner).StartCoroutine(SlideshowCoroutine(LoadingArtFolder)); } AddProgressBar(_overlayRoot); Log.LogInfo((object)("[GlitnirMenu] Death overlay exibido: " + randomArtPath)); } private static IEnumerator SimulateDeathProgress() { TargetProgress = 0.05f; while ((Object)(object)_overlayRoot != (Object)null && !DeathRespawnHappened) { _progressValue = Mathf.MoveTowards(_progressValue, TargetProgress, Time.unscaledDeltaTime * 0.04f); UpdateProgressBar(_progressValue); yield return null; } TargetProgress = 1f; while ((Object)(object)_overlayRoot != (Object)null && _progressValue < 1f) { _progressValue = Mathf.MoveTowards(_progressValue, 1f, Time.unscaledDeltaTime * 0.5f); UpdateProgressBar(_progressValue); yield return null; } UpdateProgressBar(1f); } internal static void ShowTeleportOverlay() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00df: 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_00f7: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) try { if (TeleportScreenEnabled.Value != Toggle.On) { return; } TargetProgress = 0f; _progressValue = 0f; string randomArtPath = GetRandomArtPath(TeleportArtFolder); if (string.IsNullOrEmpty(randomArtPath)) { return; } Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(randomArtPath)); if (((Texture)val).width <= 2) { Object.Destroy((Object)(object)val); return; } DestroyOverlay(); _overlayTexture = val; GameObject val2 = new GameObject("GlitnirMenu_TeleportOverlay"); Object.DontDestroyOnLoad((Object)(object)val2); _overlayRoot = val2; Canvas val3 = val2.AddComponent<Canvas>(); val3.renderMode = (RenderMode)0; val3.sortingOrder = 9999; val2.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1; val2.AddComponent<GraphicRaycaster>(); GameObject val4 = new GameObject("BG"); val4.transform.SetParent(val2.transform, false); RectTransform val5 = val4.AddComponent<RectTransform>(); val5.anchorMin = Vector2.zero; val5.anchorMax = Vector2.one; val5.offsetMin = Vector2.zero; val5.offsetMax = Vector2.zero; ((Graphic)val4.AddComponent<Image>()).color = Color.black; GameObject val6 = new GameObject("Art"); val6.transform.SetParent(val2.transform, false); RectTransform val7 = val6.AddComponent<RectTransform>(); val7.anchorMin = Vector2.zero; val7.anchorMax = Vector2.one; val7.offsetMin = Vector2.zero; val7.offsetMax = Vector2.zero; _overlayRawImage = val6.AddComponent<RawImage>(); _overlayRawImage.texture = (Texture)(object)val; _overlayRawImage.uvRect = CalcUvRect(val); _overlayGroup = val6.AddComponent<CanvasGroup>(); _overlayGroup.alpha = 0f; _overlayRunner = val2.AddComponent<CanvasCoroutineRunner>(); ((MonoBehaviour)_overlayRunner).StartCoroutine(FadeOverlay(0f, 1f, 0.4f)); ((MonoBehaviour)_overlayRunner).StartCoroutine(SimulateTeleportProgress()); ConfigEntry<Toggle> slideshowEnabled = SlideshowEnabled; if (slideshowEnabled != null && slideshowEnabled.Value == Toggle.On) { ((MonoBehaviour)_overlayRunner).StartCoroutine(SlideshowCoroutine(TeleportArtFolder)); } AddProgressBar(_overlayRoot); Log.LogInfo((object)("[GlitnirMenu] Teleport overlay exibido: " + randomArtPath)); } catch (Exception ex) { Log.LogWarning((object)("[GlitnirMenu] Erro no teleport overlay: " + ex.Message)); } } internal static void HideLoadingOverlay() { RestoreVanillaLoadingGui(); if (!((Object)(object)_overlayRoot == (Object)null)) { if ((Object)(object)_overlayRunner != (Object)null) { ((MonoBehaviour)_overlayRunner).StartCoroutine(FadeAndDestroyOverlay(0.5f)); } else { DestroyOverlay(); } } } private static IEnumerator FadeOverlay(float from, float to, float dur) { float t = 0f; while (t < dur) { if ((Object)(object)_overlayGroup == (Object)null) { yield break; } _overlayGroup.alpha = Mathf.Lerp(from, to, t / dur); t += Time.deltaTime; yield return null; } if ((Object)(object)_overlayGroup != (Object)null) { _overlayGroup.alpha = to; } } private static IEnumerator FadeAndDestroyOverlay(float dur) { GameObject root = _overlayRoot; CanvasGroup group = _overlayGroup; _overlayRoot = null; _overlayRawImage = null; _overlayGroup = null; _overlayRunner = null; float t = 0f; while (t < dur && (Object)(object)group != (Object)null) { group.alpha = Mathf.Lerp(1f, 0f, t / dur); t += Time.deltaTime; yield return null; } if ((Object)(object)root != (Object)null) { Object.Destroy((Object)(object)root); } if ((Object)(object)_overlayTexture != (Object)null) { Object.Destroy((Object)(object)_overlayTexture); _overlayTexture = null; } Log.LogInfo((object)"[GlitnirMenu] Loading overlay removido."); } private static void DestroyOverlay() { if ((Object)(object)_overlayRoot != (Object)null) { Object.Destroy((Object)(object)_overlayRoot); } if ((Object)(object)_overlayTexture != (Object)null) { Object.Destroy((Object)(object)_overlayTexture); _overlayTexture = null; } _overlayRoot = null; _overlayRawImage = null; _overlayGroup = null; _overlayRunner = null; _wolfFillImage = null; _progressLegacyText = null; _progressTmpText = null; _progressValue = 0f; } private static Rect CalcUvRect(Texture2D tex) { //IL_003b: 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) //IL_0061: Unknown result type (might be due to invalid IL or missing references) float num = (float)Screen.width / (float)Screen.height; float num2 = (float)((Texture)tex).width / (float)((Texture)tex).height; if (Mathf.Approximately(num, num2)) { return new Rect(0f, 0f, 1f, 1f); } if (num2 > num) { float num3 = num / num2; return new Rect((1f - num3) / 2f, 0f, num3, 1f); } float num4 = num2 / num; return new Rect(0f, (1f - num4) / 2f, 1f, num4); } internal static void ApplyCameraPresets() { //IL_0005: 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) //IL_0023: 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_0041: 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_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00aa: 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) CharacterCameraMarker_Position.Value = PresetCharPos; CreditsCameraMarker_Position.Value = PresetCredPos; GameCameraMarker_Position.Value = PresetGamePos; MainCameraMarker_Position.Value = PresetMainPos; StartCameraMarker_Position.Value = PresetMainPos; SavesCameraMarker_Position.Value = PresetSavesPos; CharacterCameraMarker_Rotation.Value = PresetCharRot; CreditsCameraMarker_Rotation.Value = PresetCredRot; GameCameraMarker_Rotation.Value = PresetGameRot; MainCameraMarker_Rotation.Value = PresetMainRot; StartCameraMarker_Rotation.Value = PresetMainRot; SavesCameraMarker_Rotation.Value = PresetSavesRot; MPlayerPosition.Value = PresetPlayerPos; } internal static void ApplyCameraDefaults() { //IL_0005: 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) //IL_0023: 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_0041: 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_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00aa: Unknown result type (might be due to invalid IL or missing references) CharacterCameraMarker_Position.Value = DefaultCharPos; CreditsCameraMarker_Position.Value = DefaultCredPos; GameCameraMarker_Position.Value = DefaultGamePos; MainCameraMarker_Position.Value = DefaultMainPos; StartCameraMarker_Position.Value = DefaultStartPos; SavesCameraMarker_Position.Value = DefaultSavesPos; CharacterCameraMarker_Rotation.Value = DefaultCharRot; CreditsCameraMarker_Rotation.Value = DefaultCredRot; GameCameraMarker_Rotation.Value = DefaultGameRot; MainCameraMarker_Rotation.Value = DefaultMainRot; StartCameraMarker_Rotation.Value = DefaultStartRot; SavesCameraMarker_Rotation.Value = DefaultSavesRot; } internal static bool IsStartScene() { //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) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name == "start"; } private void SetupWatcher() { string directoryName = Path.GetDirectoryName(ConfigFileFullPath); FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(directoryName, "GlitnirMenu.cfg"); fileSystemWatcher.Changed += delegate { try { _cfg.Reload(); } catch { } }; fileSystemWatcher.Created += delegate { try { _cfg.Reload(); } catch { } }; fileSystemWatcher.Renamed += delegate { try { _cfg.Reload(); } catch { } }; fileSystemWatcher.IncludeSubdirectories = false; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; FileSystemWatcher fileSystemWatcher2 = new FileSystemWatcher(AssetRoot, "*.png"); fileSystemWatcher2.Changed += delegate { TryReloadLogos(); }; fileSystemWatcher2.Created += delegate { TryReloadLogos(); }; fileSystemWatcher2.Renamed += delegate { TryReloadLogos(); }; fileSystemWatcher2.IncludeSubdirectories = true; fileSystemWatcher2.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher2.EnableRaisingEvents = true; } static GlitnirMenuPlugin() { //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) //IL_0028: 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_0041: 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_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_0073: 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_008c: 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_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_00be: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) PresetCharPos = new Vector3(-206.2f, 39.34f, 162.26f); PresetCharRot = new Vector3(19.6f, -211f, 0f); PresetCredPos = new Vector3(-205.3f, 34.29f, 132.06f); PresetCredRot = new Vector3(19.6f, -211f, 0f); PresetMainPos = new Vector3(-208.54f, 32.2f, 131.38f); PresetMainRot = new Vector3(0.72f, -211f, 0f); PresetGamePos = new Vector3(-204.55f, 38f, 158.8f); PresetGameRot = new Vector3(-181.447f, -48.532f, -180f); PresetSavesPos = new Vector3(-208.45f, 45.76f, 131.23f); PresetSavesRot = new Vector3(0.72f, -211f, 131.23f); PresetPlayerPos = new Vector3(-204.51f, 36.5f, 157.53f); _cachedPlayerCount = 0; _progressValue = 0f; TargetProgress = 0f; LoadingMessages = new(float, string)[11] { (0f, "Acendendo as forjas de Glitnir..."), (0.1f, "Invocando os corvos de Odin..."), (0.2f, "Navegando pelos mares de Midgard..."), (0.3f, "Despertando os espíritos ancestrais..."), (0.4f, "Forjando os laços entre os reinos..."), (0.5f, "Preparando os nove reinos..."), (0.6f, "Convocando os guerreiros vikings..."), (0.7f, "Erguendo as muralhas de Glitnir..."), (0.8f, "Abrindo os portões sagrados..."), (0.9f, "Valhalla está quase pronto..."), (0.99f, "Os portões de Glitnir se abrem!") }; TeleportMessages = new(float, string)[4] { (0f, "Atravessando o portal..."), (0.3f, "Viajando entre os reinos..."), (0.6f, "Chegando ao destino..."), (0.9f, "Aterrissando em segurança...") }; DeathRespawnHappened = false; string path = Path.Combine(Paths.ConfigPath, "GlitnirMenu"); ConfigFileFullPath = Path.Combine(path, "GlitnirMenu.cfg"); AssetRoot = Path.Combine(path, "images"); LoadingArtFolder = Path.Combine(AssetRoot, "loading"); TeleportArtFolder = Path.Combine(AssetRoot, "teleport"); } } internal static class SceneFunctions { internal static GameObject ClonedFire; internal static void GatherDefaults(FejdStartup startup) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0026: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_009e: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00bb: 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_00cb: 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) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00eb: 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_0106: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) GlitnirMenuPlugin.DefaultCharPos = startup.m_cameraMarkerCharacter.position; GlitnirMenuPlugin.DefaultCredPos = startup.m_cameraMarkerCredits.position; GlitnirMenuPlugin.DefaultGamePos = startup.m_cameraMarkerGame.position; GlitnirMenuPlugin.DefaultMainPos = startup.m_cameraMarkerMain.position; GlitnirMenuPlugin.DefaultStartPos = startup.m_cameraMarkerStart.position; GlitnirMenuPlugin.DefaultSavesPos = startup.m_cameraMarkerSaves.position; Quaternion rotation = startup.m_cameraMarkerCharacter.rotation; GlitnirMenuPlugin.DefaultCharRot = ((Quaternion)(ref rotation)).eulerAngles; rotation = startup.m_cameraMarkerCredits.rotation; GlitnirMenuPlugin.DefaultCredRot = ((Quaternion)(ref rotation)).eulerAngles; rotation = startup.m_cameraMarkerGame.rotation; GlitnirMenuPlugin.DefaultGameRot = ((Quaternion)(ref rotation)).eulerAngles; rotation = startup.m_cameraMarkerMain.rotation; GlitnirMenuPlugin.DefaultMainRot = ((Quaternion)(ref rotation)).eulerAngles; rotation = startup.m_cameraMarkerStart.rotation; GlitnirMenuPlugin.DefaultStartRot = ((Quaternion)(ref rotation)).eulerAngles; rotation = startup.m_cameraMarkerSaves.rotation; GlitnirMenuPlugin.DefaultSavesRot = ((Quaternion)(ref rotation)).eulerAngles; GlitnirMenuPlugin.DefaultPlayerPreviewPoint = startup.m_characterPreviewPoint; GlitnirMenuPlugin.DefaultPlayerPos = startup.m_characterPreviewPoint.position; rotation = startup.m_characterPreviewPoint.rotation; GlitnirMenuPlugin.DefaultPlayerRot = ((Quaternion)(ref rotation)).eulerAngles; } internal static void UpdateCameraValues() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00f0: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)FejdStartup.instance == (Object)null)) { FejdStartup instance = FejdStartup.instance; instance.m_cameraMarkerCharacter.position = GlitnirMenuPlugin.CharacterCameraMarker_Position.Value; instance.m_cameraMarkerCredits.position = GlitnirMenuPlugin.CreditsCameraMarker_Position.Value; instance.m_cameraMarkerGame.position = GlitnirMenuPlugin.GameCameraMarker_Position.Value; instance.m_cameraMarkerMain.position = GlitnirMenuPlugin.MainCameraMarker_Position.Value; instance.m_cameraMarkerStart.position = GlitnirMenuPlugin.StartCameraMarker_Position.Value; instance.m_cameraMarkerSaves.position = GlitnirMenuPlugin.SavesCameraMarker_Position.Value; instance.m_cameraMarkerCharacter.rotation = Quaternion.Euler(GlitnirMenuPlugin.CharacterCameraMarker_Rotation.Value); instance.m_cameraMarkerCredits.rotation = Quaternion.Euler(GlitnirMenuPlugin.CreditsCameraMarker_Rotation.Value); instance.m_cameraMarkerGame.rotation = Quaternion.Euler(GlitnirMenuPlugin.GameCameraMarker_Rotation.Value); instance.m_cameraMarkerMain.rotation = Quaternion.Euler(GlitnirMenuPlugin.MainCameraMarker_Rotation.Value); instance.m_cameraMarkerStart.rotation = Quaternion.Euler(GlitnirMenuPlugin.StartCameraMarker_Rotation.Value); instance.m_cameraMarkerSaves.rotation = Quaternion.Euler(GlitnirMenuPlugin.SavesCameraMarker_Rotation.Value); } } internal static void UpdatePlayerValues() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)FejdStartup.instance == (Object)null)) { FejdStartup.instance.m_characterPreviewPoint.position = GlitnirMenuPlugin.MPlayerPosition.Value; FejdStartup.instance.m_characterPreviewPoint.rotation = Quaternion.Euler(GlitnirMenuPlugin.MPlayerRotation.Value); } } internal static void UpdateFirePosition() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ClonedFire == (Object)null)) { ClonedFire.transform.position = GlitnirMenuPlugin.MFirePosition.Value; } } internal static void UpdateAndSet() { if (GlitnirMenuPlugin.UsePreset.Value == GlitnirMenuPlugin.Toggle.On && GlitnirMenuPlugin.UseVanilla.Value == GlitnirMenuPlugin.Toggle.Off) { GlitnirMenuPlugin.ApplyCameraPresets(); } else if (GlitnirMenuPlugin.UseVanilla.Value == GlitnirMenuPlugin.Toggle.On && GlitnirMenuPlugin.UsePreset.Value == GlitnirMenuPlugin.Toggle.Off) { GlitnirMenuPlugin.ApplyCameraDefaults(); } UpdateCameraValues(); UpdatePlayerValues(); } } internal class CanvasCoroutineRunner : MonoBehaviour { } [HarmonyPatch(typeof(FejdStartup), "SetupGui")] internal static class Patch_SetupGui { private static void Postfix(FejdStartup __instance) { //IL_00b2: 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_0111: Unknown result type (might be due to invalid IL or missing references) SceneFunctions.GatherDefaults(__instance); try { GameObject val = GameObject.Find("Static"); if ((Object)(object)val != (Object)null) { Transform val2 = TransformHelper.FindChild(val.transform, "props"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(true); Transform obj = TransformHelper.FindChild(val2, "Rocks"); if (obj != null) { ((Component)obj).gameObject.SetActive(true); } Transform obj2 = TransformHelper.FindChild(val2, "ships"); if (obj2 != null) { ((Component)obj2).gameObject.SetActive(true); } } } } catch (Exception ex) { GlitnirMenuPlugin.Log.LogWarning((object)("[GlitnirMenu] Props: " + ex.Message)); } try { GameObject val3 = GameObject.Find("MenuFire"); if ((Object)(object)val3 != (Object)null) { SceneFunctions.ClonedFire = Object.Instantiate<GameObject>(val3, GlitnirMenuPlugin.MFirePosition.Value, Quaternion.identity); TerrainModifier val4 = SceneFunctions.ClonedFire.AddComponent<TerrainModifier>(); val4.m_level = true; val4.m_levelRadius = 4f; val4.m_smoothRadius = 8f; val4.m_smoothPower = 2f; val4.m_smooth = true; val4.m_paintCleared = true; val4.m_paintType = (PaintType)2; val4.m_paintRadius = 3f; } } catch (Exception ex2) { GlitnirMenuPlugin.Log.LogWarning((object)("[GlitnirMenu] Fogueira: " + ex2.Message)); } SceneFunctions.UpdateAndSet(); GlitnirMenuPlugin.TryReloadLogos(); if ((Object)(object)GlitnirMenuPlugin.CapturedMenuFont == (Object)null) { GlitnirMenuPlugin.CapturedMenuFont = GlitnirMenuPlugin.GetMenuFont(); } GlitnirMenuPlugin.CreateOrRefreshDiscordPanel(__instance); GlitnirMenuPlugin.CreateOrRefreshWelcomePanel(__instance); ((MonoBehaviour)GlitnirMenuPlugin.Instance).StartCoroutine(HideClutterDelayed(__instance)); } private static IEnumerator HideClutterDelayed(FejdStartup fejd) { yield return (object)new WaitForSecondsRealtime(0.5f); GlitnirMenuPlugin.HideClutter(fejd); } } [HarmonyPatch(typeof(FejdStartup), "UpdateCamera")] internal static class Patch_UpdateCamera { private static void Postfix(FejdStartup __instance) { SceneFunctions.UpdateCameraValues(); GlitnirMenuPlugin.RefreshDiscordPanelVisibility(__instance); GlitnirMenuPlugin.RefreshWelcomePanelVisibility(__instance); GlitnirMenuPlugin.UpdateWelcomePlayers(); } } [HarmonyPatch(typeof(FejdStartup), "ShowCharacterSelection")] internal static class Patch_ShowCharacterSelection { private static void Prefix(FejdStartup __instance) { //IL_0014: 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_001c: 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_008d: Unknown result type (might be due to invalid IL or missing references) if (GlitnirMenuPlugin.UsePreset.Value == GlitnirMenuPlugin.Toggle.On) { Quaternion rotation = __instance.m_cameraMarkerCharacter.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; __instance.m_characterPreviewPoint.rotation = Quaternion.Euler(0f, y - 180f, 0f); object? obj = ((object)__instance).GetType().GetField("m_playerInstance", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); GameObject val = (GameObject)((obj is GameObject) ? obj : null); if ((Object)(object)val != (Object)null) { val.transform.rotation = Quaternion.Euler(0f, y - 180f, 0f); } } } } [HarmonyPatch(typeof(FejdStartup), "OnCharacterStart")] internal static class Patch_OnCharacterStart { private static void Prefix(FejdStartup __instance) { //IL_0014: 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_001c: 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_008d: Unknown result type (might be due to invalid IL or missing references) if (GlitnirMenuPlugin.UsePreset.Value == GlitnirMenuPlugin.Toggle.On) { Quaternion rotation = __instance.m_cameraMarkerCharacter.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; __instance.m_characterPreviewPoint.rotation = Quaternion.Euler(0f, y - 40f, 0f); object? obj = ((object)__instance).GetType().GetField("m_playerInstance", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); GameObject val = (GameObject)((obj is GameObject) ? obj : null); if ((Object)(object)val != (Object)null) { val.transform.rotation = Quaternion.Euler(0f, y - 40f, 0f); } } } } [HarmonyPatch(typeof(Player), "TeleportTo")] internal static class Patch_PlayerTeleportTo { private static void Postfix(bool __result) { if (__result) { GlitnirMenuPlugin.ShowTeleportOverlay(); GlitnirMenuPlugin.SetLoadingCheckpoint(0.3f, "Teleporte iniciado"); } } } [HarmonyPatch(typeof(Player), "UpdateTeleport")] internal static class Patch_PlayerUpdateTeleport { private static bool _wasTeleporting; private static void Postfix(Player __instance) { if (!((Object)(object)GlitnirMenuPlugin._overlayRoot == (Object)null) && !(((Object)GlitnirMenuPlugin._overlayRoot).name != "GlitnirMenu_TeleportOverlay")) { if (((Character)__instance).IsTeleporting()) { _wasTeleporting = true; GlitnirMenuPlugin.SetLoadingCheckpoint(0.6f, "Teleportando..."); } else if (_wasTeleporting) { _wasTeleporting = false; GlitnirMenuPlugin.SetLoadingCheckpoint(1f, "Teleporte concluído"); GlitnirMenuPlugin.HideLoadingOverlay(); } } } } [HarmonyPatch(typeof(ZoneSystem), "Start")] internal static class Patch_ZoneSystemStart { private static void Postfix() { GlitnirMenuPlugin.SetLoadingCheckpoint(0.15f, "ZoneSystem iniciado"); } } [HarmonyPatch(typeof(DungeonDB), "Start")] internal static class Patch_DungeonDBStart { private static void Postfix() { GlitnirMenuPlugin.SetLoadingCheckpoint(0.75f, "Dungeons carregadas"); } } [HarmonyPatch(typeof(ZoneSystem), "UpdateTTL")] internal static class Patch_ZoneSystemUpdateTTL { private static void Postfix() { GlitnirMenuPlugin.SetLoadingCheckpoint(0.8f, "Zonas carregadas"); } } [Ha