Hi!
I don't know if it really fits here since I think I don't know if a change in the code can be considered a feature. But also don't know where to put this.
Description of the Feature:
Change the way that Scene_Map.prototype creates the menu button.
Currently, it is as below:
So if I want to add a new button, I have to do something like that:
I know I can just alias the createDisplayObject too. But since there is a function to create buttons...
Mockups:
But I think it can be something like that:
So in the plugin we can do something like that:
Why is this feature good?
This feature is great because of the following:
Possible issues with this feature?
Issues that might arise from this feature:
I don't know if it really fits here since I think I don't know if a change in the code can be considered a feature. But also don't know where to put this.
Description of the Feature:
Change the way that Scene_Map.prototype creates the menu button.
Currently, it is as below:
JavaScript:
Scene_Map.prototype.createDisplayObjects = function() {
this.createSpriteset();
this.createWindowLayer();
this.createAllWindows();
this.createButtons();
};
Scene_Map.prototype.createButtons = function() {
if (ConfigManager.touchUI) {
this.createMenuButton();
}
};
So if I want to add a new button, I have to do something like that:
JavaScript:
const alias = Scene_Map.prototype.createButtons;
Scene_Map.prototype.createButtons = function() {
alias.call(this);
if (ConfigManager.touchUI) { // Repeating this code again.
this.createMyCustomButton();
}
};
I know I can just alias the createDisplayObject too. But since there is a function to create buttons...
Mockups:
But I think it can be something like that:
JavaScript:
Scene_Map.prototype.createDisplayObjects = function() {
this.createSpriteset();
this.createWindowLayer();
this.createAllWindows();
this.createButtons();
};
Scene_Map.prototype.createButtons = function() {
if (ConfigManager.touchUI) {
this.createAllButtons();
}
};
Scene_Map.prototype.createAllButtons = function() {
this.createMenuButton();
};
So in the plugin we can do something like that:
JavaScript:
const alias = Scene_Map.prototype.createAllButtons;
Scene_Map.prototype.createAllButtons = function() {
alias.call(this);
this.createMyCustomButton();
};
Why is this feature good?
This feature is great because of the following:
- I think if it is this way, will be cleaner and easier for plugin makers alias the function in case we want to add more buttons, without repeating the if statement to check the ConfigManager.TouchUi:
Possible issues with this feature?
Issues that might arise from this feature:
- I can't see any issues, besides a little more code.