MCPcopy Create free account
hub / github.com/codecombat/codecombat / addTutorialStepsFromSayEvents

Function addTutorialStepsFromSayEvents

app/core/store/modules/game.js:142–163  ·  view source on GitHub ↗
({ commit, rootState, dispatch }, sayEvents)

Source from the content-addressed store, hash-verified

140 // Idempotent, will not add the same step twice
141 // Appends steps to the tutorial, extracting information from each say event in sayEvents
142 addTutorialStepsFromSayEvents ({ commit, rootState, dispatch }, sayEvents) {
143 return sayEvents.forEach(function (sayEvent) {
144 const { say, tutorial } = sayEvent
145
146 return dispatch('addTutorialStep', {
147 message: utils.i18n(say, 'text'),
148 originalMessage: (say != null ? say.text : undefined),
149 // To stay backwards compatible with old Vega messages,
150 // they are turned into stationary Vega messages with no other qualities:
151 position: (tutorial != null ? tutorial.position : undefined) || 'stationary',
152 targetElement: (tutorial != null ? tutorial.targetElement : undefined),
153 animation: (tutorial != null ? tutorial.animation : undefined),
154 targetLine: (tutorial != null ? tutorial.targetLine : undefined),
155 targetThangs: (tutorial != null ? tutorial.targetThangs : undefined),
156 grayOverlay: (tutorial != null ? tutorial.grayOverlay : undefined),
157 advanceOnTarget: (tutorial != null ? tutorial.advanceOnTarget : undefined),
158 internalRelease: (tutorial != null ? tutorial.internalRelease : undefined),
159 voiceOver: say.voiceOver,
160 speakerThangType: (rootState.game.level != null ? rootState.game.level.characterPortrait : undefined) || 'vega'
161 })
162 })
163 },
164 toggleCodeBank ({ commit, rootState }) {
165 return commit('setCodeBankOpen', !rootState.game.codeBankOpen)
166 },

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected