Feat/allow modificatio of title#247
Conversation
…dling in AbstractSurfView
There was a problem hiding this comment.
Pull request overview
This PR refactors the inventory view framework to allow dynamic title modification after initial rendering. It moves container initialization from onInit to onOpen, makes ViewContainer per-context via lazyState, and introduces a public modifyContainer DSL function. It also adds a ViewIcon system and includes minor fixes.
Changes:
- Refactored container/title lifecycle: container state is now per-open-context, enabling title changes via a new
header()DSL and publicmodifyContainerfunction - Added
ViewIcon,ViewIconType, andViewIconColorenums for standardized menu icon rendering - Minor improvements: early-return optimization in
PacketLoreListener, method rename for clarity
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
AbstractSurfView.kt |
Container moved to lazyState, applyContainerDefaults moved to onOpen, modifyContainer now requires non-null Context |
SurfViewDSLImpl.kt |
Removed view-scoped modifyContainer, exposed modifyContainer0 as internal |
PaginatedSurfViewDSLImpl.kt |
Same refactor as SurfViewDSLImpl |
SurfViewLifecycleDsl.kt |
Added public modifyContainer and header() DSL functions |
ViewContainerDSL.kt |
Added header() function for setting container title |
ViewContainerTitleComponent.kt |
Changed from internal to public |
SurfViewBuilder.kt |
Removed ViewRef from builder context parameters |
ViewIcon.kt |
New icon builder using Nexo item models |
ViewIconType.kt |
Enum of available icon types |
ViewIconColor.kt |
Enum of available icon colors |
PacketLoreListener.kt |
Method rename + early-return when lore unchanged |
gradle.properties |
Version bump to 2.63.2 |
...c/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/view/icon/ViewIconType.kt
Outdated
Show resolved
Hide resolved
...src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/view/SurfViewBuilder.kt
Show resolved
Hide resolved
...rc/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/view/AbstractSurfView.kt
Outdated
Show resolved
Hide resolved
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
# Conflicts: # gradle.properties
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
No description provided.