Skip to content

Commit

Permalink
More case sensitivity.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Apr 5, 2024
1 parent 47db0ed commit a769387
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 157 deletions.
4 changes: 4 additions & 0 deletions Engines/FlatRedBallXNA/FlatRedBall/IO/FilePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public string FullPath
}

string standardizedCache;
/// <summary>
/// Returns the file with all slashes as forward slashes, and with the relative directory prepended if the file is relative, and lower-case. Use
/// StandardizedCaseSensitive to preserve case.
/// </summary>
public string Standardized
{
get
Expand Down
20 changes: 10 additions & 10 deletions Engines/FlatRedBallXNA/FlatRedBall/Utilities/StringFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -896,20 +896,20 @@ public static void RemoveDuplicates(List<string> strings)

public static void RemoveDuplicates(List<string> strings, bool ignoreCase)
{
Dictionary<string, int> uniqueStore = new Dictionary<string, int>();
Dictionary<string, int> uniqueStore;
if(ignoreCase)
{
uniqueStore = new Dictionary<string, int>(StringComparer.InvariantCultureIgnoreCase);
}
else
{
uniqueStore = new Dictionary<string, int>();
}
List<string> finalList = new List<string>();

foreach (string currValueUncasted in strings)
{
string currValue;
if (ignoreCase)
{
currValue = currValueUncasted.ToLowerInvariant();
}
else
{
currValue = currValueUncasted;
}
string currValue=currValueUncasted;

if (!uniqueStore.ContainsKey(currValue))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ public bool UpdateFileMembershipInProject(ReferencedFileSave referencedFileSave)
var isExcludedFromProject = referencedFileSave.ProjectsToExcludeFrom.Contains(projectName);
if(!isExcludedFromProject)
{
wasAnythingAdded = UpdateFileMembershipInProject(GlueState.Self.CurrentMainProject, GlueCommands.Self.GetAbsoluteFilePath(referencedFileSave), useContentPipeline, false, fileRfs: referencedFileSave);
var absoluteFilePath = GlueCommands.Self.GetAbsoluteFilePath(referencedFileSave);
wasAnythingAdded = UpdateFileMembershipInProject(GlueState.Self.CurrentMainProject, absoluteFilePath, useContentPipeline, false, fileRfs: referencedFileSave);
}

foreach (ProjectSpecificFile projectSpecificFile in referencedFileSave.ProjectSpecificFiles)
Expand Down Expand Up @@ -297,7 +298,7 @@ project.ContentProject is VisualStudioProject &&
{
var inner = new List<FilePath>();
FileReferenceManager.Self.GetFilesReferencedBy(fileToAddAbsolute, TopLevelOrRecursive.TopLevel, inner);
listOfReferencedFiles.AddRange(inner.Select(item => item.Standardized));
listOfReferencedFiles.AddRange(inner.Select(item => item.StandardizedCaseSensitive));
if (alreadyReferencedFiles != null)
{
listOfReferencedFiles = listOfReferencedFiles.Except(alreadyReferencedFiles).ToList();
Expand Down
6 changes: 3 additions & 3 deletions FRBDK/Glue/Glue/Plugins/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ internal static bool CanFileReferenceContent(string absoluteName)


CallMethodOnPluginNotUiThread(
delegate(PluginBase plugin)
plugin =>
{
if (plugin.CanFileReferenceContent != null)
{
Expand All @@ -740,7 +740,7 @@ internal static GeneralResponse GetFilesReferencedBy(string absoluteName, Editor
SaveRelativeDirectory();

CallMethodOnPluginNotUiThread(
delegate(PluginBase plugin)
plugin =>
{
if(plugin.FillWithReferencedFiles != null)
{
Expand All @@ -763,7 +763,7 @@ internal static void GetFilesNeededOnDiskBy(string absoluteName, EditorObjects.P
{
SaveRelativeDirectory();
CallMethodOnPluginNotUiThread(
delegate (PluginBase plugin)
plugin =>
{
if (plugin.GetFilesNeededOnDiskBy != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ public override string ProcessLink(string path)
return returnValue;
}


public override string ContentDirectory => "content/";

public override List<string> GetErrors()
{
List<string> toReturn = new List<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@ namespace FlatRedBall.Glue.VSHelpers.Projects
/// </summary>
public abstract class CombinedEmbeddedContentProject : VisualStudioProject
{
public CombinedEmbeddedContentProject(Project project)
: base(project)
public CombinedEmbeddedContentProject(Project project) : base(project)
{


}

protected override bool NeedToSaveContentProject { get { return false; } }
public override bool ContentCopiedToOutput { get { return false; } }

public override string ContentDirectory
{
get { return "Content/"; }
}


public override string DefaultContentAction { get { return "Content"; } }


protected override bool NeedToSaveContentProject => false;
public override bool ContentCopiedToOutput => false;
public override string ContentDirectory => "Content/";
public override string DefaultContentAction => "Content";
}
}
Loading

0 comments on commit a769387

Please sign in to comment.