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

Fix bugs in card selection

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