Skip to content

Commit

Permalink
Removed redundant variable
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Feb 5, 2024
1 parent 3748cfe commit ed301c1
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
**/bin/

# Ignore the SLN
cs2-retakes.sln
cs2-retakes.sln
2 changes: 1 addition & 1 deletion Modules/Configs/JsonConverters/QAngleJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public override void Write(Utf8JsonWriter writer, QAngle value, JsonSerializerOp

writer.WriteStringValue($"{x} {y} {z}");
}
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/JsonConverters/VectorJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public override void Write(Utf8JsonWriter writer, Vector value, JsonSerializerOp

writer.WriteStringValue($"{x} {y} {z}");
}
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ public static bool IsLoaded(MapConfig? mapConfig, string currentMap)

return true;
}
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/MapConfigData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
public class MapConfigData
{
public List<Spawn> Spawns { get; set; } = new();
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/RetakesConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ private bool UpdateVersion()

return true;
}
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/RetakesConfigData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public class RetakesConfigData
public bool IsAutoPlantEnabled { get; set; } = true;
public string QueuePriorityFlag { get; set; } = "@css/vip";
public bool IsDebugMode { get; set; } = false;
}
}
2 changes: 1 addition & 1 deletion Modules/Configs/Spawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public Spawn(Vector vector, QAngle qAngle)
public CsTeam Team { get; set; }
public Bombsite Bombsite { get; set; }
public bool CanBePlanter { get; set; }
}
}
2 changes: 1 addition & 1 deletion Modules/Enums/Bombsite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ public enum Bombsite
{
A = 0,
B = 1
}
}
2 changes: 1 addition & 1 deletion Modules/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,4 @@ public static void ShowSpawn(Spawn spawn)
beam.Teleport(spawn.Vector, new QAngle(IntPtr.Zero), new Vector(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero));
beam.DispatchSpawn();
}
}
}
2 changes: 1 addition & 1 deletion Modules/Managers/AllocationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ private static void AllocateGrenades(CCSPlayerController player)
break;
}
}
}
}
2 changes: 1 addition & 1 deletion Modules/Managers/BreakerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ public void Handle()
}
}
}
}
}
2 changes: 1 addition & 1 deletion Modules/Managers/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,4 @@ private void SetTeams(List<CCSPlayerController>? terrorists, List<CCSPlayerContr
}
}
}
}
}
2 changes: 1 addition & 1 deletion Modules/Managers/QueueManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@ public void SetRoundTeams()
_roundCounterTerrorists = ActivePlayers
.Where(player => Helpers.IsValidPlayer(player) && player.Team == CsTeam.CounterTerrorist).ToList();
}
}
}
2 changes: 1 addition & 1 deletion Modules/Managers/SpawnManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ public List<Spawn> GetSpawns(Bombsite bombsite, CsTeam? team = null)

return planter;
}
}
}
7 changes: 5 additions & 2 deletions Modules/Translator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)

private string Translate(string key, params object[] arguments)
{
var isHtml = key.StartsWith("html.");
key = key.Replace("html.", "");

var localizedString = _stringLocalizerImplementation[key, arguments];

if (localizedString == null || localizedString.ResourceNotFound)
Expand All @@ -31,7 +34,7 @@ private string Translate(string key, params object[] arguments)
}

var translation = localizedString.Value;

// Handle translation colours
return translation
.Replace("[GREEN]", ChatColors.Green.ToString())
Expand All @@ -56,4 +59,4 @@ private string Translate(string key, params object[] arguments)
.Replace("[SILVER]", ChatColors.Silver.ToString())
.Replace("[MAGENTA]", ChatColors.Magenta.ToString());
}
}
}
5 changes: 2 additions & 3 deletions RetakesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -897,14 +897,13 @@ private void AnnounceBombsite(Bombsite bombsite, bool onlyCenter = false)
};

// Get translation message
var bombsiteLetter = bombsite == Bombsite.A ? "A" : "B";
var numTerrorist = Helpers.GetCurrentNumPlayers(CsTeam.Terrorist);
var numCounterTerrorist = Helpers.GetCurrentNumPlayers(CsTeam.CounterTerrorist);

var isRetakesConfigLoaded = RetakesConfig.IsLoaded(_retakesConfig);

// TODO: Once we implement per client translations this will need to be inside the loop
var announcementMessage = _translator["retakes.bombsite.announcement", bombsiteLetter, numTerrorist,
var announcementMessage = _translator["retakes.bombsite.announcement", bombsite.ToString(), numTerrorist,
numCounterTerrorist];

foreach (var player in Utilities.GetPlayers())
Expand Down Expand Up @@ -960,4 +959,4 @@ private void HandleAutoPlant()
Helpers.TerminateRound(RoundEndReason.RoundDraw);
}
}
}
}

0 comments on commit ed301c1

Please sign in to comment.