Try Rev167. I extended quest::popup, so there are three variants:
Code:
quest::popup(<Window Title>, <Window Text>)
quest::popup(<Window Title>, <Window Text>, <PopupID>)
quest::popup(<Window Title>, <Window Text>, <PopupID>, <Buttons>)
Where Buttons = 0 means just display an OK button, or Buttons = 1 means display Yes/No buttons.
If PopupID > 0, clicking on OK or Yes will call sub EVENT_POPUPRESPONSE:
Code:
sub EVENT_POPUPRESPONSE {
quest::say("Popup response");
if($popupid eq "10") {
quest::say("You clicked OK/Yes to popup with id 10");
}
}
sub EVENT_SAY {
if ($text=~ /Hail/i){
quest::popup("Test Popup", "Test popup with ID 10", 10);
}
}
If you lose focus on the NPC, e.g. by hitting Escape while the popup is up, EVENT_POPUPRESPONSE won't be called. Not sure if it is like this on live. The ID of the NPC that produced the popup could be stored, if this is deemed to be an issue.
Edit: There is a new Opcode, so copy the patch*conf files from the utils directory.