From 92a8e2b63f4a9663fd71b035f6c1acee5a8bc70b Mon Sep 17 00:00:00 2001 From: Firenoo <49818773+firenoo@users.noreply.github.com> Date: Mon, 27 Feb 2023 23:52:57 -0800 Subject: [PATCH] New GUI - Use newly exposed AE2 P2P icons - Move name up top, display info - New icon for showing offline/unbound, tooltip for details Cleanup some constants --- .../client/gui/GuiAdvancedMemoryCard.kt | 54 ++++-- .../betterp2p/client/gui/GuiHelper.kt | 4 - .../betterp2p/client/gui/InfoWrapper.kt | 108 ++++++++--- .../betterp2p/client/gui/widget/GuiScale.kt | 2 +- .../client/gui/widget/WidgetButton.kt | 5 +- .../client/gui/widget/WidgetP2PColumn.kt | 64 +++++-- .../client/gui/widget/WidgetP2PDevice.kt | 180 +++++++----------- .../assets/betterp2p/lang/en_US.lang | 13 +- .../assets/betterp2p/lang/zh_CN.lang | 20 +- .../textures/gui/advanced_memory_card.png | Bin 5636 -> 5979 bytes 10 files changed, 264 insertions(+), 186 deletions(-) diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt index 1165975..6f14787 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt @@ -7,6 +7,7 @@ import com.projecturanus.betterp2p.client.ClientCache import com.projecturanus.betterp2p.client.TextureBound import com.projecturanus.betterp2p.client.gui.widget.* import com.projecturanus.betterp2p.network.* +import net.minecraft.client.gui.FontRenderer import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen import net.minecraft.client.renderer.Tessellator @@ -14,6 +15,7 @@ import net.minecraft.client.resources.I18n import net.minecraft.util.ResourceLocation import org.lwjgl.input.Keyboard import org.lwjgl.input.Mouse +import org.lwjgl.opengl.GL11 import java.util.* const val GUI_WIDTH = 288 @@ -72,6 +74,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { ) } + val BACKGROUND: ResourceLocation = ResourceLocation(MODID, "textures/gui/advanced_memory_card.png") private val selectedInfo: InfoWrapper? get() = infos.selectedInfo @@ -106,13 +109,13 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { scale = GuiScale.DYNAMIC } val numEntries = scale.size(height - 75) - ySize = (numEntries * P2P_ENTRY_HEIGHT) + 75 + (numEntries - 1) + ySize = (numEntries * P2PEntryConstants.HEIGHT) + 75 + (numEntries - 1) guiTop = (h - ySize) / 2 guiLeft = (width - GUI_WIDTH) / 2 scrollBar.displayX = guiLeft + 268 scrollBar.displayY = guiTop + 19 - scrollBar.height = numEntries * P2P_ENTRY_HEIGHT + (numEntries - 1) - 7 + scrollBar.height = numEntries * P2PEntryConstants.HEIGHT + (numEntries - 1) - 7 scrollBar.setRange(0, infos.size.coerceIn(0, (infos.size - numEntries).coerceAtLeast(0)), 23) searchBar.setMaxStringLength(40) @@ -170,11 +173,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) { drawDefaultBackground() drawBackground() - scrollBar.draw(this) - searchBar.drawTextBox() - col.render(this, mouseX, mouseY, partialTicks) - modeButton.drawButton(mc, mouseX, mouseY) - resizeButton.draw(mc, mouseX, mouseY, partialTicks) + // Draw the stuff that resets GL state first fontRendererObj.drawString(I18n.format("item.advanced_memory_card.name"), guiLeft + tableX, guiTop + 6, 0) if (modeButton.func_146115_a()) { descriptionLines.clear() @@ -183,10 +182,26 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { descriptionLines.clear() } drawInformation() + searchBar.drawTextBox() + resizeButton.draw(mc, mouseX, mouseY, partialTicks) + modeButton.drawButton(mc, mouseX, mouseY) + + // Now do our drawing + GL11.glPushAttrib(GL11.GL_BLEND or GL11.GL_TEXTURE_2D or GL11.GL_COLOR) + GL11.glEnable(GL11.GL_BLEND) + GL11.glEnable(GL11.GL_TEXTURE_2D) + GL11.glColor3f(255f, 255f, 255f) + scrollBar.draw(this) + + col.render(this, mouseX, mouseY, partialTicks) + // The GL state is already messed up here by string drawing but oh well + GL11.glPopAttrib() if (searchBar.isMouseIn(mouseX, mouseY)) { drawHoveringText(sortRules, guiLeft, guiTop + ySize - 40, fontRendererObj) } else if (resizeButton.isHovering(mouseX, mouseY)) { drawHoveringText(listOf(I18n.format(resizeButton.hoverText())), mouseX, mouseY, fontRendererObj) + } else { + col.mouseHovered(mouseX, mouseY) } super.drawScreen(mouseX, mouseY, partialTicks) } @@ -230,6 +245,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { col.mouseClicked(mouseX, mouseY, mouseButton) if (modeButton.mousePressed(mc, mouseX, mouseY)) { switchMode() + modeButton.func_146113_a(mc.soundHandler) } scrollBar.click(mouseX, mouseY) resizeButton.mousePressed(mouseX, mouseY) @@ -254,8 +270,8 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { super.handleMouseInput() val i = Mouse.getEventDWheel() if (i != 0 && isShiftKeyDown()) { - val x = Mouse.getEventX() * width / mc.displayWidth - val y = height - Mouse.getEventY() * height / mc.displayHeight - 1 +// val x = Mouse.getEventX() * width / mc.displayWidth +// val y = height - Mouse.getEventY() * height / mc.displayHeight - 1 // this.mouseWheelEvent(x, y, i / Math.abs(i)) } else if (i != 0) { scrollBar.wheel(i) @@ -268,8 +284,12 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { mc.textureManager.bindTexture(loc) } + fun bindTexture(loc: ResourceLocation) { + mc.textureManager.bindTexture(loc) + } + private fun drawBackground() { - bindTexture(MODID, "textures/gui/advanced_memory_card.png") + bindTexture(BACKGROUND) val tessellator = Tessellator.instance // Draw the top part drawTexturedQuad(tessellator, guiLeft.toDouble(), guiTop.toDouble(), @@ -277,7 +297,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { u0 = 0.0, v0 = 0.0, u1 = 1.0, v1 = 60.0 / GUI_TEX_HEIGHT) // Draw P2P segments - val p2pHeight = P2P_ENTRY_HEIGHT + 1.0 + val p2pHeight = P2PEntryConstants.HEIGHT + 1.0 for (i in 0 until scale.size(ySize - 75) - 2) { drawTexturedQuad(tessellator, guiLeft.toDouble(), guiTop + 60.0 + p2pHeight * i, (guiLeft + GUI_WIDTH).toDouble(), guiTop + 60.0 + p2pHeight * (i + 1), @@ -296,10 +316,18 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { } override fun keyTyped(char: Char, key: Int) { - if(key == Keyboard.KEY_LSHIFT) return - if (!col.keyTyped(char, key) && !(char.isWhitespace() && searchBar.text.isEmpty()) && searchBar.textboxKeyTyped(char, key)){ + if (key == Keyboard.KEY_LSHIFT || col.keyTyped(char, key)) return + if (!(char.isWhitespace() && searchBar.text.isEmpty()) && searchBar.textboxKeyTyped(char, key)){ infos.refilter() + } else if (char == 'e') { + mc.displayGuiScreen(null as GuiScreen?) + mc.setIngameFocus() + return } return super.keyTyped(char, key) } + + public override fun drawHoveringText(textLines: List?, x: Int, y: Int, font: FontRenderer?) { + super.drawHoveringText(textLines, x, y, font) + } } diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiHelper.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiHelper.kt index b95fbe1..d27b0b0 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiHelper.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiHelper.kt @@ -3,10 +3,6 @@ package com.projecturanus.betterp2p.client.gui import net.minecraft.client.renderer.Tessellator import net.minecraft.util.ResourceLocation -fun bindTexture(loc: ResourceLocation) { - -} - /** * Draws a textured quad. * diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/InfoWrapper.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/InfoWrapper.kt index 0c4b3ba..f67cfb4 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/InfoWrapper.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/InfoWrapper.kt @@ -1,11 +1,17 @@ package com.projecturanus.betterp2p.client.gui +import appeng.api.parts.PartItemStack +import appeng.me.GridNode +import appeng.parts.p2p.PartP2PTunnel +import appeng.parts.p2p.PartP2PTunnelME +import appeng.tile.networking.TileCableBus import com.projecturanus.betterp2p.network.P2PInfo import com.projecturanus.betterp2p.network.hashP2P import net.minecraft.client.gui.GuiButton import net.minecraft.client.resources.I18n +import net.minecraft.util.IIcon +import net.minecraftforge.common.DimensionManager import net.minecraftforge.common.util.ForgeDirection -import java.util.* class InfoWrapper(info: P2PInfo) { // Basic information @@ -19,29 +25,81 @@ class InfoWrapper(info: P2PInfo) { val posZ: Int = info.posZ val dim: Int = info.world val facing: ForgeDirection = info.facing - val description: String val output: Boolean = info.output - var name: String = info.name - var error: Boolean = false + val tile: TileCableBus? by lazy { + DimensionManager.getWorld(dim)?.getTileEntity(posX, posY, posZ) as? TileCableBus + } - // Widgets - val selectButton = GuiButton(0, 0, 0, 34, 20, I18n.format("gui.advanced_memory_card.select")) - val bindButton = GuiButton(0, 0, 0, 34, 20, I18n.format("gui.advanced_memory_card.bind")) - val renameButton = GuiButton(0, 0, 0, 0, 0,"") - init { - description = buildString { - append("P2P ") + val icon: IIcon? by lazy { + (tile?.getPart(info.facing) as? PartP2PTunnel<*>)?.typeTexture + } + val overlay: IIcon? by lazy { + tile?.getPart(info.facing)?.getItemStack(PartItemStack.Wrench)?.iconIndex + } + + val typeName: String by lazy { + val item = tile?.getPart(info.facing)?.getItemStack(PartItemStack.Wrench) + I18n.format(item?.getItem()?.getItemStackDisplayName(item)?.split(" - ")?.getOrNull(1) + ?: "§c") + } + + val description: String by lazy { + buildString { + append("Type: ") + append(typeName) + append(" - ") if (output) append(I18n.format("gui.advanced_memory_card.desc.mode.output")) else append(I18n.format("gui.advanced_memory_card.desc.mode.input")) - append(" - ") - if (info.frequency.toInt() == 0) - append(I18n.format("gui.advanced_memory_card.desc.not_set")) - else - append(info.frequency.toHexString().format4()) } } + val freqDisplay: String by lazy { + buildString { + append(I18n.format("item.advanced_memory_card.selected")) + append(" ") + if (frequency != 0L) { + val hex: String = buildString { + append((frequency shr 32).toUInt().toString(16).uppercase()) + append(frequency.toUInt().toString(16).uppercase()) + }.format4() + append(hex) + } else { + append(I18n.format("gui.advanced_memory_card.desc.not_set")) + } + } + } + + val hoverInfo: List by lazy { + val online = (tile?.getPart(info.facing) as? PartP2PTunnel<*>)?.proxy?.isPowered + val list = mutableListOf( + "§b$typeName§r", + "§e" + I18n.format("gui.advanced_memory_card.pos", info.posX, info.posY, info.posZ), + "§e" + I18n.format("gui.advanced_memory_card.side", info.facing.name), + "§e" + I18n.format("gui.advanced_memory_card.dim", info.world) + ) + if (error || frequency == 0L) { + list.add("§c" + I18n.format("gui.advanced_memory_card.p2p_status.unbound")) + } else { + list.add("§a" + I18n.format("gui.advanced_memory_card.p2p_status.bound")) + } + if (online != true) list.add("§c" + I18n.format("gui.advanced_memory_card.p2p_status.offline")) + list + } + + val channels: String? by lazy { + val c = ((tile?.getPart(facing) as? PartP2PTunnelME)?.externalFacingNode as? GridNode)?.usedChannels() + if (c != null) { + I18n.format("gui.advanced_memory_card.extra.channel", c) + } else null + } + + var name: String = info.name + var error: Boolean = false + + // Widgets + val bindButton = GuiButton(0, 0, 0, 34, 20, I18n.format("gui.advanced_memory_card.bind")) + val renameButton = GuiButton(0, 0, 0, 0, 0,"") override fun hashCode(): Int { return code.hashCode() @@ -60,23 +118,13 @@ class InfoWrapper(info: P2PInfo) { } } -fun Long.toHexString(): String { - var tmp = this - var hex = String() - while (tmp != 0.toLong()) { - hex += Integer.toHexString((tmp % 16).toInt()) - tmp /= 16 - } - return hex.uppercase(Locale.getDefault()).reversed() -} - fun String.format4(): String { - var format = String() + val format = StringBuilder() for (index in this.indices) { if (index % 4 == 0 && index != 0) { - format += " " + format.append(" ") } - format += this[index] + format.append(this[index]) } - return format + return format.toString() } diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/GuiScale.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/GuiScale.kt index 68ff9ad..0ef5f5d 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/GuiScale.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/GuiScale.kt @@ -4,5 +4,5 @@ enum class GuiScale(inline val size: (Int) -> Int, val minHeight: Int, val unloc SMALL({ 4 }, 0, "gui.advanced_memory_card.gui_scale.small"), NORMAL({ 6 }, 326, "gui.advanced_memory_card.gui_scale.normal"), LARGE({ 8 }, 409, "gui.advanced_memory_card.gui_scale.large"), - DYNAMIC({ availableHeight -> availableHeight / P2P_ENTRY_HEIGHT }, 0, "gui.advanced_memory_card.gui_scale.dynamic") + DYNAMIC({ availableHeight -> availableHeight / P2PEntryConstants.HEIGHT }, 0, "gui.advanced_memory_card.gui_scale.dynamic") } diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetButton.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetButton.kt index f4aaebb..1fe425e 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetButton.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetButton.kt @@ -29,13 +29,12 @@ abstract class WidgetButton(val gui: GuiAdvancedMemoryCard, x: Int, y: Int, widt fun draw(mc: Minecraft?, mouseX: Int, mouseY: Int, partialTicks: Float) { val tessellator = Tessellator.instance - gui.bindTexture(MODID, "textures/gui/advanced_memory_card.png") + gui.bindTexture(gui.BACKGROUND) GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f) field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height val k = getHoverState(field_146123_n) GL11.glEnable(GL11.GL_BLEND) - OpenGlHelper.glBlendFunc(770, 771, 1, 0) - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA) + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0) // Draw button backdrop drawTexturedQuad(tessellator, xPosition.toDouble(), yPosition.toDouble(), (xPosition + width).toDouble(), (yPosition + height).toDouble(), diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PColumn.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PColumn.kt index cf98a2f..19fa4f1 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PColumn.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PColumn.kt @@ -1,5 +1,6 @@ package com.projecturanus.betterp2p.client.gui.widget +import appeng.core.localization.GuiColors import com.projecturanus.betterp2p.BetterP2P import com.projecturanus.betterp2p.capability.P2PTunnelInfo import com.projecturanus.betterp2p.client.gui.GuiAdvancedMemoryCard @@ -7,8 +8,8 @@ import com.projecturanus.betterp2p.client.gui.InfoList import com.projecturanus.betterp2p.client.gui.InfoWrapper import com.projecturanus.betterp2p.item.BetterMemoryCardModes import com.projecturanus.betterp2p.network.* +import net.minecraft.client.gui.GuiTextField import net.minecraftforge.common.util.ForgeDirection -import org.lwjgl.input.Keyboard import kotlin.reflect.KProperty0 /** @@ -23,8 +24,8 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, val mode: () -> BetterMemoryCardModes, private var scrollBar: WidgetScrollBar) { - private val entries: MutableList = mutableListOf() - private val renameBar: IGuiTextField = IGuiTextField(0,0) + val entries: MutableList = mutableListOf() + private val renameBar: IGuiTextField = IGuiTextField(160,12) init { renameBar.setMaxStringLength(50) @@ -38,7 +39,7 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, for (i in 0 until scale.size(availableHeight)) { val widget = WidgetP2PDevice( selectedInfo, mode, { infos.filtered.getOrNull(i + scrollBar.currentScroll) }, - x, y + i * (P2P_ENTRY_HEIGHT + 1)) + x, y + i * (P2PEntryConstants.HEIGHT + 1)) entries.add(widget) } } @@ -48,7 +49,7 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, this.y = y for ((i, entry) in entries.withIndex()) { entry.x = x - entry.y = y + i * (P2P_ENTRY_HEIGHT + 1) + entry.y = y + i * (P2PEntryConstants.HEIGHT + 1) } } @@ -56,7 +57,7 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, for (widget in entries){ widget.renderNameTextField = true } - if(renameBar.info != null && renameBar.info.name != renameBar.text){ + if(renameBar.info != null && !renameBar.text.isEmpty() && renameBar.info.name != renameBar.text){ val info:InfoWrapper = renameBar.info renameBar.text = renameBar.text.trim() ModNetwork.channel.sendToServer(C2SP2PTunnelInfo(P2PTunnelInfo(info.posX,info.posY,info.posZ,info.dim, ForgeDirection.valueOf(info.facing.name).ordinal,renameBar.text))) @@ -72,15 +73,17 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, // ModNetwork.channel.sendToServer(C2STransportPlayer(P2PTunnelInfo(info.posX,info.posY,info.posZ,info.dim,0))) //} + /** + * Called when rename button "area" is clicked. Rename text bar must be + * visible after this is called. + */ private fun onRenameButtonClicked(info:InfoWrapper, index: Int) { // if (GuiScreen.isShiftKeyDown()) { // transportPlayer(info) // } renameBar.isVisible = true - renameBar.y = (this.y) + index * (P2P_ENTRY_HEIGHT + 1) + 19 + renameBar.y = (this.y) + index * (P2PEntryConstants.HEIGHT + 1) + 1 renameBar.x = this.x + 50 - renameBar.w = 120 - renameBar.h = 12 renameBar.text = info.name renameBar.setFocus(true,0) renameBar.info = info @@ -88,6 +91,7 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, private fun onSelectButtonClicked(info: InfoWrapper) { gui.selectInfo(info.code) + info.bindButton.func_146113_a(gui.mc.soundHandler) } private fun onBindButtonClicked(info: InfoWrapper) { @@ -107,6 +111,7 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, ModNetwork.channel.sendToServer(C2SLinkP2P(input.code, info.code)) } } + info.bindButton.func_146113_a(gui.mc.soundHandler) } private fun findInput(frequency: Long?) = @@ -116,17 +121,22 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, var clickRenameButton = false for ((index,widget) in entries.withIndex()) { val info = widget.infoSupplier() - if (info?.selectButton?.mousePressed(gui.mc, mouseX, mouseY) == true) { - onSelectButtonClicked(widget.infoSupplier()!!) - } else if (info?.bindButton?.mousePressed(gui.mc, mouseX, mouseY) == true) { + if (info?.bindButton?.mousePressed(gui.mc, mouseX, mouseY) == true) { onBindButtonClicked(widget.infoSupplier()!!) - } else if (info?.renameButton?.mousePressed(gui.mc, mouseX,mouseY) == true) { - if(renameBar.info != widget.infoSupplier()!!) { + } else if (mouseX > widget.x.toDouble() + 50 && mouseX < widget.x.toDouble() + 50 + 160 && + mouseY > widget.y.toDouble() + 1 && mouseY < widget.y + 1 + 13 && + widget.infoSupplier() != null) { + if(renameBar.info != widget.infoSupplier()) { finishRename() } widget.renderNameTextField = false onRenameButtonClicked(widget.infoSupplier()!!, index) clickRenameButton = true + } else if (mouseX > widget.x && mouseX < widget.x + P2PEntryConstants.WIDTH && + mouseY > widget.y && mouseY < widget.y + P2PEntryConstants.HEIGHT && + info != null && selectedInfo.get() != info + ) { + onSelectButtonClicked(info) } } renameBar.mouseClicked(mouseX,mouseY,mouseButton) @@ -135,12 +145,30 @@ class WidgetP2PColumn(private val gui: GuiAdvancedMemoryCard, } } + fun mouseHovered(mouseX: Int, mouseY: Int) { + entries.forEach { + val info = it.infoSupplier() + if (mouseX > it.x.toDouble() && mouseX < it.x + 20.0 && + mouseY > it.y.toDouble() && mouseY < it.y + P2PEntryConstants.HEIGHT && info != null) { + gui.drawHoveringText(info.hoverInfo, it.x + 168, it.y + 15, gui.mc.fontRenderer) + } else if (mouseX > it.x.toDouble() + 50 && mouseX < it.x.toDouble() + 50 + 160 && + mouseY > it.y.toDouble() + 1 && mouseY < it.y + 1 + 13 && + !renameBar.isFocused && info != null + ) { + GuiTextField.drawRect( + it.x + 50, + it.y + 1, + it.x + 50 + 160, + it.y + 1 + 12, + GuiColors.SearchboxFocused.color) + } + } + } + fun keyTyped(char: Char, key: Int): Boolean { - if(renameBar.isFocused){ - if(key == Keyboard.KEY_RETURN){ + if (renameBar.isFocused) { + if (!renameBar.textboxKeyTyped(char, key)) { finishRename() - }else{ - renameBar.textboxKeyTyped(char, key) } return true } diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt index 85d3c2a..39924c5 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt @@ -1,26 +1,26 @@ package com.projecturanus.betterp2p.client.gui.widget -import appeng.me.GridNode -import appeng.parts.p2p.PartP2PTunnelME -import appeng.tile.networking.TileCableBus -import com.projecturanus.betterp2p.client.gui.GuiAdvancedMemoryCard -import com.projecturanus.betterp2p.client.gui.InfoWrapper +import com.projecturanus.betterp2p.client.gui.* import com.projecturanus.betterp2p.item.BetterMemoryCardModes import net.minecraft.client.gui.GuiScreen +import net.minecraft.client.renderer.OpenGlHelper +import net.minecraft.client.renderer.Tessellator import net.minecraft.client.resources.I18n -import net.minecraftforge.common.DimensionManager -import net.minecraftforge.common.util.ForgeDirection -import java.awt.Color +import net.minecraft.util.IIcon +import org.lwjgl.opengl.GL11 import kotlin.reflect.KProperty0 -const val P2P_ENTRY_HEIGHT: Int = 41 -const val P2P_ENTRY_WIDTH: Int = 254 +object P2PEntryConstants { + const val HEIGHT = 41 + const val WIDTH = 254 + const val OUTPUT_COLOR = 0x4566ccff + const val SELECTED_COLOR = 0x4545DA75 + const val ERROR_COLOR = 0x45DA4527 + const val INACTIVE_COLOR = 0x45FFEA05 + const val LEFT_ALIGN = 24 +} class WidgetP2PDevice(private val selectedInfoProperty: KProperty0, val modeSupplier: () -> BetterMemoryCardModes, val infoSupplier: () -> InfoWrapper?, var x: Int, var y: Int): Widget() { - private val outputColor = 0x4566ccff - private val selectedColor = 0x4545DA75 - private val errorColor = 0x45DA4527 - private val inactiveColor = 0x45FFEA05 var renderNameTextField = true @@ -30,40 +30,54 @@ class WidgetP2PDevice(private val selectedInfoProperty: KProperty0 fun render(gui: GuiAdvancedMemoryCard, mouseX: Int, mouseY: Int, partialTicks: Float) { val info = infoSupplier() if (info != null) { - val fontRenderer = gui.mc.fontRenderer + // Draw the background first if (selectedInfo?.code == info.code) - GuiScreen.drawRect(x, y, x + P2P_ENTRY_WIDTH, y + P2P_ENTRY_HEIGHT, selectedColor) + GuiScreen.drawRect(x, y, x + P2PEntryConstants.WIDTH, y + P2PEntryConstants.HEIGHT, P2PEntryConstants.SELECTED_COLOR) else if (info.error) { - // P2P output without an input - GuiScreen.drawRect(x, y, x + P2P_ENTRY_WIDTH, y + P2P_ENTRY_HEIGHT, errorColor) - } - else if (!info.hasChannel && info.frequency != 0.toLong()) { + // P2P output without an input, or unbound + GuiScreen.drawRect(x, y, x + P2PEntryConstants.WIDTH, y + P2PEntryConstants.HEIGHT, P2PEntryConstants.ERROR_COLOR) + } else if (!info.hasChannel && info.frequency != 0L) { // No channel - GuiScreen.drawRect(x, y, x + P2P_ENTRY_WIDTH, y + P2P_ENTRY_HEIGHT, inactiveColor) - } - else if (selectedInfo?.frequency == info.frequency && info.frequency != 0.toLong()) { + GuiScreen.drawRect(x, y, x + P2PEntryConstants.WIDTH, y + P2PEntryConstants.HEIGHT, P2PEntryConstants.INACTIVE_COLOR) + } else if (selectedInfo?.frequency == info.frequency && info.frequency != 0.toLong()) { // Show same frequency - GuiScreen.drawRect(x, y, x + P2P_ENTRY_WIDTH, y + P2P_ENTRY_HEIGHT, outputColor) + GuiScreen.drawRect(x, y, x + P2PEntryConstants.WIDTH, y + P2PEntryConstants.HEIGHT, P2PEntryConstants.OUTPUT_COLOR) } - fontRenderer.drawString(info.description, x + 24, y + 3, 0) - fontRenderer.drawString(I18n.format("gui.advanced_memory_card.pos", info.posX, info.posY, info.posZ, info.facing.name), x + 24, y + 12, 0) - if(renderNameTextField) { - fontRenderer.drawString(I18n.format("gui.advanced_memory_card.name", info.name), x + 24, y + 21, 0) + GL11.glColor3f(255f, 255f, 255f) + // Draw our icons... + drawIcon(gui, info.icon!!, info.overlay!!, x + 3, y + 3) + gui.bindTexture(gui.BACKGROUND) + if (info.output) { + drawTexturedQuad(Tessellator.instance, x.toDouble(), y + 4.0, x + 16.0, y + 20.0, + 144.0 / GUI_WIDTH, 200.0 / GUI_TEX_HEIGHT, 160.0 / GUI_WIDTH, 216.0 / GUI_TEX_HEIGHT) } else { - fontRenderer.drawString(I18n.format("gui.advanced_memory_card.name", ""), x + 24, y + 21, 0) + drawTexturedQuad(Tessellator.instance, x.toDouble(), y + 4.0, x + 16.0, y + 20.0, + 128.0 / GUI_WIDTH, 200.0 / GUI_TEX_HEIGHT, 144.0 / GUI_WIDTH, 216.0 / GUI_TEX_HEIGHT) + } + if (info.error || info.frequency == 0L || !info.hasChannel) { + drawTexturedQuad(Tessellator.instance, x + 3.0, y + 20.0, x + 19.0, y + 36.0, + 144.0 / GUI_WIDTH, 216.0 / GUI_TEX_HEIGHT, 160.0 / GUI_WIDTH, 232.0 / GUI_TEX_HEIGHT) + } else { + drawTexturedQuad(Tessellator.instance, x + 3.0, y + 20.0, x + 19.0, y + 36.0, + 128.0 / GUI_WIDTH, 216.0 / GUI_TEX_HEIGHT, 144.0 / GUI_WIDTH, 232.0 / GUI_TEX_HEIGHT) + } + // Now draw the stuff that messes up our GL state (aka text) + val fontRenderer = gui.mc.fontRenderer + val leftAlign = x + P2PEntryConstants.LEFT_ALIGN + if (renderNameTextField) { + fontRenderer.drawString(I18n.format("gui.advanced_memory_card.name", info.name), leftAlign, y + 3, 0) + } else { + fontRenderer.drawString(I18n.format("gui.advanced_memory_card.name", ""), leftAlign, y + 3, 0) + } + fontRenderer.drawString(info.description, leftAlign, y + 13, 0) + fontRenderer.drawString(info.freqDisplay, leftAlign, y + 23, 0) + if (info.channels != null) { + fontRenderer.drawString(info.channels, leftAlign, y + 33, 0) } - fontRenderer.drawString(getExtraInfo(info.dim, info.posX, info.posY, info.posZ, info.facing), x + 24, y + 30, 0) - if (selectedInfo == null) { info.bindButton.enabled = false - info.selectButton.enabled = true - } else if (info.code != selectedInfo?.code) { - info.bindButton.enabled = true - info.selectButton.enabled = true } else { - // TODO Unbind - info.bindButton.enabled = false - info.selectButton.enabled = false + info.bindButton.enabled = info.code != selectedInfo?.code } val mode = modeSupplier() @@ -71,92 +85,38 @@ class WidgetP2PDevice(private val selectedInfoProperty: KProperty0 info.bindButton.enabled = false } drawButtons(gui, info, mouseX, mouseY, partialTicks) - drawP2PColors(gui, info.frequency, x, y) - } - } - - private fun drawP2PColors(gui: GuiScreen, frequency: Long, x: Int, y: Int) { - drawRectBorder(x + 9, y + 9, 3, 3, Color.BLACK.rgb) - for (row in 0..1) { - for (col in 0..1) { - for (colorIndex in 0..3) { - val offsetX: Int = colorIndex % 2 - val offsetY: Int = colorIndex / 2 - drawHorizontalLine(x + 7 + col * 6 + offsetX, x + 8 + col * 6 + offsetX, y + 7 + row * 6 + offsetY, Color.BLACK.rgb) - } - drawRectBorder(x + 6 + col * 6, y + 6 + row * 6, 3, 3, Color.BLACK.rgb) - } } } private fun drawButtons(gui: GuiScreen, info: InfoWrapper, mouseX: Int, mouseY: Int, partialTicks: Float) { info.renameButton.xPosition = x + 50 info.renameButton.width = 120 - info.renameButton.yPosition = y + 19 + info.renameButton.yPosition = y + 1 info.renameButton.height = 12 - if (!info.bindButton.enabled && info.selectButton.enabled) { + if (!info.bindButton.enabled) { info.bindButton.enabled = false - info.selectButton.enabled = true - - info.selectButton.xPosition = x + 215 - info.selectButton.width = 32 - info.selectButton.yPosition = y + 6 - info.selectButton.drawButton(gui.mc, mouseX, mouseY) - } else if (info.bindButton.enabled && info.selectButton.enabled) { + } else if (info.bindButton.enabled) { info.bindButton.enabled = true - info.selectButton.enabled = true - - // Select button on the left - info.selectButton.xPosition = x + 178 - info.selectButton.width = 32 - info.selectButton.yPosition = y + 6 - info.selectButton.drawButton(gui.mc, mouseX, mouseY) - - // Bind button on the right - info.bindButton.xPosition = x + 215 - info.bindButton.width = 32 - info.bindButton.yPosition = y + 6 + info.bindButton.xPosition = x + 190 + info.bindButton.width = 56 + info.bindButton.yPosition = y + 14 info.bindButton.drawButton(gui.mc, mouseX, mouseY) - } else if (!info.selectButton.enabled && !info.bindButton.enabled) { + } else if (!info.bindButton.enabled) { // TODO Unbind info.bindButton.enabled = false - info.selectButton.enabled = false } } - // For a future feature ;P - -// private fun drawIcon(gui: GuiAdvancedMemoryCard, posX: Int, posY: Int, posZ: Int, face: ForgeDirection, world: Int) { -// val tile = DimensionManager.getWorld(world)?.getTileEntity(posX, posY, posZ) -// if (tile is TileCableBus) { -// val p2p = (tile.getPart(face) as? PartP2PTunnel<*>) ?: return -// val icon: IIcon = p2p.getItemStack().getIconIndex() ?: return -// val tessellator = Tessellator.instance -// gui.bindTexture(MODID, "textures/gui/advanced_memory_card.png") -// gui.mc.renderEngine.bindTexture(gui.mc.renderEngine.getResourceLocation(0)) -// GL11.glPushAttrib(GL11.GL_BLEND or GL11.GL_TEXTURE_2D or GL11.GL_COLOR) -// GL11.glEnable(GL11.GL_BLEND) -// GL11.glEnable(GL11.GL_TEXTURE_2D) -// GL11.glColor3f(255f, 255f, 255f) -// OpenGlHelper.glBlendFunc(770, 771, 1, 0) -// tessellator.startDrawingQuads() -// tessellator.addVertexWithUV(x.toDouble(), y + rowHeight.toDouble(), 0.0, icon.minU.toDouble(), icon.maxV.toDouble()) -// tessellator.addVertexWithUV(x + rowWidth.toDouble(), y + rowHeight.toDouble(), 0.0, icon.maxU.toDouble(), icon.maxV.toDouble()) -// tessellator.addVertexWithUV(x + rowWidth.toDouble(), y.toDouble(), 0.0, icon.maxU.toDouble(), icon.minV.toDouble()) -// tessellator.addVertexWithUV(x.toDouble(), y.toDouble(), 0.0, icon.minU.toDouble(), icon.minV.toDouble()) -// tessellator.draw() -// GL11.glPopAttrib() -// } -// } -} - -fun getExtraInfo(world: Int, posX: Int, poxY: Int, posZ: Int, face: ForgeDirection): String { - val tile = DimensionManager.getWorld(world)?.getTileEntity(posX, poxY, posZ) - if (tile is TileCableBus) { - val used = ((tile.getPart(face) as? PartP2PTunnelME)?.externalFacingNode as? GridNode)?.usedChannels() - if (used != null) { - return I18n.format("gui.advanced_memory_card.extra.channel", used) - } + private fun drawIcon(gui: GuiAdvancedMemoryCard, icon: IIcon, overlay: IIcon, x: Int, y: Int) { + val tessellator = Tessellator.instance + gui.mc.renderEngine.bindTexture(gui.mc.renderEngine.getResourceLocation(0)) + GL11.glPushAttrib(GL11.GL_BLEND or GL11.GL_TEXTURE_2D or GL11.GL_COLOR) + GL11.glEnable(GL11.GL_BLEND) + GL11.glEnable(GL11.GL_TEXTURE_2D) + GL11.glColor3f(255f, 255f, 255f) + OpenGlHelper.glBlendFunc(770, 771, 1, 0) + drawTexturedQuad(tessellator, x.toDouble() + 1, y.toDouble() + 1, x + 15.0, y + 15.0, icon.minU.toDouble(), icon.minV.toDouble(), icon.maxU.toDouble(), icon.maxV.toDouble()) + drawTexturedQuad(tessellator, x.toDouble(), y.toDouble(), x + 16.0, y + 16.0, overlay.minU.toDouble(), overlay.minV.toDouble(), overlay.maxU.toDouble(), overlay.maxV.toDouble()) + GL11.glPopAttrib() } - return I18n.format("gui.advanced_memory_card.extra.none") } diff --git a/src/main/resources/assets/betterp2p/lang/en_US.lang b/src/main/resources/assets/betterp2p/lang/en_US.lang index 67d26a6..25a11ed 100644 --- a/src/main/resources/assets/betterp2p/lang/en_US.lang +++ b/src/main/resources/assets/betterp2p/lang/en_US.lang @@ -1,9 +1,10 @@ item.advanced_memory_card.name=Advanced Memory Card -item.advanced_memory_card.selected=Frequency: {} -item.advanced_memory_card.not_selected=No Frequency +item.advanced_memory_card.selected=Frequency: gui.advanced_memory_card.select=Select gui.advanced_memory_card.bind=Bind -gui.advanced_memory_card.pos=Pos: %d, %d, %d Side: %s +gui.advanced_memory_card.pos=Pos: %d, %d, %d +gui.advanced_memory_card.side=Side: %s +gui.advanced_memory_card.dim=Dim: %d gui.advanced_memory_card.name=Name: %s gui.advanced_memory_card.sortinfo1=Sorting tags gui.advanced_memory_card.sortinfo2=Show Input P2Ps only @@ -12,7 +13,6 @@ gui.advanced_memory_card.sortinfo4=Show Bound P2Ps only gui.advanced_memory_card.sortinfo5=Show Unbound P2Ps only gui.advanced_memory_card.sortinfo6=Tags are space separated and are combined w/ the AND operator. gui.advanced_memory_card.extra.channel=Channels used: %s -gui.advanced_memory_card.extra.none=No Extra Info gui.advanced_memory_card.mode.input=Mode: Bind Input gui.advanced_memory_card.mode.output=Mode: Bind Output gui.advanced_memory_card.mode.copy=Mode: Copy Output @@ -26,3 +26,8 @@ gui.advanced_memory_card.gui_scale.small=Small gui.advanced_memory_card.gui_scale.normal=Standard gui.advanced_memory_card.gui_scale.large=Large gui.advanced_memory_card.gui_scale.dynamic=Automatic +gui.advanced_memory_card.p2p_status.bound=Bound +gui.advanced_memory_card.p2p_status.unbound=Unbound +gui.advanced_memory_card.p2p_status.input=Input +gui.advanced_memory_card.p2p_status.output=Output +gui.advanced_memory_card.p2p_status.offline=Offline diff --git a/src/main/resources/assets/betterp2p/lang/zh_CN.lang b/src/main/resources/assets/betterp2p/lang/zh_CN.lang index c24d7f9..90c1e7e 100644 --- a/src/main/resources/assets/betterp2p/lang/zh_CN.lang +++ b/src/main/resources/assets/betterp2p/lang/zh_CN.lang @@ -1,10 +1,18 @@ item.advanced_memory_card.name=高级内存卡 -item.advanced_memory_card.selected=频率: {} -item.advanced_memory_card.not_selected=无内容 +item.advanced_memory_card.selected=频率: gui.advanced_memory_card.select=选择 gui.advanced_memory_card.bind=绑定 -gui.advanced_memory_card.pos=位置: %d, %d, %d 朝向: %s +gui.advanced_memory_card.pos=位置: %d, %d, %d +gui.advanced_memory_card.side=朝向: %s +gui.advanced_memory_card.dim=Dim: %d gui.advanced_memory_card.name=名称: %s +gui.advanced_memory_card.sortinfo1=Sorting tags +gui.advanced_memory_card.sortinfo2=Show Input P2Ps only +gui.advanced_memory_card.sortinfo3=Show Output P2Ps only +gui.advanced_memory_card.sortinfo4=Show Bound P2Ps only +gui.advanced_memory_card.sortinfo5=Show Unbound P2Ps only +gui.advanced_memory_card.sortinfo6=Tags are space separated and are combined w/ the AND operator. +gui.advanced_memory_card.extra.channel=Channels used: %s gui.advanced_memory_card.mode.input=模式:绑定输入 gui.advanced_memory_card.mode.output=模式:绑定输出 gui.advanced_memory_card.mode.copy=模式:复制输出 @@ -13,7 +21,13 @@ gui.advanced_memory_card.desc.mode.input=输入 gui.advanced_memory_card.desc.mode.output=输出 gui.advanced_memory_card.desc.not_set=未配置 gui.advanced_memory_card.desc.effect=效果: +gui.advanced_memory_card.gui_scale.resize=Resize gui.advanced_memory_card.gui_scale.small=小 gui.advanced_memory_card.gui_scale.normal=中 gui.advanced_memory_card.gui_scale.large=大 gui.advanced_memory_card.gui_scale.dynamic=自动 +gui.advanced_memory_card.p2p_status.bound=Bound +gui.advanced_memory_card.p2p_status.unbound=Unbound +gui.advanced_memory_card.p2p_status.input=输入 +gui.advanced_memory_card.p2p_status.output=输出 +gui.advanced_memory_card.p2p_status.offline=设备关闭 diff --git a/src/main/resources/assets/betterp2p/textures/gui/advanced_memory_card.png b/src/main/resources/assets/betterp2p/textures/gui/advanced_memory_card.png index 13b64b75a55d0261bcda52ea006a9c6a5667c215..fb0e23ce2467c70538cb7ab929c307d96dda6693 100644 GIT binary patch literal 5979 zcmeHLS5%Wtw@yNoP=wH=7$6i0MFat9QUakPEuet(B3-2yX$f5rq)L+x0@6EzbWlMA zl_tGN6A%OwBK?2AbA2xUo3qxr_%7z+o&Bz7_B_v?J$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