Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- //==============================================================================
- // ■ Emoji Engine MV - Origin "EmojiBase"
- // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- @plugindesc Permit to have VN style Message system.
- @author Nio Kasgami.
- @Data : 2015/10/05
- @Version : 1.0.0
- @Require : NA
- //==============================================================================
- //==============================================================================
- // History
- // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // 2015/10/29 - Begin and finish the plugin.
- //==============================================================================
- //==============================================================================
- // Introduction
- // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- //
- //==============================================================================
- //==============================================================================
- // Plugin Parameter
- // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // this section handle the plugin parameter. Please do not edit unless you
- // want to add extra plugin command.
- //------------------------------------------------------------------------------
- * @param Enable Bust
- * @desc Enable the use of bust in your message bust.
- * @default true
- * @param Bust Folder
- * @desc Set the folder for the bust.
- * @default Pictures
- * @param Bust Position
- * @desc set the position of the bust.
- * @default 100,100
- * @param Bust Position
- * @desc set the Z position of the bust. Use the word below or above.
- * @default below
- * @param Enable Panorama
- * @desc Enable the use of background.
- * @default below
- //==============================================================================
- //==============================================================================
- // Help File
- // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // This section serve for input the help file in the engine don't touch this
- // unless you want to input more information
- //------------------------------------------------------------------------------
- * @help
- */
- //==============================================================================
- // ■ Emoji_Engine
- //------------------------------------------------------------------------------
- // the class who handle all the base of my plugins. Can be access via $emoji.
- //==============================================================================
- (function(){
- //----------------------------------------------------------------------------
- // ○ new function: Get_pluginName
- //----------------------------------------------------------------------------
- // * Core function where you get your plugin name. for get it enter a
- // * function scoped variable and get you plugin name via this.get_Pname(plugin);
- // * or via the usual plugin name it's depends of you!
- // * Do not forgot to alias this method when you use it or this overwrite!
- //
- var NP01 = NioPluginCore.prototype.get_pluginName;
- Nio_PluginCore.prototype.get_pluginName = function() {
- NP01.call(this);
- this.message_params = this.get_Pname('NioAdvanceMessageBust');
- };
- //----------------------------------------------------------------------------
- // ○ new function: Get_pluginParams
- //----------------------------------------------------------------------------
- // * This function serve for store your plugin params data. Use this for
- // * create your commands and make it enable in your system.
- // * use the default method or the premade method in the core plugin.
- // * do not forgot to alias this method when you use it or this overwrite!
- //
- var NPN01 = NioPluginCore.prototype.get_pluginParams;
- NioPluginCore.prototype.get_pluginParams = function() {
- NPN01.call(this);
- // Get Bust Parameters.
- this.enableBust = setBoolean(this.message_params,'Enable Bust');
- this.bustFolder = setString(this.message_params,'Bust Folder');
- this.bustPos = setArray(this.message_params,'Bust Position');
- this.bustPriority = setString(this.message_params,'Bust Position');
- // Get Panorama Parameters.
- this.enablePanorama = setBoolean(this.message_params,'Enable Panorama');
- this.panoramaFolder = setString(this.message_params,'Panorama Folder');
- };
- })()
- var nio_message_clear = Game_Message.prototype.clear;
- Game_Message.prototype.clear = function() {
- nio_message_clear.call(this);
- this._bust_name = "";
- this._bust_index = 0;
- this._panorama_name = "";
- this._panorama_hue = 0
- this._mirror = false;
- };
- Game_Message.prototype.bust_name = function() {
- return this._bust_name;
- };
- Game_Message.prototype.bust_index = function() {
- return this._bust_index;
- };
- Game_Message.prototype.panorama_name = function() {
- return this._panorama_name;
- };
- Game_Message.prototype.ismirror = function() {
- return this._mirror;
- };
- Game_Message.prototype.set_bust = function(filename,index,mirror) {
- this._bust_name = filename;
- this._bust_index = index;
- this._mirror = mirror;
- };
- Game_Message.prototype.set_panorama = function(p_filename,hue) {
- this._panorama_name = p_filename;
- this._panorama_hue = hue;
- };
- ///////////////////////////////////////////////////////////////////////////////////
- Window_Message.prototype.load_messagebust = function() {
- this.bust_graphics = ImageManager.loadBust($gameMessage.bust_name());
- };
- Window_Message.prototype.load_Panorama = function() {
- this.panorama_graphics = ImageManager.loadPanorama($gameMessage.panorama_name());
- };
- Window_Message.prototype.create_panorama = function() {
- this.panorama = new Sprite();
- this.panorama.x = Graphics.width / 2;
- this.panorama.y = Graphics.height / 2;
- this.panorama.anchor.x = 0.5;
- this.panorama.anchor.y = 0.5;
- };
- Window_Message.prototype.drawMessagePanorama = function() {
- var hue = $game_message.panorama_hue;
- if ($gameMessage.panorama_name() != ""){
- this.panorama.bitmap = ImageManager.loadPanorama($gameMessage.panorama_name(), hue);
- this.panorama_name.visible = true;
- } else {
- this.panorama.bitmap = ImageManager.loadPanorama("");
- this.panorama.visible = false;
- }
- };
- Window_Message.prototype.invert_bust = function() {
- this.spritebust.mirror(true,false);
- };
- Window_Message.prototype.create_bust = function() {
- this.spritebust = new Sprite();
- this.spritebust.set_origin(0.5,0.5);
- this.spritebust.x = $nPluginCore.bustPos[0];
- this.spritebust.y = $nPluginCore.bustPos[1];
- this.spritebust.visible = false;
- // set the z axis of the sprite.
- switch($NioPluginCore.bustPriority.toLowerCase()){
- case 'below' :
- this.addChildAt(this.spritebust,0);
- break;
- case 'above' :
- this.addChildAt(this.spritebust,3);
- break;
- }
- };
- Window_Message.prototype.drawMessageBust = function() {
- if ($gameMessage.bust_name() != ""){
- this.spritebust.bitmap = ImageManager.loadBust($gameMessage.bust_name() + $gameMessage.bust_index());
- this.spritebust.visible = true;
- }else {
- this.spritebust.bitmap = ImageManager.loadBust("");
- this.spritebust.visible = false
- }
- };
- var nio_old_escapechar = Window_Message.prototype.processEscapeCharacter;
- Window_Message.prototype.processEscapeCharacter = function(code, textState) {
- nio_old_escapechar.call(this);
- switch (code) {
- case '*':
- this.invert_bust();
- break;
- }
- };
- ////////////////////////////////////////////////////////////////////////////////////
- ImageManager.loadBust = function(filename) {
- var pathofile = $nio_engine.bust_folder;
- return this.loadBitmap('img/' + pathofile + '/', filename, 0, true);
- };
- ImageManager.loadPanorama = function(filename,hue) {
- var pathofile $nio_engine.panorama_folder;
- return this.loadBitmap('img/' + pathofile + '/', filename,hue,true);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement