Package dev.deepcore.challenge.ui
Class PrepGuiRenderer
java.lang.Object
dev.deepcore.challenge.ui.PrepGuiRenderer
Renders prep GUI pages and run history entries for challenge setup flows.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPrepGuiDecorations(org.bukkit.inventory.Inventory inventory) Applies decorative border panes to the prep GUI inventory frame.booleanhasRunHistoryNextPage(int page, int totalRecords) Returns whether a subsequent run-history page exists for the current index.voidpopulateCategoriesPage(org.bukkit.inventory.Inventory inventory, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the prep categories page with navigation and ready controls.voidpopulateHealthPage(org.bukkit.inventory.Inventory inventory, ChallengeManager challengeManager, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the health mechanics page and ready/world controls.voidpopulateInventoryPage(org.bukkit.inventory.Inventory inventory, ChallengeManager challengeManager, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the inventory mechanics page and ready/world controls.intpopulateRunHistoryPage(org.bukkit.inventory.Inventory inventory, int page, List<RunRecord> records, DateTimeFormatter dateFormatter, LongFunction<String> durationFormatter) Populates one run-history page and returns the normalized page index used.
-
Constructor Details
-
PrepGuiRenderer
public PrepGuiRenderer()
-
-
Method Details
-
applyPrepGuiDecorations
public void applyPrepGuiDecorations(org.bukkit.inventory.Inventory inventory) Applies decorative border panes to the prep GUI inventory frame.- Parameters:
inventory- prep GUI inventory to decorate
-
populateCategoriesPage
public void populateCategoriesPage(org.bukkit.inventory.Inventory inventory, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the prep categories page with navigation and ready controls.- Parameters:
inventory- prep GUI inventory to populateready- whether the viewing player is marked readyreadyCount- number of ready participantsonlineCount- number of online participantspreviewEnabled- whether world preview mechanics are enabled
-
populateInventoryPage
public void populateInventoryPage(org.bukkit.inventory.Inventory inventory, ChallengeManager challengeManager, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the inventory mechanics page and ready/world controls.- Parameters:
inventory- prep GUI inventory to populatechallengeManager- challenge manager that provides enabled component statesready- whether the viewing player is marked readyreadyCount- number of ready participantsonlineCount- number of online participantspreviewEnabled- whether world preview mechanics are enabled
-
populateHealthPage
public void populateHealthPage(org.bukkit.inventory.Inventory inventory, ChallengeManager challengeManager, boolean ready, int readyCount, int onlineCount, boolean previewEnabled) Populates the health mechanics page and ready/world controls.- Parameters:
inventory- prep GUI inventory to populatechallengeManager- challenge manager that provides enabled component statesready- whether the viewing player is marked readyreadyCount- number of ready participantsonlineCount- number of online participantspreviewEnabled- whether world preview mechanics are enabled
-
populateRunHistoryPage
public int populateRunHistoryPage(org.bukkit.inventory.Inventory inventory, int page, List<RunRecord> records, DateTimeFormatter dateFormatter, LongFunction<String> durationFormatter) Populates one run-history page and returns the normalized page index used.- Parameters:
inventory- prep GUI inventory to populatepage- requested zero-based run history page indexrecords- run records ordered for displaydateFormatter- formatter for record timestampsdurationFormatter- formatter for split durations in milliseconds- Returns:
- normalized page index that was actually rendered
-
hasRunHistoryNextPage
public boolean hasRunHistoryNextPage(int page, int totalRecords) Returns whether a subsequent run-history page exists for the current index.- Parameters:
page- current zero-based page indextotalRecords- total number of available run records- Returns:
- true when a later page exists
-