Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
76aad2b
Add XML for CardAppearanceBehaviourManager
HumabHatterZed Nov 13, 2026
27c218e
Add XML for AbilityManager
HumabHatterZed Nov 13, 2026
1e4915a
Add XML to CostProperties
HumabHatterZed Nov 13, 2026
90a6226
Add/fix XML for CardExtensionsHelpers
HumabHatterZed Nov 13, 2026
47e775a
Add/fix XML for CardExtensionsPortraits
HumabHatterZed Nov 13, 2026
a94ba78
Add XML for CardExtensions class
HumabHatterZed Nov 13, 2026
7f546d1
Add XML for CardExtensionsProperties
HumabHatterZed Nov 13, 2026
9926896
Add missing XML for CardExtensionsSetters
HumabHatterZed Nov 13, 2026
c9061a4
Add missing XML to CardManager
HumabHatterZed Nov 13, 2026
d961848
Add missing XML to CardCostManager
HumabHatterZed Nov 13, 2026
4619e29
Add XML for CardModificationInfoExtensions
HumabHatterZed Nov 13, 2026
2a9b9ad
Add missing XML, remarks on the custom costs ID system that recommend…
HumabHatterZed Nov 13, 2026
4f927aa
Add XML to CardModificationInfoManager
HumabHatterZed Nov 13, 2026
870dd8f
Fix dynamic gem costs not removing from the initial starting cost, re…
HumabHatterZed Nov 13, 2026
8107a08
Add XML for classes in DamageShieldBehaviour file
HumabHatterZed Nov 13, 2026
f6d6c2b
Add missing XML in ShieldManager
HumabHatterZed Nov 13, 2026
2ca5907
Add XML to DeathCardManager
HumabHatterZed Nov 13, 2026
6e56340
Add XML to ExtendedAbilityBehaviour
HumabHatterZed Nov 13, 2026
824760b
Add XML to IActivateWhenFacedown
HumabHatterZed Nov 13, 2026
25ae802
Add XML to OpponentGemsManager
HumabHatterZed Nov 13, 2026
f09c51e
Fix minor error in XML
HumabHatterZed Nov 13, 2026
ac22a33
Add XML for SpecialStatIconManager
HumabHatterZed Nov 13, 2026
35d27dc
Fix incorrect XML documentation
HumabHatterZed Nov 13, 2026
e76ec26
Add XML to SpecialTriggeredAbilityManager
HumabHatterZed Nov 13, 2026
b8701bc
Add XML to TribeManager
HumabHatterZed Nov 13, 2026
4b597eb
Move to patches subfolder
HumabHatterZed Nov 13, 2026
b1484af
Add GainMultipleGems ability subclass so we can unify all those "give…
HumabHatterZed Nov 13, 2026
f635e9d
Add cref links to XML
HumabHatterZed Nov 13, 2026
a79384b
Add missing XML, cref tags
HumabHatterZed Nov 13, 2026
38ee55c
Add cref tags
HumabHatterZed Nov 13, 2026
65fbf98
Add cref tags
HumabHatterZed Nov 13, 2026
dd870da
Add cref tags
HumabHatterZed Nov 13, 2026
d46af02
Add cref tags
HumabHatterZed Nov 13, 2026
838c3e8
Add cref tags, fix mistakes
HumabHatterZed Nov 14, 2026
4433c9e
Add XML, comment out unused field
HumabHatterZed Nov 14, 2026
6991107
Rename files to indicate they contain patches, fix minor error in Sta…
HumabHatterZed Nov 14, 2026
652ca8d
Add xml
HumabHatterZed Nov 14, 2026
7425126
Add XML
HumabHatterZed Nov 14, 2026
1f05ef6
Add <code> tag
HumabHatterZed Nov 14, 2026
e4c956b
Add break tags to retain XML formatting in actual documentation
HumabHatterZed Nov 14, 2026
b000129
Fix duplicate ///
HumabHatterZed Nov 14, 2026
1b7df04
Fix numbered list in XML
HumabHatterZed Nov 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 64 additions & 5 deletions InscryptionAPI/Ascension/AscensionChallengePaginator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
using UnityEngine;

namespace InscryptionAPI.Ascension;
/// <summary>
/// Class that handles adding displaying custom challenges and allows for multiple pages of challenges.
/// </summary>
public class AscensionChallengePaginator : MonoBehaviour {
// not sure if this will break any mods but it's not being used or assigned to.
//public bool initialized;

public class AscensionChallengePaginator : MonoBehaviour
{
public bool initialized;

/// <summary>
/// Initialises the challenge screen, adding custom challenges and UI elements.
/// </summary>
/// <param name="screen">The <see cref="AscensionChallengeScreen"/> to attach this paginator to.</param>
/// <param name="transition">The default transition object to use.</param>
public void Initialize(AscensionChallengeScreen screen, AscensionMenuScreenTransition transition = null)
{
if (challengeObjectsForPages == null)
Expand Down Expand Up @@ -39,6 +46,10 @@ public void Initialize(AscensionChallengeScreen screen, AscensionMenuScreenTrans

this.screen = screen;
}
/// <summary>
/// Creates the <see cref="AscensionChallengeInfo"/> for the placeholder challenge.
/// This placeholder is used when errors occur when loading challenges.
/// </summary>
public void InitialiseMissingChallengeInfo()
{
missingChallengeInfo = ScriptableObject.CreateInstance<AscensionChallengeInfo>();
Expand All @@ -51,6 +62,11 @@ public void InitialiseMissingChallengeInfo()
missingChallengeInfo.pointValue = 0;
}

/// <summary>
/// Adds a new page of challenges to the list of pages.
/// Pages contain (by default) up to 14 challenge icons. Excess challenges overflow onto new pages.
/// </summary>
/// <param name="challengeInfos"><see cref="AscensionChallengeInfo"/>s that will be displayed on this page.</param>
public void AddPage(List<AscensionChallengeInfo> challengeInfos)
{
// create the challenge info for missingChallengeInfo challenges
Expand Down Expand Up @@ -165,6 +181,9 @@ private GameObject CreateIconGameObject(GameObject objectRef, int index, Ascensi

return newIcon;
}
/// <summary>
/// Initialise the challenge screen and pages whenever the challenge screen is enabled.
/// </summary>
public void OnEnable()
{
// if there are still active challenges, don't rebuild the pages
Expand Down Expand Up @@ -291,6 +310,13 @@ public void OnEnable()
InstantiateArrowObjects(icons);
}

/// <summary>
/// Creates the <c>leftArrow</c> and <c>rightArrow</c> UI elements for the challenge screen.
/// Positioning is determined by the positions of the challenge icons.
/// By default, the API tries to place the arrows on the left and right sides of the screen.
/// If there isn't enough space due to screen resolution (or if the user has toggled the config option), the arrows are placed at the top of the screen instead.
/// </summary>
/// <param name="icons"></param>
public void InstantiateArrowObjects(List<AscensionIconInteractable> icons)
{
Vector3 topRight = new(float.MinValue, float.MinValue);
Expand Down Expand Up @@ -343,6 +369,9 @@ public void InstantiateArrowObjects(List<AscensionIconInteractable> icons)
rightArrow.ClearDelegates();
rightArrow.CursorSelectStarted += (x) => NextPage();
}
/// <summary>
/// Loads the next page. Wraps around to the first page if currently on the last page.
/// </summary>
public void NextPage()
{
pageIndex++;
Expand All @@ -351,6 +380,9 @@ public void NextPage()

LoadPage(pageIndex);
}
/// <summary>
/// Loads the previous page. Wraps around to the last page if currently on the first page.
/// </summary>
public void PreviousPage()
{
pageIndex--;
Expand All @@ -359,7 +391,10 @@ public void PreviousPage()

LoadPage(pageIndex);
}

/// <summary>
/// Loads the challenge page at the given index.
/// </summary>
/// <param name="page">Index of the page to load.</param>
public void LoadPage(int page)
{
// if page index corresponds to an index in challengeObjects
Expand Down Expand Up @@ -463,17 +498,41 @@ private char DebugArrayCode(GameObject icon, AscensionChallengeInfo info = null)
/// </summary>
public List<List<GameObject>> challengeObjectsForPages;

/// <summary>
/// The current page index. Determines what challenges are currently displayed.
/// </summary>
public int pageIndex;
/// <summary>
/// How many icons are displayed on each page.
/// </summary>
public int pageLength;

/// <summary>
/// Object that handles displaying challenges.
/// </summary>
public AscensionChallengeScreen screen;

/// <summary>
/// Object that handles the transition to and from the menu screens.
/// </summary>
public AscensionMenuScreenTransition transition;

/// <summary>
/// The UI interactable for moving to the previous page.
/// </summary>
public AscensionMenuInteractable leftArrow;
/// <summary>
/// The UI interactable for moving to the next page.
/// </summary>
public AscensionMenuInteractable rightArrow;

/// <summary>
/// <see cref="Sprite"/> for the placeholder challenge that appears in empty slots or when an error occurs.
/// </summary>
public static Sprite missingChallengeSprite;
/// <summary>
/// <see cref="AscensionChallengeInfo"/> for the placeholder challenge that appears in empty slots or when an error occurs.
/// </summary>
public static AscensionChallengeInfo missingChallengeInfo;

private class NoneChallengeDisplayer : MonoBehaviour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
namespace InscryptionAPI.Ascension;

// adding this comment to say that setupifier is a ridiculous word, very fun
/// <summary>
/// Handles adding the <see cref="AscensionChallengePaginator"/> to the ascension menu object.
/// </summary>
public class AscensionChallengePaginatorSetupifier : ManagedBehaviour
{
/// <summary>
/// Adds the <see cref="AscensionChallengePaginator"/> to the ascension menu object.
/// </summary>
public void Start()
{
AscensionMenuScreenTransition screen = gameObject.GetComponent<AscensionMenuScreenTransition>();
Expand Down
Loading
Loading