Commit 173a851c authored by mohamed20047's avatar mohamed20047

make all result menus look like each other

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