{"id":33169528,"url":"https://github.com/phreaknation/plugin.dialogmanager","last_synced_at":"2025-11-20T19:01:00.023Z","repository":{"id":139782874,"uuid":"81893072","full_name":"phreaknation/plugin.dialogmanager","owner":"phreaknation","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-19T08:30:11.000Z","size":21,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-17T12:32:52.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phreaknation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-14T02:02:02.000Z","updated_at":"2020-09-21T10:06:34.000Z","dependencies_parsed_at":"2024-01-12T00:23:40.679Z","dependency_job_id":"3ba311d9-537a-4209-8be9-32bfa8fb6963","html_url":"https://github.com/phreaknation/plugin.dialogmanager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phreaknation/plugin.dialogmanager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phreaknation%2Fplugin.dialogmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phreaknation%2Fplugin.dialogmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phreaknation%2Fplugin.dialogmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phreaknation%2Fplugin.dialogmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phreaknation","download_url":"https://codeload.github.com/phreaknation/plugin.dialogmanager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phreaknation%2Fplugin.dialogmanager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285494607,"owners_count":27181443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T01:00:33.530Z","updated_at":"2025-11-20T19:01:00.015Z","avatar_url":"https://github.com/phreaknation.png","language":"JavaScript","funding_links":["https://www.patreon.com/diesoft"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Dialog Manager\nBy Joel Dies\n\n[Demo](http://codepen.io/phreaknation/full/NdZWdw/)\n\n[Video](https://youtu.be/0RNYi8aXYG4)\n\n\n**This is not 100% documented but is on its way to being 100% documented.**\n\nHelp support these efforts by becoming a [Patreon](https://www.patreon.com/diesoft)\n\n## Including in a project\nInclude the script into your html page.\n\nRequired Modules:\n\n + [Lodash](lodash.com) [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js)\n\n```\n\u003cscript src=\"/path/to/plugin/lodash.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript src=\"/path/to/plugin/phreaknation.manager.dialog.min.js\"\u003e\u003c/script\u003e\n```\n\nIn your create of your phaser project.\n\n```\ngame.plugins.add(PhreakNation.Plugins.DialogManager);\n```\n\n#### Example:\n```\nvar config = require('./path/to/config.js');\nvar manDiag;\n(function() {\n  'use strict';\n\n  var state = function state(game) {};\n\n  state.prototype = {\n    ...\n    create: function () {\n      ...\n      manDiag = this.game.plugins.add(PhreakNation.Plugins.DialogManager);\n      manDiag.load(config);\n      var Conv = manDiag.get('dialog', 1);\n      \n      Conv.play();\n      \n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n      \n      var list = Conv.answers();\n      var choice = _.random(0, 2);\n      console.log('Options: ', list);\n      console.log('Chose: `%s`', list[choice]);\n      Conv.choose(choice);\n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n\n      Conv.next();\n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n\n      Conv.next();\n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n\n      list = Conv.answers();\n      choice = _.random(0, 2);\n      console.log('Options: ', list);\n      console.log('Chose: `%s`', list[choice]);\n      Conv.choose(_.random(0, 1));\n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n\n      Conv.next();\n      console.log('[%s]: %s', Conv.actor().name(), Conv.text());\n      }\n      ...\n    },\n    ...\n  };\n\n  window.MyGame.states.MyState = state;\n})();\n```\n\n### Manager Methods\n\n### version()\nReturn the plugin version.\n\n#### Example:\n```\nmanDiag.version();\n```\n\n### description()\nReturn a description of this plugin.\n\n#### Example:\n```\nmanDiag.description();\n```\n\n### format(text)\nInternal Usage. Formats a text based on variables in the string.\n\n#### Example:\n```\nvar str = manDiag.format('Hey there {actor:0x002}, I am doing good.');\n// if there was a reference to `actor:0x002` set to `Actor` in the config. See provided config for details\n// 'Hey there Actor, I am doing good.'\n```\n\n### get(id, type)\nGrabs an item from the config.\n\n#### Example:\n```\nvar Conv = manDiag.get(1, 'dialog');\n```\n\n### load(config)\nLoads a config file.\n\n#### Example:\n```\nmanDiag.load(config);\n```\n\n### new()\nTBD\n\n#### Example:\n```\n// TBD\n```\n\n\n\n### Dialog Methods\n\n### actor()\nGets the active actor.\n\n#### Example:\n```\nvar actor = Conv.actor();\n```\n\n### answers()\nGets the list of answers when there is an active question dialog.\n\n#### Example:\n```\nvar answers = Conv.answers();\n```\n\n### choose(id)\nChooses an option for the active question dialog\n\n#### Example:\n```\nConv.choose(0);\n```\n\n### emotion()\nGets the current emotion of the speaking character of the active dialog.\n\n#### Example:\n```\nvar emotion = Conv.emotion();\n```\n\n### next()\nLoads the next dialog, if any.\n\n#### Example:\n```\nConv.next();\n```\n\n### play(id)\nInitializes the conversation. Pass in an id to target a specific point of the dialog.\n\n#### Example:\n```\nvar Conv = manDiag.get('dialog', 1);\nConv.play();\n```\n\n### process(id, type)\nInternal Usage. Processes the current dialog.\n\n#### Example:\n```\nConv.process(id);\n```\n\n### text()\nReturns the formated text of the current dialog.\n\n#### Example:\n```\nConv.text();\n```\n\n\n\n### Actor Methods\n\n### name()\nReturns the name of the actor.\n\n#### Example:\n```\nvar actor = Conv.actor();\nactor.name(); // Returns the actors name;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphreaknation%2Fplugin.dialogmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphreaknation%2Fplugin.dialogmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphreaknation%2Fplugin.dialogmanager/lists"}