Path: blob/main/website/GAUSS/js/action-manager.js
2941 views
var Action = function(id)1{2this.id = id;3this.description = '';4};56Action.prototype.setDescription = function(desc)7{8this.description = desc;9};1011var editorActionsList = new Array();12var editorMapIdAction = {};13var editorActionsCount = 0;1415var createNewEditorAction = function(id, desc)16{17var newAction = new Action(id);18if(desc)19newAction.setDescription(desc);20editorActionsList.push(newAction);21editorMapIdAction[newAction.id] = newAction;22};2324var WALK_TO_ID = 'Walk_to';25var EYES_ID = 'Eyes';26var HAND_ID = 'Hand';27var MOUTH_ID = 'Mouth';28var COMBINE_ID = 'Combine';2930var DEFAULT_WALK_TO_SENTENCE = 'Walk to';31var DEFAULT_EYES_SENTENCE = 'Look at';32var DEFAULT_HAND_SENTENCE = 'Pick up';33var DEFAULT_MOUTH_SENTENCE = 'Talk to';34var DEFAULT_COMBINE_SENTENCE = 'Combine';3536createNewEditorAction(WALK_TO_ID, DEFAULT_WALK_TO_SENTENCE);37createNewEditorAction(EYES_ID, DEFAULT_EYES_SENTENCE);38createNewEditorAction(HAND_ID, DEFAULT_HAND_SENTENCE);39createNewEditorAction(MOUTH_ID, DEFAULT_MOUTH_SENTENCE);40createNewEditorAction(COMBINE_ID, DEFAULT_COMBINE_SENTENCE);4142var defaultSentences = {};43defaultSentences[HAND_ID] = [ 'I can\'t pick that up.', 'I don\'t need it.', 'That doesn\'t seem to work.', 'I can\'t use that.', 'Nah.'];44defaultSentences[EYES_ID] = [ 'I don\'t see anything special about it.', 'Cool.' ];45defaultSentences[MOUTH_ID] = [ 'Not a chatterbox.', 'I don\'t think it\'s going to answer.' ];46defaultSentences[COMBINE_ID] = [ 'That doesn\'t seem to work.' ];4748var defaultReactions = {};49defaultReactions[HAND_ID] = 'var set = defaultSentences["' + HAND_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';50defaultReactions[EYES_ID] = 'var set = defaultSentences["' + EYES_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';51defaultReactions[MOUTH_ID] = 'var set = defaultSentences["' + MOUTH_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';52defaultReactions[COMBINE_ID] = 'var set = defaultSentences["' + COMBINE_ID +'"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';535455