1package com.fs.starfarer.api.impl.campaign.intel;
6import org.lwjgl.input.Keyboard;
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.FactionAPI;
10import com.fs.starfarer.api.campaign.InteractionDialogAPI;
11import com.fs.starfarer.api.campaign.SectorEntityToken;
12import com.fs.starfarer.api.campaign.TextPanelAPI;
13import com.fs.starfarer.api.impl.campaign.ids.Factions;
14import com.fs.starfarer.api.impl.campaign.ids.Tags;
15import com.fs.starfarer.api.impl.campaign.intel.events.LuddicChurchHostileActivityFactor;
16import com.fs.starfarer.api.impl.campaign.rulecmd.HA_CMD;
17import com.fs.starfarer.api.ui.ButtonAPI;
18import com.fs.starfarer.api.ui.IntelUIAPI;
19import com.fs.starfarer.api.ui.SectorMapAPI;
20import com.fs.starfarer.api.ui.TooltipMakerAPI;
21import com.fs.starfarer.api.util.Misc;
25 public static enum AgreementEndingType {
31 public static String
KEY =
"$luddicChurchDeal_ref";
41 protected AgreementEndingType
endType =
null;
47 LuddicChurchHostileActivityFactor.setMadeDeal(
true);
49 TextPanelAPI text =
null;
50 if (dialog !=
null) text = dialog.getTextPanel();
59 HA_CMD.avertOrEndKOLTakeoverAsNecessary();
66 LuddicChurchHostileActivityFactor.setMadeDeal(
false);
80 return "Luddic Church Immigration Controls";
117 Color h = Misc.getHighlightColor();
118 Color g = Misc.getGrayColor();
123 if (mode == ListInfoMode.IN_DESC) initPad = opad;
141 Color h = Misc.getHighlightColor();
142 Color g = Misc.getGrayColor();
143 Color tc = Misc.getTextColor();
147 info.addImage(
getFaction().getLogo(), width, 128, opad);
150 info.addPara(
"You are no longer abiding by your agreement with the Luddic Church.", opad);
154 info.addPara(
"You've made an agreement with the Luddic Church, curtailing "
155 +
"excessive immigration from their worlds. In exchange, the Knights of Ludd \"protector\" "
156 +
"fleets no longer operate in your volume.",
157 opad,
faction.getBaseUIColor(),
"Luddic Church",
"Knights of Ludd");
159 info.addPara(
"You can end this agreement, but there "
160 +
"would be no possibility of re-negotiating a similar agreement after "
161 +
"demonstrating such faithlessness.", opad);
163 ButtonAPI button = info.addButton(
"End the agreement",
BUTTON_END,
165 (
int)(width), 20f, opad * 1f);
166 button.setShortcut(Keyboard.KEY_U,
true);
176 Set<String> tags = super.getIntelTags(map);
177 tags.add(Tags.INTEL_AGREEMENTS);
197 public void endAgreement(AgreementEndingType type, InteractionDialogAPI dialog) {
204 if (dialog !=
null) {
205 sendUpdate(
new Object(), dialog.getTextPanel());
208 if (type == AgreementEndingType.BROKEN) {
209 LuddicChurchHostileActivityFactor.setBrokeDeal(
true);
210 Misc.incrUntrustwortyCount();
211 TextPanelAPI text = dialog ==
null ? null : dialog.getTextPanel();
223 super.buttonPressConfirmed(buttonId, ui);
230 prompt.addPara(
"You can end this agreement, but taking this action would "
231 +
"hurt your standing with the %s, and there "
232 +
"would be no possibility of re-negotiating a similar agreement after "
233 +
"demonstrating such faithlessness.", 0f,
244 return super.doesButtonHaveConfirmDialog(buttonId);
static SettingsAPI getSettings()
static SectorAPI getSector()
boolean isSendingUpdate()
void sendUpdate(Object listInfoParam, TextPanelAPI textPanel)
void unindent(TooltipMakerAPI info)
Object getListInfoParam()
Color getBulletColorForMode(ListInfoMode mode)
void setImportant(Boolean important)
void bullet(TooltipMakerAPI info)
String getSmallDescriptionTitle()
static float REP_FOR_BREAKING_DEAL
boolean doesButtonHaveConfirmDialog(Object buttonId)
String getImportantIcon()
void endAgreement(AgreementEndingType type, InteractionDialogAPI dialog)
FactionAPI getFactionForUIColors()
String getAcceptedPostfix()
Set< String > getIntelTags(SectorMapAPI map)
void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode)
SectorEntityToken getMapLocation(SectorMapAPI map)
void buttonPressConfirmed(Object buttonId, IntelUIAPI ui)
AgreementEndingType endType
LuddicChurchImmigrationDeal(InteractionDialogAPI dialog)
static String UPDATE_PARAM_ACCEPTED
void createConfirmationPrompt(Object buttonId, TooltipMakerAPI prompt)
void createSmallDescription(TooltipMakerAPI info, float width, float height)
String getBrokenPostfix()
String getSpriteName(String category, String id)