private static void Postfix(Panel_MainMenu __instance) { GameObject gameObject = __instance.m_VersionLabel; UILabel versionLabel = gameObject.GetComponent <UILabel>(); versionLabel.multiLine = true; versionLabel.overflowMethod = UILabel.Overflow.ResizeHeight; versionLabel.width = 1100; versionLabel.depth = int.MaxValue; if (ModLoader.HasUpdate(out string version)) { versionLabel.text += "\n\n[url=update]A new version of the Mod Loader is available (v" + version + "). Click here to be taken to the download page.[/url]"; BoxCollider collider = gameObject.AddComponent <BoxCollider>(); collider.center = versionLabel.localCenter; collider.size = versionLabel.localSize; OpenLinkInBrowser opener = gameObject.AddComponent <OpenLinkInBrowser>(); opener.label = versionLabel; } if (ModLoader.HasFailed(out string failureMessage)) { versionLabel.color = Color.red; versionLabel.text += "\n\n" + failureMessage; } }
private static void Add4DoNItem(Panel_MainMenu mainMenu) { Panel_MainMenu.MainMenuItem menuItem = new Panel_MainMenu.MainMenuItem(); menuItem.m_Type = Panel_MainMenu.MainMenuItem.MainMenuItemType.FourDaysOfNight; menuItem.m_LabelLocalizationId = "GAMEPLAY_FourDaysOfNight"; mainMenu.m_MenuItems.Insert(0, menuItem); }
public static void Postfix(Panel_MainMenu __instance) { StartSettings set = __instance.m_StartSettings; set.m_RandomTimeOfDay = true; set.m_RandomWeather = true; __instance.m_StartSettings = set; }
public static void Prefix(Panel_MainMenu __instance) { if (skipIntro) { MoviePlayer.m_HasIntroPlayedForMainMenu = true; } if (skipFade) { __instance.m_StartFadedOut = true; } }
static void Prefix(Panel_MainMenu __instance) { if (GameManager.GetExperienceModeManagerComponent().GetCurrentExperienceModeType() == ExperienceModeType.ChallengeNomad) { GameManager.GetExperienceModeManagerComponent().SetExperienceModeType(NomadGlobals.Difficulty); NomadGlobals.NomadActive = true; } else { NomadGlobals.NomadActive = false; } }
private static void Postfix(Panel_MainMenu __instance) { if (!ModLoader.HasFailed) { return; } GameObject gameObject = __instance.m_VersionLabel; UILabel versionLabel = gameObject.GetComponent <UILabel>(); versionLabel.color = Color.red; versionLabel.multiLine = true; versionLabel.text += "\n\n" + ModLoader.failureMessage; versionLabel.depth = int.MaxValue; }
private static void UpdateVisuals(Panel_MainMenu mainMenu) { BasicMenu basicMenu = mainMenu.m_BasicMenuRoot.GetComponentInChildren <BasicMenu>(); Transform tldLogo = mainMenu.m_MainWindow.transform.Find("TLD_wordmark"); Vector3 targetPos = tldLogo.localPosition; float menuHeight = basicMenu.GetItemCount() * basicMenu.m_MenuGrid.cellHeight; targetPos.y = menuHeight - 87; tldLogo.localPosition = targetPos; basicMenu.m_MenuGrid.Reposition(); Traverse.Create(basicMenu).Field("m_PreviousSelectedButtonIndex").SetValue(-1); basicMenu.ManualUpdate(); }
private static void Postfix(Panel_MainMenu __instance) { if (!changed) { return; } BasicMenu basicMenu = __instance.m_BasicMenuRoot.GetComponentInChildren <BasicMenu>(); if (!basicMenu.gameObject.activeInHierarchy) { return; } UpdateVisuals(__instance); changed = false; }
// EMS load screen private void timer1_Tick(object sender, EventArgs e) { FakeBar.Increment(inc_val); FakeBar.Update(); if (FakeBar.Value == 95) { inc_val = 1; } // go to main menu once the loading is done if (FakeBar.Value == 100) { Thread.Sleep(500); Panel_MainMenu.BringToFront(); timer1.Enabled = false; db = new DataAccess(); demographics = new Demographics(this, db); } }
internal static void SetEnabled(bool enable) { if (visible == enable) { return; } visible = enable; changed = true; Panel_MainMenu mainMenu = InterfaceManager.m_Panel_MainMenu; if (enable) { Add4DoNItem(mainMenu); } else { Remove4DoNItem(mainMenu); ResetTimeAndWeather(mainMenu); } }
private static void Postfix(Panel_MainMenu __instance) { GameObject gameObject = __instance.m_VersionLabel; UILabel versionLabel = gameObject.GetComponent <UILabel>(); versionLabel.multiLine = true; versionLabel.overflowMethod = UILabel.Overflow.ResizeHeight; versionLabel.width = 1100; versionLabel.depth = int.MaxValue; if (ModLoader.HasFailed() && !string.IsNullOrEmpty(Application.consoleLogPath)) { string logFileName = Path.GetFileName(Application.consoleLogPath); versionLabel.text += " [url=log](Error - click here to open the directory that contains " + logFileName + ")[/url]"; } if (ModLoader.HasUpdate(out string version)) { versionLabel.text += "\n\n[url=update]A new version of the Mod Loader is available (v" + version + "). Click here to be taken to the download page.[/url]"; } if (ModLoader.HasFailed(out string failureMessage)) { versionLabel.color = Color.red; versionLabel.text += "\n\n" + failureMessage; } BoxCollider collider = gameObject.AddComponent <BoxCollider>(); collider.center = versionLabel.localCenter; collider.size = versionLabel.localSize; LinkOpener opener = gameObject.AddComponent <LinkOpener>(); opener.label = versionLabel; }
// Go to Main Menu (Home) panel private void Btn_Home_Click(object sender, EventArgs e) { ClearAllFields(); Panel_MainMenu.BringToFront(); }
public static void Postfix(Panel_MainMenu __instance) { __instance.m_InitialScreenFadeInDuration = 0f; }
void Update() { //Main Key if (Input.GetKeyUp(KeyCode.Escape)) { ToggleMainMenu = !ToggleMainMenu; } //Reset Scene Key if (Input.GetKeyUp(KeyCode.R)) { #if (UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7 || UNITY_5_8 || UNITY_5_9) SceneManager.LoadScene(SceneManager.GetActiveScene().name); #else Application.LoadLevel(Application.loadedLevelName); #endif } //Toggle CGF Lines if (Input.GetKeyUp(KeyCode.T)) { ToggleCGFLines(); } //Toggles GUI if (Input.GetKeyUp(KeyCode.Home)) { ToggleGUILayout(); } //Help ESC text if (HelpUIText != null) { if (ToggleMainMenu) { HelpUIText.text = "Press <b>ESC</b> to go back."; } else { HelpUIText.text = "Press <b>ESC</b> for menu."; } } if (Panel_MainMenu != null) { Panel_MainMenu.SetActive(ToggleMainMenu); } if (Fps_GunScript != null) { Fps_GunScript.enabled = (!ToggleMainMenu); } if (FirstPersonController != null) { FirstPersonController.enabled = (!ToggleMainMenu); } #if (UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7 || UNITY_5_8 || UNITY_5_9) if ((!ToggleMainMenu && LockMouse)) { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } else { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } #else Screen.lockCursor = (!ToggleMainMenu && LockMouse);; #endif }
public static void Prefix(Panel_MainMenu __instance) { fakeInput = true; __instance.m_FadeInTimeSeconds = 0.00001f; __instance.m_InitialScreenFadeInDuration = 0f; }
private static void Postfix(Panel_MainMenu __instance) { Traverse.Create(__instance).Field("m_DoneFourDaysOfNightDeleteCheck").SetValue(true); }
public static void Prefix(Panel_MainMenu __instance) { MoviePlayer.m_HasIntroPlayedForMainMenu = true; }
private static void Postfix(Panel_MainMenu __instance) { __instance?.m_HinterlandMailingListWidget?.gameObject?.SetActive(false); }
private static void ResetTimeAndWeather(Panel_MainMenu mainMenu) { Traverse.Create(mainMenu).Field("m_StartSettingsApplied").SetValue(false); }
private static void Remove4DoNItem(Panel_MainMenu mainMenu) { mainMenu.m_MenuItems.RemoveAll(item => item.m_Type == Panel_MainMenu.MainMenuItem.MainMenuItemType.FourDaysOfNight); }
static void PanelMainMenu_Enable_Prefix(Panel_MainMenu __instance) => MoviePlayer.m_HasIntroPlayedForMainMenu = __instance.m_StartFadedOut = true;
static void PanelMainMenu_UpdateFading_Prefix(Panel_MainMenu __instance) => __instance.m_InitialScreenFadeInDuration = 0f;