some tooltips and a fix for possible install code path (nil ref)

This commit is contained in:
payonel 2020-05-23 01:29:04 -07:00
parent 9a61dd94f6
commit ec2e7d4aaf
6 changed files with 14 additions and 3 deletions

View File

@ -230,6 +230,7 @@ oc:gui.Rack.None=None
oc:gui.Rack.Right=Right
oc:gui.Rack.Enabled=Enabled
oc:gui.Rack.Disabled=Disabled
oc:gui.Rack.RelayModeTooltip=Relay Mode
oc:gui.Rack.Top=Top
oc:gui.Switch.PacketsPerCycle=Packets / cycle
oc:gui.Switch.QueueSize=Queue size

View File

@ -206,7 +206,7 @@ end
local special_target = ""
if #targets > 1 or target_filter or source_filter then
special_target = " to " .. transfer_args[1].args[2]
special_target = " to " .. transfer_args[1][1][2]
end
io.write("Install " .. source_display .. special_target .. "? [Y/n] ")

View File

@ -142,6 +142,8 @@ object Localization {
def RelayEnabled = localizeImmediately("gui.Rack.Enabled")
def RelayDisabled = localizeImmediately("gui.Rack.Disabled")
def RelayModeTooltip: String = localizeImmediately("gui.Rack.RelayModeTooltip")
}
object Switch {

View File

@ -11,6 +11,8 @@ import net.minecraft.entity.player.InventoryPlayer
import net.minecraftforge.common.util.ForgeDirection
import org.lwjgl.opengl.GL11
import scala.collection.convert.WrapAsJava.asJavaCollection
class Rack(playerInventory: InventoryPlayer, val rack: tileentity.Rack) extends DynamicGuiContainer(new container.Rack(playerInventory, rack)) {
ySize = 210
@ -248,6 +250,12 @@ class Rack(playerInventory: InventoryPlayer, val rack: tileentity.Rack) extends
x, y, 0x404040)
}
if (relayButton.func_146115_a) {
val tooltip = new java.util.ArrayList[String]
tooltip.addAll(asJavaCollection(Localization.Rack.RelayModeTooltip.lines.toIterable))
copiedDrawHoveringText(tooltip, mouseX - guiLeft, mouseY - guiTop, fontRendererObj)
}
GL11.glPopAttrib()
}

View File

@ -622,7 +622,7 @@ object DebugCard {
}
val count = args.checkInteger(1)
val damage = args.checkInteger(2)
val tagJson = args.checkString(3)
val tagJson = args.optString(3, "")
val tag = if (Strings.isNullOrEmpty(tagJson)) null else JsonToNBT.func_150315_a(tagJson).asInstanceOf[NBTTagCompound]
val position = BlockPosition(args.checkDouble(4), args.checkDouble(5), args.checkDouble(6), world)
val side = args.checkSideAny(7)