Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSBookMinigames
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
SSBookMinigames
Commits
27d95db0
Commit
27d95db0
authored
Apr 14, 2026
by
Abdulrahman Mohammed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Done with update profile message and scroll to owner rank
parent
f2151e2d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
11 deletions
+115
-11
AppRouter.cs
My project/Assets/App/Infrastructure/Core/AppRouter.cs
+5
-1
LeaderboardController.cs
My project/Assets/App/UI/LeaderboardController.cs
+25
-5
ProfileController.cs
My project/Assets/App/UI/ProfileController.cs
+17
-4
Mainmenu.uxml
My project/Assets/AppUI/NewAppUI/Mainmenu.uxml
+22
-1
Mainmenu.unity
My project/Assets/AppUI/NewAppUI/Scene/Mainmenu.unity
+46
-0
No files found.
My project/Assets/App/Infrastructure/Core/AppRouter.cs
View file @
27d95db0
...
...
@@ -236,9 +236,13 @@ public class AppRouter : MonoBehaviour
UserService
.
Instance
.
StartListening
();
}
public
static
async
void
Logout
()
public
static
async
void
Logout
(
UnityEngine
.
UIElements
.
Button
logoutButton
=
null
)
{
logoutButton
.
SetEnabled
(
false
);
CleanupSingletons
();
await
SupabaseAuthentication
.
Instance
.
LogOut
();
GoToLogin
();
}
...
...
My project/Assets/App/UI/LeaderboardController.cs
View file @
27d95db0
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Threading
;
using
Cysharp.Threading.Tasks
;
...
...
@@ -14,15 +14,33 @@ public class LeaderboardController : MonoBehaviour, IDisposable
private
CancellationTokenSource
_loadCts
;
public
int
CurrentPlayerSlotIndex
{
get
;
private
set
;
}
=
-
1
;
CustomLeaderboardSlot
currentPlayerSlot
;
ScrollView
leaderBoardScrollView
;
void
Start
()
{
root
=
leaderboardDocument
.
rootVisualElement
;
allPlayersContainer
=
root
.
Q
<
VisualElement
>(
"AllPlayerContainer"
);
leaderBoardScrollView
=
root
.
Q
<
ScrollView
>(
"Leaderboard"
);
UserService
.
Instance
.
OnUserChanged
+=
OnUserChanged
;
LoadLeaderboard
().
Forget
();
Button
myRankButton
=
root
.
Q
<
Button
>(
"MyRankButton"
);
myRankButton
.
clicked
+=
()
=>
{
if
(
currentPlayerSlot
==
null
)
{
ShowUIMessage
.
Instance
.
ShowMessage
(
"حسابك ليس من ضمن افضل 100 لاعب"
);
}
else
{
leaderBoardScrollView
.
experimental
.
animation
.
Start
(
leaderBoardScrollView
.
scrollOffset
.
y
,
currentPlayerSlot
.
layout
.
y
,
300
,
(
v
,
t
)
=>
{
leaderBoardScrollView
.
scrollOffset
=
new
Vector2
(
leaderBoardScrollView
.
scrollOffset
.
x
,
t
);
});
}
};
}
private
void
OnUserChanged
(
object
user
)
...
...
@@ -59,7 +77,7 @@ public class LeaderboardController : MonoBehaviour, IDisposable
result
.
Switch
(
(
List
<
LeaderboardPlayerModel
>
players
)
=>
{
CurrentPlayerSlotIndex
=
-
1
;
currentPlayerSlot
=
null
;
for
(
int
i
=
0
;
i
<
players
.
Count
;
i
++)
{
...
...
@@ -69,8 +87,7 @@ public class LeaderboardController : MonoBehaviour, IDisposable
var
player
=
players
[
i
];
var
isOwner
=
player
.
Id
==
UserService
.
Instance
.
CurrentUser
?.
Id
;
if
(
isOwner
)
CurrentPlayerSlotIndex
=
i
;
var
entry
=
new
CustomLeaderboardSlot
{
...
...
@@ -81,6 +98,9 @@ public class LeaderboardController : MonoBehaviour, IDisposable
IsOwner
=
isOwner
};
if
(
isOwner
)
currentPlayerSlot
=
entry
;
allPlayersContainer
.
Add
(
entry
);
}
},
...
...
My project/Assets/App/UI/ProfileController.cs
View file @
27d95db0
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UIElements
;
public
class
ProfileController
:
MonoBehaviour
...
...
@@ -24,10 +24,16 @@ public class ProfileController : MonoBehaviour
var
root
=
profileDocument
.
rootVisualElement
.
Q
(
"Settings"
);
name
=
root
.
Q
<
Label
>(
"Username"
);
logoutButton
=
root
.
Q
<
Button
>(
"LogoutButton"
);
logoutButton
.
clicked
+=
AppRouter
.
Logout
;
logoutButton
.
clicked
+=
()
=>
{
AppRouter
.
Logout
(
logoutButton
);
};
updateProfileButton
=
root
.
Q
<
Button
>(
"UpdateProfile"
);
updateProfileButton
.
clicked
+=
UpdateProfile
;
updateProfileButton
.
clicked
+=
()
=>
{
UpdateProfile
();
};
UsernameLabel
=
root
.
Q
<
TextField
>(
"Name"
);
Grade
=
root
.
Q
<
DropdownField
>(
"Grade"
);
...
...
@@ -63,6 +69,8 @@ public class ProfileController : MonoBehaviour
private
async
void
UpdateProfile
()
{
updateProfileButton
.
SetEnabled
(
false
);
int
gradeId
=
EducationManager
.
GetGradeId
(
Grade
.
value
);
int
termId
=
EducationManager
.
GetTermId
(
Term
.
value
);
int
curriculumId
=
EducationManager
.
GetCurriculumId
(
Curriculum
.
value
);
...
...
@@ -72,6 +80,8 @@ public class ProfileController : MonoBehaviour
if
(
gradeId
<
0
||
termId
<
0
||
curriculumId
<
0
)
{
updateProfileButton
.
SetEnabled
(
true
);
Debug
.
LogWarning
(
"[Profile] Invalid grade or term selection"
);
return
;
}
...
...
@@ -81,7 +91,10 @@ public class ProfileController : MonoBehaviour
grade
:
gradeId
,
term
:
termId
,
curriculum
:
curriculumId
);
updateProfileButton
.
SetEnabled
(
true
);
ShowUIMessage
.
Instance
.
ShowMessage
(
"تم تحديث البيانات بنجاح"
,
false
);
}
private
async
void
DeleteAccount
()
...
...
@@ -92,7 +105,7 @@ public class ProfileController : MonoBehaviour
private
void
OnDestroy
()
{
UserService
.
Instance
.
OnUserChanged
-=
OnUserChange
;
logoutButton
.
clicked
-=
AppRouter
.
Logout
;
logoutButton
.
clicked
-=
()
=>
{
AppRouter
.
Logout
(
logoutButton
);
}
;
updateProfileButton
.
clicked
-=
UpdateProfile
;
}
...
...
My project/Assets/AppUI/NewAppUI/Mainmenu.uxml
View file @
27d95db0
<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/AppUI/NewAppUI/USS/NewStyle.uss?fileID=7433441132597879392&guid=c81297485ce529246b88d7955e887342&type=3"/>
<Style src="project://database/Assets/AppUI/NewAppUI/USS/NewStyle.uss?fileID=7433441132597879392&guid=c81297485ce529246b88d7955e887342&type=3
#NewStyle
"/>
<ui:VisualElement name="Parent" style="flex-grow: 1;">
<ui:VisualElement name="Root" style="flex-grow: 1; background-color: rgb(238, 240, 248); display: flex;">
<ui:VisualElement name="Body" style="flex-grow: 0; width: 300%; flex-direction: row; translate: -33.333% 0; height: 90%; transition-duration: 0.15s; transition-timing-function: ease;">
...
...
@@ -352,6 +352,9 @@
</ui:VisualElement>
</ui:ScrollView>
<ui:VisualElement name="Fade" style="flex-grow: 0; background-image: url("project://database/Assets/AppUI/Image/Transp4.png?fileID=2800000&guid=9046ff72a71cb9f42bd69f32d5cc9a45&type=3#Transp4"); position: absolute; bottom: auto; width: 98%; height: 150px; -unity-background-image-tint-color: rgb(238, 240, 248); rotate: 180deg; top: 30%; border-bottom-right-radius: 100px; border-bottom-left-radius: 100px; align-self: center;"/>
<ui:Button text="" name="MyRankButton" class="edit-photo" style="width: 120px; height: 120px; display: flex; right: auto; bottom: auto; top: 30%; align-self: center; translate: 0% -50%; background-color: rgb(245, 3, 45);">
<ui:Label text="➜" class="emoji" style="font-size: 63px; translate: 0% 0; background-image: none; height: 50px; width: auto; aspect-ratio: 1; -unity-background-image-tint-color: rgb(255, 255, 255); color: rgb(255, 255, 255); rotate: 90deg;"/>
</ui:Button>
<ui:VisualElement name="Fade" style="flex-grow: 0; background-image: url("project://database/Assets/AppUI/Image/Transp4.png?fileID=2800000&guid=9046ff72a71cb9f42bd69f32d5cc9a45&type=3#Transp4"); position: absolute; bottom: 0; width: 100%; height: 100px; -unity-background-image-tint-color: rgb(238, 240, 248);"/>
</ui:VisualElement>
</ui:VisualElement>
...
...
@@ -438,4 +441,22 @@
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="MessagePanel" style="flex-grow: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.75); position: absolute; display: none; opacity: 0; align-items: center; justify-content: center;">
<ui:VisualElement name="Menu" class="padding" style="flex-grow: 0; background-color: rgb(255, 255, 255); height: auto; flex-shrink: 10; border-top-width: 0; border-right-width: 0; border-bottom-width: 7px; border-left-width: 0; border-top-left-radius: 50px; border-top-right-radius: 50px; border-bottom-right-radius: 50px; border-bottom-left-radius: 50px; padding-top: 50px; padding-right: 50px; padding-bottom: 50px; padding-left: 50px; justify-content: space-between; border-left-color: rgba(0, 0, 0, 0.25); border-right-color: rgba(0, 0, 0, 0.25); border-top-color: rgba(0, 0, 0, 0.25); border-bottom-color: rgba(0, 0, 0, 0.25); display: flex; width: 80%;">
<ui:Label text="يرجي التسجيل" name="MessageLabel" class="text-bold-black" style="color: rgb(66, 66, 66); align-self: center; font-size: 49px; white-space: pre-wrap; -unity-text-align: middle-center;"/>
<ui:VisualElement name="Line" style="flex-grow: 0; width: 100%; background-color: rgba(0, 0, 0, 0.1); height: 2px; margin-top: 25px; margin-bottom: 25px;"/>
<ui:VisualElement style="flex-grow: 1; flex-direction: row-reverse;">
<ui:VisualElement name="BackToHome" style="flex-grow: 1; flex-direction: row-reverse; justify-content: space-around; display: none;">
<ui:VisualElement name="Parent" style="width: 250px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; justify-content: center; display: flex;">
<ui:Button text="تسجيل" name="BackToHomeButton" language-direction="RTL" class="action-btn" style="background-color: rgb(0, 137, 107); color: rgb(255, 255, 255); -unity-font-definition: url("project://database/Assets/ALArcade/Hakwaty%20Font/TSHakwaty-ExtraBold.otf?fileID=12800000&guid=9edc60294a97d7f4e87aee01d4e4d689&type=3#TSHakwaty-ExtraBold"); font-size: 55px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; height: 140px; -unity-text-generator: advanced; display: flex;"/>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="Buttons" style="flex-grow: 1; flex-direction: row-reverse; justify-content: space-around;">
<ui:VisualElement name="Button" style="width: 250px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; justify-content: center;">
<ui:Button text="الغاء" name="CloseMessagePanelButton" language-direction="RTL" class="action-btn" style="background-color: rgb(245, 3, 45); color: rgb(255, 255, 255); -unity-font-definition: url("project://database/Assets/ALArcade/Hakwaty%20Font/TSHakwaty-ExtraBold.otf?fileID=12800000&guid=9edc60294a97d7f4e87aee01d4e4d689&type=3#TSHakwaty-ExtraBold"); font-size: 55px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; height: 140px; -unity-text-generator: advanced;"/>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
My project/Assets/AppUI/NewAppUI/Scene/Mainmenu.unity
View file @
27d95db0
...
...
@@ -534,6 +534,7 @@ Transform:
-
{
fileID
:
1154832527
}
-
{
fileID
:
373486799
}
-
{
fileID
:
1008654135
}
-
{
fileID
:
757936571
}
m_Father
:
{
fileID
:
2035341440
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&659928730
...
...
@@ -569,6 +570,51 @@ Transform:
-
{
fileID
:
1455761155
}
m_Father
:
{
fileID
:
2035341440
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&757936570
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
757936571
}
-
component
:
{
fileID
:
757936572
}
m_Layer
:
0
m_Name
:
_showUIMessage
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&757936571
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
757936570
}
serializedVersion
:
2
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
652396694
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&757936572
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
757936570
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
42d332574029f664b90d64379d0bea9b
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
Assembly-CSharp::ShowUIMessage
UIDocument
:
{
fileID
:
1455761156
}
---
!u!1
&803660554
GameObject
:
m_ObjectHideFlags
:
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment