Commit a186af36 authored by SherryChaos's avatar SherryChaos

fix deleting deck bug

parent ce07cb07
MDPro3 v1.1.2更新:
1.修复了在决斗中需要输入文字时(如[抹杀之指名者]),会响应快捷键功能的错误。
2.修复由对方发动的[闪刀起动-交闪]的特效中的卡片不是检索的卡片的错误。
3.增加发送消息的间隔时间,减少CPU开销。
3.修复选择卡组界面的卡组数多到需要滚动浏览时,删除卡组会错位删除的错误。
4.增加发送消息的间隔时间,减少CPU开销。
MDPro3 v1.1.1更新:
1.新投稿动画:琰魔龙 红莲魔·渊、龙骑士 D-终。
......
This diff is collapsed.
......@@ -19,7 +19,6 @@ using MDPro3.YGOSharp;
using MDPro3.YGOSharp.OCGWrapper.Enums;
using static YgomGame.Bg.BgEffectSettingInner;
using MDPro3.UI;
using Mono.Cecil.Cil;
namespace MDPro3
{
......@@ -45,6 +44,7 @@ namespace MDPro3
public GameObject buttonPlay;
public GameObject buttonAcc;
public GameObject buttonNor;
public GameObject buttonReplayQuit;
public GameObject buttonForceSaveReplay;
public Button buttonTiming;
public Button buttonLog;
......@@ -1481,6 +1481,10 @@ namespace MDPro3
}
else
buttonTiming.gameObject.SetActive(false);
if (condition == Condition.Replay)
buttonReplayQuit.SetActive(true);
else
buttonReplayQuit.SetActive(false);
HidePlaceCount();
mySummonCount = 0;
mySpSummonCount = 0;
......
......@@ -133,12 +133,13 @@ namespace MDPro3
{
if (!deck.Key.Contains(search))
continue;
var task = new string[6]
var task = new string[7]
{
deck.Key,
deck.Value.Case[0].ToString(),
"0", "0", "0",
deck.Value.Protector[0].ToString()
deck.Value.Protector[0].ToString(),
"0"//For Delete
};
if (deck.Value.Pickup.Count > 0)
task[2] = deck.Value.Pickup[0].ToString();
......@@ -161,6 +162,7 @@ namespace MDPro3
handler.card2 = int.Parse(task[3]);
handler.card3 = int.Parse(task[4]);
handler.protector = task[5];
handler.selected = task[6] != "0";
handler.Refresh();
}
......@@ -260,25 +262,26 @@ namespace MDPro3
{
deleting = false;
int count = 0;
foreach (var item in items)
if (item.selected)
foreach (var item in superScrollView.items)
if (item.args[6] != "0")
{
count++;
File.Delete("Deck/" + item.deckName + ".ydk");
MessageManager.Cast(InterString.Get("已删除卡组「[?]」", item.deckName));
File.Delete("Deck/" + item.args[0] + ".ydk");
MessageManager.Cast(InterString.Get("已删除卡组「[?]」", item.args[0]));
}
if (count > 0)
RefreshList();
else
{
ExitDeleteDeck();
}
}
}
void ExitDeleteDeck()
{
deleting = false;
if(superScrollView != null)
foreach(var item in superScrollView.items)
item.args[6] = "0";
foreach (var item in items)
item.HideToggle();
}
......
......@@ -93,6 +93,7 @@ namespace MDPro3.UI
{
items[i].gameObject = UnityEngine.Object.Instantiate(itemObject);
items[i].gameObject.transform.SetParent(scrollView.content, false);
items[i].gameObject.GetComponent<SuperScrollViewItem>().handler = this;
ItemRefreshPositon(i);
}
}
......
......@@ -8,6 +8,7 @@ namespace MDPro3.UI
public class SuperScrollViewItem : MonoBehaviour
{
public int id;
public SuperScrollView handler;
private void Start()
{
......
......@@ -47,6 +47,11 @@ namespace MDPro3.UI
bool refreshed;
IEnumerator RefreshAsync()
{
if (selected)
ToggleOn();
else
ToggleOff();
refreshed = false;
textName.text = deckName;
var casePath = deckCase.ToString();
......@@ -209,11 +214,13 @@ namespace MDPro3.UI
{
selected = true;
toggleOn.SetActive(true);
handler.items[id].args[6] = "1";
}
public void ToggleOff()
{
selected = false;
toggleOn.SetActive(false);
handler.items[id].args[6] = "0";
}
}
}
......@@ -551,7 +551,7 @@ PlayerSettings:
m_APIs: 0b000000
m_Automatic: 1
- m_BuildTarget: WindowsStandaloneSupport
m_APIs: 1500000002000000
m_APIs: 0200000015000000
m_Automatic: 0
m_BuildTargetVRSettings:
- m_BuildTarget: Standalone
......
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