Status
Not open for further replies.

lesbrarians

Veteran
Veteran
Joined
May 23, 2021
Messages
85
Reaction score
63
First Language
English
Primarily Uses
RMMV
I know, I know, another thread from me about modifying CCEX.... :stickytongue: But this is, hopefully, the very last thing I need assistance with to figure out!

When I change the color of a piece, I'd like the files in the selection screen to change to match the selected color. Say I select Skintone "Dark 02" -- I'd like the images in the file list on the left to reflect that color, not just the image in the preview window on the right. Players have to manually select and apply every body type or face etc. to see what it looks like in their desired skin color, and I'd like to avoid all those unnecessary, frustrating clicks.

1632401344637.png
1632401393652.png

The code for CCEX can be found here, by clicking on "View" if you're willing to help out with this! I believe the parts I need to modify are in Window_CharacterCreator_FileList.prototype.drawItem = function(index) and Window_CharacterCreator_FileList.prototype._createStuff = function(), but that's about as far as I've gotten... Underneath the drawItem function, I tried changing this:

Code:
    const bit = _.loadImageWPath(this._allInfo[0], file);
    this.contents.blt(bit, this._allInfo[1], this._allInfo[2] * this._allInfo[7], this._allInfo[3],
        this._allInfo[4], rect.x + this._allInfo[5], rect.y + this._allInfo[6]);

to include the hue parameter, since _.loadImageWPath = function(path, filename, hue) includes that parameter -- but that did nothing, unfortunately, so I'm not sure if I'm on the wrong path with that idea or not.

Thanks in advance for any suggestions, you folks are great!!
 

lesbrarians

Veteran
Veteran
Joined
May 23, 2021
Messages
85
Reaction score
63
First Language
English
Primarily Uses
RMMV
72 hours later bump. So, I've realized that the section parts in the preview image change based on a PIXI color filter, as seen here:

JavaScript:
Window_CharacterCreator_Preview.prototype.refresh = function() {
    for(let i = 0; i < _.priorities.length; i++) {
        const section = _.priorities[i];
        if(this._pieces[section]) {
            if(!this._spritePieces[section]) {
                const info = this._pieces[section];
                this._spritePieces[section] = new this._formattingClass();
                this._spriteFilters[section] = new PIXI.filters.ColorMatrixFilter();
                this._spritePieces[section].filters = [this._spriteFilters[section]];
                if(info.color) {
                    this.setColor(section, info.color);
                }
                const bit = _.loadImageWPath(info.path, info.file, 0, true);
                bit.addLoadListener(function() {
                    if(this._spritePieces[section]) {
                        this._spritePieces[section].bitmap = bit;
                        this._spritePieces[section].refresh(true);
                    }
                }.bind(this));
            } else {
                const info = this._pieces[section];
                const bit = _.loadImageWPath(info.path, info.file, 0, true);
                bit.addLoadListener(function() {
                    if(this._spritePieces[section]) {  
                        this._spritePieces[section].bitmap = bit;
                        this._spritePieces[section].refresh(true);
                    }
                }.bind(this));
            }
        } else {
            if(this._spritePieces[section]) this._sprite.removeChild(this._spritePieces[section]);
            this._spritePieces[section] = undefined;
        }
    }
    for(let i = 0; i < _.priorities.length; i++) {
        const section = _.priorities[i];
        if(this._spritePieces[section]) {
            this._sprite.removeChild(this._spritePieces[section]);
            this._sprite.addChild(this._spritePieces[section]);
        }
    }
};

I thought it wouldn't be too hard to add the files in FileList to this function, but I am struggling with that quite a bit. I thought I could use the const images = _.getFileList(this.currentFolder()); to do that, but no dice. Can anyone offer any guidance or suggestions? Thanks!

Edit: Couldn't figure it out, so ended up commissioning someone else to do it for me!
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,003
Reaction score
5,892
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Finally got my website fixed and the security sorted so it's been a productive day. Can I go to sleep now? I mean... I don't need to work right?
It's always a good idea to refresh yourself on what your plugins do. I'm working on a map with opening walls, and I was about to tear my hair out over how much image editing and hand-constructing of autotiles I'd have to do, when I looked again and saw @Shaz 's Tile Changer could copy areas from another map.
"sorry it took me so long to respond" - can we please agree not to say that anymore unless it actually took a long time?! (Like 36hrs at least) I mean, I'm running out of funny responses here xD
Ugh... 4:53AM over here and I can't sleep so why not just game make.
I just love the MV feature that allows you to create your own animations!

Forum statistics

Threads
115,919
Messages
1,094,015
Members
151,174
Latest member
sardin
Top