Commit f219f7b4 authored by mercury233's avatar mercury233

fix show setname

parent f90543f3
using System; using System;
using System.Collections.Generic;
using YGOSharp; using YGOSharp;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
...@@ -453,15 +454,25 @@ public class GameStringHelper ...@@ -453,15 +454,25 @@ public class GameStringHelper
public static string getSetName(long Setcode) 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++) 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 String.Join("|", returnValue.ToArray());
return returnValue;
} }
} }
...@@ -43,7 +43,7 @@ public static class GameStringManager ...@@ -43,7 +43,7 @@ public static class GameStringManager
{ {
if (line.Length > 1 && line.Substring(0, 1) == "!") 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) if (mats.Length > 2)
{ {
hashedString a = new hashedString(); 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