class ScrnVotingOptions extends Info abstract; var ScrnVotingHandlerMut VotingHandler; var string DefaultGroup; // in cases of MUTATE VOTE GROUP KEY VALUE var bool bAcceptsGlobalVotes; // should voting handler call GetVoteIndex(), if vote has no group? var array HelpInfo; var array GroupInfo; var protected bool bHelpPrepared; var array TrueStrings, FalseStrings; var localized string strRestartRequired; var localized string strOptionDisabled; var localized string strNotAvaliableATM; var localized string strPlayerNotFound; const VOTE_UNKNOWN = -1; const VOTE_ILLEGAL = -2; const VOTE_NOEFECT = -3; const VOTE_LOCAL = -10; function Destroyed() { if ( VotingHandler != none ) VotingHandler.RemoveVotingOptions(self.class); super.Destroyed(); } /* This function is called by VotingHandler immediatelly after the spawn. It should register the voting groups for GetGroupVoteIndex() callings. */ function InitGroups() { if ( DefaultGroup == "" ) bAcceptsGlobalVotes = true; else { VotingHandler.RegisterGroup(DefaultGroup, self); bAcceptsGlobalVotes = false; } } /* Function must return VOTE_UNKNOWN if this class doesn't recognizes the Key If Key is recognized, but value is incorrect, return VOTE_ILLEGAL If value is already set, or can not vote at the current moment, return VOTE_NOEFECT. If Key is correct, but no vote should be done (e.g. displaying additional help on command) return VOTE_LOCAL Keys are case-insensitive and are already passed in upper case. */ function int GetVoteIndex(PlayerController Sender, string Key, out string Value, out string VoteInfo) { return VOTE_UNKNOWN; } function int GetGroupVoteIndex(PlayerController Sender, string Group, string Key, out string Value, out string VoteInfo) { return VOTE_UNKNOWN; } function ApplyVoteValue(int VoteIndex, string VoteValue); // returns 1 (true), 0 (false) or -1 (error) function int TryStrToBool(string str) { local int i; for ( i = 0; i < TrueStrings.Length; ++i ) { if ( str ~= TrueStrings[i] ) { return 1; } } for ( i = 0; i < FalseStrings.Length; ++i ) { if ( str ~= FalseStrings[i] ) { return 0; } } return -1; } static function int TryStrToBoolStatic(string str) { local int i; for ( i = 0; i < default.TrueStrings.Length; ++i ) { if ( str ~= default.TrueStrings[i] ) { return 1; } } for ( i = 0; i < default.FalseStrings.Length; ++i ) { if ( str ~= default.FalseStrings[i] ) { return 0; } } return -1; } function SendPlayerList(PlayerController Sender) { local array AllPRI; local PlayerController PC; local int i; Level.Game.GameReplicationInfo.GetPRIArray(AllPRI); for (i = 0; i 0 && String(C.PlayerReplicationInfo.PlayerID) == NameOrID) || C.PlayerReplicationInfo.PlayerName ~= NameOrID ) { return PC; } } } return none; } function SendGroupHelp(PlayerController Sender, string Group) { local int i; if ( !bHelpPrepared ) { bHelpPrepared = true; for ( i=0; i