Content editor: Add support for switching active NPC in dialogue

This commit is contained in:
Oskar Wiksten
2013-08-20 20:41:14 +02:00
parent 06feff98c1
commit 89a64bbdea
2 changed files with 12 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ var ATEditor = (function(ATEditor, _) {
if (reply.nextPhraseID && reply.nextPhraseID.length === 1) { reply.replyLeadsTo = reply.nextPhraseID; }
reply.hasRequirements = ATEditor.utils.hasValues(reply.requires);
});
o.showAdvanced = _.toBool(o.switchToNPC);
};
prep.monster = function(o) {
o.hasConversation = _.toBool(o.phraseID);
@@ -94,6 +95,10 @@ var ATEditor = (function(ATEditor, _) {
if (o.hasOnlyNextReply) {
o.replies = [ { text: "N", nextPhraseID: o.nextPhraseID } ];
}
if (!o.showAdvanced) {
delete o.switchToNPC;
}
delete o.showAdvanced;
delete o.nextPhraseID;
delete o.hasOnlyNextReply;
delete o.tree;

View File

@@ -55,6 +55,13 @@
</table>
<button ng-click="addReward(phrase)" class="btn" title="Add reward"><i class="icon-plus-sign"></i> Add reward</button>
</div>
<div class="fieldWithLabel">
<label class="checkbox"><input type="checkbox" id="showAdvanced" ng-model="phrase.showAdvanced" />Show advanced properties</label>
</div>
<div class="fieldWithLabel" ng-ds-fade="phrase.showAdvanced">
<label for="switchToNPC"><span class="hint hint--top" data-hint="Id of a NPC that speaks this phrase. All subsequent phrases will be spoken by this NPC.">Switch active NPC to:</span></label>
<input type="text" size="30" id="switchToNPC" class="field at-input-id" ng-model="phrase.switchToNPC" />
</div>
</fieldset>
<fieldset id="dialoguePhraseReplies">