Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Agent from './agent'
import Animator from './animator'
import Queue from './queue'
import Balloon from './balloon'
import { load, ready, soundsReady } from './load'
import { load, loadExistingAgent, ready, soundsReady } from './load'

const clippy = {
Agent,
Expand All @@ -11,13 +11,12 @@ const clippy = {
Balloon,
load,
ready,
soundsReady
soundsReady,
loadExistingAgent,
}

export default clippy

if (typeof window !== 'undefined') {
window.clippy = clippy
}


6 changes: 6 additions & 0 deletions lib/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class load {
// wrapper to the success callback
let cb = function () {
let a = new Agent(path, data, sounds);
load._agents[name] = a
successCb(a);
};

Expand Down Expand Up @@ -105,6 +106,7 @@ export class load {
load._maps = {};
load._sounds = {};
load._data = {};
load._agents = {}

export function ready (name, data) {
let dfd = load._getAgentDfd(name);
Expand All @@ -119,3 +121,7 @@ export function soundsReady (name, data) {

dfd.resolve(data);
}

export function loadExistingAgent (name) {
return load._agents[name]
}