001package com.fs.starfarer.api.impl.campaign.intel.events; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.ui.TooltipMakerAPI; 006import com.fs.starfarer.api.ui.TooltipMakerAPI.TooltipCreator; 007import com.fs.starfarer.api.ui.UIComponentAPI; 008import com.fs.starfarer.api.util.Misc; 009 010public class BaseEventFactor implements EventFactor { 011 012 public static float TOOLTIP_WIDTH = 400f; 013 014 public int getProgress(BaseEventIntel intel) { 015 return 0; 016 } 017 018 public float getAllProgressMult(BaseEventIntel intel) { 019 return 1f; 020 } 021 022 public boolean shouldShow(BaseEventIntel intel) { 023 return getProgress(intel) != 0; 024 } 025 026 public String getDesc(BaseEventIntel intel) { 027 return null; 028 } 029 030 public String getProgressStr(BaseEventIntel intel) { 031 int p = getProgress(intel); 032 if (p <= 0) return "" + p; 033 return "+" + p; 034 } 035 036 public Color getDescColor(BaseEventIntel intel) { 037 return Misc.getTextColor(); 038 } 039 040 public Color getProgressColor(BaseEventIntel intel) { 041 return intel.getProgressColor(getProgress(intel)); 042 } 043 044 public TooltipCreator getMainRowTooltip(BaseEventIntel intel) { 045 // to make mods that don't implement this method and only implement the older 046 // getMainRowTooltip() with no parameter work 047 return getMainRowTooltip(); 048 } 049 public TooltipCreator getMainRowTooltip() { 050 return null; 051 } 052 053 public boolean isOneTime() { 054 return false; 055 } 056 057 public boolean isExpired() { 058 return false; 059 } 060 061 public void addExtraRows(TooltipMakerAPI info, BaseEventIntel intel) { 062 063 } 064 065 public void notifyEventEnding() { 066 067 } 068 069 public void notifyEventEnded() { 070 071 } 072 073 /** 074 * The first element in the stage info needs to have a before-padding of 5 pixels. 075 * @param info 076 */ 077 public void addBorder(TooltipMakerAPI info, Color c) { 078 float small = 5f; 079 info.addSpacer(small); 080 UIComponentAPI rect = info.createRect(c, 2f); 081 float extra = 0f; 082 extra = 64f + 14f; 083 info.addCustomDoNotSetPosition(rect).getPosition().inTL(-small - extra, 0).setSize( 084 info.getWidthSoFar() + small * 2f + extra + 10f, Math.max(64f, info.getHeightSoFar() + 3f)); 085 } 086 087 public void addBulletPointForOneTimeFactor(BaseEventIntel intel, TooltipMakerAPI info, Color tc, float initPad) { 088 089 } 090 091 public void notifyFactorRemoved() { 092 093 } 094 095 public void advance(float amount) { 096 // TODO Auto-generated method stub 097 098 } 099 100 101}