Starsector API
Loading...
Searching...
No Matches
BaseEventFactor.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.events;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.ui.TooltipMakerAPI;
6import com.fs.starfarer.api.ui.TooltipMakerAPI.TooltipCreator;
7import com.fs.starfarer.api.ui.UIComponentAPI;
8import com.fs.starfarer.api.util.Misc;
9
10public class BaseEventFactor implements EventFactor {
11
12 public static float TOOLTIP_WIDTH = 400f;
13
14 public int getProgress(BaseEventIntel intel) {
15 return 0;
16 }
17
18 public float getAllProgressMult(BaseEventIntel intel) {
19 return 1f;
20 }
21
22 public boolean shouldShow(BaseEventIntel intel) {
23 return getProgress(intel) != 0;
24 }
25
26 public String getDesc(BaseEventIntel intel) {
27 return null;
28 }
29
30 public String getProgressStr(BaseEventIntel intel) {
31 int p = getProgress(intel);
32 if (p <= 0) return "" + p;
33 return "+" + p;
34 }
35
36 public Color getDescColor(BaseEventIntel intel) {
37 return Misc.getTextColor();
38 }
39
40 public Color getProgressColor(BaseEventIntel intel) {
41 return intel.getProgressColor(getProgress(intel));
42 }
43
44 public TooltipCreator getMainRowTooltip(BaseEventIntel intel) {
45 // to make mods that don't implement this method and only implement the older
46 // getMainRowTooltip() with no parameter work
47 return getMainRowTooltip();
48 }
49 public TooltipCreator getMainRowTooltip() {
50 return null;
51 }
52
53 public boolean isOneTime() {
54 return false;
55 }
56
57 public boolean isExpired() {
58 return false;
59 }
60
61 public void addExtraRows(TooltipMakerAPI info, BaseEventIntel intel) {
62
63 }
64
65 public void notifyEventEnding() {
66
67 }
68
69 public void notifyEventEnded() {
70
71 }
72
77 public void addBorder(TooltipMakerAPI info, Color c) {
78 float small = 5f;
79 info.addSpacer(small);
80 UIComponentAPI rect = info.createRect(c, 2f);
81 float extra = 0f;
82 extra = 64f + 14f;
83 info.addCustomDoNotSetPosition(rect).getPosition().inTL(-small - extra, 0).setSize(
84 info.getWidthSoFar() + small * 2f + extra + 10f, Math.max(64f, info.getHeightSoFar() + 3f));
85 }
86
87 public void addBulletPointForOneTimeFactor(BaseEventIntel intel, TooltipMakerAPI info, Color tc, float initPad) {
88
89 }
90
91 public void notifyFactorRemoved() {
92
93 }
94
95 public void advance(float amount) {
96 // TODO Auto-generated method stub
97
98 }
99
100
101}
void addBulletPointForOneTimeFactor(BaseEventIntel intel, TooltipMakerAPI info, Color tc, float initPad)
void addExtraRows(TooltipMakerAPI info, BaseEventIntel intel)