Skip to content

Commit

Permalink
target should have protected setter, not private
Browse files Browse the repository at this point in the history
  • Loading branch information
XtraCube committed Aug 31, 2024
1 parent c318c44 commit 264defe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions MiraAPI/Hud/CustomActionButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ public virtual void FixedUpdateHandler(PlayerControl playerControl)
public abstract class CustomActionButton<T> : CustomActionButton where T : MonoBehaviour
{
/// <summary>
/// Gets the target object of the button.
/// Gets or sets the target object of the button.
/// </summary>
public T? Target { get; private set; }
public T? Target { get; protected set; }

/// <summary>
/// Gets the distance the player must be from the target object to use the button.
Expand Down
14 changes: 7 additions & 7 deletions MiraAPI/Patches/HudManagerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ namespace MiraAPI.Patches;
[HarmonyPatch(typeof(HudManager))]
public static class HudManagerPatches
{
// Custom buttons parent
// Custom buttons parent.
private static GameObject? _bottomLeft;

// Custom role tab
// Custom role tab.
private static TaskPanelBehaviour? _roleTab;

/// <summary>
/// Update custom role tab and custom role hud elements
/// Update custom role tab and custom role hud elements.
/// </summary>
/// <param name="__instance">The HudManager instance</param>
/// <param name="__instance">The HudManager instance.</param>
[HarmonyPostfix]
[HarmonyPatch(nameof(HudManager.Update))]
public static void UpdatePostfix(HudManager __instance)
Expand Down Expand Up @@ -65,7 +65,7 @@ public static void UpdatePostfix(HudManager __instance)
}

default:
if (_roleTab != null && _roleTab.gameObject != null)
if (_roleTab != null)
{
_roleTab.gameObject.Destroy();
}
Expand All @@ -85,7 +85,7 @@ public static void GameStartPatch(HudManager __instance)
}*/

/// <summary>
/// Create custom buttons and arrange them on the hud
/// Create custom buttons and arrange them on the hud.
/// </summary>
/// <param name="__instance">The HudManager instance.</param>
[HarmonyPostfix]
Expand Down Expand Up @@ -136,7 +136,7 @@ public static void StartPostfix(HudManager __instance)
}

/// <summary>
/// Set the custom role tab and custom buttons active when the hud is active
/// Set the custom role tab and custom buttons active when the hud is active.
/// </summary>
/// <param name="__instance">HudManager instance.</param>
/// <param name="localPlayer">The local PlayerControl.</param>
Expand Down

0 comments on commit 264defe

Please sign in to comment.