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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Dark_Zane
MDPro3
Commits
344bae0e
Commit
344bae0e
authored
Apr 02, 2024
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new deck share function
parent
b6acd2b1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
338 additions
and
35 deletions
+338
-35
Assets/Main.unity
Assets/Main.unity
+291
-28
Assets/Scripts/MDPro3/Servants/EditDeck.cs
Assets/Scripts/MDPro3/Servants/EditDeck.cs
+22
-5
Assets/Scripts/MDPro3/Tools.cs
Assets/Scripts/MDPro3/Tools.cs
+14
-0
Packages/manifest.json
Packages/manifest.json
+1
-0
Packages/packages-lock.json
Packages/packages-lock.json
+7
-0
ProjectSettings/ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+3
-2
No files found.
Assets/Main.unity
View file @
344bae0e
This diff is collapsed.
Click to expand it.
Assets/Scripts/MDPro3/Servants/EditDeck.cs
View file @
344bae0e
...
...
@@ -14,6 +14,7 @@ using MDPro3.YGOSharp;
using
MDPro3.YGOSharp.OCGWrapper.Enums
;
using
MDPro3.UI
;
using
Toggle
=
MDPro3
.
UI
.
Toggle
;
using
UnityEngine.Android
;
namespace
MDPro3
{
...
...
@@ -532,22 +533,24 @@ namespace MDPro3
listWidth
=
uiWidth
-
(
outerWidth
*
2
+
descriptionWidth
+
innerWidth
*
2
+
tableWidth
);
manager
.
GetElement
<
RectTransform
>(
"List"
).
sizeDelta
=
new
Vector2
(
listWidth
,
840
);
var
startX
=
8
25
f
;
var
startX
=
8
10
f
;
var
space
=
20f
;
var
fullWidth
=
uiWidth
-
startX
-
100
-
space
*
4
;
var
buttonWidth
=
fullWidth
/
5
;
var
fullWidth
=
uiWidth
-
startX
-
30
-
space
*
5
;
var
buttonWidth
=
fullWidth
/
6
;
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckReset"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckSort"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckRandom"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckCopy"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckShare"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckSave"
).
sizeDelta
=
new
Vector2
(
buttonWidth
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonChangeSide"
).
sizeDelta
=
new
Vector2
(
buttonWidth
*
3
+
space
*
2
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonChangeSide"
).
sizeDelta
=
new
Vector2
(
buttonWidth
*
4
+
space
*
3
,
62
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckReset"
).
anchoredPosition
=
new
Vector2
(
startX
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckSort"
).
anchoredPosition
=
new
Vector2
(
startX
+
buttonWidth
+
space
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckRandom"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
2
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckCopy"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
3
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckSave"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
4
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckShare"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
4
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonDeckSave"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
5
,
-
34
);
manager
.
GetElement
<
RectTransform
>(
"ButtonChangeSide"
).
anchoredPosition
=
new
Vector2
(
startX
+
(
buttonWidth
+
space
)
*
2
,
-
34
);
foreach
(
var
card
in
cards
)
...
...
@@ -1014,6 +1017,20 @@ namespace MDPro3
deckName
+=
" - "
+
InterString
.
Get
(
"复制"
);
input
.
text
=
deckName
;
}
public
void
OnShare
()
{
if
(
dirty
||
!
File
.
Exists
(
"Deck/"
+
deckName
+
".ydk"
))
{
MessageManager
.
Cast
(
InterString
.
Get
(
"请先保存卡组。"
));
return
;
}
#if UNITY_ANDROID && !UNITY_EDITOR
new
NativeShare
().
SetText
(
File
.
ReadAllText
(
"Deck/"
+
deckName
+
".ydk"
)).
Share
();
#else
Tools
.
TryOpenInFileExplorer
(
Path
.
GetFullPath
(
"Deck/"
+
deckName
+
".ydk"
));
#endif
}
public
void
OnSave
()
{
if
(
manager
.
GetElement
<
Text
>(
"TextBanlist"
).
text
!=
"N/A"
)
...
...
Assets/Scripts/MDPro3/Tools.cs
View file @
344bae0e
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
...
...
@@ -174,5 +175,18 @@ namespace MDPro3
result
[
i
]
=
result
[
i
].
Replace
(
"\""
,
""
);
return
result
.
ToArray
();
}
public
static
void
TryOpenInFileExplorer
(
string
path
)
{
try
{
string
argument
=
$"/select, \"
{
path
}
\""
;
Process
.
Start
(
new
ProcessStartInfo
(
"explorer.exe"
,
argument
));
}
catch
(
Exception
ex
)
{
MessageManager
.
Cast
(
$"Failed to open file explorer:
{
ex
.
Message
}
"
);
}
}
}
}
Packages/manifest.json
View file @
344bae0e
...
...
@@ -14,6 +14,7 @@
"com.unity.timeline"
:
"1.4.8"
,
"com.unity.toolchain.win-x86_64-linux-x86_64"
:
"2.0.6"
,
"com.unity.ugui"
:
"1.0.0"
,
"com.yasirkula.nativeshare"
:
"https://github.com/yasirkula/UnityNativeShare.git"
,
"com.unity.modules.ai"
:
"1.0.0"
,
"com.unity.modules.androidjni"
:
"1.0.0"
,
"com.unity.modules.animation"
:
"1.0.0"
,
...
...
Packages/packages-lock.json
View file @
344bae0e
...
...
@@ -195,6 +195,13 @@
"com.unity.modules.imgui"
:
"1.0.0"
}
},
"com.yasirkula.nativeshare"
:
{
"version"
:
"https://github.com/yasirkula/UnityNativeShare.git"
,
"depth"
:
0
,
"source"
:
"git"
,
"dependencies"
:
{},
"hash"
:
"99559c82d9ef7fa2e2c588b91b1995f117f754b2"
},
"com.unity.modules.ai"
:
{
"version"
:
"1.0.0"
,
"depth"
:
0
,
...
...
ProjectSettings/ProjectSettings.asset
View file @
344bae0e
...
...
@@ -134,8 +134,9 @@ PlayerSettings:
16:10:
1
16:9:
1
Others
:
1
bundleVersion
:
1.0.1
preloadedAssets
:
[]
bundleVersion
:
1.0.2
preloadedAssets
:
-
{
fileID
:
11400000
,
guid
:
5fb02d2098f52054b89ce4a9f63ba9ee
,
type
:
2
}
metroInputSource
:
0
wsaTransparentSwapchain
:
0
m_HolographicPauseOnTrackingLoss
:
1
...
...
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