Skip to content

Commit

Permalink
Add song end time to results screen
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrikMoon committed Dec 9, 2023
1 parent 5794f8d commit 43ff7a4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion TournamentAssistant/UI/FlowCoordinators/RoomCoordinator.cs
Expand Up @@ -588,7 +588,9 @@ public void SongFinished(StandardLevelScenesTransitionSetupDataSO standardLevelS
Difficulties = map.parentDifficultyBeatmapSet.difficultyBeatmaps.Select(x => (int)x.difficulty).ToArray()
}
},
Score = results.modifiedScore
Score = results.modifiedScore,
Misses = results.missedCount,
EndTime = results.endSongTime
};

if (results.levelEndStateType == LevelCompletionResults.LevelEndStateType.Cleared)
Expand Down
2 changes: 1 addition & 1 deletion TournamentAssistantProtos
7 changes: 4 additions & 3 deletions TournamentAssistantShared/Constants.cs
Expand Up @@ -8,8 +8,8 @@ namespace TournamentAssistantShared
public static class Constants
{
public const string NAME = "TournamentAssistant";
public const string VERSION = "0.7.4";
public const int VERSION_CODE = 074;
public const string VERSION = "0.7.8";
public const int VERSION_CODE = 078;
public const string MASTER_SERVER = "tournamentassistant.net";
public const string Changelog =
"0.0.1: Begin assembling UI for coordinator panels\n" +
Expand Down Expand Up @@ -64,7 +64,8 @@ public static class Constants
"0.7.0: Some server synchronization fixes, for players and users that means more stability\n" +
"0.7.3: Update for 1.29.1\n" +
"0.7.4: Score update fix\n" +
"0.7.5: Add ability for players to select Pro Mode";
"0.7.5: Add ability for players to select Pro Mode\n" +
"0.7.8: Added song end time to results";

public enum BeatmapDifficulty
{
Expand Down
1 change: 1 addition & 0 deletions TournamentAssistantUI/UI/UserControls/GameOverDialog.xaml
Expand Up @@ -37,6 +37,7 @@
<TextBlock FontSize="12" HorizontalAlignment="Center" Text="{Binding Type, StringFormat=Result: \{0\}}" />
<TextBlock FontSize="12" HorizontalAlignment="Center" Text="{Binding Score, StringFormat=Score: \{0\}}" />
<TextBlock FontSize="12" HorizontalAlignment="Center" Text="{Binding Misses, StringFormat=Misses: \{0\}}" />
<TextBlock FontSize="12" HorizontalAlignment="Center" Text="{Binding EndTime, StringFormat=End Time: \{0\}}" />
<TextBlock FontSize="12" HorizontalAlignment="Center" Text="{Binding Distance, StringFormat=Diff: +\{0\}}" />
</StackPanel>
</DataTemplate>
Expand Down
12 changes: 6 additions & 6 deletions TournamentAssistantUI/UI/UserControls/GameOverDialog.xaml.cs
Expand Up @@ -13,13 +13,12 @@ namespace TournamentAssistantUI.UI.UserControls
/// </summary>
public partial class GameOverDialog : UserControl
{
public class SongFinishedWithDistanceFromFirstPlayerAndMisses : Push.SongFinished
public class SongFinishedWithDistanceFromFirstPlayer : Push.SongFinished
{
public int Distance { get; set; }
public int Misses { get; set; }
}

public List<SongFinishedWithDistanceFromFirstPlayerAndMisses> Results { get; set; }
public List<SongFinishedWithDistanceFromFirstPlayer> Results { get; set; }
private Dictionary<string, RealtimeScore> latestRealtimeScores { get; set; }

public GameOverDialog(List<Push.SongFinished> results, Dictionary<string, RealtimeScore> latestScores)
Expand All @@ -30,15 +29,16 @@ public GameOverDialog(List<Push.SongFinished> results, Dictionary<string, Realti
var firstPlace = orderedResults.First();

Results = orderedResults.Select(x => {
latestRealtimeScores.TryGetValue(x.Player.Guid, out var lastRealtimeScore);
return new SongFinishedWithDistanceFromFirstPlayerAndMisses
// latestRealtimeScores.TryGetValue(x.Player.Guid, out var lastRealtimeScore);
return new SongFinishedWithDistanceFromFirstPlayer
{
Beatmap = x.Beatmap,
Player = x.Player,
Score = x.Score,
Type = x.Type,
Distance = x.Score - firstPlace.Score,
Misses = lastRealtimeScore?.notesMissed ?? 0
Misses = x.Misses,
EndTime = x.EndTime
};
}).ToList();

Expand Down

0 comments on commit 43ff7a4

Please sign in to comment.