I've been fixing up an old mod that I really enjoyed back in the day called Dassault-Mikoyan for personal use. I don't have a lot of programming experience but i've actually been learning really fast because of this. So far i've cracked down on a lot of bugs but this one stumps me.
The error i'm encountering occurs when you mouse over a custom hullmod. Instant crash. clearly due to a problem with adding text to the hullmods image.
Log shows this.
747663 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NoSuchMethodError: com.fs.starfarer.api.ui.TooltipMakerAPI.addImageWithText(F)V
java.lang.NoSuchMethodError: com.fs.starfarer.api.ui.TooltipMakerAPI.addImageWithText(F)V
at data.hullmods.BladeBreakerDefense.addPostDescriptionSection(BladeBreakerDefense.java:53)
at com.fs.starfarer.ui.impl.StandardTooltipV2$12.createImpl(Unknown Source)
at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.create(Unknown Source)
at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.beforeShown(Unknown Source)
at com.fs.starfarer.ui.thissuper.showTooltip(Unknown Source)
Which adds up.
taking a look at the hullmod in question you can see that it imports this.
import com.fs.starfarer.api.ui.TooltipMakerAPI;
and further down where it adds the tooltip/description you have this.
public void addPostDescriptionSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec)
{
float pad = 10f;
float padS = 2f;
tooltip.addSectionHeading("Details", Alignment.MID, pad);
TooltipMakerAPI text = tooltip.beginImageWithText("graphics/ISTL/icons/tooltip/istl_hullmod_defense.png", 40);
text.addPara("- " + getString("BBDefenseDesc1"), pad, Misc.getHighlightColor(), "20%");
text.addPara("- " + getString("BBDefenseDesc2"), padS, Misc.getHighlightColor(), "20%");
text.addPara("- " + getString("BBDefenseDesc3"), padS, Misc.getHighlightColor(), "100%");
tooltip.addImageWithText(pad);
TooltipMakerAPI text2 = tooltip.beginImageWithText("graphics/ISTL/icons/tooltip/istl_hullmod_fighter.png", 40);
text2.addPara("- " + getString("BBDefenseDescFtr"), padS, Misc.getHighlightColor(), "20%");
tooltip.addImageWithText(pad);
}
removing it doesn't help obviously because with no description at all it'll still crash.
I've tried looking at other mods and it seems they're using a different method to show descriptions now
except Diable Avionics does seem to use a method almost exactly the same as this in a couple of hullmods and those do not have the same issue.
So far I've tried to copy the other method but keep coming into roadblocks due to my lack of experience, i will undoubtedly crack it eventually but i was curious if someone more experienced here has a more expedient answer that'll save me some headbanging.
Anyways if you can't help i get it, ill just keep at it.