Commit 8f539b6f authored by SherryChaos's avatar SherryChaos

fix windbot diyDeck selection bug

parent 33c59667
......@@ -29,7 +29,6 @@ namespace MDPro3
public InputField inputDraw;
public GameObject btnDeck;
public static readonly int diyAI = 6;
public static string port;
public class BotInfo
......@@ -175,11 +174,11 @@ namespace MDPro3
Program.I().ShiftToServant(Program.I().selectDeck);
}
string GetWindBotCommand(int aiCode)
string GetWindBotCommand(int aiCode, bool diyDeck)
{
BotInfo bot = bots[aiCode];
string aiCommand = bot.command;
if (aiCode == diyAI)
if (diyDeck)
{
string selectedDeck = btnDeck.transform.GetChild(0).GetComponent<Text>().text;
if (!File.Exists(Program.deckPath + selectedDeck + Program.ydkExpansion))
......@@ -200,16 +199,16 @@ namespace MDPro3
return aiCommand;
}
public void StartAIForSolo(int aiCode)
public void StartAIForSolo(int aiCode, bool diyDeck)
{
string aiCommand = GetWindBotCommand(aiCode);
string aiCommand = GetWindBotCommand(aiCode, diyDeck);
if(aiCommand != string.Empty)
Launch(aiCommand, toggleLockHand.isOn, toggleNoCheck.isOn, toggleNoShuffle.isOn);
}
public void StartAIForRoom(int aiCode)
public void StartAIForRoom(int aiCode, bool diyDeck)
{
string aiCommand = GetWindBotCommand(aiCode);
string aiCommand = GetWindBotCommand(aiCode, diyDeck);
if (aiCommand != string.Empty)
{
StartWindBot(aiCommand, TcpHelper.joinedAddress, TcpHelper.joinedPort, TcpHelper.joinedPassword, toggleLockHand.isOn);
......
......@@ -12,13 +12,14 @@ namespace MDPro3.UI
public RawImage face;
public Solo.BotInfo botInfo;
bool diyDeck;
public override void OnSelected()
{
base.OnSelected();
Program.I().solo.superScrollView.selected = id;
Program.I().solo.description.text = botInfo.desc;
Program.I().solo.description.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
if(id == Solo.diyAI)
if(diyDeck)
Program.I().solo.btnDeck.SetActive(true);
else
Program.I().solo.btnDeck.SetActive(false);
......@@ -28,12 +29,13 @@ namespace MDPro3.UI
{
base.Refresh();
title.text = botInfo.name;
diyDeck = botInfo.command.Contains("Lucky");
action = () =>
{
if(Solo.condition == Solo.Condition.ForSolo)
Program.I().solo.StartAIForSolo(id);
Program.I().solo.StartAIForSolo(id, diyDeck);
else
Program.I().solo.StartAIForRoom(id);
Program.I().solo.StartAIForRoom(id, diyDeck);
};
}
......
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