Commit d00f6710 authored by mercury233's avatar mercury233 Committed by Unicorn369

fix show setname

parent 38d1c327
using System;
using System.Collections.Generic;
using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
......@@ -453,15 +454,25 @@ public class GameStringHelper
public static string getSetName(long Setcode)
{
string returnValue = "";
var returnValue = new List<string>();
int lastBaseType = 0xfff;
for (int i = 0; i < GameStringManager.xilies.Count; i++)
{
if (YGOSharp.CardsManager.IfSetCard(GameStringManager.xilies[i].hashCode, Setcode))
int currentHash = GameStringManager.xilies[i].hashCode;
if (YGOSharp.CardsManager.IfSetCard(currentHash, Setcode))
{
returnValue = GameStringManager.xilies[i].content + " ";
if ((lastBaseType & currentHash) == lastBaseType)
returnValue.RemoveAt(returnValue.Count - 1);
lastBaseType = currentHash & 0xfff;
string[] setArray = GameStringManager.xilies[i].content.Split('\t');
string setString = setArray[0];
//if (setArray.Length > 1)
//{
// setString += "[sup]" + setArray[1] + "[/sup]";
//}
returnValue.Add(setString);
}
}
return returnValue;
return String.Join("|", returnValue.ToArray());
}
}
......@@ -43,7 +43,7 @@ public static class GameStringManager
{
if (line.Length > 1 && line.Substring(0, 1) == "!")
{
string[] mats = line.Substring(1, line.Length - 1).Split(new string[] { " ", " " }, StringSplitOptions.RemoveEmptyEntries);
string[] mats = line.Substring(1, line.Length - 1).Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (mats.Length > 2)
{
hashedString a = new hashedString();
......
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