//-----------------------------------------------------------
// Generic localized message.
//-----------------------------------------------------------
class XS_Message extends LocalMessage;

var(Message)    string          Message;

var(Color)      color           ColorNone;
var(Color)      color           ColorCream;
var(Color)      color           ColorSky;
var(Color)      color           ColorGold;
var(Color)      color           ColorTan;
var(Color)      color           ColorPistache;
var(Color)      color           ColorSilver;

/** Interface: Generic HUD message wrapper. */
static function HUDMessage(Controller C, string NewMessage, optional float NewPosY, optional float NewLifeTime, optional color NewDrawColor)
{
    if(C != none
    && PlayerController(C) != none)
    {
        Setup(NewMessage, NewPosY, NewLifeTime, NewDrawColor);

        // Send the message.
        PlayerController(C).ReceiveLocalizedMessage(default.class);
    }
}

/** Setup: Initialize the class' defaults for the next time it'll be used...
           which will be immediately. */
static function Setup(string NewMessage, optional float NewPosY, optional float NewLifeTime, optional color NewDrawColor)
{
    default.Message = NewMessage;

    if(NewPosY > 0)
    {
        default.PosY = NewPosY;
    }

    if(NewLifeTime > 0)
    {
        default.LifeTime = NewLifeTime;
    }
    
    if(NewDrawColor != default.ColorNone)
    {
        default.DrawColor = NewDrawColor;
    }
}

/** Setup: Don't mess around with switches and objects and stuff, just use
           whatever message was given. */
static function string GetString(optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)
{
    return default.Message;
}

defaultproperties
{
     Message="Oops... message error.  Contact the coder!"
     ColorCream=(B=175,G=250,R=255)
     ColorSky=(B=240,G=230,R=190)
     ColorGold=(B=90,G=215,R=255)
     ColorTan=(B=140,G=190,R=255)
     ColorPistache=(B=135,G=230,R=220)
     ColorSilver=(B=240,G=240,R=245)
     bIsConsoleMessage=False
     bFadeMessage=True
     DrawColor=(B=90,G=215)
     StackMode=SM_Down
     PosY=0.900000
     FontSize=1
}
