Commit 69390a82 authored by SherryChaos's avatar SherryChaos

windbot now can use expansions cards

parent 298994a7
......@@ -10,12 +10,12 @@ MDPro v1.2.0更新:
③"SavedCardFormat",".jpg"或者".png",调整保存卡图的格式。
PS:新增的选项会在至少运行一次新版本游戏后才会出现。
5.现在,成为召唤素材的卡片会在同一时间飞出。
6.编辑卡组界面的卡片详情能翻动查看上一张或下一张卡,仅限卡组中的卡,快捷键左右方向键。
6.编辑卡组界面的卡片详情能翻动查看上一张或下一张卡,快捷键:左右方向键。
7.卡片详情页面现在能放大卡图了,快捷键:方向键上(放大)方向键下(还原)。
8.卡片详情中保存卡图新增一键[保存所有卡图]和[一键保存所有衍生物卡图]的选项。
9.修复决斗中无法在卡片详情中保存卡图的错误。
10.修复安卓端[天霆号 阿宙斯]的卡片特效的显示错误。
11.修复Windbot不能读取扩展卡的错误。
MDPro v1.1.9更新:
1.新增部分自定义功能,设置文件位于“Data/Settings.json“:
......
This diff is collapsed.
......@@ -23553,7 +23553,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1581995138}
m_Direction: 2
m_Value: 0
m_Size: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -27811,7 +27811,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 931169952}
m_Direction: 2
m_Value: 0
m_Size: 0.6103896
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -50105,7 +50105,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.000030517578}
m_AnchoredPosition: {x: 0, y: 0.000030517578}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &702608002
......@@ -54023,7 +54023,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 476827028}
m_Direction: 2
m_Value: 1
m_Size: 0.6256983
m_Size: 0.60808754
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -69121,7 +69121,7 @@ GameObject:
- component: {fileID: 983202227}
- component: {fileID: 983202226}
m_Layer: 5
m_Name: '#Text_SettingValue'
m_Name: Text_SettingValue
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -71793,7 +71793,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 948258731}
m_Direction: 2
m_Value: 0
m_Size: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -77464,7 +77464,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.000030517578}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0.5, y: 1}
--- !u!1 &1117266860
......@@ -98445,7 +98445,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 761159127}
m_Direction: 2
m_Value: 0
m_Size: 0.6629212
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -103723,7 +103723,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 2083794100}
m_Direction: 2
m_Value: 0
m_Size: 0.5588235
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -140,7 +140,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u6D4B\u8BD5"
m_text: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\n\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\n\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\n\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\n\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4f2b4779da094154fa119234dbc5a2cb, type: 2}
m_sharedMaterial: {fileID: 1463209681449585872, guid: 4f2b4779da094154fa119234dbc5a2cb, type: 2}
......@@ -167,12 +167,12 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 30
m_fontSize: 12.4
m_fontSizeBase: 30
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_enableAutoSizing: 1
m_fontSizeMin: 10
m_fontSizeMax: 30
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
......
......@@ -25,5 +25,28 @@ namespace MDPro3
foreach (var zip in zips)
zip.Dispose();
}
public static List<string> GetAllCdbTempPath()
{
var returnValue = new List<string>();
foreach (var zip in zips)
{
if (zip.Name.ToLower().EndsWith("script.zip"))
continue;
foreach (var file in zip.EntryFileNames)
{
if (file.ToLower().EndsWith(".cdb"))
{
var e = zip[file];
if (!Directory.Exists(Program.tempFolder))
Directory.CreateDirectory(Program.tempFolder);
var tempFile = Path.Combine(Path.GetFullPath(Program.tempFolder), file);
e.Extract(Path.GetFullPath(Program.tempFolder), ExtractExistingFileAction.OverwriteSilently);
returnValue.Add(tempFile);
}
}
}
return returnValue;
}
}
}
......@@ -5159,7 +5159,7 @@ namespace MDPro3
var valstring = StringHelper.Get(pvalue);
if (pvalue == 38723936)
{
valstring = InterString.Get("不能确认墓地的卡");
valstring = InterString.Get("不能确认墓地的卡");
if (player == 0)
{
if (ptype == 6)
......@@ -5181,9 +5181,9 @@ namespace MDPro3
else if (ptype == 7)
{
if (player == 0)
PrintDuelLog(InterString.Get("我方取消状态:[?]", valstring));
PrintDuelLog(InterString.Get("我方状态结束:[?]", valstring));
else
PrintDuelLog(InterString.Get("对方取消状态:[?]", valstring));
PrintDuelLog(InterString.Get("对方状态结束:[?]", valstring));
}
break;
case GameMessage.CardHint:
......
......@@ -6,6 +6,8 @@ using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper;
using System.Collections.Specialized;
using System.Collections.Generic;
using MDPro3;
namespace WindBot
{
......@@ -64,7 +66,11 @@ namespace WindBot
Console.ReadKey();
System.Environment.Exit(1);
}
NamedCardsManager.Init(absolutePath);
var paths = ZipHelper.GetAllCdbTempPath();
paths.Add(absolutePath);
foreach(var cdb in Directory.GetFiles(MDPro3.Program.expansionsPath, "*.cdb"))
paths.Add(cdb);
NamedCardsManager.InitForMulti(paths);
}
private static void RunFromArgs()
......
......@@ -46,6 +46,43 @@ namespace YGOSharp.OCGWrapper
}
}
public static void InitForMulti(List<string> databaseFullPaths)
{
try
{
_cards = new Dictionary<int, NamedCard>();
foreach(var databaseFullPath in databaseFullPaths)
{
if (!File.Exists(databaseFullPath))
continue;
using (SqliteConnection connection = new SqliteConnection("Data Source=" + databaseFullPath))
{
connection.Open();
using (IDbCommand command = new SqliteCommand(
"SELECT datas.id, ot, alias, setcode, type, level, race, attribute, atk, def, texts.name, texts.desc"
+ " FROM datas INNER JOIN texts ON datas.id = texts.id",
connection))
{
using (IDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
LoadCard(reader);
}
}
}
}
}
}
catch (Exception ex)
{
throw new Exception("Could not initialize the cards database. Check the inner exception for more details.", ex);
}
}
internal static NamedCard GetCard(int id)
{
if (_cards.ContainsKey(id))
......
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