From 027d6ef65f2be6e5731d6a5908ebcfa649510539 Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Fri, 14 Jul 2023 22:25:48 +0300 Subject: [PATCH] exopack curios inventory button --- .../mc/otm/datagen/lang/English.kt | 1 + .../mc/otm/datagen/lang/Russian.kt | 1 + .../mc/otm/client/render/Widgets18.kt | 1 + .../client/screen/ExoPackInventoryScreen.kt | 10 +++++++++- .../mc/otm/compat/curios/CuriosCompat.kt | 9 +++++++++ .../textures/gui/widgets/misc18.png | Bin 815 -> 826 bytes .../textures/gui/widgets/misc18.xcf | Bin 3113 -> 3924 bytes 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 08a7414d8..99d467195 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -138,6 +138,7 @@ private fun misc(provider: MatteryLanguageProvider) { gui("exopack", "Exopack Inventory") gui("exopack.go_back", "Open vanilla inventory") gui("exopack.go_in", "Open Exopack inventory") + gui("exopack.go_curios", "Open Curios inventory") gui("exopack.toggle_visibility", "Toggle Exopack visibility") gui("exopack.probe1", "This little device feels unnatural to touch, it is almost certainly resilient to any possible attempt to break it open.") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index faecb219c..6b33fac1c 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -146,6 +146,7 @@ private fun misc(provider: MatteryLanguageProvider) { gui("exopack", "Инвентарь Экзопака") gui("exopack.go_back", "Открыть обычный инвентарь") gui("exopack.go_in", "Открыть инвентарь экзопака") + gui("exopack.go_curios", "Открыть инвентарь Curios") gui("exopack.toggle_visibility", "Переключить отображение Экзопака") gui("exopack.probe1", "Данное маленькое устройство необычно на ощупь, а так же неприступно для любых попыток вскрыть.") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt index 8a54ddce1..93e07d358 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/Widgets18.kt @@ -51,6 +51,7 @@ object Widgets18 { val CROSS = miscGrid.next() val FORWARD_SLASH = miscGrid.next() val RETURN_ARROW_LEFT = miscGrid.next() + val CURIOS_INVENTORY = miscGrid.next() private val slotBgGrid = WidgetLocation.SLOT_BACKGROUNDS.grid(4, 4) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ExoPackInventoryScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ExoPackInventoryScreen.kt index 802182da8..9dc4547ee 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ExoPackInventoryScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ExoPackInventoryScreen.kt @@ -23,6 +23,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.TallHorizontalProfiledPowerGaugePanel import ru.dbotthepony.mc.otm.client.setMousePos import ru.dbotthepony.mc.otm.client.shouldOpenVanillaInventory +import ru.dbotthepony.mc.otm.compat.curios.isCuriosLoaded +import ru.dbotthepony.mc.otm.compat.curios.openCuriosScreen import ru.dbotthepony.mc.otm.core.math.integerDivisionDown import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu import ru.dbotthepony.mc.otm.network.ExoPackMenuOpen @@ -235,7 +237,7 @@ class ExoPackInventoryScreen(menu: ExoPackInventoryMenu) : MatteryScreen frame.y += movePixels moveMousePosScaled(y = movePixels) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/curios/CuriosCompat.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/curios/CuriosCompat.kt index e99c1f020..50802c1be 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/curios/CuriosCompat.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/curios/CuriosCompat.kt @@ -4,7 +4,10 @@ import com.google.common.collect.Streams import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.Slot import net.minecraft.world.item.ItemStack +import net.minecraftforge.api.distmarker.Dist import net.minecraftforge.fml.ModList +import net.minecraftforge.fml.loading.FMLEnvironment +import net.minecraftforge.network.PacketDistributor import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matteryPlayer import ru.dbotthepony.mc.otm.container.awareStream @@ -16,6 +19,8 @@ import top.theillusivec4.curios.api.CuriosApi import top.theillusivec4.curios.api.event.SlotModifiersUpdatedEvent import top.theillusivec4.curios.common.inventory.CosmeticCurioSlot import top.theillusivec4.curios.common.inventory.CurioSlot +import top.theillusivec4.curios.common.network.NetworkHandler +import top.theillusivec4.curios.common.network.client.CPacketOpenCurios import java.util.stream.Stream import kotlin.collections.ArrayList @@ -28,6 +33,10 @@ fun onCuriosSlotModifiersUpdated(event: SlotModifiersUpdatedEvent) { event.entity.matteryPlayer?.recreateExoPackMenu() } +fun openCuriosScreen(carriedStack: ItemStack = ItemStack.EMPTY) { + if (FMLEnvironment.dist.isClient) NetworkHandler.INSTANCE.send(PacketDistributor.SERVER.noArg(), CPacketOpenCurios(carriedStack)) +} + private fun Player.getCuriosSlotsImpl(): List> { val handler = getCapability(MatteryCapability.CURIOS_INVENTORY).orNull() ?: return listOf() diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.png b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.png index 9a54260fbf9ee9815e6e266c7c3e632276a8b038..e8e91ae609122f954b900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V&ra-Bfo`p5@>7XZ5Rji+=$Dk$8?7rcJy-JhN#V zocD<%tR$<%=fvYCU6A;Z>x##3oQp0CJTqcuQuD+SVzJo4N(Zx&sS!^TORA<*zL51; z<-EmNtJGNQp8SQOyuOm=I;~;Ev4jMY5TT%kGAghUrCle*LW<5~KK>!spCp$;t}+-o z7Epx-+4Y0}!GG`BT7{`eFDVoQx?ddUV-)Dw1)6oo`95}><_Qpd2CnqBzuEw1KS{5* zHR%WlZvz+CZB5w&E_Z;zCqp)6R|?V+3I*W(jJ_!c4BP^JYu?;i=Qw=;GBm5@8{ps& z7%Nity3f0NJLmRqPiuZZxTA8z1ijBF00006VoOIv0Du1g{{a7>y{D4^000SaNLh0L z01FcU01FcV0GgZ_00007bV*G`2j>AF1UnGagScY=00AsXL_t(|+U?lM5`!QRMNuFB z|IeL`3oB`crXkVPJyk9oAo!Fa%FK=xBpv^#tgOsV*>bb>d@~?(w$^nYHyjCP=G-IS zAYJ;|$bZdUuep|u*7J*i)Y(smR10T!NYT1lU97dA3aJ;)u8_>k6r4@uwZCRncaw0fGi=v&k4VwnN=+e?66K)P(HaCdZiT1aJJif8E3_;l&$AI*pX>Iy$*^r_zoe>bg}7KEZWc~j7eo+a8@U@)H-L?6W68>QsRRd w0000000000000000000000000007+C3xodq3oa&mCIA2c07*qoM6N<$g8r9Zm;e9( diff --git a/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.xcf b/src/main/resources/assets/overdrive_that_matters/textures/gui/widgets/misc18.xcf index 3d5a11d54b733ece614ee6b950f5ea8662e481c8..f42db9b994b3fc280f69543f7e8326997086cf2f 100644 GIT binary patch delta 850 zcmZ1}aYb%|9-AZs1A_|VM16fmj*0QF6&rwDAYciE(Ci)%n#&VH^XP3(X5?XHY@J-d zB(1OzA_yjhfFuY50n<(h%`o{QXYu3&&L@*6FtcoCW2s@3odJ~rQ6fML(!m1aFfg!g znLM9Wobk-&?W{`}CnvMtVf3Bsz#*-W36TbqNS1IkLdB6RDcbD9#l^@N19Y5}6n6!7 zjocF^H*+sD1WLk8V+69LF6_9l_rj(NTQBUr*mPmT#fFPL3dyBKnfb*aQ<#8wazEn) zRuD&MvN@}@AP0zv0K6U`OY3=45JGVCfkM1BFmZ1N#{d5rnE(G}`2U}s;qQNj|IA>L zgW(@Y_#eZ64kS@z6}Z?)I_puiA}sP|psBTRTk9Esexkp%a9eA^!AdXR!mWkc3IOAf BDO&&l delta 178 zcmca2w^Cw)9;3)a6MaVZi7Broiy6Rx#RWpMTSI6rm(2x?JdBJLlM^|FCr@DFV4MPE zi7_#)*}ReI9us5tt}W?c(m9+`+vJ0PfKzwg3PC