Commit 0e72faba authored by SherryChaos's avatar SherryChaos

DIY Card Author Display

parent 48a3f77c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
using MDPro3.YGOSharp;
using MDPro3.YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using System.Text;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
......@@ -53,6 +55,7 @@ namespace MDPro3
public TextMeshProUGUI spellType;
public Font atkDef;
public Text cardPassword;
public Text cardAuther;
[Header("RD")]
public RawImage cardArtRD;
......@@ -88,7 +91,7 @@ namespace MDPro3
public GameObject linkBL;
public GameObject linkL;
public Text cardPasswordRD;
public Text cardAutherRD;
#endregion
public void SwitchLanguage()
......@@ -164,6 +167,8 @@ namespace MDPro3
cardDescriptionRD.font = result.Result;
cardDescriptionPendulum.font = result.Result;
cardDescriptionPendulumRD.font = result.Result;
cardAuther.font = result.Result;
cardAutherRD.font = result.Result;
};
}
......@@ -359,8 +364,12 @@ namespace MDPro3
cardArtPendulumRD.texture = art;
}
var pendulumDescription = CardDescription.GetCardDescriptionSplit(data.Desc, true);
cardDescriptionRD.text = TextForRender(pendulumDescription[1]);
cardDescriptionPendulumRD.text = TextForRender(pendulumDescription[0]);
var authorSplit = GetAuthorFromDescription(pendulumDescription[1]);
cardAutherRD.text = authorSplit[1];
cardDescriptionRD.text = TextForRender(authorSplit[0]);
lScaleRD.text = data.LScale.ToString();
rScaleRD.text = data.RScale.ToString();
if ((data.Type & (uint)CardType.Xyz) > 0)
......@@ -382,7 +391,9 @@ namespace MDPro3
{
cardArtRD.gameObject.SetActive(true);
cardArtRD.texture = art;
cardDescriptionRD.text = TextForRender(data.Desc);
var authorSplit = GetAuthorFromDescription(data.Desc);
cardDescriptionRD.text = TextForRender(authorSplit[0]);
cardAutherRD.text = TextForRender(authorSplit[1]);
cardDescriptionPendulumRD.text = string.Empty;
if (code == 10000000)
......@@ -541,8 +552,12 @@ namespace MDPro3
}
var pendulumDescription = CardDescription.GetCardDescriptionSplit(data.Desc, true);
cardDescription.text = StringHelper.GetType(data, true).Replace(Program.slash, Language.CardUseLatin() ? smallSlash : bigSlash);
cardDescription.text += "\r\n" + TextForRender(pendulumDescription[1]);
cardDescriptionPendulum.text = TextForRender(pendulumDescription[0]);
var authorSplit = GetAuthorFromDescription(pendulumDescription[1]);
cardDescription.text += "\r\n" + TextForRender(authorSplit[0]);
cardAuther.text = authorSplit[1];
lScale.text = data.LScale.ToString();
rScale.text = data.RScale.ToString();
if ((data.Type & (uint)CardType.Xyz) > 0)
......@@ -565,8 +580,11 @@ namespace MDPro3
var description = "";
if ((data.Type & (uint)CardType.Monster) > 0)
description = StringHelper.GetType(data, true).Replace(Program.slash,Language.CardUseLatin() ? smallSlash : bigSlash) + "\r\n";
description += TextForRender(data.Desc);
var authorSplit = GetAuthorFromDescription(data.Desc);
description += TextForRender(authorSplit[0]);
cardDescription.text = description;
cardAuther.text = authorSplit[1];
if (code == 10000000)
cardFrame.sprite = TextureManager.container.cardFrameObeliskOF;
......@@ -755,6 +773,39 @@ namespace MDPro3
return description;
}
static List<string> GetAuthorFromDescription(string description)
{
var lines = description.Split("\r\n");
var returnValue = new List<string>();
StringBuilder beforeDiySymbol = new StringBuilder();
bool foundDIY = false;
foreach (var line in lines)
{
if(!foundDIY && line.StartsWith(Settings.Data.DiySymbol))
{
var beforeDiySymbolText = beforeDiySymbol.ToString();
returnValue.Add(beforeDiySymbolText);
returnValue.Add(line);
foundDIY = true;
}
else if(!foundDIY && !string.IsNullOrEmpty(line))
{
beforeDiySymbol.Append(line);
}
if (foundDIY)
break;
}
if (!foundDIY)
{
returnValue.Add(description);
returnValue.Add(string.Empty);
}
return returnValue;
}
}
}
......@@ -550,12 +550,12 @@ namespace MDPro3
splitLines = 2;
symbol = "[";
}
if (language == Language.Spanish)
else if (language == Language.Spanish)
{
beforePendulum = 2;
splitLines = 2;
}
if (language == Language.TraditionalChinese)
else if (language == Language.TraditionalChinese)
{
beforePendulum = 0;
}
......
This diff is collapsed.
......@@ -2547,14 +2547,14 @@ namespace MDPro3
{
CreateModel();
ModelAt(p);
model.SetActive(false);
}
inAnimation = true;
var offset = manager.GetElement<Transform>("Offset");
var offsetPosition = offset.localPosition;
var turn = manager.GetElement<Transform>("Turn");
var turnEulerAngles = turn.localEulerAngles;
if(!ThisLocationShouldHaveModel(p))
model.SetActive(false);
var sequence = DOTween.Sequence();
sequence.AppendInterval(id);
sequence.Append(offset.DOLocalMove(new Vector3(0, 2, 3), 0.1f).OnStart(() =>
......
......@@ -464,6 +464,7 @@ namespace MDPro3
Send(message);
}
#endregion
public static List<Package> ReadPackagesInRecord(string path)
{
List<Package> re = null;
......
using UnityEngine;
public class InputHelper : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
fileFormatVersion: 2
guid: d03598a745249be408ca5ed9e74dd315
\ No newline at end of file
......@@ -21,6 +21,7 @@ namespace MDPro3
public int[] SavedCardSize;
public string SavedCardFormat;
public bool BatchMove;
public string DiySymbol;
public SettingData()
{
......@@ -87,6 +88,7 @@ namespace MDPro3
SavedCardSize = new int[] { 704, 1024 };
SavedCardFormat = Program.jpgExpansion;
BatchMove = true;
DiySymbol = "DIY by";
}
}
......@@ -197,6 +199,11 @@ namespace MDPro3
data.BatchMove = defau.BatchMove;
needOverwrite = true;
}
if (!json.Contains("DiySymbol"))
{
data.DiySymbol = defau.DiySymbol;
needOverwrite = true;
}
if (needOverwrite)
SaveSettings(data);
......
......@@ -405,7 +405,7 @@ namespace MDPro3
else if ((c.Type & (uint)CardType.Ritual) > 0)
subCategory = (int)SummonSub.Ritual;
}
else if (core.psum)
else if (core.log.psum)
{
if (ignoreNextPendulumSummon)
break;
......
......@@ -1127,7 +1127,7 @@ namespace MDPro3
}
public void OnSort()
{
if (!deckIsFromLocalFile)
if (!deckIsFromLocalFile && condition != Condition.ChangeSide)
{
MessageManager.Cast(InterString.Get("请先保存卡组。"));
return;
......
This diff is collapsed.
......@@ -297,8 +297,6 @@ namespace MDPro3
}
else
{
cg.interactable = true;
MessageManager.messageFromSubString = InterString.Get("端口被占用, 请尝试修改端口后再尝试。端口号应大于0,小于65535。");
}
}
......
......@@ -21,7 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CommonButtonHighlight
m_Shader: {fileID: -6465566751694194690, guid: c61ed10b7c96fe2439585bbad61b3853, type: 3}
m_Shader: {fileID: 4800000, guid: 1fb22d282ef85f84c9f1afd0eb6bc6e4, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
......@@ -29,7 +29,7 @@ Material:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
......
This diff is collapsed.
fileFormatVersion: 2
guid: 1fb22d282ef85f84c9f1afd0eb6bc6e4
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
{
"ShineCards": [],
"ShineCards": [
7477101
],
"RoyalCards": [],
"GoldCards": [],
"GoldCards": [
27520594
],
"MillenniumCards": [
27204311,
5405695,
......
......@@ -52,5 +52,6 @@
1024
],
"SavedCardFormat": ".jpg",
"BatchMove": true
"BatchMove": true,
"DiySymbol": "DIY by"
}
\ No newline at end of file
No preview for this file type
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