Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiWorm0 committed Aug 24, 2022
1 parent 470e697 commit 73f569c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion LevelImposter/Core/Builders/AdminMapBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AdminMapBuilder : Builder

public void Build(LIElement elem, GameObject obj)
{
if (elem.type != "util-room")
if (elem.type != "util-room" || elem.properties.isRoomAdminVisible == false)
return;

MapBehaviour mapBehaviour = MinimapBuilder.GetMinimap();
Expand Down
2 changes: 1 addition & 1 deletion LevelImposter/Core/Builders/RoomNameBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class RoomNameBuilder : Builder

public void Build(LIElement elem, GameObject obj)
{
if (elem.type != "util-room")
if (elem.type != "util-room" || elem.properties.isRoomNameVisible == false)
return;

MapBehaviour mapBehaviour = MinimapBuilder.GetMinimap();
Expand Down
24 changes: 12 additions & 12 deletions LevelImposter/Core/Builders/StepSoundBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ public void Build(LIElement elem, GameObject obj)
if (elem.type != "util-sound2")
return;

// Colliders
Collider2D[] colliders = obj.GetComponents<Collider2D>();
foreach (Collider2D collider in colliders)
{
collider.isTrigger = true;
}
if (colliders.Length < 1)
{
LILogger.Warn("Step sound missing cooresponding collision");
return;
}

// AudioClip
if (elem.properties.sounds == null)
{
Expand Down Expand Up @@ -52,18 +64,6 @@ public void Build(LIElement elem, GameObject obj)
LILogger.Warn("Step sound has corrupt audio data [" + sound.id + "]");
}

// Colliders
Collider2D[] colliders = obj.GetComponents<Collider2D>();
foreach (Collider2D collider in colliders)
{
collider.isTrigger = true;
}
if (colliders.Length < 1)
{
LILogger.Warn("Step sound missing cooresponding collision");
return;
}

// Sound Player
FootstepWatcher stepPlayer = obj.AddComponent<FootstepWatcher>();
stepPlayer.Area = colliders[0];
Expand Down
8 changes: 3 additions & 5 deletions LevelImposter/Core/LILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ namespace LevelImposter.Core
public static class LILogger
{
private static ManualLogSource logger;
private const bool LOG_UNITY_STACK = false;

public static void Init()
{
logger = BepInEx.Logging.Logger.CreateLogSource("LevelImposter");
/*
var debug = MainHarmony.ConfigFile.Bind("Debug", "ShowUnityLogs", false);
if (debug.Value)
if (LOG_UNITY_STACK)
{
UnityEngine.Application.add_logMessageReceived(
Application.add_logMessageReceived(
new Action<string, string, UnityEngine.LogType>(OnUnityLog)
);
}
*/
}

private static void OnUnityLog(string msg, string stackTrace, UnityEngine.LogType type)
Expand Down
5 changes: 5 additions & 0 deletions LevelImposter/Core/Models/LIProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,10 @@ public class LIProperties
// Tasks
public string? description { get; set; }
public string? taskLength { get; set; }

// Room
public bool? isRoomNameVisible { get; set; }
public bool? isRoomAdminVisible { get; set; }

}
}

0 comments on commit 73f569c

Please sign in to comment.