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,050
Reaction score
5,920
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

I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e
I added a little squish effect when characters change direction to try and make things a bit more lively. Though it's a bit hard to see on the fast moving guys.
2f4fiuy.gif

Forum statistics

Threads
116,123
Messages
1,095,957
Members
151,534
Latest member
clique
Top