public class AoTDColonyEventOutcomeDelegate implements CustomVisualDialogDelegate {
protected DialogCallbacks callbacks;
protected AoTDColonyEventOutcomeUI plugin;
protected InteractionDialogAPI dialog;
public AoTDColonyEventOutcomeDelegate(AoTDColonyEventOutcomeUI panel , InteractionDialogAPI dialog){
this.plugin = panel;
this.dialog = dialog;
}
@Override
public void init(CustomPanelAPI panel, DialogCallbacks callbacks) {
this.callbacks = callbacks;
plugin.init(panel, callbacks, dialog);
}
@Override
public CustomUIPanelPlugin getCustomPanelPlugin() {
return plugin;
}
@Override
public float getNoiseAlpha() {
return 0;
}
@Override
public void advance(float amount) {
}
@Override
public void reportDismissed(int option) {
}
public class AoTDColonyEventOutomeDP implements InteractionDialogPlugin {
public InteractionDialogAPI dialog;
public AoTDColonyEvent event;
static enum OptionID {
INIT,
LEAVE
}
@Override
public void init(InteractionDialogAPI dialog) {
this.dialog = dialog;
this.dialog.getTextPanel();
dialog.hideTextPanel();
dialog.setPromptText("");
dialog.getVisualPanel().finishFadeFast();
dialog.setOpacity(1.85f);
dialog.setBackgroundDimAmount(0f);
optionSelected(null, OptionID.INIT);
}
public void setEvent(AoTDColonyEvent event) {
this.event = event;
}
@Override
public void optionSelected(String optionText, Object optionData) {
if (optionData == OptionID.INIT) {
//this is where the size of the panel is set, automatically centered
dialog.showCustomVisualDialog(AoTDColonyEventOutcomeUI.WIDTH + 20, AoTDColonyEventOutcomeUI.HEIGHT + 20, new AoTDColonyEventOutcomeDelegate(new AoTDColonyEventOutcomeUI(),dialog));
}
}
@Override
public void optionMousedOver(String optionText, Object optionData) {
}
@Override
public void advance(float amount) {
}
@Override
public void backFromEngagement(EngagementResultAPI battleResult) {
}
@Override
public Object getContext() {
return null;
}
@Override
public Map<String, MemoryAPI> getMemoryMap() {
return null;
}