Commit 173a851c authored by mohamed20047's avatar mohamed20047

make all result menus look like each other

parent b1508c50
......@@ -393,7 +393,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2715841031609213817
RectTransform:
m_ObjectHideFlags: 0
......@@ -1527,10 +1527,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 22.572838, y: -25.96685}
m_SizeDelta: {x: 0, y: 51.9337}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 22.572838, y: 0}
m_SizeDelta: {x: 51.9337, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5599785267463442964
CanvasRenderer:
......@@ -1969,10 +1969,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 267.15555, y: -25.96685}
m_SizeDelta: {x: 0, y: 51.9337}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 267.15555, y: 0}
m_SizeDelta: {x: 51.9337, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5340325998096306428
CanvasRenderer:
......@@ -2331,7 +2331,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2826639575804227870
RectTransform:
m_ObjectHideFlags: 0
......@@ -2988,10 +2988,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 206.00986, y: -25.96685}
m_SizeDelta: {x: 0, y: 51.9337}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 206.00986, y: 0}
m_SizeDelta: {x: 51.9337, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4280031676036218401
CanvasRenderer:
......@@ -3386,10 +3386,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 144.8642, y: -25.96685}
m_SizeDelta: {x: 0, y: 51.9337}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 144.8642, y: 0}
m_SizeDelta: {x: 51.9337, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3352223824432655738
CanvasRenderer:
......@@ -3663,10 +3663,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 83.71851, y: -25.96685}
m_SizeDelta: {x: 0, y: 51.9337}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 83.71851, y: 0}
m_SizeDelta: {x: 51.9337, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2582842219960060486
CanvasRenderer:
......
This diff is collapsed.
......@@ -1100,7 +1100,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &686057142080516293
RectTransform:
m_ObjectHideFlags: 0
......@@ -2421,7 +2421,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1678379179440431643
RectTransform:
m_ObjectHideFlags: 0
......
......@@ -342,7 +342,7 @@ namespace com.al_arcade.cs
if (uiManager != null)
{
uiManager.ShowFeedback($"ممتاز! {points}+", true);
uiManager.ShowFeedback($"ممتاز!", true);
uiManager.SetStreak(_streak);
}
......
......@@ -480,9 +480,8 @@ namespace com.al_arcade.cs
_resultTitle.Text = win ? pct >= 70 ? "أحسنت!" : "عمل جيد!" : "حظ اوفر";
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if (_resultStats != null)
_resultStats.Text = $"صحيح: {correct} / {total} | " +
$"المحاولات الخاطئة: {wrong} | " +
$"أعلى سلسلة: {bestStreak}";
_resultStats.Text = $"صحيح: {correct} | " +
$"المحاولات الخاطئة: {wrong} ";
var seq = DOTween.Sequence();
seq.Append(_resultsUI.DOFade(1f, 0.5f));
......
......@@ -571,10 +571,12 @@ namespace com.al_arcade.mcq
{
if (uiManager != null)
{
string msg = _streak >= streakBonusThreshold
? $"ممتاز! +{points} (سلسلة {_streak}×)"
: $"صحيح! +{points}";
uiManager.ShowFeedback(msg, true);
//string msg = _streak >= streakBonusThreshold
// ? $"ممتاز! +{points} (سلسلة {_streak}×)"
// : $"صحيح! +{points}";
uiManager.ShowFeedback($"ممتاز!", true);
}
foreach (var g in _activeGates)
......@@ -595,7 +597,7 @@ namespace com.al_arcade.mcq
private void ShowWrongFeedback()
{
if (uiManager != null) uiManager.ShowFeedback("خطأ!", false);
if (uiManager != null) uiManager.ShowFeedback("حاول مرة أخرى", false);
foreach (var g in _activeGates)
{
......
......@@ -46,10 +46,10 @@ namespace com.al_arcade.mcq
[Header("Results UI")]
[SerializeField] private UniText _resultTitle;
[SerializeField] private UniText _resultScore;
[SerializeField] private UniText _resultCorrect;
[SerializeField] private UniText _resultWrong;
[SerializeField] private UniText _resultStreak;
[SerializeField] private UniText _resultScore;//
[SerializeField] private UniText _resultStats;
[SerializeField] private UniText _resultWrong;//
[SerializeField] private UniText _resultStreak;//
[SerializeField] private Button _resultRestartBtn;
[SerializeField] private Button _backToMenuBtn;
[SerializeField] private Slider _progressSlider;
......@@ -289,20 +289,19 @@ namespace com.al_arcade.mcq
// ─── Results ──────────────────────────────────────────────────────────
public void ShowResults(int score, int correct, int wrong,
int bestStreak, int total, bool won)
public void ShowResults(int score, int correct, int wrong, int total, int bestStreak, bool win = true)
{
_resultsUI.gameObject.SetActive(true);
_resultsUI.alpha = 0;
if (_resultTitle != null) _resultTitle.Text = won ? "أحسنت!" : "حظ أوفر!";
if (_resultTitle != null) _resultTitle.Text = win ? "أحسنت!" : "حظ أوفر!";
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if (_resultCorrect != null) _resultCorrect.Text = $"صحيح: {correct}";
if (_resultWrong != null) _resultWrong.Text = $"خطأ: {wrong}";
if (_resultStreak != null) _resultStreak.Text = $"أعلى سلسلة: {bestStreak}";
if (_resultStats != null)
_resultStats.Text = $"صحيح: {correct} | " +
$"المحاولات الخاطئة: {wrong} " ;
if (_winIcon != null) _winIcon.SetActive(won);
if (_loseIcon != null) _loseIcon.SetActive(!won);
if (_winIcon != null) _winIcon.SetActive(win);
if (_loseIcon != null) _loseIcon.SetActive(!win);
var seq = DOTween.Sequence();
seq.Append(_resultsUI.DOFade(1f, 0.5f));
......
......@@ -214,7 +214,7 @@ namespace com.al_arcade.tf
if (productionLine != null) yield return productionLine.MoveForward(stepDistance);
if (questionScreen != null) questionScreen.ShowFeedback(true, _streak);
if (uiManager != null) uiManager.ShowFeedback($"ممتاز! {points}+", true);
if (uiManager != null) uiManager.ShowFeedback($"ممتاز!", true);
var audio = SSAudioManager.Instance;
if (audio != null)
......@@ -305,7 +305,7 @@ namespace com.al_arcade.tf
protected override IEnumerator NoChallengeLoseSequence()
{
yield return new WaitForSeconds(1f);
uiManager?.ShowResults(_score, _correctCount, _wrongCount, false);
uiManager?.ShowResults(_score, _correctCount, _wrongCount,_questions.Length, _streak, false);
onGameOver?.Invoke();
}
......@@ -327,7 +327,7 @@ namespace com.al_arcade.tf
protected override IEnumerator NoChallengeVictorySequence()
{
yield return new WaitForSeconds(1.5f);
uiManager?.ShowResults(_score, _correctCount, _wrongCount, true);
uiManager?.ShowResults(_score, _correctCount, _wrongCount,_questions.Length ,_streak);
onGameComplete?.Invoke();
}
......
......@@ -229,14 +229,16 @@ namespace com.al_arcade.tf
// ─── Results ──────────────────────────────────────────────────────────
public void ShowResults(int score, int correct, int wrong, bool won)
public void ShowResults(int score, int correct, int wrong, int total, int bestStreak, bool win = true)
{
_resultsUI.gameObject.SetActive(true);
_resultsUI.alpha = 0;
if (_resultTitle != null) _resultTitle.Text = won ? "نجحت المهمة" : "حاول مجدداً";
if (_resultTitle != null) _resultTitle.Text = win ? "نجحت المهمة" : "حاول مجدداً";
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if (_resultStats != null) _resultStats.Text = $"صح: {correct} | خطأ: {wrong}";
if (_resultStats != null)
_resultStats.Text = $"صحيح: {correct} | " +
$"المحاولات الخاطئة: {wrong} " ;
var seq = DOTween.Sequence();
seq.Append(_resultsUI.DOFade(1, 0.4f));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment