Commit 3bd840a6 authored by Yousef Sameh's avatar Yousef Sameh

token refresh on resume + error reversed text fix + better UI handling

parent 5fcacb0c
......@@ -51,6 +51,30 @@ public class AppRouter : MonoBehaviour
HandleBackButton();
}
private void OnApplicationPause(bool pause)
{
if (!pause && SupabaseManager.Instance?.IsInitialized == true)
{
RefreshSessionOnResume().Forget();
}
}
private async UniTaskVoid RefreshSessionOnResume()
{
if (SupabaseManager.Instance?.Supabase()?.Auth?.CurrentUser == null)
return;
try
{
await SupabaseManager.Instance.Supabase().Auth.RefreshSession();
Debug.Log("[AppRouter] Session refreshed on resume");
}
catch (Exception e)
{
Debug.LogWarning($"[AppRouter] Session refresh failed on resume: {e.Message}");
}
}
private void HandleBackButton()
{
// Safety: Don't let the back button break an active game session
......@@ -85,8 +109,10 @@ public class AppRouter : MonoBehaviour
// Execution halts here until isConnected is true
await EnsureNetworkConnection();
await SupabaseManager.Instance.Initialize();
// --- STEP 2: Authentication Session ---
UpdateStatus("Checking session...");
var authResult = await SupabaseAuthentication.Instance.EnsureSession();
if (authResult.IsT1) // No valid session found
......@@ -102,13 +128,11 @@ public class AppRouter : MonoBehaviour
}
// --- STEP 3: Load User Profile ---
UpdateStatus("Fetching profile...");
var prof = await UserService.Instance.GetCurrentUser();
prof.Switch(
async success =>
{
UpdateStatus("Welcome back!");
TransitionManager.Instance().Transition("MainMenu", transitionSettings, 0.5f);
UserService.Instance.StartListening();
},
......@@ -168,16 +192,22 @@ public class AppRouter : MonoBehaviour
{
attempts++;
UpdateStatus(attempts == 1 ? "Connecting..." : "Waiting for network...");
if (simulateNetworkFailure)
switch (Application.internetReachability)
{
Debug.LogWarning("[TEST] simulateNetworkFailure is ON. Mocking connection failure.");
case NetworkReachability.NotReachable:
isConnected = false;
break;
case NetworkReachability.ReachableViaCarrierDataNetwork:
case NetworkReachability.ReachableViaLocalAreaNetwork:
isConnected = true;
break;
}
else
if (simulateNetworkFailure)
{
isConnected = await SupabaseManager.Instance.Initialize();
Debug.LogWarning("[TEST] simulateNetworkFailure is ON. Mocking connection failure.");
isConnected = false;
}
if (!isConnected)
......@@ -197,15 +227,9 @@ public class AppRouter : MonoBehaviour
AnimateOut();
}
}
UpdateStatus("Connected!");
await UniTask.Delay(500); // Visual polish
}
private void UpdateStatus(string message)
{
Debug.Log($"[AppRouter] {message}");
}
// ─── Auth State Listener (Safety Net) ───────────────────────────
......
using System.Linq;
using com.al_arcade.shared;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UIElements;
......@@ -11,26 +8,6 @@ public class HomeController : MonoBehaviour
[SerializeField] private GameObject challengePrefab;
[SerializeField] private int minQuestionsPerType = 5;
private Label username;
private Label xp;
private Label rank;
private Label xpRankEnd;
private CustomProgressBar nextRankProgressBar;
private Button challengeButton;
private Button practiceButton;
private Label nameMenuPanel;
private Label xpMenuPanel;
private Label rankMenuPanel;
private ScrollView activityScrollView;
private Button logoutButton;
private VisualElement menuPanel;
// Navigation guard — prevents concurrent Challenge + Practice clicks
public static bool IsNavigating { get; private set; }
void Start()
......@@ -38,49 +15,42 @@ public class HomeController : MonoBehaviour
QualitySettings.vSyncCount = 0;
var root = mainMenuDocument.rootVisualElement.Q("Home");
menuPanel = mainMenuDocument.rootVisualElement.Q("MenuPanel");
username = root.Q<Label>("Username");
rank = root.Q<Label>("Rank");
xp = root.Q<Label>("XP");
xpRankEnd = root.Q<Label>("XPRankEnd");
nextRankProgressBar = root.Q<CustomProgressBar>("NextRankProgressBar");
UserService.Instance.OnUserChanged += OnUserChange;
challengeButton = root.Q<Button>("Challenge");
challengeButton.clicked += OnChallengeButtonClicked;
practiceButton = root.Q<Button>("OpenPracticeButton");
root.Q<Button>("Challenge").clicked += OnChallengeButtonClicked;
root.Q<Button>("OpenChallengePanel").clicked += OnChallengePanelButtonClicked;
SetPlayButtonsEnabled(false);
UserService.Instance.OnUserChanged += OnUserChange;
OnUserChange(UserService.Instance.CurrentUser);
}
private void OnUserChange(User user)
{
if (user == null)
{
Debug.LogWarning("[HomeController] No user logged in");
return;
}
username.text = user.Username;
xp.text = user.Points.ToString();
rank.text = user.Rank;
xpRankEnd.text = $"{user.Points} / {Rank.FromXP(user.Points).EndXP}";
var root = mainMenuDocument.rootVisualElement.Q("Home");
nextRankProgressBar.Value = Rank.FromXP(user.Points).Progress(user.Points);
nextRankProgressBar.LeftText = Rank.FromXP(user.Points).StartXP.ToString() + " " + Rank.FromXP(user.Points).Name;
nextRankProgressBar.RightText = Rank.FromXP(user.Points).Next?.StartXP.ToString() + " " + Rank.FromXP(user.Points).Next?.Name;
root.Q<Label>("Username").text = user.Username;
root.Q<Label>("XP").text = user.Points.ToString();
root.Q<Label>("Rank").text = user.Rank;
root.Q<Label>("XPRankEnd").text = $"{user.Points} / {Rank.FromXP(user.Points).EndXP}";
var progressBar = root.Q<CustomProgressBar>("NextRankProgressBar");
progressBar.Value = Rank.FromXP(user.Points).Progress(user.Points);
progressBar.LeftText = Rank.FromXP(user.Points).StartXP.ToString() + " " + Rank.FromXP(user.Points).Name;
progressBar.RightText = Rank.FromXP(user.Points).Next?.StartXP.ToString() + " " + Rank.FromXP(user.Points).Next?.Name;
CheckQuestionAvailability(user);
}
private void CheckQuestionAvailability(User user)
{
Debug.Log("Checking question availability for user: " + user.Username + " (Grade: " + user.Grade + ", Term: " + user.Term + ")");
Debug.Log("Checking question availability for user: " + user.Username + " (Grade: " + user.Grade + ", Term: " + user.Term + user.Curriculum);
StartCoroutine(SSApiManager.EnsureInstance().GetChapters(
chapters =>
{
......@@ -96,7 +66,11 @@ public class HomeController : MonoBehaviour
&& cs >= minQuestionsPerType;
SetPlayButtonsEnabled(enough);
},
_ => SetPlayButtonsEnabled(false),
_ =>
{
Debug.LogError("Failed to load chapters for user: " + user.Username);
SetPlayButtonsEnabled(false);
},
curriculumId: user.Curriculum,
gradeId: user.Grade,
termId: user.Term
......@@ -105,11 +79,16 @@ public class HomeController : MonoBehaviour
private void SetPlayButtonsEnabled(bool enabled)
{
if (challengeButton != null)
var root = mainMenuDocument.rootVisualElement.Q("Home");
var openChallengePanelButton = root.Q<Button>("OpenChallengePanel");
var practiceButton = root.Q<Button>("OpenPracticeButton");
if (openChallengePanelButton != null)
{
challengeButton.SetEnabled(enabled);
challengeButton.style.opacity = enabled ? 1f : 0.35f;
openChallengePanelButton.SetEnabled(enabled);
openChallengePanelButton.style.opacity = enabled ? 1f : 0.35f;
}
if (practiceButton != null)
{
practiceButton.SetEnabled(enabled);
......@@ -123,38 +102,11 @@ public class HomeController : MonoBehaviour
{
if (SupabaseManager.Instance.Supabase().Auth.CurrentUser.IsAnonymous)
{
challengeButton.style.opacity = 0.35f;
var root = mainMenuDocument.rootVisualElement.Q("Home");
root.Q<Button>("OpenChallengePanel").style.opacity = 0.35f;
}
}
// private void OnNewActivityReceived(Activity activity)
// {
// var name = activity.Message.Split(" ")[0];
// var label = new Label($"<color=#FED700>{name}</color> {activity.Message[name.Length..]}");
// activityScrollView.Add(label);
// activityScrollView.contentContainer.RegisterCallbackOnce<GeometryChangedEvent>(_ =>
// {
// var targetScroll = activityScrollView.horizontalScroller.highValue;
// var currentScroll = activityScrollView.scrollOffset;
// activityScrollView.schedule.Execute(() =>
// {
// var newOffset = Mathf.Lerp(currentScroll.x, targetScroll, 0.15f);
// if (Mathf.Abs(targetScroll - newOffset) < 1f)
// {
// activityScrollView.scrollOffset = new Vector2(targetScroll, currentScroll.y);
// return;
// }
// currentScroll.x = newOffset;
// activityScrollView.scrollOffset = currentScroll;
// }).Every(16).Until(() => Mathf.Abs(activityScrollView.scrollOffset.x - targetScroll) < 1f);
// });
// }
private void OnChallengeButtonClicked()
{
if (SupabaseManager.Instance.Supabase().Auth.CurrentUser.IsAnonymous)
......@@ -166,8 +118,10 @@ public class HomeController : MonoBehaviour
if (IsNavigating) return;
IsNavigating = true;
challengeButton.SetEnabled(false);
if (practiceButton != null) practiceButton.SetEnabled(false);
// var root = mainMenuDocument.rootVisualElement.Q("Home");
// root.Q<Button>("Challenge").SetEnabled(false);
// var practiceButton = root.Q<Button>("OpenPracticeButton");
// practiceButton?.SetEnabled(false);
var challenge = Instantiate(challengePrefab);
var challengeManager = challenge.GetComponent<ChallengeManager>();
......@@ -175,10 +129,17 @@ public class HomeController : MonoBehaviour
challengeManager.StartChallenge();
}
private void OnChallengePanelButtonClicked()
{
if (SupabaseManager.Instance.Supabase().Auth.CurrentUser.IsAnonymous)
{
ShowUIMessage.Instance.ShowMessage("سجل حساب أو سجل دخولك لتتمكن من الوصول إلى التحدي", true);
}
}
private void OnDestroy()
{
IsNavigating = false;
UserService.Instance.OnUserChanged -= OnUserChange;
challengeButton.clicked -= OnChallengeButtonClicked;
}
}
using System;
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;
......@@ -30,13 +29,14 @@ public class LeaderboardController : MonoBehaviour, IDisposable
Button myRankButton = root.Q<Button>("MyRankButton");
myRankButton.clicked += () =>
{
if(currentPlayerSlot == null)
if (currentPlayerSlot == null)
{
ShowUIMessage.Instance.ShowMessage("حسابك ليس من ضمن افضل 100 لاعب");
}
else
{
leaderBoardScrollView.experimental.animation.Start(leaderBoardScrollView.scrollOffset.y, currentPlayerSlot.layout.y, 300, (v, t) => {
leaderBoardScrollView.experimental.animation.Start(leaderBoardScrollView.scrollOffset.y, currentPlayerSlot.layout.y, 300, (v, t) =>
{
leaderBoardScrollView.scrollOffset = new Vector2(leaderBoardScrollView.scrollOffset.x, t);
});
}
......@@ -75,7 +75,7 @@ public class LeaderboardController : MonoBehaviour, IDisposable
return;
result.Switch(
(List<LeaderboardPlayerModel> players) =>
players =>
{
currentPlayerSlot = null;
......@@ -104,10 +104,9 @@ public class LeaderboardController : MonoBehaviour, IDisposable
allPlayersContainer.Add(entry);
}
},
(string error) =>
error =>
{
var errorLabel = new Label($"Error loading leaderboard: {error}");
allPlayersContainer.Add(errorLabel);
Debug.LogError($"Failed to load leaderboard: {error}");
}
);
}
......
using UnityEngine;
using UnityEngine;
using UnityEngine.UIElements;
public class ProfileController : MonoBehaviour
{
[SerializeField] private UIDocument profileDocument;
private Label name;
private Button logoutButton;
private Button updateProfileButton;
private TextField UsernameLabel;
private DropdownField Grade;
private DropdownField Term;
private DropdownField Curriculum;
private CustomSwitch musicSwitch;
private CustomSwitch sfxSwitch;
private Button sure;
void Start()
{
var root = profileDocument.rootVisualElement.Q("Settings");
name = root.Q<Label>("Username");
logoutButton = root.Q<Button>("LogoutButton");
logoutButton.clicked += AppRouter.Logout;
updateProfileButton = root.Q<Button>("UpdateProfile");
updateProfileButton.clicked += () =>
{
UpdateProfile();
};
UsernameLabel = root.Q<TextField>("Name");
Grade = root.Q<DropdownField>("Grade");
Term = root.Q<DropdownField>("TermDrop");
Curriculum = root.Q<DropdownField>("Curriculum");
root.Q<Button>("LogoutButton").clicked += AppRouter.Logout;
root.Q<Button>("UpdateProfile").clicked += () => UpdateProfile();
musicSwitch = root.Q<CustomSwitch>("MusicSwitch");
sfxSwitch = root.Q<CustomSwitch>("SFXSwitch");
root.Q<CustomSwitch>("MusicSwitch").IsOn = SettingsCache.MusicEnabled;
root.Q<CustomSwitch>("SFXSwitch").IsOn = SettingsCache.SfxEnabled;
musicSwitch.IsOn = SettingsCache.MusicEnabled;
sfxSwitch.IsOn = SettingsCache.SfxEnabled;
root.Q<CustomSwitch>("MusicSwitch").onValueChanged += (value) => SettingsCache.MusicEnabled = value;
root.Q<CustomSwitch>("SFXSwitch").onValueChanged += (value) => SettingsCache.SfxEnabled = value;
musicSwitch.onValueChanged += (value) => SettingsCache.MusicEnabled = value;
sfxSwitch.onValueChanged += (value) => SettingsCache.SfxEnabled = value;
sure = profileDocument.rootVisualElement.Q<Button>("Sure");
sure.clicked += DeleteAccount;
profileDocument.rootVisualElement.Q<Button>("Sure").clicked += DeleteAccount;
UserService.Instance.OnUserChanged += OnUserChange;
OnUserChange(UserService.Instance.CurrentUser);
......@@ -57,39 +28,47 @@ public class ProfileController : MonoBehaviour
{
if (user == null) return;
name.text = user.Username;
UsernameLabel.value = user.Username;
Grade.value = EducationManager.GetGradeName(user.Grade);
Term.value = EducationManager.GetTermName(user.Term);
Curriculum.value = EducationManager.GetCurriculumName(user.Curriculum);
var root = profileDocument.rootVisualElement.Q("Settings");
root.Q<Label>("Username").text = user.Username;
root.Q<Label>("Email").text = user.Email;
root.Q<TextField>("Name").value = user.Username;
root.Q<DropdownField>("Grade").value = EducationManager.GetGradeName(user.Grade);
root.Q<DropdownField>("TermDrop").value = EducationManager.GetTermName(user.Term);
root.Q<DropdownField>("Curriculum").value = EducationManager.GetCurriculumName(user.Curriculum);
}
private async void UpdateProfile()
{
var root = profileDocument.rootVisualElement.Q("Settings");
var updateProfileButton = root.Q<Button>("UpdateProfile");
updateProfileButton.SetEnabled(false);
int gradeId = EducationManager.GetGradeId(Grade.value);
int termId = EducationManager.GetTermId(Term.value);
int curriculumId = EducationManager.GetCurriculumId(Curriculum.value);
var gradeValue = root.Q<DropdownField>("Grade").value;
var termValue = root.Q<DropdownField>("TermDrop").value;
var curriculumValue = root.Q<DropdownField>("Curriculum").value;
print("Updating profile with: " + UsernameLabel.value + ", Grade: " + gradeId + ", Term: " + termId);
int gradeId = EducationManager.GetGradeId(gradeValue);
int termId = EducationManager.GetTermId(termValue);
int curriculumId = EducationManager.GetCurriculumId(curriculumValue);
print("Updating profile with: " + root.Q<TextField>("Name").value + ", Grade: " + gradeId + ", Term: " + termId);
if (gradeId < 0 || termId < 0 || curriculumId < 0)
{
updateProfileButton.SetEnabled(true);
Debug.LogWarning("[Profile] Invalid grade or term selection");
return;
}
await UserService.Instance.UpdateProfile(
username: UsernameLabel.value,
username: root.Q<TextField>("Name").value,
grade: gradeId,
term: termId,
curriculum: curriculumId
);
updateProfileButton.SetEnabled(true);
ShowUIMessage.Instance.ShowMessage("تم تحديث البيانات بنجاح", false);
}
......@@ -102,9 +81,5 @@ public class ProfileController : MonoBehaviour
private void OnDestroy()
{
UserService.Instance.OnUserChanged -= OnUserChange;
logoutButton.clicked -= AppRouter.Logout;
updateProfileButton.clicked -= UpdateProfile;
}
}
......@@ -180,7 +180,7 @@ public class LoginPageAnimation : MonoBehaviour
if (PlayerPrefs.GetInt("IsGuest") == 0)
{
var Username = registerRoot.Q<TextField>("Username").text;
if (ShowErrorIfEmpty(Username, "اسم المستخدم"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(Username), "يرجي أدخال اسم المستخدم"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -188,7 +188,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var email = registerRoot.Q<TextField>("Email").text;
if (ShowErrorIfEmpty(email, "البريد الألكتروني"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(email), "يرجي أدخال البريد الألكتروني"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -196,7 +196,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var password = registerRoot.Q<TextField>("Password").text;
if (ShowErrorIfEmpty(password, "كلمة المرور"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(password), "يرجي أدخال كلمة المرور"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -204,45 +204,49 @@ public class LoginPageAnimation : MonoBehaviour
}
var rePassword = registerRoot.Q<TextField>("RePassword").text;
if (ShowErrorIfEmpty(rePassword, "تأكيد كلمة المرور"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(rePassword), "يرجي أدخال تأكيد كلمة المرور"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
return;
}
if(password != rePassword)
if (password != rePassword)
{
ShowUIMessage.Instance.ShowMessage("كلمة المرور غير متطابقة");
return;
}
var sex = registerRoot.Q<DropdownField>("Sex").value;
if (ShowErrorIfEmpty(sex, "النوع"))
var sexDropdownField = registerRoot.Q<DropdownField>("Sex");
var sex = sexDropdownField.value;
if (ShowErrorIfTrue(() => sexDropdownField.index == 0, "يرجي أدخال النوع"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
return;
}
var curriculum = registerRoot.Q<DropdownField>("Curriculum").value;
if (ShowErrorIfEmpty(curriculum, "المنهج"))
var currDropdownField = registerRoot.Q<DropdownField>("Curriculum");
var curriculum = currDropdownField.value;
if (ShowErrorIfTrue(() => currDropdownField.index == 0, "يرجي أدخال المنهج"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
return;
}
var term = registerRoot.Q<DropdownField>("Term").value;
if (ShowErrorIfEmpty(term, "المرحلة"))
var termDropdownField = registerRoot.Q<DropdownField>("Term");
var term = termDropdownField.value;
if (ShowErrorIfTrue(() => termDropdownField.index == 0, "يرجي أدخال المرحلة"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
return;
}
var grade = registerRoot.Q<DropdownField>("Grade").value;
if (ShowErrorIfEmpty(grade, "الصف"))
var gradeDropdownField = registerRoot.Q<DropdownField>("Grade");
var grade = gradeDropdownField.value;
if (ShowErrorIfTrue(() => gradeDropdownField.index == 0, "يرجي أدخال الصف"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -326,7 +330,7 @@ public class LoginPageAnimation : MonoBehaviour
{
var Username = registerRoot.Q<TextField>("Username").text;
if (ShowErrorIfEmpty(Username, "اسم المستخدم"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(Username), "يرجي أدخال اسم المستخدم"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -334,7 +338,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var sex = registerRoot.Q<DropdownField>("Sex").value;
if (ShowErrorIfEmpty(sex, "النوع"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(sex), "يرجي أدخال النوع"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -342,7 +346,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var curriculum = registerRoot.Q<DropdownField>("Curriculum").value;
if (ShowErrorIfEmpty(curriculum, "المنهج"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(curriculum), "يرجي أدخال المنهج"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -350,7 +354,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var term = registerRoot.Q<DropdownField>("Term").value;
if (ShowErrorIfEmpty(term, "المرحلة"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(term), "يرجي أدخال المرحلة"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -358,7 +362,7 @@ public class LoginPageAnimation : MonoBehaviour
}
var grade = registerRoot.Q<DropdownField>("Grade").value;
if (ShowErrorIfEmpty(grade, "الصف"))
if (ShowErrorIfTrue(() => string.IsNullOrEmpty(grade), "يرجي أدخال الصف"))
{
registerButton.SetEnabled(true);
registerButton.text = "تسجيل";
......@@ -410,14 +414,14 @@ public class LoginPageAnimation : MonoBehaviour
}
private bool ShowErrorIfEmpty(string content, string fieldName)
private bool ShowErrorIfTrue(Func<bool> condition, string errorMessage)
{
if (string.IsNullOrEmpty(content))
if (condition())
{
ShowUIMessage.Instance.ShowMessage($"يرجي أدخال {fieldName}");
ShowUIMessage.Instance.ShowMessage(errorMessage);
}
return string.IsNullOrEmpty(content);
return condition();
}
private void HandleForgetPasswordPanel()
......@@ -506,7 +510,7 @@ public class LoginPageAnimation : MonoBehaviour
return;
}
if(newPasswordField.text.Length < 6)
if (newPasswordField.text.Length < 6)
{
ShowUIMessage.Instance.ShowMessage("كلمة المرور يجب أن تكون 6 أحرف على الأقل");
return;
......
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UIElements;
......@@ -238,6 +237,13 @@ public class MainmenuAnimation : MonoBehaviour
openChallengePanel.clicked += () =>
{
// Don't allow anonymous users to access the challenge panel
if (SupabaseManager.Instance.Supabase().Auth.CurrentUser.IsAnonymous)
{
return;
}
challengePanel.style.display = DisplayStyle.Flex;
challengePanel.experimental.animation.Start(0, 1, 200, (v, t) =>
{
......
......@@ -261,13 +261,13 @@ MonoBehaviour:
_feedbackBg: {fileID: 6230069461127900939}
_timerFill: {fileID: 8270471139914111552}
_loadingText: {fileID: 1751919878724748659}
_errorText: {fileID: 4122106323195278334}
_resultTitle: {fileID: 8550221328754262388}
_resultScore: {fileID: 6936749377702287481}
_resultStats: {fileID: 7171110102599213074}
_countDownText: {fileID: 3204408586701157358}
_timerText: {fileID: 2314289485684795983}
_timerUpdateText: {fileID: 8731479965789433114}
_errorText: {fileID: 2178552260234958699}
_optionsContainer: {fileID: 5542623615299663718}
_restartButton: {fileID: 79392514635604134}
_returnToHomeButton: {fileID: 2926549481658228636}
......@@ -1151,7 +1151,7 @@ GameObject:
m_Component:
- component: {fileID: 8472510025336300182}
- component: {fileID: 2626825708328038760}
- component: {fileID: 4122106323195278334}
- component: {fileID: 2178552260234958699}
m_Layer: 0
m_Name: Txt
m_TagString: Untagged
......@@ -1186,7 +1186,7 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2729787420965937121}
m_CullTransparentMesh: 1
--- !u!114 &4122106323195278334
--- !u!114 &2178552260234958699
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -1195,9 +1195,9 @@ MonoBehaviour:
m_GameObject: {fileID: 2729787420965937121}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0e20cc1eab1d04e7c9515c000ca5ba22, type: 3}
m_Script: {fileID: 11500000, guid: beaa34cb0e58d624bb3a264b28600785, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::ALArcade.ArabicTMP.ArabicTextMeshProUGUI
m_EditorClassIdentifier: LightSide.UniText::LightSide.UniText
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
......@@ -1206,83 +1206,35 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\uFEA7\uFEC4\uFE84"
m_isRightToLeft: 1
m_fontAsset: {fileID: 11400000, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2}
m_sharedMaterial: {fileID: 2623560040057873289, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
m_ArabicText: "\u062E\u0637\u0623"
m_ShowTashkeel: 1
m_PreserveNumbers: 1
m_FixTags: 1
m_ForceRTL: 1
text:
fontStack: {fileID: 0}
appearance: {fileID: 0}
fontSize: 36
baseDirection: 2
wordWrap: 1
horizontalAlignment: 1
verticalAlignment: 1
overEdge: 0
underEdge: 0
leadingDistribution: 0
autoSize: 0
minFontSize: 10
maxFontSize: 72
modRegisters:
items: []
modRegisterConfigs:
items: []
highlighter:
rid: 5227943948359565493
references:
version: 2
RefIds:
- rid: 5227943948359565493
type: {class: DefaultTextHighlighter, ns: LightSide, asm: LightSide.UniText}
data:
clickColor: {r: 0.2, g: 0.5, b: 1, a: 0.6}
fadeDuration: 0.25
hoverColor: {r: 0.2, g: 0.5, b: 1, a: 0.1}
--- !u!1 &2745728593025828598
GameObject:
m_ObjectHideFlags: 0
......@@ -1410,10 +1362,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5599785267463442964
CanvasRenderer:
......@@ -1852,10 +1804,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5340325998096306428
CanvasRenderer:
......@@ -2871,10 +2823,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4280031676036218401
CanvasRenderer:
......@@ -3232,10 +3184,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3352223824432655738
CanvasRenderer:
......@@ -3509,10 +3461,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1868296225662172060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2582842219960060486
CanvasRenderer:
......
......@@ -588,7 +588,7 @@ MonoBehaviour:
overEdge: 0
underEdge: 0
leadingDistribution: 0
autoSize: 0
autoSize: 1
minFontSize: 10
maxFontSize: 72
modRegisters:
......@@ -1020,10 +1020,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5665338920870028329}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1367268893384981932
CanvasRenderer:
......@@ -1971,7 +1971,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster
m_IgnoreReversedGraphics: 1
m_IgnoreReversedGraphics: 0
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
......@@ -2321,7 +2321,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2126029859342928170
RectTransform:
m_ObjectHideFlags: 0
......@@ -2331,8 +2331,8 @@ RectTransform:
m_GameObject: {fileID: 4807635275847702964}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5625, y: 0.5625, z: 0.5625}
m_ConstrainProportionsScale: 0
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 37626301424459968}
m_Father: {fileID: 6025958000610179652}
......@@ -2340,7 +2340,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 840, y: 1493.3333}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1697728672160704455
CanvasRenderer:
......@@ -3351,10 +3351,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5665338920870028329}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6044436298841298018
CanvasRenderer:
......@@ -3441,10 +3441,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5665338920870028329}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7681831561278972478
CanvasRenderer:
......@@ -3903,10 +3903,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5665338920870028329}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8749602556167845090
CanvasRenderer:
......@@ -4068,10 +4068,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5665338920870028329}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
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_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_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8187631058268110602
CanvasRenderer:
......
......@@ -2386,11 +2386,11 @@ MonoBehaviour:
_streakText: {fileID: 3088443959907424236}
_scoreLbl: {fileID: 5924483057703210132}
_loadingText: {fileID: 7759164263249432265}
_errorText: {fileID: 2594165393456477704}
_progressLabel: {fileID: 7501656307173425929}
_resultTitle: {fileID: 3377821766872872317}
_resultScore: {fileID: 2058651398905202117}
_resultStats: {fileID: 2189195751882486028}
_errorText: {fileID: 1805088816235923994}
_feedbackText: {fileID: 2715045871399486055}
_feedbackBg: {fileID: 609508365388699558}
_restartButton: {fileID: 2142933248170327394}
......@@ -3535,7 +3535,7 @@ GameObject:
m_Component:
- component: {fileID: 2090849387953898811}
- component: {fileID: 3573761653700519801}
- component: {fileID: 2594165393456477704}
- component: {fileID: 1805088816235923994}
m_Layer: 0
m_Name: Txt
m_TagString: Untagged
......@@ -3560,7 +3560,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 600, y: 100}
m_SizeDelta: {x: 600, y: 225.9419}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3573761653700519801
CanvasRenderer:
......@@ -3570,7 +3570,7 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8205817321969538790}
m_CullTransparentMesh: 1
--- !u!114 &2594165393456477704
--- !u!114 &1805088816235923994
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -3579,9 +3579,9 @@ MonoBehaviour:
m_GameObject: {fileID: 8205817321969538790}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0e20cc1eab1d04e7c9515c000ca5ba22, type: 3}
m_Script: {fileID: 11500000, guid: beaa34cb0e58d624bb3a264b28600785, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::ALArcade.ArabicTMP.ArabicTextMeshProUGUI
m_EditorClassIdentifier: LightSide.UniText::LightSide.UniText
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
......@@ -3590,83 +3590,35 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\uFEA7\uFEC4\uFE84"
m_isRightToLeft: 1
m_fontAsset: {fileID: 11400000, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2}
m_sharedMaterial: {fileID: 2623560040057873289, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
m_ArabicText: "\u062E\u0637\u0623"
m_ShowTashkeel: 1
m_PreserveNumbers: 1
m_FixTags: 1
m_ForceRTL: 1
text:
fontStack: {fileID: 0}
appearance: {fileID: 0}
fontSize: 36
baseDirection: 2
wordWrap: 1
horizontalAlignment: 1
verticalAlignment: 1
overEdge: 0
underEdge: 0
leadingDistribution: 0
autoSize: 0
minFontSize: 10
maxFontSize: 72
modRegisters:
items: []
modRegisterConfigs:
items: []
highlighter:
rid: 5227943948359565962
references:
version: 2
RefIds:
- rid: 5227943948359565962
type: {class: DefaultTextHighlighter, ns: LightSide, asm: LightSide.UniText}
data:
clickColor: {r: 0.2, g: 0.5, b: 1, a: 0.6}
fadeDuration: 0.25
hoverColor: {r: 0.2, g: 0.5, b: 1, a: 0.1}
--- !u!1 &9048445354178813042
GameObject:
m_ObjectHideFlags: 0
......
......@@ -24,8 +24,8 @@ namespace com.al_arcade.cs
[SerializeField] protected UniText _feedbackText;
[SerializeField] protected Image _feedbackBg, _timerFill;
[SerializeField] protected ArabicTextMeshProUGUI _loadingText, _errorText;
[SerializeField] protected UniText _resultTitle, _resultScore, _resultStats, _countDownText, _timerText, _timerUpdateText;
[SerializeField] protected ArabicTextMeshProUGUI _loadingText;
[SerializeField] protected UniText _resultTitle, _resultScore, _resultStats, _countDownText, _timerText, _timerUpdateText, _errorText;
[SerializeField] protected Transform _optionsContainer;
[SerializeField] protected Button _restartButton;
......@@ -445,7 +445,7 @@ namespace com.al_arcade.cs
{ _loadingUI.DOFade(0f, 0.3f).OnComplete(() => _loadingUI.gameObject.SetActive(false)); }
public void ShowError(string msg)
{ _errorUI.gameObject.SetActive(true); if (_errorText != null) _errorText.arabicText = msg; _errorUI.DOFade(1f, 0.3f); }
{ _errorUI.gameObject.SetActive(true); if (_errorText != null) _errorText.Text = msg; _errorUI.DOFade(1f, 0.3f); }
public IEnumerator ShowCountDown()
{
......
......@@ -151,7 +151,7 @@ namespace com.al_arcade.shared
if (!HasValidQuestions() || error != null)
{
OnShowError(error ?? "لا توجد أسئلة");
OnShowError("فشل تحميل الأسئلة. الرجاء المحاولة مرة أخرى.");
yield break;
}
......@@ -220,7 +220,7 @@ namespace com.al_arcade.shared
protected void ResetBaseState()
{
StopAllCoroutines();
_score = _streak = _correctCount = _wrongCount = _currentIndex = _totalAsked =_bestStreak= 0;
_score = _streak = _correctCount = _wrongCount = _currentIndex = _totalAsked = _bestStreak = 0;
_timeLeft = 0f;
_timerRunning = false;
}
......
......@@ -306,7 +306,7 @@ namespace com.al_arcade.tf
protected override IEnumerator NoChallengeLoseSequence()
{
yield return new WaitForSeconds(1f);
uiManager?.ShowResults(_score, _correctCount, _wrongCount,_questions.Length, _bestStreak, false);
uiManager?.ShowResults(_score, _correctCount, _wrongCount, _questions.Length, _bestStreak, false);
onGameOver?.Invoke();
}
......@@ -328,7 +328,7 @@ namespace com.al_arcade.tf
protected override IEnumerator NoChallengeVictorySequence()
{
yield return new WaitForSeconds(1.5f);
uiManager?.ShowResults(_score, _correctCount, _wrongCount,_questions.Length ,_bestStreak);
uiManager?.ShowResults(_score, _correctCount, _wrongCount, _questions.Length, _bestStreak);
onGameComplete?.Invoke();
}
......
......@@ -16,9 +16,9 @@ namespace com.al_arcade.tf
[SerializeField] private Canvas _canvas;
[SerializeField] private CanvasGroup _gameUI, _loadingUI, _errorUI, _resultsUI, _feedbackGroup;
[SerializeField] private UniText _scoreText, _streakText, _scoreLbl;
[SerializeField] private ArabicTextMeshProUGUI _loadingText, _errorText;
[SerializeField] private ArabicTextMeshProUGUI _loadingText;
[SerializeField] private UniText _progressLabel;
[SerializeField] private UniText _resultTitle, _resultScore, _resultStats;
[SerializeField] private UniText _resultTitle, _resultScore, _resultStats, _errorText;
[SerializeField] private UniText _feedbackText;
[SerializeField] private Image _feedbackBg;
[SerializeField] private Button _restartButton;
......@@ -223,7 +223,7 @@ namespace com.al_arcade.tf
public void ShowError(string m)
{
_errorUI.gameObject.SetActive(true);
if (_errorText != null) _errorText.arabicText = m;
if (_errorText != null) _errorText.Text = m;
_errorUI.DOFade(1, 0.3f);
}
......@@ -350,11 +350,11 @@ namespace com.al_arcade.tf
go.AddComponent<Image>().color =
SSColorPalette.WithAlpha(SSColorPalette.Danger, 0.9f);
_errorText = MkTxt(go.transform, "Txt", "خطأ", 24,
new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(600, 90));
_errorText.alignment = TMPro.TextAlignmentOptions.Center;
_errorText.color = Color.white;
_errorText.enableWordWrapping = true;
// _errorText = MkTxt(go.transform, "Txt", "خطأ", 24,
// new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(600, 90));
// _errorText.alignment = TMPro.TextAlignmentOptions.Center;
// _errorText.color = Color.white;
// _errorText.enableWordWrapping = true;
}
private void BuildResultsPanel(Transform parent)
......
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