Starsector API
Loading...
Searching...
No Matches
IndustryOptionProvider.java
Go to the documentation of this file.
1package com.fs.starfarer.api.campaign.listeners;
2
3import java.awt.Color;
4import java.util.List;
5
6import com.fs.starfarer.api.campaign.econ.Industry;
7import com.fs.starfarer.api.campaign.econ.Industry.IndustryTooltipMode;
8import com.fs.starfarer.api.ui.TooltipMakerAPI;
9import com.fs.starfarer.api.util.Misc;
10
11public interface IndustryOptionProvider {
12
13 public class IndustryOptionData {
14 public String text;
15 public Color color;
16 public boolean enabled = true;
17 public Object id;
18 public Industry ind;
20
21
22 public IndustryOptionData(String text, Object id, Industry ind, IndustryOptionProvider provider) {
23 this.text = text;
24 this.id = id;
25 this.ind = ind;
26 this.provider = provider;
27
28 if (ind.getMarket() != null) {
29 color = ind.getMarket().getFaction().getBaseUIColor();
30 } else {
31 color = Misc.getBasePlayerColor();
32 }
33 }
34 }
35
36 public List<IndustryOptionData> getIndustryOptions(Industry ind);
37 public void createTooltip(IndustryOptionData opt, TooltipMakerAPI tooltip, float width);
38
40 public void addToIndustryTooltip(Industry ind, IndustryTooltipMode mode, TooltipMakerAPI tooltip, float width, boolean expanded);
41}
42
43
44
45
46
47
48
49
IndustryOptionData(String text, Object id, Industry ind, IndustryOptionProvider provider)
List< IndustryOptionData > getIndustryOptions(Industry ind)
void createTooltip(IndustryOptionData opt, TooltipMakerAPI tooltip, float width)
void addToIndustryTooltip(Industry ind, IndustryTooltipMode mode, TooltipMakerAPI tooltip, float width, boolean expanded)
void optionSelected(IndustryOptionData opt, DialogCreatorUI ui)