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
dde96b6a
Commit
dde96b6a
authored
Jul 27, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to special-shaped screen
parent
c3613e75
Pipeline
#39586
failed
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
166 deletions
+41
-166
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+2
-2
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
+8
-8
Assets/SibylSystem/ResourceManagers/GlobalCertificateManager.cs
.../SibylSystem/ResourceManagers/GlobalCertificateManager.cs
+1
-1
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
+27
-27
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+1
-126
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+2
-2
No files found.
Assets/SibylSystem/Program.cs
View file @
dde96b6a
...
...
@@ -549,12 +549,12 @@ public class Program : MonoBehaviour
{
if
(
loadAction
(
path
))
{
Debug
.
Log
(
"Successfully loaded: "
+
path
);
//
Debug.Log("Successfully loaded: " + path);
return
true
;
}
}
}
Debug
.
LogError
(
"Failed to load file: "
+
fileName
);
//
Debug.LogError("Failed to load file: " + fileName);
return
false
;
}
...
...
Assets/SibylSystem/ResourceManagers/GameTextureManager.cs
View file @
dde96b6a
...
...
@@ -239,7 +239,7 @@ public class GameTextureManager
}
catch
(
Exception
e
)
{
Debug
.
LogError
(
"Failed to read file: "
+
path
+
". Error: "
+
e
.
Message
);
//
Debug.LogError("Failed to read file: " + path + ". Error: " + e.Message);
pic
.
rawData
=
null
;
// 确保失败时rawData为null
}
}
...
...
@@ -305,20 +305,20 @@ public class GameTextureManager
{
if
(
success
)
{
Debug
.
Log
(
"Download successful, reading file: "
+
request
.
FilePath
);
//
Debug.Log("Download successful, reading file: " + request.FilePath);
try
{
request
.
PicResource
.
rawData
=
File
.
ReadAllBytes
(
request
.
FilePath
);
}
catch
(
Exception
ex
)
{
Debug
.
LogError
(
"Failed to read downloaded file: "
+
ex
.
Message
);
//
Debug.LogError("Failed to read downloaded file: " + ex.Message);
request
.
PicResource
.
rawData
=
null
;
}
}
else
{
Debug
.
LogWarning
(
"Download failed for card: "
+
request
.
PicResource
.
code
);
//
Debug.LogWarning("Download failed for card: " + request.PicResource.code);
request
.
PicResource
.
rawData
=
null
;
}
...
...
@@ -709,7 +709,7 @@ public class GameTextureManager
// 标记为初始化完成
IsInitialized
=
true
;
Debug
.
Log
(
"[GameTextureManager] Assets initialized successfully."
);
//
Debug.Log("[GameTextureManager] Assets initialized successfully.");
}
// NEW: 这个方法现在只负责启动后台线程
...
...
@@ -721,7 +721,7 @@ public class GameTextureManager
_ioThread
=
new
Thread
(
IoThreadRun
);
_ioThread
.
IsBackground
=
true
;
// 确保主程序退出时线程也退出
_ioThread
.
Start
();
Debug
.
Log
(
"[GameTextureManager] Background I/O thread started."
);
//
Debug.Log("[GameTextureManager] Background I/O thread started.");
}
}
#
endregion
...
...
Assets/SibylSystem/ResourceManagers/GlobalCertificateManager.cs
View file @
dde96b6a
...
...
@@ -11,7 +11,7 @@ public static class GlobalCertificateManager
// 注册全局的证书验证回调
ServicePointManager
.
ServerCertificateValidationCallback
=
MyRemoteCertificateValidationCallback
;
Debug
.
Log
(
"全局证书验证回调已注册,将接受所有HTTPS证书。"
);
//
Debug.Log("全局证书验证回调已注册,将接受所有HTTPS证书。");
}
/// <summary>
...
...
Assets/SibylSystem/ResourceManagers/UnityFileDownloader.cs
View file @
dde96b6a
...
...
@@ -27,7 +27,7 @@ public class UnityFileDownloader
}
catch
(
Exception
e
)
{
Debug
.
LogError
(
"Failed to create directory for "
+
filePath
+
". Error: "
+
e
.
Message
);
//
Debug.LogError("Failed to create directory for " + filePath + ". Error: " + e.Message);
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
false
);
yield
break
;
// 提前退出协程
}
...
...
@@ -38,7 +38,7 @@ public class UnityFileDownloader
File
.
Delete
(
tempFilePath
);
}
Debug
.
Log
(
string
.
Format
(
"Downloading: {0} -> {1}"
,
url
,
filePath
));
//
Debug.Log(string.Format("Downloading: {0} -> {1}", url, filePath));
using
(
UnityWebRequest
uwr
=
new
UnityWebRequest
(
url
,
UnityWebRequest
.
kHttpVerbGET
))
{
...
...
@@ -63,7 +63,7 @@ public class UnityFileDownloader
File
.
Delete
(
filePath
);
}
File
.
Move
(
tempFilePath
,
filePath
);
Debug
.
Log
(
string
.
Format
(
"下载成功: {0} -> {1}"
,
url
,
filePath
));
//
Debug.Log(string.Format("下载成功: {0} -> {1}", url, filePath));
if
(
onComplete
!=
null
)
{
...
...
@@ -72,7 +72,7 @@ public class UnityFileDownloader
}
else
{
Debug
.
LogError
(
string
.
Format
(
"下载失败: {0}\n错误信息: {1}"
,
url
,
uwr
.
error
));
//
Debug.LogError(string.Format("下载失败: {0}\n错误信息: {1}", url, uwr.error));
if
(
File
.
Exists
(
tempFilePath
))
{
File
.
Delete
(
tempFilePath
);
...
...
@@ -111,21 +111,21 @@ public class UnityFileDownloader
{
localEtag
=
File
.
ReadAllText
(
etagFilePath
);
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
Debug
.
LogWarning
(
string
.
Format
(
"读取本地ETag文件失败: {0}. Error: {1}. 将强制更新。"
,
etagFilePath
,
e
.
Message
));
//
Debug.LogWarning(string.Format("读取本地ETag文件失败: {0}. Error: {1}. 将强制更新。", etagFilePath, e.Message));
localEtag
=
null
;
// 读取失败则当做不存在
}
}
// 2. 发送HEAD请求获取服务器ETag
Debug
.
Log
(
string
.
Format
(
"[HEAD] 正在检查: {0}"
,
Path
.
GetFileName
(
filePath
)));
//
Debug.Log(string.Format("[HEAD] 正在检查: {0}", Path.GetFileName(filePath)));
UnityWebRequest
headRequest
=
UnityWebRequest
.
Head
(
url
);
yield
return
headRequest
.
SendWebRequest
();
if
(
headRequest
.
isNetworkError
||
headRequest
.
isHttpError
)
{
Debug
.
LogError
(
string
.
Format
(
"[HEAD] 请求失败: {0}\n错误: {1}"
,
url
,
headRequest
.
error
));
//
Debug.LogError(string.Format("[HEAD] 请求失败: {0}\n错误: {1}", url, headRequest.error));
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
false
);
yield
break
;
}
...
...
@@ -133,28 +133,28 @@ public class UnityFileDownloader
string
serverEtag
=
headRequest
.
GetResponseHeader
(
"ETag"
);
if
(
string
.
IsNullOrEmpty
(
serverEtag
))
{
Debug
.
LogError
(
string
.
Format
(
"[HEAD] 服务器未提供ETag头信息: {0}"
,
url
));
//
Debug.LogError(string.Format("[HEAD] 服务器未提供ETag头信息: {0}", url));
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
false
);
yield
break
;
}
Debug
.
Log
(
string
.
Format
(
"版本比较: Local ETag='{0}', Server ETag='{1}'"
,
localEtag
,
serverEtag
));
//
Debug.Log(string.Format("版本比较: Local ETag='{0}', Server ETag='{1}'", localEtag, serverEtag));
// 3. 比较ETag
if
(
localFileExists
&&
!
string
.
IsNullOrEmpty
(
localEtag
)
&&
localEtag
.
Equals
(
serverEtag
))
{
Debug
.
Log
(
string
.
Format
(
"[OK] 文件已是最新版本: {0}"
,
Path
.
GetFileName
(
filePath
)));
//
Debug.Log(string.Format("[OK] 文件已是最新版本: {0}", Path.GetFileName(filePath)));
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
true
);
// 已是最新,也算成功
yield
break
;
}
// 4. ETag不匹配或本地文件不存在,执行下载
Debug
.
Log
(
string
.
Format
(
"发现新版本或本地文件不存在,开始下载: {0}"
,
Path
.
GetFileName
(
filePath
)));
//
Debug.Log(string.Format("发现新版本或本地文件不存在,开始下载: {0}", Path.GetFileName(filePath)));
// --- Chaining Coroutine to get the result ---
bool
downloadSucceeded
=
false
;
// 创建一个回调,用于从DownloadFileAsync获取其执行结果
Action
<
bool
>
downloadCallback
=
delegate
(
bool
success
)
Action
<
bool
>
downloadCallback
=
delegate
(
bool
success
)
{
downloadSucceeded
=
success
;
};
...
...
@@ -168,12 +168,12 @@ public class UnityFileDownloader
try
{
File
.
WriteAllText
(
etagFilePath
,
serverEtag
);
Debug
.
Log
(
string
.
Format
(
"成功保存新的ETag到: {0}"
,
etagFilePath
));
//
Debug.Log(string.Format("成功保存新的ETag到: {0}", etagFilePath));
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
true
);
// 下载并保存ETag成功
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
Debug
.
LogError
(
string
.
Format
(
"保存ETag文件失败: {0}. Error: {1}"
,
etagFilePath
,
e
.
Message
));
//
Debug.LogError(string.Format("保存ETag文件失败: {0}. Error: {1}", etagFilePath, e.Message));
if
(
onComplete
!=
null
)
onComplete
.
Invoke
(
false
);
// ETag保存失败,算整体失败
}
}
...
...
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
dde96b6a
...
...
@@ -203,13 +203,7 @@ public class DeckManager : ServantWithCardDescription
{
base
.
applyShowArrangement
();
Program
.
cameraFacing
=
true
;
// UITexture tex = UIHelper.getByName<UITexture>(gameObjectSearch, "under_");
// tex.height = Screen.height;
// Vector3 targetPos = Program.camera_main_2d.ScreenToWorldPoint(
// new Vector3(Screen.width - MAIN_PANEL_MARGIN_RIGHT, Screen.height / 2, 0)
// );
// gameObjectSearch.transform.DOMove(targetPos, 0.6f);
// --- 1. 获取UI元素和安全区域 ---
UITexture
tex
=
UIHelper
.
getByName
<
UITexture
>(
gameObjectSearch
,
"under_"
);
Rect
safeArea
=
Screen
.
safeArea
;
...
...
@@ -516,17 +510,6 @@ public class DeckManager : ServantWithCardDescription
/// </summary>
private
const
float
DETAILED_SEARCH_PANEL_WIDTH
=
230f
;
/// <summary>
/// 主搜索面板距离屏幕右边缘的距离 (基于其中心点)
/// </summary>
private
const
float
MAIN_PANEL_MARGIN_RIGHT
=
MAIN_SEARCH_PANEL_WIDTH
/
2
;
/// <summary>
/// 详细搜索面板滑出后,与主搜索面板组合的总宽度 (用于计算位置)
/// </summary>
private
const
float
COMBINED_PANEL_WIDTH
=
MAIN_SEARCH_PANEL_WIDTH
+
DETAILED_SEARCH_PANEL_WIDTH
+
115f
;
// 115f 是原始代码中的一个偏移/间距值
/// <summary>
/// 摄像机右侧需要避让的边距 (当只有主搜索面板时)
/// </summary>
...
...
@@ -538,104 +521,6 @@ public class DeckManager : ServantWithCardDescription
/// </summary>
private
const
float
CAMERA_MARGIN_RIGHT_DETAILED
=
DETAILED_SEARCH_PANEL_WIDTH
;
// -----------------------------------------------------------------
// void refreshDetail()
// {
// if (gameObjectDetailedSearch != null)
// {
// if (isShowed)
// {
// if (Screen.height < 700)
// {
// gameObjectDetailedSearch.transform.localScale = new Vector3(
// Screen.height / 700f,
// Screen.height / 700f,
// Screen.height / 700f
// );
// if (detailShowed)
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = 700;
// Vector3 targetPos = Program.camera_main_2d.ScreenToWorldPoint(
// new Vector3(
// Screen.width
// - MAIN_SEARCH_PANEL_WIDTH
// - DETAILED_SEARCH_PANEL_WIDTH
// - 115f * Screen.height / 700f,
// Screen.height * 0.5f,
// 0
// )
// );
// gameObjectDetailedSearch.transform.DOMove(targetPos, 0.6f);
// reShowBar(
// 0,
// MAIN_SEARCH_PANEL_WIDTH
// + DETAILED_SEARCH_PANEL_WIDTH * Screen.height / 700f
// );
// }
// else
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = 700;
// Vector3 targetPos = Program.camera_main_2d.ScreenToWorldPoint(
// new Vector3(
// Screen.width
// - MAIN_SEARCH_PANEL_WIDTH
// - DETAILED_SEARCH_PANEL_WIDTH
// - 115f * Screen.height / 700f,
// Screen.height * 1.5f,
// 0
// )
// );
// gameObjectDetailedSearch.transform.DOMove(targetPos, 0.6f);
// reShowBar(0, CAMERA_MARGIN_RIGHT_NORMAL);
// }
// }
// else
// {
// gameObjectDetailedSearch.transform.localScale = Vector3.one;
// if (detailShowed)
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = Screen.height;
// Vector3 targetPos = Program.camera_main_2d.ScreenToWorldPoint(
// new Vector3(
// Screen.width - COMBINED_PANEL_WIDTH,
// Screen.height * 0.5f,
// 0
// )
// );
// gameObjectDetailedSearch.transform.DOMove(targetPos, 0.6f);
// reShowBar(0, MAIN_SEARCH_PANEL_WIDTH + DETAILED_SEARCH_PANEL_WIDTH);
// }
// else
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = Screen.height;
// Vector3 targetPos = Program.camera_main_2d.ScreenToWorldPoint(
// new Vector3(
// Screen.width - COMBINED_PANEL_WIDTH,
// Screen.height * 1.5f,
// 0
// )
// );
// gameObjectDetailedSearch.transform.DOMove(targetPos, 0.6f);
// reShowBar(0, CAMERA_MARGIN_RIGHT_NORMAL);
// }
// }
// }
// else
// {
// gameObjectDetailedSearch.transform.localScale = Vector3.zero;
// }
// }
// }
// 在 DeckManager.cs 文件中
void
refreshDetail
()
{
if
(
gameObjectDetailedSearch
==
null
||
!
isShowed
)
...
...
@@ -690,7 +575,7 @@ public class DeckManager : ServantWithCardDescription
// 逻辑:安全区右边缘 - 主面板宽度 - 详细面板宽度的一半(考虑缩放)
float
visibleTargetX
=
safeAreaRightEdgeX
-
searchPanelActualWidth
-
(
DETAILED_SEARCH_PANEL_WIDTH
/
2f
*
scaleFactor
);
Debug
.
Log
(
"visibleTargetX: "
+
visibleTargetX
);
//
Debug.Log("visibleTargetX: " + visibleTargetX);
// “隐藏时”的目标 Y 坐标,把它移动到屏幕顶部之外
float
hiddenTargetY
=
Screen
.
height
*
1.5f
;
...
...
@@ -1680,16 +1565,6 @@ public class DeckManager : ServantWithCardDescription
private
void
camrem
()
{
// float l = Program.I().cardDescription.width + ((float)Screen.width) * 0.03f;
// float r = Screen.width - 230f;
// if (detailShowed)
// {
// if (gameObjectDetailedSearch != null)
// {
// // [修改] 使用常量替换硬编码的 230
// r -= CAMERA_MARGIN_RIGHT_DETAILED * gameObjectDetailedSearch.transform.localScale.x;
// }
// }
// 获取安全区域
Rect
safeArea
=
Screen
.
safeArea
;
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
dde96b6a
...
...
@@ -144,7 +144,7 @@ public class selectReplay : WindowServantSP
var
collection
=
TcpHelper
.
readPackagesInRecord
(
path
);
foreach
(
var
item
in
collection
)
{
Debug
.
Log
(
item
.
Fuction
);
//
Debug.Log(item.Fuction);
if
(
item
.
Fuction
==
(
int
)
YGOSharp
.
OCGWrapper
.
Enums
.
GameMessage
.
sibyl_replay
)
{
returnValue
=
item
.
Data
.
reader
.
ReadToEnd
();
...
...
@@ -156,7 +156,7 @@ public class selectReplay : WindowServantSP
{
Debug
.
Log
(
e
);
}
Debug
.
Log
(
returnValue
);
//
Debug.Log(returnValue);
return
returnValue
;
}
...
...
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