Skip to content

Commit

Permalink
ArtifactCode fix, ContentLogging fix (#361)
Browse files Browse the repository at this point in the history
* ArtifactCode fix, ContentLogging fix

* whiteline fix

* Made IsPrefabHashed public
  • Loading branch information
Nebby1999 authored Mar 19, 2022
1 parent 4952039 commit baa5cd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion R2API/ContentManagement/R2APIContentPackProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ internal R2APIGenericContentPack(ContentPack finalizedContentPack) {

private ContentPack contentPack;

private bool logged = false;

public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) {
LogContentsFromContentPack();
args.ReportProgress(1f);
yield break;
}

public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) {
ContentPack.Copy(contentPack, args.output);
LogContentsFromContentPack();
args.ReportProgress(1f);
yield break;
}
Expand All @@ -31,6 +33,10 @@ public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) {
yield break;
}
private void LogContentsFromContentPack() {
if (logged)
return;

logged = true;
List<string> log = new List<string>();
log.Add($"Content added from {contentPack.identifier}:");
log.AddRange(contentPack.bodyPrefabs.assetInfos.Select(ai => $"{ai.assetName} ({ai.asset.GetType().Name})"));
Expand Down
2 changes: 1 addition & 1 deletion R2API/PrefabAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static bool Loaded {
private static GameObject _parent;
private static readonly List<HashStruct> ThingsToHash = new List<HashStruct>();

internal static bool IsPrefabHashed(GameObject prefabToCheck) => ThingsToHash.Select(hash => hash.Prefab).Contains(prefabToCheck);
public static bool IsPrefabHashed(GameObject prefabToCheck) => ThingsToHash.Select(hash => hash.Prefab).Contains(prefabToCheck);

#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do)

Expand Down
2 changes: 1 addition & 1 deletion R2API/ScriptableObjects/ArtifactCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ private int[] CreateSequenceFromVectors() {
sequence.Add(middleRow.z);
sequence.Add(bottomRow.z);
sequence.Add(topRow.y);
sequence.Add(middleRow.y);
sequence.Add(bottomRow.y);
sequence.Add(middleRow.y);
sequence.Add(topRow.x);
sequence.Add(middleRow.x);
sequence.Add(bottomRow.x);
Expand Down

0 comments on commit baa5cd7

Please sign in to comment.