/// <summary> /// Shows which support levels are available and what the current level are /// </summary> /// <param name="tuple"></param> /// <param name="value"></param> public void SetSupportValue(SupportTuple tuple, SupportValue value) { SupportLetter max = (tuple != null) ? tuple.maxlevel : SupportLetter.NONE; supportS.enabled = ((int)max >= 4); supportA.enabled = ((int)max >= 3); supportB.enabled = ((int)max >= 2); supportC.enabled = ((int)max >= 1); SupportLetter achieved = (tuple != null && value != null) ? (SupportLetter)value.currentLevel : SupportLetter.NONE; supportS.color = ((int)achieved >= 4) ? Color.green : Color.black; supportA.color = ((int)achieved >= 3) ? Color.white : Color.black; supportB.color = ((int)achieved >= 2) ? Color.white : Color.black; supportC.color = ((int)achieved >= 1) ? Color.white : Color.black; SupportLetter current = (tuple != null && value != null) ? tuple.CalculateLevel(value.value) : SupportLetter.NONE; newLevel.enabled = (current > achieved); }
private void UpdateSelectedHouse() { Room currentRoom = housingController.GetCurrentRoom(); StatsContainer stats = playerData.stats[currentRoom.residentIndex]; roomNumber.text = housingController.GetRoomName(); characterName.text = (stats != null) ? stats.charData.entryName : ""; characterClass.text = (stats != null) ? stats.currentClass.entryName : ""; characterLevel.text = (stats != null) ? "Level " + stats.level : ""; portrait.sprite = (stats != null) ? stats.charData.portraitSet.poses[0] : null; List <Room> neighbours = currentRoom.house.GetNeighbours(currentRoom); string nr1 = "", nr2 = ""; if (stats != null) { if (neighbours.Count > 0) { StatsContainer neigh1 = playerData.stats[neighbours[0].residentIndex]; SupportContainer supportCon1 = playerData.baseInfo[neighbours[0].residentIndex]; nr1 += neigh1.charData.entryName; SupportTuple support = neigh1.charData.GetSupport(stats.charData); if (support != null) { int supportValue = supportCon1.GetSupportValue(neigh1.charData).value; nr1 += "\nRank " + support.CalculateLevel(supportValue) + " " + support.GetSpeedString(); } else { nr1 += "\nRank - (x)"; } } else { nr1 = "-Empty-"; } if (neighbours.Count > 1) { StatsContainer neigh2 = playerData.stats[neighbours[1].residentIndex]; SupportContainer supportCon2 = playerData.baseInfo[neighbours[1].residentIndex]; nr2 += neigh2.charData.entryName; SupportTuple support = neigh2.charData.GetSupport(stats.charData); if (support != null) { int supportValue = supportCon2.GetSupportValue(neigh2.charData).value; nr2 += "\nRank " + support.CalculateLevel(supportValue) + " " + support.GetSpeedString(); } else { nr2 += "\nRank - (x)"; } } else { nr2 = "-Empty-"; } } neighbourStats1.text = nr1; neighbourStats2.text = nr2; }