Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赤子奈落
MDPro3
Commits
6cb91510
Commit
6cb91510
authored
Mar 09, 2026
by
Senator John
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch' into 'master'
Patch See merge request
!29
parents
29f844aa
4fa42886
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
211 additions
and
78 deletions
+211
-78
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
+24
-8
Assets/Scripts/MDPro3/UI/Function/UserProfile.cs
Assets/Scripts/MDPro3/UI/Function/UserProfile.cs
+52
-16
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionButton_DeckSelector.cs
...MDPro3/UI/SelectionButton/SelectionButton_DeckSelector.cs
+85
-36
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionInputField.cs
.../Scripts/MDPro3/UI/SelectionButton/SelectionInputField.cs
+18
-16
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionToggle_Watch.cs
...cripts/MDPro3/UI/SelectionButton/SelectionToggle_Watch.cs
+32
-2
No files found.
Assets/Scripts/MDPro3/Servant/OnlineServant.cs
View file @
6cb91510
...
@@ -235,26 +235,42 @@ namespace MDPro3.Servant
...
@@ -235,26 +235,42 @@ namespace MDPro3.Servant
private
IEnumerator
RefreshMyCardAssets
()
private
IEnumerator
RefreshMyCardAssets
()
{
{
var
onlineUI
=
GetUI
<
OnlineServantUI
>();
if
(
onlineUI
==
null
||
onlineUI
.
PageMyCard
==
null
||
onlineUI
.
PageMyCard
.
UserProfile
==
null
)
yield
break
;
var
userProfile
=
onlineUI
.
PageMyCard
.
UserProfile
;
var
task
=
MyCard
.
GetExp
();
var
task
=
MyCard
.
GetExp
();
while
(!
task
.
IsCompleted
)
while
(!
task
.
IsCompleted
)
yield
return
null
;
yield
return
null
;
GetUI
<
OnlineServantUI
>().
PageMyCard
.
UserProfile
.
SetProfile
(
task
.
Result
);
MyCardUserExp
expData
=
null
;
if
(!
task
.
IsCanceled
&&
task
.
Exception
==
null
)
expData
=
task
.
Result
;
userProfile
.
SetProfile
(
expData
);
while
(!
Appearance
.
loaded
)
while
(!
Appearance
.
loaded
)
yield
return
null
;
yield
return
null
;
GetUI
<
OnlineServantUI
>().
PageMyCard
.
UserProfile
.
Avatar
.
material
=
Appearance
.
duelFrameMat0
;
if
(
userProfile
.
Avatar
!=
null
)
userProfile
.
Avatar
.
material
=
Appearance
.
duelFrameMat0
;
if
(
MyCard
.
avatar
==
null
)
if
(
MyCard
.
avatar
==
null
)
{
{
var
avatarTask
=
Tools
.
DownloadImageAsync
(
MyCard
.
account
.
user
.
avatar
);
var
avatarAddress
=
MyCard
.
account
?.
user
?.
avatar
;
while
(!
avatarTask
.
IsCompleted
)
if
(!
string
.
IsNullOrEmpty
(
avatarAddress
))
yield
return
null
;
{
MyCard
.
avatar
=
avatarTask
.
Result
;
var
avatarTask
=
Tools
.
DownloadImageAsync
(
avatarAddress
);
GetUI
<
OnlineServantUI
>().
PageMyCard
.
UserProfile
.
Avatar
.
texture
=
MyCard
.
avatar
;
while
(!
avatarTask
.
IsCompleted
)
yield
return
null
;
MyCard
.
avatar
=
avatarTask
.
Result
;
}
}
}
GetUI
<
OnlineServantUI
>().
PageMyCard
.
ActivePageFunction
();
if
(
userProfile
.
Avatar
!=
null
&&
MyCard
.
avatar
!=
null
)
userProfile
.
Avatar
.
texture
=
MyCard
.
avatar
;
onlineUI
.
PageMyCard
.
ActivePageFunction
();
}
}
private
void
RefreshDeckSelector
()
private
void
RefreshDeckSelector
()
...
...
Assets/Scripts/MDPro3/UI/Function/UserProfile.cs
View file @
6cb91510
...
@@ -111,22 +111,58 @@ namespace MDPro3.UI
...
@@ -111,22 +111,58 @@ namespace MDPro3.UI
public
void
SetProfile
(
MyCardUserExp
data
)
public
void
SetProfile
(
MyCardUserExp
data
)
{
{
TextUserName
.
text
=
MyCard
.
account
.
user
.
name
;
if
(
data
==
null
)
return
;
TextExpValue
.
text
=
data
.
exp
.
ToString
();
TextDPValue
.
text
=
data
.
pt
.
ToString
();
var
userInfo
=
MyCard
.
account
?.
user
;
TextAthleticWinValue
.
text
=
data
.
athletic_win
.
ToString
();
var
userName
=
userInfo
?.
name
;
TextAthleticWinRatioValue
.
text
=
data
.
athletic_wl_ratio
+
"%"
;
if
(
string
.
IsNullOrEmpty
(
userName
))
TextAthleticRankValue
.
text
=
data
.
arena_rank
.
ToString
();
userName
=
userInfo
?.
username
??
string
.
Empty
;
TextEntertainCountValue
.
text
=
data
.
entertain_all
.
ToString
();
TextEntertainRankValue
.
text
=
data
.
exp_rank
.
ToString
();
var
textUserName
=
TextUserName
;
if
(
textUserName
!=
null
)
var
rankSprites
=
TextureManager
.
container
.
GetRankSprites
(
data
.
pt
);
textUserName
.
text
=
userName
;
IconBG
.
sprite
=
rankSprites
[
0
];
var
textExpValue
=
TextExpValue
;
IconRank
.
sprite
=
rankSprites
[
1
];
if
(
textExpValue
!=
null
)
IconTier1
.
sprite
=
rankSprites
[
2
];
textExpValue
.
text
=
data
.
exp
.
ToString
();
IconTier2
.
sprite
=
rankSprites
[
3
];
var
textDPValue
=
TextDPValue
;
IconTier3
.
sprite
=
rankSprites
[
4
];
if
(
textDPValue
!=
null
)
textDPValue
.
text
=
data
.
pt
.
ToString
();
var
textAthleticWinValue
=
TextAthleticWinValue
;
if
(
textAthleticWinValue
!=
null
)
textAthleticWinValue
.
text
=
data
.
athletic_win
.
ToString
();
var
textAthleticWinRatioValue
=
TextAthleticWinRatioValue
;
if
(
textAthleticWinRatioValue
!=
null
)
textAthleticWinRatioValue
.
text
=
data
.
athletic_wl_ratio
+
"%"
;
var
textAthleticRankValue
=
TextAthleticRankValue
;
if
(
textAthleticRankValue
!=
null
)
textAthleticRankValue
.
text
=
data
.
arena_rank
.
ToString
();
var
textEntertainCountValue
=
TextEntertainCountValue
;
if
(
textEntertainCountValue
!=
null
)
textEntertainCountValue
.
text
=
data
.
entertain_all
.
ToString
();
var
textEntertainRankValue
=
TextEntertainRankValue
;
if
(
textEntertainRankValue
!=
null
)
textEntertainRankValue
.
text
=
data
.
exp_rank
.
ToString
();
var
rankSprites
=
TextureManager
.
container
?.
GetRankSprites
(
data
.
pt
);
if
(
rankSprites
==
null
||
rankSprites
.
Count
<
5
)
return
;
var
iconBG
=
IconBG
;
if
(
iconBG
!=
null
)
iconBG
.
sprite
=
rankSprites
[
0
];
var
iconRank
=
IconRank
;
if
(
iconRank
!=
null
)
iconRank
.
sprite
=
rankSprites
[
1
];
var
iconTier1
=
IconTier1
;
if
(
iconTier1
!=
null
)
iconTier1
.
sprite
=
rankSprites
[
2
];
var
iconTier2
=
IconTier2
;
if
(
iconTier2
!=
null
)
iconTier2
.
sprite
=
rankSprites
[
3
];
var
iconTier3
=
IconTier3
;
if
(
iconTier3
!=
null
)
iconTier3
.
sprite
=
rankSprites
[
4
];
}
}
}
}
}
}
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionButton_DeckSelector.cs
View file @
6cb91510
...
@@ -2,6 +2,7 @@ using Cysharp.Threading.Tasks;
...
@@ -2,6 +2,7 @@ using Cysharp.Threading.Tasks;
using
DG.Tweening
;
using
DG.Tweening
;
using
MDPro3.Duel.YGOSharp
;
using
MDPro3.Duel.YGOSharp
;
using
MDPro3.Utility
;
using
MDPro3.Utility
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
...
@@ -101,8 +102,7 @@ namespace MDPro3.UI
...
@@ -101,8 +102,7 @@ namespace MDPro3.UI
protected
override
void
OnDisable
()
protected
override
void
OnDisable
()
{
{
base
.
OnDisable
();
base
.
OnDisable
();
cts
?.
Cancel
();
DisposeRefreshCts
();
cts
?.
Dispose
();
}
}
public
void
SetConfigDeck
(
string
hint
)
public
void
SetConfigDeck
(
string
hint
)
...
@@ -147,55 +147,104 @@ namespace MDPro3.UI
...
@@ -147,55 +147,104 @@ namespace MDPro3.UI
{
{
refreshed
=
false
;
refreshed
=
false
;
cts
=
new
();
DisposeRefreshCts
();
await
UniTask
.
WaitUntil
(()
=>
Items
.
initialized
,
cancellationToken
:
cts
.
Token
);
var
refreshCts
=
new
CancellationTokenSource
();
await
UniTask
.
WaitWhile
(()
=>
TextureManager
.
container
==
null
,
cancellationToken
:
cts
.
Token
);
cts
=
refreshCts
;
var
token
=
refreshCts
.
Token
;
ImageDeck
.
color
=
Color
.
clear
;
try
ImageCard0
.
color
=
Color
.
clear
;
ImageCard1
.
color
=
Color
.
clear
;
ImageCard2
.
color
=
Color
.
clear
;
ImageDeck
.
sprite
=
await
Program
.
items
.
LoadDeckCaseIconAsync
(
deckCase
,
"_L_SD"
);
ImageDeck
.
color
=
Color
.
white
;
if
(
card0
==
0
)
{
{
ImageCard0
.
texture
=
null
;
await
UniTask
.
WaitUntil
(()
=>
Items
.
initialized
,
cancellationToken
:
token
);
ImageCard0
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
cts
.
Token
);
await
UniTask
.
WaitWhile
(()
=>
TextureManager
.
container
==
null
,
cancellationToken
:
token
);
ImageDeck
.
color
=
Color
.
clear
;
ImageCard0
.
color
=
Color
.
clear
;
ImageCard1
.
color
=
Color
.
clear
;
ImageCard2
.
color
=
Color
.
clear
;
ImageDeck
.
sprite
=
await
Program
.
items
.
LoadDeckCaseIconAsync
(
deckCase
,
"_L_SD"
);
ImageDeck
.
color
=
Color
.
white
;
if
(
card0
==
0
)
{
ImageCard0
.
texture
=
null
;
ImageCard0
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
token
);
}
else
{
ImageCard0
.
material
=
MaterialLoader
.
GetCardMaterial
(
card0
);
ImageCard0
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card0
,
true
);
}
ImageCard0
.
color
=
Color
.
white
;
if
(
card1
==
0
)
{
ImageCard1
.
texture
=
null
;
ImageCard1
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
token
);
}
else
{
ImageCard1
.
material
=
MaterialLoader
.
GetCardMaterial
(
card1
);
ImageCard1
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card1
,
true
);
}
ImageCard1
.
color
=
Color
.
white
;
if
(
card2
==
0
)
{
ImageCard2
.
texture
=
null
;
ImageCard2
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
token
);
}
else
{
ImageCard2
.
material
=
MaterialLoader
.
GetCardMaterial
(
card2
);
ImageCard2
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card2
,
true
);
}
ImageCard2
.
color
=
Color
.
white
;
refreshed
=
true
;
}
}
else
catch
(
OperationCanceledException
)
{
{
ImageCard0
.
material
=
MaterialLoader
.
GetCardMaterial
(
card0
);
ImageCard0
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card0
,
true
);
}
}
ImageCard0
.
color
=
Color
.
white
;
finally
{
if
(
ReferenceEquals
(
cts
,
refreshCts
))
{
cts
=
null
;
try
{
refreshCts
.
Dispose
();
}
catch
(
ObjectDisposedException
)
{
}
}
}
}
if
(
card1
==
0
)
private
void
DisposeRefreshCts
()
{
var
refreshCts
=
cts
;
if
(
refreshCts
==
null
)
return
;
cts
=
null
;
try
{
{
ImageCard1
.
texture
=
null
;
refreshCts
.
Cancel
();
ImageCard1
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
cts
.
Token
);
}
}
else
catch
(
ObjectDisposedException
)
{
{
ImageCard1
.
material
=
MaterialLoader
.
GetCardMaterial
(
card1
);
ImageCard1
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card1
,
true
);
}
}
ImageCard1
.
color
=
Color
.
white
;
if
(
card2
==
0
)
try
{
{
ImageCard2
.
texture
=
null
;
refreshCts
.
Dispose
();
ImageCard2
.
material
=
await
ABLoader
.
LoadProtectorMaterial
(
protector
.
ToString
(),
cts
.
Token
);
}
}
else
catch
(
ObjectDisposedException
)
{
{
ImageCard2
.
material
=
MaterialLoader
.
GetCardMaterial
(
card2
);
ImageCard2
.
texture
=
await
CardImageLoader
.
LoadCardAsync
(
card2
,
true
);
}
}
ImageCard2
.
color
=
Color
.
white
;
refreshed
=
true
;
}
}
protected
override
void
CallHoverOnEvent
()
protected
override
void
CallHoverOnEvent
()
...
...
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionInputField.cs
View file @
6cb91510
...
@@ -65,10 +65,7 @@ namespace MDPro3.UI
...
@@ -65,10 +65,7 @@ namespace MDPro3.UI
{
{
if
(
InputField
.
isFocused
)
if
(
InputField
.
isFocused
)
{
{
if
(
int
.
TryParse
(
InputField
.
text
,
out
int
num
))
TryAdjustFocusedIntegerValue
(
upNum
);
{
InputField
.
text
=
(
num
+
upNum
).
ToString
();
}
return
;
return
;
}
}
else
if
(
navigationEvent
.
onUpNavigation
.
GetPersistentEventCount
()
>
0
)
else
if
(
navigationEvent
.
onUpNavigation
.
GetPersistentEventCount
()
>
0
)
...
@@ -81,10 +78,7 @@ namespace MDPro3.UI
...
@@ -81,10 +78,7 @@ namespace MDPro3.UI
{
{
if
(
InputField
.
isFocused
)
if
(
InputField
.
isFocused
)
{
{
if
(
int
.
TryParse
(
InputField
.
text
,
out
int
num
))
TryAdjustFocusedIntegerValue
(-
upNum
);
{
InputField
.
text
=
(
num
-
upNum
).
ToString
();
}
return
;
return
;
}
}
else
if
(
navigationEvent
.
onDownNavigation
.
GetPersistentEventCount
()
>
0
)
else
if
(
navigationEvent
.
onDownNavigation
.
GetPersistentEventCount
()
>
0
)
...
@@ -97,10 +91,7 @@ namespace MDPro3.UI
...
@@ -97,10 +91,7 @@ namespace MDPro3.UI
{
{
if
(
InputField
.
isFocused
)
if
(
InputField
.
isFocused
)
{
{
if
(
int
.
TryParse
(
InputField
.
text
,
out
int
num
))
TryAdjustFocusedIntegerValue
(-
rightNum
);
{
InputField
.
text
=
(
num
-
rightNum
).
ToString
();
}
return
;
return
;
}
}
else
if
(
navigationEvent
.
onLeftNavigation
.
GetPersistentEventCount
()
>
0
)
else
if
(
navigationEvent
.
onLeftNavigation
.
GetPersistentEventCount
()
>
0
)
...
@@ -113,10 +104,7 @@ namespace MDPro3.UI
...
@@ -113,10 +104,7 @@ namespace MDPro3.UI
{
{
if
(
InputField
.
isFocused
)
if
(
InputField
.
isFocused
)
{
{
if
(
int
.
TryParse
(
InputField
.
text
,
out
int
num
))
TryAdjustFocusedIntegerValue
(
rightNum
);
{
InputField
.
text
=
(
num
+
rightNum
).
ToString
();
}
return
;
return
;
}
}
else
if
(
navigationEvent
.
onRightNavigation
.
GetPersistentEventCount
()
>
0
)
else
if
(
navigationEvent
.
onRightNavigation
.
GetPersistentEventCount
()
>
0
)
...
@@ -128,5 +116,19 @@ namespace MDPro3.UI
...
@@ -128,5 +116,19 @@ namespace MDPro3.UI
base
.
OnNavigation
(
eventData
);
base
.
OnNavigation
(
eventData
);
}
}
private
void
TryAdjustFocusedIntegerValue
(
int
delta
)
{
if
(!
AllowArrowAdjustForFocusedInput
())
return
;
if
(
int
.
TryParse
(
InputField
.
text
,
out
int
num
))
InputField
.
text
=
(
num
+
delta
).
ToString
();
}
private
bool
AllowArrowAdjustForFocusedInput
()
{
return
InputField
.
contentType
==
TMP_InputField
.
ContentType
.
IntegerNumber
||
InputField
.
characterValidation
==
TMP_InputField
.
CharacterValidation
.
Integer
;
}
}
}
}
}
Assets/Scripts/MDPro3/UI/SelectionButton/SelectionToggle_Watch.cs
View file @
6cb91510
...
@@ -3,6 +3,8 @@ using TMPro;
...
@@ -3,6 +3,8 @@ using TMPro;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.UI
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Text
;
using
UnityEngine.EventSystems
;
using
UnityEngine.EventSystems
;
using
MDPro3.Servant
;
using
MDPro3.Servant
;
using
MDPro3.UI.ServantUI
;
using
MDPro3.UI.ServantUI
;
...
@@ -25,8 +27,36 @@ namespace MDPro3.UI
...
@@ -25,8 +27,36 @@ namespace MDPro3.UI
{
{
base
.
Refresh
();
base
.
Refresh
();
Manager
.
GetElement
<
TextMeshProUGUI
>(
"Player0Name"
).
text
=
player0Name
;
var
player0Label
=
Manager
.
GetElement
<
TextMeshProUGUI
>(
"Player0Name"
);
Manager
.
GetElement
<
TextMeshProUGUI
>(
"Player1Name"
).
text
=
player1Name
;
var
player1Label
=
Manager
.
GetElement
<
TextMeshProUGUI
>(
"Player1Name"
);
if
(
player0Label
!=
null
)
player0Label
.
text
=
GetSafeDisplayName
(
player0Name
,
player0Label
);
if
(
player1Label
!=
null
)
player1Label
.
text
=
GetSafeDisplayName
(
player1Name
,
player1Label
);
}
private
static
string
GetSafeDisplayName
(
string
name
,
TextMeshProUGUI
label
)
{
if
(
string
.
IsNullOrEmpty
(
name
))
return
string
.
Empty
;
if
(
label
==
null
||
label
.
font
==
null
)
return
name
;
if
(
label
.
font
.
HasCharacters
(
name
,
out
uint
[]
missingCharacters
,
true
,
true
))
return
name
;
if
(
missingCharacters
==
null
||
missingCharacters
.
Length
==
0
)
return
name
;
var
missingSet
=
new
HashSet
<
uint
>(
missingCharacters
);
var
builder
=
new
StringBuilder
(
name
.
Length
);
for
(
int
i
=
0
;
i
<
name
.
Length
;
i
++)
{
var
code
=
name
[
i
];
builder
.
Append
(
missingSet
.
Contains
(
code
)
?
'?'
:
name
[
i
]);
}
return
builder
.
ToString
();
}
}
protected
override
async
UniTask
RefreshAsync
()
protected
override
async
UniTask
RefreshAsync
()
...
...
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