MV [SOLVED] Show windowskin for YEP_EventMiniLabels

Hi
I'm trying to show the window frame/skin around the 'Mini Labels from Yanfly's YEP_EventMiniLabel.
I'd post the code, but I'm not sure I'm allowed to.

Making them visible was easy, cause I could just edit "this.opacity" to 255 or something.

But the problem for me, is that when the label is hidden (plugin command: HideMiniLabel), the window stays visible.

I tried imitating the original code by adding this.opacity similar places, but it didn't have any effect.
And that's about as far as my (lack of) coding skills got me.
Spoiler
Code:
Window_EventMiniLabel.prototype.show = function() {
    if (this.contentsOpacity >= 255) return;
    this.contentsOpacity += 16;
    this.Opacity += 16; //edited
    this.visible = true;
};

Window_EventMiniLabel.prototype.hide = function() {
    if (this.contentsOpacity <= 0) {
      if (this.visible) this.visible = false;
      return;
    }
    this.contentsOpacity -= 16;
    this.Opacity -= 16; //edited


So in short, I'd like to:
1. make the mini-label "window" be visible
2. Make it Show/Hide just like the label does

But the current problem is:
When the label is hidden the window frame stays visible

yep.png
than also put the opacity inside the visible if its not true.
so it would hide there as well.
than also put the opacity inside the visible if its not true.
so it would hide there as well.
Thanks for the reply 🙂
I tried putting this.contentsOpacity = 0; in all kinds of places, but it hasn't worked out so far.
I think maybe something else is needed.
The only way I've managed to hide the window so far is by destroying it lol.
than delete it, because opacity only hides it, not remove it.
so however you draw that image, you should destroy it if not needed.

I made an overhaul of that plugin which much more features 🙂
- multiline
- range show
- automatic update (otherwise you had to update by plugin command)
- range hide kept while hiding
- label on XY screen coordinates (1 per event), find a way for multiple).
and some more 😀

so to get yours to work the way you want, I need to see and test how you draw it,
or a better way.

the better way is to use it, is through comment like: <label file: filename>
so when you hide it, it hides it, so it more efficient that way 🙂

while its an interesting idea, I try to add that as well ^^
than delete it, because opacity only hides it, not remove it.
so however you draw that image, you should destroy it if not needed.

I made an overhaul of that plugin which much more features 🙂
- multiline
- range show
- automatic update (otherwise you had to update by plugin command)
- range hide kept while hiding
- label on XY screen coordinates (1 per event), find a way for multiple).
and some more 😀

so to get yours to work the way you want, I need to see and test how you draw it,
or a better way.

the better way is to use it, is through comment like: <label file: filename>
so when you hide it, it hides it, so it more efficient that way 🙂

while its an interesting idea, I try to add that as well ^^
Sorry if I was unclear in the first post, I haven't really managed to write anything on my own :hswt2:
The code snippet in the first post was just a try to modify YEP_EventMiniLabel (by yanfly).

Basically I think he uses a normal invisible window for his labels. it takes the graphics from window.png like all other windows.

I tried to make them visible, but now they don't hide with the labels and are stuck on screen lol.
Your overhaul sounds interesting though
Your overhaul sounds interesting though
it is ^^ and I very understand your question, but it involve more than just opacity.

if you want it always be visible, set opacity on line 258 to 255 (default 0).
on hide, you can set it to 0, on visible on 255.

if you want it on a certain label only, a new comment tag would be wise to do.
but maybe its only enough to change it there, but I need to test for its effect.
it is ^^ and I very understand your question, but it involve more than just opacity.

if you want it always be visible, set opacity on line 258 to 255 (default 0).
on hide, you can set it to 0, on visible on 255.

if you want it on a certain label only, a new comment tag would be wise to do.
but maybe its only enough to change it there, but I need to test for its effect.
Alright 🙂
Setting line 258 to 255 (or 0) works fine.
But when I try it using in show/hide/visible etc, nothing happens, the window stays, label disappears.
You probably already know, but I suck at coding 😀 So I probably missed something obvious

Basically just want the window visibility to behave the same as label visibility, on all labels.
So you can have some nice graphics behind the label.
I check tomorrow for on you on base plugin (as mine has more lines, optimized).
so will look around to show windows and hide it when doing so.

(unless someone else did before me).
Cannot test this of low time, but see if it works:
Code:
line 258: set opacity 0 (default)
line 349: press enter for a new line, and add =>  this.opacity = 0;
line 354: press enter, and also add =>  this.opacity = 0;
line 357: press enter, and add =>  this.opacity = 255;
line 424: press enter, and add =>  this.opacity = 255; (show function)
line 424: press enter, and add =>   this.opacity = 255; (show function)
line 433 (behind "}") press enter and add =>  this.opacity = 0;
line 443: press enter after "{" and add =>  this.opacity = 0;

this should do the trick hopefully 🙂
let me know if it did.
Cannot test this of low time, but see if it works:
Code:
line 258: set opacity 0 (default)
line 349: press enter for a new line, and add =>  this.opacity = 0;
line 354: press enter, and also add =>  this.opacity = 0;
line 257: press enter, and add =>  this.opacity = 255;
line 424: press enter, and add =>  this.opacity = 255; (show function)
line 424: press enter, and add =>   this.opacity = 255; (show function)
line 433 (behind "}") press enter and add =>  this.opacity = 0;
line 443: press enter after "{" and add =>  this.opacity = 0;

this should do the trick hopefully 🙂
let me know if it did.
Hi again and thanks 🙂

I tried making all the changes, but the label just seems to behave as normally. When you set line 258: to 0 opacity. There's no visible window. So basically you just get the normal behavior with the text label.

Also, I wasn't sure if this was a typo? "257: press enter, and add => this.opacity = 255;", so I tried 356 and also 357 just in case 😀.



edit 2:
Ok, sorry, I did some more testing, and actually when using show/hideMiniLabel plugin command it works fine.

But if you switch event page the window stayed visible,so that was the issue :hswt2:


This seems to work to hide the window when changing event page from a page with comment, to a page without comment.
Code:
Sprite_Character.prototype.updateMiniLabel = function() {
    this.setupMiniLabel();
    if (!this._miniLabel) return;
    this.positionMiniLabel();
    // Sync window opacity with text visibility
    if (this._miniLabel._text === '' || !this._miniLabel.showMiniLabel()) {
        this._miniLabel.opacity = 0;  // added
    } else {
        this._miniLabel.opacity = 255;  // added
    }
};
the 257 was indeed a typo (my bad for that).

also, I kinda forget the no text as well for showing it or not.
as I made more changes, that complete was oversight on my end, sorry for that.

if it works correctly now the way you want, it would be solved?

Also fixed the typo for later as reference.

if it is solved indeed, put the solution on your first post and report as saved.
in case someone else want it as well 🙂
the 257 was indeed a typo (my bad for that).

also, I kinda forget the no text as well for showing it or not.
as I made more changes, that complete was oversight on my end, sorry for that.

if it works correctly now the way you want, it would be solved?

Also fixed the typo for later as reference.

if it is solved indeed, put the solution on your first post and report as saved.
in case someone else want it as well 🙂
Yea it works as intended now, thank you for you help!
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/solved-show-windowskin-for-yep_eventminilabels.175769/