-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
How to evolve is finally here! A lot of things added to make it, including new translations and new textures! Added some missing translations to translation file (still have a lot, will be available on next update)
- Loading branch information
1 parent
4933bc4
commit e91b13f
Showing
16 changed files
with
968 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/gui/menus/EvolutionMenu.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.rafacasari.mod.cobbledex.client.gui.menus | ||
|
||
import com.rafacasari.mod.cobbledex.client.widget.LongTextDisplay | ||
import com.rafacasari.mod.cobbledex.network.template.SerializablePokemonEvolution | ||
|
||
object EvolutionMenu { | ||
|
||
|
||
fun drawText(longTextDisplay: LongTextDisplay?, evolution: SerializablePokemonEvolution) { | ||
if (longTextDisplay == null) return | ||
|
||
evolution.drawInfo(longTextDisplay) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/widget/entries/EmptyEntry.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.rafacasari.mod.cobbledex.client.widget.entries | ||
|
||
|
||
import com.rafacasari.mod.cobbledex.client.widget.LongTextDisplay | ||
import net.minecraft.client.gui.DrawContext | ||
class EmptyEntry : LongTextDisplay.TextDisplayEntry() { | ||
|
||
override fun drawTooltip(context: DrawContext, mouseX: Int, mouseY: Int) { | ||
|
||
} | ||
|
||
override fun render( | ||
context: DrawContext?, | ||
index: Int, | ||
y: Int, | ||
x: Int, | ||
entryWidth: Int, | ||
entryHeight: Int, | ||
mouseX: Int, | ||
mouseY: Int, | ||
hovered: Boolean, | ||
tickDelta: Float | ||
) | ||
{ | ||
|
||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/widget/entries/PokemonEntry.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.rafacasari.mod.cobbledex.client.widget.entries | ||
|
||
import com.cobblemon.mod.common.api.gui.blitk | ||
import com.cobblemon.mod.common.api.gui.drawPortraitPokemon | ||
import com.cobblemon.mod.common.client.render.drawScaledText | ||
import com.cobblemon.mod.common.pokemon.Species | ||
import com.rafacasari.mod.cobbledex.client.widget.LongTextDisplay | ||
import com.rafacasari.mod.cobbledex.utils.cobbledexResource | ||
import net.minecraft.client.MinecraftClient | ||
import net.minecraft.client.gui.DrawContext | ||
import net.minecraft.text.OrderedText | ||
import net.minecraft.util.Colors | ||
|
||
class PokemonEntry(val species: Species, val aspects: Set<String>, val text: OrderedText) : LongTextDisplay.TextDisplayEntry() { | ||
companion object | ||
{ | ||
private val BACKGROUND = cobbledexResource("textures/gui/evolution-menu/background.png") | ||
private val OVERLAY = cobbledexResource("textures/gui/evolution-menu/overlay.png") | ||
private const val IMAGE_SIZE = 16 | ||
private const val Y_OFFSET = 1 | ||
private const val X_OFFSET = -2 | ||
} | ||
|
||
|
||
override fun render( | ||
context: DrawContext?, | ||
index: Int, | ||
y: Int, | ||
x: Int, | ||
entryWidth: Int, | ||
entryHeight: Int, | ||
mouseX: Int, | ||
mouseY: Int, | ||
hovered: Boolean, | ||
tickDelta: Float | ||
) { | ||
if (context == null) return | ||
val matrices = context.matrices | ||
|
||
|
||
blitk( | ||
matrixStack = matrices, | ||
texture = BACKGROUND, | ||
x = x + X_OFFSET, | ||
y = y + Y_OFFSET, | ||
height = IMAGE_SIZE, | ||
width = IMAGE_SIZE | ||
) | ||
|
||
context.enableScissor( | ||
x + X_OFFSET, | ||
y + Y_OFFSET, | ||
x + X_OFFSET + IMAGE_SIZE, | ||
y + Y_OFFSET + IMAGE_SIZE | ||
) | ||
|
||
matrices.push() | ||
matrices.translate( | ||
x + 10.0 + X_OFFSET, | ||
y.toDouble() - 3 + Y_OFFSET, | ||
0.0 | ||
) | ||
matrices.scale(0.5f, 0.5f,1f) | ||
|
||
drawPortraitPokemon(species, aspects, matrices, partialTicks = tickDelta) | ||
|
||
matrices.pop() | ||
context.disableScissor() | ||
|
||
|
||
blitk( | ||
matrixStack = matrices, | ||
texture = OVERLAY, | ||
x = x + X_OFFSET, | ||
y = y + Y_OFFSET, | ||
height = IMAGE_SIZE, | ||
width = IMAGE_SIZE | ||
) | ||
|
||
drawScaledText(context, text, x + 18, y + 5, scaleX = 1.1f, scaleY = 1.1f) | ||
} | ||
|
||
override fun drawTooltip(context: DrawContext, mouseX: Int, mouseY: Int) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.