Don't use a window class for showing a simple image, that's a waste of performance. >.>
Here is a much cleaner version, in case you care about performance:
Spoiler
Code:
class ActorPic
def initialize(aid)
@img = Sprite.new
@img.bitmap = Cache.load_bitmap("Graphics/Pictures/","actor_pic_#{aid}")
@img.z = 55555
end
def refresh(aid)
@img.bitmap.dispose
@img.bitmap = Cache.load_bitmap("Graphics/Pictures/","actor_pic_#{aid}")
end
def dispose
@img.bitmap.dispose
@img.dispose
end
end
class Scene_Skill < Scene_ItemBase
alias add_apics9911 create_command_window
def create_command_window
add_apics9911
@apics = ActorPic.new(@actor.id)
end
alias add_apics7725 on_actor_change
def on_actor_change
add_apics7725
@apics.refresh(@actor.id)
end
def dispose_all_windows
super
@apics.dispose
end
end
I have no idea what methods Luna engine overwrites or aliases, but if it directly defines the method
dispose_all_windows, you will need to alias it instead of calling super in it, or else this script will overwrite Luna's method.
This should go below the Luna engine scripts.
Change the folder and image name format if you like at the obvious places in the script.
I also set the Z level to something very high, but change it how you want. I tested with very small images, and couldn't see them under the windows, so I put the images above the windows.
😀
And I forgot about that other script change you asked me to do, but will do it now to avoid further forgetfulness.
😀