Commit ab3d79bc authored by 赤子奈落's avatar 赤子奈落

Fix bugs in card selection

parent 6de17c3f
......@@ -216,13 +216,14 @@ public class CardDetail : MonoBehaviour
{
base_property.bottomAnchor.absolute = -120;
}
try
{
if (origin.Desc.Contains("【怪兽效果】"))
{
string text_pendulum = "";
string text_other = "";
string temp = origin.Desc.Split("→\r\n")[1];
if(temp.Split("\r\nЧ\r\n").Length > 1)
if (temp.Split("\r\n【怪兽效果】\r\n").Length > 1)
{
text_pendulum = temp.Split("\r\n【怪兽效果】\r\n")[0];
text_other = temp.Split("\r\n【怪兽效果】\r\n")[1];
......@@ -260,6 +261,12 @@ public class CardDetail : MonoBehaviour
base_pendulum.alpha = 0f;
label_description.text = origin.Desc;
}
}
catch
{
Debug.LogError("灵摆效果文本分段失败!!!");
}
Program.I().cardDescription.FrameColor(origin, false);
back_name.color = Program.I().cardDescription.color1;
......
......@@ -44,6 +44,7 @@ public class CardSelectionHandler : MonoBehaviour
public bool exitable;
public bool finishable;
bool tempHide;
public bool hideByRMS;
private void Start()
{
base_cardSelect = transform.GetChild(0).GetChild(0).GetComponent<UI2DSprite>();
......@@ -69,8 +70,6 @@ public class CardSelectionHandler : MonoBehaviour
Debug.Log("没有卡需要选择,请检查。");
return;
}
//初始化
list.localPosition = Vector3.zero;
isShowed = true;
gameObject.transform.DOLocalMoveY(-340, 0.2f);
......@@ -81,6 +80,7 @@ public class CardSelectionHandler : MonoBehaviour
this.ES_max = ES_max;
this.exitable = exitable;
tempHide = false;
hideByRMS = false;
if (Program.I().setting.setting.confirmLeft.value)
{
......@@ -128,13 +128,17 @@ public class CardSelectionHandler : MonoBehaviour
}
cardsOnSelection.Clear();
for(int i = 0; i < cards.Count; i++)
{
if(i >= 1)
List<gameCard> cleaned = new List<gameCard>();
foreach (var card in cards)
{
if (cards[i] == cards[i - 1])
return;
if (!cleaned.Contains(card))
cleaned.Add(card);
}
cards = cleaned;
for (int i = 0; i < cards.Count; i++)
{
bool theFirst = false;
bool theLast = false;
if(i == 0)
......@@ -225,6 +229,14 @@ public class CardSelectionHandler : MonoBehaviour
Destroy(card.arrow);
}
public void ShowWithoutAction()
{
core.Sleep(12);
isShowed = true;
hideByRMS = false;
gameObject.transform.DOLocalMoveY(-340, 0.2f);
}
void TempHide()
{
if(!tempHide)
......@@ -303,6 +315,7 @@ public class CardSelectionHandler : MonoBehaviour
values.Add(new messageSystemValue { hint = InterString.Get("取消"), value = "hide" });
core.RMSshow_singleChoice("return", values);
hideByRMS = true;
}
}
break;
......
......@@ -270962,6 +270962,7 @@ MonoBehaviour:
alreadySelected: 0
exitable: 0
finishable: 0
hideByRMS: 0
--- !u!1 &1731746415
GameObject:
m_ObjectHideFlags: 0
......@@ -5822,7 +5822,6 @@ public class Ocgcore : ServantWithCardDescription
break;
case GameMessage.SelectSum:
Debug.Log("SelectSum");
if (cardsSelectable.Count <= ES_min)
{
autoSendCards();
......@@ -8434,7 +8433,11 @@ public class Ocgcore : ServantWithCardDescription
{
Debug.Log(e);
}
else
{
if(Program.I().cardSelection.hideByRMS)
Program.I().cardSelection.ShowWithoutAction();
}
break;
case "autoForceChainHandler":
if (result[0].value != "hide")
......@@ -8792,6 +8795,11 @@ public class Ocgcore : ServantWithCardDescription
Program.I().cardDetail.Hide();
return;
}
else if (PhaseUIBehaviour.isShowed)
{
PhaseUIBehaviour.hide();
return;
}
else if(Program.I().cardSelection.isShowed && Program.I().cardSelection.exitable)
{
Program.I().cardSelection.hide();
......
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