IEnumerator ShowResults() { GameObject.Find("Character").GetComponent <Move>().enabled = false; yield return(new WaitForSeconds(delay)); main_section.transform.localScale = Vector3.zero; results_section.transform.localScale = Vector3.one; float time = Time.realtimeSinceStartup - (start_time + delay); time = Mathf.Round((time * 10.0f)) / 10.0f; Text results = results_obj.transform.GetChild(0).GetComponent <Text>(); results.text = results.text.Replace("XXXX", time.ToString()); string levelStr = SceneManager.GetActiveScene().name; levelStr = levelStr.Replace("Level", ""); int levelNum = int.Parse(levelStr); if (levelNum < Unlocks.num_levels) { Unlocks.level_done[levelNum] = true; } Unlocks.SaveData(); }
public override void Update() { string text = this._textElement.text; int num = 0; foreach (MatchSetting matchSetting in TeamSelect2.matchSettings) { if (matchSetting.filtered) { ++num; } } foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Any)) { if (unlock.enabled && unlock.filtered) { ++num; } } if (num == 0) { this._textElement.text = "|DGBLUE|NO FILTERS"; } else { this._textElement.text = "|DGYELLOW|FILTERS: " + num.ToString(); } if (this._textElement.text != text) { this._textElement.Resize(); this._dirty = true; this.rightSection.Resize(); } base.Update(); }
public static void Init(GraphicsDevice graphics) { UnlockedTowers = 0; rnd = new Random(); UiManager.UiScreens.Clear(); UiSideScreen = new UiSideGameScreen(graphics); UiTopScreen = new UiTopGameScreen(graphics); WaveManager.Reset(); EnemyManager.Init(); EnemyListener.InitiliseListener(); TowerManager.Init(); TowerListener.InitiliseListener(); TroopManager.Init(); TroopListener.InitiliseListener(); QuestionPopUpManager.Init(); // CHEATY TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /*UnlockedTowers |= Unlocks.RocketTower; * UnlockedTowers |= Unlocks.SamTower; * UnlockedTowers |= Unlocks.TeslaTower; * UnlockedTowers |= Unlocks.Upgrade; * ModifyResources(100000); * for (int i = 0; i < 100; i++) * TroopManager.SpawnTroop();*/ }
public override void Update() { string text = this._textElement.text; int num = 0; foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Modifier)) { if (unlock.enabled) { ++num; } } if (num == 0) { this._textElement.text = "|DGBLUE|NO MODIFIERS"; } else { this._textElement.text = "|DGYELLOW|MODIFIERS: " + num.ToString(); } if (this._textElement.text != text) { this._textElement.Resize(); this._dirty = true; this.rightSection.Resize(); } base.Update(); }
public ActionResult <Unlocks> PostUnlocks(Unlocks unlocks) { _context.Unlocks.Add(unlocks); _context.SaveChanges(); return(CreatedAtAction("GetUnlocks", new { id = unlocks.Id }, unlocks)); }
void Awake() { if (instance == null) { instance = this; } }
void Update() { Unlocks unlocks = Unlocks.instance; if (unlocks.zeus.isUnlocked) // Custom usage, since there is a speed power up. { if (Input.GetKeyDown(unlocks.zeus.keycode)) { float speedMulti = unlocks.zeusSpeed.isUnlocked ? unlocks.zeusSpeed.value : 1; if (Time.time - unlocks.zeus.lastUsedTime >= (unlocks.zeus.cooldown * speedMulti)) { unlocks.zeus.lastUsedTime = Time.time; Instantiate(zeusZapPrefab); } } } if (unlocks.poseidon.AttemptUse(Time.time)) { unlocks.poseidon.lastUsedTime = Time.time; } if (unlocks.athena.AttemptUse(Time.time)) { unlocks.athena.lastUsedTime = Time.time; } }
public void LoadXML(XmlElement xmlStage) { StageName = xmlStage.GetAttribute("stageName"); // Required StageDir = xmlStage.GetAttribute("stageDir"); // Required StageKey = xmlStage.GetAttribute("stageKey"); // Required XmlNode xmlUnlocks = xmlStage.GetElementsByTagName("StageUnlocks").Item(0); if (xmlUnlocks != null) { for (var child = xmlUnlocks.FirstChild; child != null; child = child.NextSibling) { if (Unlocks == null) { Unlocks = new List <string>(); } Unlocks.Add(child.Name); } } XmlNode xmlAssets = xmlStage.GetElementsByTagName("StageAssets").Item(0); if (xmlAssets != null) { for (var child = xmlAssets.FirstChild; child != null; child = child.NextSibling) { if (Assets == null) { Assets = new List <IZAsset>(); } Assets.Add(new IZAsset(child.Attributes["basePath"].Value, child.Attributes["newPath"].Value)); } } }
// ETT fix 3 of 5. // Load part unlocks. // *** move to Unlocks class? public void LoadUnlocks(ConfigNode node) { if (node.HasNode("Unlocks")) { ConfigNode node2 = node.GetNode("Unlocks"); this.unlocks = new HENode.Unlocks(node2); } }
void Win() { ship.ShipParts.ForEach(h => h.enabled = false); ship.enabled = false; VictorySplash.SetActive(true); enabled = false; Unlocks.ClearStage(UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex - 1); GetComponent <StageAdvancer>().NextStageWithDelay(3f); }
public ActionResult <Unlocks> PutUnlocks(Unlocks unlocks) { if (_context.Unlocks.FirstOrDefault(u => u.Id == unlocks.Id) == null) { return(NotFound()); } _context.Unlocks.Update(unlocks); return(unlocks); }
void UpdateButtonStates() { bool heroIsUnlocked = SelectedHero.IsUnlocked(); bool gameModeIsUnlocked = GameEvents.IsUnlocked(GameMode); bool canDoDeeds = Unlocks.WeaponIsUnlocked(WeaponType.Rambo); ButtonPlay.interactable = heroIsUnlocked; ButtonSandbox.interactable = heroIsUnlocked; ButtonGo.interactable = heroIsUnlocked && gameModeIsUnlocked; ButtonUnlockedText.transform.parent.GetComponent <Button>().interactable = UnlockedPct > 0.0f; ButtonDeedText.transform.parent.GetComponent <Button>().interactable = canDoDeeds && heroIsUnlocked; TextDeedsLocked.SetActive(!canDoDeeds); }
private void Button1_Click(object sender, RoutedEventArgs e) { if (textBox.Text != "") { GlobalRandom.rnd = new Random(Convert.ToInt32(textBox.Text)); } if (checkBox.IsChecked == true) { Courses.Shuffle(); } if (checkBox1.IsChecked == true) { Hubs.Shuffle(checkBox7.IsChecked ?? false); } if (checkBox2.IsChecked == true) { Rewards.Shuffle(); } if (checkBox3.IsChecked == true) { NPCCoords.Shuffle(); } if (checkBox4.IsChecked == true) { Minigames.Shuffle(); } if (checkBox5.IsChecked == true) { NPCMind.Shuffle(); } if (checkBox6.IsChecked == true) { Unlocks.Shuffle(); } string[] delete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.new"); foreach (string file in delete) { File.Delete(file); } MessageBox.Show("Done!"); }
void UpdateUnlockedPct() { int unlockedCount = Unlocks.CountUnlocked(); int possibleUnlocks = Unlocks.CountPossibleUnlocks(); UnlockedPct = unlockedCount / (float)possibleUnlocks; StartCoroutine(Server.Instance.UpdateStat("PctUnlocked", Mathf.RoundToInt(UnlockedPct * 100))); int deedDoneCount = Unlocks.CountDoneDeeds(); int possibleDeedCount = Unlocks.CountPossibleDeeds(); DeedDonePct = deedDoneCount / (float)possibleDeedCount; StartCoroutine(Server.Instance.UpdateStat("DeedPct", Mathf.RoundToInt(DeedDonePct * 100))); }
private void Start() { SaveGame.Load(); Unlocks.RefreshUnlocked(); MusicManagerScript.Instance.SetVolume(SaveGame.Members.VolumeMusic); AudioManager.Instance.SetVolume(SaveGame.Members.VolumeSfx); Cursor.visible = false; Cursor.lockState = CursorLockMode.Confined; StartCoroutine(ServerColdStart()); ShowTitle(); StartCoroutine(GameStateCo()); }
// Start is called before the first frame update void Start() { Unlocks.file_path = Application.persistentDataPath + "/snailmail.save"; if (!Unlocks.initialized) { Unlocks.level_done[0] = true; for (int i = 1; i < Unlocks.num_levels; i++) { Unlocks.level_done[i] = false; } Unlocks.initialized = true; } Unlocks.LoadData(); UpdateButtons(); }
/// <summary> /// <para>Forcefully unlocks an unlock with the specified <paramref name="unlockName"/> and <paramref name="unlockType"/>.</para> /// </summary> /// <param name="unlocks">The current unlocks.</param> /// <param name="unlockName">The name of the unlock to unlock.</param> /// <param name="unlockType">The type of the unlock to unlock.</param> /// <exception cref="ArgumentNullException"><paramref name="unlocks"/> is <see langword="null"/>.</exception> public static void DoUnlockForced(this Unlocks unlocks, string unlockName, string unlockType) { if (unlocks is null) { throw new ArgumentNullException(nameof(unlocks)); } if (RogueFramework.IsDebugEnabled(DebugFlags.Unlocks)) { RogueFramework.LogDebug($"Force-unlocking \"{unlockName}\" ({unlockType})"); } bool prev = AllowUnlocksAnyway; AllowUnlocksAnyway = true; unlocks.DoUnlock(unlockName, unlockType); AllowUnlocksAnyway = prev; }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != gameObject) { Destroy(gameObject); } if (unlocksInitialized == false) { unlocks = new bool[15]; unlocksInitialized = true; unlocks[0] = true; } }
void Update() { if (Input.GetKey(Code[codeIdx])) { codeIdx++; if (codeIdx == Code.Length) { codeIdx = 0; SaveGame.ResetAll(); SaveGame.Save(); Unlocks.RefreshUnlocked(); return; } } if (Input.GetKeyDown(KeyCode.I) && GameState != State.Intro_Sandbox) { TextFps.enabled = !TextFps.enabled; } if (TextFps.enabled) { TextFps.text = string.Format("{0} fps", Mathf.RoundToInt(1.0f / Time.unscaledDeltaTime)); } if (Input.GetKeyDown(KeyCode.F) && GameState != State.Intro_Sandbox) { Screen.fullScreen = !Screen.fullScreen; } Vector3 worldPos = Input.mousePosition; worldPos.z = 0; Crosshair.position = worldPos; CrosshairWorldPosition = Camera.main.ScreenToWorldPoint(worldPos); CrosshairWorldPosition.z = 0.0f; }
public int LevelOf(Progression.Unlock unlock) => Unlocks.ContainsKey(unlock) ? Unlocks[unlock] : 0;
public static bool Unlocks_LoadUnlockData2(Unlocks __instance, bool secondTry, bool foundFile, object mySaveObject) { string saveSlotText = GameController.gameController.sessionDataBig.GetSaveSlotText(); string text = "/CloudData/" + saveSlotText + "GameUnlocks.dat"; if (secondTry) { text = "/BackupData/" + saveSlotText + "BackupGameUnlocks2.dat"; } GameController.gameController.sessionDataBig.loadedUnlockData = true; if (foundFile) { try { UnlockSaveData unlockSaveData = null; if ((GameController.gameController.consoleVersion || GameController.gameController.usingUWP || mySaveObject != null) && !GameController.gameController.fakeConsole) { unlockSaveData = (UnlockSaveData)mySaveObject; } else { string str = Application.persistentDataPath; if (GameController.gameController.usingMyDocuments && !GameController.gameController.macVersion && !GameController.gameController.linuxVersion && !GameController.gameController.usingUWP) { str = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + GameController.gameController.dataFolder; } BinaryFormatter binaryFormatter = new BinaryFormatter(); using (FileStream fileStream = File.Open(str + text, FileMode.Open)) unlockSaveData = (UnlockSaveData)binaryFormatter.Deserialize(fileStream); } __instance.tempUnlocks = unlockSaveData.unlocks; string currentVersion = unlockSaveData.currentVersion; if (currentVersion != GameController.gameController.version && (__instance.buildsToBeCleared.Contains(currentVersion) || currentVersion == null)) { __instance.tempUnlocks.Clear(); } if (currentVersion != null) { GameController.gameController.sessionDataBig.highScores = unlockSaveData.highScores; GameController.gameController.sessionDataBig.customCharacterSlots = unlockSaveData.customCharacterSlots; if (GameController.gameController.sessionDataBig.customCharacterSlots == null) { GameController.gameController.sessionDataBig.customCharacterSlots = new List <string>(); GameController.gameController.sessionDataBig.customCharacterSlotsDetails = new List <SaveCharacterData>(); for (int i = 0; i < 16; i++) { GameController.gameController.sessionDataBig.customCharacterSlots.Add(""); GameController.gameController.sessionDataBig.customCharacterSlotsDetails.Add(new SaveCharacterData()); } } else if (GameController.gameController.sessionDataBig.customCharacterSlots.Count == 8) { for (int j = 0; j < 8; j++) { GameController.gameController.sessionDataBig.customCharacterSlots.Add(""); GameController.gameController.sessionDataBig.customCharacterSlotsDetails.Add(new SaveCharacterData()); } } GameController.gameController.sessionDataBig.storedItem = unlockSaveData.storedItem; GameController.gameController.sessionDataBig.storedItem2 = unlockSaveData.storedItem2; GameController.gameController.sessionDataBig.storedItem3 = unlockSaveData.storedItem3; GameController.gameController.sessionDataBig.storedItem4 = unlockSaveData.storedItem4; GameController.gameController.sessionDataBig.storedItem5 = unlockSaveData.storedItem5; GameController.gameController.sessionDataBig.totalDeaths = unlockSaveData.totalDeaths; GameController.gameController.sessionDataBig.totalWins = unlockSaveData.totalWins; GameController.gameController.sessionDataBig.totalGamesPlayed = unlockSaveData.totalGamesPlayed; GameController.gameController.sessionDataBig.nuggets = unlockSaveData.nuggets; GameController.gameController.sessionDataBig.lastDailyRun = unlockSaveData.lastDailyRun; GameController.gameController.sessionDataBig.finishedTutorial = GameController.gameController.specialShowVersion || unlockSaveData.finishedTutorial; GameController.gameController.sessionDataBig.viewedReadThis = unlockSaveData.viewedReadThis; try { for (int k = 0; k < unlockSaveData.loadoutList.Length; k++) { GameController.gameController.sessionDataBig.loadoutList[k] = new List <Unlock>(); if (unlockSaveData.loadoutList[k] != null) { for (int l = 0; l < unlockSaveData.loadoutList[k].Count; l++) { Unlock item = unlockSaveData.loadoutList[k][l]; GameController.gameController.sessionDataBig.loadoutList[k].Add(item); } } } } catch (Exception e) { Debug.LogError("LoadoutList Load Error"); Debug.LogError(e); } if (GameController.gameController.consoleVersion) { try { for (int m = 0; m < unlockSaveData.rewardConfigConsoleList.Length; m++) { GameController.gameController.sessionDataBig.rewardConfigConsoleList[m] = new List <string>(); if (unlockSaveData.rewardConfigConsoleList[m] != null) { for (int n = 0; n < unlockSaveData.rewardConfigConsoleList[m].Count; n++) { string item2 = unlockSaveData.rewardConfigConsoleList[m][n]; GameController.gameController.sessionDataBig.rewardConfigConsoleList[m].Add(item2); } } } for (int num = 0; num < unlockSaveData.traitConfigConsoleList.Length; num++) { GameController.gameController.sessionDataBig.traitConfigConsoleList[num] = new List <string>(); if (unlockSaveData.traitConfigConsoleList[num] != null) { for (int num2 = 0; num2 < unlockSaveData.traitConfigConsoleList[num].Count; num2++) { string item3 = unlockSaveData.traitConfigConsoleList[num][num2]; GameController.gameController.sessionDataBig.traitConfigConsoleList[num].Add(item3); } } } for (int num3 = 0; num3 < unlockSaveData.mutatorConfigConsoleList.Length; num3++) { GameController.gameController.sessionDataBig.mutatorConfigConsoleList[num3] = new List <string>(); if (unlockSaveData.mutatorConfigConsoleList[num3] != null) { for (int num4 = 0; num4 < unlockSaveData.mutatorConfigConsoleList[num3].Count; num4++) { string item4 = unlockSaveData.mutatorConfigConsoleList[num3][num4]; GameController.gameController.sessionDataBig.mutatorConfigConsoleList[num3].Add(item4); } } } } catch (Exception e) { Debug.LogError("ConfigList Load Error"); Debug.LogError(e); } } } __instance.LoadInitialUnlocks(); if (currentVersion != GameController.gameController.version) { __instance.SaveUnlockData(); } return(false); } catch (Exception e) { if (!secondTry && !GameController.gameController.usingUWP && (!GameController.gameController.consoleVersion || GameController.gameController.fakeConsole)) { Debug.LogError("Failed to Load GameUnlocks, Trying Backup"); Debug.LogError(e); __instance.CopyToCorrupted(text, "GameUnlocks.dat", saveSlotText); __instance.LoadUnlockData(true); } else { Debug.LogError("Couldn't load unlock data!"); Debug.LogError(e); __instance.CopyToCorrupted(text, "BackupGameUnlocks2.dat", saveSlotText); __instance.LoadInitialUnlocks(); } return(false); } } if (!secondTry && !GameController.gameController.usingUWP && (!GameController.gameController.consoleVersion || GameController.gameController.fakeConsole)) { Debug.Log("Failed to Load GameUnlocks (File Not Found), Trying Backup"); __instance.LoadUnlockData(true); return(false); } try { UnlockSaveData unlockSaveData2 = new UnlockSaveData(); __instance.LoadInitialUnlocks(); unlockSaveData2.unlocks = GameController.gameController.sessionDataBig.unlocks; unlockSaveData2.highScores = GameController.gameController.sessionDataBig.highScores; unlockSaveData2.customCharacterSlots = GameController.gameController.sessionDataBig.customCharacterSlots; unlockSaveData2.storedItem = GameController.gameController.sessionDataBig.storedItem; unlockSaveData2.storedItem2 = GameController.gameController.sessionDataBig.storedItem2; unlockSaveData2.storedItem3 = GameController.gameController.sessionDataBig.storedItem3; unlockSaveData2.storedItem4 = GameController.gameController.sessionDataBig.storedItem4; unlockSaveData2.storedItem5 = GameController.gameController.sessionDataBig.storedItem5; unlockSaveData2.totalDeaths = GameController.gameController.sessionDataBig.totalDeaths; unlockSaveData2.totalWins = GameController.gameController.sessionDataBig.totalWins; unlockSaveData2.totalGamesPlayed = GameController.gameController.sessionDataBig.totalGamesPlayed; unlockSaveData2.nuggets = GameController.gameController.sessionDataBig.nuggets; unlockSaveData2.lastDailyRun = GameController.gameController.sessionDataBig.lastDailyRun; unlockSaveData2.finishedTutorial = GameController.gameController.sessionDataBig.finishedTutorial; unlockSaveData2.viewedReadThis = GameController.gameController.sessionDataBig.viewedReadThis; unlockSaveData2.currentVersion = GameController.gameController.version; try { unlockSaveData2.loadoutList = new List <Unlock> [30]; for (int num5 = 0; num5 < GameController.gameController.sessionDataBig.loadoutList.Length; num5++) { unlockSaveData2.loadoutList[num5] = new List <Unlock>(); if (GameController.gameController.sessionDataBig.loadoutList[num5] != null) { for (int num6 = 0; num6 < GameController.gameController.sessionDataBig.loadoutList[num5].Count; num6++) { Unlock item5 = GameController.gameController.sessionDataBig.loadoutList[num5][num6]; unlockSaveData2.loadoutList[num5].Add(item5); } } } } catch (Exception e) { Debug.LogError("LoadoutList Save Error 2"); Debug.LogError(e); } if (GameController.gameController.consoleVersion) { try { unlockSaveData2.rewardConfigConsoleList = new List <string> [10]; for (int num7 = 0; num7 < GameController.gameController.sessionDataBig.rewardConfigConsoleList.Length; num7++) { unlockSaveData2.rewardConfigConsoleList[num7] = new List <string>(); if (GameController.gameController.sessionDataBig.rewardConfigConsoleList[num7] != null) { for (int num8 = 0; num8 < GameController.gameController.sessionDataBig.rewardConfigConsoleList[num7].Count; num8++) { string item6 = GameController.gameController.sessionDataBig.rewardConfigConsoleList[num7][num8]; unlockSaveData2.rewardConfigConsoleList[num7].Add(item6); } } } unlockSaveData2.traitConfigConsoleList = new List <string> [10]; for (int num9 = 0; num9 < GameController.gameController.sessionDataBig.traitConfigConsoleList.Length; num9++) { unlockSaveData2.traitConfigConsoleList[num9] = new List <string>(); if (GameController.gameController.sessionDataBig.traitConfigConsoleList[num9] != null) { for (int num10 = 0; num10 < GameController.gameController.sessionDataBig.traitConfigConsoleList[num9].Count; num10++) { string item7 = GameController.gameController.sessionDataBig.traitConfigConsoleList[num9][num10]; unlockSaveData2.traitConfigConsoleList[num9].Add(item7); } } } unlockSaveData2.mutatorConfigConsoleList = new List <string> [10]; for (int num11 = 0; num11 < GameController.gameController.sessionDataBig.mutatorConfigConsoleList.Length; num11++) { unlockSaveData2.mutatorConfigConsoleList[num11] = new List <string>(); if (GameController.gameController.sessionDataBig.mutatorConfigConsoleList[num11] != null) { for (int num12 = 0; num12 < GameController.gameController.sessionDataBig.mutatorConfigConsoleList[num11].Count; num12++) { string item8 = GameController.gameController.sessionDataBig.mutatorConfigConsoleList[num11][num12]; unlockSaveData2.mutatorConfigConsoleList[num11].Add(item8); } } } } catch (Exception e) { Debug.LogError("ConfigList Save Error 2"); Debug.LogError(e); } } if (GameController.gameController.consoleVersion && !GameController.gameController.fakeConsole) { GameController.gameController.consoleFunctions.SaveData(unlockSaveData2, saveSlotText + "GameUnlocks"); } else if (GameController.gameController.usingUWP) { GameController.gameController.uwpFunctions.SaveData(unlockSaveData2, saveSlotText + "GameUnlocks"); } else { string str2 = Application.persistentDataPath; if (GameController.gameController.usingMyDocuments && !GameController.gameController.macVersion && !GameController.gameController.linuxVersion && !GameController.gameController.usingUWP) { str2 = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + GameController.gameController.dataFolder; } BinaryFormatter binaryFormatter2 = new BinaryFormatter(); using (FileStream fileStream2 = File.Create(str2 + "/CloudData/" + saveSlotText + "GameUnlocks.dat")) binaryFormatter2.Serialize(fileStream2, unlockSaveData2); if (GameController.gameController.usingGDK) { GameController.gameController.gdkFunctions.SaveData(unlockSaveData2, saveSlotText + "GameUnlocks", binaryFormatter2); } } __instance.LoadUnlockData(false); } catch (Exception e) { Debug.LogError("Couldn't load unlock data!"); Debug.LogError(e); __instance.LoadInitialUnlocks(); } return(false); }
public static IEnumerator SaveEnumerator(Unlocks __instance) { yield return(null); __instance.savingUnlockData = false; if (curSaving) { saveOnNext = true; yield break; } curSaving = true; try { string text = Application.persistentDataPath; if (!GameController.gameController.consoleVersion || GameController.gameController.fakeConsole) { if (GameController.gameController.usingMyDocuments && !GameController.gameController.macVersion && !GameController.gameController.linuxVersion && !GameController.gameController.usingUWP && !GameController.gameController.usingUWP) { text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + GameController.gameController.dataFolder; } Directory.CreateDirectory(text + "/CloudData/"); } SessionDataBig sdb = GameController.gameController.sessionDataBig; UnlockSaveData unlockSaveData = new UnlockSaveData { unlocks = sdb.unlocks, highScores = sdb.highScores, customCharacterSlots = sdb.customCharacterSlots, storedItem = sdb.storedItem, storedItem2 = sdb.storedItem2, storedItem3 = sdb.storedItem3, storedItem4 = sdb.storedItem4, storedItem5 = sdb.storedItem5, totalDeaths = sdb.totalDeaths, totalWins = sdb.totalWins, totalGamesPlayed = sdb.totalGamesPlayed, nuggets = sdb.nuggets + sdb.loadoutNuggetsSpent, lastDailyRun = sdb.lastDailyRun, finishedTutorial = sdb.finishedTutorial, viewedReadThis = sdb.viewedReadThis, currentVersion = GameController.gameController.version, }; try { unlockSaveData.loadoutList = new List <Unlock> [30]; for (int i = 0; i < sdb.loadoutList.Length; i++) { unlockSaveData.loadoutList[i] = new List <Unlock>(); if (sdb.loadoutList[i] != null) { for (int j = 0; j < sdb.loadoutList[i].Count; j++) { Unlock item = sdb.loadoutList[i][j]; unlockSaveData.loadoutList[i].Add(item); } } } } catch (Exception e) { Debug.LogError("LoadoutList Save Error"); Debug.LogError(e); } if (GameController.gameController.consoleVersion) { try { unlockSaveData.rewardConfigConsoleList = new List <string> [10]; unlockSaveData.traitConfigConsoleList = new List <string> [10]; unlockSaveData.mutatorConfigConsoleList = new List <string> [10]; for (int k = 0; k < sdb.rewardConfigConsoleList.Length; k++) { unlockSaveData.rewardConfigConsoleList[k] = new List <string>(); if (sdb.rewardConfigConsoleList[k] != null) { for (int l = 0; l < sdb.rewardConfigConsoleList[k].Count; l++) { string item2 = sdb.rewardConfigConsoleList[k][l]; unlockSaveData.rewardConfigConsoleList[k].Add(item2); } } } for (int m = 0; m < sdb.traitConfigConsoleList.Length; m++) { unlockSaveData.traitConfigConsoleList[m] = new List <string>(); if (sdb.traitConfigConsoleList[m] != null) { for (int n = 0; n < sdb.traitConfigConsoleList[m].Count; n++) { string item3 = sdb.traitConfigConsoleList[m][n]; unlockSaveData.traitConfigConsoleList[m].Add(item3); } } } for (int num = 0; num < sdb.mutatorConfigConsoleList.Length; num++) { unlockSaveData.mutatorConfigConsoleList[num] = new List <string>(); if (sdb.mutatorConfigConsoleList[num] != null) { for (int num2 = 0; num2 < sdb.mutatorConfigConsoleList[num].Count; num2++) { string item4 = sdb.mutatorConfigConsoleList[num][num2]; unlockSaveData.mutatorConfigConsoleList[num].Add(item4); } } } } catch { Debug.LogError("ConfigList Save Error"); } } Debug.Log("SAVE UNLOCK DATA"); string saveSlotText = sdb.GetSaveSlotText(); if (GameController.gameController.consoleVersion && !GameController.gameController.fakeConsole) { GameController.gameController.consoleFunctions.SaveData(unlockSaveData, saveSlotText + "GameUnlocks"); } else if (GameController.gameController.usingUWP) { GameController.gameController.uwpFunctions.SaveData(unlockSaveData, saveSlotText + "GameUnlocks"); } else { if (GameController.gameController.usingUWP) { BinaryFormatter binaryFormatter = new BinaryFormatter(); FileStream fileStream = File.Create(text + "/CloudData/" + saveSlotText + "GameUnlocks.dat"); binaryFormatter.Serialize(fileStream, unlockSaveData); fileStream.Close(); } else { BinaryFormatter binaryFormatter2 = new BinaryFormatter(); FileStream fileStream2 = File.Create(text + "/CloudData/Temp.dat"); if (!File.Exists(text + "/CloudData/" + saveSlotText + "GameUnlocks.dat")) { File.Create(text + "/CloudData/" + saveSlotText + "GameUnlocks.dat").Close(); } binaryFormatter2.Serialize(fileStream2, unlockSaveData); fileStream2.Close(); File.Replace(text + "/CloudData/Temp.dat", text + "/CloudData/" + saveSlotText + "GameUnlocks.dat", text + "/BackupData/" + saveSlotText + "BackupGameUnlocks.dat"); if (GameController.gameController.usingGDK) { GameController.gameController.gdkFunctions.SaveData(unlockSaveData, saveSlotText + "GameUnlocks", binaryFormatter2); } } __instance.StartCoroutine((IEnumerator)unlocksBackupMethod.Invoke(__instance, new object[] { text, saveSlotText, unlockSaveData })); GameController.gameController.steamGog.CloudSave(text + "/CloudData/" + saveSlotText + "GameUnlocks.dat"); } } catch (Exception e) { Debug.LogError("Couldn't save unlock data!"); Debug.LogError(e); } if (saveOnNext) { saveOnNext = false; __instance.StartCoroutine(__instance.SaveUnlockData2()); } curSaving = false; }
public static void Init(GraphicsDevice graphics ) { UnlockedTowers = 0; rnd = new Random(); UiManager.UiScreens.Clear(); UiSideScreen = new UiSideGameScreen(graphics); UiTopScreen = new UiTopGameScreen(graphics); WaveManager.Reset(); EnemyManager.Init(); EnemyListener.InitiliseListener(); TowerManager.Init(); TowerListener.InitiliseListener(); TroopManager.Init(); TroopListener.InitiliseListener(); QuestionPopUpManager.Init(); // CHEATY TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /*UnlockedTowers |= Unlocks.RocketTower; UnlockedTowers |= Unlocks.SamTower; UnlockedTowers |= Unlocks.TeslaTower; UnlockedTowers |= Unlocks.Upgrade; ModifyResources(100000); for (int i = 0; i < 100; i++) TroopManager.SpawnTroop();*/ }
public void ButtonResetData() { Unlocks.ResetData(); GameObject.Find("Canvas").GetComponent <Unlocker>().UpdateButtons(); }
public bool DoesUnlock(Achievement achievement) { return(Unlocks != null && Unlocks.Any(i => i == achievement.Identifier)); }
public void OnOrcPickup(Vector3 pos) { SaveGame.RoundScore++; GameEvents.CounterEvent(GameCounter.Score_Any_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Any, SaveGame.RoundScore); if (GameMode == GameModeEnum.Nursery) { GameEvents.CounterEvent(GameCounter.Score_Nursery_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Nursery, SaveGame.RoundScore); } else if (GameMode == GameModeEnum.Earth) { GameEvents.CounterEvent(GameCounter.Score_Earth_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Earth, SaveGame.RoundScore); } else if (GameMode == GameModeEnum.Wind) { GameEvents.CounterEvent(GameCounter.Score_Wind_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Wind, SaveGame.RoundScore); } else if (GameMode == GameModeEnum.Fire) { GameEvents.CounterEvent(GameCounter.Score_Fire_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Fire, SaveGame.RoundScore); } else if (GameMode == GameModeEnum.Storm) { GameEvents.CounterEvent(GameCounter.Score_Storm_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_Score_Storm, SaveGame.RoundScore); } else if (GameMode == GameModeEnum.Harmony) { GameEvents.CounterEvent(GameCounter.score_Harmony_Sum, 1); GameEvents.CounterEvent(GameCounter.Max_score_Harmony, SaveGame.RoundScore); } AudioManager.Instance.PlayClipWithRandomPitch(AudioManager.Instance.MiscAudioSource, AudioManager.Instance.AudioData.OrcPickup); Vector2 uiPos = UiPositionFromWorld(PlayerTrans.position + Vector3.up * 0.5f); var rectTransform = TextFloatingWeapon.GetComponent <RectTransform>(); rectTransform.anchoredPosition = uiPos; TextScore.text = SaveGame.RoundScore.ToString(); if (CurrentDeedData.Deed != DeedEnum.Sandbox) { Unlocks.SetRandomWeapon(); TextFloatingWeapon.SetText(WeaponBase.WeaponDisplayName(PlayerScript.Weapon.Type), 2.0f); } if (CurrentDeedData.ShowOrcs) { Vector3 bestPos = Vector3.zero; float bestDistance = 0.0f; for (int i = 0; i < 5; ++i) { Vector3 newPos = PositionUtility.GetPointInsideArena(1.0f, 0.9f); float distance = Vector3.Distance(newPos, pos); if (distance > bestDistance) { bestDistance = distance; bestPos = newPos; } // TODO PE: Does not seem to work? I've seen it behind the score. // Let's try not placing the orc around the UI bool nearUi = newPos.y > 4.5f && (newPos.x > -3.5f && newPos.x < 3.5f); if (nearUi) { continue; } if (distance > 5.0f) { break; } } Orc.SetPosition(bestPos); MakeFlash(bestPos, 2.0f); } else { // Hide the orc Orc.SetPosition(Vector3.left * 10000); } }
// We are hooking this because loads of stuff in Initialize is either private or internal so I'm adding stuff to the calls it does public static void UpdateModifierStatus() { // Extra stuff here - Very dangerous + slow. Need better method StackFrame frame = new StackFrame(1); var method = frame.GetMethod(); var type = method.DeclaringType; var name = method.Name; if (name == "Initialize" && type == typeof(TeamSelect2)) { List <DuckPersona> _personas = typeof(Persona).GetField("_personas", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public).GetValue(null) as List <DuckPersona>; FieldInfo _profilesField = typeof(TeamSelect2).GetField("_profiles", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); dynamic _profiles = _profilesField.GetValue(Level.current as TeamSelect2); Profile defaultProfile5 = Profiles.all.FirstOrDefault(x => { if (x.team != null) { return(x.persona == _personas[4]); } return(false); }) ?? Profiles.core.all.ElementAt(4); Profile defaultProfile6 = Profiles.all.FirstOrDefault(x => { if (x.team != null) { return(x.persona == _personas[5]); } return(false); }) ?? Profiles.core.all.ElementAt(5); Profile defaultProfile7 = Profiles.all.FirstOrDefault(x => { if (x.team != null) { return(x.persona == _personas[6]); } return(false); }) ?? Profiles.core.all.ElementAt(6); Profile defaultProfile8 = Profiles.all.FirstOrDefault(x => { if (x.team != null) { return(x.persona == _personas[7]); } return(false); }) ?? Profiles.core.all.ElementAt(7); float xpos = 1f; ProfileBox2 profileBox2_5 = new ProfileBox2(xpos, 180f, InputProfile.Get("MPPlayer5"), defaultProfile5, (TeamSelect2)Level.current, 4); _profiles.Add(profileBox2_5); Level.Add(profileBox2_5); ProfileBox2 profileBox2_6 = new ProfileBox2(xpos + 178f, 180f, InputProfile.Get("MPPlayer6"), defaultProfile6, (TeamSelect2)Level.current, 5); _profiles.Add(profileBox2_6); Level.Add(profileBox2_6); ProfileBox2 profileBox2_7 = new ProfileBox2(xpos, 270f, InputProfile.Get("MPPlayer7"), defaultProfile7, (TeamSelect2)Level.current, 6); _profiles.Add(profileBox2_7); Level.Add(profileBox2_7); ProfileBox2 profileBox2_8 = new ProfileBox2(xpos + 178f, 270f, InputProfile.Get("MPPlayer8"), defaultProfile8, (TeamSelect2)Level.current, 7); _profiles.Add(profileBox2_8); Level.Add(profileBox2_8); // Expand the view and tweak boxes Level.current.camera = new Camera(0f, 0f, -1f, (Graphics.height / 2f)); Layer.HUD.camera = new Camera(0f, 0f, -1f, (Graphics.height / 2f)); if (Network.isActive) { (Level.current as TeamSelect2).PrepareForOnline(); } } // Normal stuff here Type typea = typeof(TeamSelect2); FieldInfo info2 = typea.GetField("_modifierStatus", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); Dictionary <string, bool> _modifierStatus = info2.GetValue(Level.current) as Dictionary <string, bool>; bool flag = false; foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Modifier)) { _modifierStatus[unlock.id] = false; if (unlock.enabled) { flag = true; _modifierStatus[unlock.id] = true; } } if (!Network.isActive || !Network.isServer || Steam.lobby == null) { return; } Steam.lobby.SetLobbyData("modifiers", flag ? "true" : "false"); }
private void Awake() { instance = this; }
static bool Prefix(TeamSelect2 __instance) { // TO IMPLEMENT //++Global.data.bootedSinceUpdate; //Global.Save(); // TO IMPLEMENT List <DuckPersona> personas = Persona.all as List <DuckPersona>; // Get the private fields by reflection Type teamselect2type = typeof(TeamSelect2); dynamic littleFont = teamselect2type.GetField("_littleFont", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic countdownScreen = teamselect2type.GetField("_countdownScreen", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic countdown = teamselect2type.GetField("_countdown", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic profiles = teamselect2type.GetField("_profiles", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic font = teamselect2type.GetField("_font", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic buttons = teamselect2type.GetField("_buttons", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic beam = teamselect2type.GetField("_beam", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic configGroup = teamselect2type.GetField("_configGroup", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic multiplayerMenu = teamselect2type.GetField("_multiplayerMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic modifierMenu = teamselect2type.GetField("_modifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic levelSelectMenu = teamselect2type.GetField("_levelSelectMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic playOnlineGroup = teamselect2type.GetField("_playOnlineGroup", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic playOnlineMenu = teamselect2type.GetField("_playOnlineMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic hostGameMenu = teamselect2type.GetField("_hostGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic browseGamesMenu = teamselect2type.GetField("_browseGamesMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic miniHostGameMenu = teamselect2type.GetField("_miniHostGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic joinGameMenu = teamselect2type.GetField("_joinGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic filtersMenu = teamselect2type.GetField("_filtersMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic filterModifierMenu = teamselect2type.GetField("_filterModifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic matchmaker = teamselect2type.GetField("_matchmaker", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic hostGameSettingsMenu = teamselect2type.GetField("_hostGameSettingsMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic hostGameModifierMenu = teamselect2type.GetField("_hostGameModifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic createGame = teamselect2type.GetField("_createGame", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); dynamic hostGame = teamselect2type.GetField("_hostGame", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); // End of getting fields TeamSelect2.customLevels = TeamSelect2.prevCustomLevels = 0; if (!Network.isActive) { Level.core.gameInProgress = false; } if (!Level.core.gameInProgress) { Main.ResetMatchStuff(); Main.ResetGameStuff(); DuckNetwork.ClosePauseMenu(); } else { ConnectionStatusUI.Hide(); if (Network.isServer) { if (Steam.lobby != null) { Steam.lobby.SetLobbyData("started", "false"); Steam.lobby.joinable = true; } DuckNetwork.inGame = false; foreach (Profile profile in DuckNetwork.profiles) { if (profile.connection == null && profile.slotType != SlotType.Reserved) { profile.slotType = SlotType.Closed; } } } } if (Network.isActive && Network.isServer) { DuckNetwork.ChangeSlotSettings(); } littleFont = new BitmapFont("smallBiosFontUI", 7, 5); countdownScreen = new Sprite("title/wideScreen", 0.0f, 0.0f); __instance.backgroundColor = Color.Black; DuckNetwork.levelIndex = (byte)0; if (Network.isActive && Network.isServer) { GhostManager.context.SetGhostIndex((NetIndex16)32); } countdown = new SpriteMap("countdown", 32, 32, false); countdown.center = new Vec2(16f, 16f); Profile defaultProfile1 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == Persona.Duck1); } return(false); })) ?? Profiles.DefaultPlayer1; Profile defaultProfile2 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == Persona.Duck2); } return(false); })) ?? Profiles.DefaultPlayer2; Profile defaultProfile3 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == Persona.Duck3); } return(false); })) ?? Profiles.DefaultPlayer3; Profile defaultProfile4 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == Persona.Duck4); } return(false); })) ?? Profiles.DefaultPlayer4; Profile defaultProfile5 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == personas[4]); } return(false); })) ?? Profiles.core.all.ElementAt(4); Profile defaultProfile6 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == personas[5]); } return(false); })) ?? Profiles.core.all.ElementAt(5); Profile defaultProfile7 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == personas[6]); } return(false); })) ?? Profiles.core.all.ElementAt(6); Profile defaultProfile8 = Profiles.all.FirstOrDefault <Profile>((Func <Profile, bool>)(x => { if (x.team != null) { return(x.persona == personas[7]); } return(false); })) ?? Profiles.core.all.ElementAt(7); float xpos = 1f; ProfileBox2 profileBox2_1 = new ProfileBox2(xpos, 1f, InputProfile.Get("MPPlayer1"), defaultProfile1, __instance, 0); profiles.Add(profileBox2_1); Level.Add((Thing)profileBox2_1); ProfileBox2 profileBox2_2 = new ProfileBox2(xpos + 119f, 1f, InputProfile.Get("MPPlayer2"), defaultProfile2, __instance, 1); profiles.Add(profileBox2_2); Level.Add((Thing)profileBox2_2); ProfileBox2 profileBox2_3 = new ProfileBox2(xpos + 238f, 1f, InputProfile.Get("MPPlayer3"), defaultProfile3, __instance, 2); profiles.Add(profileBox2_3); Level.Add((Thing)profileBox2_3); ProfileBox2 profileBox2_4 = new ProfileBox2(xpos, 62f, InputProfile.Get("MPPlayer4"), defaultProfile4, __instance, 3); profiles.Add(profileBox2_4); Level.Add((Thing)profileBox2_4); ProfileBox2 profileBox2_5 = new ProfileBox2(xpos + 238f, 62f, InputProfile.Get("MPPlayer5"), defaultProfile5, __instance, 4); profiles.Add(profileBox2_5); Level.Add((Thing)profileBox2_5); ProfileBox2 profileBox2_6 = new ProfileBox2(xpos, 121f, InputProfile.Get("MPPlayer6"), defaultProfile6, __instance, 5); profiles.Add(profileBox2_6); Level.Add((Thing)profileBox2_6); ProfileBox2 profileBox2_7 = new ProfileBox2(xpos + 119f, 121f, InputProfile.Get("MPPlayer7"), defaultProfile7, __instance, 6); profiles.Add(profileBox2_7); Level.Add((Thing)profileBox2_7); ProfileBox2 profileBox2_8 = new ProfileBox2(xpos + 238f, 121f, InputProfile.Get("MPPlayer8"), defaultProfile8, __instance, 7); profiles.Add(profileBox2_8); Level.Add((Thing)profileBox2_8); Saxaphone spicySax = new Saxaphone(160f, 100f); spicySax.infinite = true; Level.Add(spicySax); if (Network.isActive) { __instance.PrepareForOnline(); } else { __instance.BuildPauseMenu(false); } font = new BitmapFont("biosFont", 8, -1); font.scale = new Vec2(1f, 1f); buttons = new SpriteMap("buttons", 14, 14, false); buttons.CenterOrigin(); buttons.depth = (Depth)0.9f; Music.Play("CharacterSelect", true, 0.0f); beam = new TeamBeam(101f, 0.0f); Level.Add((Thing)beam); beam = new TeamBeam(219f, 0.0f); Level.Add((Thing)beam); TeamSelect2.UpdateModifierStatus(); configGroup = new UIComponent(Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 0.0f, 0.0f); multiplayerMenu = new UIMenu("@LWING@MATCH SETTINGS@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); modifierMenu = new UIMenu("MODIFIERS", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 240f, -1f, "@DPAD@ADJUST @QUACK@BACK", (InputProfile)null, false); levelSelectMenu = (UIMenu) new LevelSelectCompanionMenu(Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, multiplayerMenu); foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Modifier)) { if (unlock.unlocked) { modifierMenu.Add((UIComponent) new UIMenuItemToggle(unlock.shortName, (UIMenuAction)null, new FieldBinding((object)unlock, "enabled", 0.0f, 1f, 0.1f), new Color(), (FieldBinding)null, (List <string>)null, false, false), true); } else { modifierMenu.Add((UIComponent) new UIMenuItem("@TINYLOCK@LOCKED", (UIMenuAction)null, UIAlign.Center, Color.Red, false), true); } } modifierMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); modifierMenu.Add((UIComponent) new UIMenuItem("OK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)modifierMenu, (UIComponent)multiplayerMenu), UIAlign.Center, new Color(), true), true); modifierMenu.Close(); foreach (MatchSetting matchSetting in TeamSelect2.matchSettings) { if (!(matchSetting.id == "workshopmaps") || Network.available) { multiplayerMenu.AddMatchSetting(matchSetting, false, true); } } multiplayerMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); multiplayerMenu.Add((UIComponent) new UIModifierMenuItem((UIMenuAction) new UIMenuActionOpenMenu((UIComponent)multiplayerMenu, (UIComponent)modifierMenu), UIAlign.Center, new Color(), false), true); multiplayerMenu.Add((UIComponent) new UICustomLevelMenu((UIMenuAction) new UIMenuActionOpenMenu((UIComponent)multiplayerMenu, (UIComponent)levelSelectMenu), UIAlign.Center, new Color(), false), true); multiplayerMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); multiplayerMenu.Add((UIComponent) new UIMenuItem("OK", (UIMenuAction) new UIMenuActionCloseMenu(configGroup), UIAlign.Center, new Color(), true), true); multiplayerMenu.Close(); configGroup.Add((UIComponent)multiplayerMenu, false); configGroup.Add((UIComponent)modifierMenu, false); configGroup.Add((UIComponent)levelSelectMenu, false); configGroup.Close(); Level.Add((Thing)configGroup); playOnlineGroup = new UIComponent(Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 0.0f, 0.0f); playOnlineMenu = new UIMenu("@PLANET@PLAY ONLINE@PLANET@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); hostGameMenu = new UIMenu("@LWING@CREATE GAME@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); browseGamesMenu = (UIMenu) new UIServerBrowser(playOnlineMenu, "SERVER BROWSER", Layer.HUD.camera.width, Layer.HUD.camera.height, 550f, -1f, "@DPAD@@SELECT@JOIN @SHOOT@REFRESH @QUACK@BACK", (InputProfile)null); miniHostGameMenu = new UIMenu("@LWING@HOST GAME@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); joinGameMenu = new UIMenu("@LWING@FIND GAME@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); filtersMenu = new UIMenu("@LWING@FILTERS@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@SELECT@SELECT @GRAB@TYPE", (InputProfile)null, false); filterModifierMenu = new UIMenu("@LWING@FILTER MODIFIERS@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 240f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); matchmaker = new UIMatchmakingBox(joinGameMenu, Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f); hostGameSettingsMenu = new UIMenu("@LWING@SETTINGS@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); hostGameModifierMenu = new UIMenu("@LWING@MODIFIERS@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 240f, -1f, "@DPAD@ADJUST @SELECT@SELECT", (InputProfile)null, false); if ((string)typeof(ModLoader).GetProperty("modHash", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null) != "nomods") { playOnlineMenu.Add((UIComponent) new UIMenuItem("FIND GAME", (UIMenuAction) new UIMenuActionCloseMenuCallFunction((UIComponent)playOnlineMenu, new UIMenuActionCloseMenuCallFunction.Function(__instance.OpenNoModsFindGame)), UIAlign.Center, new Color(), false), true); playOnlineMenu.Add((UIComponent) new UIMenuItem("CREATE GAME", (UIMenuAction) new UIMenuActionCloseMenuCallFunction((UIComponent)playOnlineMenu, new UIMenuActionCloseMenuCallFunction.Function(__instance.OpenNoModsCreateGame)), UIAlign.Center, new Color(), false), true); } else { playOnlineMenu.Add((UIComponent) new UIMenuItem("FIND GAME", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)playOnlineMenu, (UIComponent)joinGameMenu), UIAlign.Center, new Color(), false), true); playOnlineMenu.Add((UIComponent) new UIMenuItem("CREATE GAME", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)playOnlineMenu, (UIComponent)hostGameMenu), UIAlign.Center, new Color(), false), true); } playOnlineMenu.Add((UIComponent) new UIMenuItem("BROWSE GAMES", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)playOnlineMenu, (UIComponent)browseGamesMenu), UIAlign.Center, new Color(), false), true); playOnlineMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); playOnlineMenu.Add((UIComponent) new UIMenuItem("CANCEL", (UIMenuAction) new UIMenuActionCloseMenuCallFunction(playOnlineGroup, new UIMenuActionCloseMenuCallFunction.Function(__instance.ClosedOnline)), UIAlign.Center, new Color(), true), true); playOnlineMenu.Close(); playOnlineGroup.Add((UIComponent)playOnlineMenu, false); foreach (MatchSetting onlineSetting in TeamSelect2.onlineSettings) { if (!onlineSetting.filterOnly) { hostGameMenu.AddMatchSetting(onlineSetting, false, true); } } hostGameMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); hostGameMenu.Add((UIComponent) new UIMenuItem("CREATE GAME", (UIMenuAction) new UIMenuActionCloseMenuSetBoolean(playOnlineGroup, createGame), UIAlign.Center, new Color(), false), true); hostGameMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)hostGameMenu, (UIComponent)playOnlineMenu), UIAlign.Center, new Color(), true), true); hostGameMenu.Close(); browseGamesMenu.Close(); playOnlineGroup.Add((UIComponent)browseGamesMenu, false); playOnlineGroup.Add((UIComponent)hostGameMenu, false); miniHostGameMenu.AddMatchSetting(TeamSelect2.GetOnlineSetting("type"), false, true); miniHostGameMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); miniHostGameMenu.Add((UIComponent) new UIMenuItem("HOST GAME", (UIMenuAction) new UIMenuActionCloseMenuSetBoolean((UIComponent)miniHostGameMenu, hostGame), UIAlign.Center, new Color(), false), true); miniHostGameMenu.Add((UIComponent) new UIMenuItem("CANCEL", (UIMenuAction) new UIMenuActionCloseMenu((UIComponent)miniHostGameMenu), UIAlign.Center, new Color(), true), true); miniHostGameMenu.Close(); Level.Add((Thing)miniHostGameMenu); foreach (MatchSetting onlineSetting in TeamSelect2.onlineSettings) { if (!onlineSetting.createOnly) { joinGameMenu.AddMatchSetting(onlineSetting, true, true); } } joinGameMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); joinGameMenu.Add((UIComponent) new UIMenuItem("FIND GAME", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)joinGameMenu, (UIComponent)matchmaker), UIAlign.Center, new Color(), false), true); joinGameMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)joinGameMenu, (UIComponent)playOnlineMenu), UIAlign.Center, new Color(), true), true); joinGameMenu.Close(); playOnlineGroup.Add((UIComponent)joinGameMenu, false); foreach (MatchSetting matchSetting in TeamSelect2.matchSettings) { if (!(matchSetting.id == "workshopmaps") || Network.available) { filtersMenu.AddMatchSetting(matchSetting, true, true); } } filtersMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); filtersMenu.Add((UIComponent) new UIModifierMenuItem((UIMenuAction) new UIMenuActionOpenMenu((UIComponent)filtersMenu, (UIComponent)filterModifierMenu), UIAlign.Center, new Color(), false), true); filtersMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); filtersMenu.Add((UIComponent) new UIMenuItem("|DGBLUE|CLEAR FILTERS", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(__instance.ClearFilters)), UIAlign.Center, new Color(), false), true); filtersMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)filtersMenu, (UIComponent)joinGameMenu), UIAlign.Center, new Color(), true), true); filtersMenu.Close(); playOnlineGroup.Add((UIComponent)filtersMenu, false); foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Modifier)) { filterModifierMenu.Add((UIComponent) new UIMenuItemToggle(unlock.shortName, (UIMenuAction)null, new FieldBinding((object)unlock, "enabled", 0.0f, 1f, 0.1f), new Color(), new FieldBinding((object)unlock, "filtered", 0.0f, 1f, 0.1f), (List <string>)null, false, false), true); } filterModifierMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); filterModifierMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)filterModifierMenu, (UIComponent)filtersMenu), UIAlign.Center, new Color(), true), true); filterModifierMenu.Close(); playOnlineGroup.Add((UIComponent)filterModifierMenu, false); foreach (MatchSetting matchSetting in TeamSelect2.matchSettings) { if (!(matchSetting.id == "workshopmaps") || Network.available) { hostGameSettingsMenu.AddMatchSetting(matchSetting, false, true); } } hostGameSettingsMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); hostGameSettingsMenu.Add((UIComponent) new UIModifierMenuItem((UIMenuAction) new UIMenuActionOpenMenu((UIComponent)hostGameSettingsMenu, (UIComponent)hostGameModifierMenu), UIAlign.Center, new Color(), false), true); hostGameSettingsMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); hostGameSettingsMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)hostGameSettingsMenu, (UIComponent)hostGameMenu), UIAlign.Center, new Color(), true), true); hostGameSettingsMenu.Close(); playOnlineGroup.Add((UIComponent)hostGameSettingsMenu, false); foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Modifier)) { hostGameModifierMenu.Add((UIComponent) new UIMenuItemToggle(unlock.shortName, (UIMenuAction)null, new FieldBinding((object)unlock, "enabled", 0.0f, 1f, 0.1f), new Color(), (FieldBinding)null, (List <string>)null, false, false), true); } hostGameModifierMenu.Add((UIComponent) new UIText(" ", Color.White, UIAlign.Center, 0.0f, (InputProfile)null), true); hostGameModifierMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)hostGameModifierMenu, (UIComponent)hostGameSettingsMenu), UIAlign.Center, new Color(), true), true); hostGameModifierMenu.Close(); playOnlineGroup.Add((UIComponent)hostGameModifierMenu, false); matchmaker.Close(); playOnlineGroup.Add((UIComponent)matchmaker, false); playOnlineGroup.Close(); Level.Add((Thing)playOnlineGroup); Graphics.fade = 0.0f; Layer l = new Layer("HUD2", -85, new Camera(), false, new Vec2()); l.camera.width /= 2f; l.camera.height /= 2f; Layer.Add(l); Layer hud = Layer.HUD; Layer.HUD = l; Editor.gamepadMode = true; Layer.HUD = hud; // Start of setting private fields teamselect2type.GetField("_littleFont", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, littleFont); teamselect2type.GetField("_countdownScreen", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, countdownScreen); teamselect2type.GetField("_countdown", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, countdown); teamselect2type.GetField("_profiles", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, profiles); teamselect2type.GetField("_font", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, font); teamselect2type.GetField("_buttons", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, buttons); teamselect2type.GetField("_beam", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, beam); teamselect2type.GetField("_configGroup", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, configGroup); teamselect2type.GetField("_multiplayerMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, multiplayerMenu); teamselect2type.GetField("_modifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, modifierMenu); teamselect2type.GetField("_levelSelectMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, levelSelectMenu); teamselect2type.GetField("_playOnlineGroup", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, playOnlineGroup); teamselect2type.GetField("_playOnlineMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, playOnlineMenu); teamselect2type.GetField("_hostGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, hostGameMenu); teamselect2type.GetField("_browseGamesMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, browseGamesMenu); teamselect2type.GetField("_miniHostGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, miniHostGameMenu); teamselect2type.GetField("_joinGameMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, joinGameMenu); teamselect2type.GetField("_filtersMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, filtersMenu); teamselect2type.GetField("_filterModifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, filterModifierMenu); teamselect2type.GetField("_matchmaker", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, matchmaker); teamselect2type.GetField("_hostGameSettingsMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, hostGameSettingsMenu); teamselect2type.GetField("_hostGameModifierMenu", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, hostGameModifierMenu); teamselect2type.GetField("_createGame", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, createGame); teamselect2type.GetField("_hostGame", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, hostGame); // End of setting private fields if (DuckNetwork.ShowUserXPGain() || !Unlockables.HasPendingUnlocks()) { return(false); } MonoMain.pauseMenu = (UIComponent) new UIUnlockBox(Unlockables.GetPendingUnlocks().ToList <Unlockable>(), Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 190f, -1f); return(false); }
public static bool Unlocks_SaveUnlockData2(Unlocks __instance, ref IEnumerator __result) { __result = SaveEnumerator(__instance); return(false); }