Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

WormbotHandlerUTComp.WIR_ModHandler_UTComp


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
/******************************************************************************
Copyright (c) 2005-2007 by Wormbo <wormbo@online.de>
$Id$

Handler for UTComp. Lot's of GetPropertyText() here so I don't depend on any
specific version of that mess some people call a mutator.
******************************************************************************/


class WIR_ModHandler_UTComp extends WIR_ModHandler;


//=============================================================================
// Localization
//=============================================================================

var localized string MsgVoteStarted;
var localized string StringWarmup;
var localized string StringPrefixWarmupTime;
var localized string StringSuffixWarmupTime;


//=============================================================================
// Variables
//=============================================================================

var ReplicationInfo UTCompWarmup;


//== GetRemainingTime =========================================================
/**
Returns the time remaining in the match or the time elapsed if there's no time limit.
*/
//============================================================================= 

function string GetRemainingTime()
{
  local string Time;
  local int Seconds;
  
  Time = Super.GetRemainingTime();
  if ( Time != "" )
    return Time;
  
  if ( UTCompWarmup == None ) {
    foreach DynamicActors(class'ReplicationInfo', UTCompWarmup)
      if ( UTCompWarmup.IsA('UTComp_Warmup') )
        break;
    if ( UTCompWarmup != None && !UTCompWarmup.IsA('UTComp_Warmup') )
      UTCompWarmup = None;
  }
  if ( UTCompWarmup != None && bool(UTCompWarmup.GetPropertyText("bInWarmup")) ) {
    if ( bool(UTCompWarmup.GetPropertyText("bInFinalCountdown")) )
      Seconds = int(UTCompWarmup.GetPropertyText("iFinalCountDown"));
    else if ( !bool(UTCompWarmup.GetPropertyText("bTimeUnlimitedWarmup")) )
      Seconds = int(UTCompWarmup.GetPropertyText("iWarmupTimeRemaining"));
    else
      return StringWarmup;
    
    return StringPrefixWarmupTime $ class'WIR_Util'.static.FormatTime(Seconds, true, true) $ StringSuffixWarmupTime;
  }
  
  return "";
}


//== HandleLocalizedMessage ===================================================
/**
Return True if the message should not be reported through the default event.
*/
//=============================================================================

function bool HandleLocalizedMessage(class<LocalMessage> Message, int Switch, PlayerReplicationInfo RelatedPRI_1, PlayerReplicationInfo RelatedPRI_2, Object OptionalObject)
{
  if ( Message.Name == 'UTComp_Vote_Started' ) {
    if ( MyMutator != None && MyMutator.ReportConnection != None )
      MyMutator.ReportConnection.SendMessage(Repl(MsgVoteStarted, "%r", MyMutator.MyGameHandler.GetRemainingTime(), True));
    return true;
  }
  if ( Super.HandleLocalizedMessage(Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject) || Message.Name == 'UTComp_Warmup_CountDown' )
    return true;
  
  return false;
}


//=============================================================================
// Default properties
//=============================================================================

defaultproperties
{
  StringWarmup            = "Warmup"
  StringPrefixWarmupTime  = "W-"
  MsgVoteStarted          = "[%r] - [^B]A Vote Was Started![^B]"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mo 12.3.2007 10:46:18.000 - Creation time: Do 14.8.2014 09:58:55.732 - Created with UnCodeX