Add hand cursor to progress gauge panel

This commit is contained in:
DBotThePony 2024-01-04 18:53:12 +07:00
parent c52995541b
commit dbc793a592
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -6,6 +6,7 @@ import mezz.jei.api.recipe.RecipeType
import net.minecraft.ChatFormatting
import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.client.CursorType
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
import ru.dbotthepony.mc.otm.client.render.UVWindingOrder
import ru.dbotthepony.mc.otm.client.render.WidgetLocation
@ -94,6 +95,9 @@ open class ProgressGaugePanel<out S : Screen>(
return recipeTypeSupplier != null && value == InputConstants.MOUSE_BUTTON_LEFT
}
override val cursorType: CursorType
get() = if (recipeTypeSupplier != null) CursorType.HAND else CursorType.ARROW
override fun onClick(mouseButton: Int) {
val recipeTypeSupplier = recipeTypeSupplier ?: return
JEIPlugin.RUNTIME.recipesGui.showTypes(recipeTypeSupplier.get())