Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alycecil committed Sep 10, 2021
1 parent 3b25af9 commit 7be4df6
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 40 deletions.
43 changes: 18 additions & 25 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified jars/StarSectorIndustry.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/alycecil/econ/impl/ChopShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
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 {
public static String POLLUTION_ID = Conditions.POLLUTION;
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);
}
Expand Down Expand Up @@ -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);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/github/alycecil/econ/util/AliceCommon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.github.alycecil.econ.util;

import java.awt.*;

public class AliceCommon {
public static final Color WARNING = Color.YELLOW.darker();
}

0 comments on commit 7be4df6

Please sign in to comment.