diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f82e16c..01c0c21 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,35 +1,17 @@ - - - - - + + + - - - - - - - - - - - - - - - - @@ -131,6 +123,7 @@ - \ No newline at end of file diff --git a/jars/StarSectorIndustry.jar b/jars/StarSectorIndustry.jar index 2269eb1..319f1cb 100644 Binary files a/jars/StarSectorIndustry.jar and b/jars/StarSectorIndustry.jar differ diff --git a/src/main/java/com/github/alycecil/econ/impl/AuthoritarianRegime.java b/src/main/java/com/github/alycecil/econ/impl/AuthoritarianRegime.java index c9bed04..7d939db 100644 --- a/src/main/java/com/github/alycecil/econ/impl/AuthoritarianRegime.java +++ b/src/main/java/com/github/alycecil/econ/impl/AuthoritarianRegime.java @@ -7,7 +7,7 @@ //TODO ALERT FACTIONS LUDDIC_*, HEGEMONY, and the League on trade or advance. Quickly causing war. public class AuthoritarianRegime extends SupportInfraGrowsPopulation { - public static final String CRIMES_AGAINST_HUMANITY = "Crimes against humanity."; + public static final String CRIMES_AGAINST_HUMANITY = "Crimes against humanity"; public AuthoritarianRegime() { super(-0.05f, diff --git a/src/main/java/com/github/alycecil/econ/impl/ChopShop.java b/src/main/java/com/github/alycecil/econ/impl/ChopShop.java index eaab9ee..3a80a24 100644 --- a/src/main/java/com/github/alycecil/econ/impl/ChopShop.java +++ b/src/main/java/com/github/alycecil/econ/impl/ChopShop.java @@ -9,7 +9,7 @@ //TODO ALERT FACTIONS LUDDIC_*, HEGEMONY, and the League on trade or advance. Slowly causing war. public class ChopShop extends AddsMarket { - public static final String CRIMES_AGAINST_HUMANITY = "Organ Harvesting."; + public static final String CRIMES_AGAINST_HUMANITY = "Organ Harvesting"; public ChopShop() { super(-0.05f, diff --git a/src/main/java/com/github/alycecil/econ/impl/PoliceState.java b/src/main/java/com/github/alycecil/econ/impl/PoliceState.java index e6f5842..236691a 100644 --- a/src/main/java/com/github/alycecil/econ/impl/PoliceState.java +++ b/src/main/java/com/github/alycecil/econ/impl/PoliceState.java @@ -7,7 +7,7 @@ //TODO ALERT FACTIONS LUDDIC_*, HEGEMONY, and the League on trade or advance. Quickly causing war. public class PoliceState extends SupportInfraGrowsPopulation { - public static final String CRIMES_AGAINST_HUMANITY = "Police state."; + public static final String CRIMES_AGAINST_HUMANITY = "Police state"; public PoliceState() { super(-0.05f, diff --git a/src/main/java/com/github/alycecil/econ/impl/common/PollutingIndustry.java b/src/main/java/com/github/alycecil/econ/impl/common/PollutingIndustry.java index 8bb8f4c..ae4442b 100644 --- a/src/main/java/com/github/alycecil/econ/impl/common/PollutingIndustry.java +++ b/src/main/java/com/github/alycecil/econ/impl/common/PollutingIndustry.java @@ -5,8 +5,7 @@ import com.fs.starfarer.api.ui.TooltipMakerAPI; import com.fs.starfarer.api.util.Misc; import com.github.alycecil.econ.model.IndustryEffect; - -import java.awt.*; +import com.github.alycecil.econ.util.AliceCommon; public abstract class PollutingIndustry extends PopulationAwareExtension { @@ -14,8 +13,6 @@ public abstract class PollutingIndustry extends PopulationAwareExtension { public static float DAYS_BEFORE_POLLUTION = 90f; public static float DAYS_BEFORE_POLLUTION_PERMANENT = 360f; - public static final Color WARNING = Color.YELLOW.darker(); - public PollutingIndustry(IndustryEffect... bonuses) { super(bonuses); } @@ -74,13 +71,13 @@ protected void updatePollutionStatus(boolean add) { protected void addPostSupplySection(TooltipMakerAPI tooltip, boolean hasSupply, IndustryTooltipMode mode) { super.addPostSupplySection(tooltip, hasSupply, mode); if (addedPollution && permaPollution) { - tooltip.addPara("The pollution caused by this industry is %s.", 10f, WARNING, Misc.getHighlightColor(), "PERMANENT"); + tooltip.addPara("The pollution caused by this industry is %s.", 10f, AliceCommon.WARNING, Misc.getHighlightColor(), "PERMANENT"); } else if (addedPollution || market.hasCondition(POLLUTION_ID)) { String daysLeft = String.valueOf(Math.max(0, DAYS_BEFORE_POLLUTION_PERMANENT - daysWithPolluter)); - tooltip.addPara("There are %s days left before the pollution becomes permanent, from this source.", 10f, WARNING, Misc.getHighlightColor(), daysLeft); + tooltip.addPara("There are %s days left before the pollution becomes permanent, from this source.", 10f, AliceCommon.WARNING, Misc.getHighlightColor(), daysLeft); } else if (!market.hasCondition(POLLUTION_ID)) { String daysLeft = String.valueOf(Math.max(0, DAYS_BEFORE_POLLUTION - daysWithPolluter)); - tooltip.addPara("There are %s days left before the pollution becomes a colony issue, from this source.", 10f, WARNING, Misc.getHighlightColor(), daysLeft); + tooltip.addPara("There are %s days left before the pollution becomes a colony issue, from this source.", 10f, AliceCommon.WARNING, Misc.getHighlightColor(), daysLeft); } } diff --git a/src/main/java/com/github/alycecil/econ/impl/common/PopulationAwareExtension.java b/src/main/java/com/github/alycecil/econ/impl/common/PopulationAwareExtension.java index 24d0699..58e7748 100644 --- a/src/main/java/com/github/alycecil/econ/impl/common/PopulationAwareExtension.java +++ b/src/main/java/com/github/alycecil/econ/impl/common/PopulationAwareExtension.java @@ -4,6 +4,8 @@ import com.fs.starfarer.api.ui.TooltipMakerAPI; import com.github.alycecil.econ.model.IndustryEffect; +import java.awt.*; + public abstract class PopulationAwareExtension extends IndustryExtension implements MarketImmigrationModifier { public PopulationAwareExtension(IndustryEffect... bonuses) { super(bonuses); @@ -20,7 +22,9 @@ public void unapply() { } @Override - protected void addPostUpkeepSection(TooltipMakerAPI tooltip, IndustryTooltipMode mode) { - tooltip.addPara("Population Breakdown:\n"+market.getPopulation().toString(), 10f); + protected void addPostSupplySection(TooltipMakerAPI tooltip, boolean hasSupply, IndustryTooltipMode mode) { + super.addPostSupplySection(tooltip, hasSupply, mode); + + tooltip.addPara("Population Breakdown:\n"+market.getPopulation().toString(), Color.lightGray, 10f); } } diff --git a/src/main/java/com/github/alycecil/econ/impl/common/SupportInfraGrowsPopulation.java b/src/main/java/com/github/alycecil/econ/impl/common/SupportInfraGrowsPopulation.java index 76cf542..7ce74c4 100644 --- a/src/main/java/com/github/alycecil/econ/impl/common/SupportInfraGrowsPopulation.java +++ b/src/main/java/com/github/alycecil/econ/impl/common/SupportInfraGrowsPopulation.java @@ -5,13 +5,13 @@ import com.fs.starfarer.api.ui.TooltipMakerAPI; import com.fs.starfarer.api.util.Misc; import com.github.alycecil.econ.model.IndustryEffect; +import com.github.alycecil.econ.util.AliceCommon; import com.github.alycecil.econ.util.Incoming; import java.awt.*; public abstract class SupportInfraGrowsPopulation extends SupportInfrastructure { - public static final Color COLOR = Color.YELLOW.darker(); public SupportInfraGrowsPopulation(float perMarketSize, IndustryEffect... bonuses) { super(perMarketSize, bonuses); @@ -31,7 +31,7 @@ protected void addPostSupplySection(TooltipMakerAPI tooltip, boolean hasSupply, if (value > 0.01f) { tooltip.addPara("Increasing growth rate by %s.", 10f, Misc.getHighlightColor(), String.valueOf(value)); } else if (value < -0.01f) { - tooltip.addPara("Decreasing growth rate by %s.", 10f, COLOR, Misc.getNegativeHighlightColor(), String.valueOf(value)); + tooltip.addPara("Decreasing growth rate by %s.", 10f, AliceCommon.WARNING, Misc.getNegativeHighlightColor(), String.valueOf(value)); } } } diff --git a/src/main/java/com/github/alycecil/econ/model/QuantityCommodityChange.java b/src/main/java/com/github/alycecil/econ/model/QuantityCommodityChange.java index 341b3e0..51bca2d 100644 --- a/src/main/java/com/github/alycecil/econ/model/QuantityCommodityChange.java +++ b/src/main/java/com/github/alycecil/econ/model/QuantityCommodityChange.java @@ -16,7 +16,7 @@ public QuantityCommodityChange(String commodityId, String desc) { @Override public void apply(Industry industry, String modId, float mult) { if (industry == null) return; - String desc = this.desc + industry.getNameForModifier(); + String desc = this.desc +" for "+ industry.getNameForModifier(); MutableCommodityQuantity modifier = getModifier(industry); if (modifier == null) return; MutableStat quantityStat = modifier.getQuantity(); diff --git a/src/main/java/com/github/alycecil/econ/util/AliceCommon.java b/src/main/java/com/github/alycecil/econ/util/AliceCommon.java new file mode 100644 index 0000000..7f40490 --- /dev/null +++ b/src/main/java/com/github/alycecil/econ/util/AliceCommon.java @@ -0,0 +1,7 @@ +package com.github.alycecil.econ.util; + +import java.awt.*; + +public class AliceCommon { + public static final Color WARNING = Color.YELLOW.darker(); +}