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
7c15b217
Commit
7c15b217
authored
Mar 14, 2026
by
Senator John
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch' into 'master'
Refactor Trash Button function See merge request
sherry_chaos/MDPro3!38
parents
7a0e5cb0
f320ee58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
175 deletions
+181
-175
Assets/Prefabs/ScriptableObjects/TextureContainer.asset
Assets/Prefabs/ScriptableObjects/TextureContainer.asset
+3
-0
Assets/Prefabs/ServantUI/OcgCoreUI.prefab
Assets/Prefabs/ServantUI/OcgCoreUI.prefab
+9
-9
Assets/Scripts/MDPro3/Duel/CardList.cs
Assets/Scripts/MDPro3/Duel/CardList.cs
+166
-166
Assets/Scripts/MDPro3/ScriptableObjects/TextureContainer.cs
Assets/Scripts/MDPro3/ScriptableObjects/TextureContainer.cs
+3
-0
No files found.
Assets/Prefabs/ScriptableObjects/TextureContainer.asset
View file @
7c15b217
...
@@ -397,6 +397,9 @@ MonoBehaviour:
...
@@ -397,6 +397,9 @@ MonoBehaviour:
chainNumSet7
:
{
fileID
:
21300000
,
guid
:
5a4b900ee24dc5546861d48ce2e42150
,
type
:
3
}
chainNumSet7
:
{
fileID
:
21300000
,
guid
:
5a4b900ee24dc5546861d48ce2e42150
,
type
:
3
}
chainNumSet8
:
{
fileID
:
21300000
,
guid
:
0ac64bc140f9d204886aed6f0dcf8eeb
,
type
:
3
}
chainNumSet8
:
{
fileID
:
21300000
,
guid
:
0ac64bc140f9d204886aed6f0dcf8eeb
,
type
:
3
}
chainNumSet9
:
{
fileID
:
21300000
,
guid
:
1514e0f4855cc744587659ea7eb86465
,
type
:
3
}
chainNumSet9
:
{
fileID
:
21300000
,
guid
:
1514e0f4855cc744587659ea7eb86465
,
type
:
3
}
duelCardSelectionListFrame
:
{
fileID
:
21300000
,
guid
:
7b65c898a762940478e77cdb545bac45
,
type
:
3
}
duelCardSelectionListViewIconHorizontal
:
{
fileID
:
21300000
,
guid
:
5a5bd2c00c42fe440a5f3d62fade6359
,
type
:
3
}
duelCardSelectionListViewIconVertical
:
{
fileID
:
21300000
,
guid
:
1a70faaead076664786c1564bcce5b79
,
type
:
3
}
toggleM
:
{
fileID
:
21300000
,
guid
:
b4b6f990bf52e9e41a3157d2c0701a28
,
type
:
3
}
toggleM
:
{
fileID
:
21300000
,
guid
:
b4b6f990bf52e9e41a3157d2c0701a28
,
type
:
3
}
toggleM_On
:
{
fileID
:
21300000
,
guid
:
77342bb8b8bac73418a111be27a694e5
,
type
:
3
}
toggleM_On
:
{
fileID
:
21300000
,
guid
:
77342bb8b8bac73418a111be27a694e5
,
type
:
3
}
toggleM_Over
:
{
fileID
:
21300000
,
guid
:
03c22d822bdf72e4680c02fb6caa13a5
,
type
:
3
}
toggleM_Over
:
{
fileID
:
21300000
,
guid
:
03c22d822bdf72e4680c02fb6caa13a5
,
type
:
3
}
...
...
Assets/Prefabs/ServantUI/OcgCoreUI.prefab
View file @
7c15b217
...
@@ -1400,7 +1400,7 @@ RectTransform:
...
@@ -1400,7 +1400,7 @@ RectTransform:
m_Father
:
{
fileID
:
3141161628360550058
}
m_Father
:
{
fileID
:
3141161628360550058
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
...
@@ -1897,7 +1897,7 @@ RectTransform:
...
@@ -1897,7 +1897,7 @@ RectTransform:
m_Father
:
{
fileID
:
2601215752712795956
}
m_Father
:
{
fileID
:
2601215752712795956
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
...
@@ -4510,7 +4510,7 @@ GameObject:
...
@@ -4510,7 +4510,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
&3547886573148048411
---
!u!224
&3547886573148048411
RectTransform
:
RectTransform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -4613,7 +4613,7 @@ MonoBehaviour:
...
@@ -4613,7 +4613,7 @@ MonoBehaviour:
m_HandleRect
:
{
fileID
:
3411319760472490572
}
m_HandleRect
:
{
fileID
:
3411319760472490572
}
m_Direction
:
2
m_Direction
:
2
m_Value
:
0
m_Value
:
0
m_Size
:
0.6103896
m_Size
:
1
m_NumberOfSteps
:
0
m_NumberOfSteps
:
0
m_OnValueChanged
:
m_OnValueChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
@@ -5858,7 +5858,7 @@ GameObject:
...
@@ -5858,7 +5858,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
&4644922332218632127
---
!u!224
&4644922332218632127
RectTransform
:
RectTransform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -7417,7 +7417,7 @@ RectTransform:
...
@@ -7417,7 +7417,7 @@ RectTransform:
m_Father
:
{
fileID
:
7903533369499340670
}
m_Father
:
{
fileID
:
7903533369499340670
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
...
@@ -8315,7 +8315,7 @@ RectTransform:
...
@@ -8315,7 +8315,7 @@ RectTransform:
m_Father
:
{
fileID
:
4209928021973815270
}
m_Father
:
{
fileID
:
4209928021973815270
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_SizeDelta
:
{
x
:
20
,
y
:
20
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
...
@@ -10319,7 +10319,7 @@ GameObject:
...
@@ -10319,7 +10319,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
&1606593035982896797
---
!u!224
&1606593035982896797
RectTransform
:
RectTransform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -10904,7 +10904,7 @@ GameObject:
...
@@ -10904,7 +10904,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
&6648772700326188638
---
!u!224
&6648772700326188638
RectTransform
:
RectTransform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/MDPro3/Duel/CardList.cs
View file @
7c15b217
...
@@ -19,20 +19,16 @@ namespace MDPro3.UI
...
@@ -19,20 +19,16 @@ namespace MDPro3.UI
const
float
ExtraDeckHorizontalGap
=
16f
;
const
float
ExtraDeckHorizontalGap
=
16f
;
const
float
ExtraDeckVerticalGap
=
20f
;
const
float
ExtraDeckVerticalGap
=
20f
;
const
float
ExtraDeckRowLineHeight
=
2f
;
const
float
ExtraDeckRowLineHeight
=
2f
;
const
float
ExtraDeckToggleButtonWidth
=
64f
;
const
float
ExtraDeckToggleButtonWidth
=
88f
;
const
float
ExtraDeckToggleButtonHeight
=
62f
;
const
float
ExtraDeckToggleButtonHeight
=
68f
;
const
float
ExtraDeckToggleButtonIconSize
=
42f
;
const
float
ExtraDeckToggleButtonIconSize
=
26f
;
const
float
ExtraDeckToggleButtonOverlap
=
0f
;
const
float
ExtraDeckToggleButtonOverlap
=
4f
;
const
float
ExtraDeckToggleButtonTopInset
=
0f
;
const
float
ExtraDeckToggleButtonTopInset
=
4f
;
const
float
ExtraDeckToggleAdornmentWidth
=
40f
;
const
float
ExtraDeckToggleHeaderLineHeight
=
2f
;
const
float
ExtraDeckToggleAdornmentHeight
=
106f
;
const
float
ExtraDeckToggleHeaderLineRightInset
=
10f
;
const
float
ExtraDeckToggleAdornmentVisibleStartX
=
22f
;
const
float
ExtraDeckHeaderHeight
=
96f
;
const
float
ExtraDeckToggleAdornmentOffsetY
=
22f
;
const
float
ExtraDeckLocationIconSize
=
64f
;
const
float
ExtraDeckToggleJoinPatchWidth
=
16f
;
const
float
ExtraDeckLocationIconTopInset
=
8f
;
const
float
ExtraDeckToggleJoinPatchHeight
=
16f
;
const
float
ExtraDeckToggleJoinPatchOffsetX
=
ExtraDeckToggleButtonWidth
-
2f
;
const
float
ExtraDeckToggleJoinPatchOffsetY
=
0f
;
const
float
ExtraDeckToggleJoinPatchTopLineHeight
=
2f
;
const
float
HiddenPadding
=
20f
;
const
float
HiddenPadding
=
20f
;
public
RectTransform
baseRect
;
public
RectTransform
baseRect
;
...
@@ -52,9 +48,17 @@ namespace MDPro3.UI
...
@@ -52,9 +48,17 @@ namespace MDPro3.UI
bool
extraDeckGridMode
=
false
;
bool
extraDeckGridMode
=
false
;
Button
extraDeckModeButton
;
Button
extraDeckModeButton
;
Image
extraDeckModeButtonIcon
;
Image
extraDeckModeButtonIcon
;
RectTransform
extraDeckModeButtonSeamRect
;
Image
extraDeckModeButtonFrame
;
RectTransform
extraDeckModeButtonJoinPatchRect
;
RectTransform
extraDeckModeButtonHeaderLineRect
;
RectTransform
extraDeckModeButtonJoinPatchTopLineRect
;
RectTransform
locationIconRect
;
RectTransform
listHeaderRect
;
RectTransform
listScrollRect
;
Vector2
defaultLocationIconAnchoredPosition
;
Vector2
defaultLocationIconSizeDelta
;
Vector2
defaultHeaderSizeDelta
;
Vector2
defaultScrollViewAnchoredPosition
;
Vector2
defaultScrollViewSizeDelta
;
bool
defaultListLayoutCached
;
public
void
Show
(
List
<
GameCard
>
cards
,
CardLocation
location
,
int
controller
)
public
void
Show
(
List
<
GameCard
>
cards
,
CardLocation
location
,
int
controller
)
{
{
...
@@ -102,6 +106,8 @@ namespace MDPro3.UI
...
@@ -102,6 +106,8 @@ namespace MDPro3.UI
showing
=
false
;
showing
=
false
;
if
(
extraDeckModeButton
!=
null
)
if
(
extraDeckModeButton
!=
null
)
extraDeckModeButton
.
gameObject
.
SetActive
(
false
);
extraDeckModeButton
.
gameObject
.
SetActive
(
false
);
if
(
extraDeckModeButtonHeaderLineRect
!=
null
)
extraDeckModeButtonHeaderLineRect
.
gameObject
.
SetActive
(
false
);
baseRect
.
DOAnchorPosX
(
GetHiddenPosX
(),
0.3f
);
baseRect
.
DOAnchorPosX
(
GetHiddenPosX
(),
0.3f
);
if
(
showWithCloseDuelLog
)
if
(
showWithCloseDuelLog
)
{
{
...
@@ -113,6 +119,7 @@ namespace MDPro3.UI
...
@@ -113,6 +119,7 @@ namespace MDPro3.UI
void
RefreshList
()
void
RefreshList
()
{
{
EnsureWidthForLocation
();
EnsureWidthForLocation
();
UpdateListHeaderLayout
();
EnsureExtraDeckModeToggle
();
EnsureExtraDeckModeToggle
();
UpdateExtraDeckModeToggle
();
UpdateExtraDeckModeToggle
();
locationIcon
.
sprite
=
GetListLocationIcon
(
location
,
controller
);
locationIcon
.
sprite
=
GetListLocationIcon
(
location
,
controller
);
...
@@ -234,11 +241,61 @@ namespace MDPro3.UI
...
@@ -234,11 +241,61 @@ namespace MDPro3.UI
return
IsToggleListLocation
(
location
)
&&
extraDeckGridMode
;
return
IsToggleListLocation
(
location
)
&&
extraDeckGridMode
;
}
}
void
EnsureListLayoutBindings
()
{
if
(
locationIcon
!=
null
)
{
if
(
locationIconRect
==
null
)
locationIconRect
=
locationIcon
.
rectTransform
;
if
(
listHeaderRect
==
null
)
listHeaderRect
=
locationIconRect
.
parent
as
RectTransform
;
locationIcon
.
preserveAspect
=
true
;
}
if
(
scrollRect
!=
null
)
{
if
(
listScrollRect
==
null
)
listScrollRect
=
scrollRect
.
transform
as
RectTransform
;
}
if
(
defaultListLayoutCached
||
locationIconRect
==
null
||
listHeaderRect
==
null
||
listScrollRect
==
null
)
return
;
defaultLocationIconAnchoredPosition
=
locationIconRect
.
anchoredPosition
;
defaultLocationIconSizeDelta
=
locationIconRect
.
sizeDelta
;
defaultHeaderSizeDelta
=
listHeaderRect
.
sizeDelta
;
defaultScrollViewAnchoredPosition
=
listScrollRect
.
anchoredPosition
;
defaultScrollViewSizeDelta
=
listScrollRect
.
sizeDelta
;
defaultListLayoutCached
=
true
;
}
void
UpdateListHeaderLayout
()
{
EnsureListLayoutBindings
();
if
(!
defaultListLayoutCached
)
return
;
var
useExpandedExtraHeader
=
IsExtraListLocation
(
location
);
var
headerHeight
=
useExpandedExtraHeader
?
ExtraDeckHeaderHeight
:
defaultHeaderSizeDelta
.
y
;
listHeaderRect
.
sizeDelta
=
new
Vector2
(
defaultHeaderSizeDelta
.
x
,
headerHeight
);
listScrollRect
.
anchoredPosition
=
new
Vector2
(
defaultScrollViewAnchoredPosition
.
x
,
-
headerHeight
*
0.5f
);
listScrollRect
.
sizeDelta
=
new
Vector2
(
defaultScrollViewSizeDelta
.
x
,
-
headerHeight
);
locationIconRect
.
anchoredPosition
=
useExpandedExtraHeader
?
new
Vector2
(
defaultLocationIconAnchoredPosition
.
x
,
-
ExtraDeckLocationIconTopInset
)
:
defaultLocationIconAnchoredPosition
;
locationIconRect
.
sizeDelta
=
useExpandedExtraHeader
?
new
Vector2
(
ExtraDeckLocationIconSize
,
ExtraDeckLocationIconSize
)
:
defaultLocationIconSizeDelta
;
}
void
EnsureExtraDeckModeToggle
()
void
EnsureExtraDeckModeToggle
()
{
{
TryBindExistingExtraDeckModeToggle
();
TryBindExistingExtraDeckModeToggle
();
if
(
extraDeckModeButton
!=
null
)
if
(
extraDeckModeButton
!=
null
)
{
{
EnsureExtraDeckModeToggleHeaderLine
();
UpdateExtraDeckModeToggleLayout
();
UpdateExtraDeckModeToggleLayout
();
return
;
return
;
}
}
...
@@ -278,13 +335,30 @@ namespace MDPro3.UI
...
@@ -278,13 +335,30 @@ namespace MDPro3.UI
extraDeckModeButton
.
targetGraphic
=
bgImage
;
extraDeckModeButton
.
targetGraphic
=
bgImage
;
extraDeckModeButton
.
onClick
.
AddListener
(
OnExtraDeckModeButtonClick
);
extraDeckModeButton
.
onClick
.
AddListener
(
OnExtraDeckModeButtonClick
);
var
frame
=
new
GameObject
(
"Frame"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
frame
.
transform
.
SetParent
(
go
.
transform
,
false
);
frame
.
transform
.
SetAsFirstSibling
();
var
frameRect
=
frame
.
GetComponent
<
RectTransform
>();
frameRect
.
anchorMin
=
Vector2
.
zero
;
frameRect
.
anchorMax
=
Vector2
.
one
;
frameRect
.
offsetMin
=
Vector2
.
zero
;
frameRect
.
offsetMax
=
Vector2
.
zero
;
extraDeckModeButtonFrame
=
frame
.
GetComponent
<
Image
>();
extraDeckModeButtonFrame
.
sprite
=
TextureManager
.
container
!=
null
?
TextureManager
.
container
.
duelCardSelectionListFrame
:
null
;
extraDeckModeButtonFrame
.
type
=
Image
.
Type
.
Sliced
;
extraDeckModeButtonFrame
.
color
=
Color
.
white
;
extraDeckModeButtonFrame
.
raycastTarget
=
false
;
var
icon
=
new
GameObject
(
"Icon"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
var
icon
=
new
GameObject
(
"Icon"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
icon
.
transform
.
SetParent
(
go
.
transform
,
false
);
icon
.
transform
.
SetParent
(
go
.
transform
,
false
);
var
iconRect
=
icon
.
GetComponent
<
RectTransform
>();
var
iconRect
=
icon
.
GetComponent
<
RectTransform
>();
iconRect
.
anchorMin
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
anchorMin
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
anchorMax
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
anchorMax
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
pivot
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
pivot
=
new
Vector2
(
0.5f
,
0.5f
);
iconRect
.
anchoredPosition
=
Vector2
.
zero
;
iconRect
.
anchoredPosition
=
new
Vector2
(
0f
,
-
1f
)
;
iconRect
.
sizeDelta
=
new
Vector2
(
ExtraDeckToggleButtonIconSize
,
ExtraDeckToggleButtonIconSize
);
iconRect
.
sizeDelta
=
new
Vector2
(
ExtraDeckToggleButtonIconSize
,
ExtraDeckToggleButtonIconSize
);
extraDeckModeButtonIcon
=
icon
.
GetComponent
<
Image
>();
extraDeckModeButtonIcon
=
icon
.
GetComponent
<
Image
>();
...
@@ -292,8 +366,7 @@ namespace MDPro3.UI
...
@@ -292,8 +366,7 @@ namespace MDPro3.UI
extraDeckModeButtonIcon
.
color
=
Color
.
white
;
extraDeckModeButtonIcon
.
color
=
Color
.
white
;
extraDeckModeButtonIcon
.
raycastTarget
=
false
;
extraDeckModeButtonIcon
.
raycastTarget
=
false
;
EnsureExtraDeckModeToggleSeam
(
go
.
transform
);
EnsureExtraDeckModeToggleHeaderLine
();
EnsureExtraDeckModeToggleJoinPatch
(
go
.
transform
);
UpdateExtraDeckModeToggleLayout
();
UpdateExtraDeckModeToggleLayout
();
}
}
...
@@ -314,8 +387,11 @@ namespace MDPro3.UI
...
@@ -314,8 +387,11 @@ namespace MDPro3.UI
if
(
iconTransform
!=
null
)
if
(
iconTransform
!=
null
)
extraDeckModeButtonIcon
=
iconTransform
.
GetComponent
<
Image
>();
extraDeckModeButtonIcon
=
iconTransform
.
GetComponent
<
Image
>();
EnsureExtraDeckModeToggleSeam
(
existing
);
var
frameTransform
=
existing
.
Find
(
"Frame"
);
EnsureExtraDeckModeToggleJoinPatch
(
existing
);
if
(
frameTransform
!=
null
)
extraDeckModeButtonFrame
=
frameTransform
.
GetComponent
<
Image
>();
TryBindExistingExtraDeckModeToggleHeaderLine
();
var
bgImage
=
existing
.
GetComponent
<
Image
>();
var
bgImage
=
existing
.
GetComponent
<
Image
>();
if
(
bgImage
!=
null
)
if
(
bgImage
!=
null
)
...
@@ -334,17 +410,23 @@ namespace MDPro3.UI
...
@@ -334,17 +410,23 @@ namespace MDPro3.UI
var
isToggleLocation
=
IsToggleListLocation
(
location
);
var
isToggleLocation
=
IsToggleListLocation
(
location
);
extraDeckModeButton
.
gameObject
.
SetActive
(
isToggleLocation
);
extraDeckModeButton
.
gameObject
.
SetActive
(
isToggleLocation
);
if
(
extraDeckModeButtonHeaderLineRect
!=
null
)
extraDeckModeButtonHeaderLineRect
.
gameObject
.
SetActive
(
isToggleLocation
);
if
(!
isToggleLocation
)
if
(!
isToggleLocation
)
return
;
return
;
if
(
ShouldUseExtraDeckGrid
())
if
(
ShouldUseExtraDeckGrid
())
extraDeckModeButtonIcon
.
sprite
=
TextureManager
.
container
.
listViewIconDefault
!=
null
extraDeckModeButtonIcon
.
sprite
=
TextureManager
.
container
.
duelCardSelectionListViewIconVertical
!=
null
?
TextureManager
.
container
.
listViewIconDefault
?
TextureManager
.
container
.
duelCardSelectionListViewIconVertical
:
TextureManager
.
container
.
listMyDeck
;
:
TextureManager
.
container
.
listViewIconDefault
!=
null
?
TextureManager
.
container
.
listViewIconDefault
:
TextureManager
.
container
.
listMyDeck
;
else
else
extraDeckModeButtonIcon
.
sprite
=
TextureManager
.
container
.
listViewIconExpand
!=
null
extraDeckModeButtonIcon
.
sprite
=
TextureManager
.
container
.
duelCardSelectionListViewIconHorizontal
!=
null
?
TextureManager
.
container
.
listViewIconExpand
?
TextureManager
.
container
.
duelCardSelectionListViewIconHorizontal
:
(
controller
==
0
?
TextureManager
.
container
.
listMyDeck
:
TextureManager
.
container
.
listOpDeck
);
:
TextureManager
.
container
.
listViewIconExpand
!=
null
?
TextureManager
.
container
.
listViewIconExpand
:
(
controller
==
0
?
TextureManager
.
container
.
listMyDeck
:
TextureManager
.
container
.
listOpDeck
);
}
}
void
OnExtraDeckModeButtonClick
()
void
OnExtraDeckModeButtonClick
()
...
@@ -361,6 +443,11 @@ namespace MDPro3.UI
...
@@ -361,6 +443,11 @@ namespace MDPro3.UI
return
(
targetLocation
&
(
CardLocation
.
Extra
|
CardLocation
.
Grave
|
CardLocation
.
Removed
))
>
0
;
return
(
targetLocation
&
(
CardLocation
.
Extra
|
CardLocation
.
Grave
|
CardLocation
.
Removed
))
>
0
;
}
}
bool
IsExtraListLocation
(
CardLocation
targetLocation
)
{
return
(
targetLocation
&
CardLocation
.
Extra
)
>
0
;
}
float
GetHiddenPosX
()
float
GetHiddenPosX
()
{
{
return
(
baseRect
.
sizeDelta
.
x
+
HiddenPadding
+
GetToggleLeftProtrusion
())
*
Config
.
GetUIScale
(
1.18f
)
return
(
baseRect
.
sizeDelta
.
x
+
HiddenPadding
+
GetToggleLeftProtrusion
())
*
Config
.
GetUIScale
(
1.18f
)
...
@@ -383,10 +470,9 @@ namespace MDPro3.UI
...
@@ -383,10 +470,9 @@ namespace MDPro3.UI
return
-
ExtraDeckToggleButtonWidth
+
ExtraDeckToggleButtonOverlap
;
return
-
ExtraDeckToggleButtonWidth
+
ExtraDeckToggleButtonOverlap
;
}
}
float
GetExtraDeckToggle
Adornment
AnchoredX
()
float
GetExtraDeckToggle
HeaderLine
AnchoredX
()
{
{
// Lock the visible seam line to the toggle start (left edge).
return
ExtraDeckToggleButtonWidth
-
ExtraDeckToggleButtonOverlap
-
2f
;
return
-
ExtraDeckToggleAdornmentVisibleStartX
;
}
}
void
UpdateExtraDeckModeToggleLayout
()
void
UpdateExtraDeckModeToggleLayout
()
...
@@ -397,159 +483,73 @@ namespace MDPro3.UI
...
@@ -397,159 +483,73 @@ namespace MDPro3.UI
buttonRect
.
sizeDelta
=
new
Vector2
(
ExtraDeckToggleButtonWidth
,
ExtraDeckToggleButtonHeight
);
buttonRect
.
sizeDelta
=
new
Vector2
(
ExtraDeckToggleButtonWidth
,
ExtraDeckToggleButtonHeight
);
}
}
if
(
extraDeckModeButtonSeamRect
!=
null
)
if
(
extraDeckModeButtonFrame
!=
null
&&
extraDeckModeButtonFrame
.
transform
is
RectTransform
frameRect
)
{
extraDeckModeButtonSeamRect
.
anchoredPosition
=
new
Vector2
(
GetExtraDeckToggleAdornmentAnchoredX
(),
ExtraDeckToggleAdornmentOffsetY
);
extraDeckModeButtonSeamRect
.
sizeDelta
=
new
Vector2
(
ExtraDeckToggleAdornmentWidth
,
ExtraDeckToggleAdornmentHeight
);
}
if
(
extraDeckModeButtonJoinPatchRect
!=
null
)
{
{
extraDeckModeButtonJoinPatchRect
.
anchoredPosition
=
frameRect
.
anchorMin
=
Vector2
.
zero
;
new
Vector2
(
ExtraDeckToggleJoinPatchOffsetX
,
ExtraDeckToggleJoinPatchOffsetY
)
;
frameRect
.
anchorMax
=
Vector2
.
one
;
extraDeckModeButtonJoinPatchRect
.
sizeDelta
=
frameRect
.
offsetMin
=
Vector2
.
zero
;
new
Vector2
(
ExtraDeckToggleJoinPatchWidth
,
ExtraDeckToggleJoinPatchHeight
)
;
frameRect
.
offsetMax
=
Vector2
.
zero
;
}
}
if
(
extraDeckModeButton
JoinPatchTop
LineRect
!=
null
)
if
(
extraDeckModeButton
Header
LineRect
!=
null
)
{
{
extraDeckModeButtonJoinPatchTopLineRect
.
anchoredPosition
=
Vector2
.
zero
;
var
width
=
Mathf
.
Max
(
0f
,
extraDeckModeButtonJoinPatchTopLineRect
.
sizeDelta
=
new
Vector2
(
0f
,
ExtraDeckToggleJoinPatchTopLineHeight
);
baseRect
.
rect
.
width
-
GetExtraDeckToggleHeaderLineAnchoredX
()
-
ExtraDeckToggleHeaderLineRightInset
);
extraDeckModeButtonHeaderLineRect
.
anchoredPosition
=
new
Vector2
(
GetExtraDeckToggleHeaderLineAnchoredX
(),
0f
);
extraDeckModeButtonHeaderLineRect
.
sizeDelta
=
new
Vector2
(
width
,
ExtraDeckToggleHeaderLineHeight
);
}
}
}
}
void
EnsureExtraDeckModeToggleSeam
(
Transform
parent
)
void
TryBindExistingExtraDeckModeToggleHeaderLine
(
)
{
{
extraDeckModeButtonSeamRect
=
null
;
if
(
extraDeckModeButtonHeaderLineRect
!=
null
||
baseRect
==
null
)
var
seamSprite
=
GetToggleBackgroundSprite
();
if
(
parent
==
null
||
seamSprite
==
null
)
return
;
return
;
RectTransform
seamRect
=
null
;
EnsureListLayoutBindings
();
var
seamTransform
=
parent
.
Find
(
"Seam"
);
var
line
=
listHeaderRect
!=
null
if
(
seamTransform
!=
null
)
?
listHeaderRect
.
Find
(
"ExtraDeckHeaderLine"
)
{
:
null
;
seamTransform
.
gameObject
.
SetActive
(
true
);
if
(
line
==
null
)
seamRect
=
seamTransform
as
RectTransform
;
line
=
baseRect
.
Find
(
"ExtraDeckHeaderLine"
);
if
(
seamRect
==
null
)
if
(
line
==
null
)
seamRect
=
seamTransform
.
GetComponent
<
RectTransform
>();
return
;
}
if
(
seamRect
==
null
)
extraDeckModeButtonHeaderLineRect
=
line
as
RectTransform
;
{
if
(
extraDeckModeButtonHeaderLineRect
==
null
)
var
seam
=
new
GameObject
(
"Seam"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
extraDeckModeButtonHeaderLineRect
=
line
.
GetComponent
<
RectTransform
>();
seam
.
transform
.
SetParent
(
parent
,
false
);
seam
.
transform
.
SetAsFirstSibling
();
seamRect
=
seam
.
GetComponent
<
RectTransform
>();
}
seamRect
.
anchorMin
=
new
Vector2
(
0f
,
1f
);
var
desiredParent
=
listHeaderRect
!=
null
?
listHeaderRect
:
baseRect
;
seamRect
.
anchorMax
=
new
Vector2
(
0f
,
1f
);
if
(
desiredParent
!=
null
&&
extraDeckModeButtonHeaderLineRect
!=
null
seamRect
.
pivot
=
new
Vector2
(
0f
,
1f
);
&&
extraDeckModeButtonHeaderLineRect
.
parent
!=
desiredParent
)
seamRect
.
anchoredPosition
=
Vector2
.
zero
;
extraDeckModeButtonHeaderLineRect
.
SetParent
(
desiredParent
,
false
);
seamRect
.
sizeDelta
=
Vector2
.
zero
;
var
seamImage
=
seamRect
.
GetComponent
<
Image
>();
if
(
seamImage
==
null
)
seamImage
=
seamRect
.
gameObject
.
AddComponent
<
Image
>();
seamImage
.
sprite
=
seamSprite
;
seamImage
.
type
=
Image
.
Type
.
Simple
;
seamImage
.
color
=
Color
.
white
;
seamImage
.
raycastTarget
=
false
;
extraDeckModeButtonSeamRect
=
seamRect
;
var
middleMaskTransform
=
seamRect
.
Find
(
"MiddleMask"
);
if
(
middleMaskTransform
!=
null
)
middleMaskTransform
.
gameObject
.
SetActive
(
false
);
}
}
void
EnsureExtraDeckModeToggle
JoinPatch
(
Transform
parent
)
void
EnsureExtraDeckModeToggle
HeaderLine
(
)
{
{
extraDeckModeButtonJoinPatchRect
=
null
;
TryBindExistingExtraDeckModeToggleHeaderLine
();
extraDeckModeButtonJoinPatchTopLineRect
=
null
;
EnsureListLayoutBindings
();
if
(
parent
==
null
)
return
;
RectTransform
patchRect
=
null
;
var
patchTransform
=
parent
.
Find
(
"JoinPatch"
);
if
(
patchTransform
!=
null
)
{
patchTransform
.
gameObject
.
SetActive
(
true
);
patchRect
=
patchTransform
as
RectTransform
;
if
(
patchRect
==
null
)
patchRect
=
patchTransform
.
GetComponent
<
RectTransform
>();
}
if
(
patchRect
==
null
)
var
parent
=
listHeaderRect
!=
null
?
listHeaderRect
:
baseRect
;
{
if
(
extraDeckModeButtonHeaderLineRect
!=
null
||
parent
==
null
)
var
patch
=
new
GameObject
(
"JoinPatch"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
return
;
patch
.
transform
.
SetParent
(
parent
,
false
);
patch
.
transform
.
SetSiblingIndex
(
0
);
patchRect
=
patch
.
GetComponent
<
RectTransform
>();
}
patchRect
.
anchorMin
=
new
Vector2
(
0f
,
1f
);
patchRect
.
anchorMax
=
new
Vector2
(
0f
,
1f
);
patchRect
.
pivot
=
new
Vector2
(
0f
,
1f
);
var
patchImage
=
patchRect
.
GetComponent
<
Image
>();
var
blackBg
=
TextureManager
.
container
!=
null
?
TextureManager
.
container
.
black
:
null
;
var
blackBg
=
TextureManager
.
container
!=
null
?
TextureManager
.
container
.
black
:
null
;
if
(
blackBg
!=
null
)
var
line
=
new
GameObject
(
"ExtraDeckHeaderLine"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
{
line
.
transform
.
SetParent
(
parent
,
false
);
patchImage
.
sprite
=
blackBg
;
line
.
transform
.
SetSiblingIndex
(
0
);
patchImage
.
type
=
Image
.
Type
.
Simple
;
patchImage
.
color
=
Color
.
white
;
extraDeckModeButtonHeaderLineRect
=
line
.
GetComponent
<
RectTransform
>();
}
extraDeckModeButtonHeaderLineRect
.
anchorMin
=
new
Vector2
(
0f
,
0f
);
else
extraDeckModeButtonHeaderLineRect
.
anchorMax
=
new
Vector2
(
0f
,
0f
);
{
extraDeckModeButtonHeaderLineRect
.
pivot
=
new
Vector2
(
0f
,
0f
);
patchImage
.
sprite
=
null
;
patchImage
.
color
=
Color
.
black
;
var
lineImage
=
line
.
GetComponent
<
Image
>();
}
lineImage
.
sprite
=
blackBg
;
patchImage
.
raycastTarget
=
false
;
lineImage
.
type
=
Image
.
Type
.
Simple
;
lineImage
.
color
=
new
Color
(
0.78f
,
0.78f
,
0.78f
,
1f
);
RectTransform
topLineRect
=
null
;
lineImage
.
raycastTarget
=
false
;
var
topLineTransform
=
patchRect
.
Find
(
"TopLine"
);
if
(
topLineTransform
!=
null
)
{
topLineTransform
.
gameObject
.
SetActive
(
true
);
topLineRect
=
topLineTransform
as
RectTransform
;
if
(
topLineRect
==
null
)
topLineRect
=
topLineTransform
.
GetComponent
<
RectTransform
>();
}
if
(
topLineRect
==
null
)
{
var
topLine
=
new
GameObject
(
"TopLine"
,
typeof
(
RectTransform
),
typeof
(
CanvasRenderer
),
typeof
(
Image
));
topLine
.
transform
.
SetParent
(
patchRect
,
false
);
topLineRect
=
topLine
.
GetComponent
<
RectTransform
>();
}
topLineRect
.
anchorMin
=
new
Vector2
(
0f
,
1f
);
topLineRect
.
anchorMax
=
new
Vector2
(
1f
,
1f
);
topLineRect
.
pivot
=
new
Vector2
(
0.5f
,
1f
);
var
topLineImage
=
topLineRect
.
GetComponent
<
Image
>();
if
(
blackBg
!=
null
)
{
topLineImage
.
sprite
=
blackBg
;
topLineImage
.
type
=
Image
.
Type
.
Simple
;
}
else
{
topLineImage
.
sprite
=
null
;
}
topLineImage
.
color
=
new
Color
(
0.78f
,
0.78f
,
0.78f
,
1f
);
topLineImage
.
raycastTarget
=
false
;
extraDeckModeButtonJoinPatchRect
=
patchRect
;
extraDeckModeButtonJoinPatchTopLineRect
=
topLineRect
;
}
Sprite
GetToggleBackgroundSprite
()
{
return
TextureManager
.
container
!=
null
?
TextureManager
.
container
.
listCardStatsBase
:
null
;
}
}
void
ClearList
()
void
ClearList
()
...
...
Assets/Scripts/MDPro3/ScriptableObjects/TextureContainer.cs
View file @
7c15b217
...
@@ -361,6 +361,9 @@ namespace MDPro3
...
@@ -361,6 +361,9 @@ namespace MDPro3
public
Sprite
chainNumSet9
;
public
Sprite
chainNumSet9
;
[
Header
(
"Window"
)]
[
Header
(
"Window"
)]
public
Sprite
duelCardSelectionListFrame
;
public
Sprite
duelCardSelectionListViewIconHorizontal
;
public
Sprite
duelCardSelectionListViewIconVertical
;
public
Sprite
toggleM
;
public
Sprite
toggleM
;
public
Sprite
toggleM_On
;
public
Sprite
toggleM_On
;
public
Sprite
toggleM_Over
;
public
Sprite
toggleM_Over
;
...
...
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