You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2134 lines
68 KiB
2134 lines
68 KiB
using ChatFilter;
|
|
using IVDataFormat;
|
|
using System;
|
|
using System.Numerics;
|
|
using System.Text;
|
|
using UnityEngine;
|
|
|
|
// 스트링 포맷.
|
|
public static class FormatString
|
|
{
|
|
private static StringBuilder sb = new StringBuilder(256);
|
|
private static StringBuilder sbformat = new StringBuilder(256);
|
|
private static readonly IFormatProvider provider = System.Globalization.CultureInfo.InvariantCulture;
|
|
|
|
public const char C_Sharp = '#';
|
|
public const char C_Zero = '0';
|
|
public const char C_Dot = '.';
|
|
public const char C_Percent = '%';
|
|
public const char C_BracketS = '(';
|
|
public const char C_BracketE = ')';
|
|
|
|
private const string S_Empty = "";
|
|
public const string S_Blank = " ";
|
|
public const string S_BreakLine = "\n";
|
|
public const string S_CommaSpace = ", ";
|
|
public const string S_SlashSpace = " / ";
|
|
public const string S_SplitDot = "・";
|
|
public const string S_Ellipsis = "...";
|
|
public const string S_ArrowRight = " → ";
|
|
public const string S_Hypen = "-";
|
|
public const string S_IncBlank = "▲ ";
|
|
public const string S_DecBlank = "▼ ";
|
|
public const string S_BlankRp = " RP";
|
|
public const string S_Dollar = "$ ";
|
|
|
|
private const string F_Int = "N0";
|
|
private const string F_Hex = "X";
|
|
private const string F_Hex2 = "X2";
|
|
private const string F_Int1 = "D1";
|
|
private const string F_Int2 = "D2";
|
|
private const string F_Int3 = "D3";
|
|
|
|
private const string F_Float1 = "N1";
|
|
private const string F_Float2 = "N2";
|
|
private const string F_Float3 = "N3";
|
|
private const string F_Float4 = "N4";
|
|
|
|
private const string IntPer1 = "{0}.{1:0}%";
|
|
private const string IntPer2 = "{0}.{1:00}%";
|
|
private const string IntPer0Comma = "{0:#,0}%";
|
|
private const string FloatPer0 = "{0:0%}";
|
|
private const string FloatPer1 = "{0:0.0%}";
|
|
private const string FloatPer2 = "{0:0.00%}";
|
|
private const string FloatPer3 = "{0:0.000%}";
|
|
|
|
private const string TimeSec = "s";
|
|
private const string TimeBracket = "({0:#,00}:{1:00}:{2:00})";
|
|
private const string TimeDHMS = "time_dhms"; // {0:#,0}日 {1:00}:{2:00}:{3:00}
|
|
private const string TimeHMS = "{0:#,00}:{1:00}:{2:00}";
|
|
private const string TimeHMS_Space = "{0:#,00} : {1:00} : {2:00}";
|
|
private const string TimeMS = "{0:#,0}:{1:00}";
|
|
private const string TimeM0S = "{0:00}:{1:00}";
|
|
private const string UTCDateUntil = "~ yyyy-MM-dd HH:mm (UTC)";
|
|
private const string UTC9DateUntil = "~ yyyy-MM-dd HH:mm (UTC+9)";
|
|
public const string DateTimeParse = "yyyy-MM-dd HH:mm:ss"; // for json parse
|
|
public const string TimeParse = "HH:mm:ss"; // for json parse
|
|
public const string DateTimeParse0 = "0000-00-00 00:00:00";
|
|
|
|
private const string DtUtc9Line1 = "yy-MM-dd (UTC+9)";
|
|
private const string DtUtc9Line2 = "yy-MM-dd HH:mm\n(UTC+9)";
|
|
private const string DtUtc9Clock1 = "HH:mm (UTC+9)";
|
|
private const string DtLeftM = "dtleft_m";
|
|
private const string DtLeftH = "dtleft_h";
|
|
private const string DtLeftMNoLeft = "dtleft_m_noleft";
|
|
private const string DtLeftHNoLeft = "dtleft_h_noleft";
|
|
private const string DtLeftD = "dtleft_d";
|
|
private const string DtLeftHMS = "dtleft_hms";
|
|
private const string DtLeftDHMS = "dtleft_dhms";
|
|
|
|
private const string Level = "Lv.{0}";
|
|
private const string LevelPerMax = "Lv.{0} / {1}";
|
|
private const string LevelCon = "Lv.{0:#,0} {1}";
|
|
public const string LevelName = "Lv.{0} {1}";
|
|
private const string LevelBracket = "[Lv.{0}]";
|
|
private const string LevelBracketName = "[Lv.{0}] {1}";
|
|
private const string LevelChage = "Lv.{0:#,0} → {1:#,0}";
|
|
private const string ValueChange = "{0} → {1}";
|
|
|
|
private const string XCount = "x{0:#,0}";
|
|
private const string XCountBlank = "x {0:#,0}";
|
|
|
|
private const string AddCount = "+";
|
|
|
|
private const string AddIntPer0 = "+{0}%";
|
|
private const string AddIntPer1 = "+{0}.{1:0}%";
|
|
private const string AddIntPer2 = "+{0}.{1:00}%";
|
|
private const string SubIntPer0 = "-{0}%";
|
|
private const string SubIntPer1 = "-{0}.{1:0}%";
|
|
private const string SubIntPer2 = "-{0}.{1:00}%";
|
|
private const string MulIntPer0 = "x{0}%";
|
|
private const string MulIntPer1 = "x{0}.{1:0}%";
|
|
private const string MulIntPer2 = "x{0}.{1:00}%";
|
|
|
|
private const string ColorRed0 = "<color=#FF7272>0</color>";
|
|
private const string CntPer = "{0}/{1}";
|
|
private const string CntPerRed = "<color=#FF7272>{0}</color>/{1}";
|
|
private const string CntPerRedBlank = "<color=#FF7272>{0}</color> / {1}";
|
|
private const string CntPerInt = "{0:#,0}/{1:#,0}";
|
|
private const string CntPerIntBlank = "{0:#,0} / {1:#,0}";
|
|
private const string CntPerBlank = "{0} / {1}";
|
|
private const string CntPerBracket = "({0}/{1})";
|
|
private const string CntAddBracket = "{0:#,0} (+{1:#,0})";
|
|
private const string CntSubBracket = "{0:#,0} ({1:#,0})";
|
|
private const string RankAddBracket = "all_rankadd";
|
|
private const string RankSubBracket = "all_ranksub";
|
|
|
|
public const string CashDLR = "$ {0:#,0.00}";
|
|
public const string CashEUR = "€ {0:#,0.00}";
|
|
public const string CashWON = "₩ {0:#,0}";
|
|
public const string CashYEN = "¥ {0:#,0}";
|
|
|
|
public const string AreaStageNoWave = "{0:#,0}-{1}";
|
|
|
|
private const string EffectTtle = "efc";
|
|
private const string DebuffTitle = "debuff";
|
|
private const string CondDesc = "cond";
|
|
public const string SkillActiveDesc = "activedesc";
|
|
|
|
public static void PrintLog(string strtext)
|
|
{
|
|
if (string.IsNullOrEmpty(strtext))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (strtext.Length < 512)
|
|
{
|
|
Logger.LogWarning(strtext);
|
|
return;
|
|
}
|
|
|
|
sb.Length = 0;
|
|
sb.Append(strtext);
|
|
while (sb.Length > 500)
|
|
{
|
|
Logger.Log(sb.ToString(0, 500));
|
|
sb.Remove(0, 500);
|
|
}
|
|
Logger.Log(sb.ToString());
|
|
}
|
|
|
|
#region Text
|
|
public static string StringFormat(string format, params object[] args)
|
|
{
|
|
sbformat.Length = 0;
|
|
sbformat.AppendFormat(provider, format, args);
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string TextOpenStageClear(int iopenstage)
|
|
{
|
|
int iarea = iopenstage / 100;
|
|
int istage = iopenstage % 100;
|
|
sbformat.Length = 0;
|
|
sbformat.AppendFormat(LocalizationText.GetText("msg_stageopen"), iarea.ToString(), istage.ToString());
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string GetRewardType(int rewardType, int key = -1)
|
|
{
|
|
string str = "";
|
|
switch (rewardType)
|
|
{
|
|
case 100:
|
|
str = "currency";
|
|
break;
|
|
case 201:
|
|
str = "wp";
|
|
break;
|
|
case 211:
|
|
str = "cape";
|
|
break;
|
|
case 212:
|
|
str = "hat";
|
|
break;
|
|
case 213:
|
|
str = "shoes";
|
|
break;
|
|
case 221:
|
|
str = "ear";
|
|
break;
|
|
case 222:
|
|
str = "neck";
|
|
break;
|
|
case 223:
|
|
str = "ring";
|
|
break;
|
|
case 231:
|
|
str = "treasure";
|
|
break;
|
|
case 301:
|
|
case 302:
|
|
case 303:
|
|
case 304:
|
|
case 350:
|
|
str = "item";
|
|
break;
|
|
case 421:
|
|
str = "coscloth";
|
|
break;
|
|
case 422:
|
|
str = "cosweapon";
|
|
break;
|
|
case 600:
|
|
str = "box";
|
|
break;
|
|
}
|
|
if (key < 0)
|
|
return str;
|
|
|
|
str = LocalizationText.GetText(CombineAllString(str, key.ToString()));
|
|
|
|
return str;
|
|
}
|
|
#endregion Text
|
|
|
|
#region AppVersion
|
|
public static string AppVersion()
|
|
{
|
|
sb.Clear();
|
|
sb.Append(Global.MajorVer);
|
|
sb.Append(C_Dot);
|
|
sb.Append(Global.MinorVer);
|
|
sb.Append(C_Dot);
|
|
sb.Append(Global.DetailVer);
|
|
sb.Append(Global.SubVer);
|
|
sb.Append(Global.ServerType);
|
|
sb.Append(Global.Platform);
|
|
|
|
return sb.ToString();
|
|
}
|
|
#endregion
|
|
|
|
#region Text Format
|
|
public static bool IsAvailName(string strname)
|
|
{
|
|
foreach (char c in strname)
|
|
{
|
|
// 영문 대문자.
|
|
if (c >= 'A' && c <= 'Z')
|
|
continue;
|
|
// 영문 소문자.
|
|
if (c >= 'a' && c <= 'z')
|
|
continue;
|
|
// 숫자.
|
|
if (c >= '0' && c <= '9')
|
|
continue;
|
|
// 러시아.
|
|
if (c >= 0x0410 && c <= 0x044F)
|
|
continue;
|
|
// 독일, 스페인.
|
|
if (c >= 0x00C4 && c <= 0x00F1)
|
|
continue;
|
|
// 한글.
|
|
if (c >= 0xAC00 && c <= 0xD7A3)
|
|
continue;
|
|
// 일본어.
|
|
if (c >= 0x3040 && c <= 0x30FF)
|
|
continue;
|
|
// 일본어2.
|
|
if (c >= 0x31F0 && c <= 0x31FF)
|
|
continue;
|
|
// 한중일 통합 한자 확장A.
|
|
if (c >= 0x3400 && c <= 0x4DBF)
|
|
continue;
|
|
// 한중일 통합 한자.
|
|
if (c >= 0x4E00 && c <= 0x9FBF)
|
|
continue;
|
|
// 한중일 호환용 한자.
|
|
if (c >= 0xF900 && c <= 0xFAFF)
|
|
continue;
|
|
// 한중일 통합 한자 확장 B.
|
|
if (c >= 0x20000 && c <= 0x2A6DF)
|
|
continue;
|
|
// 한중일 통합 한자 확장 C.
|
|
if (c >= 0x2A700 && c <= 0x2B73F)
|
|
continue;
|
|
// 한중일 통합 한자 확장 D.
|
|
if (c >= 0x2B740 && c <= 0x2B81F)
|
|
continue;
|
|
// 한중일 호환용 한자 보충.
|
|
if (c >= 0x2F800 && c <= 0x2FA1F)
|
|
continue;
|
|
//// 그리스.
|
|
//if (c >= 0x0391 && c <= 0x03C9)
|
|
// continue;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
private static readonly string[] alphabetList = new string[]
|
|
{
|
|
"A", "B", "C", "D", "E",
|
|
"F", "G", "H", "I", "J",
|
|
"K", "L", "M", "N", "O",
|
|
"P", "Q", "R", "S", "T",
|
|
"U", "V", "W", "X", "Y",
|
|
"Z"
|
|
};
|
|
|
|
// 123 -> 1.2A -> 12.3A -> 123.4A -> 1.2B
|
|
private static string BigIntString1M(BigInteger val)
|
|
{
|
|
if (val > -1000)
|
|
return val.ToString(F_Int);
|
|
int num = 0;
|
|
int n = 0;
|
|
|
|
while (val <= -10000)
|
|
{
|
|
val /= 10;
|
|
num++;
|
|
}
|
|
|
|
n = num / 3;
|
|
num = num % 3;
|
|
|
|
float result = (int)val / Mathf.Pow(10, 3 - num);
|
|
sb.Length = 0;
|
|
sb.Append(result.ToString(F_Float1));
|
|
while (n >= 0)
|
|
{
|
|
int ichar = n % alphabetList.Length;
|
|
n -= alphabetList.Length;
|
|
sb.Append(alphabetList[ichar]);
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
// 123 -> 1.2A -> 12.3A -> 123.4A -> 1.2B
|
|
public static string BigIntString1(BigInteger val)
|
|
{
|
|
if (val < 0)
|
|
return BigIntString1M(val);
|
|
if (val < 1000)
|
|
return val.ToString(F_Int);
|
|
int num = 0;
|
|
int n = 0;
|
|
|
|
while (val >= 10000)
|
|
{
|
|
val /= 10;
|
|
num++;
|
|
}
|
|
|
|
n = num / 3;
|
|
num = num % 3;
|
|
|
|
float result = (int)val / Mathf.Pow(10, 3 - num);
|
|
sb.Length = 0;
|
|
sb.Append(result.ToString(F_Float1));
|
|
while (n >= 0)
|
|
{
|
|
int ichar = n % alphabetList.Length;
|
|
n -= alphabetList.Length;
|
|
sb.Append(alphabetList[ichar]);
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
// 123 -> 1.234A -> 12.34A -> 123.4A -> 1.234B
|
|
public static string BigIntString2(BigInteger val)
|
|
{
|
|
if (val < 10000)
|
|
return val.ToString(F_Int);
|
|
int num = 0;
|
|
int n = 0;
|
|
|
|
while (val >= 100000)
|
|
{
|
|
val /= 10;
|
|
num++;
|
|
}
|
|
|
|
n = num / 4;
|
|
num = num % 4;
|
|
|
|
float result = (int)val / Mathf.Pow(10, 4 - num);
|
|
sb.Length = 0;
|
|
if (num == 0)
|
|
sb.Append(result.ToString(F_Float4));
|
|
else if (num == 1)
|
|
sb.Append(result.ToString(F_Float3));
|
|
else if (num == 2)
|
|
sb.Append(result.ToString(F_Float2));
|
|
else
|
|
sb.Append(result.ToString(F_Float1));
|
|
|
|
while (n >= 0)
|
|
{
|
|
int ichar = n % alphabetList.Length;
|
|
n -= alphabetList.Length;
|
|
sb.Append(alphabetList[ichar]);
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
// 123 -> 1.234A -> 12.34A -> 123.4A -> 1.234B
|
|
public static string BigIntString3(BigInteger val)
|
|
{
|
|
if (val < 1000)
|
|
return val.ToString(F_Int);
|
|
int num = 0;
|
|
int n = 0;
|
|
|
|
while (val >= 10000)
|
|
{
|
|
val /= 10;
|
|
num++;
|
|
}
|
|
|
|
n = num / 3;
|
|
num = num % 3;
|
|
|
|
float result = (int)val / Mathf.Pow(10, 3 - num);
|
|
sb.Length = 0;
|
|
if (num == 0)
|
|
sb.Append(result.ToString(F_Float3));
|
|
else if (num == 1)
|
|
sb.Append(result.ToString(F_Float2));
|
|
else
|
|
sb.Append(result.ToString(F_Float1));
|
|
|
|
while (n >= 0)
|
|
{
|
|
int ichar = n % alphabetList.Length;
|
|
n -= alphabetList.Length;
|
|
sb.Append(alphabetList[ichar]);
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
#endregion Text Format
|
|
|
|
#region Int
|
|
public static string TextInt(int ivalue)
|
|
{
|
|
return ivalue.ToString(F_Int);
|
|
}
|
|
|
|
public static string TextInt(long ivalue)
|
|
{
|
|
return ivalue.ToString(F_Int);
|
|
}
|
|
|
|
public static string TextInt(BigInteger ivalue)
|
|
{
|
|
return ivalue.ToString(F_Int);
|
|
}
|
|
|
|
public static string TextInt2(int ivalue)
|
|
{
|
|
return ivalue.ToString(F_Int2);
|
|
}
|
|
|
|
public static string TextHex(int ivalue)
|
|
{
|
|
return ivalue.ToString(F_Hex);
|
|
}
|
|
|
|
public static string TextHex2(int ivalue)
|
|
{
|
|
return ivalue.ToString(F_Hex2);
|
|
}
|
|
#endregion Int
|
|
|
|
#region Int Percent
|
|
// 가변 자리수 n%.
|
|
public static string TextIntPer(int iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
iper = iper % dConst.RateDivideInt;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append(C_Dot);
|
|
|
|
sb.Append((iper / dConst.RateDivideInt1).ToString());
|
|
iper = iper % dConst.RateDivideInt1;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append((iper / dConst.RateDivideInt2).ToString());
|
|
iper = iper % dConst.RateDivideInt2;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append((iper / dConst.RateDivideInt3).ToString());
|
|
iper = iper % dConst.RateDivideInt3;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append(iper.ToString());
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
public static string TextIntPer0(int iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
//return StringFormat(IntPer0, iper / dConst.RateDivideInt);
|
|
}
|
|
|
|
|
|
public static string TextIntPer0(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
public static string TextIntPer0Comma(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString(F_Int));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
public static string TextIntPer0CommaBi(BigInteger iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString(F_Int));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
public static string TextIntPer1(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
sb.Append(C_Dot);
|
|
sb.Append(((iper % dConst.RateDivideInt) / dConst.RateDivideInt1).ToString(F_Int1));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
//return StringFormat(IntPer1, iper / dConst.RateDivideInt, (iper % dConst.RateDivideInt) / dConst.RateDivideInt1);
|
|
}
|
|
|
|
|
|
public static string TextIntPer2(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
sb.Append(C_Dot);
|
|
sb.Append(((iper % dConst.RateDivideInt) / dConst.RateDivideInt2).ToString(F_Int2));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
//return StringFormat(IntPer2, iper / dConst.RateDivideInt, (iper % dConst.RateDivideInt) / dConst.RateDivideInt2);
|
|
}
|
|
public static string TextIntPer3(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
sb.Append(C_Dot);
|
|
sb.Append(((iper % dConst.RateDivideInt) / dConst.RateDivideInt3).ToString(F_Int3));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
public static string TextIntSmallPer3(long iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append((iper / dConst.RateDivideInt1).ToString());
|
|
sb.Append(C_Dot);
|
|
sb.Append((iper % dConst.RateDivideInt1).ToString(F_Int3));
|
|
sb.Append(C_Percent);
|
|
return sb.ToString();
|
|
//return StringFormat(IntPer2, iper / dConst.RateDivideInt, (iper % dConst.RateDivideInt) / dConst.RateDivideInt2);
|
|
}
|
|
|
|
//public static string TextIntPer3(long iper)
|
|
//{
|
|
// sb.Length = 0;
|
|
// sb.Append(iper / dConst.RateDivideInt1).ToString();
|
|
// sb.Append(C_Dot);
|
|
// sb.Append(iper % dConst.RateDivideInt1).ToString();
|
|
// sb.Append(C_Percent);
|
|
// return sb.ToString();
|
|
|
|
//}
|
|
|
|
// 가변 자리수 (n%).
|
|
public static string TextIntPerBracket(int iper)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append(C_BracketS);
|
|
sb.Append((iper / dConst.RateDivideInt).ToString());
|
|
iper = iper % dConst.RateDivideInt;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
sb.Append(C_BracketE);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append(C_Dot);
|
|
|
|
sb.Append((iper / dConst.RateDivideInt1).ToString());
|
|
iper = iper % dConst.RateDivideInt1;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
sb.Append(C_BracketE);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append((iper / dConst.RateDivideInt2).ToString());
|
|
iper = iper % dConst.RateDivideInt2;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
sb.Append(C_BracketE);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append((iper / dConst.RateDivideInt3).ToString());
|
|
iper = iper % dConst.RateDivideInt3;
|
|
if (iper == 0)
|
|
{
|
|
sb.Append(C_Percent);
|
|
sb.Append(C_BracketE);
|
|
return sb.ToString();
|
|
}
|
|
|
|
sb.Append(iper.ToString());
|
|
sb.Append(C_Percent);
|
|
sb.Append(C_BracketE);
|
|
return sb.ToString();
|
|
}
|
|
#endregion Int Percent
|
|
|
|
#region Float Percent
|
|
public static string TextFloatPer0(int iper)
|
|
{
|
|
return StringFormat(FloatPer0, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
public static string TextFloatPer1(int iper)
|
|
{
|
|
return StringFormat(FloatPer1, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer2(int iper)
|
|
{
|
|
return StringFormat(FloatPer2, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer3(int iper)
|
|
{
|
|
return StringFormat(FloatPer3, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer0(long iper)
|
|
{
|
|
return StringFormat(FloatPer0, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer1(long iper)
|
|
{
|
|
return StringFormat(FloatPer1, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer2(long iper)
|
|
{
|
|
return StringFormat(FloatPer2, iper / dConst.RateMaxFloat);
|
|
}
|
|
|
|
|
|
public static string TextFloatPer3(long iper)
|
|
{
|
|
return StringFormat(FloatPer3, iper / dConst.RateMaxFloat);
|
|
}
|
|
#endregion Float Percent
|
|
|
|
#region Add/Sub
|
|
public static string TextAddInt(int ivalue)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append(AddCount);
|
|
sb.Append(ivalue.ToString());
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
//public static string ToAddSubBracket(int ivalue, int ichange)
|
|
//{
|
|
// if (ichange < 0)
|
|
// return StringFormat(CntSubBracket, ivalue, ichange);
|
|
// else
|
|
// return StringFormat(CntAddBracket, ivalue, ichange);
|
|
//}
|
|
|
|
|
|
//public static string ToAddSubBracketRank(int ivalue, int ichange)
|
|
//{
|
|
// ichange *= -1;
|
|
// if (ichange < 0)
|
|
// return StringFormat(LocalizationText.GetText(RankSubBracket), ivalue, ichange);
|
|
// else
|
|
// return StringFormat(LocalizationText.GetText(RankAddBracket), ivalue, ichange);
|
|
//}
|
|
#endregion Add/Sub
|
|
|
|
#region Count Per
|
|
public static string TextCntPer(string strleft, string strright)
|
|
{
|
|
return StringFormat(CntPer, strleft, strright);
|
|
}
|
|
|
|
public static string TextCntPerBlank(string strleft, string strright)
|
|
{
|
|
return StringFormat(CntPerBlank, strleft, strright);
|
|
}
|
|
|
|
public static string TextCntPerRed(int ileft, int iright)
|
|
{
|
|
if (ileft < 0)
|
|
return StringFormat(CntPerRed, S_Hypen, iright.ToString());
|
|
if (ileft < iright)
|
|
return StringFormat(CntPerRed, ileft.ToString(), iright.ToString());
|
|
return StringFormat(CntPer, ileft.ToString(), iright.ToString());
|
|
}
|
|
|
|
public static string TextCntPerRedBlank(int ileft, int iright)
|
|
{
|
|
if (ileft < 0)
|
|
return StringFormat(CntPerRedBlank, S_Hypen, iright.ToString());
|
|
if (ileft < iright)
|
|
return StringFormat(CntPerRedBlank, ileft.ToString(), iright.ToString());
|
|
return StringFormat(CntPerBlank, ileft.ToString(), iright.ToString());
|
|
}
|
|
#endregion Count Per
|
|
|
|
#region Level & Rank & RP
|
|
public static string TextLv(int ilv)
|
|
{
|
|
return StringFormat(Level, ilv.ToString());
|
|
}
|
|
|
|
public static string TextLvPerMax(int ilv, int imaxlv)
|
|
{
|
|
return StringFormat(LevelPerMax, ilv.ToString(), imaxlv.ToString());
|
|
}
|
|
|
|
public static string TextLvName(int ilv, string strname)
|
|
{
|
|
return StringFormat(LevelName, ilv.ToString(), strname);
|
|
}
|
|
|
|
public static string TextRank(int irank)
|
|
{
|
|
if (irank <= 0)
|
|
return StringFormat(LocalizationText.GetText("all_rankvalue"), S_Hypen);
|
|
return StringFormat(LocalizationText.GetText("all_rankvalue"), irank);
|
|
}
|
|
|
|
public static string TextRankChange(int irankchange)
|
|
{
|
|
if (irankchange == 0)
|
|
return S_Hypen;
|
|
if (irankchange > 0)
|
|
return CombineAllString(S_DecBlank, irankchange.ToString());
|
|
irankchange *= -1;
|
|
return CombineAllString(S_IncBlank, irankchange.ToString());
|
|
}
|
|
|
|
public static string TextRp(int irp)
|
|
{
|
|
return CombineAllString(irp.ToString(), S_BlankRp);
|
|
}
|
|
#endregion Level & Rank & RP
|
|
|
|
#region Grade
|
|
//public static string GradeListComma(fRangeGrade grades)
|
|
//{
|
|
// if (grades == fRangeGrade.All)
|
|
// return LocalizationText.GetText("gacharate_gradeall");
|
|
// //switch (grades)
|
|
// //{
|
|
// // case RangeGrade.Etc5_1:
|
|
// // case RangeGrade.Etc5_2:
|
|
// // case RangeGrade.Etc4_1:
|
|
// // case RangeGrade.Etc4_2:
|
|
// // case RangeGrade.Etc4_3:
|
|
// // return LocalizationText.GetText("gacharate_gradeetc");
|
|
// //}
|
|
// sb.Length = 0;
|
|
// for (int k = 0; k < 6; k++)
|
|
// {
|
|
// fRangeGrade curgrade = (fRangeGrade)Global.IntPow(2, (uint)k);
|
|
// if ((grades & curgrade) == curgrade)
|
|
// {
|
|
// if (sb.Length > 0)
|
|
// sb.Append(CommaSpace);
|
|
// sb.Append(LocalizationText.GetText(StringFormat(Global.STRF_Tier, k + 1)));
|
|
// }
|
|
// }
|
|
// return sb.ToString();
|
|
//}
|
|
|
|
|
|
//public static string GradeListSlash(fRangeGrade grades)
|
|
//{
|
|
// if (grades == fRangeGrade.All)
|
|
// return LocalizationText.GetText("gacharate_gradeall");
|
|
// switch (grades)
|
|
// {
|
|
// case fRangeGrade.Etc5_1:
|
|
// case fRangeGrade.Etc5_2:
|
|
// case fRangeGrade.Etc4_1:
|
|
// case fRangeGrade.Etc4_2:
|
|
// case fRangeGrade.Etc4_3:
|
|
// return LocalizationText.GetText("gacharate_gradeetc");
|
|
// }
|
|
// sb.Length = 0;
|
|
// for (int k = 0; k < 6; k++)
|
|
// {
|
|
// fRangeGrade curgrade = (fRangeGrade)Global.IntPow(2, (uint)k);
|
|
// if ((grades & curgrade) == curgrade)
|
|
// {
|
|
// if (sb.Length > 0)
|
|
// sb.Append(SlashSpace);
|
|
// sb.Append(LocalizationText.GetText(StringFormat(Global.STRF_Tier, k + 1)));
|
|
// }
|
|
// }
|
|
// return sb.ToString();
|
|
//}
|
|
#endregion Grade
|
|
|
|
#region Days & Term
|
|
//public static string GetDays(fDays days)
|
|
//{
|
|
// sb.Length = 0;
|
|
// bool before = false;
|
|
// if ((days & fDays.Monday) == fDays.Monday)
|
|
// {
|
|
// sb.Append(LocalizationText.GetText("all_monday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Tuesday) == fDays.Tuesday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_tuesday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Wednesday) == fDays.Wednesday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_wednesday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Thursday) == fDays.Thursday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_thursday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Friday) == fDays.Friday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_friday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Saturday) == fDays.Saturday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_saturday"));
|
|
// before = true;
|
|
// }
|
|
// if ((days & fDays.Sunday) == fDays.Sunday)
|
|
// {
|
|
// if (before)
|
|
// {
|
|
// sb.Append(SplitDot);
|
|
// }
|
|
// sb.Append(LocalizationText.GetText("all_sunday"));
|
|
// before = true;
|
|
// }
|
|
// return sb.ToString();
|
|
//}
|
|
|
|
|
|
//public static string GetTerm(fDays days, DateTime startat, DateTime endat)
|
|
//{
|
|
// if (!DataHandler.IsOpenEvent(startat, endat, days))
|
|
// return LocalizationText.GetText("all_finished");
|
|
|
|
// switch (days)
|
|
// {
|
|
// case fDays.None:
|
|
// return LocalizationText.GetText("all_finished");
|
|
// case fDays.All:
|
|
// return TimeUtils.ToLocalTime(endat).ToString(UTC9DateUntil);
|
|
|
|
// case fDays.Sunday:
|
|
// case fDays.Monday:
|
|
// case fDays.Tuesday:
|
|
// case fDays.Wednesday:
|
|
// case fDays.Thursday:
|
|
// case fDays.Friday:
|
|
// case fDays.Saturday:
|
|
// return TimeUtils.NowLocal().AddDays(1d).Date.ToString(UTC9DateUntil);
|
|
|
|
// default:
|
|
// int idays = (int)days;
|
|
// if (idays > (int)fDays.All)
|
|
// return TimeUtils.ToLocalTime(endat).ToString(UTC9DateUntil);
|
|
|
|
// //int itoday = (int)TimeUtils.GetCurDays();
|
|
|
|
// return TimeUtils.ToLocalTime(endat).ToString(UTC9DateUntil);
|
|
// }
|
|
//}
|
|
#endregion Days & Term
|
|
|
|
#region Time
|
|
public static string TextTimeSec(int isec)
|
|
{
|
|
sbformat.Length = 0;
|
|
sbformat.Append(isec.ToString());
|
|
sbformat.Append(TimeSec);
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string TextTimeSec(float fsec)
|
|
{
|
|
sbformat.Length = 0;
|
|
sbformat.Append(fsec.ToString());
|
|
sbformat.Append(TimeSec);
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string TextTime(int isec)
|
|
{
|
|
int ihour = isec / 3600;
|
|
isec -= ihour * 3600;
|
|
int imin = isec / 60;
|
|
isec -= imin * 60;
|
|
|
|
sbformat.Length = 0;
|
|
sbformat.AppendFormat(TimeHMS, ihour, imin, isec);
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string TextTimeSpace(int isec)
|
|
{
|
|
int ihour = isec / 3600;
|
|
isec -= ihour * 3600;
|
|
int imin = isec / 60;
|
|
isec -= imin * 60;
|
|
|
|
sbformat.Length = 0;
|
|
sbformat.AppendFormat(TimeHMS_Space, ihour, imin, isec);
|
|
return sbformat.ToString();
|
|
}
|
|
#endregion Time
|
|
|
|
#region DateTime
|
|
//UTC+9 시간만 표기
|
|
public static string TextDateTimeUtc9Clock1(DateTime utctime)
|
|
{
|
|
return TimeUtils.ToLocalTime(utctime).ToString(DtUtc9Clock1);
|
|
}
|
|
|
|
//UTC+9 날짜만 표기
|
|
public static string TextDateTimeUtc9Line1(DateTime utctime)
|
|
{
|
|
return TimeUtils.ToLocalTime(utctime).ToString(DtUtc9Line1);
|
|
}
|
|
|
|
// UTC+9 날짜 시간 표시.
|
|
public static string TextDateTimeUtc9Line2(DateTime utctime)
|
|
{
|
|
return TimeUtils.ToLocalTime(utctime).ToString(DtUtc9Line2);
|
|
}
|
|
|
|
// 남은 시간(시:분) 표시. 남음 없음
|
|
public static string TextLeftTimeDH_NoLeft(DateTime utctime)
|
|
{
|
|
if (utctime <= TimeUtils.Now())
|
|
{
|
|
return S_Hypen;
|
|
}
|
|
TimeSpan ts = utctime - System.DateTime.Now;
|
|
|
|
// 1분 남음.
|
|
if (ts.TotalMinutes <= 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftMNoLeft), "1");
|
|
// n분 남음.
|
|
if (ts.TotalHours < 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftMNoLeft), ts.Minutes.ToString());
|
|
// n시간 n분 남음.
|
|
else if (ts.TotalDays < 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftHNoLeft), ts.Hours.ToString(), ts.Minutes.ToString());
|
|
// n일 n시간 남음.
|
|
else
|
|
return StringFormat(LocalizationText.GetText(DtLeftD), ((int)ts.TotalDays).ToString(), ts.Hours.ToString());
|
|
}
|
|
|
|
// 남은 시간 표시.
|
|
public static string TextLeftTimeDH(DateTime utctime)
|
|
{
|
|
if (utctime <= TimeUtils.Now())
|
|
{
|
|
return S_Hypen;
|
|
}
|
|
TimeSpan ts = utctime - TimeUtils.Now();
|
|
|
|
// 1분 남음.
|
|
if (ts.TotalMinutes <= 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftM), "1");
|
|
// n분 남음.
|
|
if (ts.TotalHours < 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftM), ts.Minutes.ToString());
|
|
// n시간 n분 남음.
|
|
else if (ts.TotalDays < 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftH), ts.Hours.ToString(), ts.Minutes.ToString());
|
|
//5000 일 이상 남음
|
|
else if (ts.TotalDays > 5000d)
|
|
return StringFormat(LocalizationText.GetText("event_time_no_limit"));
|
|
// n일 n시간 남음.
|
|
else
|
|
return StringFormat(LocalizationText.GetText(DtLeftD), ((int)ts.TotalDays).ToString(), ts.Hours.ToString());
|
|
}
|
|
|
|
// 남은 시간 표시.
|
|
public static string TextLeftTimeDHMS(DateTime utctime)
|
|
{
|
|
if (utctime <= TimeUtils.Now())
|
|
{
|
|
return S_Hypen;
|
|
}
|
|
TimeSpan ts = utctime - TimeUtils.Now();
|
|
|
|
// h:mm:ss 남음.
|
|
if (ts.TotalDays < 1d)
|
|
return StringFormat(LocalizationText.GetText(DtLeftHMS), ts.Hours, ts.Minutes, ts.Seconds);
|
|
// d일 h:mm:ss 남음.
|
|
else
|
|
return StringFormat(LocalizationText.GetText(DtLeftDHMS), ((int)ts.TotalDays).ToString(), ts.Hours, ts.Minutes, ts.Seconds);
|
|
}
|
|
|
|
//public static string GetTimeStringBracket(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return "(00:00:00)";
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// #region hh:MM:ss
|
|
// if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(TimeBracket, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// long iday = (long)(ts.TotalDays + 0.00001d);
|
|
// if (ts.Hours != 0 || ts.Minutes != 0 || ts.Seconds != 0)
|
|
// iday++;
|
|
// sb.Length = 0;
|
|
// sb.Append("(");
|
|
// sb.Append(StringFormat(LocalizationText.GetText("all_daycount"), iday));
|
|
// sb.Append(")");
|
|
// strtime = sb.ToString();
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringDay(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// #region hh:MM:ss
|
|
// if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(TimeHMS, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// //long iday = (long)(ts.TotalDays + 0.00001d);
|
|
// //if (ts.Hours != 0 || ts.Minutes != 0 || ts.Seconds != 0)
|
|
// // iday++;
|
|
// //strtime = StringFormat(LocalizationText.GetText("all_daycount"), iday);
|
|
// long iday = (long)ts.TotalDays;
|
|
// strtime = StringFormat(LocalizationText.GetText(TimeDHMS), iday, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeString(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// #region hh:MM:ss
|
|
// if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(TimeHMS, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// long iday = (long)(ts.TotalDays + 0.00001d);
|
|
// if (ts.Hours != 0 || ts.Minutes != 0 || ts.Seconds != 0)
|
|
// iday++;
|
|
// strtime = StringFormat(LocalizationText.GetText("all_daycount"), iday);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringDay(TimeSpan ts)
|
|
//{
|
|
// if (ts.TotalSeconds <= 0d)
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// #region hh:MM:ss
|
|
// if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(TimeHMS, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// long iday = (long)ts.TotalDays;
|
|
// strtime = StringFormat(LocalizationText.GetText(TimeDHMS), iday, ts.Hours, ts.Minutes, ts.Seconds);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringDay(long itime)
|
|
//{
|
|
// if (itime <= 0L)
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// #region hh:MM:ss
|
|
// if (itime < 86400L)
|
|
// {
|
|
// long ihour = itime / 3600L;
|
|
// itime = itime % 3600L;
|
|
// long imin = itime / 60L;
|
|
// long isec = itime % 60L;
|
|
// strtime = StringFormat(TimeHMS, ihour, imin, isec);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// //long iday = (itime / 86400L);
|
|
// //if (itime % 86400L != 0)
|
|
// // iday++;
|
|
// //strtime = StringFormat(LocalizationText.GetText("all_daycount"), iday);
|
|
// long iday = (itime / 86400L);
|
|
// itime = itime % 86400L;
|
|
// long ihour = itime / 3600L;
|
|
// itime = itime % 3600L;
|
|
// long imin = itime / 60L;
|
|
// long isec = itime % 60L;
|
|
// strtime = StringFormat(LocalizationText.GetText(TimeDHMS), iday, ihour, imin, isec);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeString(long itime)
|
|
//{
|
|
// if (itime <= 0L)
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// #region hh:MM:ss
|
|
// if (itime < 86400L)
|
|
// {
|
|
// long ihour = itime / 3600L;
|
|
// itime = itime % 3600L;
|
|
// long imin = itime / 60L;
|
|
// long isec = itime % 60L;
|
|
// strtime = StringFormat(TimeHMS, ihour, imin, isec);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// long iday = (itime / 86400L);
|
|
// if (itime % 86400L != 0)
|
|
// iday++;
|
|
// strtime = StringFormat(LocalizationText.GetText("all_daycount"), iday);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeString(double ftime)
|
|
//{
|
|
// long itime = Convert.ToInt64(ftime);
|
|
// if (itime <= 0L)
|
|
// {
|
|
// return "00:00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// #region hh:MM:ss
|
|
// if (itime < 86400L)
|
|
// {
|
|
// long ihour = itime / 3600L;
|
|
// itime = itime % 3600L;
|
|
// long imin = itime / 60L;
|
|
// long isec = itime % 60L;
|
|
// strtime = StringFormat(TimeHMS, ihour, imin, isec);
|
|
// }
|
|
// #endregion hh:MM:ss
|
|
// #region Day
|
|
// else
|
|
// {
|
|
// long iday = (itime / 86400L);
|
|
// if (itime % 86400L != 0)
|
|
// iday++;
|
|
// strtime = StringFormat(LocalizationText.GetText("all_daycount"), iday);
|
|
// }
|
|
// #endregion Day
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringSec(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return "00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// strtime = StringFormat(TimeMS, (int)ts.TotalMinutes, ts.Seconds);
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringMin(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return "00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// strtime = StringFormat(TimeMS, (int)ts.TotalHours, ts.Minutes);
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringMin(long itime)
|
|
//{
|
|
// if (itime <= 0)
|
|
// {
|
|
// return "00:00";
|
|
// }
|
|
// string strtime = null;
|
|
// long ihour = itime / 3600;
|
|
// long imin = itime % 3600;
|
|
// strtime = StringFormat(TimeMS, ihour, imin);
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringPast(DateTime time)
|
|
//{
|
|
// if (time >= TimeUtils.Now())
|
|
// {
|
|
// return LocalizationText.GetText("dtago_now");
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = TimeUtils.Now() - time;
|
|
// if (ts.TotalHours < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtago_m"), ts.Minutes);
|
|
// }
|
|
// else if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtago_h"), ts.Hours);
|
|
// }
|
|
// else
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtago_d"), ts.Days);
|
|
// }
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeStringLeft(System.DateTime time)
|
|
//{
|
|
// if (time <= TimeUtils.Now())
|
|
// {
|
|
// return LocalizationText.GetText("dtleft_comp");
|
|
// }
|
|
// string strtime = null;
|
|
// TimeSpan ts = time - TimeUtils.Now();
|
|
// if (ts.TotalHours < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_m"), ts.Minutes);
|
|
// }
|
|
// else if (ts.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_h"), ts.Hours, ts.Minutes);
|
|
// }
|
|
// else
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_d"), ts.Days, ts.Hours);
|
|
// }
|
|
// return strtime;
|
|
//}
|
|
|
|
//public static string GetTimeSPanLeft(TimeSpan time)
|
|
//{
|
|
// string strtime = null;
|
|
// if (time.TotalHours < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_m"), time.Minutes);
|
|
// }
|
|
// else if (time.TotalDays < 1d)
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_h"), time.Hours, time.Minutes);
|
|
// }
|
|
// else
|
|
// {
|
|
// strtime = StringFormat(LocalizationText.GetText("dtleft_d"), time.Days, time.Hours);
|
|
// }
|
|
// return strtime;
|
|
//}
|
|
#endregion DateTime
|
|
|
|
#region Price & Limit
|
|
public static string TextPriceCash(int price)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append(S_Dollar);
|
|
sb.Append((price / 100).ToString());
|
|
sb.Append(C_Dot);
|
|
sb.Append((price % 100).ToString(F_Int2));
|
|
return sb.ToString();
|
|
}
|
|
|
|
// 구매 제한 텍스트 가져오기.
|
|
public static string TextShopLimit(eRefreshType refreshtype, int refreshvalue, int icount, int ilimit)
|
|
{
|
|
sbformat.Length = 0;
|
|
if (refreshtype == eRefreshType.Daily && refreshvalue == 30)
|
|
sbformat.Append(LocalizationText.GetText("shoplimit30"));
|
|
else if (icount == 0)
|
|
sbformat.AppendFormat(provider, LocalizationText.GetText(FormatString.CombineAllString("shoplimit", ((int)refreshtype).ToString())), ColorRed0, ilimit.ToString());
|
|
else
|
|
sbformat.AppendFormat(provider, LocalizationText.GetText(FormatString.CombineAllString("shoplimit", ((int)refreshtype).ToString())), icount.ToString(), ilimit.ToString());
|
|
return sbformat.ToString();
|
|
}
|
|
#endregion Price & Limit
|
|
|
|
#region Effect
|
|
public static string TextEffectTitle(eEffectType efctype)
|
|
{
|
|
sbformat.Length = 0;
|
|
sbformat.Append(EffectTtle);
|
|
sbformat.Append(((int)efctype).ToString());
|
|
return LocalizationText.GetText(sbformat.ToString());
|
|
}
|
|
|
|
public static string TextEffectValue(eEffectType efctype, float fvalue)
|
|
{
|
|
long value = (long)fvalue;
|
|
switch (efctype)
|
|
{
|
|
case eEffectType.None:
|
|
return S_Empty;
|
|
|
|
case eEffectType.SkillDamage:
|
|
case eEffectType.SkillCool:
|
|
case eEffectType.HealPerSec:
|
|
case eEffectType.PetBuff:
|
|
case eEffectType.GearBuff:
|
|
case eEffectType.AtkAble:
|
|
case eEffectType.HpAble:
|
|
case eEffectType.AtkWill:
|
|
case eEffectType.HpWill:
|
|
case eEffectType.AtkBuff:
|
|
case eEffectType.HpBuff:
|
|
return TextIntPer0(value);
|
|
|
|
case eEffectType.CrtRate:
|
|
return TextIntPer2(value);
|
|
|
|
case eEffectType.Mov:
|
|
case eEffectType.Spd:
|
|
case eEffectType.GoldDropRate:
|
|
case eEffectType.ExpDropRate:
|
|
case eEffectType.ChestDropRate:
|
|
case eEffectType.PetBoxDropRate:
|
|
case eEffectType.DgGoldBonus:
|
|
case eEffectType.DgReinStoneBonus:
|
|
case eEffectType.DgPetBonus:
|
|
case eEffectType.DgAwakneStoneBonus:
|
|
return TextIntPer1(value);
|
|
|
|
default:
|
|
return TextInt(value);
|
|
}
|
|
}
|
|
|
|
public static string TextEffectValue(eEffectType efctype, long value, bool bint = false, bool bper = true, bool bownEffect = false)
|
|
{
|
|
switch (efctype)
|
|
{
|
|
case eEffectType.None:
|
|
return S_Empty;
|
|
|
|
case eEffectType.SkillDamage:
|
|
case eEffectType.SkillCool:
|
|
case eEffectType.HealPerSec:
|
|
case eEffectType.PetBuff:
|
|
case eEffectType.GearBuff:
|
|
case eEffectType.AtkAble:
|
|
case eEffectType.HpAble:
|
|
case eEffectType.AtkWill:
|
|
case eEffectType.HpWill:
|
|
case eEffectType.AtkBuff:
|
|
case eEffectType.HpBuff:
|
|
return TextIntPer0(value);
|
|
|
|
case eEffectType.CrtRate:
|
|
return TextIntPer2(value);
|
|
|
|
case eEffectType.Mov:
|
|
case eEffectType.Spd:
|
|
case eEffectType.GoldDropRate:
|
|
case eEffectType.ExpDropRate:
|
|
case eEffectType.ChestDropRate:
|
|
case eEffectType.PetBoxDropRate:
|
|
case eEffectType.DgGoldBonus:
|
|
case eEffectType.DgReinStoneBonus:
|
|
case eEffectType.DgPetBonus:
|
|
case eEffectType.DgAwakneStoneBonus:
|
|
return TextIntPer1(value);
|
|
|
|
case eEffectType.AtkBase:
|
|
case eEffectType.HpBase:
|
|
if (bper)
|
|
{
|
|
if (!bint)
|
|
return TextIntSmallPer3(value);
|
|
else if (!bownEffect)
|
|
return TextIntPer3(value);
|
|
else
|
|
return TextIntPer0(value);
|
|
}
|
|
else
|
|
return TextInt(value);
|
|
|
|
|
|
|
|
default:
|
|
return TextInt(value);
|
|
}
|
|
}
|
|
|
|
public static string TextEffectTitleValue(eEffectType efctype, long value)
|
|
{
|
|
if (efctype == eEffectType.None)
|
|
return S_Empty;
|
|
|
|
sbformat.Length = 0;
|
|
sbformat.Append(EffectTtle);
|
|
sbformat.Append(((int)efctype).ToString());
|
|
string strtitle = LocalizationText.GetText(sbformat.ToString());
|
|
string strvalue = null;
|
|
|
|
switch (efctype)
|
|
{
|
|
case eEffectType.SkillDamage:
|
|
case eEffectType.SkillCool:
|
|
case eEffectType.HealPerSec:
|
|
case eEffectType.PetBuff:
|
|
case eEffectType.GearBuff:
|
|
case eEffectType.AtkAble:
|
|
case eEffectType.HpAble:
|
|
case eEffectType.AtkWill:
|
|
case eEffectType.HpWill:
|
|
case eEffectType.AtkBuff:
|
|
case eEffectType.HpBuff:
|
|
strvalue = TextIntPer0Comma(value);
|
|
break;
|
|
|
|
case eEffectType.CrtRate:
|
|
strvalue = TextIntPer2(value);
|
|
break;
|
|
|
|
case eEffectType.Mov:
|
|
case eEffectType.Spd:
|
|
case eEffectType.GoldDropRate:
|
|
case eEffectType.ExpDropRate:
|
|
case eEffectType.ChestDropRate:
|
|
case eEffectType.PetBoxDropRate:
|
|
case eEffectType.AtkBase:
|
|
case eEffectType.HpBase:
|
|
case eEffectType.DgGoldBonus:
|
|
case eEffectType.DgReinStoneBonus:
|
|
case eEffectType.DgPetBonus:
|
|
case eEffectType.DgAwakneStoneBonus:
|
|
strvalue = TextIntPer1(value);
|
|
break;
|
|
|
|
default:
|
|
strvalue = TextInt(value);
|
|
break;
|
|
}
|
|
|
|
sbformat.Length = 0;
|
|
sbformat.Append(strtitle);
|
|
sbformat.Append(S_Blank);
|
|
sbformat.Append(strvalue);
|
|
return sbformat.ToString();
|
|
}
|
|
|
|
public static string TextEffectTitleValuesBreakline(eEffectType efctype1, long value1, eEffectType efctype2, long value2)
|
|
{
|
|
if (efctype1 == eEffectType.None)
|
|
return LocalizationText.GetText("own_effect_none");
|
|
|
|
string strefc1 = TextEffectTitleValue(efctype1, value1);
|
|
if (efctype2 == eEffectType.None)
|
|
return strefc1;
|
|
|
|
string strefc2 = TextEffectTitleValue(efctype2, value2);
|
|
sb.Length = 0;
|
|
sb.Append(strefc1);
|
|
sb.Append(S_BreakLine);
|
|
sb.Append(strefc2);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string TextEffectTitleValuesComma(eEffectType efctype1, long value1, eEffectType efctype2, long value2)
|
|
{
|
|
if (efctype1 == eEffectType.None)
|
|
return LocalizationText.GetText("own_effect_none");
|
|
|
|
string strefc1 = TextEffectTitleValue(efctype1, value1);
|
|
if (efctype2 == eEffectType.None)
|
|
return strefc1;
|
|
|
|
string strefc2 = TextEffectTitleValue(efctype2, value2);
|
|
sb.Length = 0;
|
|
sb.Append(strefc1);
|
|
sb.Append(S_CommaSpace);
|
|
sb.Append(strefc2);
|
|
return sb.ToString();
|
|
}
|
|
#endregion Effect
|
|
|
|
#region Debuff
|
|
public static string TextDebuffTitle(eSkillDebuff debufftype)
|
|
{
|
|
sbformat.Length = 0;
|
|
sbformat.Append(DebuffTitle);
|
|
sbformat.Append(((int)debufftype).ToString());
|
|
return LocalizationText.GetText(sbformat.ToString());
|
|
}
|
|
|
|
public static string TextDebuffValue(eSkillDebuff debufftype, int value, float time)
|
|
{
|
|
switch (debufftype)
|
|
{
|
|
case eSkillDebuff.None:
|
|
return S_Empty;
|
|
|
|
case eSkillDebuff.DecMove:
|
|
case eSkillDebuff.DamageSec:
|
|
return TextIntPer(value);
|
|
//return CombineAllString(TextIntPer(value), C_Blank.ToString(), TextTimeSec(time));
|
|
|
|
case eSkillDebuff.Push:
|
|
return TextInt(value / dConst.RangeDivide);
|
|
|
|
case eSkillDebuff.Stun:
|
|
return TextTimeSec(time);
|
|
|
|
default:
|
|
return TextInt(value);
|
|
}
|
|
}
|
|
#endregion Debuff
|
|
|
|
#region Condition
|
|
public static string TextCondition(eCondition condition, int value)
|
|
{
|
|
if (condition == eCondition.None)
|
|
return S_Empty;
|
|
|
|
sbformat.Length = 0;
|
|
sbformat.Append(CondDesc);
|
|
sbformat.Append(((int)condition).ToString());
|
|
string strdesc = LocalizationText.GetText(sbformat.ToString());
|
|
|
|
switch (condition)
|
|
{
|
|
case eCondition.StageClear:
|
|
case eCondition.DgStagePet:
|
|
return StringFormat(strdesc, (value / 100).ToString(), (value % 100).ToString());
|
|
case eCondition.CosHave:
|
|
string cosname = LocalizationText.GetText(CombineAllString("coscloth", value.ToString()));
|
|
return StringFormat(strdesc, cosname);
|
|
case eCondition.CosSetHave:
|
|
string cossetname = LocalizationText.GetText(CombineAllString("cosclothset", value.ToString()));
|
|
return StringFormat(strdesc, cossetname);
|
|
case eCondition.EquipIcon:
|
|
string iconname = LocalizationText.GetText(CombineAllString("profile_icon_name", value.ToString()));
|
|
return StringFormat(strdesc, iconname);
|
|
case eCondition.EquipTitle:
|
|
string titlename = LocalizationText.GetText(CombineAllString("profile_title_name", value.ToString()));
|
|
return StringFormat(strdesc, titlename);
|
|
case eCondition.Etc:
|
|
return LocalizationText.GetText(CombineAllString(CondDesc, ((int)condition + value).ToString()));
|
|
default:
|
|
return StringFormat(strdesc, TextInt(value));
|
|
}
|
|
}
|
|
|
|
public static string TextConditionValue(eCondition condition, int value)
|
|
{
|
|
if (condition == eCondition.None)
|
|
return S_Empty;
|
|
|
|
switch (condition)
|
|
{
|
|
case eCondition.StageClear:
|
|
return StringFormat(AreaStageNoWave, (value / 100).ToString(), (value % 100).ToString());
|
|
case eCondition.DgStagePet:
|
|
float inum = Mathf.Ceil((float)value / 10);
|
|
return StringFormat(AreaStageNoWave, inum.ToString(), (value - (inum - 1) * 10).ToString());
|
|
case eCondition.Etc:
|
|
return LocalizationText.GetText(CombineAllString(CondDesc, ((int)condition + value).ToString()));
|
|
|
|
default:
|
|
return TextInt(value);
|
|
}
|
|
}
|
|
|
|
public static string TextConditionRate(nAchivement achive)
|
|
{
|
|
if (achive.condition == eCondition.None)
|
|
return S_Empty;
|
|
|
|
switch (achive.condition)
|
|
{
|
|
// 스테이지 형식의 조건
|
|
case eCondition.StageClear:
|
|
case eCondition.DgStagePet:
|
|
//return TextCntPerBlank(TextConditionValue(achive.condition,DataHandler.GetAchievementValue(achive) > achive.condValue ?
|
|
// achive.condValue : DataHandler.GetAchievementValue(achive)), TextConditionValue(achive.condition, achive.condValue));
|
|
|
|
// 횟수,레벨 비교가 아닌 달성 여부를 가리는 조건
|
|
case eCondition.CosHave:
|
|
case eCondition.CosSetHave:
|
|
case eCondition.EquipHaveAll:
|
|
case eCondition.EquipHaveWeaponAll:
|
|
case eCondition.EquipHaveWeaponD:
|
|
case eCondition.EquipHaveWeaponC:
|
|
case eCondition.EquipHaveWeaponB:
|
|
case eCondition.EquipHaveWeaponA:
|
|
case eCondition.EquipHaveWeaponSS:
|
|
case eCondition.EquipHaveWeaponS:
|
|
case eCondition.EquipHaveWeaponSR:
|
|
case eCondition.EquipHaveArmorAll:
|
|
case eCondition.EquipHaveArmorD:
|
|
case eCondition.EquipHaveArmorC:
|
|
case eCondition.EquipHaveArmorB:
|
|
case eCondition.EquipHaveArmorA:
|
|
case eCondition.EquipHaveArmorSS:
|
|
case eCondition.EquipHaveArmorS:
|
|
case eCondition.EquipHaveArmorSR:
|
|
case eCondition.EquipHaveAccAll:
|
|
case eCondition.EquipHaveAccD:
|
|
case eCondition.EquipHaveAccC:
|
|
case eCondition.EquipHaveAccB:
|
|
case eCondition.EquipHaveAccA:
|
|
case eCondition.EquipHaveAccSS:
|
|
case eCondition.EquipHaveAccS:
|
|
case eCondition.EquipHaveAccSR:
|
|
case eCondition.EquipHaveWeaponNOne:
|
|
case eCondition.EquipHaveWeaponROne:
|
|
case eCondition.EquipHaveWeaponEOne:
|
|
case eCondition.EquipHaveWeaponUOne:
|
|
case eCondition.EquipHaveWeaponLOne:
|
|
case eCondition.EquipHaveWeaponHOne:
|
|
case eCondition.EquipHaveWeaponMOne:
|
|
case eCondition.EquipHaveEarNOne:
|
|
case eCondition.EquipHaveEarROne:
|
|
case eCondition.EquipHaveEarEOne:
|
|
case eCondition.EquipHaveEarUOne:
|
|
case eCondition.EquipHaveEarLOne:
|
|
case eCondition.EquipHaveEarHOne:
|
|
case eCondition.EquipHaveEarMOne:
|
|
case eCondition.EquipWeapon:
|
|
case eCondition.EquipArmorCape:
|
|
case eCondition.EquipArmorHat:
|
|
case eCondition.EquipArmorShoes:
|
|
case eCondition.EquipAccEar:
|
|
case eCondition.EquipAccNeck:
|
|
case eCondition.EquipAccRing:
|
|
case eCondition.DgStageGold:
|
|
case eCondition.DgStageEnhance:
|
|
case eCondition.DgStageAwaken:
|
|
case eCondition.SkillEquip:
|
|
case eCondition.PetHave:
|
|
case eCondition.EquipIcon:
|
|
case eCondition.EquipTitle:
|
|
case eCondition.AutoBattle:
|
|
case eCondition.ActivateADbuff:
|
|
case eCondition.ActivateADbuffAtk:
|
|
case eCondition.ActivateADbuffExp:
|
|
case eCondition.ActivateADbuffGold:
|
|
return TextCntPerBlank(DataHandler.isClearAchievements(achive) >= 1 ? 1.ToString() : 0.ToString(), 1.ToString());
|
|
default:
|
|
return TextCntPerBlank(DataHandler.GetAchievementValue(achive) > achive.condValue ?
|
|
achive.condValue.ToString() : DataHandler.GetAchievementValue(achive).ToString() , achive.condValue.ToString());
|
|
}
|
|
}
|
|
#endregion Condition
|
|
|
|
#region Open Condition
|
|
#endregion Open Condition
|
|
|
|
#region Chat
|
|
private const string ChatWhite = "#EDEDEDFF";
|
|
private const string ChatGreen = "#A5E95BFF";
|
|
private const string ChatBlue = "#4F9CD5FF";
|
|
private const string ChatPurple = "#B0A0FFFF";
|
|
private const string ChatYellow = "#FFF284FF";
|
|
private const string ChatViolet = "#D259E6FF";
|
|
private const string ChatRed = "#D74C4CFF";
|
|
|
|
public static string GetChatColor(int iplayertitle)
|
|
{
|
|
//iplayertitle -= IdPreset.Peerage;
|
|
//if (iplayertitle >= 30)
|
|
// return ChatRed;
|
|
//if (iplayertitle >= 28)
|
|
// return ChatViolet;
|
|
//if (iplayertitle >= 25)
|
|
// return ChatYellow;
|
|
//if (iplayertitle >= 21)
|
|
// return ChatPurple;
|
|
//if (iplayertitle >= 16)
|
|
// return ChatBlue;
|
|
//if (iplayertitle >= 10)
|
|
// return ChatGreen;
|
|
return ChatPurple;
|
|
}
|
|
|
|
public static string GetChatMessageSmall(int iplayertitle, string username, string strmsg)
|
|
{
|
|
username = BanWordFilter.FilterSpChar(username);
|
|
string usertitle = iplayertitle != -1 ? LocalizationText.GetText(StringFormat("profile_title_name{0}", iplayertitle.ToString())) : LocalizationText.GetText("profile_empty_title");
|
|
return CutEllipsis(StringFormat(LocalizationText.GetText("chat_msgmain"), strmsg, username, usertitle), 50);
|
|
}
|
|
|
|
public static string GetChatName(int irank, int iplayertitle, string username)
|
|
{
|
|
username = BanWordFilter.FilterSpChar(username);
|
|
string usertitle = iplayertitle != -1 ? LocalizationText.GetText(StringFormat("profile_title_name{0}", iplayertitle.ToString())) : LocalizationText.GetText("profile_empty_title");
|
|
return StringFormat(LocalizationText.GetText("chat_name"), username, usertitle, GetChatColor(iplayertitle));
|
|
}
|
|
#endregion Chat
|
|
|
|
#region File
|
|
public static string FileSize(long size)
|
|
{
|
|
sb.Length = 0;
|
|
long kb = size / 1024L;
|
|
if (kb < 1024L)
|
|
{
|
|
sb.Append(kb);
|
|
sb.Append("KB");
|
|
return sb.ToString();
|
|
}
|
|
long mb = kb / 1024L;
|
|
if (mb < 1024L)
|
|
{
|
|
sb.Append(mb);
|
|
sb.Append("MB");
|
|
return sb.ToString();
|
|
}
|
|
long gb = mb / 1024L;
|
|
sb.Append(gb);
|
|
sb.Append("GB");
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string FileSizeF1(long size)
|
|
{
|
|
if (size < 1024L)
|
|
{
|
|
return StringFormat("{0:#,0}bytes", size);
|
|
}
|
|
float kb = size / 1024f;
|
|
if (kb < 1024f)
|
|
{
|
|
return StringFormat("{0:#,0.0}KB", kb);
|
|
}
|
|
float mb = kb / 1024f;
|
|
if (mb < 1024f)
|
|
{
|
|
return StringFormat("{0:#,0.0}MB", mb);
|
|
}
|
|
float gb = mb / 1024f;
|
|
return StringFormat("{0:#,0.0}GB", gb);
|
|
}
|
|
#endregion File
|
|
|
|
#region Name & Desc
|
|
// 재화 이름.
|
|
public static string GetGoodsName(int itype, int icode)
|
|
{
|
|
switch (itype)
|
|
{
|
|
case cGoods.TAdsRemove:
|
|
return LocalizationText.GetText("adremove");
|
|
case cGoods.TCurrency:
|
|
return LocalizationText.GetText(CombineAllString("currency", icode.ToString()));
|
|
|
|
case cGoods.TBagWeapon:
|
|
return LocalizationText.GetText(CombineAllString("wp", icode.ToString()));
|
|
case cGoods.TBagArmorCape:
|
|
return LocalizationText.GetText(CombineAllString("cape", icode.ToString()));
|
|
case cGoods.TBagArmorHat:
|
|
return LocalizationText.GetText(CombineAllString("hat", icode.ToString()));
|
|
case cGoods.TBagArmorShoes:
|
|
return LocalizationText.GetText(CombineAllString("shoes", icode.ToString()));
|
|
case cGoods.TBagAcceEar:
|
|
return LocalizationText.GetText(CombineAllString("ear", icode.ToString()));
|
|
case cGoods.TBagAcceNeck:
|
|
return LocalizationText.GetText(CombineAllString("neck", icode.ToString()));
|
|
case cGoods.TBagAcceRing:
|
|
return LocalizationText.GetText(CombineAllString("ring", icode.ToString()));
|
|
case cGoods.TBagTreasure:
|
|
return LocalizationText.GetText(CombineAllString("treasure", icode.ToString()));
|
|
|
|
case cGoods.TPet:
|
|
return LocalizationText.GetText(CombineAllString("pet", icode.ToString()));
|
|
case cGoods.TPetSpirit:
|
|
return LocalizationText.GetText(CombineAllString("petspirit", icode.ToString()));
|
|
|
|
case cGoods.TSkillActive:
|
|
return LocalizationText.GetText(CombineAllString("active", icode.ToString()));
|
|
case cGoods.TSkillPassive:
|
|
return LocalizationText.GetText(CombineAllString("passive", icode.ToString()));
|
|
|
|
case cGoods.TDgTicketGold:
|
|
case cGoods.TDgTicketPet:
|
|
case cGoods.TDgTicketEnhance:
|
|
case cGoods.TDgTicketAwaken:
|
|
case cGoods.TDgTicketRelic:
|
|
case cGoods.TPvpTicket:
|
|
return LocalizationText.GetText(CombineAllString("item", itype.ToString()));
|
|
|
|
case cGoods.TCosCloth:
|
|
return LocalizationText.GetText(CombineAllString("coscloth", icode.ToString()));
|
|
case cGoods.TCosWeapon:
|
|
return LocalizationText.GetText(CombineAllString("cosweapon", icode.ToString()));
|
|
case cGoods.TPass:
|
|
return LocalizationText.GetText(CombineAllString("pass", icode.ToString()));
|
|
|
|
case cGoods.TBox:
|
|
return LocalizationText.GetText(CombineAllString("box", icode.ToString()));
|
|
|
|
case cGoods.TProfileIcon:
|
|
return LocalizationText.GetText(CombineAllString("profile_icon_name", icode.ToString()));
|
|
case cGoods.TProfileTitle:
|
|
return LocalizationText.GetText(CombineAllString("profile_title_name", icode.ToString()));
|
|
}
|
|
return S_Empty;
|
|
}
|
|
|
|
// 재화 설명.
|
|
public static string GetGoodsDesc(int itype, int icode)
|
|
{
|
|
switch (itype)
|
|
{
|
|
case cGoods.TPetSpirit:
|
|
return LocalizationText.GetText(CombineAllString("petspiritdesc", icode.ToString()));
|
|
|
|
case cGoods.TPass:
|
|
return LocalizationText.GetText(CombineAllString("passdesc", icode.ToString()));
|
|
|
|
case cGoods.TBox:
|
|
return LocalizationText.GetText(CombineAllString("boxdesc", GetBoxNum(icode).ToString()));
|
|
}
|
|
return S_Empty;
|
|
}
|
|
public static int GetBoxNum(int icode)
|
|
{
|
|
|
|
switch (icode)
|
|
{
|
|
case int n when (icode < 100):
|
|
return 1;
|
|
case int n when (icode >= 100 && icode < 200):
|
|
return 100;
|
|
case int n when (icode >= 400 && icode <= 403):
|
|
return 400;
|
|
case int n when (icode >= 404 && icode <= 407):
|
|
return 401;
|
|
case int n when (icode >= 408 && icode <= 411):
|
|
return 402;
|
|
case int n when (icode >= 412 && icode <= 415):
|
|
return 403;
|
|
case int n when (icode >= 416 && icode <= 419):
|
|
return 404;
|
|
case int n when (icode >= 420 && icode <= 423):
|
|
return 405;
|
|
case int n when (icode >= 424 && icode <= 427):
|
|
return 406;
|
|
case int n when (icode >= 500 && icode <= 503):
|
|
return 500;
|
|
case int n when (icode >= 504 && icode <= 507):
|
|
return 501;
|
|
case int n when (icode >= 508 && icode <= 511):
|
|
return 502;
|
|
case int n when (icode >= 512 && icode <= 515):
|
|
return 503;
|
|
case int n when (icode >= 516 && icode <= 519):
|
|
return 504;
|
|
case int n when (icode >= 520 && icode <= 523):
|
|
return 505;
|
|
case int n when (icode >= 524 && icode <= 527):
|
|
return 506;
|
|
default:
|
|
return icode;
|
|
}
|
|
//if (icode < 100)
|
|
// return 1;
|
|
//else if (icode <= 100 && icode < 200)
|
|
// return 100;
|
|
//else if (icode >= 400 && icode <= 403)
|
|
// return 400;
|
|
//else if (icode >= 404 && icode <= 407)
|
|
// return 401;
|
|
//else if (icode >= 408 && icode <= 411)
|
|
// return 402;
|
|
//else if (icode >= 412 && icode <= 415)
|
|
// return 403;
|
|
//else if (icode >= 416 && icode <= 419)
|
|
// return 404;
|
|
//else if (icode >= 420 && icode <= 423)
|
|
// return 405;
|
|
//else if (icode >= 424 && icode <= 427)
|
|
// return 406;
|
|
//else if (icode >= 500 && icode <= 503)
|
|
// return 500;
|
|
//else if (icode >= 504 && icode <= 507)
|
|
// return 501;
|
|
//else if (icode >= 508 && icode <= 511)
|
|
// return 502;
|
|
//else if (icode >= 512 && icode <= 515)
|
|
// return 503;
|
|
//else if (icode >= 516 && icode <= 519)
|
|
// return 504;
|
|
//else if (icode >= 520 && icode <= 523)
|
|
// return 505;
|
|
//else if (icode >= 524 && icode <= 527)
|
|
// return 506;
|
|
//else
|
|
// return icode;
|
|
}
|
|
|
|
// 세트 이름.
|
|
public static string GetSetName(int itype, int icode)
|
|
{
|
|
switch (itype)
|
|
{
|
|
case cGoods.TCosCloth:
|
|
return LocalizationText.GetText(CombineAllString("cosclothset", icode.ToString()));
|
|
case cGoods.TCosWeapon:
|
|
return LocalizationText.GetText(CombineAllString("cosweaponset", icode.ToString()));
|
|
}
|
|
return S_Empty;
|
|
}
|
|
|
|
public static string TextColorCode(Color color)
|
|
{
|
|
return StringFormat("#{0}{1}{2}", TextHex2(Mathf.CeilToInt(color.r * 255f)), TextHex2(Mathf.CeilToInt(color.g * 255f)), TextHex2(Mathf.CeilToInt(color.b * 255f)));
|
|
}
|
|
#endregion Name & Desc
|
|
|
|
#region Combine
|
|
public static string CombineStringWithBreakLine(string str1, string str2)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append(str1);
|
|
if (sb.Length > 0)
|
|
sb.Append(S_BreakLine);
|
|
sb.Append(str2);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string CombineStringNumeric(string strnum, int iaddzero)
|
|
{
|
|
sb.Length = 0;
|
|
sb.Append(strnum);
|
|
sb.Append(new System.String(C_Zero, iaddzero));
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string CombineAllString(params object[] strs)
|
|
{
|
|
sb.Length = 0;
|
|
for (int i = 0; i < strs.Length; i++)
|
|
{
|
|
if (strs[i] != null)
|
|
{
|
|
sb.Append(strs[i]);
|
|
}
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string CombineAll(params object[] objs)
|
|
{
|
|
sb.Length = 0;
|
|
for (int i = 0; i < objs.Length; i++)
|
|
{
|
|
if (objs[i] != null)
|
|
{
|
|
sb.Append(objs[i]);
|
|
}
|
|
}
|
|
//sb.Append(strs);
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string CombineAllWithSharp(params object[] objs)
|
|
{
|
|
sb.Length = 0;
|
|
for (int i = 0; i < objs.Length; i++)
|
|
{
|
|
if (i > 0)
|
|
sb.Append(C_Sharp);
|
|
if (objs[i] != null)
|
|
{
|
|
sb.Append(objs[i]);
|
|
}
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string CutEllipsis(string str, int count)
|
|
{
|
|
if (str.Length <= count)
|
|
return str;
|
|
|
|
sb.Length = 0;
|
|
sb.Append(str);
|
|
sb.Remove(count, str.Length - count);
|
|
sb.Append(S_Ellipsis);
|
|
return sb.ToString();
|
|
}
|
|
#endregion Combine
|
|
}
|
|
|
|
|