Tuesday, 12 July 2016

Yanfly's Event Window

Yanfly's Event Window is a small window that automatically pops up whenever the Player gains or loses items or gold, and shows exactly what they gained or lost.

I made the following tweaks:

Only display found items


I didn't necessarily want it to show up for items lost, so I added a flag that would turn that functionality off. You could make this the ID of a global switch, much like the HIDE_SWITCH is, but I don't think I'll ever want to toggle it mid-game, so I'm just setting it to false here.


Then you modify the IF statement like below:
First half of the event_window_make_item_text method

Text format


I also added a space between the icon and the item name, and made it always show the amount that had been found even if only 1 has been found.

Second half of the event_window_make_item_text method

Only show newly found items

I personally found it confusing that the Event Window would retain its data every time a new item was found. It made me think I had gotten another of the previous item. So I added code to clear the data every time the Event Window disappeared.

If you get another item before the Event Window has had time to vanish, however, it still shows the previous item. I think this is okay, because it means the window only shows up once when multiple items are received at a time.


The Event Window actually fades away. It doesn't just vanish instantly. That's why there's an if statement to check if the opacity is at 0 before clearing the data, because this method gets called multiple times, gradually reducing the opacity of the window until it's totally gone.

Play a sound every time an item is found

The Event Window is not very obvious, so I wanted a sound to play every time an item was found.

Done during add_text since that only happens each time an item is found

What I would really like is to make it look like the Message Window and perhaps be in a more prominent place, but I haven't figured out how to do those things yet.

No comments:

Post a Comment