じ☆ve冰风 发表于 2026-7-29 18:25:53

Display All Status Icons

Display All State Icons


v1.0 by Wavelength


for RPG Maker MV


        Just a humble script I wrote for a friend, and figured I'd share with everyone since I was surprised I couldn't find anything that did it already.


        By default the player can only see a few state icons in battle or the status menu, leaving them with incomplete information when an actor has several different statuses applied.  This script will automatically shrink the state icons when an actor has too many state icons to display at full size, so that the player can see far more icons for each actor.


        This plugin does not use standard "plugin parameters", but you can open the script in a text editor to easily change the amount that you want the icons to scale.


        Download the script here or just open the code below. 

Spoiler                Code:       
////////////////////////////////////////
//      ICON SCALING SCRIPT         //
//         for RPG Maker MV         //
//         Version 1.0            //
//by Jason "Wavelength" Commander   //
////////////////////////////////////////

// By default, only a few state icons can be shown at once.This script will scale down the icons'
// display size by a factor of your choice if there are too many to display at full size, so that
// players can be aware of all of the states that are currently affecting their actors.

// TERMS OF USE
// You may use this script for your commercial or noncommercial RPG Maker games.
// You must credit me in your game or documentation (as Jason Commander or as Wavelength).
// For any other use of this script besides inclusion in an RPG Maker game, contact me.
// Thanks!


// This value can be changed to determine how much to scale down the icons when there are too many to
// display at full size.For example, a value of 2 will reduce width and height by half.
Game_Party.ICON_SCALE = 2;


/*:
*
* @plugindesc This script sizes status icons down when there are too many to display at full size.
* @author Jason "Wavelength" Commander
* @help By opening the script in a text editor,
you can change the amount that icons will scale.
*
* By default, they will scale to half size when
* there are too many icons to display at full size.
*
*/



Window_Base.prototype.drawSmallIcon = function(iconIndex, x, y) {
        var scaler = Game_Party.ICON_SCALE;
    var bitmap = ImageManager.loadSystem('IconSet');
    var pw = Window_Base._iconWidth / scaler;
    var ph = Window_Base._iconHeight / scaler;
    var sx = iconIndex % 16 * (pw * scaler);
    var sy = Math.floor(iconIndex / 16) * (ph * scaler);
    this.contents.blt(bitmap, sx, sy, pw * scaler, ph * scaler, x, y,
                    Window_Base._iconWidth / scaler, Window_Base._iconHeight / scaler);
};

Window_Base.prototype.drawActorIcons = function(actor, x, y, width) {
    width = width || 144;
    too_big = false;
    if (actor.allIcons().length > Math.floor(width / Window_Base._iconWidth)) {
            too_big = true;
    }
    if (too_big === false) {
            var icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
          for (var i = 0; i < icons.length; i++) {
                this.drawIcon(icons, x + Window_Base._iconWidth * i, y + 2);
          }
        } else {
                var scaler = Game_Party.ICON_SCALE;
                row_size = (Math.floor(width / (Window_Base._iconWidth / scaler)));
                rows_needed = Math.floor((actor.allIcons().length - 1) / row_size) + 1;
                for (j = 0; j < rows_needed; j++) {
                        var icons = actor.allIcons().slice(0,
                                        Math.floor(width / (Window_Base._iconWidth / (scaler * scaler))));
                  for (var i = 0; i < row_size; i++) {
                        this.drawSmallIcon(icons[(j * row_size + i)],
                                        x + ((Window_Base._iconWidth / scaler) * (i % row_size)),
                                        y + (j * (Window_Base._iconHeight / scaler)) + 2);
                        if (((j * row_size) + i + 1) >= actor.allIcons().length) {
                                break;
                        }
                        }
                }
        }
};







Screenshots:

Spoilerhttps://forums.rpgmakerweb.com/data/attachments/18/18346-1511e9628b462d9edae271c1954ebdb9.jpg


https://forums.rpgmakerweb.com/data/attachments/18/18347-4314091ccd1f0b70751f2a91de5ffdcb.jpg






Terms of Use:


        You may use this script for your commercial or noncommercial RPG Maker games.
        You must credit me in your game or documentation (as Jason Commander or as Wavelength).
        For any other use of this script besides inclusion in an RPG Maker game, contact me.


本贴来自国际rpgmaker官方论坛作者:Wavelength处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/display-all-status-icons.56880/
页: [1]
查看完整版本: Display All Status Icons