//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); }
public void OnClickSelectLevelMenu(int id) { currentWorld = id; mainMenuCanvas.SetActive(false); levelCanvas.SetActive(true); worldCanvas.SetActive(false); optionCanvas.SetActive(false); int[] currentList = new int[0]; StarPoints[] tmpPoints = new StarPoints[0]; switch (id) { case 1: currentList = starsMonde1; tmpPoints = StarPointsMonde1; break; case 2: currentList = starsMonde2; tmpPoints = StarPointsMonde2; break; case 3: currentList = starsMonde3; tmpPoints = StarPointsMonde3; break; } for (int i = 0; i < currentList.Length; i++) { if (tmpPoints[i].sprite != null) { levelUIMonde1[i].image.sprite = tmpPoints[i].sprite; } if (levelUIMonde1[i].button != null) { levelUIMonde1[i].button.interactable = false; } if (levelUIMonde1[i].locker != null) { levelUIMonde1[i].locker.SetActive(true); } } for (int i = 0; i < currentList.Length; i++) { levelUIMonde1[i].starUnlock1.SetActive(false); levelUIMonde1[i].starUnlock2.SetActive(false); levelUIMonde1[i].starUnlock3.SetActive(false); if (currentList[i] >= 0) { if (levelUIMonde1[i].button != null) { levelUIMonde1[i].button.interactable = true; } if (levelUIMonde1[i].locker != null) { levelUIMonde1[i].locker.SetActive(false); } if (levelUIMonde1.Length > i + 1) { if (levelUIMonde1[i + 1].button != null) { levelUIMonde1[i + 1].button.interactable = true; } if (levelUIMonde1[i + 1].locker != null) { levelUIMonde1[i + 1].locker.SetActive(false); } } levelUIMonde1[i].starUnlock1.SetActive(true); if (currentList[i] <= tmpPoints[i].minPoints2Star) { levelUIMonde1[i].starUnlock2.SetActive(true); if (currentList[i] <= tmpPoints[i].minPoints3Star) { levelUIMonde1[i].starUnlock3.SetActive(true); } } } } eventSystem.SetSelectedGameObject(levelFirstSelectedObj); OnclikSelecteLevel(1); }
public void OnclikSelecteLevel(int i) { currentId = i - 1; nameLeveltextEnd.text = string.Format(nameLeveltextTrad.text, currentWorld.ToString(), (currentId + 1).ToString()); LevelMenu[] currentList = levelObjMonde1; StarPoints[] currenPoint = StarPointsMonde1; switch (currentWorld) { case 2: currentList = levelObjMonde2; currenPoint = StarPointsMonde2; break; case 3: currentList = levelObjMonde3; currenPoint = StarPointsMonde3; break; } if (currentLevel != null) { if (currentLevel.cubes.Count > 0) { currentLevel.gameObject.SetActive(false); } } if (currentList.Length > currentId) { currentLevel = currentList[currentId]; if (currentLevel != null) { // info level nbcouptextEnd.text = string.Format(nbcouptextTrad.text, currenPoint[currentId].nbblock); nbEnnemietextEnd.text = string.Format(nbEnnemietextTrad.text, currenPoint[currentId].nbenemie); // spawn level currentLevel.gameObject.SetActive(true); currentLevel.LoadLevel(); if (true) { if (stars[0] != null) { stars[0].SetActive(true); } if (stars[1] != null) { stars[1].SetActive(true); } if (stars[2] != null) { stars[2].SetActive(true); } } ///////////////////////////////////////////////////////////////// int[] currentListi = new int[0]; StarPoints[] tmpPointsi = new StarPoints[0]; switch (currentWorld) { case 1: currentListi = starsMonde1; tmpPointsi = StarPointsMonde1; break; case 2: currentListi = starsMonde2; tmpPointsi = StarPointsMonde2; break; case 3: currentListi = starsMonde3; tmpPointsi = StarPointsMonde3; break; } if (stars[0] != null) { stars[0].SetActive(false); } if (stars[1] != null) { stars[1].SetActive(false); } if (stars[2] != null) { stars[2].SetActive(false); } i = i - 1; //Debug.Log(currentListi[i] +" , " + tmpPointsi[i].minPoints2Star + " , " + tmpPointsi[i].minPoints3Star); if (currentListi[i] >= 0) { if (stars[0] != null) { stars[0].SetActive(true); } if (currentListi[i] <= tmpPointsi[i].minPoints2Star) { if (stars[1] != null) { stars[1].SetActive(true); } if (currentListi[i] <= tmpPointsi[i].minPoints3Star) { if (stars[2] != null) { stars[2].SetActive(true); } } } } ///////////////////////////////////////////////////////////////// } } }
public void OnClickSelectWorldMenu() { if (!level2Unlock || !level3Unlock) { int[] tmpTab; StarPoints[] tmpStarStab = new StarPoints[0]; int[] conte = new int[3]; int tmpCount = 0; for (int i = 1; i <= 3; i++) { tmpTab = SaveSystem.LoadPoints("starsMonde" + i); switch (i) { case 1: tmpStarStab = StarPointsMonde1; break; case 2: tmpStarStab = StarPointsMonde2; break; case 3: tmpStarStab = StarPointsMonde3; break; } for (int j = 0; j < tmpTab.Length; j++) { if (tmpTab[j] > 0) { tmpCount += 1; if (tmpTab[j] <= tmpStarStab[j].minPoints2Star) { tmpCount += 1; if (tmpTab[j] <= tmpStarStab[j].minPoints3Star) { tmpCount += 1; } } } } conte[i - 1] = tmpCount; tmpCount = 0; } tmpCount = conte[0] + conte[1] + conte[2]; nbStarToUnlockText1.text = conte[0].ToString(); if (tmpCount >= minPointsToUnlockWorld2) { if (unlockWorld[0] == 0) { unlockWorldObj[0].SetActive(true); unlockWorldObj2[0].SetActive(false); } else { unlockWorldObj[0].SetActive(false); unlockWorldObj2[0].SetActive(false); level2Unlock = true; nbStarToUnlockText2.text = conte[1].ToString(); } } else { unlockWorldObj[0].SetActive(false); unlockWorldObj2[0].SetActive(true); nbStarToUnlockText2.text = tmpCount + " / " + minPointsToUnlockWorld2; } if (tmpCount >= minPointsToUnlockWorld3) { if (unlockWorld[1] == 0) { unlockWorldObj[1].SetActive(true); unlockWorldObj2[1].SetActive(false); } else { unlockWorldObj[1].SetActive(false); unlockWorldObj2[1].SetActive(false); level3Unlock = true; nbStarToUnlockText3.text = conte[2].ToString(); } } else { unlockWorldObj[1].SetActive(false); unlockWorldObj2[1].SetActive(true); nbStarToUnlockText3.text = tmpCount + " / " + minPointsToUnlockWorld3; } nbStarTotal.text = tmpCount + " / " + 135; } if (world2Button != null) { world2Button.interactable = level2Unlock; } else { Debug.Log("world2Button is not set"); } if (world3Button != null) { world3Button.interactable = level3Unlock; } else { Debug.Log("world2Button is not set"); } mainMenuCanvas.SetActive(false); worldCanvas.SetActive(true); levelCanvas.SetActive(false); optionCanvas.SetActive(false); eventSystem.SetSelectedGameObject(mondeFirstSelectedObj); }