Skip to content

Commit 69b8723

Browse files
committed
Revert "No map when job_show_distance = none"
This reverts commit e769851.
1 parent 34256c1 commit 69b8723

1 file changed

Lines changed: 74 additions & 73 deletions

File tree

src/org/magiclib/bounty/intel/MagicBountyInfo.kt

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe
543543
}
544544

545545
val location = getLocationIfBountyIsActive()
546-
if (location is StarSystemAPI
547-
&& bountySpec.job_show_distance != ShowDistance.None) {
546+
if (location is StarSystemAPI) {
548547

549548
fun setupSystemParams(params: MapParams, location: StarSystemAPI) {
550549
params.showSystem(location)
@@ -555,88 +554,90 @@ open class MagicBountyInfo(val bountyKey: String, val bountySpec: MagicBountySpe
555554
val w = targetInfoTooltip.widthSoFar
556555
val h = (w / 1.6f).roundToInt().toFloat()
557556

558-
when (bountySpec.job_show_distance) {
559-
ShowDistance.Exact -> {
560-
setupSystemParams(params, location)
561-
562-
targetInfoTooltip.addPara(
563-
createLocationPreciseText(bounty),
564-
10f,
565-
location.lightColor,
566-
bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType
567-
)
568-
}
569-
570-
ShowDistance.System -> {
571-
setupSystemParams(params, location)
557+
if (bountySpec.job_show_distance != ShowDistance.None) {
558+
when (bountySpec.job_show_distance) {
559+
ShowDistance.Exact -> {
560+
setupSystemParams(params, location)
572561

573-
targetInfoTooltip.addPara(
574-
MagicTxt.getString("mb_distance_system"),
575-
10f,
576-
arrayOf(Misc.getTextColor(), location.lightColor),
577-
MagicTxt.getString("mb_distance_they"),
578-
bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType
579-
)
580-
}
562+
targetInfoTooltip.addPara(
563+
createLocationPreciseText(bounty),
564+
10f,
565+
location.lightColor,
566+
bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType
567+
)
568+
}
581569

582-
/*ShowDistance.Vague -> {
583-
params.filterData.names = false
570+
ShowDistance.System -> {
571+
setupSystemParams(params, location)
584572

585-
val distance = bounty.fleetSpawnLocation.containingLocation.location.length()
586-
var vague = MagicTxt.getString("mb_distance_core")
587-
if (distance > MagicVariables.getSectorSize() * 0.6f) {
588-
vague = MagicTxt.getString("mb_distance_far")
589-
} else if (distance > MagicVariables.getSectorSize() * 0.33f) {
590-
vague = MagicTxt.getString("mb_distance_close")
573+
targetInfoTooltip.addPara(
574+
MagicTxt.getString("mb_distance_system"),
575+
10f,
576+
arrayOf(Misc.getTextColor(), location.lightColor),
577+
MagicTxt.getString("mb_distance_they"),
578+
bounty.fleetSpawnLocation.starSystem.nameWithLowercaseType
579+
)
591580
}
592-
targetInfoTooltip.addPara(
593-
MagicTxt.getString("mb_distance_vague"),
594-
10f,
595-
Misc.getTextColor(),
596-
Misc.getHighlightColor(),
597-
vague
598-
)
599-
}*///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.
600581

601-
ShowDistance.Distance -> {
602-
params.filterData.names = false
582+
/*ShowDistance.Vague -> {
583+
params.filterData.names = false
603584
604-
val distanceLY = Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt()
605-
targetInfoTooltip.addPara(
606-
MagicTxt.getString("mb_distance"),
607-
10f,
608-
Misc.getTextColor(),
609-
Misc.getHighlightColor(),
610-
distanceLY.toString()
611-
)
612-
}
585+
val distance = bounty.fleetSpawnLocation.containingLocation.location.length()
586+
var vague = MagicTxt.getString("mb_distance_core")
587+
if (distance > MagicVariables.getSectorSize() * 0.6f) {
588+
vague = MagicTxt.getString("mb_distance_far")
589+
} else if (distance > MagicVariables.getSectorSize() * 0.33f) {
590+
vague = MagicTxt.getString("mb_distance_close")
591+
}
592+
targetInfoTooltip.addPara(
593+
MagicTxt.getString("mb_distance_vague"),
594+
10f,
595+
Misc.getTextColor(),
596+
Misc.getHighlightColor(),
597+
vague
598+
)
599+
}*///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.
613600

614-
else -> {
615-
val constellation = location.constellation
616-
if(constellation != null) {
617-
//Show constellation
618-
params.filterData.constellations = true
601+
ShowDistance.Distance -> {
619602
params.filterData.names = false
620-
params.showConsellations = setOf(constellation)
621-
params.smallConstellations = true
622-
623-
//Point towards center of constellation
624-
val token = createConstellationCenterToken(constellation)
625-
if (token != null) {
626-
params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token))
627-
params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace))
628-
}
629603

630-
} else {
631-
setupSystemParams(params, location)
604+
val distance = Misc.getDistanceLY(Global.getSector().playerFleet, bounty.fleetSpawnLocation).roundToInt()
605+
targetInfoTooltip.addPara(
606+
MagicTxt.getString("mb_distance"),
607+
10f,
608+
Misc.getTextColor(),
609+
Misc.getHighlightColor(),
610+
distance.toString()
611+
)
632612
}
633613

634-
targetInfoTooltip.addPara(
635-
createLocationEstimateText(bounty),
636-
10f,
637-
location.lightColor,
638-
BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false)
639-
)
614+
else -> {
615+
val constellation = location.constellation
616+
if(constellation != null) {
617+
//Show constellation
618+
params.filterData.constellations = true
619+
params.filterData.names = false
620+
params.showConsellations = setOf(constellation)
621+
params.smallConstellations = true
622+
623+
//Point towards center of constellation
624+
val token = createConstellationCenterToken(constellation)
625+
if (token != null) {
626+
params.arrows.add(IntelInfoPlugin.ArrowData(Global.getSector().playerFleet, token))
627+
params.markers = listOf(MarkerData(token.location, Global.getSector().hyperspace))
628+
}
629+
630+
} else {
631+
setupSystemParams(params, location)
632+
}
633+
634+
targetInfoTooltip.addPara(
635+
createLocationEstimateText(bounty),
636+
10f,
637+
location.lightColor,
638+
BreadcrumbSpecial.getLocationDescription(bounty.fleetSpawnLocation, false)
639+
)
640+
}
640641
}
641642
}
642643

0 commit comments

Comments
 (0)