Skip to content

Commit

Permalink
Custom loading screen path is incorrect CnCNet#439 (CnCNet#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rans4ckeR authored and SadPencil committed Oct 4, 2024
1 parent 26bdac3 commit 2af84e3
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ClientCore/LoadingScreenController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Rampastring.Tools;

namespace ClientCore
{
Expand All @@ -7,21 +8,19 @@ public static class LoadingScreenController
public static string GetLoadScreenName(string sideId)
{
int resHeight = UserINISettings.Instance.IngameScreenHeight;

string loadingScreenName = ProgramConstants.BASE_RESOURCE_PATH + "l";
int randomInt = new Random().Next(1, 1 + ClientConfiguration.Instance.LoadingScreenCount);
string resolutionText;

if (resHeight < 480)
loadingScreenName += "400";
resolutionText = "400";
else if (resHeight < 600)
loadingScreenName += "480";
resolutionText = "480";
else
loadingScreenName += "600";

loadingScreenName = loadingScreenName + "s" + sideId;
Random random = new Random();
int randomInt = random.Next(1, 1 + ClientConfiguration.Instance.LoadingScreenCount);
resolutionText = "600";

return loadingScreenName + Convert.ToString(randomInt) + ".pcx";
return SafePath.CombineFilePath(
ProgramConstants.BASE_RESOURCE_PATH,
FormattableString.Invariant($"l{resolutionText}s{sideId}{randomInt}.pcx")).Replace('\\', '/');
}
}
}
}

0 comments on commit 2af84e3

Please sign in to comment.