joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
Hello there, I'm using the standard menu. How can I display icon near to the character name into the main menu?
I'd like to put a code into database in the "note" section for each actor such as <icon 2> so that the menu can read it. It should look like the following menu screen.
 

Attachments

  • Screenshot_20210724_084423_com.android.chrome.jpg
    Screenshot_20210724_084423_com.android.chrome.jpg
    600.4 KB · Views: 11

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,249
Reaction score
726
First Language
Poland
Primarily Uses
RMMV
I don't remember who exacly made a plugin, but I'm 90% sure it is still in this forum and I had it in use in my game. It's a plugin that allows create buttons on game screen and assing to it a common event wich would be ideal for your needs, however I noticed you use primilary MZ so it might not work with MZ, it was made for MV, but your screen shot shows MV... I'm a little confused... Give few moments to remember that plugin and I provide link either in this post edit or if someone else's find what I have in mind.

Edit:
I think it was this plugin by @Aloe Guvner

Edit2:
If it is really this what you need then please be aware that if you disable mouse input in your game, buttons will not work.
 
Last edited:

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
I'm using MV, anyway the best solution for me would be to use a plugin (I've installed many Yanfly plugins including his menu) that can read the note on the Actor database so I can put there what icon should be displayed.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,249
Reaction score
726
First Language
Poland
Primarily Uses
RMMV
I don't have all Yanfly's plugins, but I don't think Picture Common Event plugin works in Scenes other than Scene_Map. I Never had a need to use it in my game.
 

BlueMoon

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
363
Reaction score
486
First Language
Italian
Primarily Uses
RMMZ
So, let me see. You can try to do something like this. Inside a js file, add this:


Code:
// As I don't know which version of MV are you using, I will use ES5 standards;

(function() {
    
    var _window_base_drawActorSimpleStatus = Window_Base.prototype.drawActorSimpleStatus;
    Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
        _window_base_drawActorSimpleStatus.call(this, actor, x, y, width);
        var data = actor.actor();
        if(!!data.meta["MenuIcon"]) {
            var iconIndex = parseInt(data.meta["MenuIcon"].trim())
            // Edit this part of the code for positioning better the [x,y] of the icon
            this.drawIcon(iconIndex,x + width - Window_Base._iconWidth,y + this.lineHeight())
        }

    };
})()

You can use this notetag for the icon index: <MenuIcon:iconIndex>
Ex.
<MenuIcon:17>
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,249
Reaction score
726
First Language
Poland
Primarily Uses
RMMV
AAAAAAAhhh, I missunderstood topic's word "close" with close (window) instead of close (near to/next to)
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
I don't have all Yanfly's plugins, but I don't think Picture Common Event plugin works in Scenes other than Scene_Map.
Don't
So, let me see. You can try to do something like this. Inside a js file, add this:


Code:
// As I don't know which version of MV are you using, I will use ES5 standards;

(function() {
   
    var _window_base_drawActorSimpleStatus = Window_Base.prototype.drawActorSimpleStatus;
    Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
        _window_base_drawActorSimpleStatus.call(this, actor, x, y, width);
        var data = actor.actor();
        if(!!data.meta["MenuIcon"]) {
            var iconIndex = parseInt(data.meta["MenuIcon"].trim())
            // Edit this part of the code for positioning better the [x,y] of the icon
            this.drawIcon(iconIndex,x + width - Window_Base._iconWidth,y + this.lineHeight())
        }

    };
})()

You can use this notetag for the icon index: <MenuIcon:iconIndex>
Ex.
<MenuIcon:17>
Thank you! Shall I add this as a new plugin? I'm not into javascript, how can install it?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,249
Reaction score
726
First Language
Poland
Primarily Uses
RMMV
Yes, save it as plugin, place it in js/plugins directory, add to plugin manager as any plugin you did before and that's all.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
Done, but that appears

1627118813918.png
 

BlueMoon

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
363
Reaction score
486
First Language
Italian
Primarily Uses
RMMZ
Mmm... Strange! I have tried to add it in a js file, too. No problem on my end. You can test my file then, I have added it for your in the attachments.
 

Attachments

  • Blue_MenuIcon.js
    2 KB · Views: 2

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
wonderful! it works. I very thank you! this community is fantastic!
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
is there a way to display it in x.y positions?

// Edit this part of the code for positioning better the [x,y] of the icon

shall I insert integers in the place of x and y?

I'd like the icon to be just to the right of the actor name (same position of Lv number, just on the upper line)
1627130356862.png
 

BlueMoon

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
363
Reaction score
486
First Language
Italian
Primarily Uses
RMMZ
You can try editing the icon drawing this way:

Code:
this.drawIcon(iconIndex,x + width/2,y)

Then, you can try to add some offsets number to place it better (ex. this.drawIcon(iconIndex,x + width/2 - 8,y + 4) etc...
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
148
Reaction score
30
First Language
English
Primarily Uses
RMMV
You can try editing the icon drawing this way:

Code:
this.drawIcon(iconIndex,x + width/2,y)

Then, you can try to add some offsets number to place it better (ex. this.drawIcon(iconIndex,x + width/2 - 8,y + 4) etc...
Perfect! Found the position, it is:
this.drawIcon(this.drawIcon(iconIndex,x + width/70 - 8,y + 75))


(for those which will need the same plugin too)

Thank you very much!
 

Latest Threads

Latest Posts

Latest Profile Posts

Welp, people are trying to quit my team because I can't code. Where's the dancing blob emoji when I need it?
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:<

Forum statistics

Threads
116,052
Messages
1,095,309
Members
151,398
Latest member
aubee
Top