Commit de99ef7a authored by SherryChaos's avatar SherryChaos

overframe support

parent 58147aea
...@@ -65,3 +65,4 @@ Data/lflist_genesys.conf ...@@ -65,3 +65,4 @@ Data/lflist_genesys.conf
Data/mycard_apps.json Data/mycard_apps.json
Data/Rarity.json Data/Rarity.json
Data/SpecialCards.json
...@@ -25,11 +25,6 @@ MonoBehaviour: ...@@ -25,11 +25,6 @@ MonoBehaviour:
m_ReadOnly: 0 m_ReadOnly: 0
m_SerializedLabels: [] m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0 FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 067b10328108b7d45827fb33f6134466
m_Address: CardframeMask_RNA
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 081b5e42d6f01b34486d8ff6af7f6692 - m_GUID: 081b5e42d6f01b34486d8ff6af7f6692
m_Address: RD_Level m_Address: RD_Level
m_ReadOnly: 0 m_ReadOnly: 0
...@@ -50,11 +45,6 @@ MonoBehaviour: ...@@ -50,11 +45,6 @@ MonoBehaviour:
m_ReadOnly: 0 m_ReadOnly: 0
m_SerializedLabels: [] m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0 FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 0e96adbf14f612e44bc3aad5d944bfbf
m_Address: CardframeMask_Pen
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 128a74e58ae2587469da4b8339d98a25 - m_GUID: 128a74e58ae2587469da4b8339d98a25
m_Address: card_frame07 m_Address: card_frame07
m_ReadOnly: 0 m_ReadOnly: 0
...@@ -460,11 +450,6 @@ MonoBehaviour: ...@@ -460,11 +450,6 @@ MonoBehaviour:
m_ReadOnly: 0 m_ReadOnly: 0
m_SerializedLabels: [] m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0 FlaggedDuringContentUpdateRestriction: 0
- m_GUID: b592abbe0c43f914d97d5fa7e7cef0e1
m_Address: CardframeMask_Link
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: b91e64d35f635f7499e24b2e9d931e4a - m_GUID: b91e64d35f635f7499e24b2e9d931e4a
m_Address: card_frame16 m_Address: card_frame16
m_ReadOnly: 0 m_ReadOnly: 0
......
...@@ -33,7 +33,7 @@ Material: ...@@ -33,7 +33,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 2800000, guid: d0a85fb87789a624b84e98d941aad31b, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _Texture2DAsset_90c6e35ef4304f289c279037152a03b7_Out_0_Texture2D: - _Texture2DAsset_90c6e35ef4304f289c279037152a03b7_Out_0_Texture2D:
...@@ -56,7 +56,7 @@ Material: ...@@ -56,7 +56,7 @@ Material:
m_Floats: m_Floats:
- _ColorMask: 15 - _ColorMask: 15
- _DirectionalLightAmp: 0.88 - _DirectionalLightAmp: 0.88
- _FakeBlend: 0 - _FakeBlend: 1
- _LoadingBlend: 0 - _LoadingBlend: 0
- _Monochrome: 0 - _Monochrome: 0
- _QueueControl: 1 - _QueueControl: 1
......
...@@ -29,7 +29,7 @@ Material: ...@@ -29,7 +29,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 2800000, guid: d0a85fb87789a624b84e98d941aad31b, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _Texture2DAsset_90c6e35ef4304f289c279037152a03b7_Out_0_Texture2D: - _Texture2DAsset_90c6e35ef4304f289c279037152a03b7_Out_0_Texture2D:
...@@ -52,7 +52,7 @@ Material: ...@@ -52,7 +52,7 @@ Material:
m_Floats: m_Floats:
- _ColorMask: 15 - _ColorMask: 15
- _DirectionalLightAmp: 0.88 - _DirectionalLightAmp: 0.88
- _FakeBlend: 0 - _FakeBlend: 1
- _LoadingBlend: 0 - _LoadingBlend: 0
- _Monochrome: 0 - _Monochrome: 0
- _QueueControl: 1 - _QueueControl: 1
......
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: a0dbb7d454373a24f803a94207de55c0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: f83d945d0f8fd0148b1020033a7a57f5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
...@@ -57,9 +57,10 @@ MonoBehaviour: ...@@ -57,9 +57,10 @@ MonoBehaviour:
cardFramePendulumFusionOF: {fileID: 21300000, guid: 2ec1557d11f62fd4bba646561ddc8a38, type: 3} cardFramePendulumFusionOF: {fileID: 21300000, guid: 2ec1557d11f62fd4bba646561ddc8a38, type: 3}
cardFrameLinkOF: {fileID: 21300000, guid: ecfebef1d741fc64891a732e662f66c9, type: 3} cardFrameLinkOF: {fileID: 21300000, guid: ecfebef1d741fc64891a732e662f66c9, type: 3}
cardFramePendulumRitualOF: {fileID: 21300000, guid: 17e2debd03606ec4b9ff05e2cc4362e7, type: 3} cardFramePendulumRitualOF: {fileID: 21300000, guid: 17e2debd03606ec4b9ff05e2cc4362e7, type: 3}
cardFrameMask: {fileID: 2800000, guid: 067b10328108b7d45827fb33f6134466, type: 3} cardFrameMask: {fileID: 2800000, guid: d85dfb059355dce48b6cd677047f2b81, type: 3}
cardFrameMaskLink: {fileID: 2800000, guid: b592abbe0c43f914d97d5fa7e7cef0e1, type: 3} cardFrameMaskLink: {fileID: 2800000, guid: 7f29816a1a66c2c41b256372756b7708, type: 3}
cardFrameMaskPendulum: {fileID: 2800000, guid: 0e96adbf14f612e44bc3aad5d944bfbf, type: 3} cardFrameMaskPendulum: {fileID: 2800000, guid: 9bc20d0183a757e4e80a2772046b7402, type: 3}
cardFrameMaskW: {fileID: 2800000, guid: 2ebeb635d3a68e84485108267f2c9c29, type: 3}
cardKiraMask: {fileID: 2800000, guid: f67522af775aebb4bafcfc0fb0ccb8bc, type: 3} cardKiraMask: {fileID: 2800000, guid: f67522af775aebb4bafcfc0fb0ccb8bc, type: 3}
cardKiraMaskLink: {fileID: 2800000, guid: 1c882f9fe5e46c944b41f2f476b45827, type: 3} cardKiraMaskLink: {fileID: 2800000, guid: 1c882f9fe5e46c944b41f2f476b45827, type: 3}
cardKiraMaskPendulum: {fileID: 2800000, guid: ab1dd000ca931a342958b889832686e6, type: 3} cardKiraMaskPendulum: {fileID: 2800000, guid: ab1dd000ca931a342958b889832686e6, type: 3}
...@@ -67,6 +68,8 @@ MonoBehaviour: ...@@ -67,6 +68,8 @@ MonoBehaviour:
cardNormalLink: {fileID: 2800000, guid: 875fa980a3eb990419e51879fe12b281, type: 3} cardNormalLink: {fileID: 2800000, guid: 875fa980a3eb990419e51879fe12b281, type: 3}
cardNormalPendulum: {fileID: 2800000, guid: 71402236982fddd41ada1cc6a44e94bd, type: 3} cardNormalPendulum: {fileID: 2800000, guid: 71402236982fddd41ada1cc6a44e94bd, type: 3}
CardKiraNormal03_Millennium: {fileID: 2800000, guid: 71d6974fbeeed2c41901e87746fda0cb, type: 3} CardKiraNormal03_Millennium: {fileID: 2800000, guid: 71d6974fbeeed2c41901e87746fda0cb, type: 3}
CardDescColumnMask: {fileID: 2800000, guid: 126a985029b9aaa408d5a9e06f434442, type: 3}
CardDescColumnMaskP: {fileID: 2800000, guid: bc76d40f1527fe944a1875c5939a820d, type: 3}
attributeLight: {fileID: 21300000, guid: 157f899e40b269e4bb70d867aa084278, type: 3} attributeLight: {fileID: 21300000, guid: 157f899e40b269e4bb70d867aa084278, type: 3}
attributeDark: {fileID: 21300000, guid: 7976b559931f6e840863f07ea92c278a, type: 3} attributeDark: {fileID: 21300000, guid: 7976b559931f6e840863f07ea92c278a, type: 3}
attributeWater: {fileID: 21300000, guid: e639e2cab68115f499825b099bd456d5, type: 3} attributeWater: {fileID: 21300000, guid: e639e2cab68115f499825b099bd456d5, type: 3}
...@@ -476,6 +479,8 @@ MonoBehaviour: ...@@ -476,6 +479,8 @@ MonoBehaviour:
rd_KiraMaskPendulum: {fileID: 2800000, guid: ad112383d2d010945965fb587ff62a3d, type: 3} rd_KiraMaskPendulum: {fileID: 2800000, guid: ad112383d2d010945965fb587ff62a3d, type: 3}
rd_CardAttributeSet: {fileID: 2800000, guid: 8e060280489ff074cbc3cfd6122ebdfd, type: 3} rd_CardAttributeSet: {fileID: 2800000, guid: 8e060280489ff074cbc3cfd6122ebdfd, type: 3}
rd_CardNormal: {fileID: 2800000, guid: 3f5b3131dbe35bb4592393a6adc7ead2, type: 3} rd_CardNormal: {fileID: 2800000, guid: 3f5b3131dbe35bb4592393a6adc7ead2, type: 3}
rd_CardDescColumnMask: {fileID: 2800000, guid: 4c0d6dc80e3c3c84182f91749a226934, type: 3}
rd_CardDescColumnMaskP: {fileID: 2800000, guid: 26387e3c01068cc428504db53a9498ef, type: 3}
gamepad_ButtonSouth_Xbox: {fileID: 21300000, guid: d5977869931a55f458b6ef0ffa413a1f, type: 3} gamepad_ButtonSouth_Xbox: {fileID: 21300000, guid: d5977869931a55f458b6ef0ffa413a1f, type: 3}
gamepad_ButtonEast_Xbox: {fileID: 21300000, guid: 1d4312ba815631546b3703002b49271f, type: 3} gamepad_ButtonEast_Xbox: {fileID: 21300000, guid: 1d4312ba815631546b3703002b49271f, type: 3}
gamepad_ButtonWest_Xbox: {fileID: 21300000, guid: c2c100a0a6077774e822c1b1b5b1f7fd, type: 3} gamepad_ButtonWest_Xbox: {fileID: 21300000, guid: c2c100a0a6077774e822c1b1b5b1f7fd, type: 3}
......
fileFormatVersion: 2
guid: 8c89aba1c35e8dd4a87dc5a5d5cbc48e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
#pragma kernel CSMain
RWTexture2D<float4> Result;
Texture2D<float4> SourceTex;
Texture2D<float4> MaskTex;
float2 SourceSize;
float2 MaskSize;
int _BlendMode;
float _Threshold;
float _InvertMask;
int _MaskChannel; // 0=R, 1=G, 2=B, 3=A
SamplerState linear_clamp_sampler;
float ApplyBlendMode(float sourceAlpha, float maskValue, int blendMode)
{
switch (blendMode)
{
case 0: // Multiply
return sourceAlpha * maskValue;
case 1: // Replace
return maskValue;
case 2: // Additive
return min(sourceAlpha + maskValue, 1.0);
case 3: // Subtractive
return max(sourceAlpha - maskValue, 0.0);
case 4: // Overwrite
return sourceAlpha > 0.0 ? maskValue : 0.0;
default:
return sourceAlpha * maskValue;
}
}
// 获取指定通道的值
float GetChannelValue(float4 color, int channel)
{
if (channel == 0)
return color.r; // R
if (channel == 1)
return color.g; // G
if (channel == 2)
return color.b; // B
return color.a; // A (默认)
}
[numthreads(8, 8, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
uint2 pixel = id.xy;
// 确保不超出边界
if (pixel.x >= SourceSize.x || pixel.y >= SourceSize.y)
return;
// 读取原纹理颜色
float4 color = SourceTex[pixel];
float4 maskColor;
// 当纹理尺寸一致时,直接通过像素坐标访问,避免采样开销
if (SourceSize.x == MaskSize.x && SourceSize.y == MaskSize.y)
{
maskColor = MaskTex[pixel];
}
else
{
// 尺寸不一致时,使用UV采样
float2 uv = float2(pixel.x / SourceSize.x, pixel.y / SourceSize.y);
maskColor = MaskTex.SampleLevel(linear_clamp_sampler, uv, 0);
}
// 获取指定通道的mask值
float maskValue = GetChannelValue(maskColor, _MaskChannel);
// 应用阈值
if (_Threshold > 0.0)
{
maskValue = maskValue >= _Threshold ? 1.0 : 0.0;
}
// 反转mask
if (_InvertMask > 0.5)
{
maskValue = 1.0 - maskValue;
}
// 应用混合模式
color.a = ApplyBlendMode(color.a, maskValue, _BlendMode);
// 输出结果
Result[pixel] = color;
}
\ No newline at end of file
fileFormatVersion: 2
guid: 245068b0f18ff1d4e83f69e7ce92c123
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
#pragma kernel CSMain
RWTexture2D<float4> Result;
Texture2D<float4> SourceTex;
[numthreads(8, 8, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
uint width, height;
Result.GetDimensions(width, height);
if (id.x >= width || id.y >= height)
return;
float4 color = SourceTex[id.xy];
// 反转alpha值,保持RGB不变
color.a = 1.0 - color.a;
Result[id.xy] = color;
}
\ No newline at end of file
fileFormatVersion: 2
guid: bb5d60439693102478b228ad23d2e96e
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
...@@ -158,7 +158,12 @@ namespace MDPro3.Duel.YGOSharp ...@@ -158,7 +158,12 @@ namespace MDPro3.Duel.YGOSharp
public bool HasType(CardType type) public bool HasType(CardType type)
{ {
return ((Type & (int)type) != 0); return (Type & (int)type) != 0;
}
public bool HasType(CardType type1, CardType type2)
{
return HasType(type1) || HasType(type2);
} }
public bool HasLinkMarker(CardLinkMarker dir) public bool HasLinkMarker(CardLinkMarker dir)
......
fileFormatVersion: 2
guid: abc3e45aaa747b54ba5ba9c2f3a578d8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 71830460b841b844e8d1717ab6dc2513
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 970a35db89027b64cbc19efdd25911b5
\ No newline at end of file
using MDPro3.Duel.YGOSharp;
using UnityEngine;
using UnityEngine.UI;
namespace MDPro3
{
public class CardBuilderOCG : CardBuilder
{
[Header("OCG")]
[SerializeField] private RawImage imageArt;
[SerializeField] private RawImage imageArtPendulum;
[SerializeField] private RawImage imageArtPendulumSquare;
[SerializeField] private RawImage imageArtPendulumWide;
[SerializeField] private GameObject levels;
[SerializeField] private GameObject ranks;
[SerializeField] private GameObject ranks13;
[SerializeField] private GameObject levelMasks;
[SerializeField] private GameObject rankMasks;
[SerializeField] private GameObject rank13Masks;
[SerializeField] private GameObject linkMarkers;
[SerializeField] private GameObject line;
[SerializeField] private GameObject atk;
[SerializeField] private GameObject def;
[SerializeField] private Text numAtk;
[SerializeField] private Text numDef;
[SerializeField] private Image imageLinkCount;
private RectTransform descriptionRT;
private RectTransform DescriptionRT =>
descriptionRT = descriptionRT != null ? descriptionRT : textDescription.GetComponent<RectTransform>();
protected override void ShowNameOnlyParts()
{
base.ShowNameOnlyParts();
imageArt.gameObject.SetActive(false);
imageArtPendulum.gameObject.SetActive(false);
imageArtPendulumSquare.gameObject.SetActive(false);
imageArtPendulumWide.gameObject.SetActive(false);
levels.SetActive(false);
ranks.SetActive(false);
ranks13.SetActive(false);
levelMasks.SetActive(false);
rankMasks.SetActive(false);
rank13Masks.SetActive(false);
linkMarkers.SetActive(false);
tmpCardType.text = string.Empty;
line.SetActive(false);
atk.SetActive(false);
def.SetActive(false);
numAtk.text = string.Empty;
numDef.text = string.Empty;
imageLinkCount.gameObject.SetActive(false);
tmpCardType.text = string.Empty;
}
public override void SetCardName(Card data, string language)
{
base.SetCardName(data, language);
if (data.IsLevelZeroMonster())
data.Level = 0;
if (data.HasType(CardType.Xyz))
{
if (data.Level == 13)
rank13Masks.SetActive(true);
else
{
rankMasks.SetActive(true);
for (int i = 0; i < 12; i++)
rankMasks.transform.GetChild(i).gameObject.SetActive(i < data.Level);
}
}
else if (data.HasType(CardType.Monster)
&& !data.HasType(CardType.Link))
{
levelMasks.SetActive(true);
for (int i = 0; i < 12; i++)
levelMasks.transform.GetChild(i).gameObject.SetActive(i < data.Level);
}
}
public override void SetCard(Card data, string language, Texture art, Texture2D overFrame = null)
{
base.SetCard(data, language, art, overFrame);
levelMasks.SetActive(false);
rankMasks.SetActive(false);
rank13Masks.SetActive(false);
line.SetActive(true);
atk.SetActive(true);
def.SetActive(true);
numAtk.text = data.GetAttackString();
numDef.text = data.GetDefenseString();
DescriptionRT.sizeDelta = new Vector2(590f, 160f);
imageAttr.sprite = TextureManager.container.GetCardAttributeIcon(data, true);
if (data.HasType(CardType.Pendulum))
{
if(art.width == art.height)
{
imageArtPendulumSquare.gameObject.SetActive(true);
imageArtPendulumSquare.texture = art;
}
else if(art.width > art.height)
{
imageArtPendulumWide.gameObject.SetActive(true);
imageArtPendulumWide.texture = art;
}
else
{
imageArtPendulum.gameObject.SetActive(true);
imageArtPendulum.texture = art;
}
var pendulumDesc = data.GetDescriptionSplit(true);
textDescription.text = data.GetTypeForRushDuelRender();
textDescriptionPendulum.text = TextForRender(pendulumDesc[0], data.isPre);
var authorSplit = GetAuthorFromDescription(pendulumDesc[1]);
textDescription.text += Program.STRING_LINE_BREAK + TextForRender(authorSplit[0], data.isPre);
textAuther.text = authorSplit[1];
textLScale.text = data.LScale.ToString();
textRScale.text = data.RScale.ToString();
}
else
{
imageArt.gameObject.SetActive(true);
imageArt.texture = art;
var desc = string.Empty;
if (data.HasType(CardType.Monster))
desc = data.GetTypeForRushDuelRender() + Program.STRING_LINE_BREAK;
var authorSplit = GetAuthorFromDescription(data.Desc);
desc += TextForRender(authorSplit[0], data.isPre);
textDescription.text = desc;
textAuther.text = authorSplit[1];
}
if (data.IsLevelZeroMonster())
data.Level = 0;
if (data.HasType(CardType.Link))
{
tmpCardName.color = Color.white;
linkMarkers.SetActive(true);
def.SetActive(false);
numDef.text = string.Empty;
imageLinkCount.gameObject.SetActive(true);
imageLinkCount.sprite = TextureManager.container.GetOcgLinkCount(data.GetLinkCount());
for (int i = 0; i < 8; i++)
{
int bitIndex = i < 4 ? i : i + 1;
linkMarkers.transform.GetChild(i).gameObject.SetActive((data.LinkMarker & (1 << bitIndex)) != 0);
}
}
else if (data.HasType(CardType.Xyz))
{
tmpCardName.color = Color.white;
if (!data.HasType(CardType.Xyz))
{
textPassword.color = Color.white;
textAuther.color = Color.white;
}
if(data.Level == 13)
ranks13.SetActive(true);
else
{
ranks.SetActive(true);
for (int i = 0; i < 12; i++)
ranks.transform.GetChild(i).gameObject.SetActive(i < data.Level);
}
}
else if (data.HasType(CardType.Monster))
{
levels.SetActive(true);
for (int i = 0; i < 12; i++)
levels.transform.GetChild(i).gameObject.SetActive(i < data.Level);
}
else if (data.HasType(CardType.Spell, CardType.Trap))
{
descriptionRT.sizeDelta = new Vector2(590, 185);
tmpCardName.color = Color.white;
line.SetActive(false);
atk.SetActive(false);
def.SetActive(false);
numAtk.text = string.Empty;
numDef.text = string.Empty;
tmpCardType.text = data.GetSpellTypeForOCGRender();
}
}
public override RawImage GetArtPartForVideo(bool isPendulum)
{
return isPendulum ? imageArtPendulum : imageArt;
}
public override void SetAllArtPartsOff()
{
imageArt.gameObject.SetActive(false);
imageArtPendulum.gameObject.SetActive(false);
imageArtPendulumSquare.gameObject.SetActive(false);
imageArtPendulumWide.gameObject.SetActive(false);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: c5eccffa0200c0a4a9b1503ff9e61a99
\ No newline at end of file
using MDPro3.Duel.YGOSharp;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static YgomGame.Card.Content;
namespace MDPro3
{
public class CardBuilderRushDuel : CardBuilder
{
[Header("Rush Duel")]
[SerializeField] private RawImage imageArt;
[SerializeField] private RawImage imageArtPendulum;
[SerializeField] private RawImage imageArtPendulumWide;
[SerializeField] private GameObject legend;
[SerializeField] private RectTransform moveParts;
[SerializeField] private GameObject maxAtk;
[SerializeField] private TextMeshProUGUI numMaxAtk;
[SerializeField] private GameObject atk;
[SerializeField] private TextMeshProUGUI numAtk;
[SerializeField] private GameObject def;
[SerializeField] private TextMeshProUGUI numDef;
[SerializeField] private GameObject level;
[SerializeField] private TextMeshProUGUI numLevel;
[SerializeField] private GameObject rank;
[SerializeField] private TextMeshProUGUI numRank;
[SerializeField] private GameObject link;
protected override CardRenderer.CardStyle CardStyle => CardRenderer.CardStyle.RUSH_DUEL;
protected override float[] FontSizeSimplifiedChinese => new float[] { 50f, 27f };
protected override float[] FontSizeTraditionalChinese => new float[] { 55f, 28f };
protected override float[] FontSizeKorean => new float[] { 50f, 27f };
protected override float[] FontSizeJapanese => new float[] { 55f, 29f };
protected override float[] FontSizeEnglish => new float[] { 63f, 30f };
protected override void ShowNameOnlyParts()
{
base.ShowNameOnlyParts();
imageArt.gameObject.SetActive(false);
imageArtPendulum.gameObject.SetActive(false);
imageArtPendulumWide.gameObject.SetActive(false);
legend.SetActive(false);
level.SetActive(false);
rank.SetActive(false);
link.SetActive(false);
numLevel.text = string.Empty;
numRank.text = string.Empty;
}
public override void SetCard(Card data, string language, Texture art, Texture2D overFrame = null)
{
base.SetCard(data, language, art, overFrame);
numAtk.text = data.GetAttackString();
numDef.text = data.GetDefenseString();
atk.SetActive(true);
def.SetActive(true);
moveParts.gameObject.SetActive(true);
moveParts.anchoredPosition = Vector2.zero;
imageAttr.sprite = TextureManager.container.GetCardAttributeIcon(data, true);
tmpCardType.text = data.GetTypeForRushDuelRender();
if (data.HasType(CardType.Pendulum))
{
moveParts.anchoredPosition = new Vector2(0f, 133f);
if(art.width == art.height)
{
imageArt.gameObject.SetActive(true);
imageArt.texture = art;
}
else if (art.width > art.height)
{
imageArtPendulumWide.gameObject.SetActive(true);
imageArtPendulumWide.texture = art;
}
else
{
imageArtPendulum.gameObject.SetActive(true);
imageArtPendulum.texture = art;
}
textDescriptionPendulum.text = TextForRender(data.GetPendulumDescription(true), data.isPre);
var authorSplit = GetAuthorFromDescription(data.GetMonsterDescription(true));
textAuther.text = authorSplit[1];
textDescription.text = TextForRender(authorSplit[0], data.isPre);
textLScale.text = data.LScale.ToString();
textRScale.text = data.RScale.ToString();
}
else
{
imageArt.gameObject.SetActive(true);
imageArt.texture = art;
var authorSplit = GetAuthorFromDescription(data.Desc);
textDescription.text = TextForRender(authorSplit[0], data.isPre);
textAuther.text = authorSplit[1];
}
if (data.IsLevelZeroMonster())
data.Level = 0;
if (data.HasType(CardType.Link))
{
tmpCardName.color = Color.white;
def.SetActive(false);
numDef.text = string.Empty;
numLevel.text = data.GetLinkCount().ToString();
link.SetActive(true);
for (int i = 0; i < 8; i++)
{
int bitIndex = i < 4 ? i : i + 1;
link.transform.GetChild(i).gameObject.SetActive((data.LinkMarker & (1 << bitIndex)) != 0);
}
}
else if(data.HasType(CardType.Xyz))
{
tmpCardName.color = Color.white;
if (!data.HasType(CardType.Pendulum))
tmpCardType.color = Color.white;
rank.SetActive(true);
numRank.text = data.Level.ToString();
}
else if (data.HasType(CardType.Monster))
{
level.SetActive(true);
numLevel.text = data.Level.ToString();
}
else if(data.HasType(CardType.Spell, CardType.Trap))
{
atk.SetActive(false);
def.SetActive(false);
numAtk.text = string.Empty;
numDef.text = string.Empty;
}
}
public override RawImage GetArtPartForVideo(bool isPendulum)
{
return isPendulum ? imageArtPendulum : imageArt;
}
public override void SetAllArtPartsOff()
{
imageArt.gameObject.SetActive(false);
imageArtPendulum.gameObject.SetActive(false);
imageArtPendulumWide.gameObject.SetActive(false);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 989b9cd1cd9edfe4a8f87866c1e3c5ff
\ No newline at end of file
This diff is collapsed.
using MDPro3.Duel.YGOSharp;
using Newtonsoft.Json;
using System;
using System.IO;
namespace MDPro3
{
public static class SpecialCards
{
[Serializable]
private class SpecialCardLists
{
public int[] FinalAttackBlueEyes;
public int[] FinalAttackDarkM;
public int[] FinalAttackRedEyes;
public int[] FinalAttackObelisk;
public int[] FinalAttackRa;
public int[] FinalAttackSlifer;
public int[] LevelZeroMonsters;
public SpecialCardLists()
{
FinalAttackBlueEyes = new int[]
{
89631139, //青眼白龙
53347303, //青眼光龙
22804410, //渊眼白龙
38517737, //青眼亚白龙
30576089, //青眼喷气龙
9433350, //罪 青眼白龙
53183600, //青眼卡通龙
23995346, //青眼究极龙
43228023, //青眼究极亚龙
56532353, //真青眼究极龙
2129638, //青眼双爆裂龙
11443677 //青眼暴君龙
};
FinalAttackDarkM = new int[]
{
46986414, //黑魔术师
92377303, //黑衣大贤者
342673, //黑色魔术师-黑魔术师
21296502, //卡通黑魔术师
29436665, //黑魔导执行官
35191415, //黑幻想之魔术师
38033121, //黑魔术少女
90960358, //卡通黑魔术少女
50237654 //超魔导师-黑魔术师徒
};
FinalAttackRedEyes = new int[]
{
74677422, //真红眼黑龙
96561011, //真红眼暗龙
64335804, //真红眼黑钢龙
18491580, //真红眼亚黑龙
55343236, //罪 真红眼黑龙
6556909, //真红之魂
};
FinalAttackObelisk = new int[]
{
10000000 //巨神兵
};
FinalAttackRa = new int[]
{
10000010, //翼神龙
10000080, //蛋
10000090, //不死鸟
};
FinalAttackSlifer = new int[]
{
10000020 //天空龙
};
LevelZeroMonsters = new int[]
{
1686814,
90884403,
26973555,
43490025,
65305468,
52653092,
};
}
}
private const string PATH_JSON = Program.PATH_DATA + "SpecialCards.json";
private static SpecialCardLists lists;
private static SpecialCardLists Lists
{
get
{
if (lists == null)
Initialize();
return lists;
}
}
private static void Initialize()
{
if (!File.Exists(PATH_JSON))
{
lists = new SpecialCardLists();
SaveJson(lists);
return;
}
var json = File.ReadAllText(PATH_JSON);
try
{
lists = JsonConvert.DeserializeObject<SpecialCardLists>(json);
}
catch (JsonReaderException ex)
{
MessageManager.Cast("Failed to parse SpecialCards.json: " + ex.Message);
lists = new SpecialCardLists();
}
finally
{
lists ??= new SpecialCardLists();
}
}
private static void SaveJson(SpecialCardLists lists)
{
var json = JsonConvert.SerializeObject(lists, Formatting.Indented);
File.WriteAllText(PATH_JSON, json);
}
public static bool IsLevelZeroMonster(this Card data)
{
var code = data.GetOriginalID();
return Array.Exists(Lists.LevelZeroMonsters, c => c == code);
}
public static FinalAttackType GetFinalAttackType(int code)
{
var data = CardsManager.Get(code);
var id = data.GetOriginalID();
if (Array.Exists(Lists.FinalAttackBlueEyes, c => c == id))
return FinalAttackType.BlueEyes;
if (Array.Exists(Lists.FinalAttackDarkM, c => c == id))
return FinalAttackType.DarkM;
if (Array.Exists(Lists.FinalAttackRedEyes, c => c == id))
return FinalAttackType.RedEyes;
if (Array.Exists(Lists.FinalAttackObelisk, c => c == id))
return FinalAttackType.Obelisk;
if (Array.Exists(Lists.FinalAttackRa, c => c == id))
return FinalAttackType.Ra;
if (Array.Exists(Lists.FinalAttackSlifer, c => c == id))
return FinalAttackType.Slifer;
return FinalAttackType.Normal;
}
public enum FinalAttackType
{
Normal,
BlueEyes,
DarkM,
RedEyes,
Obelisk,
Ra,
Slifer,
}
}
}
fileFormatVersion: 2
guid: 251b1f8329bcd554b97c09d40773b8b2
\ No newline at end of file
...@@ -71,6 +71,7 @@ namespace MDPro3 ...@@ -71,6 +71,7 @@ namespace MDPro3
public const string PATH_ALT_ART = "Picture/Art2/"; public const string PATH_ALT_ART = "Picture/Art2/";
public const string PATH_CARD_PIC = "Picture/CardGenerated/"; public const string PATH_CARD_PIC = "Picture/CardGenerated/";
public const string PATH_CLOSEUP = "Picture/Closeup/"; public const string PATH_CLOSEUP = "Picture/Closeup/";
public const string PATH_OVER_FRAME = "Picture/OverFrame/";
public const string PATH_DATA = "Data/"; public const string PATH_DATA = "Data/";
public const string PATH_LOCALES = "Data/locales/"; public const string PATH_LOCALES = "Data/locales/";
public const string PATH_CONFIG = "Data/config.conf"; public const string PATH_CONFIG = "Data/config.conf";
......
...@@ -138,7 +138,7 @@ namespace MDPro3 ...@@ -138,7 +138,7 @@ namespace MDPro3
public static class Settings public static class Settings
{ {
private const string JsonPath = "Data/Settings.json"; private const string PATH_JSON = Program.PATH_DATA + "Settings.json";
private const string MDPRO3_VERSION_URL_OLD = "https://code.moenext.com/sherry_chaos/MDPro3/-/raw/master/Version.txt"; private const string MDPRO3_VERSION_URL_OLD = "https://code.moenext.com/sherry_chaos/MDPro3/-/raw/master/Version.txt";
private const string MDPRO3_VERSION_URL_FALSE = "https://code.moenext.com/sherry_chaos/MDPro3/-/raw/master/version.txt"; private const string MDPRO3_VERSION_URL_FALSE = "https://code.moenext.com/sherry_chaos/MDPro3/-/raw/master/version.txt";
private const string MDPRO3_VERSION_URL_DEFAULT = "https://cdn02.moecube.com:444/mdpro3-data/Version.txt"; private const string MDPRO3_VERSION_URL_DEFAULT = "https://cdn02.moecube.com:444/mdpro3-data/Version.txt";
...@@ -156,14 +156,14 @@ namespace MDPro3 ...@@ -156,14 +156,14 @@ namespace MDPro3
public static void Initialize() public static void Initialize()
{ {
if (!File.Exists(JsonPath)) if (!File.Exists(PATH_JSON))
{ {
_data = new SettingData(); _data = new SettingData();
SaveSettings(_data); SaveSettings(_data);
return; return;
} }
var json = File.ReadAllText(JsonPath); var json = File.ReadAllText(PATH_JSON);
try try
{ {
_data = EnsureDefaultValues(json); _data = EnsureDefaultValues(json);
...@@ -212,7 +212,7 @@ namespace MDPro3 ...@@ -212,7 +212,7 @@ namespace MDPro3
private static void SaveSettings(SettingData data) private static void SaveSettings(SettingData data)
{ {
var json = JsonConvert.SerializeObject(data, Formatting.Indented); var json = JsonConvert.SerializeObject(data, Formatting.Indented);
File.WriteAllText(JsonPath, json); File.WriteAllText(PATH_JSON, json);
} }
private static SettingData EnsureDefaultValues(string json) private static SettingData EnsureDefaultValues(string json)
......
This diff is collapsed.
fileFormatVersion: 2
guid: 5f03889ace155894a9f4f55595f8ff9f
\ No newline at end of file
...@@ -1356,9 +1356,14 @@ namespace MDPro3.UI.ServantUI ...@@ -1356,9 +1356,14 @@ namespace MDPro3.UI.ServantUI
{ {
string selected = EventSystem.current.currentSelectedGameObject string selected = EventSystem.current.currentSelectedGameObject
.GetComponent<SelectionButton>().GetButtonText(); .GetComponent<SelectionButton>().GetButtonText();
var currrent = Config.Get("CardStyle", selected);
Config.Set("CardStyle", selected); Config.Set("CardStyle", selected);
ButtonCardStyle.SetModeText(selected); if(currrent != selected)
UIManager.ChangeLanguage(); {
ButtonCardStyle.SetModeText(selected);
UIManager.ChangeLanguage();
MaterialLoader.ClearCachedOverFrameMasks();
}
} }
#endregion #endregion
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: b592abbe0c43f914d97d5fa7e7cef0e1 guid: bc76d40f1527fe944a1875c5939a820d
TextureImporter: TextureImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}
serializedVersion: 12 serializedVersion: 13
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 0
enableMipMap: 1 enableMipMap: 1
...@@ -20,10 +20,12 @@ TextureImporter: ...@@ -20,10 +20,12 @@ TextureImporter:
externalNormalMap: 0 externalNormalMap: 0
heightScale: 0.25 heightScale: 0.25
normalMapFilter: 0 normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0 isReadable: 0
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -38,7 +40,7 @@ TextureImporter: ...@@ -38,7 +40,7 @@ TextureImporter:
wrapU: 0 wrapU: 0
wrapV: 0 wrapV: 0
wrapW: 0 wrapW: 0
nPOTScale: 1 nPOTScale: 0
lightmap: 0 lightmap: 0
compressionQuality: 50 compressionQuality: 50
spriteMode: 0 spriteMode: 0
...@@ -62,9 +64,10 @@ TextureImporter: ...@@ -62,9 +64,10 @@ TextureImporter:
textureFormatSet: 0 textureFormatSet: 0
ignorePngGamma: 0 ignorePngGamma: 0
applyGammaDecoding: 0 applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0 cookieLightType: 0
platformSettings: platformSettings:
- serializedVersion: 3 - serializedVersion: 4
buildTarget: DefaultTexturePlatform buildTarget: DefaultTexturePlatform
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
...@@ -74,9 +77,10 @@ TextureImporter: ...@@ -74,9 +77,10 @@ TextureImporter:
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3 - serializedVersion: 4
buildTarget: Standalone buildTarget: Standalone
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
...@@ -86,10 +90,11 @@ TextureImporter: ...@@ -86,10 +90,11 @@ TextureImporter:
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3 - serializedVersion: 4
buildTarget: iPhone buildTarget: Android
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
...@@ -98,10 +103,11 @@ TextureImporter: ...@@ -98,10 +103,11 @@ TextureImporter:
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3 - serializedVersion: 4
buildTarget: Android buildTarget: iOS
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
...@@ -110,12 +116,14 @@ TextureImporter: ...@@ -110,12 +116,14 @@ TextureImporter:
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []
outline: [] outline: []
customData:
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: spriteID:
...@@ -125,9 +133,11 @@ TextureImporter: ...@@ -125,9 +133,11 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
spritePackingTag: spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
This diff is collapsed.
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