Skip to content

Commit

Permalink
Ignore color lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Dec 18, 2024
1 parent 09f6eda commit 5c3b6fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
13 changes: 2 additions & 11 deletions RLBotCS/Conversion/FlatToModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,8 @@ internal static Rotator ToRotator(rlbot.flat.Rotator r) =>

internal static Loadout ToLoadout(rlbot.flat.PlayerLoadoutT l, uint team)
{
Color primaryColor = l.PrimaryColorLookup switch
{
{ } p => Color.FromArgb(p.A, p.R, p.G, p.B),
_ => ColorSwatches.GetPrimary(l.TeamColorId, team)
};

Color secondaryColor = l.SecondaryColorLookup switch
{
{ } s => Color.FromArgb(s.A, s.R, s.G, s.B),
_ => ColorSwatches.GetSecondary(l.CustomColorId)
};
Color primaryColor = ColorSwatches.GetPrimary(l.TeamColorId, team);
Color secondaryColor = ColorSwatches.GetSecondary(l.CustomColorId);

var lp = l.LoadoutPaint;

Expand Down
36 changes: 0 additions & 36 deletions RLBotCS/ManagerTools/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,6 @@ List<string> missingValues
}
}

private static int ParseInt(
TomlTable table,
string key,
int fallback,
List<string> missingValues
)
{
try
{
return (int)(long)table[key];
}
catch (KeyNotFoundException)
{
missingValues.Add(key);
return fallback;
}
}

private static uint ParseUint(
TomlTable table,
string key,
Expand All @@ -127,24 +109,6 @@ List<string> missingValues
}
}

private static float ParseFloat(
TomlTable table,
string key,
float fallback,
List<string> missingValues
)
{
try
{
return Convert.ToSingle(table[key]);
}
catch (KeyNotFoundException)
{
missingValues.Add(key);
return fallback;
}
}

private static string? ParseString(TomlTable table, string key, List<string> missingValues)
{
try
Expand Down
3 changes: 0 additions & 3 deletions RLBotCS/ManagerTools/MatchStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ int rlbotSocketsPort
private int _connectionReadies;

private bool _communicationStarted;
private bool _hasEverLoadedMap;
private bool _needsSpawnCars;

public bool HasSpawnedMap;
Expand Down Expand Up @@ -71,7 +70,6 @@ public void StartMatch(MatchSettingsT matchSettings)
public void MapSpawned(string MapName)
{
Logger.LogInformation("Got map info for " + MapName);
_hasEverLoadedMap = true;
HasSpawnedMap = true;

if (!_needsSpawnCars)
Expand Down Expand Up @@ -217,7 +215,6 @@ private void LoadMatch(MatchSettingsT matchSettings)
_needsSpawnCars = true;
if (shouldSpawnNewMap)
{
_hasEverLoadedMap = true;
HasSpawnedMap = false;
_matchSettings = null;
_deferredMatchSettings = matchSettings;
Expand Down

0 comments on commit 5c3b6fc

Please sign in to comment.