[Help] SRD 'Window Skin Option' memory leak problem

Discussion in 'Javascript/Plugin Support' started by Oscar92player, May 15, 2018.

  1. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    188
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Hi! Recently, I was trying to figure out how to solve a little problem with SumRndmDde plugin 'Window Skin Option', since it seems to have memory leak problems.

    When you are selecting your windows skins, if you are doing it repeatedly or even with small pauses between the selection, later you are able to see that there are frame drops, and lag when the windows are changing the graphic. If you open the Task Manager in Windows, the RAM and CPU compsumption have increased a lot, due to a problem with this plugin, because it is not erasing the stored cache for the window skins loaded previously.

    I would like to ask you for help trying to fix this issue, since it can be a big problem if the user is deciding which window skin is going to use through the game, because it can crash the game or even the computer.

    Here is the plugin:
    Code:
    /*:
     * @plugindesc Adds a Window Skin selector to the Options Window that allows the Player to choose a Window Skin for the game.
     * @author SumRndmDde
     *
     * @param Option Name
     * @desc The name used by the Window Skin option.
     * @default Window Skin
     *
     * @param Position
     * @desc The position of the option in the Options Window.
     * Choices are: Top, Middle, Bottom
     * @default Middle
     *
     * @param == Default Skin ==
     * @default
     *
     * @param Default Skin Name
     * @desc The name that appears in the Options Window for the default Window Skin.
     * @default Default
     *
     * @param == Window Skin 1 ==
     * @default
     *
     * @param Skin 1 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 1.
     * @default
     *
     * @param Skin 1 Name
     * @desc The name that appears in the Options Window for Window Skin 1.
     * @default
     *
     * @param Skin 1 Switch
     * @desc The Switch ID that must be ON for Skin 1 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 2 ==
     * @default
     *
     * @param Skin 2 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 2.
     * @default
     *
     * @param Skin 2 Name
     * @desc The name that appears in the Options Window for Window Skin 2.
     * @default
     *
     * @param Skin 2 Switch
     * @desc The Switch ID that must be ON for Skin 2 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 3 ==
     * @default
     *
     * @param Skin 3 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 3.
     * @default
     *
     * @param Skin 3 Name
     * @desc The name that appears in the Options Window for Window Skin 3.
     * @default
     *
     * @param Skin 3 Switch
     * @desc The Switch ID that must be ON for Skin 3 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 4 ==
     * @default
     *
     * @param Skin 4 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 4.
     * @default
     *
     * @param Skin 4 Name
     * @desc The name that appears in the Options Window for Window Skin 4.
     * @default
     *
     * @param Skin 4 Switch
     * @desc The Switch ID that must be ON for Skin 4 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 5 ==
     * @default
     *
     * @param Skin 5 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 5.
     * @default
     *
     * @param Skin 5 Name
     * @desc The name that appears in the Options Window for Window Skin 5.
     * @default
     *
     * @param Skin 5 Switch
     * @desc The Switch ID that must be ON for Skin 5 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 6 ==
     * @default
     *
     * @param Skin 6 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 6.
     * @default
     *
     * @param Skin 6 Name
     * @desc The name that appears in the Options Window for Window Skin 6.
     * @default
     *
     * @param Skin 6 Switch
     * @desc The Switch ID that must be ON for Skin 6 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 7 ==
     * @default
     *
     * @param Skin 7 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 7.
     * @default
     *
     * @param Skin 7 Name
     * @desc The name that appears in the Options Window for Window Skin 7.
     * @default
     *
     * @param Skin 7 Switch
     * @desc The Switch ID that must be ON for Skin 7 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 8 ==
     * @default
     *
     * @param Skin 8 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 8.
     * @default
     *
     * @param Skin 8 Name
     * @desc The name that appears in the Options Window for Window Skin 8.
     * @default
     *
     * @param Skin 8 Switch
     * @desc The Switch ID that must be ON for Skin 8 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 9 ==
     * @default
     *
     * @param Skin 9 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 9.
     * @default
     *
     * @param Skin 9 Name
     * @desc The name that appears in the Options Window for Window Skin 9.
     * @default
     *
     * @param Skin 9 Switch
     * @desc The Switch ID that must be ON for Skin 9 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 10 ==
     * @default
     *
     * @param Skin 10 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 10.
     * @default
     *
     * @param Skin 10 Name
     * @desc The name that appears in the Options Window for Window Skin 10.
     * @default
     *
     * @param Skin 10 Switch
     * @desc The Switch ID that must be ON for Skin 10 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 11 ==
     * @default
     *
     * @param Skin 11 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 11.
     * @default
     *
     * @param Skin 11 Name
     * @desc The name that appears in the Options Window for Window Skin 11.
     * @default
     *
     * @param Skin 11 Switch
     * @desc The Switch ID that must be ON for Skin 11 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 12 ==
     * @default
     *
     * @param Skin 12 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 12.
     * @default
     *
     * @param Skin 12 Name
     * @desc The name that appears in the Options Window for Window Skin 12.
     * @default
     *
     * @param Skin 12 Switch
     * @desc The Switch ID that must be ON for Skin 12 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 13 ==
     * @default
     *
     * @param Skin 13 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 13.
     * @default
     *
     * @param Skin 13 Name
     * @desc The name that appears in the Options Window for Window Skin 13.
     * @default
     *
     * @param Skin 13 Switch
     * @desc The Switch ID that must be ON for Skin 13 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 14 ==
     * @default
     *
     * @param Skin 14 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 14.
     * @default
     *
     * @param Skin 14 Name
     * @desc The name that appears in the Options Window for Window Skin 14.
     * @default
     *
     * @param Skin 14 Switch
     * @desc The Switch ID that must be ON for Skin 14 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 15 ==
     * @default
     *
     * @param Skin 15 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 15.
     * @default
     *
     * @param Skin 15 Name
     * @desc The name that appears in the Options Window for Window Skin 15.
     * @default
     *
     * @param Skin 15 Switch
     * @desc The Switch ID that must be ON for Skin 15 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 16 ==
     * @default
     *
     * @param Skin 16 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 16.
     * @default
     *
     * @param Skin 16 Name
     * @desc The name that appears in the Options Window for Window Skin 16.
     * @default
     *
     * @param Skin 16 Switch
     * @desc The Switch ID that must be ON for Skin 16 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 17 ==
     * @default
     *
     * @param Skin 17 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 17.
     * @default
     *
     * @param Skin 17 Name
     * @desc The name that appears in the Options Window for Window Skin 17.
     * @default
     *
     * @param Skin 17 Switch
     * @desc The Switch ID that must be ON for Skin 17 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 18 ==
     * @default
     *
     * @param Skin 18 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 18.
     * @default
     *
     * @param Skin 18 Name
     * @desc The name that appears in the Options Window for Window Skin 18.
     * @default
     *
     * @param Skin 18 Switch
     * @desc The Switch ID that must be ON for Skin 18 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 19 ==
     * @default
     *
     * @param Skin 19 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 19.
     * @default
     *
     * @param Skin 19 Name
     * @desc The name that appears in the Options Window for Window Skin 19.
     * @default
     *
     * @param Skin 19 Switch
     * @desc The Switch ID that must be ON for Skin 19 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 20 ==
     * @default
     *
     * @param Skin 20 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 20.
     * @default
     *
     * @param Skin 20 Name
     * @desc The name that appears in the Options Window for Window Skin 20.
     * @default
     *
     * @param Skin 20 Switch
     * @desc The Switch ID that must be ON for Skin 20 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 21 ==
     * @default
     *
     * @param Skin 21 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 21.
     * @default
     *
     * @param Skin 21 Name
     * @desc The name that appears in the Options Window for Window Skin 21.
     * @default
     *
     * @param Skin 21 Switch
     * @desc The Switch ID that must be ON for Skin 21 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 22 ==
     * @default
     *
     * @param Skin 22 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 22.
     * @default
     *
     * @param Skin 22 Name
     * @desc The name that appears in the Options Window for Window Skin 22.
     * @default
     *
     * @param Skin 22 Switch
     * @desc The Switch ID that must be ON for Skin 22 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 23 ==
     * @default
     *
     * @param Skin 23 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 23.
     * @default
     *
     * @param Skin 23 Name
     * @desc The name that appears in the Options Window for Window Skin 23.
     * @default
     *
     * @param Skin 23 Switch
     * @desc The Switch ID that must be ON for Skin 23 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 24 ==
     * @default
     *
     * @param Skin 24 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 24.
     * @default
     *
     * @param Skin 24 Name
     * @desc The name that appears in the Options Window for Window Skin 24.
     * @default
     *
     * @param Skin 24 Switch
     * @desc The Switch ID that must be ON for Skin 24 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 25 ==
     * @default
     *
     * @param Skin 25 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 25.
     * @default
     *
     * @param Skin 25 Name
     * @desc The name that appears in the Options Window for Window Skin 25.
     * @default
     *
     * @param Skin 25 Switch
     * @desc The Switch ID that must be ON for Skin 25 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 26 ==
     * @default
     *
     * @param Skin 26 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 26.
     * @default
     *
     * @param Skin 26 Name
     * @desc The name that appears in the Options Window for Window Skin 26.
     * @default
     *
     * @param Skin 26 Switch
     * @desc The Switch ID that must be ON for Skin 26 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 27 ==
     * @default
     *
     * @param Skin 27 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 27.
     * @default
     *
     * @param Skin 27 Name
     * @desc The name that appears in the Options Window for Window Skin 27.
     * @default
     *
     * @param Skin 27 Switch
     * @desc The Switch ID that must be ON for Skin 27 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 28 ==
     * @default
     *
     * @param Skin 28 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 28.
     * @default
     *
     * @param Skin 28 Name
     * @desc The name that appears in the Options Window for Window Skin 28.
     * @default
     *
     * @param Skin 28 Switch
     * @desc The Switch ID that must be ON for Skin 28 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 29 ==
     * @default
     *
     * @param Skin 29 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 29.
     * @default
     *
     * @param Skin 29 Name
     * @desc The name that appears in the Options Window for Window Skin 29.
     * @default
     *
     * @param Skin 29 Switch
     * @desc The Switch ID that must be ON for Skin 29 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 30 ==
     * @default
     *
     * @param Skin 30 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 30.
     * @default
     *
     * @param Skin 30 Name
     * @desc The name that appears in the Options Window for Window Skin 30.
     * @default
     *
     * @param Skin 30 Switch
     * @desc The Switch ID that must be ON for Skin 30 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 31 ==
     * @default
     *
     * @param Skin 31 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 31.
     * @default
     *
     * @param Skin 31 Name
     * @desc The name that appears in the Options Window for Window Skin 31.
     * @default
     *
     * @param Skin 31 Switch
     * @desc The Switch ID that must be ON for Skin 31 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 32 ==
     * @default
     *
     * @param Skin 32 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 32.
     * @default
     *
     * @param Skin 32 Name
     * @desc The name that appears in the Options Window for Window Skin 32.
     * @default
     *
     * @param Skin 32 Switch
     * @desc The Switch ID that must be ON for Skin 32 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 33 ==
     * @default
     *
     * @param Skin 33 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 33.
     * @default
     *
     * @param Skin 33 Name
     * @desc The name that appears in the Options Window for Window Skin 33.
     * @default
     *
     * @param Skin 33 Switch
     * @desc The Switch ID that must be ON for Skin 33 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 34 ==
     * @default
     *
     * @param Skin 34 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 34.
     * @default
     *
     * @param Skin 34 Name
     * @desc The name that appears in the Options Window for Window Skin 34.
     * @default
     *
     * @param Skin 34 Switch
     * @desc The Switch ID that must be ON for Skin 34 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 35 ==
     * @default
     *
     * @param Skin 35 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 35.
     * @default
     *
     * @param Skin 35 Name
     * @desc The name that appears in the Options Window for Window Skin 35.
     * @default
     *
     * @param Skin 35 Switch
     * @desc The Switch ID that must be ON for Skin 35 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 36 ==
     * @default
     *
     * @param Skin 36 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 36.
     * @default
     *
     * @param Skin 36 Name
     * @desc The name that appears in the Options Window for Window Skin 36.
     * @default
     *
     * @param Skin 36 Switch
     * @desc The Switch ID that must be ON for Skin 36 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 37 ==
     * @default
     *
     * @param Skin 37 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 37.
     * @default
     *
     * @param Skin 37 Name
     * @desc The name that appears in the Options Window for Window Skin 37.
     * @default
     *
     * @param Skin 37 Switch
     * @desc The Switch ID that must be ON for Skin 37 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 38 ==
     * @default
     *
     * @param Skin 38 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 38.
     * @default
     *
     * @param Skin 38 Name
     * @desc The name that appears in the Options Window for Window Skin 38.
     * @default
     *
     * @param Skin 38 Switch
     * @desc The Switch ID that must be ON for Skin 38 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 39 ==
     * @default
     *
     * @param Skin 39 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 39.
     * @default
     *
     * @param Skin 39 Name
     * @desc The name that appears in the Options Window for Window Skin 39.
     * @default
     *
     * @param Skin 39 Switch
     * @desc The Switch ID that must be ON for Skin 39 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 40 ==
     * @default
     *
     * @param Skin 40 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 40.
     * @default
     *
     * @param Skin 40 Name
     * @desc The name that appears in the Options Window for Window Skin 40.
     * @default
     *
     * @param Skin 40 Switch
     * @desc The Switch ID that must be ON for Skin 40 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 41 ==
     * @default
     *
     * @param Skin 41 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 41.
     * @default
     *
     * @param Skin 41 Name
     * @desc The name that appears in the Options Window for Window Skin 41.
     * @default
     *
     * @param Skin 41 Switch
     * @desc The Switch ID that must be ON for Skin 41 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 42 ==
     * @default
     *
     * @param Skin 42 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 42.
     * @default
     *
     * @param Skin 42 Name
     * @desc The name that appears in the Options Window for Window Skin 42.
     * @default
     *
     * @param Skin 42 Switch
     * @desc The Switch ID that must be ON for Skin 42 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 43 ==
     * @default
     *
     * @param Skin 43 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 43.
     * @default
     *
     * @param Skin 43 Name
     * @desc The name that appears in the Options Window for Window Skin 43.
     * @default
     *
     * @param Skin 43 Switch
     * @desc The Switch ID that must be ON for Skin 43 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 44 ==
     * @default
     *
     * @param Skin 44 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 44.
     * @default
     *
     * @param Skin 44 Name
     * @desc The name that appears in the Options Window for Window Skin 44.
     * @default
     *
     * @param Skin 44 Switch
     * @desc The Switch ID that must be ON for Skin 44 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 45 ==
     * @default
     *
     * @param Skin 45 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 45.
     * @default
     *
     * @param Skin 45 Name
     * @desc The name that appears in the Options Window for Window Skin 45.
     * @default
     *
     * @param Skin 45 Switch
     * @desc The Switch ID that must be ON for Skin 45 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 46 ==
     * @default
     *
     * @param Skin 46 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 46.
     * @default
     *
     * @param Skin 46 Name
     * @desc The name that appears in the Options Window for Window Skin 46.
     * @default
     *
     * @param Skin 46 Switch
     * @desc The Switch ID that must be ON for Skin 46 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 47 ==
     * @default
     *
     * @param Skin 47 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 47.
     * @default
     *
     * @param Skin 47 Name
     * @desc The name that appears in the Options Window for Window Skin 47.
     * @default
     *
     * @param Skin 47 Switch
     * @desc The Switch ID that must be ON for Skin 47 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 48 ==
     * @default
     *
     * @param Skin 48 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 48.
     * @default
     *
     * @param Skin 48 Name
     * @desc The name that appears in the Options Window for Window Skin 48.
     * @default
     *
     * @param Skin 48 Switch
     * @desc The Switch ID that must be ON for Skin 48 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 49 ==
     * @default
     *
     * @param Skin 49 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 49.
     * @default
     *
     * @param Skin 49 Name
     * @desc The name that appears in the Options Window for Window Skin 49.
     * @default
     *
     * @param Skin 49 Switch
     * @desc The Switch ID that must be ON for Skin 49 to be accessable. Leave blank to always allow.
     * @default
     *
     * @param == Window Skin 50 ==
     * @default
     *
     * @param Skin 50 File
     * @desc Input the file name of Window Skin in /img/SumRndmDde/window/ that will be Window Skin 50.
     * @default
     *
     * @param Skin 50 Name
     * @desc The name that appears in the Options Window for Window Skin 50.
     * @default
     *
     * @param Skin 50 Switch
     * @desc The Switch ID that must be ON for Skin 50 to be accessable. Leave blank to always allow.
     * @default
     *
     * @help
     *
     * Window Skin Option
     * Version 1.00
     * SumRndmDde
     *
     *
     * This Plugin adds a Window Skin selector to the Options Window that allows
     * the Player to choose a Window Skin for the game.
     *
     *
     * ==========================================================================
     *  How to Set up the Images
     * ==========================================================================
     *
     * First place all of the Window Skins you wish to use in:
     *
     * /img/SumRndmDde/window/
     *
     * This does not include the default Window Skin which should be placed in
     * the normal location: /img/system/Window.png
     *
     *
     * ==========================================================================
     *  How to Set up the Options
     * ==========================================================================
     *
     * In order to set up the order and the names for the Window Skins in the
     * Options Menu, you must use the Parameters.
     *
     * It is manadatory that one Window Skin is available for the Player, and
     * that Window Skin is the default one located here: /img/system/Window.png
     * Using the "Default Skin Name" Parameter, you can give it a specific
     * name when selected in the Options Menu.
     *
     * Next, you can set up the choices by filling out the "Window Skin" sections.
     *
     * Using "Skin # File", input the name of a Window Skin file located in:
     * /img/SumRndmDde/window/
     *
     * Next, use "Skin # Name", set the name of that Window Skin that will be
     * displayed in the Options Menu.
     *
     * Once you have filled out both Parameters for one "Window Skin" section,
     * it will be available in the Options Menu in game.
     *
     *
     * ==========================================================================
     *  End of Help File
     * ==========================================================================
     *
     * Welcome to the bottom of the Help file.
     *
     *
     * Thanks for reading!
     * If you have questions, or if you enjoyed this Plugin, please check
     * out my YouTube channel!
     *
     * https://www.youtube.com/c/SumRndmDde
     *
     *
     * Until next time,
     *   ~ SumRndmDde
     *
     */
    
    var SRD = SRD || {};
    SRD.WindowSkinOptions = SRD.WindowSkinOptions || {};
    
    var Imported = Imported || {};
    Imported["SumRndmDde Window Skin Options"] = true;
    
    (function(_) {
    
        "use strict";
    
        _.name = String(PluginManager.parameters('SRD_WindowSkinOption')['Option Name']);
        _.position = String(PluginManager.parameters('SRD_WindowSkinOption')['Position']).trim().toLowerCase();
    
        _.defaultName = String(PluginManager.parameters('SRD_WindowSkinOption')['Default Skin Name']);
    
        _.index = 0;
        _.lowest = 0;
        _.windows = ["Window"];
        _.names = [_.defaultName];
        _.switches = [0];
        for(var i = 1; i <= 50; i++) {
            var file = String(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' File']);
            var name = String(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' Name']);
            var swit = parseInt(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' Switch']);
            if(file.trim().length > 0) _.windows[i] = file;
            if(name.trim().length > 0) _.names[i] = name;
            if(swit) _.switches[i] = swit;
        }
    
        _.loadImage = function(filename, hue) {
            return ImageManager.loadBitmap('img/SumRndmDde/window/', filename, hue, true);
        };
    
        //-----------------------------------------------------------------------------
        // ConfigManager
        //-----------------------------------------------------------------------------
    
        Object.defineProperty(ConfigManager, 'windowSkin', {
            get: function() {
                while((_.switches[_.index] && _.switches[_.index] != 0) && (!$gameSwitches || !$gameSwitches.value(_.switches[_.index]))) {
                    _.index++;
                    if(_.index > _.windows.length - 1) _.index = 0;
                }
                return _.index;
            },
            set: function(value) {
                _.index = Number(value).clamp(_.lowest, _.windows.length - 1);
                while((_.switches[_.index] && _.switches[_.index] != 0) && (!$gameSwitches || !$gameSwitches.value(_.switches[_.index]))) {
                    _.index++;
                    if(_.index > _.windows.length - 1) _.index = 0;
                }
            },
            configurable: true
        });
    
        var _ConfigManager_makeData = ConfigManager.makeData;
        ConfigManager.makeData = function() {
            var config = _ConfigManager_makeData.call(this);
            config.windowSkin = this.windowSkin;
            return config;
        };
    
        var _ConfigManager_applyData = ConfigManager.applyData;
        ConfigManager.applyData = function(config) {
            _ConfigManager_applyData.call(this, config);
            this.windowSkin = this.readWindowskin(config, 'windowSkin');
        };
    
        ConfigManager.readWindowskin = function(config, name) {
            var value = config[name];
            if (value !== undefined) {
                return value;
            } else {
                return _.lowest;
            }
        };
    
        //-----------------------------------------------------------------------------
        // Window_Base
        //-----------------------------------------------------------------------------
    
        var _Window_Base_initialize = Window_Base.prototype.initialize;
        Window_Base.prototype.initialize = function(x, y, width, height) {
            _Window_Base_initialize.call(this, x, y, width, height);
            this._windowSkinName = "";
        };
    
        var _Window_Base_update = Window_Base.prototype.update;
        if(Imported["SumRndmDde Individual Skins for Windows"]) {
            Window_Base.prototype.update = function() {
                _Window_Base_update.call(this);
                if(!SRD.IndividualSkinsForWindows.skins[this.constructor.name] && this._windowSkinName !== _.windows[ConfigManager.windowSkin]) {
                    if(_.index === 0) {
                        this.windowskin = ImageManager.loadSystem(_.windows[ConfigManager.windowSkin]);
                    } else {
                        this.windowskin = _.loadImage(_.windows[ConfigManager.windowSkin]);
                    }
                    this._windowSkinName = _.windows[ConfigManager.windowSkin];
                }
            };
        } else {
            Window_Base.prototype.update = function() {
                _Window_Base_update.call(this);
                if(this._windowSkinName !== _.windows[ConfigManager.windowSkin]) {
                    if(_.index === 0) {
                        this.windowskin = ImageManager.loadSystem(_.windows[ConfigManager.windowSkin]);
                    } else {
                        this.windowskin = _.loadImage(_.windows[ConfigManager.windowSkin]);
                    }
                    this._windowSkinName = _.windows[ConfigManager.windowSkin];
                }
            };
        }
    
        //-----------------------------------------------------------------------------
        // Window_Options
        //-----------------------------------------------------------------------------
    
        var _Window_Options_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
        Window_Options.prototype.addGeneralOptions = function() {
            _Window_Options_addGeneralOptions.call(this);
            if(_.position === 'middle') {
                this.addCommand(_.name, 'windowSkin');
            }
        };
    
        var _Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
        Window_Options.prototype.makeCommandList = function() {
            if(_.position === 'top') {
                this.addCommand(_.name, 'windowSkin');
            }
            _Window_Options_makeCommandList.call(this);
        };
    
        var _Window_Options_addVolumeOptions = Window_Options.prototype.addVolumeOptions;
        Window_Options.prototype.addVolumeOptions = function() {
            _Window_Options_addVolumeOptions.call(this);
            if(_.position === 'bottom') {
                this.addCommand(_.name, 'windowSkin');
            }
        };
    
        var _Window_Options_statusText = Window_Options.prototype.statusText;
        Window_Options.prototype.statusText = function(index) {
            var symbol = this.commandSymbol(index);
            var value = this.getConfigValue(symbol);
            if(this.isWindowSkinSymbol(symbol)) {
                return this.windowSkinStatusText(value);
            }
            return _Window_Options_statusText.call(this, index);
        };
    
        Window_Options.prototype.isWindowSkinSymbol = function(symbol) {
            return symbol === 'windowSkin';
        };
    
        Window_Options.prototype.windowSkinStatusText = function(value) {
            return _.names[value];
        };
    
        var _Window_Options_processOk = Window_Options.prototype.processOk;
        Window_Options.prototype.processOk = function() {
            var index = this.index();
            var symbol = this.commandSymbol(index);
            var value = this.getConfigValue(symbol);
            _Window_Options_processOk.call(this);
            if(this.isWindowSkinSymbol(symbol)) {
                value += 1;
                if(value >= _.windows.length) value = _.lowest;
                this.changeValue(symbol, value);
            }
        };
    
        var _Window_Options_cursorRight = Window_Options.prototype.cursorRight;
        Window_Options.prototype.cursorRight = function(wrap) {
            var index = this.index();
            var symbol = this.commandSymbol(index);
            var value = this.getConfigValue(symbol);
            _Window_Options_cursorRight.call(this, wrap);
            if(this.isWindowSkinSymbol(symbol)) {
                value += 1;
                this.changeValue(symbol, value);
            }
        };
    
        var _Window_Options_cursorLeft = Window_Options.prototype.cursorLeft;
        Window_Options.prototype.cursorLeft = function(wrap) {
            var index = this.index();
            var symbol = this.commandSymbol(index);
            var value = this.getConfigValue(symbol);
            _Window_Options_cursorLeft.call(this, wrap);
            if(this.isWindowSkinSymbol(symbol)) {
                value -= 1;
                this.changeValue(symbol, value);
            }
        };
    
    })(SRD.WindowSkinOptions);
    Please, this is something important for me and other users, since it is the only plugin at this moment that allows to change the window skin through the Options menu.

    Thanks in advance!
     
    #1
  2. JamesRyan

    JamesRyan Game Designer Veteran

    Messages:
    589
    Likes Received:
    186
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMMV
    Are you using his Game Upgrade plugin? If yes, it must be the one who causes memory leaks.
     
    #2
  3. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    188
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Nope, in fact, I've deactivated the Game Upgrade plugin in all the projects where I tested the Window Skin Option plugin, and it still has memory leak issues when changing the window skins after a while.
     
    #3
  4. JamesRyan

    JamesRyan Game Designer Veteran

    Messages:
    589
    Likes Received:
    186
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMMV
    So this one too, huh? I heard that he abandoned making plugins. It should be the best if we get an official fix from the owner.
     
    #4
  5. Oscar92player

    Oscar92player Veteran Veteran

    Messages:
    443
    Likes Received:
    188
    Location:
    Benalmádena - Málaga - Spain
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Sorry to say this, but forget about SRD, I doubt he is going to fix this or release new plugins, even knowing that some of them have serious problems with memory leak.

    If we can only fix this by ourselves... and the last option we have is that Yanfly could release a plugin for window skin selection, now that he gave us the Options Core plugin, but I don't think so at this moment.
     
    #5
  6. JamesRyan

    JamesRyan Game Designer Veteran

    Messages:
    589
    Likes Received:
    186
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMMV
    I did try to contact SRD to report about memory leaks in his plugins before, but no reply. I think you should remove his window skin plugin and keep on developing other features until a new plugin with the same feature from someone else (like Yanfly) is released.
     
    #6
    Oscar92player likes this.

Share This Page