Added quick format versions of the TSPlayer.Send<X>Message methods.
This commit is contained in:
parent
a7f4c649b0
commit
76aab4af78
3 changed files with 23 additions and 3 deletions
|
|
@ -2839,7 +2839,7 @@ namespace TShockAPI
|
||||||
Region region = TShock.Regions.GetRegionByName(regionName);
|
Region region = TShock.Regions.GetRegionByName(regionName);
|
||||||
if (region == null)
|
if (region == null)
|
||||||
{
|
{
|
||||||
args.Player.SendErrorMessage(string.Format("Region {0} does not exist.", regionName));
|
args.Player.SendErrorMessage("Region {0} does not exist.", regionName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2894,7 +2894,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
args.Player.SendMessage("Invalid syntax! Proper syntax: /region info [name]", Color.Red);
|
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: /region info [name]");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,7 @@ namespace TShockAPI.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] groups = mergedGroups.Split(',');
|
string[] groups = mergedGroups.Split(',');
|
||||||
// Is the user already allowed to the region?
|
// Is the group already allowed to the region?
|
||||||
if (groups.Contains(groupName))
|
if (groups.Contains(groupName))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -604,21 +604,41 @@ namespace TShockAPI
|
||||||
SendMessage(msg, Color.Yellow);
|
SendMessage(msg, Color.Yellow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendInfoMessage(string format, params object[] args)
|
||||||
|
{
|
||||||
|
SendInfoMessage(string.Format(format, args));
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void SendSuccessMessage(string msg)
|
public virtual void SendSuccessMessage(string msg)
|
||||||
{
|
{
|
||||||
SendMessage(msg, Color.Green);
|
SendMessage(msg, Color.Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendSuccessMessage(string format, params object[] args)
|
||||||
|
{
|
||||||
|
SendSuccessMessage(string.Format(format, args));
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void SendWarningMessage(string msg)
|
public virtual void SendWarningMessage(string msg)
|
||||||
{
|
{
|
||||||
SendMessage(msg, Color.OrangeRed);
|
SendMessage(msg, Color.OrangeRed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendWarningMessage(string format, params object[] args)
|
||||||
|
{
|
||||||
|
SendWarningMessage(string.Format(format, args));
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void SendErrorMessage(string msg)
|
public virtual void SendErrorMessage(string msg)
|
||||||
{
|
{
|
||||||
SendMessage(msg, Color.Red);
|
SendMessage(msg, Color.Red);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendErrorMessage(string format, params object[] args)
|
||||||
|
{
|
||||||
|
SendErrorMessage(string.Format(format, args));
|
||||||
|
}
|
||||||
|
|
||||||
[Obsolete("Use SendErrorMessage, SendInfoMessage, or SendWarningMessage, or a custom color instead.")]
|
[Obsolete("Use SendErrorMessage, SendInfoMessage, or SendWarningMessage, or a custom color instead.")]
|
||||||
public virtual void SendMessage(string msg)
|
public virtual void SendMessage(string msg)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue