Commit 8da9ba82 authored by Unicorn369's avatar Unicorn369

Merge branch 'Test' of https://github.com/Unicorn369/YGOPro2_Droid into Android

parents a0eaff39 d00f6710
...@@ -56,6 +56,7 @@ updates/ ...@@ -56,6 +56,7 @@ updates/
cards.cdb cards.cdb
lflist.conf lflist.conf
strings.conf strings.conf
commamd.shell
AI_core_vs2017solution/core.VC.db AI_core_vs2017solution/core.VC.db
AI_core_vs2017solution/core.VC.VC.opendb AI_core_vs2017solution/core.VC.VC.opendb
AI_core_vs2017solution/System.Servicemodel.Faltexception.dll AI_core_vs2017solution/System.Servicemodel.Faltexception.dll
......
...@@ -145,7 +145,7 @@ Transform: ...@@ -145,7 +145,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 142624} m_GameObject: {fileID: 142624}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 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_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: [] m_Children: []
m_Father: {fileID: 417952} m_Father: {fileID: 417952}
...@@ -349,17 +349,17 @@ MonoBehaviour: ...@@ -349,17 +349,17 @@ MonoBehaviour:
updateAnchors: 1 updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1} mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4 mPivot: 4
mWidth: 260 mWidth: 270
mHeight: 180 mHeight: 120
mDepth: 2 mDepth: 2
autoResizeBoxCollider: 0 autoResizeBoxCollider: 0
hideIfOffScreen: 0 hideIfOffScreen: 0
keepAspectRatio: 0 keepAspectRatio: 0
aspectRatio: 1.4444444 aspectRatio: 2.25
keepCrispWhenShrunk: 1 keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3} mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0} 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" \ [sup]DEF[/sup]5000[-]\n"
mFontSize: 30 mFontSize: 30
mFontStyle: 0 mFontStyle: 0
...@@ -370,7 +370,7 @@ MonoBehaviour: ...@@ -370,7 +370,7 @@ MonoBehaviour:
mEffectColor: {r: 0, g: 0, b: 0, a: 1} mEffectColor: {r: 0, g: 0, b: 0, a: 1}
mSymbols: 1 mSymbols: 1
mEffectDistance: {x: 1, y: 1} mEffectDistance: {x: 1, y: 1}
mOverflow: 1 mOverflow: 3
mMaterial: {fileID: 0} mMaterial: {fileID: 0}
mApplyGradient: 1 mApplyGradient: 1
mGradientTop: {r: 1, g: 1, b: 1, a: 1} mGradientTop: {r: 1, g: 1, b: 1, a: 1}
......
using System; using System;
using System.Collections.Generic;
using YGOSharp; using YGOSharp;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
public class GameStringHelper public class GameStringHelper
{ {
public static string fen = "/"; public static string fen = "/";
...@@ -327,17 +328,151 @@ public class GameStringHelper ...@@ -327,17 +328,151 @@ public class GameStringHelper
return re; 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) 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();
......
...@@ -686,7 +686,7 @@ public class DeckManager : ServantWithCardDescription ...@@ -686,7 +686,7 @@ public class DeckManager : ServantWithCardDescription
string[] arg = new string[5]; string[] arg = new string[5];
arg[0] = item.Id.ToString(); arg[0] = item.Id.ToString();
arg[1] = "3"; arg[1] = "3";
arg[2] = item.Name + "\n" + GameStringHelper.getSmall(item); arg[2] = item.Name + "\n" + GameStringHelper.getSearchResult(item);
args.Add(arg); args.Add(arg);
} }
superScrollView.print(args); superScrollView.print(args);
......
...@@ -17,6 +17,8 @@ public class SelectServer : WindowServantSP ...@@ -17,6 +17,8 @@ public class SelectServer : WindowServantSP
UISprite inputIP_; UISprite inputIP_;
UISprite inputPort_; UISprite inputPort_;
static bool EditIpAndPort;
public override void initialize() public override void initialize()
{ {
createWindow(Program.I().new_ui_selectServer); createWindow(Program.I().new_ui_selectServer);
...@@ -81,7 +83,7 @@ public class SelectServer : WindowServantSP ...@@ -81,7 +83,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "233"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "233";
Config.Set("serversPicker", "[OCG]Mercury233"); Config.Set("serversPicker", "[OCG]Mercury233");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -92,7 +94,7 @@ public class SelectServer : WindowServantSP ...@@ -92,7 +94,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "7210"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "7210";
Config.Set("serversPicker", "[OCG]Koishi"); Config.Set("serversPicker", "[OCG]Koishi");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -103,7 +105,7 @@ public class SelectServer : WindowServantSP ...@@ -103,7 +105,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "1311"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "1311";
Config.Set("serversPicker", "[TCG]Koishi"); Config.Set("serversPicker", "[TCG]Koishi");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -114,7 +116,7 @@ public class SelectServer : WindowServantSP ...@@ -114,7 +116,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "765"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "765";
Config.Set("serversPicker", "[轮抽服]2Pick"); Config.Set("serversPicker", "[轮抽服]2Pick");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -125,7 +127,7 @@ public class SelectServer : WindowServantSP ...@@ -125,7 +127,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "17225"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "17225";
Config.Set("serversPicker", "[OCG&TCG]한국서버"); Config.Set("serversPicker", "[OCG&TCG]한국서버");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -136,7 +138,7 @@ public class SelectServer : WindowServantSP ...@@ -136,7 +138,7 @@ public class SelectServer : WindowServantSP
UIHelper.getByName<UIInput>(gameObject, "port_").value = "7911"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "7911";
Config.Set("serversPicker", "[OCG&TCG]YGOhollow (JP)"); Config.Set("serversPicker", "[OCG&TCG]YGOhollow (JP)");
list.enabled = false; EditIpAndPort = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
...@@ -150,7 +152,7 @@ public class SelectServer : WindowServantSP ...@@ -150,7 +152,7 @@ public class SelectServer : WindowServantSP
Config.Set("serversPicker", "[Custom]"); Config.Set("serversPicker", "[Custom]");
} }
list.enabled = true; EditIpAndPort = true;
inputIP_.enabled = true; inputIP_.enabled = true;
inputPort_.enabled = true; inputPort_.enabled = true;
break; break;
...@@ -201,8 +203,11 @@ public class SelectServer : WindowServantSP ...@@ -201,8 +203,11 @@ public class SelectServer : WindowServantSP
catch (Exception) catch (Exception)
{ {
} }
inputIP.value = ip; if (EditIpAndPort)
inputPort.value = port; {
inputIP.value = ip;
inputPort.value = port;
}
inputPsw.value = psw; inputPsw.value = psw;
//inputVersion.value = version; //inputVersion.value = version;
} }
......
...@@ -12,7 +12,7 @@ We use Yu-Gi-Oh card game only to test our engine, and the game is not for comme ...@@ -12,7 +12,7 @@ We use Yu-Gi-Oh card game only to test our engine, and the game is not for comme
# How to compile the game? # How to compile the game?
1. Download Unity 5.6.7f1 (https://unity3d.com/cn/get-unity/download/archive). 1. Download Unity 5.6.7 (https://unity3d.com/get-unity/download/archive).
2. Clone the repository. 2. Clone the repository.
......
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