Advertisement
nio_kasgami

Untitled

Oct 29th, 2015
89
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 Permit to have VN style Message system.
  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.    * @param Enable Bust
  32.    * @desc Enable the use of bust in your message bust.
  33.    * @default true
  34.  
  35.    * @param Bust Folder
  36.    * @desc Set the folder for the bust.
  37.    * @default Pictures
  38.  
  39.    * @param Bust Position
  40.    * @desc set the position of the bust.
  41.    * @default 100,100
  42.  
  43.    * @param Bust Position
  44.    * @desc set the Z position of the bust. Use the word below or above.
  45.    * @default below
  46.  
  47.    * @param Enable Panorama
  48.    * @desc Enable the use of background.
  49.    * @default below
  50.  
  51. //==============================================================================
  52.  
  53. //==============================================================================
  54. // Help File
  55. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. // This section serve for input the help file in the engine don't touch this
  57. // unless you want to input more information
  58. //------------------------------------------------------------------------------
  59.    * @help
  60.  
  61. */
  62.  
  63. //==============================================================================
  64. // ■ Emoji_Engine
  65. //------------------------------------------------------------------------------
  66. // the class who handle all the base of my plugins. Can be access via $emoji.
  67. //==============================================================================
  68.  
  69.  
  70.  
  71. (function(){
  72.  
  73. //----------------------------------------------------------------------------
  74. // ○ new function: Get_pluginName
  75. //----------------------------------------------------------------------------
  76. // * Core function where you get your plugin name. for get it enter a
  77. // * function scoped variable and get you plugin name via this.get_Pname(plugin);
  78. // * or via the usual plugin name it's depends of you!
  79. // * Do not forgot to alias this method when you use it or this overwrite!
  80. //
  81. var NP01 = NioPluginCore.prototype.get_pluginName;
  82. Nio_PluginCore.prototype.get_pluginName = function() {
  83.     NP01.call(this);
  84.     this.message_params = this.get_Pname('NioAdvanceMessageBust');
  85. };
  86.  
  87. //----------------------------------------------------------------------------
  88. // ○ new function: Get_pluginParams
  89. //----------------------------------------------------------------------------
  90. // * This function serve for store your plugin params data. Use this for
  91. // * create your commands and make it enable in your system.
  92. // * use the default method or the premade method in the core plugin.
  93. // * do not forgot to alias this method when you use it or this overwrite!
  94. //
  95. var NPN01 = NioPluginCore.prototype.get_pluginParams;
  96. NioPluginCore.prototype.get_pluginParams = function() {
  97.     NPN01.call(this);
  98.  
  99. // Get Bust Parameters.
  100.     this.enableBust     = setBoolean(this.message_params,'Enable Bust');
  101.     this.bustFolder     = setString(this.message_params,'Bust Folder');
  102.     this.bustPos        = setArray(this.message_params,'Bust Position');
  103.     this.bustPriority   = setString(this.message_params,'Bust Position');
  104. // Get Panorama Parameters.
  105.     this.enablePanorama = setBoolean(this.message_params,'Enable Panorama');
  106.     this.panoramaFolder = setString(this.message_params,'Panorama Folder');
  107. };
  108.  
  109. })()
  110.  
  111.  
  112.  
  113. var nio_message_clear = Game_Message.prototype.clear;
  114. Game_Message.prototype.clear = function() {
  115.     nio_message_clear.call(this);
  116.     this._bust_name     = "";
  117.     this._bust_index    = 0;
  118.     this._panorama_name = "";
  119.     this._panorama_hue  = 0
  120.     this._mirror        = false;
  121. };
  122.  
  123.  
  124. Game_Message.prototype.bust_name = function() {
  125.     return this._bust_name;
  126. };
  127.  
  128. Game_Message.prototype.bust_index = function() {
  129.     return this._bust_index;
  130. };
  131.  
  132. Game_Message.prototype.panorama_name = function() {
  133.     return this._panorama_name;
  134. };
  135.  
  136. Game_Message.prototype.ismirror = function() {
  137.     return this._mirror;
  138. };
  139.  
  140. Game_Message.prototype.set_bust = function(filename,index,mirror) {
  141.     this._bust_name  = filename;
  142.     this._bust_index = index;
  143.     this._mirror     = mirror;
  144. };
  145.  
  146. Game_Message.prototype.set_panorama = function(p_filename,hue) {
  147.     this._panorama_name = p_filename;
  148.     this._panorama_hue  = hue;
  149. };
  150.  
  151.  
  152. ///////////////////////////////////////////////////////////////////////////////////
  153.  
  154.  
  155. Window_Message.prototype.load_messagebust = function() {
  156.     this.bust_graphics = ImageManager.loadBust($gameMessage.bust_name());
  157. };
  158.  
  159.  
  160.  
  161. Window_Message.prototype.load_Panorama = function() {
  162.     this.panorama_graphics = ImageManager.loadPanorama($gameMessage.panorama_name());
  163. };
  164.  
  165. Window_Message.prototype.create_panorama = function() {
  166.     this.panorama = new Sprite();
  167.     this.panorama.x = Graphics.width / 2;
  168.     this.panorama.y = Graphics.height / 2;
  169.     this.panorama.anchor.x = 0.5;
  170.     this.panorama.anchor.y = 0.5;
  171. };
  172. Window_Message.prototype.drawMessagePanorama = function() {
  173.     var hue = $game_message.panorama_hue;
  174.     if ($gameMessage.panorama_name() != ""){
  175.         this.panorama.bitmap = ImageManager.loadPanorama($gameMessage.panorama_name(), hue);
  176.         this.panorama_name.visible = true;
  177.     } else {
  178.         this.panorama.bitmap = ImageManager.loadPanorama("");
  179.         this.panorama.visible = false;
  180.     }
  181. };
  182.  
  183. Window_Message.prototype.invert_bust = function() {
  184.     this.spritebust.mirror(true,false);
  185. };
  186.  
  187. Window_Message.prototype.create_bust = function() {
  188.     this.spritebust = new Sprite();
  189.     this.spritebust.set_origin(0.5,0.5);
  190.     this.spritebust.x = $nPluginCore.bustPos[0];
  191.     this.spritebust.y = $nPluginCore.bustPos[1];
  192.     this.spritebust.visible = false;
  193.     // set the z axis of the sprite.
  194.     switch($NioPluginCore.bustPriority.toLowerCase()){
  195.         case 'below' :
  196.         this.addChildAt(this.spritebust,0);
  197.         break;
  198.         case 'above' :
  199.         this.addChildAt(this.spritebust,3);
  200.         break;
  201.     }
  202. };
  203.  
  204. Window_Message.prototype.drawMessageBust = function() {
  205.     if ($gameMessage.bust_name() != ""){
  206.         this.spritebust.bitmap  = ImageManager.loadBust($gameMessage.bust_name() + $gameMessage.bust_index());
  207.         this.spritebust.visible = true;
  208.     }else {
  209.         this.spritebust.bitmap  = ImageManager.loadBust("");
  210.         this.spritebust.visible = false
  211.     }
  212. };
  213.  
  214. var nio_old_escapechar = Window_Message.prototype.processEscapeCharacter;
  215. Window_Message.prototype.processEscapeCharacter = function(code, textState) {
  216.     nio_old_escapechar.call(this);
  217.     switch (code) {
  218.     case '*':
  219.         this.invert_bust();
  220.         break;
  221.     }
  222. };
  223.  
  224.  
  225. ////////////////////////////////////////////////////////////////////////////////////
  226.  
  227. ImageManager.loadBust = function(filename) {
  228.     var pathofile = $nio_engine.bust_folder;
  229.     return this.loadBitmap('img/' + pathofile + '/', filename, 0, true);
  230. };
  231. ImageManager.loadPanorama = function(filename,hue) {
  232.     var pathofile $nio_engine.panorama_folder;
  233.     return this.loadBitmap('img/' + pathofile + '/', filename,hue,true);
  234. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement