Replace calls to Main.buffName to Lang.GetBuffName
This commit is contained in:
parent
d2705d785b
commit
46c42536c9
2 changed files with 8 additions and 8 deletions
|
|
@ -5517,7 +5517,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
else if (found.Count > 1)
|
else if (found.Count > 1)
|
||||||
{
|
{
|
||||||
TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Main.buffName[f]));
|
TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Lang.GetBuffName(f)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
id = found[0];
|
id = found[0];
|
||||||
|
|
@ -5568,7 +5568,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
else if (found.Count > 1)
|
else if (found.Count > 1)
|
||||||
{
|
{
|
||||||
TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Main.buffName[b]));
|
TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Lang.GetBuffName(b)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
id = found[0];
|
id = found[0];
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ namespace TShockAPI
|
||||||
/// <returns>name</returns>
|
/// <returns>name</returns>
|
||||||
public string GetBuffName(int id)
|
public string GetBuffName(int id)
|
||||||
{
|
{
|
||||||
return (id > 0 && id < Main.maxBuffTypes) ? Main.buffName[id] : "null";
|
return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -445,7 +445,7 @@ namespace TShockAPI
|
||||||
/// <returns>description</returns>
|
/// <returns>description</returns>
|
||||||
public string GetBuffDescription(int id)
|
public string GetBuffDescription(int id)
|
||||||
{
|
{
|
||||||
return (id > 0 && id < Main.maxBuffTypes) ? Main.buffTip[id] : "null";
|
return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -459,14 +459,14 @@ namespace TShockAPI
|
||||||
string buffname;
|
string buffname;
|
||||||
for (int i = 1; i < Main.maxBuffTypes; i++)
|
for (int i = 1; i < Main.maxBuffTypes; i++)
|
||||||
{
|
{
|
||||||
buffname = Main.buffName[i];
|
buffname = Lang.GetBuffName(i);
|
||||||
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower)
|
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower)
|
||||||
return new List<int> {i};
|
return new List<int> {i};
|
||||||
}
|
}
|
||||||
var found = new List<int>();
|
var found = new List<int>();
|
||||||
for (int i = 1; i < Main.maxBuffTypes; i++)
|
for (int i = 1; i < Main.maxBuffTypes; i++)
|
||||||
{
|
{
|
||||||
buffname = Main.buffName[i];
|
buffname = Lang.GetBuffName(i);
|
||||||
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower))
|
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower))
|
||||||
found.Add(i);
|
found.Add(i);
|
||||||
}
|
}
|
||||||
|
|
@ -1209,9 +1209,9 @@ namespace TShockAPI
|
||||||
List<object[]> elements = new List<object[]>();
|
List<object[]> elements = new List<object[]>();
|
||||||
for (int i = 0; i < Main.maxBuffTypes; i++)
|
for (int i = 0; i < Main.maxBuffTypes; i++)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(Main.buffName[i]))
|
if (!String.IsNullOrEmpty(Lang.GetBuffName(i)))
|
||||||
{
|
{
|
||||||
object[] element = new object[] { i, Main.buffName[i], Main.buffTip[i] };
|
object[] element = new object[] { i, Lang.GetBuffName(i), Main.buffTip[i] };
|
||||||
elements.Add(element);
|
elements.Add(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue