Commit b2f7cc1e authored by SherryChaos's avatar SherryChaos

better support for rush duel

parent fe3fe796
...@@ -523,6 +523,8 @@ namespace MDPro3 ...@@ -523,6 +523,8 @@ namespace MDPro3
if (language != "en-US" && language != "es-ES") if (language != "en-US" && language != "es-ES")
description = description.Replace(" ", "\u00A0"); description = description.Replace(" ", "\u00A0");
description = description.Replace("\r\n\r\n", "\r\n");
return description; return description;
} }
......
...@@ -166,6 +166,28 @@ namespace MDPro3 ...@@ -166,6 +166,28 @@ namespace MDPro3
else if (File.Exists("Art/" + code.ToString() + ".jpg")) else if (File.Exists("Art/" + code.ToString() + ".jpg"))
path = "Art/" + code.ToString() + ".jpg"; path = "Art/" + code.ToString() + ".jpg";
else else
{
foreach (var zip in ZipManager.zips)
{
if (zip.Name.ToLower().EndsWith("script.zip"))
continue;
foreach (var file in zip.EntryFileNames)
{
foreach (var extName in new[] { ".png", ".jpg" })
{
var picPath = $"art/{code}{extName}";
if (file.ToLower() == picPath)
{
returenValue = new Texture2D(0, 0);
MemoryStream stream = new MemoryStream();
var entry = zip[picPath];
entry.Extract(stream);
returenValue.LoadImage(stream.ToArray());
}
}
}
}
if(returenValue == null)
{ {
foreach (var zip in ZipManager.zips) foreach (var zip in ZipManager.zips)
{ {
...@@ -184,7 +206,14 @@ namespace MDPro3 ...@@ -184,7 +206,14 @@ namespace MDPro3
entry.Extract(stream); entry.Extract(stream);
returenValue.LoadImage(stream.ToArray()); returenValue.LoadImage(stream.ToArray());
var card = CardsManager.Get(code); var card = CardsManager.Get(code);
if ((card.Type & (uint)CardType.Pendulum) > 0) if(code >= 120000000 && code < 130000000)
{
if ((card.Type & (uint)CardType.Monster) > 0)
returenValue = GetArtFromRushDuelMonsterCard(returenValue);
else
returenValue = GetArtFromRushDuelSpellCard(returenValue);
}
else if ((card.Type & (uint)CardType.Pendulum) > 0)
returenValue = GetArtFromPendulumCard(returenValue); returenValue = GetArtFromPendulumCard(returenValue);
else else
returenValue = GetArtFromCard(returenValue); returenValue = GetArtFromCard(returenValue);
...@@ -193,6 +222,7 @@ namespace MDPro3 ...@@ -193,6 +222,7 @@ namespace MDPro3
} }
} }
} }
}
if (returenValue == null) if (returenValue == null)
{ {
IEnumerator ie = LoadFromFileAsync(path); IEnumerator ie = LoadFromFileAsync(path);
...@@ -218,7 +248,6 @@ namespace MDPro3 ...@@ -218,7 +248,6 @@ namespace MDPro3
} }
yield return returenValue; yield return returenValue;
} }
//loadingArt = false;
} }
int getCount; int getCount;
...@@ -679,6 +708,22 @@ namespace MDPro3 ...@@ -679,6 +708,22 @@ namespace MDPro3
var height = Mathf.CeilToInt(cardPic.height * 0.81f); var height = Mathf.CeilToInt(cardPic.height * 0.81f);
return GetCroppingTex(cardPic, startX, startY, width, height); return GetCroppingTex(cardPic, startX, startY, width, height);
} }
public static Texture2D GetArtFromRushDuelMonsterCard(Texture2D cardPic)
{
var startX = Mathf.CeilToInt(cardPic.width * 0.067f);
var startY = Mathf.CeilToInt(cardPic.height * 0.29f);
var width = Mathf.CeilToInt(cardPic.width * 0.933f);
var height = Mathf.CeilToInt(cardPic.height * 0.90f);
return GetCroppingTex(cardPic, startX, startY, width, height);
}
public static Texture2D GetArtFromRushDuelSpellCard(Texture2D cardPic)
{
var startX = Mathf.CeilToInt(cardPic.width * 0.067f);
var startY = Mathf.CeilToInt(cardPic.height * 0.29f);
var width = Mathf.CeilToInt(cardPic.width * 0.933f);
var height = Mathf.CeilToInt(cardPic.height * 0.90f);
return GetCroppingTex(cardPic, startX, startY, width, height);
}
public static Texture2D GetCroppingTex(Texture2D texture, int startX, int startY, int width, int height) public static Texture2D GetCroppingTex(Texture2D texture, int startX, int startY, int width, int height)
{ {
......
...@@ -134,8 +134,9 @@ PlayerSettings: ...@@ -134,8 +134,9 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 1.0.2 bundleVersion: 1.0.2.1
preloadedAssets: [] preloadedAssets:
- {fileID: 11400000, guid: 5fb02d2098f52054b89ce4a9f63ba9ee, type: 2}
metroInputSource: 0 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1
...@@ -529,7 +530,7 @@ PlayerSettings: ...@@ -529,7 +530,7 @@ PlayerSettings:
m_APIs: 0b000000 m_APIs: 0b000000
m_Automatic: 1 m_Automatic: 1
- m_BuildTarget: WindowsStandaloneSupport - m_BuildTarget: WindowsStandaloneSupport
m_APIs: 0200000012000000150000000b000000 m_APIs: 0b000000020000001200000015000000
m_Automatic: 0 m_Automatic: 0
m_BuildTargetVRSettings: m_BuildTargetVRSettings:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
......
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