diff options
| author | Darkelarious <darkelarious@333networks.com> | 2021-09-09 14:02:36 +0200 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2021-09-09 14:02:36 +0200 |
| commit | abf0ef36b57c72b17d414673ecaadd74cf408134 (patch) | |
| tree | 9f56739bf25d209a7a795b28fe39ace05647b7ed /lib/MasterWebInterface/Util | |
| parent | 91729ec8ac5a8098cef2aa1c006aba88f6ef7eb3 (diff) | |
| download | WebInterface-Perl-abf0ef36b57c72b17d414673ecaadd74cf408134.tar.gz WebInterface-Perl-abf0ef36b57c72b17d414673ecaadd74cf408134.zip | |
style fix, readable gametypes
Diffstat (limited to 'lib/MasterWebInterface/Util')
| -rwxr-xr-x | lib/MasterWebInterface/Util/GameTypes.pm | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/MasterWebInterface/Util/GameTypes.pm b/lib/MasterWebInterface/Util/GameTypes.pm new file mode 100755 index 0000000..6dc26f4 --- /dev/null +++ b/lib/MasterWebInterface/Util/GameTypes.pm @@ -0,0 +1,59 @@ +package MasterWebInterface::Util::GameTypes; +use strict; +use warnings; +use Exporter 'import'; +our @EXPORT = qw| better_gametype |; + +# translate default gametype names to better readable equivalents +# in: string, out: string +sub better_gametype +{ + my ($s, $gametype) = @_; + + return " " unless $gametype; + + # all available equivalents + my %types = ( + + # general abbreviations + "DM" => "Deathmatch", + "CTF" => "Capture the Flag", + "COOP" => "Cooperative Mission", + + + # Rune + "ArenaGameInfo" => "Arena", + "RuneMultiPlayer" => "Deathmatch", + "TVGame" => "Thirsty Vikings", + "SRGame" => "Shadow Rules", + "NomadsGame" => "Nomads", + "CapTheTorchGame" => "Capture the Torch", + "HeadBallGame" => "Headball", + "SarkballGame" => "Sarkball", + "VasArenaGame" => "VAS Arena", + + # Unreal and Unreal Tournament + "DeathMatchPlus" => "Deathmatch", + "TeamGamePlus" => "Team Deathmatch", + "EUTDeathMatchPlus" => "Extra UT Deathmatch", + "CTFGame" => "Capture the Flag", + "Domination" => "Domination", + "LastManStanding" => "Last Man Standing", + "TLastManStanding" => "Team Last Man Standing", + "InstaGibDeathMatch" => "InstaGib", + "Assault" => "Assault", + "MonsterHunt" => "Monsterhunt", + "BunnyTrackGame" => "Bunnytrack", + "BunnyTrackNewNet" => "Bunnytrack", + "JailBreak" => "Jailbreak", + "TO3" => "Tactical Ops", + "LeagueAssault" => "League Assault", + "s_SWATGame" => "S.W.A.T.", + "SiegeGI" => "Siege", + "FreeSiegeGI" => "Siege", + ); + + return ($types{$gametype} // $gametype); +} + +1; |
