// GET: Trophies/Delete/5 public ActionResult Delete(int?id, bool?saveChangesError = false) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Trophies trophies = db.Trophies.Find(id); if (trophies == null) { return(HttpNotFound()); } if (saveChangesError.GetValueOrDefault()) { ViewBag.ErrorMessage = "Delete failed. Try again, if the problem persists please contact the system administrator."; } return(View(trophies)); }
private void OnTrophyGotTrophyInfo(Messages.PluginMessage msg) { OnScreenLog.Add("Got Trophy List!"); Trophies.TrophyDetails[] cachedTrophyDetails = Trophies.GetCachedTrophyDetails(); Trophies.TrophyData[] cachedTrophyData = Trophies.GetCachedTrophyData(); OnScreenLog.Add("Trophies: " + cachedTrophyDetails.Length); for (int i = 0; i < cachedTrophyDetails.Length; i++) { if (cachedTrophyData[i].get_hasIcon() && this.trophyIcon == null) { this.trophyIcon = cachedTrophyData[i].get_icon(); OnScreenLog.Add(string.Concat(new object[] { "Found icon: ", this.trophyIcon.get_width(), ", ", this.trophyIcon.get_height() })); } OnScreenLog.Add(string.Concat(new object[] { " ", i, ": ", cachedTrophyDetails[i].get_name(), ", ", cachedTrophyDetails[i].trophyId, ", ", cachedTrophyDetails[i].trophyGrade, ", ", cachedTrophyDetails[i].groupId, ", ", cachedTrophyDetails[i].hidden, ", ", cachedTrophyData[i].unlocked, ", ", cachedTrophyData[i].timestamp, ", ", cachedTrophyData[i].userId.ToString("X") })); } }
public void MenuTrophies(MenuStack menuStack) { menuTrophies.Update(); bool trophiesAreAvailable = Trophies.TrophiesAreAvailable; if (menuTrophies.AddItem("Game Info", trophiesAreAvailable)) { DumpGameInfo(); } if (menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy())) { ErrorHandler(Trophies.RequestGroupInfo()); } if (menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy())) { ErrorHandler(Trophies.RequestTrophyInfo()); } if (menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy())) { ErrorHandler(Trophies.RequestTrophyProgress()); } if (menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && ErrorHandler(Trophies.AwardTrophy(nextTrophyIndex)) == ErrorCode.NP_OK) { nextTrophyIndex++; if (nextTrophyIndex == gameInfo.numTrophies) { nextTrophyIndex = 1; } } if (menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable)) { for (int i = 1; i < gameInfo.numTrophies; i++) { ErrorHandler(Trophies.AwardTrophy(i)); } } if (menuTrophies.AddBackIndex("Back")) { menuStack.PopMenu(); } }
public void MenuTrophies(MenuStack menuStack) { this.menuTrophies.Update(); bool trophiesAreAvailable = Trophies.get_TrophiesAreAvailable(); if (this.menuTrophies.AddItem("Game Info", trophiesAreAvailable)) { this.DumpGameInfo(); } if (this.menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy())) { this.ErrorHandler(Trophies.RequestGroupInfo()); } if (this.menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy())) { this.ErrorHandler(Trophies.RequestTrophyInfo()); } if (this.menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy())) { this.ErrorHandler(Trophies.RequestTrophyProgress()); } if (this.menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && this.ErrorHandler(Trophies.AwardTrophy(this.nextTrophyIndex)) == null) { this.nextTrophyIndex++; if (this.nextTrophyIndex == this.gameInfo.numTrophies) { this.nextTrophyIndex = 1; } } if (this.menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable)) { for (int i = 1; i < this.gameInfo.numTrophies; i++) { this.ErrorHandler(Trophies.AwardTrophy(i)); } } if (this.menuTrophies.AddBackIndex("Back", true)) { menuStack.PopMenu(); } }
public void Unlock() { if (GameJoltAPI.Instance.CurrentUser == null) { return; } if (trophyID > 0 && !trophyUnlocked.RuntimeValue) { Trophies.Unlock(trophyID, (bool success) => { trophyUnlocked.RuntimeValue = success; if (success) { Debug.Log("Success!"); } else { Debug.Log("Something went wrong"); } }); } }
/// <summary> /// Returns true if LegendLeagueTournamentSeasonResult instances are equal /// </summary> /// <param name="input">Instance of LegendLeagueTournamentSeasonResult to be compared</param> /// <returns>Boolean</returns> public bool Equals(LegendLeagueTournamentSeasonResult?input) { if (input == null) { return(false); } return (( Trophies == input.Trophies || Trophies.Equals(input.Trophies) ) && ( Id == input.Id || (Id != null && Id.Equals(input.Id)) ) && ( Rank == input.Rank || Rank.Equals(input.Rank) )); }
private ErrorCode ErrorHandler(ErrorCode errorCode = 3) { if (errorCode != null) { ResultCode resultCode = default(ResultCode); Trophies.GetLastError(ref resultCode); if (resultCode.lastError != null) { OnScreenLog.Add(string.Concat(new object[] { "Error: ", resultCode.get_className(), ": ", resultCode.lastError, ", sce error 0x", resultCode.lastErrorSCE.ToString("X8") })); return(resultCode.lastError); } } return(errorCode); }
//the html that displays the clan card used in the pop down menu's and header of searched clan public override string ToString() { string returnString = "<div class=\"card card-group\"> <div class=\"container-fluid d-inline-flex\"> <div class=\"col-2\"> <p><b>Name:</b>" + Name + "</p> <p><b>Tag:</b>" + Tag + "</p> <p><b>Level:</b>" + ExpLevel.ToString() + "</p>"; if (ExpLevel == 13) { returnString += "<p><b>Star Points:</b>" + StarPoints.ToString() + "</p>"; } returnString += "<p><b>Current Tropies:</b>" + Trophies.ToString() + "</p><p><b>Highest Trophies:</b>" + BestTrophies + "</p></div>"; returnString += "<div class=\"col-2\"><p><b>All Time Wins:</b>" + Wins.ToString() + "</p><p><b>All Time Losses:</b>" + Losses.ToString() + "</p>"; Console.WriteLine(); returnString += "<p><b>Current Favorite Card:</b>" + CurrentFavouriteCard.Name + "</p><img class=\"text-center\" src=\"" + CurrentFavouriteCard.Url + "\" width=\"64px\" />"; returnString += "<p><b>Cards Discovered:</b>" + CardsDiscovered.ToString() + "/" + CardsInGame.ToString() + "</p></div>"; returnString += "<div class=\"col-3\">"; if (Clan != null) { returnString += "<p><b>Clan Name:</b>" + Clan.Name + "</p>"; } if (Clan != null) { returnString += "<p><b>Clan Tag:</b>" + ClanTag + "</p>"; } else { returnString += "<h2 class=\"text-center m-2\">Not In a Clan</h2>"; } returnString += "<p><b>Recent Donations:</b>" + Donations.ToString() + "</p><p><b>Recent Donations Recieved:</b>" + DonationsReceived.ToString() + "</p>"; returnString += "<p><b>Total Donations:</b>" + TotalDonations.ToString() + "</p><p><b>Total Donations Recieved:</b>" + ClanCardsCollected.ToString() + "</p></div>"; returnString += "<div class=\"col-5 m-0\"><div class=\"text-center\"><p><b>Current Deck</b></p> " + Deck.ToString() + "<p>Profile Updated:" + UpdateTime + "</p></div></div></div></div>"; return(returnString); }
// Show this window, and hides any narrator stuff and Issue the trophy. public void Show(Trophies currentTrophy, string captionText, string bodyText) { _mouseStateOnReturn = _game.IsMouseVisible; _game.IsMouseVisible = true; PersistentStorage.Trophies[(int)currentTrophy]++; _currentTrophy = currentTrophy; _buttonMemory = Narrator.Instance.GetAllLabels(); Visible = true; _captionText = captionText; _bodyText = bodyText; Narrator.Instance.RemoveAllButtons(); Narrator.Instance.Hide(); _isReturnConfirmState = false; }
private void OnTrophyGotGameInfo(Messages.PluginMessage msg) { gameInfo = Trophies.GetCachedGameInfo(); DumpGameInfo(); }
public bool HasTrophy(PerformanceTrophies trophy) { return(Trophies.Contains(trophy)); }
public static void UnlockTrophy(Trophy trophyToUnlock) { Trophies.TryUnlock((int)trophyToUnlock); }
private void OnTrophyGotGroupInfo(Messages.PluginMessage msg) { OnScreenLog.Add("Got Group List!"); Trophies.GroupDetails[] cachedGroupDetails = Trophies.GetCachedGroupDetails(); Trophies.GroupData[] cachedGroupData = Trophies.GetCachedGroupData(); OnScreenLog.Add("Groups: " + cachedGroupDetails.Length); for (int i = 0; i < cachedGroupDetails.Length; i++) { if (cachedGroupDetails[i].get_hasIcon() && this.trophyGroupIcon == null) { this.trophyGroupIcon = cachedGroupDetails[i].get_icon(); OnScreenLog.Add(string.Concat(new object[] { "Found icon: ", this.trophyGroupIcon.get_width(), ", ", this.trophyGroupIcon.get_height() })); } OnScreenLog.Add(string.Concat(new object[] { " ", i, ": ", cachedGroupDetails[i].groupId, ", ", cachedGroupDetails[i].get_title(), ", ", cachedGroupDetails[i].get_description(), ", ", cachedGroupDetails[i].numTrophies, ", ", cachedGroupDetails[i].numPlatinum, ", ", cachedGroupDetails[i].numGold, ", ", cachedGroupDetails[i].numSilver, ", ", cachedGroupDetails[i].numBronze })); OnScreenLog.Add(string.Concat(new object[] { " ", i, ": ", cachedGroupData[i].groupId, ", ", cachedGroupData[i].unlockedTrophies, ", ", cachedGroupData[i].unlockedPlatinum, ", ", cachedGroupData[i].unlockedGold, ", ", cachedGroupData[i].unlockedSilver, ", ", cachedGroupData[i].unlockedBronze, ", ", cachedGroupData[i].progressPercentage, cachedGroupData[i].userId.ToString("X") })); } }
public static void TrophiesRegister() { Trophies.RegisterTrophyPackRequest request = new Trophies.RegisterTrophyPackRequest(); request.UserId = loggedInUser.userId; Trophies.RegisterTrophyPack(request, new Core.EmptyResponse()); }
private void OnTriggerEnter2D(Collider2D collision) { if (GameJoltAPI.Instance.CurrentUser == null) { return; } Scene scene = SceneManager.GetActiveScene(); if (currentLevel.RuntimeValue == 24 && !trophy25Unlocked.RuntimeValue) { Trophies.Unlock(level25, (bool success) => { trophy25Unlocked.RuntimeValue = success; if (success) { Debug.Log("Success!"); } else { Debug.Log("Something went wrong"); } }); } if (currentLevel.RuntimeValue == 49 && !trophy50Unlocked.RuntimeValue) { Trophies.Unlock(level50, (bool success) => { trophy50Unlocked.RuntimeValue = success; if (success) { //Debug.Log("Success!"); } else { Debug.Log("Something went wrong"); } }); } if (currentLevel.RuntimeValue == 74 && !trophy75Unlocked.RuntimeValue) { Trophies.Unlock(level75, (bool success) => { trophy75Unlocked.RuntimeValue = success; if (success) { //Debug.Log("Success!"); } else { Debug.Log("Something went wrong"); } }); } if (collision.tag == "Player" && trophyID > 0 && !trophyUnlocked.RuntimeValue) { Trophies.Unlock(trophyID, (bool success) => { trophyUnlocked.RuntimeValue = success; if (success) { Debug.Log("Success!"); } else { Debug.Log("Something went wrong"); } }); } }
/// <summary> /// Returns true if Player instances are equal /// </summary> /// <param name="input">Instance of Player to be compared</param> /// <returns>Boolean</returns> public bool Equals(Player?input) { if (input == null) { return(false); } return (( Clan == input.Clan || (Clan != null && Clan.Equals(input.Clan)) ) && ( League == input.League || (League != null && League.Equals(input.League)) ) && ( Role == input.Role || Role.Equals(input.Role) ) && ( AttackWins == input.AttackWins || AttackWins.Equals(input.AttackWins) ) && ( DefenseWins == input.DefenseWins || DefenseWins.Equals(input.DefenseWins) ) && ( TownHallLevel == input.TownHallLevel || TownHallLevel.Equals(input.TownHallLevel) ) && ( TownHallWeaponLevel == input.TownHallWeaponLevel || TownHallWeaponLevel.Equals(input.TownHallWeaponLevel) ) && ( VersusBattleWins == input.VersusBattleWins || VersusBattleWins.Equals(input.VersusBattleWins) ) && ( LegendStatistics == input.LegendStatistics || (LegendStatistics != null && LegendStatistics.Equals(input.LegendStatistics)) ) && ( Troops == input.Troops || Troops != null && input.Troops != null && Troops.SequenceEqual(input.Troops) ) && ( Heroes == input.Heroes || Heroes != null && input.Heroes != null && Heroes.SequenceEqual(input.Heroes) ) && ( Spells == input.Spells || Spells != null && input.Spells != null && Spells.SequenceEqual(input.Spells) ) && ( Labels == input.Labels || Labels != null && input.Labels != null && Labels.SequenceEqual(input.Labels) ) && ( Tag == input.Tag || (Tag != null && Tag.Equals(input.Tag)) ) && ( Name == input.Name || (Name != null && Name.Equals(input.Name)) ) && ( ExpLevel == input.ExpLevel || ExpLevel.Equals(input.ExpLevel) ) && ( Trophies == input.Trophies || Trophies.Equals(input.Trophies) ) && ( BestTrophies == input.BestTrophies || BestTrophies.Equals(input.BestTrophies) ) && ( Donations == input.Donations || Donations.Equals(input.Donations) ) && ( DonationsReceived == input.DonationsReceived || DonationsReceived.Equals(input.DonationsReceived) ) && ( BuilderHallLevel == input.BuilderHallLevel || BuilderHallLevel.Equals(input.BuilderHallLevel) ) && ( VersusTrophies == input.VersusTrophies || VersusTrophies.Equals(input.VersusTrophies) ) && ( BestVersusTrophies == input.BestVersusTrophies || BestVersusTrophies.Equals(input.BestVersusTrophies) ) && ( WarStars == input.WarStars || WarStars.Equals(input.WarStars) ) && ( Achievements == input.Achievements || Achievements != null && input.Achievements != null && Achievements.SequenceEqual(input.Achievements) ) && ( VersusBattleWinCount == input.VersusBattleWinCount || VersusBattleWinCount.Equals(input.VersusBattleWinCount) )); }