Merge branch 'CloseSummary' into 'main'

Added ability to close summary and starter screen with summary button.

See merge request cable-mc/cobblemon!2274
This commit is contained in:
Polymeta
2026-05-21 08:38:55 +00:00
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -55,6 +55,7 @@
- Added 7 new advancements
- Pressing the inventory key now closes the Pokémon interact wheel GUI
- Pokémon cries now play when clicking Pokémon in the summary screen.
- Pressing the Summary key while either the starter selection or summary screen are open now closes those screens
### New rideable Pokémon
- Drampa
@@ -28,6 +28,7 @@ import com.cobblemon.mod.common.client.gui.startselection.widgets.SelectionButto
import com.cobblemon.mod.common.client.gui.startselection.widgets.preview.StarterRoundabout
import com.cobblemon.mod.common.client.gui.summary.Summary.Companion.PARTY
import com.cobblemon.mod.common.client.gui.summary.widgets.ModelWidget
import com.cobblemon.mod.common.client.keybind.keybinds.SummaryBinding
import com.cobblemon.mod.common.client.render.drawScaledText
import com.cobblemon.mod.common.config.starter.RenderableStarterCategory
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
@@ -333,7 +334,7 @@ class StarterSelectionScreen(private val categories: List<RenderableStarterCateg
}
override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
if (minecraft?.options?.keyInventory?.matches(keyCode, scanCode) == true) {
if (minecraft?.options?.keyInventory?.matches(keyCode, scanCode) == true || SummaryBinding.matches(keyCode, scanCode)) {
Minecraft.getInstance().setScreen(null)
return true
}
@@ -35,6 +35,7 @@ import com.cobblemon.mod.common.client.gui.summary.widgets.screens.marks.MarksWi
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.moves.MoveSwapScreen
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.moves.MovesWidget
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.stats.StatWidget
import com.cobblemon.mod.common.client.keybind.keybinds.SummaryBinding
import com.cobblemon.mod.common.client.render.drawScaledText
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
import com.cobblemon.mod.common.net.messages.server.pokemon.update.SetItemHiddenPacket
@@ -701,7 +702,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
}
if (isInventoryKeyPressed(minecraft, keyCode, scanCode) && !nicknameSelected) {
if ( !nicknameSelected && (isInventoryKeyPressed(minecraft, keyCode, scanCode) || SummaryBinding.matches(keyCode, scanCode)) ){
saveActiveMark()
saveMarkings()
Minecraft.getInstance().setScreen(null)