Removed the max width for the debug tooltip because Forge makes it so tooptips can't go offscreen anyways

This commit is contained in:
Ellpeck 2016-07-26 13:43:35 +02:00
parent 48c3c0c848
commit 602072d51b

View file

@ -56,7 +56,7 @@ public class ClientEvents{
@SubscribeEvent @SubscribeEvent
public void onTooltipEvent(ItemTooltipEvent event){ public void onTooltipEvent(ItemTooltipEvent event){
//Advanced Item Info //Advanced Item Info
if(event.getItemStack().getItem() != null){ if(event.getItemStack() != null && event.getItemStack().getItem() != null){
if(ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()){ if(ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()){
if(GuiScreen.isCtrlKeyDown()){ if(GuiScreen.isCtrlKeyDown()){
event.getToolTip().add(TextFormatting.DARK_GRAY+""+TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".extraInfo.desc")+":"); event.getToolTip().add(TextFormatting.DARK_GRAY+""+TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".extraInfo.desc")+":");
@ -102,10 +102,7 @@ public class ClientEvents{
if(compound != null && !compound.hasNoTags()){ if(compound != null && !compound.hasNoTags()){
event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".nbt.desc")+":"); event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".nbt.desc")+":");
if(GuiScreen.isShiftKeyDown()){ if(GuiScreen.isShiftKeyDown()){
List<String> strgList = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(compound.toString(), 200); event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+compound.toString());
for(String strg : strgList){
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+strg);
}
} }
else{ else{
event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+TextFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".pressShift.desc")+"]"); event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+TextFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".pressShift.desc")+"]");
@ -113,7 +110,7 @@ public class ClientEvents{
} }
//Disabling Info //Disabling Info
event.getToolTip().addAll(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".disablingInfo.desc"), 200)); event.getToolTip().add(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".disablingInfo.desc"));
} }
else{ else{