Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Using the EndConversation rule-command with a custom InteractionDialogPlugin  (Read 1570 times)

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile

EndConversation is set up to work specifically with a FleetInteractionDialogPluginImpl.
Spoiler
Code: java
public class EndConversation extends BaseCommandPlugin {

public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
FleetInteractionDialogPluginImpl.inConversation = false;
return true;
}

}
[close]

This means any InteractionDialogPlugin that uses the same method of opening and closing a comm link as FleetInteractionDialogPluginImpl won't work. You can open the comm link and click "Cut the comm link," but it will never actually close.

API bug? I'm sure there are ways around this, so it shouldn't be a major issue, but I just thought I'd give you folks a heads-up.


All you have to do to get this working properly is import FleetInteractionDialogPluginImpl and replace every instance of inConversation with FleetInteractionDialogPluginImpl.inConversation.
« Last Edit: October 25, 2014, 12:59:25 PM by Sundog »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: PSA: The EndConversation rule-command doesn't work for mods
« Reply #1 on: October 25, 2014, 12:45:58 PM »

Just FYI, not a bug - it's just an implementation detail of FIDPI.

If you write a custom dialog that uses the same conversation mechanics (which makes sense if you want to avoid rewriting all the rules), why not use  FleetInteractionDialogPluginImpl.inConversation in your dialog in the same way FIDPI uses it? It's a public field.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: PSA: The EndConversation rule-command doesn't work for mods
« Reply #2 on: October 25, 2014, 12:52:09 PM »

It's a public field.
I assumed it wasn't, fool that I am. Thanks Alex  :)