Commit f90543f3 authored by mercury233's avatar mercury233

update search result

parent 2956594c
......@@ -145,7 +145,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 142624}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 32, y: -5.4, z: 0}
m_LocalPosition: {x: 32, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 417952}
......@@ -349,17 +349,17 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 260
mHeight: 180
mWidth: 270
mHeight: 120
mDepth: 2
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1.4444444
aspectRatio: 2.25
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0}
mText: "\u7EDD\u671B\u795E \u5B89\u63D0\u970D\u666E\n[ff8000]\u6548\u679C|\u6076\u9B54\u65CF|\u6697\u5C5E\u6027|12[sup]\u2605[/sup]\n[sup]ATK[/sup]5000
mText: "\u7EDD\u671B\u795E \u5B89\u63D0\u970D\u666E\n[ff8000]\u6697/12[sup]\u2605[/sup]\n[sup]ATK[/sup]5000
\ [sup]DEF[/sup]5000[-]\n"
mFontSize: 30
mFontStyle: 0
......@@ -370,7 +370,7 @@ MonoBehaviour:
mEffectColor: {r: 0, g: 0, b: 0, a: 1}
mSymbols: 1
mEffectDistance: {x: 1, y: 1}
mOverflow: 1
mOverflow: 3
mMaterial: {fileID: 0}
mApplyGradient: 1
mGradientTop: {r: 1, g: 1, b: 1, a: 1}
......
using System;
using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
using YGOSharp.OCGWrapper.Enums;
public class GameStringHelper
{
public static string fen = "/";
......@@ -327,6 +327,130 @@ public class GameStringHelper
return re;
}
public static string getSearchResult(YGOSharp.Card data)
{
string re = "";
try
{
if ((data.Type & 0x1) > 0)
{
re += "[ff8000]";
if ((data.Type & (int)CardType.Link) == 0)
{
if ((data.Type & (int)CardType.Xyz) > 0)
{
re += race(data.Race) + fen + attribute(data.Attribute) + fen + data.Level.ToString() + "[sup]☆[/sup]";
}
else
{
re += race(data.Race) + fen + attribute(data.Attribute) + fen + data.Level.ToString() + "[sup]★[/sup]";
}
}
else
{
re += race(data.Race) + fen + attribute(data.Attribute);
}
if (data.LScale > 0) re += fen + data.LScale.ToString() + "[sup]P[/sup]";
re += "\n";
if (data.Attack < 0)
{
re += "[sup]ATK[/sup]? ";
}
else
{
if (data.rAttack > 0)
{
int pos = data.Attack - data.rAttack;
if (pos > 0)
{
re += "[sup]ATK[/sup]" + data.Attack.ToString() + "(↑" + pos.ToString() + ") ";
}
if (pos < 0)
{
re += "[sup]ATK[/sup]" + data.Attack.ToString() + "(↓" + (-pos).ToString() + ") ";
}
if (pos == 0)
{
re += "[sup]ATK[/sup]" + data.Attack.ToString() + " ";
}
}
else
{
re += "[sup]ATK[/sup]" + data.Attack.ToString() + " ";
}
}
if ((data.Type & (int)CardType.Link) == 0)
{
if (data.Defense < 0)
{
re += "[sup]DEF[/sup]?";
}
else
{
if (data.rAttack > 0)
{
int pos = data.Defense - data.rDefense;
if (pos > 0)
{
re += "[sup]DEF[/sup]" + data.Defense.ToString() + "(↑" + pos.ToString() + ")";
}
if (pos < 0)
{
re += "[sup]DEF[/sup]" + data.Defense.ToString() + "(↓" + (-pos).ToString() + ")";
}
if (pos == 0)
{
re += "[sup]DEF[/sup]" + data.Defense.ToString();
}
}
else
{
re += "[sup]DEF[/sup]" + data.Defense.ToString();
}
}
}
else
{
re += "[sup]LINK[/sup]" + data.Level.ToString();
}
}
else if ((data.Type & 0x2) > 0)
{
re += "[7FFF00]";
re += secondType(data.Type);
if (data.LScale > 0) re += fen + data.LScale.ToString() + "[sup]P[/sup]";
}
else if ((data.Type & 0x4) > 0)
{
re += "[dda0dd]";
re += secondType(data.Type);
}
else
{
re += "[ff8000]";
}
if (data.Alias > 0)
{
if (data.Alias != data.Id)
{
string name = YGOSharp.CardsManager.Get(data.Alias).Name;
if (name != data.Name)
{
re += "\n[" + YGOSharp.CardsManager.Get(data.Alias).Name + "]";
}
}
}
re += "[-]";
}
catch (Exception e)
{
}
return re;
}
public static string getSetName(long Setcode)
{
string returnValue = "";
......
......@@ -679,7 +679,7 @@ public class DeckManager : ServantWithCardDescription
string[] arg = new string[5];
arg[0] = item.Id.ToString();
arg[1] = "3";
arg[2] = item.Name + "\n" + GameStringHelper.getSmall(item);
arg[2] = item.Name + "\n" + GameStringHelper.getSearchResult(item);
args.Add(arg);
}
superScrollView.print(args);
......
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