From f11e7e7421061e16bbdf0ddefd9ae1c7ad5a5bfb Mon Sep 17 00:00:00 2001 From: S-Numan Date: Tue, 10 Jun 2025 23:31:18 -0700 Subject: [PATCH 1/3] Moderate Bounty Board Revamp Took into account the `job_show_distance` "distance" setting. Removed AssassinationMagicBountyInfo and added into MagicBountyInfo. (why does that class exist anyway?) Handle position of bounty shown to user properly. E.G, no arrow and name showing the destination when only the constellation should be showing, like vanilla! Plot course now follows the above as well. When job_show_distance is "None" or "Distance", plot course is removed entirely. --- src/org/magiclib/bounty/MagicBountyIntel.java | 13 +- .../intel/AssassinationMagicBountyInfo.kt | 98 --------- .../bounty/intel/MagicBountyBoardProvider.kt | 3 - .../magiclib/bounty/intel/MagicBountyInfo.kt | 203 ++++++++++++++---- 4 files changed, 174 insertions(+), 143 deletions(-) delete mode 100644 src/org/magiclib/bounty/intel/AssassinationMagicBountyInfo.kt diff --git a/src/org/magiclib/bounty/MagicBountyIntel.java b/src/org/magiclib/bounty/MagicBountyIntel.java index 3e944d3b..8f2e6d0f 100644 --- a/src/org/magiclib/bounty/MagicBountyIntel.java +++ b/src/org/magiclib/bounty/MagicBountyIntel.java @@ -426,6 +426,13 @@ public void createSmallDescription(TooltipMakerAPI info, float width, float heig Misc.ucFirst(MagicBountyUtilsInternal.getPronoun(bounty.getCaptain())), bounty.getFleetSpawnLocation().getStarSystem().getNameWithLowercaseType()); break; + case Distance: + info.addPara(MagicTxt.getString("mb_distance"), + 10f, + Misc.getTextColor(), + Misc.getHighlightColor(), + Math.round(Misc.getDistanceLY(Global.getSector().getPlayerFleet(), bounty.getFleetSpawnLocation())) + ""); + break; default: info.addPara(MagicBountyUtilsInternal.createLocationEstimateText(bounty), 10f); break; @@ -459,8 +466,10 @@ public SectorEntityToken getMapLocation(SectorMapAPI map) { case Exact: case System: return hideoutLocation; -// case None: -// return null; NOPE, the icon should always be placed somewhere otherwise there is no way to get the location information again. + //case Vague: + case Distance: + case None: + return Global.getSector().getPlayerFleet(); default: // From PersonBountyIntel.getMapLocation Constellation c = hideoutLocation.getConstellation(); diff --git a/src/org/magiclib/bounty/intel/AssassinationMagicBountyInfo.kt b/src/org/magiclib/bounty/intel/AssassinationMagicBountyInfo.kt deleted file mode 100644 index c215da3d..00000000 --- a/src/org/magiclib/bounty/intel/AssassinationMagicBountyInfo.kt +++ /dev/null @@ -1,98 +0,0 @@ -package org.magiclib.bounty.intel - -import com.fs.starfarer.api.Global -import com.fs.starfarer.api.campaign.StarSystemAPI -import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin -import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special.BreadcrumbSpecial -import com.fs.starfarer.api.ui.CustomPanelAPI -import com.fs.starfarer.api.ui.MapParams -import com.fs.starfarer.api.ui.TooltipMakerAPI -import com.fs.starfarer.api.util.Misc -import org.magiclib.bounty.MagicBountyLoader -import org.magiclib.bounty.MagicBountySpec -import org.magiclib.kotlin.ucFirst -import org.magiclib.util.MagicTxt -import java.awt.Color -import kotlin.math.roundToInt - -class AssassinationMagicBountyInfo(bountyKey: String, bountySpec: MagicBountySpec) : - MagicBountyInfo(bountyKey, bountySpec) { - override fun showTargetInfo(panel: CustomPanelAPI, width: Float, height: Float): TooltipMakerAPI { - val targetInfoTooltip = panel.createUIElement(width, height, true) - val childPanelWidth = width - 16f - val activeBountyLocal = activeBounty ?: return targetInfoTooltip - - if (bountySpec.job_show_captain) { - val portrait = targetInfoTooltip.beginImageWithText(getJobIcon(), 64f) - var displayName = activeBountyLocal.fleet.commander.nameString - val targetFirstName = activeBountyLocal.captain.name.first - val targetLastName = activeBountyLocal.captain.name.last - if (targetFirstName != null || targetLastName != null) { - displayName = "$targetFirstName $targetLastName" - if (targetFirstName == null || targetFirstName.isEmpty()) - displayName = targetLastName - else if (targetLastName == null || targetLastName.isEmpty()) - displayName = targetFirstName - } - portrait.addPara(displayName, activeBountyLocal.targetFactionTextColor, 0f) - portrait.addPara(activeBountyLocal.fleet.commander.rank.ucFirst(), 2f) - targetInfoTooltip.addImageWithText(0f) - } - - val location = getLocationIfBountyIsActive() - if (location is StarSystemAPI) { - val params = MapParams() - params.showSystem(location) - val w = targetInfoTooltip.widthSoFar - val h = (w / 1.6f).roundToInt().toFloat() - params.positionToShowAllMarkersAndSystems(false, w.coerceAtMost(h)) - params.filterData.fuel = true - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) - - val map = targetInfoTooltip.createSectorMap(childPanelWidth, 200f, params, null) - targetInfoTooltip.addCustom(map, 4f) - - if (bountySpec.job_show_distance != MagicBountyLoader.ShowDistance.None) { - when (bountySpec.job_show_distance) { - MagicBountyLoader.ShowDistance.Exact -> targetInfoTooltip.addPara( - createLocationPreciseText(activeBounty!!), - 10f, - location.lightColor, - activeBounty!!.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) - - MagicBountyLoader.ShowDistance.System -> targetInfoTooltip.addPara( - MagicTxt.getString("mb_distance_system"), - 10f, - arrayOf(Misc.getTextColor(), location.lightColor), - MagicTxt.getString("mb_distance_they"), - activeBounty!!.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) - - else -> targetInfoTooltip.addPara( - createLocationEstimateText(activeBounty!!), - 10f, - location.lightColor, - BreadcrumbSpecial.getLocationDescription(activeBounty!!.fleetSpawnLocation, false) - ) - } - } - } else { - targetInfoTooltip.setButtonFontOrbitron20Bold() - targetInfoTooltip.addPara(MagicTxt.getString("mb_descLocationUnknown"), 3f, Color.RED).position.inTMid(2f) - } - - activeBounty?.let { - showFleet(targetInfoTooltip, childPanelWidth, it) - - if (it.spec.job_show_captain) { - targetInfoTooltip.addPara(MagicTxt.getString("mb_hvb_skillsHeader"), 8f) - targetInfoTooltip.addSkillPanel(it.captain, 2f) - } - } - - panel.addUIElement(targetInfoTooltip).inTL(0f, 0f) - - return targetInfoTooltip - } -} \ No newline at end of file diff --git a/src/org/magiclib/bounty/intel/MagicBountyBoardProvider.kt b/src/org/magiclib/bounty/intel/MagicBountyBoardProvider.kt index e3a1f90f..e479964a 100644 --- a/src/org/magiclib/bounty/intel/MagicBountyBoardProvider.kt +++ b/src/org/magiclib/bounty/intel/MagicBountyBoardProvider.kt @@ -9,9 +9,6 @@ class MagicBountyBoardProvider: BountyBoardProvider { .entries .distinctBy { it.key } .map { (key, spec) -> - if (spec.job_type == MagicBountyLoader.JobType.Assassination) - AssassinationMagicBountyInfo(key, spec) - else MagicBountyInfo(key, spec) } } diff --git a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt index c5a4d29e..eac688f5 100644 --- a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt +++ b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt @@ -2,17 +2,16 @@ package org.magiclib.bounty.intel import com.fs.starfarer.api.Global import com.fs.starfarer.api.campaign.LocationAPI +import com.fs.starfarer.api.campaign.SectorEntityToken import com.fs.starfarer.api.campaign.StarSystemAPI import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin -import com.fs.starfarer.api.campaign.rules.MemoryAPI import com.fs.starfarer.api.fleet.FleetMemberAPI import com.fs.starfarer.api.impl.campaign.ids.Factions +import com.fs.starfarer.api.impl.campaign.procgen.Constellation import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special.BreadcrumbSpecial -import com.fs.starfarer.api.ui.CustomPanelAPI -import com.fs.starfarer.api.ui.LabelAPI -import com.fs.starfarer.api.ui.MapParams -import com.fs.starfarer.api.ui.TooltipMakerAPI +import com.fs.starfarer.api.ui.* import com.fs.starfarer.api.util.Misc +import org.lwjgl.util.vector.Vector2f import org.magiclib.bounty.ActiveBounty import org.magiclib.bounty.MagicBountyCoordinator import org.magiclib.bounty.MagicBountyLoader.* @@ -20,11 +19,13 @@ import org.magiclib.bounty.MagicBountySpec import org.magiclib.bounty.MagicBountyUtilsInternal import org.magiclib.bounty.ui.InteractiveUIPanelPlugin import org.magiclib.kotlin.setAlpha +import org.magiclib.kotlin.ucFirst import org.magiclib.util.MagicCampaign import org.magiclib.util.MagicTxt import java.awt.Color import kotlin.math.ceil import kotlin.math.roundToInt +import kotlin.text.isEmpty open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpec) : BountyInfo { val activeBounty: ActiveBounty? @@ -278,13 +279,31 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe BountyBoardIntelPlugin.refreshPanel(this) } } else if (activeBountyLocal.stage == ActiveBounty.Stage.Accepted) { - val courseButton = - actionTooltip.addButton(MagicTxt.getString("mb_plot_course"), null, rightPanelWidth, 24f, 0f) - rightPanelPlugin.addButton(courseButton) { - courseButton.isChecked = false - Global.getSector().layInCourseFor( - Misc.getDistressJumpPoint(activeBountyLocal.fleet.containingLocation as StarSystemAPI) - ) + + //Add plot course button if there is a clear destination + val dis = activeBountyLocal.spec.job_show_distance + if(dis != ShowDistance.Distance && dis != ShowDistance.None// && dis != ShowDistance.Vague + ) { + + var location: SectorEntityToken? = null + if(dis == ShowDistance.Exact || dis == ShowDistance.System) { + location = Misc.getDistressJumpPoint(activeBountyLocal.fleet.containingLocation as StarSystemAPI) + } else { + val constellation = activeBountyLocal.fleet.constellation + if(constellation != null) + location = createConstellationCenterToken(constellation) + } + + if(location != null) { + val courseButton = + actionTooltip.addButton(MagicTxt.getString("mb_plot_course"), null, rightPanelWidth, 24f, 0f) + rightPanelPlugin.addButton(courseButton) { + courseButton.isChecked = false + Global.getSector().layInCourseFor( + location + ) + } + } } } @@ -455,45 +474,128 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe val targetInfoTooltip = panel.createUIElement(width, height, true) val childPanelWidth = width - 16f + val bounty = activeBounty!! + + if (bountySpec.job_type == JobType.Assassination && bountySpec.job_show_captain) { + val portrait = targetInfoTooltip.beginImageWithText(getJobIcon(), 64f) + var displayName = bounty.fleet.commander.nameString + val targetFirstName = bounty.captain.name.first + val targetLastName = bounty.captain.name.last + if (targetFirstName != null || targetLastName != null) { + displayName = "$targetFirstName $targetLastName" + if (targetFirstName == null || targetFirstName.isEmpty()) + displayName = targetLastName + else if (targetLastName == null || targetLastName.isEmpty()) + displayName = targetFirstName + } + portrait.addPara(displayName, bounty.targetFactionTextColor, 0f) + portrait.addPara(bounty.fleet.commander.rank.ucFirst(), 2f) + targetInfoTooltip.addImageWithText(0f) + } + val location = getLocationIfBountyIsActive() if (location is StarSystemAPI) { + val params = MapParams() - params.showSystem(location) val w = targetInfoTooltip.widthSoFar val h = (w / 1.6f).roundToInt().toFloat() - params.positionToShowAllMarkersAndSystems(false, w.coerceAtMost(h)) - params.filterData.fuel = true - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) - - val map = targetInfoTooltip.createSectorMap(childPanelWidth, 200f, params, null) - targetInfoTooltip.addCustom(map, 2f) if (bountySpec.job_show_distance != ShowDistance.None) { - val bounty = activeBounty!! when (bountySpec.job_show_distance) { - ShowDistance.Exact -> targetInfoTooltip.addPara( - createLocationPreciseText(bounty), - 10f, - location.lightColor, - bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) + ShowDistance.Exact -> { + params.showSystem(location) + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + + targetInfoTooltip.addPara( + createLocationPreciseText(bounty), + 10f, + location.lightColor, + bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType + ) + } - ShowDistance.System -> targetInfoTooltip.addPara( - MagicTxt.getString("mb_distance_system"), - 10f, - arrayOf(Misc.getTextColor(), location.lightColor), - MagicTxt.getString("mb_distance_they"), - bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) + ShowDistance.System -> { + params.showSystem(location) + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance_system"), + 10f, + arrayOf(Misc.getTextColor(), location.lightColor), + MagicTxt.getString("mb_distance_they"), + bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType + ) + } - else -> targetInfoTooltip.addPara( - createLocationEstimateText(bounty), - 10f, - location.lightColor, - BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false) - ) + /*ShowDistance.Vague -> { + params.filterData.names = false + + val distance = bounty.fleetSpawnLocation.containingLocation.location.length() + var vague = MagicTxt.getString("mb_distance_core") + if (distance > MagicVariables.getSectorSize() * 0.6f) { + vague = MagicTxt.getString("mb_distance_far") + } else if (distance > MagicVariables.getSectorSize() * 0.33f) { + vague = MagicTxt.getString("mb_distance_close") + } + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance_vague"), + 10f, + Misc.getTextColor(), + Misc.getHighlightColor(), + vague + ) + }*///Commented out due to seeming to be a bad mechanic with the current implementation of the bounty board. Given pre-existing use of it in some mods (such as Seeker), enabling this on an update may cause issues for some users. + + ShowDistance.Distance -> { + params.filterData.names = false + + targetInfoTooltip.addPara(MagicTxt.getString("mb_distance"), + 10f, + Misc.getTextColor(), + Misc.getHighlightColor(), + Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt().toString()); + } + + else -> { + val constellation = location.constellation + if(constellation != null) { + //Show constellation + params.filterData.constellations = true + params.filterData.names = false + params.showConsellations = setOf(constellation) + params.smallConstellations = true + + //Point towards center of constellation + val token = createConstellationCenterToken(constellation) + if (token != null) { + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token)) + + params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace)) + } + + } else { + params.showSystem(location) + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + } + + targetInfoTooltip.addPara( + createLocationEstimateText(bounty), + 10f, + location.lightColor, + BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false) + ) + } } } + + params.positionToShowAllMarkersAndSystems(false, w.coerceAtMost(h)) + params.markers = null//Markers are purely for positioning the camera. Don't render them. + + params.filterData.fuel = true + + val map = targetInfoTooltip.createSectorMap(childPanelWidth, 200f, params, null) + targetInfoTooltip.addCustom(map, 2f) + } else { targetInfoTooltip.setButtonFontOrbitron20Bold() targetInfoTooltip.addPara(MagicTxt.getString("mb_descLocationUnknown"), 3f, Color.RED).position.inTMid(2f) @@ -793,4 +895,25 @@ fun ActiveBounty.calculateCreditReward(): Float? { MagicBountyCoordinator.getInstance().preScalingCreditRewardMultiplier, MagicBountyCoordinator.getInstance().postScalingCreditRewardMultiplier ) -} \ No newline at end of file +} + +fun getConstellationSystemsCenter(constellation: Constellation): Vector2f? { + val systems = constellation.systems + if (systems.isEmpty()) return null + + val total = Vector2f(0f, 0f) + for (system in systems) { + Vector2f.add(total, system.location, total) + } + + total.scale(1f / systems.size) + return total +} + +fun createConstellationCenterToken(constellation: Constellation): SectorEntityToken? { + val center = getConstellationSystemsCenter(constellation) ?: return null + val hyperspace = Global.getSector().hyperspace + + // Create a temporary token at the calculated position + return hyperspace.createToken(center.x, center.y) +} From 35831eabdbfe1f5f93448f01fc0133c4f085ab7c Mon Sep 17 00:00:00 2001 From: S-Numan Date: Fri, 13 Jun 2025 21:15:14 -0700 Subject: [PATCH 2/3] Cleaning up a bit --- .../magiclib/bounty/intel/MagicBountyInfo.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt index eac688f5..58b52ff3 100644 --- a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt +++ b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt @@ -496,6 +496,11 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe val location = getLocationIfBountyIsActive() if (location is StarSystemAPI) { + fun setupSystemParams(params: MapParams, location: StarSystemAPI) { + params.showSystem(location) + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + } + val params = MapParams() val w = targetInfoTooltip.widthSoFar val h = (w / 1.6f).roundToInt().toFloat() @@ -503,8 +508,7 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe if (bountySpec.job_show_distance != ShowDistance.None) { when (bountySpec.job_show_distance) { ShowDistance.Exact -> { - params.showSystem(location) - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + setupSystemParams(params, location) targetInfoTooltip.addPara( createLocationPreciseText(bounty), @@ -515,8 +519,7 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe } ShowDistance.System -> { - params.showSystem(location) - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + setupSystemParams(params, location) targetInfoTooltip.addPara( MagicTxt.getString("mb_distance_system"), @@ -549,11 +552,14 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe ShowDistance.Distance -> { params.filterData.names = false - targetInfoTooltip.addPara(MagicTxt.getString("mb_distance"), + val distance = Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt() + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance"), 10f, Misc.getTextColor(), Misc.getHighlightColor(), - Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt().toString()); + distance.toString() + ) } else -> { @@ -569,13 +575,11 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe val token = createConstellationCenterToken(constellation) if (token != null) { params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token)) - params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace)) } } else { - params.showSystem(location) - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, location.center)) + setupSystemParams(params, location) } targetInfoTooltip.addPara( From e7698512086672e0f52b16483cfbea69f5fef9e2 Mon Sep 17 00:00:00 2001 From: S-Numan Date: Fri, 13 Jun 2025 23:18:43 -0700 Subject: [PATCH 3/3] No map when job_show_distance = none --- .../magiclib/bounty/intel/MagicBountyInfo.kt | 147 +++++++++--------- 1 file changed, 73 insertions(+), 74 deletions(-) diff --git a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt index 58b52ff3..9ce8e30b 100644 --- a/src/org/magiclib/bounty/intel/MagicBountyInfo.kt +++ b/src/org/magiclib/bounty/intel/MagicBountyInfo.kt @@ -494,7 +494,8 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe } val location = getLocationIfBountyIsActive() - if (location is StarSystemAPI) { + if (location is StarSystemAPI + && bountySpec.job_show_distance != ShowDistance.None) { fun setupSystemParams(params: MapParams, location: StarSystemAPI) { params.showSystem(location) @@ -505,90 +506,88 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe val w = targetInfoTooltip.widthSoFar val h = (w / 1.6f).roundToInt().toFloat() - if (bountySpec.job_show_distance != ShowDistance.None) { - when (bountySpec.job_show_distance) { - ShowDistance.Exact -> { - setupSystemParams(params, location) + when (bountySpec.job_show_distance) { + ShowDistance.Exact -> { + setupSystemParams(params, location) - targetInfoTooltip.addPara( - createLocationPreciseText(bounty), - 10f, - location.lightColor, - bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) - } + targetInfoTooltip.addPara( + createLocationPreciseText(bounty), + 10f, + location.lightColor, + bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType + ) + } - ShowDistance.System -> { - setupSystemParams(params, location) + ShowDistance.System -> { + setupSystemParams(params, location) - targetInfoTooltip.addPara( - MagicTxt.getString("mb_distance_system"), - 10f, - arrayOf(Misc.getTextColor(), location.lightColor), - MagicTxt.getString("mb_distance_they"), - bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType - ) - } + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance_system"), + 10f, + arrayOf(Misc.getTextColor(), location.lightColor), + MagicTxt.getString("mb_distance_they"), + bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType + ) + } - /*ShowDistance.Vague -> { - params.filterData.names = false + /*ShowDistance.Vague -> { + params.filterData.names = false - val distance = bounty.fleetSpawnLocation.containingLocation.location.length() - var vague = MagicTxt.getString("mb_distance_core") - if (distance > MagicVariables.getSectorSize() * 0.6f) { - vague = MagicTxt.getString("mb_distance_far") - } else if (distance > MagicVariables.getSectorSize() * 0.33f) { - vague = MagicTxt.getString("mb_distance_close") - } - targetInfoTooltip.addPara( - MagicTxt.getString("mb_distance_vague"), - 10f, - Misc.getTextColor(), - Misc.getHighlightColor(), - vague - ) - }*///Commented out due to seeming to be a bad mechanic with the current implementation of the bounty board. Given pre-existing use of it in some mods (such as Seeker), enabling this on an update may cause issues for some users. + val distance = bounty.fleetSpawnLocation.containingLocation.location.length() + var vague = MagicTxt.getString("mb_distance_core") + if (distance > MagicVariables.getSectorSize() * 0.6f) { + vague = MagicTxt.getString("mb_distance_far") + } else if (distance > MagicVariables.getSectorSize() * 0.33f) { + vague = MagicTxt.getString("mb_distance_close") + } + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance_vague"), + 10f, + Misc.getTextColor(), + Misc.getHighlightColor(), + vague + ) + }*///Commented out due to seeming to be a bad mechanic with the current implementation of the bounty board. Given pre-existing use of it in some mods (such as Seeker), enabling this on an update may cause issues for some users. - ShowDistance.Distance -> { - params.filterData.names = false + ShowDistance.Distance -> { + params.filterData.names = false - val distance = Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt() - targetInfoTooltip.addPara( - MagicTxt.getString("mb_distance"), - 10f, - Misc.getTextColor(), - Misc.getHighlightColor(), - distance.toString() - ) - } + val distanceLY = Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt() + targetInfoTooltip.addPara( + MagicTxt.getString("mb_distance"), + 10f, + Misc.getTextColor(), + Misc.getHighlightColor(), + distanceLY.toString() + ) + } - else -> { - val constellation = location.constellation - if(constellation != null) { - //Show constellation - params.filterData.constellations = true - params.filterData.names = false - params.showConsellations = setOf(constellation) - params.smallConstellations = true - - //Point towards center of constellation - val token = createConstellationCenterToken(constellation) - if (token != null) { - params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token)) - params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace)) - } - - } else { - setupSystemParams(params, location) + else -> { + val constellation = location.constellation + if(constellation != null) { + //Show constellation + params.filterData.constellations = true + params.filterData.names = false + params.showConsellations = setOf(constellation) + params.smallConstellations = true + + //Point towards center of constellation + val token = createConstellationCenterToken(constellation) + if (token != null) { + params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token)) + params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace)) } - targetInfoTooltip.addPara( - createLocationEstimateText(bounty), - 10f, - location.lightColor, - BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false) - ) + } else { + setupSystemParams(params, location) } + + targetInfoTooltip.addPara( + createLocationEstimateText(bounty), + 10f, + location.lightColor, + BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false) + ) } }