Commit 61be2be9 authored by SherryChaos's avatar SherryChaos

download YPK by URL, case error fix

parent 93621da4
...@@ -15,7 +15,7 @@ MonoBehaviour: ...@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: ca8b8e6916019834fb0ec5578fa0be37 m_DefaultGroup: ca8b8e6916019834fb0ec5578fa0be37
m_currentHash: m_currentHash:
serializedVersion: 2 serializedVersion: 2
Hash: 00000000000000000000000000000000 Hash: a7787d5667f17613de3b1b0e88584bac
m_OptimizeCatalogSize: 0 m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0 m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0 m_CatalogRequestsTimeout: 0
......
This diff is collapsed.
fileFormatVersion: 2
guid: fc30482cb33dcd041baa9aad2c794346
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
MDPro3 v1.3.1更新:
1.【设置-扩展卡包】中新增输入下载地址自动下载并部署自定义卡包的功能。
2.修复Linux端决斗中需要显示“解放怪兽”特效时,游戏卡死的问题。
3.*修复Mac端非Apple Silicon芯片的设备无法本地决斗的错误。
4.*修复非Windows端无法导入、导出文件的错误。
MDPro3 v1.3.0更新: MDPro3 v1.3.0更新:
0.本次更新跳过了v1.2.9版本,仅提供完整包安装。 0.本次更新跳过了v1.2.9版本,仅提供完整包安装。
1.新增对Linux、macOS的支持。 1.新增对Linux、macOS的支持。
...@@ -6,65 +12,3 @@ MDPro3 v1.3.0更新: ...@@ -6,65 +12,3 @@ MDPro3 v1.3.0更新:
3.渲染先行卡卡图时,原以卡图设置语言为准,现改为先行卡语言(更新先行卡时的系统语言)为准。 3.渲染先行卡卡图时,原以卡图设置语言为准,现改为先行卡语言(更新先行卡时的系统语言)为准。
4.修复登录MyCard账号时,账号或密码中包含特殊字符时无法登录的错误。 4.修复登录MyCard账号时,账号或密码中包含特殊字符时无法登录的错误。
5.修复部分场地的BGM与预期不符的错误。 5.修复部分场地的BGM与预期不符的错误。
# MDPro3 Translation Credits
Below is the list of contributors who have generously donated their time and expertise to localise **MDPro3**. Thank you all for keeping the project alive!
## English
* **SenatorJohn** — Project lead; maintainer of the Discord community [MDPro3 Requiem](https://discord.gg/GVZb4dC44b) and of the card database. Pre‑release translations courtesy of [YGOrganization](https://ygorganization.com/category/news/ocg-tcg/).
* **Reinen** — Original initiator of the English translation.
* **ShinTheAbsol** — Provided fixes and improvements to the English translation.
## French
* **Takatuktuk** — Initiated the French translation; translated `strings.conf` and the UI.
* **Zilco** — Translated pre‑release cards, corrected .cdb errors, proof‑read translations, and wrote WindBot dialogues.
* **SenatorJohn** — Maintains the French database.
## German
* **Pazze** — Translated part of `strings.conf` and the entire UI.
* **SenatorJohn** — Completed the remaining `strings.conf`, proof‑read, and maintains the database.
* **dennisw100** — Translated a large number of cards.
* **Fabio (Umbra Lunar)** — Translated the remaining cards together with dennisw100.
* **Tyliion** — Contributed 15 card translations.
## Italian
* **GigioFede & Berry** — Started the Italian localisation project.
* **SevenSaske** — Translated `strings.conf` and the UI.
* **RashFaustino** — Translated the remaining 212 cards, all pre‑release cards, and proof‑read the UI and `strings.conf`.
* **Unlucky** — Assisted RashFaustino with card translations.
* **SenatorJohn** — Maintains the Italian database.
## Portuguese
* **Kewyn** — Main translator for Portuguese pre‑release cards.
* **SenatorJohn** — Maintains the Portuguese database.
## Spanish
* **Dårk Zånë** — Main translator for Spanish pre‑release cards; maintains the Spanish database.
* **Termo‑DAK** — Developed the “Evolution Server”.
## Japanese
* **SenatorJohn** — Main translator for Japanese pre‑release cards (source: [OCG‑Card](https://ocg-card.com/)).
## Korean
* **응애** — Main translator for Korean cards.
* **JSY1728** — Provided card errata and UI fixes.
* **SenatorJohn** — Maintains the Korean database.
---
### Special Thanks
* **BullyWiiPlaza** — Development of tools and extraction of Duel Links voice lines, and good tutorials for new users.
* **Sherry Chaos** — Creator of this amazing project.
* **ggezeee** — For doing the "How to Install" Manual.
END_
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -1203,7 +1203,7 @@ namespace MDPro3 ...@@ -1203,7 +1203,7 @@ namespace MDPro3
if ((p.reason & (uint)CardReason.RELEASE) > 0 && model != null) if ((p.reason & (uint)CardReason.RELEASE) > 0 && model != null)
{ {
se = "SE_SUMMON_ADVANCE"; se = "SE_SUMMON_ADVANCE";
var fx = ABLoader.LoadFromFile("MasterDuel/Effects/Sacrifice/fxp_sacrifice_rls_001", true); var fx = ABLoader.LoadFromFile("MasterDuel/Effects/Sacrifice/fxp_Sacrifice_rls_001", true);
fx.transform.position = model.transform.position; fx.transform.position = model.transform.position;
Destroy(fx, 5f); Destroy(fx, 5f);
} }
...@@ -1695,7 +1695,7 @@ namespace MDPro3 ...@@ -1695,7 +1695,7 @@ namespace MDPro3
if ((p.reason & (uint)CardReason.RELEASE) > 0 && model != null) if ((p.reason & (uint)CardReason.RELEASE) > 0 && model != null)
{ {
se = "SE_SUMMON_ADVANCE"; se = "SE_SUMMON_ADVANCE";
var fx = ABLoader.LoadFromFile("MasterDuel/Effects/Sacrifice/fxp_sacrifice_rls_001", true); var fx = ABLoader.LoadFromFile("MasterDuel/Effects/Sacrifice/fxp_Sacrifice_rls_001", true);
fx.transform.position = model.transform.position; fx.transform.position = model.transform.position;
Destroy(fx, 5f); Destroy(fx, 5f);
} }
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
#if SUPPORT_WINDOWS_PORT #if UNITY_EDITOR || (!UNITY_ANDROID && !UNITY_IOS)
using SFB; using SFB;
#endif #endif
...@@ -34,7 +34,6 @@ namespace MDPro3 ...@@ -34,7 +34,6 @@ namespace MDPro3
private static void ChooseFiles() private static void ChooseFiles()
{ {
#if SUPPORT_WINDOWS_PORT
var extensions = new[] var extensions = new[]
{ {
new ExtensionFilter(InterString.Get("所有文件"), "*"), new ExtensionFilter(InterString.Get("所有文件"), "*"),
...@@ -49,13 +48,10 @@ namespace MDPro3 ...@@ -49,13 +48,10 @@ namespace MDPro3
{ {
CopyFilesToGame(paths); CopyFilesToGame(paths);
}); });
#endif
} }
private static void ChooseBGPicture() private static void ChooseBGPicture()
{ {
#if SUPPORT_WINDOWS_PORT
var extensions = new[] var extensions = new[]
{ {
new ExtensionFilter(InterString.Get("图片文件"), "png", "jpg") new ExtensionFilter(InterString.Get("图片文件"), "png", "jpg")
...@@ -64,7 +60,6 @@ namespace MDPro3 ...@@ -64,7 +60,6 @@ namespace MDPro3
{ {
CopyBGToGame(paths); CopyBGToGame(paths);
}); });
#endif
} }
private static void CopyBGToGame(IEnumerable<string> files) private static void CopyBGToGame(IEnumerable<string> files)
...@@ -190,7 +185,7 @@ namespace MDPro3 ...@@ -190,7 +185,7 @@ namespace MDPro3
NativeFilePicker.ExportMultipleFiles(filePaths, ExportResult); NativeFilePicker.ExportMultipleFiles(filePaths, ExportResult);
if(!copy) if(!copy)
filesToDelete = filePaths.ToList(); filesToDelete = filePaths.ToList();
#elif SUPPORT_WINDOWS_PORT #else
StandaloneFileBrowser.OpenFolderPanelAsync(InterString.Get("请选择导出目录"), "", false, (string[] paths) => StandaloneFileBrowser.OpenFolderPanelAsync(InterString.Get("请选择导出目录"), "", false, (string[] paths) =>
{ {
ExportFiles(paths, filePaths, copy); ExportFiles(paths, filePaths, copy);
...@@ -216,7 +211,6 @@ namespace MDPro3 ...@@ -216,7 +211,6 @@ namespace MDPro3
ExportResult(false); ExportResult(false);
} }
} }
} }
} }
...@@ -6,11 +6,11 @@ namespace MDPro3 ...@@ -6,11 +6,11 @@ namespace MDPro3
{ {
public class ZipHelper public class ZipHelper
{ {
public static List<ZipFile> zips = new List<ZipFile>(); public static List<ZipFile> zips = new();
public static void Initialize() public static void Initialize()
{ {
zips.Clear(); Dispose();
if (!Directory.Exists("Expansions")) if (!Directory.Exists("Expansions"))
Directory.CreateDirectory("Expansions"); Directory.CreateDirectory("Expansions");
...@@ -21,10 +21,12 @@ namespace MDPro3 ...@@ -21,10 +21,12 @@ namespace MDPro3
zips.Add(new ZipFile("Data/script.zip"));//Make "Data/script.zip" the last one to read. zips.Add(new ZipFile("Data/script.zip"));//Make "Data/script.zip" the last one to read.
} }
public static void Dispose() public static void Dispose()
{ {
foreach (var zip in zips) foreach (var zip in zips)
zip.Dispose(); zip.Dispose();
zips.Clear();
} }
public static List<string> GetAllCdbTempPath() public static List<string> GetAllCdbTempPath()
......
...@@ -33,7 +33,10 @@ namespace MDPro3.Net ...@@ -33,7 +33,10 @@ namespace MDPro3.Net
public static MyCardApp ygopro; public static MyCardApp ygopro;
public static Texture2D avatar; public static Texture2D avatar;
const int avatarSize = 256; private const string avatarSavePath = "Picture/MyCardAvatars/";
private static readonly Dictionary<string, string> cachedAvatarAddress = new();
private static readonly Dictionary<string, Texture2D> cachedAvatars = new();
private const int avatarSize = 256;
public static async Task<MyCardAccount> Login(string account, string password) public static async Task<MyCardAccount> Login(string account, string password)
{ {
...@@ -113,9 +116,6 @@ namespace MDPro3.Net ...@@ -113,9 +116,6 @@ namespace MDPro3.Net
} }
} }
private const string avatarSavePath = "Picture/MyCardAvatars/";
private static Dictionary<string, string> cachedAvatarAddress = new();
private static Dictionary<string, Texture2D> cachedAvatars = new();
public static async Task<Texture2D> GetAvatarAsync(string userName) public static async Task<Texture2D> GetAvatarAsync(string userName)
{ {
if(!Directory.Exists(avatarSavePath)) if(!Directory.Exists(avatarSavePath))
...@@ -281,7 +281,10 @@ namespace MDPro3.Net ...@@ -281,7 +281,10 @@ namespace MDPro3.Net
#region WebSocket Athletic Watch #region WebSocket Athletic Watch
private static string currentEventType;
private static WebSocket socket; private static WebSocket socket;
public static void ConnectToAthleticWatchListWebSocket() public static void ConnectToAthleticWatchListWebSocket()
{ {
socket = new WebSocket(athleticWatchUrl); socket = new WebSocket(athleticWatchUrl);
...@@ -309,22 +312,23 @@ namespace MDPro3.Net ...@@ -309,22 +312,23 @@ namespace MDPro3.Net
{ {
Debug.Log(string.Format("Socket Connected: {0}", athleticWatchUrl)); Debug.Log(string.Format("Socket Connected: {0}", athleticWatchUrl));
} }
private static void OnSocketClose(object sender, CloseEventArgs e) private static void OnSocketClose(object sender, CloseEventArgs e)
{ {
Debug.Log(string.Format("Socket Closed: StatusCode: {0}, Reason: {1}", e.StatusCode, e.Reason)); Debug.Log(string.Format("Socket Closed: StatusCode: {0}, Reason: {1}", e.StatusCode, e.Reason));
} }
private static void OnSocketError(object sender, UnityWebSocket.ErrorEventArgs e) private static void OnSocketError(object sender, UnityWebSocket.ErrorEventArgs e)
{ {
Debug.Log(string.Format("Socket Error: {0}", e.Message)); Debug.Log(string.Format("Socket Error: {0}", e.Message));
} }
private static void OnSocketMessage(object sender, MessageEventArgs e) private static void OnSocketMessage(object sender, MessageEventArgs e)
{ {
//Debug.Log(string.Format("Receive: {0}", e.Data)); //Debug.Log(string.Format("Receive: {0}", e.Data));
HandleWatchInfo(e.Data); HandleWatchInfo(e.Data);
} }
static string currentEventType;
private static void HandleWatchInfo(string json) private static void HandleWatchInfo(string json)
{ {
var info = JsonConvert.DeserializeObject<MyCardWatchInfo>(json); var info = JsonConvert.DeserializeObject<MyCardWatchInfo>(json);
...@@ -348,6 +352,7 @@ namespace MDPro3.Net ...@@ -348,6 +352,7 @@ namespace MDPro3.Net
break; break;
} }
} }
private static void HandleRooms(JArray rooms) private static void HandleRooms(JArray rooms)
{ {
var list = new List<MyCardRoom>(); var list = new List<MyCardRoom>();
...@@ -358,6 +363,7 @@ namespace MDPro3.Net ...@@ -358,6 +363,7 @@ namespace MDPro3.Net
} }
Program.instance.online.SetWatchRooms(list); Program.instance.online.SetWatchRooms(list);
} }
private static void HandleSingleRoom(JObject room) private static void HandleSingleRoom(JObject room)
{ {
var roomInstance = room.ToObject<MyCardRoom>(); var roomInstance = room.ToObject<MyCardRoom>();
...@@ -371,13 +377,24 @@ namespace MDPro3.Net ...@@ -371,13 +377,24 @@ namespace MDPro3.Net
break; break;
} }
} }
private static void HandleDelete(string roomId) private static void HandleDelete(string roomId)
{ {
Program.instance.online.DeleteWatchRoom(roomId); Program.instance.online.DeleteWatchRoom(roomId);
} }
#endregion #endregion
#region Mycard Tools #region MyCard Tools
public enum RoomAction
{
CreatePublic = 1,
CreatePrivate = 2,
JoinPublic = 3,
JoinPrivate = 5,
}
public static string GetJoinRoomPassword(MyCardRoomOptions options, string roomId, int userId, bool _private = false) public static string GetJoinRoomPassword(MyCardRoomOptions options, string roomId, int userId, bool _private = false)
{ {
byte[] optionsBuffer = new byte[6]; byte[] optionsBuffer = new byte[6];
...@@ -389,6 +406,7 @@ namespace MDPro3.Net ...@@ -389,6 +406,7 @@ namespace MDPro3.Net
return base64String + roomId; return base64String + roomId;
} }
public static string GetCreateRoomPasswd(MyCardRoomOptions options, string roomID, int userId, bool _private = false) public static string GetCreateRoomPasswd(MyCardRoomOptions options, string roomID, int userId, bool _private = false)
{ {
byte[] optionsBuffer = new byte[6]; byte[] optionsBuffer = new byte[6];
...@@ -440,13 +458,7 @@ namespace MDPro3.Net ...@@ -440,13 +458,7 @@ namespace MDPro3.Net
buffer[offset] = (byte)(value & 0xff); buffer[offset] = (byte)(value & 0xff);
buffer[offset + 1] = (byte)((value >> 8) & 0xff); buffer[offset + 1] = (byte)((value >> 8) & 0xff);
} }
public enum RoomAction
{
CreatePublic = 1,
CreatePrivate = 2,
JoinPublic = 3,
JoinPrivate = 5,
}
#endregion #endregion
} }
...@@ -456,11 +468,13 @@ namespace MDPro3.Net ...@@ -456,11 +468,13 @@ namespace MDPro3.Net
public MyCardUserInfo user; public MyCardUserInfo user;
public string token; public string token;
} }
[Serializable] [Serializable]
public class MyCardRoomUserInfo public class MyCardRoomUserInfo
{ {
public MyCardUserInfo user; public MyCardUserInfo user;
} }
[Serializable] [Serializable]
public class MyCardUserInfo public class MyCardUserInfo
{ {
...@@ -507,6 +521,7 @@ namespace MDPro3.Net ...@@ -507,6 +521,7 @@ namespace MDPro3.Net
public string address; public string address;
public string[] windbot; public string[] windbot;
} }
[Serializable] [Serializable]
public class MyCardWindbots public class MyCardWindbots
{ {
...@@ -515,6 +530,7 @@ namespace MDPro3.Net ...@@ -515,6 +530,7 @@ namespace MDPro3.Net
[JsonProperty("zh-CN")] [JsonProperty("zh-CN")]
public string[] ChineseCN { get; set; } public string[] ChineseCN { get; set; }
} }
[Serializable] [Serializable]
public class MyCardNews public class MyCardNews
{ {
...@@ -523,6 +539,7 @@ namespace MDPro3.Net ...@@ -523,6 +539,7 @@ namespace MDPro3.Net
[JsonProperty("zh-CN")] [JsonProperty("zh-CN")]
public News[] ChineseCN { get; set; } public News[] ChineseCN { get; set; }
} }
[Serializable] [Serializable]
public class News public class News
{ {
...@@ -532,6 +549,7 @@ namespace MDPro3.Net ...@@ -532,6 +549,7 @@ namespace MDPro3.Net
public string title; public string title;
public string updated_at; public string updated_at;
} }
[Serializable] [Serializable]
public class MyCardUserExp public class MyCardUserExp
{ {
...@@ -550,6 +568,7 @@ namespace MDPro3.Net ...@@ -550,6 +568,7 @@ namespace MDPro3.Net
public string athletic_wl_ratio; public string athletic_wl_ratio;
public int arena_rank; public int arena_rank;
} }
[Serializable] [Serializable]
public class MyCardMatchInfo public class MyCardMatchInfo
{ {
...@@ -565,6 +584,7 @@ namespace MDPro3.Net ...@@ -565,6 +584,7 @@ namespace MDPro3.Net
public string eventType; public string eventType;
public object data; public object data;
} }
[Serializable] [Serializable]
public class MyCardRoom public class MyCardRoom
{ {
...@@ -575,12 +595,14 @@ namespace MDPro3.Net ...@@ -575,12 +595,14 @@ namespace MDPro3.Net
public MyCardRoomOptions options; public MyCardRoomOptions options;
public string arena; public string arena;
} }
[Serializable] [Serializable]
public class MyCardRoomUser public class MyCardRoomUser
{ {
public string username; public string username;
public int position; public int position;
} }
[Serializable] [Serializable]
public class MyCardRoomOptions public class MyCardRoomOptions
{ {
...@@ -598,4 +620,5 @@ namespace MDPro3.Net ...@@ -598,4 +620,5 @@ namespace MDPro3.Net
public bool auto_death; public bool auto_death;
public int replay_mode; public int replay_mode;
} }
} }
using System;
namespace MDPro3.Net
{
public static class NetUtil
{
public static bool IsValidUrl(string inputUrl)
{
if(string.IsNullOrEmpty(inputUrl))
return false;
if (!inputUrl.StartsWith("http://") && !inputUrl.StartsWith("https://"))
inputUrl = "http://" + inputUrl;
if (!Uri.TryCreate(inputUrl, UriKind.Absolute, out Uri uriResult))
return false;
if (uriResult.Scheme != Uri.UriSchemeHttp && uriResult.Scheme != Uri.UriSchemeHttps)
return false;
return true;
}
public static bool IsValidDownloadUrl(string inputUrl, string[] supportExtensions)
{
bool hasValidExtension = false;
foreach(var ext in supportExtensions)
if (inputUrl.ToLower().Contains(ext.ToLower()))
{
hasValidExtension = true;
break;
}
if (hasValidExtension)
{
return IsValidUrl(inputUrl);
}
else
return false;
}
}
}
fileFormatVersion: 2
guid: 8e3b69f1cb0b46448b0c3524ab5058db
\ No newline at end of file
using MDPro3.Net;
using MDPro3.UI; using MDPro3.UI;
using MDPro3.UI.ServantUI; using MDPro3.UI.ServantUI;
using MDPro3.Utility; using MDPro3.Utility;
...@@ -143,6 +144,7 @@ namespace MDPro3.Servant ...@@ -143,6 +144,7 @@ namespace MDPro3.Servant
} }
private bool checkingPrereleaseUpdate; private bool checkingPrereleaseUpdate;
public void UpdatePrerelease() public void UpdatePrerelease()
{ {
if (!checkingPrereleaseUpdate) if (!checkingPrereleaseUpdate)
...@@ -187,7 +189,6 @@ namespace MDPro3.Servant ...@@ -187,7 +189,6 @@ namespace MDPro3.Servant
} }
if (download.result == UnityWebRequest.Result.Success) if (download.result == UnityWebRequest.Result.Success)
{ {
ZipHelper.Dispose();
File.WriteAllBytes(filePath, download.downloadHandler.data); File.WriteAllBytes(filePath, download.downloadHandler.data);
MessageManager.Cast(InterString.Get("先行卡更新成功。")); MessageManager.Cast(InterString.Get("先行卡更新成功。"));
Config.Set("Prerelease", lines[0]); Config.Set("Prerelease", lines[0]);
...@@ -207,5 +208,60 @@ namespace MDPro3.Servant ...@@ -207,5 +208,60 @@ namespace MDPro3.Servant
checkingPrereleaseUpdate = false; checkingPrereleaseUpdate = false;
} }
private bool downloadingYPK;
public void DownloadYPK()
{
if (!downloadingYPK)
{
var selections = new List<string>()
{
InterString.Get("下载卡包@n请输入卡包的下载地址"),
string.Empty
};
UIManager.ShowPopupInput(selections, DownloadYPK, null, TmpInputValidation.ValidationType.None);
}
else
MessageManager.Toast(InterString.Get("正在下载中,请稍后再试。"));
}
private void DownloadYPK(string url)
{
string[] supportedExts = new string[] { ".zip", ".ypk" };
if (!NetUtil.IsValidDownloadUrl(url, supportedExts))
{
MessageManager.Toast(InterString.Get("无效的下载地址。"));
return;
}
StartCoroutine(DownloadYpkAsync(url));
}
private IEnumerator DownloadYpkAsync(string url)
{
downloadingYPK = true;
using var request = UnityWebRequest.Get(url);
request.SendWebRequest();
while (!request.isDone)
{
GetUI<SettingServantUI>().ButtonDownloadYPK.SetModeText((request.downloadProgress * 100f).ToString("0.##") + "%");
yield return null;
}
if (request.result == UnityWebRequest.Result.Success)
{
var filePath = Path.Combine(Program.PATH_EXPANSIONS, Path.GetFileName(url));
if (!Directory.Exists(Program.PATH_EXPANSIONS))
Directory.CreateDirectory(Program.PATH_EXPANSIONS);
File.WriteAllBytes(filePath, request.downloadHandler.data);
MessageManager.Cast(InterString.Get("下载成功。"));
Program.instance.InitializeForDataChange();
}
else
MessageManager.Cast(InterString.Get("下载失败。"));
GetUI<SettingServantUI>().ButtonDownloadYPK.SetModeText(string.Empty);
downloadingYPK = false;
}
} }
} }
...@@ -13,10 +13,10 @@ namespace MDPro3.UI ...@@ -13,10 +13,10 @@ namespace MDPro3.UI
public class SelectionButton_Setting : SelectionButton public class SelectionButton_Setting : SelectionButton
{ {
[Header("Setting")] [Header("Setting")]
[SerializeField] Slider slider; [SerializeField] private Slider slider;
[SerializeField] RectTransform arrow; [SerializeField] private RectTransform arrow;
[SerializeField] TextMeshProUGUI modeText; [SerializeField] private TextMeshProUGUI modeText;
[SerializeField] TextMeshProUGUI noteText; [SerializeField] private TextMeshProUGUI noteText;
public void SetModeText(string text) public void SetModeText(string text)
{ {
...@@ -90,12 +90,6 @@ namespace MDPro3.UI ...@@ -90,12 +90,6 @@ namespace MDPro3.UI
return slider.value; return slider.value;
} }
public void SetClickEvent(UnityAction call)
{
if(Selectable is Button button)
button.onClick.AddListener(call);
}
protected override void HoverOn() protected override void HoverOn()
{ {
if (hoverd) if (hoverd)
......
using MDPro3.Net;
using MDPro3.Servant; using MDPro3.Servant;
using MDPro3.Utility; using MDPro3.Utility;
using System; using System;
...@@ -6,6 +7,7 @@ using System.Collections.Generic; ...@@ -6,6 +7,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
...@@ -523,6 +525,12 @@ namespace MDPro3.UI.ServantUI ...@@ -523,6 +525,12 @@ namespace MDPro3.UI.ServantUI
m_ButtonUpdatePrerelease = m_ButtonUpdatePrerelease != null ? m_ButtonUpdatePrerelease m_ButtonUpdatePrerelease = m_ButtonUpdatePrerelease != null ? m_ButtonUpdatePrerelease
: Manager.GetElement<SelectionButton_Setting>(LABEL_SBN_UPDATEPRERELEASE); : Manager.GetElement<SelectionButton_Setting>(LABEL_SBN_UPDATEPRERELEASE);
private const string LABEL_SBN_DOWNLOAD_YPK = "DonwloadYPK";
private SelectionButton_Setting m_ButtonDownloadYPK;
public SelectionButton_Setting ButtonDownloadYPK =>
m_ButtonDownloadYPK = m_ButtonDownloadYPK != null ? m_ButtonDownloadYPK
: Manager.GetElement<SelectionButton_Setting>(LABEL_SBN_DOWNLOAD_YPK);
#endregion #endregion
#endregion #endregion
...@@ -2189,6 +2197,7 @@ namespace MDPro3.UI.ServantUI ...@@ -2189,6 +2197,7 @@ namespace MDPro3.UI.ServantUI
var config = Config.GetBool("Expansions", true); var config = Config.GetBool("Expansions", true);
ButtonExpansionSupport.SetModeText(InterString.Get(config ? "是" : "否")); ButtonExpansionSupport.SetModeText(InterString.Get(config ? "是" : "否"));
} }
public void OnSupportExpansions() public void OnSupportExpansions()
{ {
if (Program.instance.ocgcore.showing) if (Program.instance.ocgcore.showing)
...@@ -2203,6 +2212,7 @@ namespace MDPro3.UI.ServantUI ...@@ -2203,6 +2212,7 @@ namespace MDPro3.UI.ServantUI
Program.instance.InitializeForDataChange(); Program.instance.InitializeForDataChange();
} }
public void OnClearExpansions() public void OnClearExpansions()
{ {
if (Program.instance.ocgcore.showing) if (Program.instance.ocgcore.showing)
...@@ -2220,7 +2230,6 @@ namespace MDPro3.UI.ServantUI ...@@ -2220,7 +2230,6 @@ namespace MDPro3.UI.ServantUI
}; };
UIManager.ShowPopupYesOrNo(selections, () => UIManager.ShowPopupYesOrNo(selections, () =>
{ {
ZipHelper.Dispose();
if (!Directory.Exists(Program.PATH_EXPANSIONS)) if (!Directory.Exists(Program.PATH_EXPANSIONS))
Directory.CreateDirectory(Program.PATH_EXPANSIONS); Directory.CreateDirectory(Program.PATH_EXPANSIONS);
foreach (var file in Directory.GetFiles(Program.PATH_EXPANSIONS)) foreach (var file in Directory.GetFiles(Program.PATH_EXPANSIONS))
...@@ -2239,6 +2248,17 @@ namespace MDPro3.UI.ServantUI ...@@ -2239,6 +2248,17 @@ namespace MDPro3.UI.ServantUI
Program.instance.setting.UpdatePrerelease(); Program.instance.setting.UpdatePrerelease();
} }
public void OnDownloadYPK()
{
if (Program.instance.ocgcore.showing)
{
MessageManager.Toast(InterString.Get("决斗中不能进行此操作。"));
return;
}
Program.instance.setting.DownloadYPK();
}
#endregion #endregion
#region About #region About
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment