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
1
Issues
1
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
hex
ygopro2
Commits
4aee470a
Commit
4aee470a
authored
Jun 14, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download qq avatar with https
parent
4694efba
Pipeline
#37630
failed
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
340 additions
and
182 deletions
+340
-182
Assets/SibylSystem/Room/Room.cs
Assets/SibylSystem/Room/Room.cs
+310
-158
Assets/SibylSystem/Servant.cs
Assets/SibylSystem/Servant.cs
+3
-1
Assets/transUI/UIselectableList.cs
Assets/transUI/UIselectableList.cs
+27
-23
No files found.
Assets/SibylSystem/Room/Room.cs
View file @
4aee470a
This diff is collapsed.
Click to expand it.
Assets/SibylSystem/Servant.cs
View file @
4aee470a
...
...
@@ -917,7 +917,7 @@ public class Servant
public
void
DownloadFace
()
{
string
url
=
"http://q1.qlogo.cn/headimg_dl?dst_uin="
+
inputUrl
.
value
+
"&spec=100"
;
string
url
=
"http
s
://q1.qlogo.cn/headimg_dl?dst_uin="
+
inputUrl
.
value
+
"&spec=100"
;
string
facePath
=
"textures/face/"
+
nameFace
+
".jpg"
;
// 如果输入的是一个完整的URL,则使用它
if
(
inputUrl
.
value
.
Length
>=
4
&&
inputUrl
.
value
.
StartsWith
(
"http"
))
...
...
@@ -939,6 +939,7 @@ public class Servant
if
(
success
)
{
Debug
.
Log
(
"头像下载成功,路径: "
+
facePath
);
Program
.
PrintToChat
(
"头像下载成功!"
);
// 将原来同步执行的刷新逻辑移动到这里
// 确保文件确实存在并且已经被下载完毕
if
(
File
.
Exists
(
facePath
))
...
...
@@ -961,6 +962,7 @@ public class Servant
else
{
Debug
.
LogError
(
"头像下载失败: "
+
url
);
Program
.
PrintToChat
(
"头像下载失败: "
+
url
);
}
}
)
...
...
Assets/transUI/UIselectableList.cs
View file @
4aee470a
using
UnityEngine
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System
;
using
UnityEngine
;
public
class
UIselectableList
:
MonoBehaviour
{
public
class
UIselectableList
:
MonoBehaviour
{
public
GameObject
mod
;
public
UIPanel
panel
;
public
UIScrollBar
scrollBar
;
private
string
m_selectedString
;
public
string
selectedString
{
get
{
return
m_selectedString
;
}
get
{
return
m_selectedString
;
}
set
{
if
(
m_selectedString
!=
value
)
...
...
@@ -30,13 +28,15 @@ public class UIselectableList : MonoBehaviour {
UIScrollView
uIScrollView
;
float
heightOfEach
=
35
;
public
float
preHeight
=
0
;
class
selection
{
public
string
str
=
""
;
public
UIselectableListItem
obj
=
null
;
public
bool
selected
=
false
;
}
List
<
selection
>
selections
=
new
List
<
selection
>();
List
<
selection
>
selections
=
new
List
<
selection
>();
float
width
=
0
;
float
height
=
0
;
...
...
@@ -60,7 +60,6 @@ public class UIselectableList : MonoBehaviour {
height
=
panel
.
GetViewSize
().
y
;
clear
();
toTop
();
}
void
onScrollBarChange
()
...
...
@@ -75,7 +74,7 @@ public class UIselectableList : MonoBehaviour {
uIScrollView
.
transform
.
localPosition
.
x
,
Y
,
uIScrollView
.
transform
.
localPosition
.
z
);
);
panel
.
clipOffset
=
new
Vector2
(
0
,
-
Y
);
}
...
...
@@ -95,7 +94,7 @@ public class UIselectableList : MonoBehaviour {
needRefresh
=
true
;
}
public
bool
Selected
()
public
bool
Selected
()
{
bool
returnValue
=
false
;
foreach
(
var
item
in
selections
)
...
...
@@ -115,7 +114,7 @@ public class UIselectableList : MonoBehaviour {
uIScrollView
.
transform
.
localPosition
.
x
,
Y
,
uIScrollView
.
transform
.
localPosition
.
z
);
);
panel
.
clipOffset
=
new
Vector2
(
0
,
-
Y
);
if
(
select
)
{
...
...
@@ -133,16 +132,19 @@ public class UIselectableList : MonoBehaviour {
public
void
add
(
string
item
)
{
selections
.
Add
(
new
selection
{
str
=
item
,
obj
=
null
,
selected
=
false
});
selections
.
Add
(
new
selection
{
str
=
item
,
obj
=
null
,
selected
=
false
,
}
);
needRefresh
=
true
;
}
float
pre
=
0
;
public
void
refresh
()
{
float
screenTop
=
panel
.
clipOffset
.
y
+
(
height
-
heightOfEach
)
/
2f
;
...
...
@@ -159,7 +161,7 @@ public class UIselectableList : MonoBehaviour {
scrollBar
.
barSize
=
0.1f
;
}
float
beginY
=
(
height
-
heightOfEach
)
/
2f
;
float
endY
=
beginY
+
heightOfEach
*
selections
.
Count
+
preHeight
-
height
;
float
endY
=
beginY
+
heightOfEach
*
selections
.
Count
+
preHeight
-
height
;
float
allHeight
=
endY
-
beginY
;
float
curHeight
=
uIScrollView
.
transform
.
localPosition
.
y
-
beginY
;
scrollBar
.
value
=
curHeight
/
allHeight
;
...
...
@@ -169,7 +171,7 @@ public class UIselectableList : MonoBehaviour {
scrollBar
.
gameObject
.
SetActive
(
false
);
}
float
screenButtom
=
screenTop
-
height
+
heightOfEach
;
for
(
int
i
=
0
;
i
<
selections
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
selections
.
Count
;
i
++)
{
var
currentItem
=
selections
[
i
];
float
currentY
=
-
i
*
heightOfEach
-
preHeight
;
...
...
@@ -181,7 +183,9 @@ public class UIselectableList : MonoBehaviour {
}
else
{
currentItem
.
obj
=
MonoBehaviour
.
Instantiate
<
GameObject
>(
mod
).
GetComponent
<
UIselectableListItem
>();
currentItem
.
obj
=
MonoBehaviour
.
Instantiate
<
GameObject
>(
mod
)
.
GetComponent
<
UIselectableListItem
>();
currentItem
.
obj
.
List
=
this
;
currentItem
.
obj
.
transform
.
SetParent
(
panel
.
transform
,
false
);
currentItem
.
obj
.
lable
.
width
=
(
int
)
width
-
10
;
...
...
@@ -213,9 +217,9 @@ public class UIselectableList : MonoBehaviour {
}
}
void
Update
()
{
void
Update
()
{
refresh
();
}
public
void
refreshForOneFrame
()
...
...
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