Hi all,
So I made this little plugin for my game and decided to share it with you. I don't consider it as "official" or anything, since it will probably have some compatibility issues, and I only made it for my game anyway. However, you may edit it to work for yours too.
So in this case I will not upload it to my GitHub, instead I will just upload it here.
WHAT IT DOES:
By default, state icons are displayed in a single line below the character's name and level. In my case i'm not using a face for my actor, so I wanted them to be displayed there.
Also, instead of using the 1 line, I wanted them to be displayed in 2 (if it's below the name) or 4 (if it's at the space where the face would be). So, basically, if you use the "face"'s space, you can have up to 16 states' icons displayed at the same time!
HOW TO USE:
1. Copy the raw code and paste it in a JS file
2. Name the file "Makai_States_Display.js"
3. Put that file in your plugin folder.
4. Turn it on from your plugins manager (duh)
EDIT: Discussing it with people with far more JS experience than me, I was informed that not everything is saved in the game files. This means that my initial script calls to alter the game windows would (probably) have to be re-run each time. So I removed them. Now the plugin takes effect immediately, while the original version of the game window is stored in maka.states.default
There may be bugs since i'm still learning, but, again, feel free to edit and use and, of course, correct me
Here it is:
Spoiler: Raw code
Code: - /*:
- *@plugindesc Change how many states' icons are displayed and where v1
- *@author Makai Rosi
- *
- *@param States Position Face
- *@type boolean
- *@on YES
- *@off NO
- *@desc If you aren't using a face for your actors, we can make use of that space.
- *YES - true NO - false
- *@default true
- *
- *@param Lines
- *@desc The max lines of the states
- *@default 4
- *
- *@help
- *This humble little plugin REPLACES how state icons are drawn on the status page.
- *If you have no face for your actor, you can use that space.
- *Also, put how many lines you want to be displayed at once.
- *Note that there is space for 4 lines where the face is, and space for 2 lines
- *if you use the default space.
- *
- *
- *I have no idea what other plugins this is compatible with. I made it for my
- *game, but share it in case it helps you too.
- *
- *
- *As always, feel free to edit it, just credit me in your plugin's help file.
- *
- */
- //plugin starts here
- var maka = maka || {};
- maka.states = maka.states || {};
- (function(){
- maka.parameters = PluginManager.parameters('Makai_States_Display');
- maka.param = maka.param || {};
- maka.param.statesFacePos = eval(String(maka.parameters['States Position Face']));
- maka.param.lines = maka.parameters['Lines'];
- //======================================FUNCTIONS=====================================================//
- maka.states.default = Window_Base.prototype.drawActorIcons;
-
- Window_Base.prototype.drawActorIcons = function(actor, x, y, width) {
- width = width || 144*maka.param.lines;
- var icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
- var new_i = 0;
- var new_posy = 0;
- var new_posx = 0;
- var iconLine = 0;
- if(maka.param.statesFacePos==true){
- new_posy = 70;
- new_posx = 150;
- };
-
- for (var i = 0; i < icons.length; i++) {
- if(new_i==4){
- iconLine++;
- new_i=0;
- };
- this.drawIcon(icons[i], x - new_posx + Window_Base._iconWidth * new_i, y + 2 + iconLine*34 - new_posy);
-
- new_i++;
- };
- };
-
- })(maka.states);
复制代码
I hope you find some use for it!
EDIT: The changed state of the plugin might not be saved when you save your game. I will edit it soon so that it works immediately, rather than with a script call. <-DONE!
License:
Use freely as commercial, non-commercial, whatever. Edit it as you wish but if you do i'd like to be credited as the original author inside the plugin description. If you want to be extra nice, you can include this page's link as well.
本贴来自国际rpgmaker官方论坛作者:MiD处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/states-icons-display-change.115985/