Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
Xu Chenxi
ygopro2
Commits
2a45c62b
Commit
2a45c62b
authored
Apr 29, 2019
by
Unicorn369
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
输入QQ换头像
parent
af71becb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
427 additions
and
15 deletions
+427
-15
Assets/SibylSystem/MonoHelpers/UIHelper.cs
Assets/SibylSystem/MonoHelpers/UIHelper.cs
+1
-1
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
+4
-0
Assets/SibylSystem/Servant.cs
Assets/SibylSystem/Servant.cs
+29
-2
Assets/transUI/prefab/trans_ES_face.prefab
Assets/transUI/prefab/trans_ES_face.prefab
+393
-12
No files found.
Assets/SibylSystem/MonoHelpers/UIHelper.cs
View file @
2a45c62b
...
...
@@ -792,7 +792,7 @@ public static class UIHelper
{
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
{
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".png"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".png"
||
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".jpg"
)
{
string
name
=
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
);
if
(!
faces
.
ContainsKey
(
name
))
...
...
Assets/SibylSystem/ResourceManagers/HttpDldFile.cs
View file @
2a45c62b
...
...
@@ -54,6 +54,10 @@ public class HttpDldFile
}
catch
(
Exception
)
{
if
(
File
.
Exists
(
filename
+
".tmp"
))
{
File
.
Delete
(
filename
+
".tmp"
);
}
flag
=
false
;
}
return
flag
;
...
...
Assets/SibylSystem/Servant.cs
View file @
2a45c62b
using
UnityEngine
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
YGOSharp.OCGWrapper.Enums
;
public
class
Servant
...
...
@@ -391,8 +392,12 @@ public class Servant
public
string
currentMShash
;
public
string
nameFace
;
private
GameObject
currentMSwindow
=
null
;
private
GameObject
currentMSwindow_Face
=
null
;
public
class
messageSystemValue
{
public
string
value
=
""
;
...
...
@@ -779,10 +784,32 @@ public class Servant
true
,
new
Vector3
(((
float
)
Screen
.
height
)
/
700f
,
((
float
)
Screen
.
height
)
/
700f
,
((
float
)
Screen
.
height
)
/
700f
)
);
nameFace
=
name
;
currentMSwindow_Face
=
currentMSwindow
;
UIHelper
.
InterGameObject
(
currentMSwindow
);
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow
,
"face_"
).
mainTexture
=
UIHelper
.
getFace
(
name
);
UIHelper
.
registEvent
(
currentMSwindow
,
"yes_"
,
ES_RMSpremono
,
new
messageSystemValue
());
UIHelper
.
registEvent
(
currentMSwindow
,
"exit_"
,
ES_RMSpremono
,
new
messageSystemValue
());
UIHelper
.
registEvent
(
currentMSwindow
,
"yes_"
,
DownloadFace
);
}
public
void
DownloadFace
()
{
//获取QQ号
UIInput
inputHttp
=
UIHelper
.
getByName
<
UIInput
>(
currentMSwindow_Face
,
"input_"
);
//如果使用自定义url,而不是QQ头像,请修改url,改为:string url = inputHttp.value;
string
url
=
"http://q1.qlogo.cn/headimg_dl?dst_uin="
+
inputHttp
.
value
+
"&spec=100"
;
string
face
=
"texture/face/"
+
nameFace
+
".jpg"
;
//开始下载
HttpDldFile
df
=
new
HttpDldFile
();
df
.
Download
(
url
,
face
);
//刷新头像
if
(
File
.
Exists
(
face
))
{
Texture2D
Face
=
UIHelper
.
getTexture2D
(
face
);
UIHelper
.
faces
.
Remove
(
nameFace
);
//防止bug,先删除再添加
UIHelper
.
faces
.
Add
(
nameFace
,
Face
);
UIHelper
.
getByName
<
UITexture
>(
currentMSwindow_Face
,
"face_"
).
mainTexture
=
Face
;
}
}
#
endregion
}
Assets/transUI/prefab/trans_ES_face.prefab
View file @
2a45c62b
This diff is collapsed.
Click to expand it.
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