Sprint 6
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Abstract class for all minigame-gameEndedPanels
|
||||
/// </summary>
|
||||
@@ -16,7 +17,7 @@ public abstract class AbstractGameEndedPanel : MonoBehaviour
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the scoreboard entries container
|
||||
/// </summary>
|
||||
@@ -100,7 +101,7 @@ public abstract class AbstractGameEndedPanel : MonoBehaviour
|
||||
}
|
||||
else if (diff.Hours > 0)
|
||||
{
|
||||
formatted = $"{diff.Hours}h ";
|
||||
formatted = $"{diff.Hours}u ";
|
||||
}
|
||||
else if (diff.Minutes > 0)
|
||||
{
|
||||
@@ -108,7 +109,7 @@ public abstract class AbstractGameEndedPanel : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted = "now";
|
||||
formatted = "nu";
|
||||
}
|
||||
|
||||
entry.transform.Find("Ago").GetComponent<TMP_Text>().text = formatted;
|
||||
@@ -125,7 +126,10 @@ public abstract class AbstractGameEndedPanel : MonoBehaviour
|
||||
if (diff.TotalSeconds < 1)
|
||||
{
|
||||
Image image = entry.transform.GetComponent<Image>();
|
||||
image.color = new Color(0, 229, 255, 233);
|
||||
image.color = new Color(247 / 255f, 173 / 255f, 25 / 255f, 1f);
|
||||
entry.transform.Find("PlayerName").GetComponent<TMP_Text>().color = new Color(5 / 255f, 63 / 255f, 92 / 255f, 1f);
|
||||
entry.transform.Find("Score").GetComponent<TMP_Text>().color = new Color(5 / 255f, 63 / 255f, 92 / 255f, 1f);
|
||||
entry.transform.Find("Ago").GetComponent<TMP_Text>().color = new Color(5 / 255f, 63 / 255f, 92 / 255f, 1f);
|
||||
}
|
||||
|
||||
rank++;
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Shared abstract class for the minigameControllers
|
||||
/// </summary>
|
||||
@@ -69,7 +70,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
// Prepare the signPredictor
|
||||
signPredictor.SetModel(signPredictorTheme.modelIndex);
|
||||
signPredictor.SwapScreen(webcamScreen);
|
||||
signPredictor.SetSignsList(GetSignsList());
|
||||
AddSelfAsListener();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
// This part is the only reason that feedbackProgress is needed in the abstract
|
||||
else if (feedbackProgress != null)
|
||||
{
|
||||
|
||||
feedbackProgress.value = 0.0f;
|
||||
}
|
||||
|
||||
@@ -115,6 +114,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
score.time = DateTime.Now.ToString();
|
||||
|
||||
// Save the new score
|
||||
user = UserList.GetCurrentUser();
|
||||
var progress = user.GetMinigameProgress(minigame.index);
|
||||
|
||||
// Get the current list of scores
|
||||
@@ -129,11 +129,12 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
highestScores.Sort((a, b) => b.scoreValue.CompareTo(a.scoreValue));
|
||||
|
||||
// Only save the top 10 scores, so this list doesn't keep growing endlessly
|
||||
progress.latestScores = latestScores.Take(10).ToList();
|
||||
progress.latestScores = latestScores.TakeLast(10).ToList();
|
||||
progress.highestScores = highestScores.Take(10).ToList();
|
||||
|
||||
PersistentDataController.GetInstance().Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The function that activates when the game ends, handles some endgame logic and displays the EndPanel
|
||||
/// </summary>
|
||||
@@ -152,7 +153,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy of the passed sign</param>
|
||||
/// <param name="predictedSign">The name of the passed sign</param>
|
||||
protected abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
|
||||
public abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
|
||||
|
||||
/// <summary>
|
||||
/// Each minigame has their own way of calculating their score
|
||||
|
||||
Reference in New Issue
Block a user