22 public void createTooltip(TooltipMakerAPI tooltip,
boolean expanded, Object tooltipParam) {
23 FDNode node = (FDNode) tooltipParam;
36 Color h = Misc.getHighlightColor();
39 Color color = faction.getBaseUIColor();
40 Color dark = faction.getDarkUIColor();
41 Color grid = faction.getGridUIColor();
42 Color bright = faction.getBrightUIColor();
44 if (MonthlyReport.FLEET.equals(node.custom)) {
45 tooltip.addPara(
"Fleet-related income and expenses.", 0);
46 }
else if (MonthlyReport.OUTPOSTS.equals(node.custom)) {
47 tooltip.addPara(
"Colony-related income and expenses.", 0);
48 }
else if (MonthlyReport.PRODUCTION_WEAPONS.equals(node.custom)) {
49 tooltip.addPara(
"Weapons and fighter LPCs installed on produced ships.", 0);
50 }
else if (MonthlyReport.PRODUCTION.equals(node.custom)) {
52 if (node.custom2 instanceof CargoAPI) {
53 CargoAPI cargo = (CargoAPI) node.custom2;
54 if (!cargo.isEmpty()) {
55 tooltip.addSectionHeading(
"Equipment", color, dark, Alignment.MID, currPad);
56 tooltip.showCargo(cargo, 10,
true, opad);
59 List<FleetMemberAPI> ships =
new ArrayList<FleetMemberAPI>();
60 ships.addAll(cargo.getMothballedShips().getMembersListCopy());
61 if (!ships.isEmpty()) {
62 tooltip.addSectionHeading(
"Ships", color, dark, Alignment.MID, currPad);
63 tooltip.showShips(ships, 10,
true, opad);
68 FactionProductionAPI prod = pf.getProduction();
69 int accrued = prod.getAccruedProduction();
71 tooltip.addPara(
"A total of %s worth of production effort has been put into projects that have not yet been " +
72 "completed.", currPad, Misc.getHighlightColor(),
"" + Misc.getDGSCredits(accrued));
75 }
else if (MonthlyReport.STOCKPILING.equals(node.custom)) {
76 if (node.custom2 instanceof CargoAPI) {
77 tooltip.addPara(
"Expenses incurred due to the use of local stockpiles to counter shortages.", 0);
78 CargoAPI cargo = (CargoAPI) node.custom2;
79 if (!cargo.isEmpty()) {
80 tooltip.addSectionHeading(
"Resources", color, dark, Alignment.MID, opad);
81 tooltip.showCargo(cargo, 10,
true, opad);
83 List<FleetMemberAPI> ships =
new ArrayList<FleetMemberAPI>();
84 ships.addAll(cargo.getMothballedShips().getMembersListCopy());
85 if (!ships.isEmpty()) {
86 tooltip.addSectionHeading(
"Ships", color, dark, Alignment.MID, opad);
87 tooltip.showShips(ships, 10,
true, opad);
90 }
else if (MonthlyReport.RESTOCKING.equals(node.custom)) {
91 if (node.custom2 instanceof CargoAPI) {
92 tooltip.addPara(
"Expenses incurred due to the need to restock local stockpiles to replace the resources drawn by your fleet.", 0);
93 CargoAPI cargo = (CargoAPI) node.custom2;
94 if (!cargo.isEmpty()) {
95 tooltip.addSectionHeading(
"Resources", color, dark, Alignment.MID, opad);
96 tooltip.showCargo(cargo, 10,
true, opad);
98 List<FleetMemberAPI> ships =
new ArrayList<FleetMemberAPI>();
99 ships.addAll(cargo.getMothballedShips().getMembersListCopy());
100 if (!ships.isEmpty()) {
101 tooltip.addSectionHeading(
"Ships", color, dark, Alignment.MID, opad);
102 tooltip.showShips(ships, 10,
true, opad);
105 }
else if (MonthlyReport.OFFICERS.equals(node.custom)) {
107 "Each officer receives a base salary of %s credits per month, plus %s credits per officer level.", 0,
108 h, Misc.getWithDGS(officerBase), Misc.getWithDGS(officerPerLevel));
109 }
else if (MonthlyReport.ADMIN.equals(node.custom)) {
112 "Each administrator receives a salary that depends on their skills. " +
113 "When not assigned to govern a colony, their salary is reduced to %s.", 0,
114 Misc.getHighlightColor(),
"" + (
int)Math.round(f * 100f) +
"%");
115 }
else if (MonthlyReport.CREW.equals(node.custom)) {
116 tooltip.addPara(
"Each crew member receives a monthly salary of %s credits.", 0,
117 h, Misc.getWithDGS(crewSalary));
118 }
else if (MonthlyReport.MARINES.equals(node.custom)) {
119 tooltip.addPara(
"Each marine receives a monthly salary of %s credits.", 0,
120 h, Misc.getWithDGS(marineSalary));
121 }
else if (MonthlyReport.LAST_MONTH_DEBT.equals(node.custom)) {
122 tooltip.addPara(
"Unpaid debt carried over from last month.", 0);
123 }
else if (MonthlyReport.INDUSTRIES.equals(node.custom)) {
124 tooltip.addPara(
"Upkeep and income from industries and structures located at the outpost or colony.", 0);
125 }
else if (MonthlyReport.INCENTIVES.equals(node.custom)) {
126 tooltip.addPara(
"Total spent on hazard pay and related growth incentives at the colony during the previous month.", 0);
127 }
else if (MonthlyReport.EXPORTS.equals(node.custom)) {
128 tooltip.addPara(
"Income from out-of-faction exports by this outpost or colony. " +
129 "Smuggling and in-faction exports do not produce income.", 0);
130 }
else if (MonthlyReport.STORAGE.equals(node.custom)) {
134 tooltip.addPara(
"Fees and expenses incurred by storing crew or materiel at a location. Includes rent, security, and other such.", 0);
136 String percent =
"" + (int) (storageFreeFraction * 100f) +
"%";
137 tooltip.addPara(
"The monthly expenses are generally %s of the base value of what's in storage.", 10f, h,
140 tooltip.addPara(
"Storage at a colony under your control does not incur any fees.", 10f);
141 }
else if (node.custom instanceof CommodityOnMarketAPI) {
143 if (node.custom2 instanceof Float) {
144 quantity = (Float) node.custom2;
145 if (quantity < 1) quantity = 1;
147 String units =
"units";
148 if (quantity <= 1) units =
"unit";
149 CommodityOnMarketAPI com = (CommodityOnMarketAPI) node.custom;
150 tooltip.addPara(
"Approximately %s " + units +
" of " + com.getCommodity().getName() +
".", 0f,
151 h, Misc.getWithDGS(quantity));