Added support for the extended reward system to the conversation resource files and the content editor.

Added support for different types of item requirements in conversation replies. For example, requiring the player to wear a specific item instead of just having it in inventory.

git-svn-id: https://andors-trail.googlecode.com/svn/trunk@216 08aca716-68be-ccc6-4d58-36f5abd142ac
This commit is contained in:
oskar.wiksten
2012-01-08 12:55:48 +00:00
parent 4f640f2726
commit ad5b8991bf
9 changed files with 5353 additions and 5294 deletions

View File

@@ -62,10 +62,7 @@ function buildEditorForPhrase(div, phrase, tree, treeNode) {
var dialoguePhrase = $( "#dialoguePhrase", div );
var dialoguePhraseReplies = $( "#dialoguePhraseReplies", div );
checkboxHidesElement( $( '#hasProgressQuest', dialoguePhrase ), $( '#hasProgressQuestDisplay', dialoguePhrase ), phrase.progressQuest);
checkboxHidesElement( $( '#hasRewardDroplist', dialoguePhrase ), $( '#hasRewardDroplistDisplay', dialoguePhrase ), phrase.rewardDropListID);
bindFieldToDataStore( $( "#progressQuest", dialoguePhrase ), model.quests);
bindFieldToDataStore( $( "#rewardDropListID", dialoguePhrase ), model.droplists);
checkboxHidesElement( $( '#hasRewards', dialoguePhrase ), $( '#hasRewardsDisplay', dialoguePhrase ), phrase.rewards);
var rebuildChildNodes = function() {
updatePhraseReplyTreeNodesBelow(tree, treeNode, phrase);
@@ -122,6 +119,17 @@ function buildEditorForPhrase(div, phrase, tree, treeNode) {
$( '#message', dialoguePhrase ).change(function() { treeNode.setTitle( getPhraseNodeText(phrase) ); });
var createNewReward = function() { return { rewardType: 0 }; }
var setupEditor = function(div) { }
if (!phrase.rewards) phrase.rewards = [];
applyTableEditor({
table: $( '#rewards', dialoguePhrase ),
dialog: phraseRewardDialog,
array: phrase.rewards,
templateFunction: createNewReward,
editorSetup: setupEditor
});
dialoguePhrase.show();
dialoguePhraseReplies.show();
}