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,036
Reaction score
5,907
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 Profile Posts

My home state baseball team is going back to the World Series for the first time since 1999. I remember when they went in 1995 and won, that was like the best day of my life. (I'm a huge baseball fan and yes I'm talking about the Braves).
FL Studio is a huge step up from LMMS but I'm having such a tough time with it D:<
The new Dune movie reminds me of the game Dune 2 made by Westwood. A quality product on its own, but extremely disloyal to its source of inspiration.
Terrible Writing Advice, you've done it again.
1635026211997.png

Forum statistics

Threads
116,041
Messages
1,095,232
Members
151,386
Latest member
sheyzo
Top