Own Message Window Part 3 - The last bug ...

My own message-window finally works but there is still a little bug in there. It opens the text-message but I am still able to move around and click on events ...
 
So I guess there must be some busy-function that isn't triggered with my message but I don't know where to find it?

Changes in the DataManager:

Spoiler
var $klrgGameMessage = null;KLRG.TestMessageWindow.DataManager_createGameObjects = DataManager.createGameObjects;DataManager.createGameObjects = function() { KLRG.TestMessageWindow.DataManager_createGameObjects.call(this); console.log("KLRG.TestMessageWindow.DataManager_createGameObjects"); /*$gameTemp = new Game_Temp(); $gameSystem = new Game_System(); $gameScreen = new Game_Screen(); $gameTimer = new Game_Timer(); $gameMessage = new Game_Message(); $gameSwitches = new Game_Switches(); $gameVariables = new Game_Variables(); $gameSelfSwitches = new Game_SelfSwitches(); $gameActors = new Game_Actors(); $gameParty = new Game_Party(); $gameTroop = new Game_Troop(); $gameMap = new Game_Map(); $gamePlayer = new Game_Player();*/ $klrgGameMessage = new KLRG_Game_Message(); }; 
My own Game_Message:

Spoiler
//=============================================================================// Game_Message: -> KLRG_Game_Message//=============================================================================function KLRG_Game_Message() { this.initialize.apply(this, arguments);}KLRG_Game_Message.prototype.initialize = function() { this.clear();};KLRG_Game_Message.prototype.clear = function() { this._texts = []; this._choices = []; this._faceName = ''; this._faceIndex = 0; this._background = 0; this._positionType = 2; this._choiceDefaultType = 0; this._choiceCancelType = 0; this._choiceBackground = 0; this._choicePositionType = 2; this._numInputVariableId = 0; this._numInputMaxDigits = 0; this._itemChoiceVariableId = 0; this._itemChoiceItypeId = 0; this._scrollMode = false; this._scrollSpeed = 2; this._scrollNoFast = false; this._choiceCallback = null;};KLRG_Game_Message.prototype.choices = function() { return this._choices;};KLRG_Game_Message.prototype.faceName = function() { return this._faceName;};KLRG_Game_Message.prototype.faceIndex = function() { return this._faceIndex;};KLRG_Game_Message.prototype.background = function() { return this._background;};KLRG_Game_Message.prototype.positionType = function() { return this._positionType;};KLRG_Game_Message.prototype.choiceDefaultType = function() { return this._choiceDefaultType;};KLRG_Game_Message.prototype.choiceCancelType = function() { return this._choiceCancelType;};KLRG_Game_Message.prototype.choiceBackground = function() { return this._choiceBackground;};KLRG_Game_Message.prototype.choicePositionType = function() { return this._choicePositionType;};KLRG_Game_Message.prototype.numInputVariableId = function() { return this._numInputVariableId;};KLRG_Game_Message.prototype.numInputMaxDigits = function() { return this._numInputMaxDigits;};KLRG_Game_Message.prototype.itemChoiceVariableId = function() { return this._itemChoiceVariableId;};KLRG_Game_Message.prototype.itemChoiceItypeId = function() { return this._itemChoiceItypeId;};KLRG_Game_Message.prototype.scrollMode = function() { return this._scrollMode;};KLRG_Game_Message.prototype.scrollSpeed = function() { return this._scrollSpeed;};KLRG_Game_Message.prototype.scrollNoFast = function() { return this._scrollNoFast;};KLRG_Game_Message.prototype.add = function(text) { this._texts.push(text);};KLRG_Game_Message.prototype.setFaceImage = function(faceName, faceIndex) { this._faceName = faceName; this._faceIndex = faceIndex;};KLRG_Game_Message.prototype.setBackground = function(background) { this._background = background;};KLRG_Game_Message.prototype.setPositionType = function(positionType) { this._positionType = positionType;};KLRG_Game_Message.prototype.setChoices = function(choices, defaultType, cancelType) { this._choices = choices; this._choiceDefaultType = defaultType; this._choiceCancelType = cancelType;};KLRG_Game_Message.prototype.setChoiceBackground = function(background) { this._choiceBackground = background;};KLRG_Game_Message.prototype.setChoicePositionType = function(positionType) { this._choicePositionType = positionType;};KLRG_Game_Message.prototype.setNumberInput = function(variableId, maxDigits) { this._numInputVariableId = variableId; this._numInputMaxDigits = maxDigits;};KLRG_Game_Message.prototype.setItemChoice = function(variableId, itemType) { this._itemChoiceVariableId = variableId; this._itemChoiceItypeId = itemType;};KLRG_Game_Message.prototype.setScroll = function(speed, noFast) { this._scrollMode = true; this._scrollSpeed = speed; this._scrollNoFast = noFast;};KLRG_Game_Message.prototype.setChoiceCallback = function(callback) { this._choiceCallback = callback;};KLRG_Game_Message.prototype.onChoice = function(n) { if (this._choiceCallback) { this._choiceCallback(n); this._choiceCallback = null; }};KLRG_Game_Message.prototype.hasText = function() { return this._texts.length > 0;};KLRG_Game_Message.prototype.isChoice = function() { return this._choices.length > 0;};KLRG_Game_Message.prototype.isNumberInput = function() { return this._numInputVariableId > 0;};KLRG_Game_Message.prototype.isItemChoice = function() { return this._itemChoiceVariableId > 0;};KLRG_Game_Message.prototype.isBusy = function() { return (this.hasText() || this.isChoice() || this.isNumberInput() || this.isItemChoice());};KLRG_Game_Message.prototype.newPage = function() { if (this._texts.length > 0) { this._texts[this._texts.length - 1] += '\f'; }};KLRG_Game_Message.prototype.allText = function() { return this._texts.reduce(function(previousValue, currentValue) { return previousValue + '\n' + currentValue; });}; 

My manipulation of Scene_Map:

Spoiler
//=============================================================================// Scene_Map: -> KLRG_Scene_Map//=============================================================================KLRG.TestMessageWindow.Scene_Map_createAllWindows = Scene_Map.prototype.createAllWindows;Scene_Map.prototype.createAllWindows = function() { KLRG.TestMessageWindow.Scene_Map_createAllWindows.call(this); console.log("KLRG.TestMessageWindow.Scene_Map_createAllWindows"); //this.createMessageWindow(); //this.createScrollTextWindow(); this._klrgmessageWindow = new KLRG_Window_Message(); this.addWindow(this._klrgmessageWindow); this._klrgmessageWindow.subWindows().forEach(function(window) { this.addWindow(window); }, this); }; 
My own Version of the Window_Message

Spoiler
//=============================================================================// Window_Message: -> KLRG_Message_Window//=============================================================================function KLRG_Window_Message() { this.initialize.apply(this, arguments);}KLRG_Window_Message.prototype = Object.create(Window_Base.prototype);KLRG_Window_Message.prototype.constructor = KLRG_Window_Message;KLRG_Window_Message.prototype.initialize = function() { var width = this.windowWidth(); var height = this.windowHeight(); var x = (Graphics.boxWidth - width) / 2; Window_Base.prototype.initialize.call(this, x, 0, width, height); this.openness = 0; this.initMembers(); this.createSubWindows(); this.updatePlacement();};KLRG_Window_Message.prototype.initMembers = function() { this._background = 0; this._positionType = 2; this._waitCount = 0; this._faceBitmap = null; this._textState = null; this.clearFlags();};KLRG_Window_Message.prototype.subWindows = function() { return [this._goldWindow, this._choiceWindow, this._numberWindow, this._itemWindow];};KLRG_Window_Message.prototype.createSubWindows = function() { this._goldWindow = new Window_Gold(0, 0); this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width; this._goldWindow.openness = 0; this._choiceWindow = new Window_ChoiceList(this); this._numberWindow = new Window_NumberInput(this); this._itemWindow = new Window_EventItem(this);};KLRG_Window_Message.prototype.windowWidth = function() { return Graphics.boxWidth;};KLRG_Window_Message.prototype.windowHeight = function() { return this.fittingHeight(this.numVisibleRows());};KLRG_Window_Message.prototype.clearFlags = function() { this._showFast = false; this._lineShowFast = false; this._pauseSkip = false;};KLRG_Window_Message.prototype.numVisibleRows = function() { return 4;};KLRG_Window_Message.prototype.update = function() { this.checkToNotClose(); Window_Base.prototype.update.call(this); while (!this.isOpening() && !this.isClosing()) { if (this.updateWait()) { return; } else if (this.updateLoading()) { return; } else if (this.updateInput()) { return; } else if (this.updateMessage()) { return; } else if (this.canStart()) { this.startMessage(); } else { this.startInput(); return; } }};KLRG_Window_Message.prototype.checkToNotClose = function() { if (this.isClosing() && this.isOpen()) { if (this.doesContinue()) { this.open(); } }};KLRG_Window_Message.prototype.canStart = function() { return $klrgGameMessage.hasText() && !$klrgGameMessage.scrollMode();};KLRG_Window_Message.prototype.startMessage = function() { this._textState = {}; this._textState.index = 0; this._textState.text = this.convertEscapeCharacters($klrgGameMessage.allText()); this.newPage(this._textState); this.updatePlacement(); this.updateBackground(); this.open();};KLRG_Window_Message.prototype.updatePlacement = function() { this._positionType = $klrgGameMessage.positionType(); this.y = this._positionType * (Graphics.boxHeight - this.height) / 2; this._goldWindow.y = this.y > 0 ? 0 : Graphics.boxHeight - this._goldWindow.height;};KLRG_Window_Message.prototype.updateBackground = function() { this._background = $klrgGameMessage.background(); this.setBackgroundType(this._background);};KLRG_Window_Message.prototype.terminateMessage = function() { this.close(); this._goldWindow.close(); $klrgGameMessage.clear();};KLRG_Window_Message.prototype.updateWait = function() { if (this._waitCount > 0) { this._waitCount--; return true; } else { return false; }};KLRG_Window_Message.prototype.updateLoading = function() { if (this._faceBitmap) { if (ImageManager.isReady()) { this.drawMessageFace(); this._faceBitmap = null; return false; } else { return true; } } else { return false; }};KLRG_Window_Message.prototype.updateInput = function() { if (this.isAnySubWindowActive()) { return true; } if (this.pause) { if (this.isTriggered()) { Input.update(); this.pause = false; if (!this._textState) { this.terminateMessage(); } } return true; } return false;};KLRG_Window_Message.prototype.isAnySubWindowActive = function() { return (this._choiceWindow.active || this._numberWindow.active || this._itemWindow.active);};KLRG_Window_Message.prototype.updateMessage = function() { if (this._textState) { while (!this.isEndOfText(this._textState)) { if (this.needsNewPage(this._textState)) { this.newPage(this._textState); } this.updateShowFast(); this.processCharacter(this._textState); if (!this._showFast && !this._lineShowFast) { break; } if (this.pause || this._waitCount > 0) { break; } } if (this.isEndOfText(this._textState)) { this.onEndOfText(); } return true; } else { return false; }};KLRG_Window_Message.prototype.onEndOfText = function() { if (!this.startInput()) { if (!this._pauseSkip) { this.startPause(); } else { this.terminateMessage(); } } this._textState = null;};KLRG_Window_Message.prototype.startInput = function() { if ($klrgGameMessage.isChoice()) { this._choiceWindow.start(); return true; } else if ($klrgGameMessage.isNumberInput()) { this._numberWindow.start(); return true; } else if ($klrgGameMessage.isItemChoice()) { this._itemWindow.start(); return true; } else { return false; }};KLRG_Window_Message.prototype.isTriggered = function() { return (Input.isRepeated('ok') || Input.isRepeated('cancel') || TouchInput.isRepeated());};KLRG_Window_Message.prototype.doesContinue = function() { return ($klrgGameMessage.hasText() && !$klrgGameMessage.scrollMode() && !this.areSettingsChanged());};KLRG_Window_Message.prototype.areSettingsChanged = function() { return (this._background !== $klrgGameMessage.background() || this._positionType !== $klrgGameMessage.positionType());};KLRG_Window_Message.prototype.updateShowFast = function() { if (this.isTriggered()) { this._showFast = true; }};KLRG_Window_Message.prototype.newPage = function(textState) { this.contents.clear(); this.resetFontSettings(); this.clearFlags(); this.loadMessageFace(); textState.x = this.newLineX(); textState.y = 0; textState.left = this.newLineX(); textState.height = this.calcTextHeight(textState, false);};KLRG_Window_Message.prototype.loadMessageFace = function() { this._faceBitmap = ImageManager.loadFace($klrgGameMessage.faceName());};KLRG_Window_Message.prototype.drawMessageFace = function() { this.drawFace($klrgGameMessage.faceName(), $klrgGameMessage.faceIndex(), 0, 0);};KLRG_Window_Message.prototype.newLineX = function() { return $klrgGameMessage.faceName() === '' ? 0 : 168;};KLRG_Window_Message.prototype.processNewLine = function(textState) { this._lineShowFast = false; Window_Base.prototype.processNewLine.call(this, textState); if (this.needsNewPage(textState)) { this.startPause(); }};KLRG_Window_Message.prototype.processNewPage = function(textState) { Window_Base.prototype.processNewPage.call(this, textState); if (textState.text[textState.index] === '\n') { textState.index++; } textState.y = this.contents.height; this.startPause();};KLRG_Window_Message.prototype.isEndOfText = function(textState) { return textState.index >= textState.text.length;};KLRG_Window_Message.prototype.needsNewPage = function(textState) { return (!this.isEndOfText(textState) && textState.y + textState.height > this.contents.height);};KLRG_Window_Message.prototype.processEscapeCharacter = function(code, textState) { switch (code) { case '$': this._goldWindow.open(); break; case '.': this.startWait(15); break; case '|': this.startWait(60); break; case '!': this.startPause(); break; case '>': this._lineShowFast = true; break; case '<': this._lineShowFast = false; break; case '^': this._pauseSkip = true; break; default: Window_Base.prototype.processEscapeCharacter.call(this, code, textState); break; }};KLRG_Window_Message.prototype.startWait = function(count) { this._waitCount = count;};KLRG_Window_Message.prototype.startPause = function() { this.startWait(10); this.pause = true;}; 
So where is the function I am missing??? o,O
any news about own Message Window ?
So whats the issue exactly? You can still move around when your message window is active?

Could be this. Let me know and I can do some more digging.

Code:
Scene_Map.prototype.isBusy = function() {    return ((this._messageWindow && this._messageWindow.isClosing()) ||            this._waitCount > 0 || this._encounterEffectDuration > 0 ||            Scene_Base.prototype.isBusy.call(this));};

Original thread: https://forums.rpgmakerweb.com/threads/own-message-window-part-3-the-last-bug.49596/