nio_kasgami

EmojiBase

Oct 29th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2. //==============================================================================
  3. // ■ Emoji Engine MV - Origin "EmojiBase"
  4. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5.   @plugindesc Base for EMM. It's store the base values for the engine.
  6.   @author Nio Kasgami.
  7.   @Data : 2015/10/05
  8.   @Version : 1.0.0
  9.   @Require : NA
  10. //==============================================================================
  11.  
  12. //==============================================================================
  13. // History
  14. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  15. // 2015/10/29 - Begin and finish the plugin.
  16. //==============================================================================
  17.  
  18. //==============================================================================
  19. // Introduction
  20. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. //
  22. //==============================================================================
  23.  
  24.  
  25. //==============================================================================
  26. // Plugin Parameter
  27. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. // this section handle the plugin parameter. Please do not edit unless you
  29. // want to add extra plugin command.
  30. //------------------------------------------------------------------------------
  31.    * it's a base so this not handle any param commands
  32. //==============================================================================
  33.  
  34. //==============================================================================
  35. // Help File
  36. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  37. // This section serve for input the help file in the engine don't touch this
  38. // unless you want to input more information
  39. //------------------------------------------------------------------------------
  40.    * @help
  41.    * This plugin base serve for handles datas so it's not provide plugin command
  42.    * though it's serve for store my other plugin commands via the alias of
  43.    * the method "get_pluginname" and "get_params".
  44.    *
  45.    * be sure please to input this above all my EEMV plugin for avoid any issues.
  46. */
  47.  
  48. //==============================================================================
  49. // ■ Emoji_Engine
  50. //------------------------------------------------------------------------------
  51. // the class who handle all the base of my plugins. Can be access via $emoji.
  52. //==============================================================================
  53.  
  54. function Emoji_Engine() {this.initialize.apply(this,arguments);}
  55.   Emoji_Engine.prototype.constructor = Emoji_Engine;
  56.  
  57.  
  58. //----------------------------------------------------------------------------
  59. // ○ new function: initialize
  60. //----------------------------------------------------------------------------
  61. Emoji_Engine.prototype.initialize = function() {
  62.     this.get_data();
  63. };
  64.  
  65. //----------------------------------------------------------------------------
  66. // ○ new function: get_data
  67. //----------------------------------------------------------------------------
  68. Emoji_Engine.prototype.get_data = function() {
  69.     this.get_pluginname();
  70.     this.get_params();
  71. };
  72.  
  73. //----------------------------------------------------------------------------
  74. // ○ new function: get_pluginname
  75. //----------------------------------------------------------------------------
  76. Emoji_Engine.prototype.get_pluginname = function() {
  77.     this.emojibase = PluginManager.parameters('EmojiBase');
  78. };
  79.  
  80. //----------------------------------------------------------------------------
  81. // ○ new function: get_params
  82. //----------------------------------------------------------------------------
  83. Emoji_Engine.prototype.get_params = function() {};
  84.  
  85. //===============================================================================
  86. // => END : Emoji_Engine
  87. //===============================================================================
  88.  
  89. //==============================================================================
  90. // ■ DataManager
  91. //------------------------------------------------------------------------------
  92. // The static class that manages the database and game objects.
  93. //==============================================================================
  94.  
  95. //----------------------------------------------------------------------------
  96. // ★ new global variables : $emoji
  97. //----------------------------------------------------------------------------
  98.  var $emoji = null;
  99.  
  100. //----------------------------------------------------------------------------
  101. // ● alias function: createGameObjects
  102. //----------------------------------------------------------------------------
  103. var emoji_basealias = DataManager.createGameObjects;
  104. DataManager.createGameObjects = function() {
  105.     emoji_basealias.call(this);
  106.     $emoji                      = new Emoji_Engine();
  107. };
  108.  
  109. //----------------------------------------------------------------------------
  110. // ● overwrite function: loadDataFileSync
  111. //----------------------------------------------------------------------------  
  112. DataManager.loadDataFileSync = function(name, src) {
  113.     var xhr = new XMLHttpRequest();
  114.     var url = 'data/' + src;
  115.     xhr.open('GET', url, true);
  116.     xhr.overrideMimeType('application/json');
  117.     xhr.onload = function() {
  118.         if (xhr.status < 400) {
  119.             window[name] = JSON.parse(xhr.responseText);
  120.             DataManager.onLoad(window[name]);
  121.         }
  122.     };
  123.     xhr.onerror = function() {
  124.         DataManager._errorUrl = DataManager._errorUrl || url;
  125.     };
  126.     window[name] = null;
  127.     xhr.send();
  128. };
  129. //===============================================================================
  130. // => END : DataManager
  131. //===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment