public string textInfoOf(ModePlayerInfoBase playerInfo, bool isFinished) { if (playerInfo is TimeBasedModePlayerInfo) { if (isFinished) { return(GUtils.GetFormattedMS((double)playerInfo.modeData_)); } else { return(((int)((TimeBasedModePlayerInfo)playerInfo).distanceToFinish_).ToString() + "m"); } } if (playerInfo is SoccerMode.SoccerModePlayerInfo) { return("Team " + ((SoccerMode.SoccerModePlayerInfo)playerInfo).team_.ID_ + " - score " + ((SoccerMode.SoccerModePlayerInfo)playerInfo).team_.points_); } if (G.Sys.GameManager_.ModeID_ == GameModeID.ReverseTag) { return(GUtils.GetFormattedTime((float)playerInfo.modeData_, true, 3)); } return(playerInfo.modeData_.ToString() + " eV"); }
public string LevelInfo() { GameManager game_manager = G.Sys.GameManager_; string level_path = game_manager.LevelPath_; LevelInfo level_info = G.Sys.LevelSets_.GetLevelInfo(level_path); ProfileProgress progress = G.Sys.ProfileManager_.CurrentProfile_.Progress_; GameMode mode = G.Sys.GameManager_.Mode_; string out_result = ""; int best = progress.GetTopResultWithRelativePath(level_info.relativePath_, mode.GameModeID_); string personal_best = Language.GetLine("levelinfo.personalbest.none"); if (best != -1) { if (mode.ResultsDisplayType_ == ResultsDisplayType.Time) { personal_best = GUtils.GetFormattedMS(best); } else { personal_best = $"{GUtils.GetFormattedPoints(best)} eV"; } } string out_personal_best = string.Format(Language.GetLine("levelinfo.personalbest"), personal_best); bool supports_medals = level_info.SupportsMedals(mode.GameModeID_); MedalStatus medal_status = MedalStatus.None; string medal = Language.GetLine($"medal.none"); if (mode.SupportsMedals_ && supports_medals && level_path != null) { medal_status = progress.GetMedalStatusWithRelativePath(level_info.relativePath_, mode.GameModeID_); medal = Language.GetLine($"medal.{medal_status.ToString().DOWN().Replace("_", "")}"); } string out_medal_earned = string.Format(Language.GetLine("levelinfo.medalearned"), medal); string out_difficulty = string.Format(Language.GetLine("levelinfo.difficulty"), Language.GetLine($"difficulty.{level_info.difficulty_.ToString().DOWN()}")); out_result = $"{out_personal_best}\n{out_medal_earned}\n{out_difficulty}"; if (level_info.levelType_ == LevelType.Workshop) { string rating, vote; rating = vote = ""; if (SteamworksManager.IsSteamBuild_ && G.Sys.SteamworksManager_.UGC_.TryGetWorkshopLevelData(level_info.relativePath_, out WorkshopLevelInfo level_data)) { rating = SteamworksUGC.GetWorkshopRatingText(level_data); vote = Language.GetLine("levelinfo.workshop.vote.none"); switch (level_data.workshopVote_) { case EWorkshopVote.k_EWorkshopVoteFor: vote = Language.GetLine("levelinfo.workshop.vote.for"); break; case EWorkshopVote.k_EWorkshopVoteAgainst: vote = Language.GetLine("levelinfo.workshop.vote.against"); break; } } else { rating = Language.GetLine("levelinfo.workshop.rating.unknown"); vote = Language.GetLine("levelinfo.workshop.vote.unknown"); } string out_rating = string.Format(Language.GetLine("levelinfo.workshop.rating"), rating); string out_vote = string.Format(Language.GetLine("levelinfo.workshop.vote"), vote); out_result = $"{out_result}\n{out_rating}\n{out_vote}"; } return(out_result); }