Commit d470c007 authored by mercury233's avatar mercury233

fix SelectEffectYn hint

parent 2fa3922b
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class Ocgcore : ServantWithCardDescription
......@@ -3234,18 +3235,32 @@ public class Ocgcore : ServantWithCardDescription
code = r.ReadInt32();
gps = r.ReadShortGPS();
r.ReadByte();
int cr = 95;
if (Config.ClientVersion >= 0x233c)
{
int cp = r.ReadInt32();
if (cp > 0)
cr = cp;
}
desc = GameStringManager.get(cr);
int cr = r.ReadInt32();
card = GCS_cardGet(gps, false);
desc = desc.Replace("[%ls]", "「" + card.get_data().Name + "」");
if (card != null)
{
string displayname = "「" + card.get_data().Name + "」";
if (cr == 0)
{
desc = GameStringManager.get(200);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
else if (cr == 221)
{
desc = GameStringManager.get(221);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
desc = desc + "\n" + GameStringManager.get(223);
}
else
{
desc = GameStringManager.get(cr);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
string hin = ES_hint + ",\n" + desc;
RMSshow_yesOrNo("return", hin, new messageSystemValue { value = "1", hint = "yes" }, new messageSystemValue { value = "0", hint = "no" });
card.add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting");
......
......@@ -122,5 +122,30 @@ public static class GameStringManager
}
return a;
}
internal static string formatLocation(uint location, uint sequence)
{
if (location == 0x8)
{
if (sequence < 5)
return get(1003);
else if (sequence == 5)
return get(1008);
else
return get(1009);
}
uint filter = 1;
int i = 1000;
for (; filter != 0x100 && filter != location; filter <<= 1)
++i;
if (filter == location)
return get(i);
else
return "???";
}
internal static string formatLocation(GPS gps)
{
return formatLocation(gps.location, gps.sequence);
}
}
......@@ -160,8 +160,8 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 125396}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -273, y: 99.2, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 410700}
......@@ -189,7 +189,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193174}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 75, y: -58, z: 0}
m_LocalPosition: {x: 100, y: -58, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 462324}
......@@ -202,7 +202,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 123944}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -78, y: -58, z: 0}
m_LocalPosition: {x: -100, y: -58, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 462324}
......@@ -289,7 +289,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 350, y: 220, z: 0}
m_Size: {x: 450, y: 220, z: 0}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6543226
BoxCollider:
......@@ -455,13 +455,13 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 305
mWidth: 400
mHeight: 5
mDepth: 2
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 61
aspectRatio: 80
mType: 0
mFillDirection: 4
mFillAmount: 1
......@@ -505,13 +505,13 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 302
mWidth: 402
mHeight: 172
mDepth: -100
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1.755814
aspectRatio: 2.3372092
mType: 0
mFillDirection: 4
mFillAmount: 1
......@@ -636,13 +636,13 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 260
mWidth: 360
mHeight: 120
mDepth: 10
autoResizeBoxCollider: 1
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 2.1666667
aspectRatio: 3
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
mFont: {fileID: 0}
......@@ -888,13 +888,13 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 0, g: 0, b: 0, a: 0.8627451}
mPivot: 4
mWidth: 350
mWidth: 450
mHeight: 220
mDepth: 0
autoResizeBoxCollider: 1
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1.5909091
aspectRatio: 2.0454545
mType: 1
mFillDirection: 4
mFillAmount: 1
......
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