Double_X

DoubleX RMMV Skill Hotkeys v101b

Sep 8th, 2017 (edited)
735
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*============================================================================
  2.  *    ## Plugin Info
  3.  *----------------------------------------------------------------------------
  4.  *    # Plugin Name
  5.  *      DoubleX RMMV Skill Hotkeys
  6.  *----------------------------------------------------------------------------
  7.  *    # Introduction
  8.  *    1. When the party's out of battles, an actor can bind hotkeys to his/her
  9.  *       currently usable/unusable skills in the skill menu, unless the result
  10.  *       of the relevant notetags indicates otherwise
  11.  *       All these bindings will be saved
  12.  *    2. When the party's inside battles, an actor having nonempty hotkey slot
  13.  *       can use hotkeys to use their corresponding usable skills directly,
  14.  *       unless the result of the relevant notetags indicates otherwise
  15.  *----------------------------------------------------------------------------
  16.  *    # Terms Of Use
  17.  *      1. Commercial use's always allowed and crediting me's always optional.
  18.  *      2. You shall keep this plugin's Plugin Info part's contents intact.
  19.  *      3. You shalln't claim that this plugin's written by anyone other than
  20.  *         DoubleX or my aliases. I always reserve the right to deny you from
  21.  *         using any of my plugins anymore if you've violated this.
  22.  *      4. CC BY 4.0, except those conflicting with any of the above, applies
  23.  *         to this plugin, unless you've my permissions not needing follow so.
  24.  *      5. I always reserve the right to deny you from using this plugin
  25.  *         anymore if you've violated any of the above.
  26.  *----------------------------------------------------------------------------
  27.  *    # Prerequisites
  28.  *      Abilities:
  29.  *      1. Nothing special for most ordinary cases
  30.  *      2. Little RMMV plugin development proficiency for more advanced uses
  31.  *      3. Some RMMV plugin development proficiency to fully utilize this
  32.  *----------------------------------------------------------------------------
  33.  *    # Author Notes
  34.  *      1. DoubleX RMMV Skill Hotkeys aims to give extreme control and freedom
  35.  *         to users by making it as flexible as I can with as little damage to
  36.  *         user-friendliness as I can
  37.  *----------------------------------------------------------------------------
  38.  *    # Links
  39.  *      This plugin:
  40.  *      1. https://pastebin.com/iEfRMhf3
  41.  *      Video:
  42.  *      1. https://www.youtube.com/watch?v=iBaFP_cN5yE
  43.  *      DoubleX RMMV Skill Hotkeys Unit Test:
  44.  *      1. https://pastebin.com/iHh5frL3
  45.  *----------------------------------------------------------------------------
  46.  *    # Instructions
  47.  *      1. If you want to edit configurations instead of parameters, you must
  48.  *         open this js file to access its configuration region
  49.  *         Some settings, like the hotkey mappings, are only available as
  50.  *         configurations
  51.  *      2. The default plugin file name is DoubleX RMMV Skill Hotkeys v101b
  52.  *         If you want to change that, you must edit the value of
  53.  *         DoubleX_RMMV.Skill_Hotkeys_File, which must be done via opening
  54.  *         this plugin js file directly
  55.  *      3. If you wish to use DoubleX RMMV Skill Hotkeys Unit Test, place it
  56.  *         right below this plugin
  57.  *----------------------------------------------------------------------------
  58.  *    # Author
  59.  *      DoubleX
  60.  *----------------------------------------------------------------------------
  61.  *    # Changelog
  62.  *      v1.01b(GMT 0400 13-2-2021):
  63.  *      1. Fixed the bug of being able to select unusable hotkey skills in the
  64.  *         skill window in battles
  65.  *      v1.01a(GMT 1400 17-7-2019):
  66.  *      1. Lets you show skill names instead of icons in the hotkey list
  67.  *      2. Lets you show hotkey icons instead of names in the hotkey list
  68.  *      (v1.01a+ will be incompatible with v1.00a due to hotkeyNames changes)
  69.  *      v1.00a(GMT 0900 8-9-2017):
  70.  *      1. 1st version of this plugin finished
  71.  *============================================================================*/
  72. /*:
  73.  * @plugindesc Lets you bind hotkeys to skills for actors outside
  74.  * battles, and use them to select usable skills for actors inside battles
  75.  * @author DoubleX
  76.  *
  77.  * @param isEnabled
  78.  * @desc Sets whether this plugin will be enabled
  79.  * It'll be the contents of a function returning a Boolean
  80.  * @default return true;
  81.  *
  82.  * @param bindNotePriority
  83.  * @desc Sets the data type priority of <bind skill hotkey: BSHX>
  84.  * It'll be the contents of a function returning an Array of Strings
  85.  * @default return ["states", "armors", "weapons", "classes", "actors"];
  86.  *
  87.  * @param useNotePriority
  88.  * @desc Sets the data type priority of <use skill hotkey: USHX>
  89.  * It'll be the contents of a function returning an Array of Strings
  90.  * @default return ["states", "armors", "weapons", "classes", "actors"];
  91.  *
  92.  * @param bindNoteChainingRule
  93.  * @desc Sets how to use multiple <bind skill hotkey: BSHX> notetags
  94.  * It'll be the contents of a function returning a String
  95.  * @default return "first";
  96.  *
  97.  * @param useNoteChainingRule
  98.  * @desc Sets how to use multiple <use skill hotkey: USHX> notetags
  99.  * It'll be the contents of a function returning a String
  100.  * @default return "first";
  101.  *
  102.  * @param bindHotkeyText
  103.  * @desc Sets the bind hotkey text for skills without hotkeys
  104.  * It'll be the contents of a function returning a String
  105.  * @default return "Bind Hotkey";
  106.  *
  107.  * @param useSkillText
  108.  * @desc Sets the use skill text when showing the bind hotkey texts
  109.  * It'll be the contents of a function returning a String
  110.  * @default return "Use";
  111.  *
  112.  * @param unusableSkillCoverIconPath
  113.  * @desc Sets the path of the icon masking that of unusable skills
  114.  * It'll be the contents of a function returning a String
  115.  * @default return "img/pictures/";
  116.  *
  117.  * @param unusableSkillCoverIconName
  118.  * @desc Sets the name of the icon masking that of unusable skills
  119.  * It'll be the contents of a function returning a String
  120.  * @default return "UnusableSkill";
  121.  *
  122.  * @param unusableSkillCoverIconHue
  123.  * @desc Sets the hue of the icon masking that of unusable skills
  124.  * It'll be the contents of a function returning a Number
  125.  * @default return 0;
  126.  *
  127.  * @param unusableSkillCoverIconSmooth
  128.  * @desc Sets the smooth of the icon masking that of unusable skills
  129.  * It'll be the contents of a function returning a Boolean
  130.  * @default return true;
  131.  *
  132.  * @param hotkeyCmdWindowW
  133.  * @desc Sets the width of the window for binding hotkeys to skills
  134.  * It'll be the contents of a function returning a Number
  135.  * @default return Window_SkillHotkeyBase.prototype.windowWidth.call(this);
  136.  *
  137.  * @param hotkeyCmdWindowH
  138.  * @desc Sets the height of the window for binding hotkeys to skills
  139.  * It'll be the contents of a function returning a Number
  140.  * @default return Window_SkillHotkeyBase.prototype.windowHeight.call(this);
  141.  *
  142.  * @param hotkeyCmdWindowX
  143.  * @desc Sets the x position of the window for binding hotkeys
  144.  * It'll be the contents of a function returning a Number
  145.  * @default return 0;
  146.  *
  147.  * @param hotkeyCmdWindowY
  148.  * @desc Sets the y position of the window for binding hotkeys
  149.  * It'll be the contents of a function returning a Number
  150.  * @default return 0;
  151.  *
  152.  * @param hotkeyCmdLineH
  153.  * @desc Sets the line height of the window for binding hotkeys
  154.  * It'll be the contents of a function returning a Number
  155.  * @default return 36;
  156.  *
  157.  * @param hotkeyCmdFontSize
  158.  * @desc Sets the font size of the window for binding hotkeys
  159.  * It'll be the contents of a function returning a Number
  160.  * @default return 28;
  161.  *
  162.  * @param hotkeyCmdPadding
  163.  * @desc Sets the standard padding of the window for binding hotkeys
  164.  * It'll be the contents of a function returning a Number
  165.  * @default return 18;
  166.  *
  167.  * @param hotkeyCmdTextPadding
  168.  * @desc Sets the text padding of the window for binding hotkeys
  169.  * It'll be the contents of a function returning a Number
  170.  * @default return 6;
  171.  *
  172.  * @param hotkeyCmdBackOpacity
  173.  * @desc Sets the back opacity of the window for binding hotkeys
  174.  * It'll be the contents of a function returning a Number
  175.  * @default return 192;
  176.  *
  177.  * @param hotkeyCmdTranslucentOpacity
  178.  * @desc Sets the translucent opacity of the hotkey binding window
  179.  * It'll be the contents of a function returning a Number
  180.  * @default return 160;
  181.  *
  182.  * @param hotkeyCmdSpacing
  183.  * @desc Sets the spacing of the window for binding hotkeys
  184.  * It'll be the contents of a function returning a Number
  185.  * @default return 12;
  186.  *
  187.  * @param hotkeyListWindowW
  188.  * @desc Sets the width of the window listing the actor hotkey slots
  189.  * It'll be the contents of a function returning a Number
  190.  * @default return Graphics.boxWidth;
  191.  *
  192.  * @param hotkeyListWindowH
  193.  * @desc Sets the height of the window listing the actor hotkey slots
  194.  * It'll be the contents of a function returning a Number
  195.  * @default return this.fittingHeight(2);
  196.  *
  197.  * @param hotkeyListWindowX
  198.  * @desc Sets the x position of the window listing actor hotkey slots
  199.  * It'll be the contents of a function returning a Number
  200.  * @default return 0;
  201.  *
  202.  * @param hotkeyListWindowY
  203.  * @desc Sets the y position of the window listing actor hotkey slots
  204.  * It'll be the contents of a function returning a Number
  205.  * @default return 0;
  206.  *
  207.  * @param hotkeyListLineH
  208.  * @desc Sets the line height of the window listing actor hotkeys
  209.  * It'll be the contents of a function returning a Number
  210.  * @default return 36;
  211.  *
  212.  * @param hotkeyListFontSize
  213.  * @desc Sets the font size of the window listing actor hotkey slots
  214.  * It'll be the contents of a function returning a Number
  215.  * @default return 28;
  216.  *
  217.  * @param hotkeyListPadding
  218.  * @desc Sets the padding of the window listing actor hotkeys
  219.  * It'll be the contents of a function returning a Number
  220.  * @default return 18;
  221.  *
  222.  * @param hotkeyListTextPadding
  223.  * @desc Sets the text padding of the window listing actor hotkeys
  224.  * It'll be the contents of a function returning a Number
  225.  * @default return 6;
  226.  *
  227.  * @param hotkeyListBackOpacity
  228.  * @desc Sets the back opacity of the window listing actor hotkeys
  229.  * It'll be the contents of a function returning a Number
  230.  * @default return 192;
  231.  *
  232.  * @param hotkeyListTranslucentOpacity
  233.  * @desc Sets the translucent opacity of the actor hotkey list window
  234.  * It'll be the contents of a function returning a Number
  235.  * @default return 160;
  236.  *
  237.  * @param hotkeyListSpacing
  238.  * @desc Sets the spacing of the window listing actor hotkey slots
  239.  * It'll be the contents of a function returning a Number
  240.  * @default return 12;
  241.  *
  242.  * @param hotkeyCmdListWindowW
  243.  * @desc Sets the width of the window listing the hotkeys in battle
  244.  * It'll be the contents of a function returning a Number
  245.  * @default return Graphics.boxWidth;
  246.  *
  247.  * @param hotkeyCmdListWindowH
  248.  * @desc Sets the height of the window listing the hotkeys in battle
  249.  * It'll be the contents of a function returning a Number
  250.  * @default return this.fittingHeight(2);
  251.  *
  252.  * @param hotkeyCmdListWindowX
  253.  * @desc Sets the x position of the window listing hotkeys in battle
  254.  * It'll be the contents of a function returning a Number
  255.  * @default return 0;
  256.  *
  257.  * @param hotkeyCmdListWindowY
  258.  * @desc Sets the y position of the window listing hotkeys in battle
  259.  * It'll be the contents of a function returning a Number
  260.  * @default return Graphics.boxHeight - this.fittingHeight(4) - this.windowHeight();
  261.  *
  262.  * @param hotkeyCmdListLineH
  263.  * @desc Sets the line height of the window listing hotkeys in battle
  264.  * It'll be the contents of a function returning a Number
  265.  * @default return 36;
  266.  *
  267.  * @param hotkeyCmdListFontSize
  268.  * @desc Sets the font size of the window listing hotkeys in battle
  269.  * It'll be the contents of a function returning a Number
  270.  * @default return 28;
  271.  *
  272.  * @param hotkeyCmdListPadding
  273.  * @desc Sets the padding of the window listing hotkeys in battle
  274.  * It'll be the contents of a function returning a Number
  275.  * @default return 18;
  276.  *
  277.  * @param hotkeyCmdListTextPadding
  278.  * @desc Sets the text padding of the hotkey window in battle
  279.  * It'll be the contents of a function returning a Number
  280.  * @default return 6;
  281.  *
  282.  * @param hotkeyCmdListBackOpacity
  283.  * @desc Sets the back opacity of the hotkey window in battle
  284.  * It'll be the contents of a function returning a Number
  285.  * @default return 192;
  286.  *
  287.  * @param hotkeyCmdListTranslucentOpacity
  288.  * @desc Sets the translucent opacity of the hotkey window in battle
  289.  * It'll be the contents of a function returning a Number
  290.  * @default return 160;
  291.  *
  292.  * @param hotkeyCmdListSpacing
  293.  * @desc Sets the spacing of the window listing hotkeys in battle
  294.  * It'll be the contents of a function returning a Number
  295.  * @default return 12;
  296.  *
  297.  * @help
  298.  *============================================================================
  299.  *    ## Parameter/Configurations Info
  300.  *----------------------------------------------------------------------------
  301.  *    # General
  302.  *      The below points apply to all parameters/configurations unless stated
  303.  *      otherwise:
  304.  *      1. If the value of a parameter's empty, its configuration counterpart
  305.  *         will be used instead(Reference tag: PARAMETERS_CONFIGURATIONS)
  306.  *         - E.g.: Setting the parameter isEnabled as empty means that the
  307.  *                 configuration isEnabled will be used instead
  308.  *      2. The this pointer refers to the actor involved as the function
  309.  *         contexts are Game_Actor.prototype
  310.  *      3. The value of all parameters are contents of functions taking
  311.  *         skillId - The id of the skill involved as the arguments
  312.  *      4. Don't change the name nor the ordering of any function arguments
  313.  *         unless you really know what you're truly doing
  314.  *    # Function arguments
  315.  *      1. isEnabled
  316.  *         None
  317.  *      2. bindNotePriority
  318.  *         Same as those mentioned in # General
  319.  *      3. useNotePriority
  320.  *         Same as those mentioned in # General
  321.  *      4. bindNoteChainingRule
  322.  *         Same as those mentioned in # General
  323.  *      5. useNoteChainingRule
  324.  *         Same as those mentioned in # General
  325.  *      6. bindHotkeyText
  326.  *         None
  327.  *      7. useSkillText
  328.  *         Same as those mentioned in # General
  329.  *      8. unusableSkillCoverIconPath
  330.  *         None
  331.  *      9. unusableSkillCoverIconName
  332.  *         None
  333.  *      10. unusableSkillCoverIconHue
  334.  *         None
  335.  *      11. unusableSkillCoverIconSmooth
  336.  *         None
  337.  *      12. hotkeyCmdWindowW
  338.  *         None
  339.  *      13. hotkeyCmdWindowH
  340.  *         None
  341.  *      14. hotkeyCmdWindowX
  342.  *         None
  343.  *      15. hotkeyCmdWindowY
  344.  *         None
  345.  *      16. hotkeyCmdLineH
  346.  *         None
  347.  *      17. hotkeyCmdFontSize
  348.  *         None
  349.  *      18. hotkeyCmdPadding
  350.  *         None
  351.  *      19. hotkeyCmdTextPadding
  352.  *         None
  353.  *      20. hotkeyCmdBackOpacity
  354.  *         None
  355.  *      21. hotkeyCmdTranslucentOpacity
  356.  *         None
  357.  *      22. hotkeyCmdWindowSpacing
  358.  *         None
  359.  *      23. hotkeyListWindowW
  360.  *         None
  361.  *      24. hotkeyListWindowH
  362.  *         None
  363.  *      25. hotkeyListWindowX
  364.  *         None
  365.  *      26. hotkeyListWindowY
  366.  *         None
  367.  *      27. hotkeyListLineH
  368.  *         None
  369.  *      28. hotkeyListFontSize
  370.  *         None
  371.  *      29. hotkeyListPadding
  372.  *         None
  373.  *      30. hotkeyListTextPadding
  374.  *         None
  375.  *      31. hotkeyListBackOpacity
  376.  *         None
  377.  *      32. hotkeyListTranslucentOpacity
  378.  *         None
  379.  *      33. hotkeyListSpacing
  380.  *         None
  381.  *      34. hotkeyCmdListWindowW
  382.  *         None
  383.  *      35. hotkeyCmdListWindowH
  384.  *         None
  385.  *      36. hotkeyCmdListWindowX
  386.  *         None
  387.  *      37. hotkeyCmdListWindowY
  388.  *         None
  389.  *      38. hotkeyCmdListLineH
  390.  *         None
  391.  *      39. hotkeyCmdListFontSize
  392.  *         None
  393.  *      40. hotkeyCmdListPadding
  394.  *         None
  395.  *      41. hotkeyCmdListTextPadding
  396.  *         None
  397.  *      42. hotkeyCmdListBackOpacity
  398.  *         None
  399.  *      43. hotkeyCmdListTranslucentOpacity
  400.  *         None
  401.  *      44. hotkeyCmdListSpacing
  402.  *         None
  403.  *    # Valid values
  404.  *      1. isEnabled
  405.  *         Any valid Javascript(It'll always be regarded as truthy/falsy)
  406.  *         It'll only be used as a prerequisite when checking whether the
  407.  *         actor inolved can bind/use hotkeys for the skill involved
  408.  *      2. bindNotePriority
  409.  *         Note that skills always have the highest priority
  410.  *         Any valid Javascript returning any Array having the below String:
  411.  *         - "states" States in the States category
  412.  *         - "armors" Armors in the Armors category
  413.  *         - "weapons" Weapons in the Weapons category
  414.  *         - "classes" Classes in the Classes category
  415.  *         - "actors" Actors in the Actors category
  416.  *         (Reference tag: NOTE_DATA_TYPES)
  417.  *         The effective notetag priority among data types are sorted
  418.  *         ascendingly in the array
  419.  *         The effective notetag priority among the same data type are the
  420.  *         same as the other priorities among there
  421.  *         Notetags of data belonging types not included in the array won't be
  422.  *         effective
  423.  *      3. useNotePriority
  424.  *         Note that skills always have the highest priority
  425.  *         Any valid Javascript returning any Array having the below String:
  426.  *         - "states" States in the States category
  427.  *         - "armors" Armors in the Armors category
  428.  *         - "weapons" Weapons in the Weapons category
  429.  *         - "classes" Classes in the Classes category
  430.  *         - "actors" Actors in the Actors category
  431.  *         (Reference tag: NOTE_DATA_TYPES)
  432.  *         The effective notetag priority among data types are sorted
  433.  *         ascendingly in the array
  434.  *         The effective notetag priority among the same data type are the
  435.  *         same as the other priorities among there
  436.  *         Notetags of data belonging types not included in the array won't be
  437.  *         effective
  438.  *      4. bindNoteChainingRule
  439.  *         Any valid Javascript returning any of the below String:
  440.  *         - "first"(Only the notetag of the involved skill will be used)
  441.  *         - "every"(All effective notetags must return truthy to be regarded
  442.  *                   as truthy)
  443.  *         - "some"(All effective notetags must return falsy to be regarded as
  444.  *                 falsy)
  445.  *         All invalid values will be regarded as "first"
  446.  *         (Reference tag: DEFAULT_FIRST)
  447.  *      5. useNoteChainingRule
  448.  *         Any valid Javascript returning any of the below String:
  449.  *         - "first"(Only the notetag of the involved skill will be used)
  450.  *         - "every"(All effective notetags must return truthy to be regarded
  451.  *                   as truthy)
  452.  *         - "some"(All effective notetags must return falsy to be regarded as
  453.  *                 falsy)
  454.  *         All invalid values will be regarded as "first"
  455.  *         (Reference tag: DEFAULT_FIRST)
  456.  *      6. bindHotkeyText
  457.  *         Any valid Javascript returning any String
  458.  *      7. useSkillText
  459.  *         Any valid Javascript returning any String
  460.  *      8. unusableSkillCoverIconPath
  461.  *         Any valid Javascript returning any String as the path of an image
  462.  *         file in the project directory
  463.  *         Returning random values would lead to heavy performance penalties
  464.  *      9. unusableSkillCoverIconName
  465.  *         Any valid Javascript returning any String as the name of an image
  466.  *         file in the project directory
  467.  *         Returning random values would lead to heavy performance penalties
  468.  *      10. unusableSkillCoverIconHue
  469.  *         Any valid Javascript returning any Number as the hue of an image
  470.  *         file in the project directory
  471.  *         Returning random values would lead to heavy performance penalties
  472.  *      11. unusableSkillCoverIconSmooth
  473.  *         Any valid Javascript returning any Boolean as the smooth flag of an
  474.  *         image file in the project directory
  475.  *         Returning random values would lead to heavy performance penalties
  476.  *      12. hotkeyCmdWindowW
  477.  *         Any valid Javascript returning any positive Number
  478.  *         Returning random values would lead to heavy performance penalties
  479.  *      13. hotkeyCmdWindowH
  480.  *         Any valid Javascript returning any positive Number
  481.  *         Returning random values would lead to heavy performance penalties
  482.  *      14. hotkeyCmdWindowX
  483.  *         Any valid Javascript returning any non negative Number
  484.  *         Returning random values would lead to heavy performance penalties
  485.  *      15. hotkeyCmdWindowY
  486.  *         Any valid Javascript returning any non negative Number
  487.  *         Returning random values would lead to heavy performance penalties
  488.  *      16. hotkeyCmdLineH
  489.  *         Any valid Javascript returning any positive Number
  490.  *         Returning random values would lead to heavy performance penalties
  491.  *      17. hotkeyCmdFontSize
  492.  *         Any valid Javascript returning any positive Number
  493.  *         Returning random values would lead to heavy performance penalties
  494.  *      18. hotkeyCmdPadding
  495.  *         Any valid Javascript returning any non negative Number
  496.  *         Returning random values would lead to heavy performance penalties
  497.  *      19. hotkeyCmdTextPadding
  498.  *         Any valid Javascript returning any non negative Number
  499.  *         Returning random values would lead to heavy performance penalties
  500.  *      20. hotkeyCmdBackOpacity
  501.  *         Any valid Javascript returning any Number ranging from 0 to 255
  502.  *         Returning random values would lead to heavy performance penalties
  503.  *      21. hotkeyCmdTranslucentOpacity
  504.  *         Any valid Javascript returning any Number ranging from 0 to 255
  505.  *         Returning random values would lead to heavy performance penalties
  506.  *      22. hotkeyCmdSpacing
  507.  *         Any valid Javascript returning any non negative Number
  508.  *         Returning random values would lead to heavy performance penalties
  509.  *      23. hotkeyListWindowW
  510.  *         Any valid Javascript returning any positive Number
  511.  *         Returning random values would lead to heavy performance penalties
  512.  *      24. hotkeyListWindowH
  513.  *         Any valid Javascript returning any positive Number
  514.  *         Returning random values would lead to heavy performance penalties
  515.  *      25. hotkeyListWindowX
  516.  *         Any valid Javascript returning any non negative Number
  517.  *         Returning random values would lead to heavy performance penalties
  518.  *      26. hotkeyListWindowY
  519.  *         Any valid Javascript returning any non negative Number
  520.  *         Returning random values would lead to heavy performance penalties
  521.  *      27. hotkeyListLineH
  522.  *         Any valid Javascript returning any positive Number
  523.  *         Returning random values would lead to heavy performance penalties
  524.  *      28. hotkeyListFontSize
  525.  *         Any valid Javascript returning any positive Number
  526.  *         Returning random values would lead to heavy performance penalties
  527.  *      29. hotkeyListPadding
  528.  *         Any valid Javascript returning any non negative Number
  529.  *         Returning random values would lead to heavy performance penalties
  530.  *      30. hotkeyListTextPadding
  531.  *         Any valid Javascript returning any non negative Number
  532.  *         Returning random values would lead to heavy performance penalties
  533.  *      31. hotkeyListBackOpacity
  534.  *         Any valid Javascript returning any Number ranging from 0 to 255
  535.  *         Returning random values would lead to heavy performance penalties
  536.  *      32. hotkeyListTranslucentOpacity
  537.  *         Any valid Javascript returning any Number ranging from 0 to 255
  538.  *         Returning random values would lead to heavy performance penalties
  539.  *      33. hotkeyListSpacing
  540.  *         Any valid Javascript returning any non negative Number
  541.  *         Returning random values would lead to heavy performance penalties
  542.  *      34. hotkeyCmdListWindowW
  543.  *         Any valid Javascript returning any positive Number
  544.  *         Returning random values would lead to heavy performance penalties
  545.  *      35. hotkeyCmdListWindowH
  546.  *         Any valid Javascript returning any positive Number
  547.  *         Returning random values would lead to heavy performance penalties
  548.  *      36. hotkeyCmdListWindowX
  549.  *         Any valid Javascript returning any non negative Number
  550.  *         Returning random values would lead to heavy performance penalties
  551.  *      37. hotkeyCmdListWindowY
  552.  *         Any valid Javascript returning any non negative Number
  553.  *         Returning random values would lead to heavy performance penalties
  554.  *      38. hotkeyCmdListLineH
  555.  *         Any valid Javascript returning any positive Number
  556.  *         Returning random values would lead to heavy performance penalties
  557.  *      39. hotkeyCmdListFontSize
  558.  *         Any valid Javascript returning any positive Number
  559.  *         Returning random values would lead to heavy performance penalties
  560.  *      40. hotkeyCmdListPadding
  561.  *         Any valid Javascript returning any non negative Number
  562.  *         Returning random values would lead to heavy performance penalties
  563.  *      41. hotkeyCmdListTextPadding
  564.  *         Any valid Javascript returning any non negative Number
  565.  *         Returning random values would lead to heavy performance penalties
  566.  *      42. hotkeyCmdListBackOpacity
  567.  *         Any valid Javascript returning any Number ranging from 0 to 255
  568.  *         Returning random values would lead to heavy performance penalties
  569.  *      43. hotkeyCmdListTranslucentOpacity
  570.  *         Any valid Javascript returning any Number ranging from 0 to 255
  571.  *         Returning random values would lead to heavy performance penalties
  572.  *      44. hotkeyCmdListSpacing
  573.  *         Any valid Javascript returning any non negative Number
  574.  *         Returning random values would lead to heavy performance penalties
  575.  *    # Examples
  576.  *      1. isEnabled
  577.  *          Setting isEnabled as return false; will disable this plugin
  578.  *      2. bindNotePriority
  579.  *         Aside from the skills, which always have the highest priority,
  580.  *         setting bindNotePriority as
  581.  *         return ["states", "armors", "weapons", "classes"];
  582.  *         will cause the <bind skill hotkey: BSHX> notetags in the States
  583.  *         category to have the highest priorities, followed by the Armors,
  584.  *         Weapons and Classes categories, whereas no notetags in the Actors
  585.  *         categories will be effective
  586.  *      3. useNotePriority
  587.  *         Aside from the skills, which always have the highest priority,
  588.  *         setting useNotePriority as
  589.  *         return ["states", "armors", "weapons", "classes"];
  590.  *         will cause the <use skill hotkey: USHX> notetags in the States
  591.  *         category to have the highest priorities, followed by the Armors,
  592.  *         Weapons and Classes categories, whereas no notetags in the Actors
  593.  *         categories will be effective
  594.  *      4. bindNoteChainingRule
  595.  *         Setting bindNoteChainingRule as return "every"; will cause the
  596.  *         result to be truthy if and only if all effective
  597.  *         <bind skill hotkey: BSHX> notetags return truthy
  598.  *      5. useNoteChainingRule
  599.  *         Setting useNoteChainingRule as return "every"; will cause the
  600.  *         result to be truthy if and only if all effective
  601.  *         <use skill hotkey: USHX> notetags return truthy
  602.  *      6. bindHotkeyText
  603.  *         Setting bindHotkeyText as return "Set Hotkey"; will set the bind
  604.  *         hotkey text for skills without hotkeys as Set Hotkey
  605.  *      7. useSkillText
  606.  *         Setting useSkillText as return "Use"; will set the use skill text
  607.  *         when showing the bind hotkey texts as Use
  608.  *      8. unusableSkillCoverIconPath
  609.  *         Setting unusableSkillCoverIconPath as return "img/pictures/"; will
  610.  *         set the path of the icon covering theicon of unusable skills with
  611.  *         hotkeys as thefolder pictures which is in the folder img
  612.  *      9. unusableSkillCoverIconName
  613.  *         Setting unusableSkillCoverIconName as return "UnusableSkill"; will
  614.  *         set the name of the icon covering the icon of unusable skills with
  615.  *         hotkeys as UnusableSkill.png
  616.  *      10. unusableSkillCoverIconHue
  617.  *         Setting unusableSkillCoverIconHue as return 0; will set the name of
  618.  *         the icon covering the icon of unusable skills with hotkeys as 0
  619.  *      11. unusableSkillCoverIconSmooth
  620.  *         Setting unusableSkillCoverIconSmooth as return true; will set the
  621.  *         smooth flag of the icon covering the icon of unusable skills with
  622.  *         hotkeys as true
  623.  *      12. hotkeyCmdWindowW
  624.  *         Setting hotkeyCmdWindowW as
  625.  *         return Window_Command.prototype.windowWidth.call(this); will set
  626.  *         the width of the window for binding hotkeys to skills as that of
  627.  *         an ordinary command window
  628.  *      13. hotkeyCmdWindowH
  629.  *         Setting hotkeyCmdWindowH as
  630.  *         return Window_Command.prototype.windowHeight.call(this); will set
  631.  *         the height of the window for binding hotkeys to skills as that of
  632.  *         an ordinary command window
  633.  *      14. hotkeyCmdWindowX
  634.  *         Setting hotkeyCmdWindowX as return 0; will set the x position of
  635.  *         the window for binding hotkeys to skills as 0 pixel from the game
  636.  *         screen
  637.  *      15. hotkeyCmdWindowY
  638.  *         Setting hotkeyCmdWindowY as return 0; will set the y position of
  639.  *         the window for binding hotkeys to skills as 0 pixel from the game
  640.  *         screen
  641.  *      16. hotkeyCmdLineH
  642.  *         Setting hotkeyCmdLineH as return 36; will set the line height of
  643.  *         the window for binding hotkeys to skills as 36 pixels
  644.  *      17. hotkeyCmdFontSize
  645.  *         Setting hotkeyCmdFontSize as return 28; will set the standard font
  646.  *         size of the window for binding hotkeys to skills as 28 pixels
  647.  *      18. hotkeyCmdPadding
  648.  *         Setting hotkeyCmdPadding as return 18; will set the standard
  649.  *         padding of the window for binding hotkeys to skills as 18 pixels
  650.  *      19. hotkeyCmdTextPadding
  651.  *         Setting hotkeyCmdTextPadding as return 6; will set the text padding
  652.  *         of the window for binding hotkeys to skills as 6 pixels
  653.  *      20. hotkeyCmdBackOpacity
  654.  *         Setting hotkeyCmdBackOpacity as return 192; will set the standard
  655.  *         back opacity of the window for binding hotkeys to skills as 192
  656.  *      21. hotkeyCmdTranslucentOpacity
  657.  *         Setting hotkeyCmdTranslucentOpacity as return 160; will set the
  658.  *         translucent opacity opacity of the window for binding hotkeys to
  659.  *         skills as 160
  660.  *      22. hotkeyCmdSpacing
  661.  *         Setting hotkeyCmdSpacing as return 12; will set the selectable
  662.  *         spacing of the window for binding hotkeys to skills as 12
  663.  *      23. hotkeyListWindowW
  664.  *         Setting hotkeyListWindowW as return Graphics.boxWidth; will set the
  665.  *         width of the window listing the actor hotkey slots as that of the
  666.  *         game screen
  667.  *      24. hotkeyListWindowH
  668.  *         Setting hotkeyListWindowH as this.fittingHeight(2); will set the
  669.  *         height of the window listing the actor hotkey slots as that of an
  670.  *         ordinary window having 2 line contents
  671.  *      25. hotkeyListWindowX
  672.  *         Setting hotkeyListWindowX as return 0; will set the x position of
  673.  *         the window listing the actor hotkey slots as 0 pixel from the game
  674.  *         screen
  675.  *      26. hotkeyListWindowY
  676.  *         Setting hotkeyListWindowY as return 0; will set the y position of
  677.  *         the window listing the actor hotkey slots as 0 pixel from the game
  678.  *         screen
  679.  *      27. hotkeyListLineH
  680.  *         Setting hotkeyListLineH as return 36; will set the line height of
  681.  *         the window listing the actor hotkey slots as 36 pixels
  682.  *      28. hotkeyListFontSize
  683.  *         Setting hotkeyListFontSize as return 28; will set the standard font
  684.  *         size of the window listing the actor hotkey slots as 28 pixels
  685.  *      29. hotkeyListPadding
  686.  *         Setting hotkeyListPadding as return 18; will set the standard
  687.  *         padding of the window listing the actor hotkey slots as 18 pixels
  688.  *      30. hotkeyListTextPadding
  689.  *         Setting hotkeyListTextPadding as return 6; will set the text
  690.  *         padding of the window listing the actor hotkey slots as 6 pixels
  691.  *      31. hotkeyListBackOpacity
  692.  *         Setting hotkeyListBackOpacity as return 192; will set the standard
  693.  *         back opacity of the window listing the actor hotkey slots as 192
  694.  *      32. hotkeyListTranslucentOpacity
  695.  *         Setting hotkeyListTranslucentOpacity as return 160; will set the
  696.  *         translucent opacity of the window listing the actor hotkey slots as
  697.  *         160
  698.  *      33. hotkeyListSpacing
  699.  *         Setting hotkeyListSpacing as return 12; will set the selectable
  700.  *         spacing of the window listing the actor hotkey slots as 12
  701.  *      34. hotkeyCmdListWindowW
  702.  *         Setting hotkeyCmdListWindowW as return Graphics.boxWidth; will set
  703.  *         the width of the window listing the hotkeys in battle as that of
  704.  *         the game screen
  705.  *      35. hotkeyCmdListWindowH
  706.  *         Setting hotkeyListWindowH as this.fittingHeight(2); will set the
  707.  *         height of the window listing the hotkeys in battle as that of an
  708.  *         ordinary window having 2 line contents
  709.  *      36. hotkeyCmdListWindowX
  710.  *         Setting hotkeyCmdListWindowX as return 0; will set the x position
  711.  *         of the window listing the hotkeys in battle as 0 pixel from the
  712.  *         game screen
  713.  *      37. hotkeyCmdListWindowY
  714.  *         Setting hotkeyCmdListWindowY as
  715.  *         return Graphics.boxHeight - this.fittingHeight(4) - this.windowHeight();
  716.  *         will set the window listing the hotkeys in battle to be placed
  717.  *         right above the status window
  718.  *      38. hotkeyListLineH
  719.  *         Setting hotkeyCmdListLineH as return 36; will set the line height
  720.  *         of the window listing the hotkeys in battle as 36 pixels
  721.  *      39. hotkeyListFontSize
  722.  *         Setting hotkeyCmdListFontSize as return 28; will set the standard
  723.  *         font size of the window listing the hotkeys in battle as 28 pixels
  724.  *      40. hotkeyListPadding
  725.  *         Setting hotkeyCmdListPadding as return 18; will set the standard
  726.  *         padding of the window listing the hotkeys in battle as 18 pixels
  727.  *      41. hotkeyListTextPadding
  728.  *         Setting hotkeyCmdListTextPadding as return 6; will set the text
  729.  *         padding of the window listing the hotkeys in battle as 6 pixels
  730.  *      42. hotkeyListBackOpacity
  731.  *         Setting hotkeyCmdListBackOpacity as return 192; will set the
  732.  *         standard back opacity of the window listing the hotkeys in battle
  733.  *         as 192
  734.  *      43. hotkeyListTranslucentOpacity
  735.  *         Setting hotkeyCmdListTranslucentOpacity as return 160; will set the
  736.  *         translucent opacity of the window listing the hotkeys in battle as
  737.  *         160
  738.  *      44. hotkeyListSpacing
  739.  *         Setting hotkeyCmdListSpacing as return 12; will set the selectable
  740.  *         spacing of the window listing the hotkeys in battle as 12
  741.  *============================================================================
  742.  *    ## Notetag Info
  743.  *       Among all the same notetag types in the same data, only the 1st one
  744.  *       can be effective(Reference tag: NOTETAG_MONO)
  745.  *       Each line can only have at most 1 notetag(Reference tag: LINE_MONO)
  746.  *----------------------------------------------------------------------------
  747.  *    # Actor/Class/Weapon/Armor/State/Skill Notetags:
  748.  *      Having no effective notetag means the actors can bind hotkeys
  749.  *      to the skills(Reference tag: DEFAULT_TRUE)
  750.  *      1. <bind skill hotkey: BSHX>
  751.  *         - Sets whether the actor can bind hotkeys for the skill as the
  752.  *           value returned by function with name BSHX, which can only be
  753.  *           edited in the configuration region, which is inside this plugin
  754.  *           js file contents, directly
  755.  *         - E.g.:
  756.  *           <bind skill hotkey: BSH1> will set the actor to always be able to
  757.  *           bind the skill due to BSH1, which is the name of a function in
  758.  *           the configuration region, always returning true
  759.  *    # Actor/Class/Weapon/Armor/State Notetags:
  760.  *      Having no effective notetag means the actors can use hotkeys
  761.  *      1. <use skill hotkey: USHX>
  762.  *         - Sets whether the actor can use hotkeys as the value returned by
  763.  *           function with name USHX, which can only be edited in the
  764.  *           configuration region, which is inside this plugin js file
  765.  *           contents, directly
  766.  *         - E.g.:
  767.  *           <use skill hotkey: USH1> will set the actor to always be able to
  768.  *           use the skill due to USH1, which is the name of a function in the
  769.  *           configuration region, always returning true
  770.  *============================================================================
  771.  *    ## Plugin Call Info
  772.  *----------------------------------------------------------------------------
  773.  *    # Configuration manipulations
  774.  *      1. $gameSystem.skillHotkeys.params.param
  775.  *         - Returns the stored value of param listed in the plugin manager or
  776.  *           their configuration counterpart
  777.  *         - E.g.:
  778.  *           $gameSystem.skillHotkeys.params.isEnabled will return the
  779.  *           contents of a function returning a Boolean indicating whether
  780.  *           this plugin's enabled
  781.  *      2. $gameSystem.skillHotkeys.params.param = funcContents
  782.  *         - Sets the stored value of param listed in the plugin manager or
  783.  *           their configuration counterpart as funcContents, which is the
  784.  *           contents of a function
  785.  *         - E.g.:
  786.  *           $gameSystem.skillHotkeys.params.isEnabled = return false; will
  787.  *           set the stored value of parameter isEnabled shown on the plugin
  788.  *           manager or its configuration counterpart as return false;,
  789.  *           causing the corresponding function to always return false, thus
  790.  *           always disabling this plugin
  791.  *         - $gameSystem.skillHotkeys.params.param changes will be saved
  792.  *         - DoubleX_RMMV.Skill_Hotkeys.params.param = func, where func is the
  793.  *           corresponding function having funcContents as its contents,
  794.  *           should be explicitly called immediately afterwards
  795.  *      3. $gameSystem.skillHotkeys.cfgs.cfg
  796.  *         - Basically the same as $gameSystem.skillHotkeys.params.param,
  797.  *           except that this plugin call applies to configurations found in
  798.  *           the configuration region only
  799.  *      4. $gameSystem.skillHotkeys.cfgs.cfg = funcContents
  800.  *         - Basically the same as
  801.  *           $gameSystem.skillHotkeys.params.param = funcContents, except that
  802.  *           this plugin call applies to configurations found in the
  803.  *           configuration region only
  804.  *         - DoubleX_RMMV.Skill_Hotkeys.cfgs.cfg = func, where func is the
  805.  *           corresponding function having funcContents as its contents,
  806.  *           should be explicitly called immediately afterwards
  807.  *      5. $gameSystem.skillHotkeys.notes.note
  808.  *         - Basically the same as $gameSystem.skillHotkeys.params.param,
  809.  *           except that this plugin call applies to notetag values found in
  810.  *           the configuration region
  811.  *      6. $gameSystem.skillHotkeys.notes.note = funcContents
  812.  *         - Basically the same as
  813.  *           $gameSystem.skillHotkeys.params.param = funcContents, except that
  814.  *           this plugin call applies to notetag values found in the
  815.  *           configuration region
  816.  *         - DoubleX_RMMV.Skill_Hotkeys.notes.note = func, where func is the
  817.  *           corresponding function having funcContents as its contents,
  818.  *           should be explicitly called immediately afterwards
  819.  *    # Actor/Class/Weapon/Armor/State/Skill notetag manipulations
  820.  *      1. meta.skillHotkeys.canBind
  821.  *         - Returns the function name BSHX, which is a String, in
  822.  *           <bind skill hotkey: BSHX>
  823.  *         - E.g.:
  824.  *           $dataStates[1].meta.skillHotkeys.canBind will return the function
  825.  *           name BSH1, which is a String, in <bind skill hotkey: BSH1>
  826.  *           notetag of state with id 1
  827.  *      2. meta.skillHotkeys.canBind = BSHX
  828.  *         - Sets the <bind skill hotkey: BSHX> notetag to use the function
  829.  *           with name BSHX, which is a String
  830.  *         - E.g.:
  831.  *           $dataActors[2].meta.skillHotkeys.canBind = BSH1 will set the
  832.  *           <bind skill hotkey: BSHX> notetag of actor with id 2 to use the
  833.  *           function with name BSH1, with is a String
  834.  *         - The function name must be one of the notetag values in the
  835.  *           configuration region
  836.  *         - All meta.statusBars changes can be saved if
  837.  *           DoubleX RMMV Dynamic Data is used
  838.  *      3. meta.skillHotkeys.canUse
  839.  *         - Basically the same as meta.skillHotkeys.canBind, except that this
  840.  *           plugin call works with <use skill hotkey: USHX>
  841.  *      4. meta.skillHotkeys.canUse = USHX
  842.  *         - Basically the same as meta.skillHotkeys.canBind = BSHX, except
  843.  *           that this plugin call works with <use skill hotkey: USHX>
  844.  *    # Actor manipulations
  845.  *      1. bindSkillHotkey(skillId, hotkey)
  846.  *         - Binds the hotkey with symbol hotkey to the skill with id skillId
  847.  *           for the actor involved, bypassing all <bind skill hotkey: BSHX>
  848.  *           notetags
  849.  *         - E.g.:
  850.  *           $gameParty.aliveMembers()[0].bindSkillHotkey(1, #1) will bind the
  851.  *           hotkey with symbol #1 to the skill with id 1 for the 1st alive
  852.  *           party member
  853.  *         - Don't use this plugin call when players are
  854.  *           binding/using hotkeys unless you really know what you're truly
  855.  *           doing
  856.  *      2. canBindSkillHotkey(skillId)
  857.  *         - Returns whether the actor involved can bind hotkeys for the skill
  858.  *           with id skillId
  859.  *         - E.g.:
  860.  *           $gameParty.aliveMembers()[0].canBindSkillHotkey(1) will return
  861.  *           whether the 1st alive party member can bind hotkeys for the skill
  862.  *           with id 1
  863.  *      3. canUseSkillHotkey(skillId)
  864.  *         - Returns whether the actor involved can use the hotkey bound to
  865.  *           the skill with id skillId
  866.  *         - E.g.:
  867.  *           $gameActors.actor(1).canUseSkillHotkey(1) will return whether the
  868.  *           actor with id 1 can use the hotkey bound to the skill with id 1
  869.  *      4. isSkillHotkeysBound(skillId)
  870.  *         - Returns whether the actor has bound a hotkey for the skill with
  871.  *           id skillId
  872.  *         - E.g.:
  873.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  874.  *                   isSkillHotkeysBound(1) will return whether the last alive
  875.  *           party member has bound a hotkey for the skill with id 1
  876.  *      5. boundSkillHotkeys(skillId)
  877.  *         - Returns the list of symbols of hotkeys bound to the skill with id
  878.  *           skillId
  879.  *         - E.g.:
  880.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  881.  *                   boundSkillHotkeys(1) will return the list of symbols of
  882.  *           hotkeys bound to the skill with id 1
  883.  *      6. hotkeys()
  884.  *         - Returns the list of symbols of hotkeys bound to skills
  885.  *         - E.g.:
  886.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  887.  *                   hotkeys() will return the list of symbols of hotkeys
  888.  *           bound to the skills
  889.  *      7. raiseSkillHotkeyNoteChangeFactors()
  890.  *         - Notifys that all notetags might need to be reevaluated due to
  891.  *           potential data source changes or changes in the actor involved
  892.  *         - This plugin call should be called whenever there are potential
  893.  *           changes in the bindNoteChainingRule/useNoteChainingRule
  894.  *           parameter/configuration
  895.  *         - E.g.:
  896.  *           $gameActors.actor(1).raiseSkillHotkeyNoteChangeFactors() will
  897.  *           notify the actor with id 1 that all notetags might need to be
  898.  *           reevaluated due to potential data source changes or changes in
  899.  *           the actor involved
  900.  *      8. skillHotkeys.hotkeyMapping
  901.  *         - Access the mapping from the hotkey symbols to the skill ids where
  902.  *           the hotkey represented by the formers' bound to the skill
  903.  *           referred by the latters
  904.  *         - E.g.:
  905.  *           $gameActors.actor(1).skillHotkeys.hotkeyMapping will access the
  906.  *           mapping from the hotkey symbols to the skill ids where the hotkey
  907.  *           represented by the formers' bound to the skill referred by the
  908.  *           latters for the actor with id 1
  909.  *      9. skillHotkeys.noteChangeFactors[note][factor] = true
  910.  *         - Notifys that the notetag note might need to be reevaluated due to
  911.  *           potential changes in factor factor
  912.  *         - note is either "canBind", referring to the notetag
  913.  *           <bind skill hotkey: BSHX>, or 'canUse", referring to the notetag
  914.  *           <use skill hotkey: USHX>
  915.  *         - factor is either "states", meaning the changes in state notetags,
  916.  *           "armors", meaning the changes in armor notetags, "weapons",
  917.  *           meaning the changes in weapon notetags, "classes", meaning the
  918.  *           changes in classes notetags, "actors", meaning the changes in
  919.  *           actors notetags, or "priority", meaning the changes in the
  920.  *           bindNotePriority/useNotePriority parameter/configuration
  921.  *         - E.g.:
  922.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  923.  *                   skillHotkeys. noteChangeFactors[canBind][priority] = true
  924.  *           will notify the last alive party member that the
  925.  *           <bind skill hotkey: BSHX> notetag might need to be reevaluated
  926.  *           due to potential changes in the bindNotePriority
  927.  *           parameter/configuration
  928.  *           (The counterpart for <use skill hotkey: USHX> is useNotePriority)
  929.  *============================================================================
  930.  *    ## Plugin Command Info
  931.  *----------------------------------------------------------------------------
  932.  *      1. bindSkillHotkey actorId skillId hotkey
  933.  *         - The same as the plugin call bindSkillHotkey(skillId, hotkey) in
  934.  *           Actor manipulations for the actor with id actorId
  935.  *         - Don't use this plugin command for actors that don't exist yet
  936.  *           unless you really know what you're truly doing
  937.  *      2. canBindSkillHotkey actorId skillId
  938.  *         - The same as the plugin call canBindSkillHotkey(skillId) in
  939.  *           Actor manipulations for the actor with id actorId
  940.  *         - Don't use this plugin command for actors that don't exist yet
  941.  *           unless you really know what you're truly doing
  942.  *      3. canUseSkillHotkey actorId skillId
  943.  *         - The same as the plugin call canUseSkillHotkey(skillId) in
  944.  *           Actor manipulations for the actor with id actorId
  945.  *         - Don't use this plugin command for actors that don't exist yet
  946.  *           unless you really know what you're truly doing
  947.  *      4. isSkillHotkeysBound actorId skillId
  948.  *         - The same as the plugin call isSkillHotkeysBound(skillId) in
  949.  *           Actor manipulations for the actor with id actorId
  950.  *         - Don't use this plugin command for actors that don't exist yet
  951.  *           unless you really know what you're truly doing
  952.  *      5. boundSkillHotkeys actorId skillId
  953.  *         - The same as the plugin call boundSkillHotkeys(skillId) in
  954.  *           Actor manipulations for the actor with id actorId
  955.  *         - Don't use this plugin command for actors that don't exist yet
  956.  *           unless you really know what you're truly doing
  957.  *      6. hotkeys actorId
  958.  *         - The same as the plugin call hotkeys() in Actor manipulations for
  959.  *           the actor with id actorId
  960.  *         - Don't use this plugin command for actors that don't exist yet
  961.  *           unless you really know what you're truly doing
  962.  *      7. raiseSkillHotkeyNoteChangeFactors actorId
  963.  *         - The same as the plugin call raiseSkillHotkeyNoteChangeFactors()
  964.  *           in Actor manipulations for the actor with id actorId
  965.  *         - Don't use this plugin command for actors that don't exist yet
  966.  *           unless you really know what you're truly doing
  967.  *============================================================================
  968.  */
  969.  
  970. var DoubleX_RMMV = DoubleX_RMMV || {};
  971. DoubleX_RMMV["Skill Hotkeys"] = "v1.01b";
  972.  
  973. // The plugin file name must be the same as DoubleX_RMMV.Skill_Hotkeys_File
  974. DoubleX_RMMV.Skill_Hotkeys_File = "DoubleX RMMV Skill Hotkeys v101b";
  975. //
  976.  
  977. /*============================================================================
  978.  *    ## Plugin Configurations
  979.  *       You only need to edit this part as it's about what this plugin does
  980.  *----------------------------------------------------------------------------*/
  981.  
  982. DoubleX_RMMV.Skill_Hotkeys = {
  983.  
  984. /*----------------------------------------------------------------------------
  985.  *    Parameter counterparts
  986.  *    - These configurations will only be used when their counterparts' empty
  987.  *----------------------------------------------------------------------------*/
  988.  
  989.     params: {
  990.  
  991.         /**
  992.          * The this pointer refers to the actor involved
  993.          * Sets whether this plugin will be enabled
  994.          * Hotspot/Nullipotent
  995.          * @returns {Boolean} The check result
  996.          * @since v1.00a
  997.          * @version v1.00a
  998.          */
  999.         isEnabled: function() { return true; /* Always enable this plugin */ },
  1000.  
  1001.         /**
  1002.          * The this pointer refers to the actor involved
  1003.          * Note that skills always have the highest priority
  1004.          * Sets the priority of effective <bind skill hotkey: BSHX> notetags
  1005.          * among all data types
  1006.          * Potential Hotspot/Nullipotent
  1007.          * @param {Number} skillId - The id of the skill involved
  1008.          * @returns {Array[String]} The requested data type priority queue
  1009.          * @since v1.00a
  1010.          * @version v1.00a
  1011.          */
  1012.         bindNotePriority: function(skillId) {
  1013.             // States and Actors have the highest and lowest priorities
  1014.             return [
  1015.                 "states",
  1016.                 "armors",
  1017.                 "weapons",
  1018.                 "classes",
  1019.                 "actors"
  1020.             ];
  1021.             //
  1022.         }, // bindNotePriority
  1023.  
  1024.         /**
  1025.          * The this pointer refers to the actor involved
  1026.          * Note that skills always have the highest priority
  1027.          * Sets the priority of effective <use skill hotkey: USHX> notetags
  1028.          * among all data types
  1029.          * Potential Hotspot/Nullipotent
  1030.          * @param {Number} skillId - The id of the skill involved
  1031.          * @returns {Array[String]} The requested data type priority queue
  1032.          * @since v1.00a
  1033.          * @version v1.00a
  1034.          */
  1035.         useNotePriority: function(skillId) {
  1036.             // States and Actors have the highest and lowest priorities
  1037.             return [
  1038.                 "states",
  1039.                 "armors",
  1040.                 "weapons",
  1041.                 "classes",
  1042.                 "actors"
  1043.             ];
  1044.             //
  1045.         }, // useNotePriority
  1046.  
  1047.         /**
  1048.          * The this pointer refers to the actor involved
  1049.          * Sets the priority of effective <bind skill hotkey: BSHX> notetags
  1050.          * among all data types
  1051.          * Potential Hotspot/Nullipotent
  1052.          * @param {Number} skillId - The id of the skill involved
  1053.          * @returns {String} The requested effective notetag chaining rule
  1054.          * @since v1.00a
  1055.          * @version v1.00a
  1056.          */
  1057.         bindNoteChainingRule: function(skillId) {
  1058.             return "first"; // Only the 1st effective notetag will be used
  1059.         }, // bindNoteChainingRule
  1060.  
  1061.         /**
  1062.          * The this pointer refers to the actor involved
  1063.          * Sets the priority of effective <use skill hotkey: USHX> notetags
  1064.          * among all data types
  1065.          * Potential Hotspot/Nullipotent
  1066.          * @param {Number} skillId - The id of the skill involved
  1067.          * @returns {String} The requested effective notetag chaining rule
  1068.          * @since v1.00a
  1069.          * @version v1.00a
  1070.          */
  1071.         useNoteChainingRule: function(skillId) {
  1072.             return "first"; // Only the 1st effective notetag will be used
  1073.         }, // useNoteChainingRule
  1074.  
  1075.         /**
  1076.          * The this pointer refers to the actor involved
  1077.          * Sets the bind hotkey text for skills without hotkeys
  1078.          * Nullipotent
  1079.          * @returns {String} The requested bind hotkey text
  1080.          * @since v1.00a
  1081.          * @version v1.00a
  1082.          */
  1083.         bindHotkeyText: function() {
  1084.             return "Bind Hotkey"; // The bind hotkey text will be Bind Hotkey
  1085.         }, // bindHotkeyText
  1086.  
  1087.         /**
  1088.          * The this pointer refers to the actor involved
  1089.          * Sets the use skill text when showing the bind hotkey texts
  1090.          * Nullipotent
  1091.          * @param {Number} skillId - The id of the skill involved
  1092.          * @returns {String} The requested use skill text
  1093.          * @since v1.00a
  1094.          * @version v1.00a
  1095.          */
  1096.         useSkillText: function(skillId) {
  1097.             return "Use"; // The use skill text will be Use
  1098.         }, // useSkillText
  1099.  
  1100.         /**
  1101.          * The this pointer refers to the actor involved
  1102.          * Sets the path of the icon covering the icon of unusable skills
  1103.          * Returning random values would lead to heavy performance penalties
  1104.          * Hotspot/Nullipotent
  1105.          * @returns {String} The requested cover icon path
  1106.          * @since v1.00a
  1107.          * @version v1.00a
  1108.          */
  1109.         unusableSkillCoverIconPath: function() {
  1110.             // The path of the icon will be in pictures which is in img
  1111.             return "img/pictures/";
  1112.             //
  1113.         }, // unusableSkillCoverIconPath
  1114.  
  1115.         /**
  1116.          * The this pointer refers to the actor involved
  1117.          * Sets the name of the icon covering the icon of unusable skills
  1118.          * Returning random values would lead to heavy performance penalties
  1119.          * Hotspot/Nullipotent
  1120.          * @returns {String} The requested cover icon name
  1121.          * @since v1.00a
  1122.          * @version v1.00a
  1123.          */
  1124.         unusableSkillCoverIconName: function() {
  1125.             // The name of the icon will be UnusableSkill.png
  1126.             return "UnusableSkill";
  1127.             //
  1128.         }, // unusableSkillCoverIconName
  1129.  
  1130.         /**
  1131.          * The this pointer refers to the actor involved
  1132.          * Sets the hue of the icon covering the icon of unusable skills
  1133.          * Returning random values would lead to heavy performance penalties
  1134.          * Hotspot/Nullipotent
  1135.          * @returns {Number} The requested cover icon hue
  1136.          * @since v1.00a
  1137.          * @version v1.00a
  1138.          */
  1139.         unusableSkillCoverIconHue: function() {
  1140.             return 0; // The hue of the icon will be 0
  1141.         }, // unusableSkillCoverIconName
  1142.  
  1143.         /**
  1144.          * The this pointer refers to the actor involved
  1145.          * Sets the smooth flag of the icon covering the icon of unusable skills
  1146.          * Returning random values would lead to heavy performance penalties
  1147.          * Hotspot/Nullipotent
  1148.          * @returns {Boolean} The requested cover icon smooth flag
  1149.          * @since v1.00a
  1150.          * @version v1.00a
  1151.          */
  1152.         unusableSkillCoverIconSmooth: function() {
  1153.             return true; // The smooth flag of the icon will be true
  1154.         }, // unusableSkillCoverIconSmooth
  1155.  
  1156.         /**
  1157.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1158.          * Sets the width of the window for binding hotkeys to skills
  1159.          * Returning random values would lead to heavy performance penalties
  1160.          * Hotspot/Nullipotent
  1161.          * @returns {Number} The requested window width
  1162.          * @since v1.00a
  1163.          * @version v1.00a
  1164.          */
  1165.         hotkeyCmdWindowW: function() {
  1166.             // The width will be that of an ordinary command window
  1167.             return Window_SkillHotkeyBase.prototype.windowWidth.call(this);
  1168.             //
  1169.         }, // hotkeyCmdWindowW
  1170.  
  1171.         /**
  1172.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1173.          * Sets the height of the window for binding hotkeys to skills
  1174.          * Returning random values would lead to heavy performance penalties
  1175.          * Hotspot/Nullipotent
  1176.          * @returns {Number} The requested window height
  1177.          * @since v1.00a
  1178.          * @version v1.00a
  1179.          */
  1180.         hotkeyCmdWindowH: function() {
  1181.             // The height will be that of an ordinary command window
  1182.             return Window_SkillHotkeyBase.prototype.windowHeight.call(this);
  1183.             //
  1184.         }, // hotkeyCmdWindowH
  1185.  
  1186.         /**
  1187.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1188.          * Sets the x position of the window for binding hotkeys to skills
  1189.          * Returning random values would lead to heavy performance penalties
  1190.          * Hotspot/Nullipotent
  1191.          * @returns {Number} The requested window x position
  1192.          * @since v1.00a
  1193.          * @version v1.00a
  1194.          */
  1195.         hotkeyCmdWindowX: function() {
  1196.             return 0; // The x position will be 0 pixel from the game screen
  1197.         }, // hotkeyCmdWindowX
  1198.  
  1199.         /**
  1200.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1201.          * Sets the y position of the window for binding hotkeys to skills
  1202.          * Returning random values would lead to heavy performance penalties
  1203.          * Hotspot/Nullipotent
  1204.          * @returns {Number} The requested window y position
  1205.          * @since v1.00a
  1206.          * @version v1.00a
  1207.          */
  1208.         hotkeyCmdWindowY: function() {
  1209.             return 0; // The y position will be 0 pixel from the game screen
  1210.         }, // hotkeyCmdWindowY
  1211.  
  1212.         /**
  1213.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1214.          * Sets the line height of the window for binding hotkeys to skills
  1215.          * Returning random values would lead to heavy performance penalties
  1216.          * Hotspot/Nullipotent
  1217.          * @returns {Number} The requested window line height
  1218.          * @since v1.00a
  1219.          * @version v1.00a
  1220.          */
  1221.         hotkeyCmdLineH: function() {
  1222.             return 36; // The line height will be 36 pixels
  1223.         }, // hotkeyCmdLineH
  1224.  
  1225.         /**
  1226.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1227.          * Sets the standard font size of the window for binding hotkeys to
  1228.          * skills
  1229.          * Returning random values would lead to heavy performance penalties
  1230.          * Hotspot/Nullipotent
  1231.          * @returns {Number} The requested window standard font size
  1232.          * @since v1.00a
  1233.          * @version v1.00a
  1234.          */
  1235.         hotkeyCmdFontSize: function() {
  1236.             return 28; // The standard font size will be 28 pixels
  1237.         }, // hotkeyCmdFontSize
  1238.  
  1239.         /**
  1240.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1241.          * Sets the standard padding of the window for binding hotkeys to skills
  1242.          * Returning random values would lead to heavy performance penalties
  1243.          * Hotspot/Nullipotent
  1244.          * @returns {Number} The requested window standard padding
  1245.          * @since v1.00a
  1246.          * @version v1.00a
  1247.          */
  1248.         hotkeyCmdPadding: function() {
  1249.             return 18; // The standard padding will be 18 pixels
  1250.         }, // hotkeyCmdPadding
  1251.  
  1252.         /**
  1253.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1254.          * Sets the text padding of the window for binding hotkeys to skills
  1255.          * Returning random values would lead to heavy performance penalties
  1256.          * Hotspot/Nullipotent
  1257.          * @returns {Number} The requested window text padding
  1258.          * @since v1.00a
  1259.          * @version v1.00a
  1260.          */
  1261.         hotkeyCmdTextPadding: function() {
  1262.             return 6; // The text padding will be 6 pixels
  1263.         }, // hotkeyCmdTextPadding
  1264.  
  1265.         /**
  1266.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1267.          * Sets the standard back opacity of the window for binding hotkeys to
  1268.          * skills
  1269.          * Returning random values would lead to heavy performance penalties
  1270.          * Hotspot/Nullipotent
  1271.          * @returns {Number} The requested window standard back opacity
  1272.          * @since v1.00a
  1273.          * @version v1.00a
  1274.          */
  1275.         hotkeyCmdBackOpacity: function() {
  1276.             return 192; // The standard back opacity will be 192
  1277.         }, // hotkeyCmdBackOpacity
  1278.  
  1279.         /**
  1280.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1281.          * Sets the translucent opacity of the window for binding hotkeys to
  1282.          * skills
  1283.          * Returning random values would lead to heavy performance penalties
  1284.          * Hotspot/Nullipotent
  1285.          * @returns {Number} The requested window translucent opacity
  1286.          * @since v1.00a
  1287.          * @version v1.00a
  1288.          */
  1289.         hotkeyCmdTranslucentOpacity: function() {
  1290.             return 160; // The translucent opacity will be 160
  1291.         }, // hotkeyCmdTranslucentOpacity
  1292.  
  1293.         /**
  1294.          * The this pointer refers to the window(Window_SkillHotkeyCmd) involved
  1295.          * Sets the selectable spacing of the window for binding hotkeys to
  1296.          * skills
  1297.          * Returning random values would lead to heavy performance penalties
  1298.          * Hotspot/Nullipotent
  1299.          * @returns {Number} The requested window selectable spacing
  1300.          * @since v1.00a
  1301.          * @version v1.00a
  1302.          */
  1303.         hotkeyCmdSpacing: function() {
  1304.             return 12; // The selectable spacing will be 12 pixels
  1305.         }, // hotkeyCmdSpacing
  1306.  
  1307.         /**
  1308.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1309.          * involved
  1310.          * Sets the width of the window listing skill hotkeys for binding
  1311.          * Returning random values would lead to heavy performance penalties
  1312.          * Hotspot/Nullipotent
  1313.          * @returns {Number} The requested window width
  1314.          * @since v1.00a
  1315.          * @version v1.00a
  1316.          */
  1317.         hotkeyListWindowW: function() {
  1318.             // The width will be that of the game screen
  1319.             return Graphics.boxWidth;
  1320.             //
  1321.         }, // hotkeyListWindowW
  1322.  
  1323.         /**
  1324.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1325.          * involved
  1326.          * Sets the height of the window listing skill hotkeys for binding
  1327.          * Returning random values would lead to heavy performance penalties
  1328.          * Hotspot/Nullipotent
  1329.          * @returns {Number} The requested window height
  1330.          * @since v1.00a
  1331.          * @version v1.00a
  1332.          */
  1333.         hotkeyListWindowH: function() {
  1334.             // The height will be that of ordinary window having 2 line contents
  1335.             return this.fittingHeight(2);
  1336.             //
  1337.         }, // hotkeyListWindowH
  1338.  
  1339.         /**
  1340.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1341.          * involved
  1342.          * Sets the x position of the window listing skill hotkeys for binding
  1343.          * Returning random values would lead to heavy performance penalties
  1344.          * Hotspot/Nullipotent
  1345.          * @returns {Number} The requested window x position
  1346.          * @since v1.00a
  1347.          * @version v1.00a
  1348.          */
  1349.         hotkeyListWindowX: function() {
  1350.             return 0; // The x position will be 0 pixel from the game screen
  1351.         }, // hotkeyListWindowX
  1352.  
  1353.         /**
  1354.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1355.          * involved
  1356.          * Sets the y position of the window listing skill hotkeys for binding
  1357.          * Returning random values would lead to heavy performance penalties
  1358.          * Hotspot/Nullipotent
  1359.          * @returns {Number} The requested window y position
  1360.          * @since v1.00a
  1361.          * @version v1.00a
  1362.          */
  1363.         hotkeyListWindowY: function() {
  1364.             return 0; // The y position will be 0 pixel from the game screen
  1365.         }, // hotkeyListWindowY
  1366.  
  1367.         /**
  1368.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1369.          * involved
  1370.          * Sets the line height of the window listing skill hotkeys for binding
  1371.          * Returning random values would lead to heavy performance penalties
  1372.          * Hotspot/Nullipotent
  1373.          * @returns {Number} The requested window line height
  1374.          * @since v1.00a
  1375.          * @version v1.00a
  1376.          */
  1377.         hotkeyListLineH: function() {
  1378.             return 36; // The line height will be 36 pixels
  1379.         }, // hotkeyListLineH
  1380.  
  1381.         /**
  1382.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1383.          * involved
  1384.          * Sets the standard font size of the window listing skill hotkeys for
  1385.          * binding
  1386.          * Returning random values would lead to heavy performance penalties
  1387.          * Hotspot/Nullipotent
  1388.          * @returns {Number} The requested window standard font size
  1389.          * @since v1.00a
  1390.          * @version v1.00a
  1391.          */
  1392.         hotkeyListFontSize: function() {
  1393.             return 28; // The standard font size will be 28 pixels
  1394.         }, // hotkeyListFontSize
  1395.  
  1396.         /**
  1397.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1398.          * involved
  1399.          * Sets the standard padding of the window listing skill hotkeys for
  1400.          * binding
  1401.          * Returning random values would lead to heavy performance penalties
  1402.          * Hotspot/Nullipotent
  1403.          * @returns {Number} The requested window standard padding
  1404.          * @since v1.00a
  1405.          * @version v1.00a
  1406.          */
  1407.         hotkeyListPadding: function() {
  1408.             return 18; // The standard padding will be 18 pixels
  1409.         }, // hotkeyListPadding
  1410.  
  1411.         /**
  1412.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1413.          * involved
  1414.          * Sets the text padding of the window listing skill hotkeys for binding
  1415.          * Returning random values would lead to heavy performance penalties
  1416.          * Hotspot/Nullipotent
  1417.          * @returns {Number} The requested window text padding
  1418.          * @since v1.00a
  1419.          * @version v1.00a
  1420.          */
  1421.         hotkeyListTextPadding: function() {
  1422.             return 6; // The text padding will be 6 pixels
  1423.         }, // hotkeyListTextPadding
  1424.  
  1425.         /**
  1426.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1427.          * involved
  1428.          * Sets the standard back opacity of the window listing skill hotkeys
  1429.          * for binding
  1430.          * Returning random values would lead to heavy performance penalties
  1431.          * Hotspot/Nullipotent
  1432.          * @returns {Number} The requested window standard back opacity
  1433.          * @since v1.00a
  1434.          * @version v1.00a
  1435.          */
  1436.         hotkeyListBackOpacity: function() {
  1437.             return 192; // The standard back opacity will be 192
  1438.         }, // hotkeyListBackOpacity
  1439.  
  1440.         /**
  1441.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1442.          * involved
  1443.          * Sets the translucent opacity of the window listing skill hotkeys for
  1444.          * binding
  1445.          * Returning random values would lead to heavy performance penalties
  1446.          * Hotspot/Nullipotent
  1447.          * @returns {Number} The requested window translucent opacity
  1448.          * @since v1.00a
  1449.          * @version v1.00a
  1450.          */
  1451.         hotkeyListTranslucentOpacity: function() {
  1452.             return 160; // The translucent opacity will be 160
  1453.         }, // hotkeyListTranslucentOpacity
  1454.  
  1455.         /**
  1456.          * The this pointer refers to the window(Window_SkillHotkeyList)
  1457.          * involved
  1458.          * Sets the selectable spacing of the window listing skill hotkeys for
  1459.          * binding
  1460.          * Returning random values would lead to heavy performance penalties
  1461.          * Hotspot/Nullipotent
  1462.          * @returns {Number} The requested window selectable spacing
  1463.          * @since v1.00a
  1464.          * @version v1.00a
  1465.          */
  1466.         hotkeyListSpacing: function() {
  1467.             return 12; // The selectable spacing will be 12 pixels
  1468.         }, // hotkeyListSpacing
  1469.  
  1470.         /**
  1471.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1472.          * involved
  1473.          * Sets the width of the window listing actor skill hotkeys in battle
  1474.          * Returning random values would lead to heavy performance penalties
  1475.          * Hotspot/Nullipotent
  1476.          * @returns {Number} The requested window width
  1477.          * @since v1.00a
  1478.          * @version v1.00a
  1479.          */
  1480.         hotkeyCmdListWindowW: function() {
  1481.             // The width will be that of the game screen
  1482.             return Graphics.boxWidth;
  1483.             //
  1484.         }, // hotkeyCmdListWindowW
  1485.  
  1486.         /**
  1487.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1488.          * involved
  1489.          * Sets the height of the window listing actor skill hotkeys in battle
  1490.          * Returning random values would lead to heavy performance penalties
  1491.          * Hotspot/Nullipotent
  1492.          * @returns {Number} The requested window height
  1493.          * @since v1.00a
  1494.          * @version v1.00a
  1495.          */
  1496.         hotkeyCmdListWindowH: function() {
  1497.             // The height will be that of ordinary window having 2 line contents
  1498.             return this.fittingHeight(2);
  1499.             //
  1500.         }, // hotkeyCmdListWindowH
  1501.  
  1502.         /**
  1503.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1504.          * involved
  1505.          * Sets the x position of the window listing actor skill hotkeys in
  1506.          * battle
  1507.          * Returning random values would lead to heavy performance penalties
  1508.          * Hotspot/Nullipotent
  1509.          * @returns {Number} The requested window x position
  1510.          * @since v1.00a
  1511.          * @version v1.00a
  1512.          */
  1513.         hotkeyCmdListWindowX: function() {
  1514.             return 0; // The x position will be 0 pixel from the game screen
  1515.         }, // hotkeyCmdListWindowX
  1516.  
  1517.         /**
  1518.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1519.          * involved
  1520.          * Sets the y position of the window listing actor skill hotkeys in
  1521.          * battle
  1522.          * Returning random values would lead to heavy performance penalties
  1523.          * Hotspot/Nullipotent
  1524.          * @returns {Number} The requested window y position
  1525.          * @since v1.00a
  1526.          * @version v1.00a
  1527.          */
  1528.         hotkeyCmdListWindowY: function() {
  1529.             // The window will be placed right above the status window
  1530.             return Graphics.boxHeight - this.fittingHeight(4) -
  1531.                     this.windowHeight();
  1532.             //
  1533.         }, // hotkeyCmdListWindowY
  1534.  
  1535.         /**
  1536.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1537.          * involved
  1538.          * Sets the line height of the window listing actor skill hotkeys in
  1539.          * battle
  1540.          * Returning random values would lead to heavy performance penalties
  1541.          * Hotspot/Nullipotent
  1542.          * @returns {Number} The requested window line height
  1543.          * @since v1.00a
  1544.          * @version v1.00a
  1545.          */
  1546.         hotkeyCmdListLineH: function() {
  1547.             return 36; // The line height will be 36 pixels
  1548.         }, // hotkeyCmdListLineH
  1549.  
  1550.         /**
  1551.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1552.          * involved
  1553.          * Sets the standard font size of the window listing actor skill hotkeys
  1554.          * in battle
  1555.          * Returning random values would lead to heavy performance penalties
  1556.          * Hotspot/Nullipotent
  1557.          * @returns {Number} The requested window standard font size
  1558.          * @since v1.00a
  1559.          * @version v1.00a
  1560.          */
  1561.         hotkeyCmdListFontSize: function() {
  1562.             return 28; // The standard font size will be 28 pixels
  1563.         }, // hotkeyCmdListFontSize
  1564.  
  1565.         /**
  1566.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1567.          * involved
  1568.          * Sets the standard padding of the window listing actor skill hotkeys
  1569.          * in battle
  1570.          * Returning random values would lead to heavy performance penalties
  1571.          * Hotspot/Nullipotent
  1572.          * @returns {Number} The requested window standard padding
  1573.          * @since v1.00a
  1574.          * @version v1.00a
  1575.          */
  1576.         hotkeyCmdListPadding: function() {
  1577.             return 18; // The standard padding will be 18 pixels
  1578.         }, // hotkeyCmdListPadding
  1579.  
  1580.         /**
  1581.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1582.          * involved
  1583.          * Sets the text padding of the window listing actor skill hotkeys in
  1584.          * battle
  1585.          * Returning random values would lead to heavy performance penalties
  1586.          * Hotspot/Nullipotent
  1587.          * @returns {Number} The requested window text padding
  1588.          * @since v1.00a
  1589.          * @version v1.00a
  1590.          */
  1591.         hotkeyCmdListTextPadding: function() {
  1592.             return 6; // The text padding will be 6 pixels
  1593.         }, // hotkeyCmdListTextPadding
  1594.  
  1595.         /**
  1596.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1597.          * involved
  1598.          * Sets the standard back opacity of the window listing actor skill
  1599.          * hotkeys in battle
  1600.          * Returning random values would lead to heavy performance penalties
  1601.          * Hotspot/Nullipotent
  1602.          * @returns {Number} The requested window standard back opacity
  1603.          * @since v1.00a
  1604.          * @version v1.00a
  1605.          */
  1606.         hotkeyCmdListBackOpacity: function() {
  1607.             return 192; // The standard back opacity will be 192
  1608.         }, // hotkeyCmdListBackOpacity
  1609.  
  1610.         /**
  1611.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1612.          * involved
  1613.          * Sets the translucent opacity of the window listing actor skill
  1614.          * hotkeys in battle
  1615.          * Returning random values would lead to heavy performance penalties
  1616.          * Hotspot/Nullipotent
  1617.          * @returns {Number} The requested window translucent opacity
  1618.          * @since v1.00a
  1619.          * @version v1.00a
  1620.          */
  1621.         hotkeyCmdListTranslucentOpacity: function() {
  1622.             return 160; // The translucent opacity will be 160
  1623.         }, // hotkeyCmdListTranslucentOpacity
  1624.  
  1625.         /**
  1626.          * The this pointer refers to the window(Window_BattleSkillHotkeys)
  1627.          * involved
  1628.          * Sets the selectable spacing of the window listing actor skill hotkeys
  1629.          * in battle
  1630.          * Returning random values would lead to heavy performance penalties
  1631.          * Hotspot/Nullipotent
  1632.          * @returns {Number} The requested window selectable spacing
  1633.          * @since v1.00a
  1634.          * @version v1.00a
  1635.          */
  1636.         hotkeyCmdListSpacing: function() {
  1637.             return 12; // The selectable spacing will be 12 pixels
  1638.         } // hotkeyCmdListSpacing
  1639.  
  1640.     }, // params
  1641.  
  1642. /*----------------------------------------------------------------------------
  1643.  *    Configurations
  1644.  *    - These configurations don't have any parameter counterparts
  1645.  *----------------------------------------------------------------------------*/
  1646.  
  1647.     cfgs: {
  1648.  
  1649.         /**
  1650.          * The this pointer refers to the actor involved
  1651.          * Sets the list of hotkeys mapped with their corresponding names
  1652.          * None of the hotkeys are supposed to be changed during the same battle
  1653.          * Using a keyboard mapping plugin, like Quasi Input, can be useful here
  1654.          * Ensure it won't return different values when binding/using hotkeys
  1655.          * unless you really know what you're truly doing
  1656.          * (v1.01a+)Skill name and icon shouldn't be shown at the same time
  1657.          * unless you really know what you're truly doing
  1658.          * (v1.01a+)Hotkey name and icon shouldn't be shown at the same time
  1659.          * unless you really know what you're truly doing
  1660.          * Potential Hotspot/Nullipotent
  1661.          * @returns {Object[String, Object]} The requested hotkey-name mapping
  1662.          * @since v1.00a
  1663.          * @version v1.00a
  1664.          */
  1665.         hotkeyNames: function() {
  1666.             return {
  1667.                 "#1": {
  1668.                     isShowSkillName: false,
  1669.                     isShowSkillIcon: true,
  1670.                     hotkeyName: "1", // Uses falsy value to hide hotkey name
  1671.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1672.                 },
  1673.                 "#2": {
  1674.                     isShowSkillName: false,
  1675.                     isShowSkillIcon: true,
  1676.                     hotkeyName: "2", // Uses falsy value to hide hotkey name
  1677.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1678.                 },
  1679.                 "#3": {
  1680.                     isShowSkillName: false,
  1681.                     isShowSkillIcon: true,
  1682.                     hotkeyName: "3", // Uses falsy value to hide hotkey name
  1683.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1684.                 },
  1685.                 "#4": {
  1686.                     isShowSkillName: false,
  1687.                     isShowSkillIcon: true,
  1688.                     hotkeyName: "4", // Uses falsy value to hide hotkey name
  1689.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1690.                 },
  1691.                 "#5": {
  1692.                     isShowSkillName: false,
  1693.                     isShowSkillIcon: true,
  1694.                     hotkeyName: "5", // Uses falsy value to hide hotkey name
  1695.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1696.                 },
  1697.                 "#6": {
  1698.                     isShowSkillName: false,
  1699.                     isShowSkillIcon: true,
  1700.                     hotkeyName: "6", // Uses falsy value to hide hotkey name
  1701.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1702.                 },
  1703.                 "#7": {
  1704.                     isShowSkillName: false,
  1705.                     isShowSkillIcon: true,
  1706.                     hotkeyName: "7", // Uses falsy value to hide hotkey name
  1707.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1708.                 },
  1709.                 "#8": {
  1710.                     isShowSkillName: false,
  1711.                     isShowSkillIcon: true,
  1712.                     hotkeyName: "8", // Uses falsy value to hide hotkey name
  1713.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1714.                 },
  1715.                 "#9": {
  1716.                     isShowSkillName: false,
  1717.                     isShowSkillIcon: true,
  1718.                     hotkeyName: "9", // Uses falsy value to hide hotkey name
  1719.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1720.                 },
  1721.                 "#0": {
  1722.                     isShowSkillName: false,
  1723.                     isShowSkillIcon: true,
  1724.                     hotkeyName: "0", // Uses falsy value to hide hotkey name
  1725.                     hotkeyIconIndex: 0, // Uses falsy value to hide hotkey icon
  1726.                 }
  1727.             };
  1728.         } // hotkeyNames
  1729.  
  1730.     }, // cfgs
  1731.  
  1732. /*----------------------------------------------------------------------------
  1733.  *    Notetag values
  1734.  *    - These functions are used by notetags using function name as values
  1735.  *----------------------------------------------------------------------------*/
  1736.  
  1737.     notes: {
  1738.  
  1739.         /*--------------------------------------------------------------------
  1740.          *    Bind Skill Hotkey Functions
  1741.          *    - Setups BSHX used by this plugin's notetags
  1742.          *--------------------------------------------------------------------*/
  1743.         /* BSHX names can only use alphanumeric characters
  1744.          * The 1st character of BSHX can't be a number
  1745.          * The below BSHX are examples added to help you set your BSHX
  1746.          * You can freely use, rewrite and/or delete these examples
  1747.          */
  1748.  
  1749.         /**
  1750.          * The this pointer refers to the actor involved
  1751.          * Nullipotent
  1752.          * @param {Number} skillId - The id of the skill involved
  1753.          * @param {Object} data - The data having this notetag
  1754.          * @returns {Boolean} The check result
  1755.          * @since v1.00a
  1756.          * @version v1.00a
  1757.          */
  1758.         "BSH1": function(skillId, data) { return true; },
  1759.  
  1760.         /**
  1761.          * The this pointer refers to the actor involved
  1762.          * Nullipotent
  1763.          * @param {Number} skillId - The id of the skill involved
  1764.          * @param {Object} data - The data having this notetag
  1765.          * @returns {Boolean} The check result
  1766.          * @since v1.00a
  1767.          * @version v1.00a
  1768.          */
  1769.         "BSH2": function(skillId, data) { return false; },
  1770.  
  1771.         /**
  1772.          * The this pointer refers to the actor involved
  1773.          * Nullipotent
  1774.          * @param {Number} skillId - The id of the skill involved
  1775.          * @param {Object} data - The data having this notetag
  1776.          * @returns {Boolean} The check result
  1777.          * @since v1.00a
  1778.          * @version v1.00a
  1779.          */
  1780.         "BSH3": function(skillId, data) {
  1781.             // Returns the value in the game switch with id x
  1782.             return $gameSwitches.value(x);
  1783.             //
  1784.         }, // BSH3
  1785.  
  1786.         // Adds new BSHX here
  1787.  
  1788.  
  1789.         /*--------------------------------------------------------------------
  1790.          *    Use Skill Hotkey Functions
  1791.          *    - Setups USHX used by this plugin's notetags
  1792.          *--------------------------------------------------------------------*/
  1793.         /* USHX names can only use alphanumeric characters
  1794.          * The 1st character of USHX can't be a number
  1795.          * The below USHX are examples added to help you set your USHX
  1796.          * You can freely use, rewrite and/or delete these examples
  1797.          */
  1798.  
  1799.         /**
  1800.          * The this pointer refers to the actor involved
  1801.          * Nullipotent
  1802.          * @param {Number} skillId - The id of the skill involved
  1803.          * @param {Object} data - The data having this notetag
  1804.          * @returns {Boolean} The check result
  1805.          * @since v1.00a
  1806.          * @version v1.00a
  1807.          */
  1808.         "USH1": function(skillId, data) { return true; },
  1809.  
  1810.         /**
  1811.          * The this pointer refers to the actor involved
  1812.          * Nullipotent
  1813.          * @param {Number} skillId - The id of the skill involved
  1814.          * @param {Object} data - The data having this notetag
  1815.          * @returns {Boolean} The check result
  1816.          * @since v1.00a
  1817.          * @version v1.00a
  1818.          */
  1819.         "USH2": function(skillId, data) {
  1820.             // Returns whether the id of the actor involved's 4
  1821.             return this._actorId === 4;
  1822.             //
  1823.         }, // USH2
  1824.  
  1825.         /**
  1826.          * The this pointer refers to the actor involved
  1827.          * Nullipotent
  1828.          * @param {Number} skillId - The id of the skill involved
  1829.          * @param {Object} data - The data having this notetag
  1830.          * @returns {Boolean} The check result
  1831.          * @since v1.00a
  1832.          * @version v1.00a
  1833.          */
  1834.         "USH3": function(skillId, data) {
  1835.             // Returns whether the id of the actor involved's not equal to 4
  1836.             return this._actorId !== 4;
  1837.             //
  1838.         } // USH3
  1839.  
  1840.         // Adds new USHX here
  1841.  
  1842.  
  1843.     } // notes
  1844.  
  1845. }; // DoubleX_RMMV.Skill_Hotkeys
  1846.  
  1847. /*============================================================================
  1848.  *    ## Plugin Implementations
  1849.  *       You need not edit this part as it's about how this plugin works
  1850.  *----------------------------------------------------------------------------
  1851.  *    # Plugin Support Info:
  1852.  *      1. Prerequisites
  1853.  *         - Solid understanding on how all those edited window and scene
  1854.  *           classes work
  1855.  *         - Decent RMMV plugin development proficiency to fully comprehend
  1856.  *           this
  1857.  *----------------------------------------------------------------------------*/
  1858.  
  1859. /*----------------------------------------------------------------------------
  1860.  *    # New classes:
  1861.  *      - Implements the UIs for binding/using hotkeys
  1862.  *----------------------------------------------------------------------------*/
  1863.  
  1864. function Window_SkillHotkeyBase() { this.initialize.apply(this, arguments); };
  1865.  
  1866. function Window_SkillHotkeyCmd() { this.initialize.apply(this, arguments); };
  1867.  
  1868. function Window_SkillHotkeyList() { this.initialize.apply(this, arguments); };
  1869.  
  1870. function Window_BattleSkillHotkeys() { this.initialize.apply(this, arguments); };
  1871.  
  1872. /*----------------------------------------------------------------------------
  1873.  *    # Edit class: DataManager
  1874.  *      - Reads all notetags for binding/using hotkeys
  1875.  *----------------------------------------------------------------------------*/
  1876.  
  1877. (function(SH) {
  1878.  
  1879.     "use strict";
  1880.  
  1881.     SH.DataManager = { orig: {}, new: {} };
  1882.     var _DM = SH.DataManager.orig, $ = DataManager;
  1883.     var _SH = SH.DataManager.new;
  1884.     _SH._REG_EXPS = {
  1885.         canBind: /< *bind[-_ ]+skill[-_ ]+hotkeys *: *(\w+) *>/i,
  1886.         canUse: /< *use[-_ ]+skill[-_ ]+hotkeys *: *(\w+) *>/i
  1887.     };
  1888.     _SH._areAllNotesLoaded = false;
  1889.  
  1890.     _DM.isDatabaseLoaded = $.isDatabaseLoaded;
  1891.     $.isDatabaseLoaded = function() { // v1.00a - v1.00a; Extended
  1892.         // Edited to read all notetags of this plugin as well
  1893.         return _DM.isDatabaseLoaded.apply(this, arguments) &&
  1894.                 _SH._isDatabaseLoaded.call(this);
  1895.         //
  1896.     }; // $.isDatabaseLoaded
  1897.  
  1898.     _DM.extractSaveContents = $.extractSaveContents;
  1899.     $.extractSaveContents = function(contents) {
  1900.     // v1.00a - v1.00a; Extended
  1901.         _DM.extractSaveContents.apply(this, arguments);
  1902.         // Added to use the stored function contents
  1903.         _SH._extractSaveContents.call(this);
  1904.         //
  1905.     }; // $.extractSaveContents
  1906.  
  1907.     /**
  1908.      * The this pointer is DataManager
  1909.      * DataManager.isDatabaseLoaded was Nullipotent but is now Idempotent
  1910.      * Idempotent
  1911.      * @author DoubleX
  1912.      * @returns {Boolean} The database loaded flag
  1913.      * @since v1.00a
  1914.      * @todo: Make this function Nullipotent to preserve the contract integrity
  1915.      * @version v1.00a
  1916.      */
  1917.     _SH._isDatabaseLoaded = function() {
  1918.         // Ensures the notetags will only be read exactly once upon game start
  1919.         if (_SH._areAllNotesLoaded) return true;
  1920.         _SH._loadAllNotes.call(this);
  1921.         _SH._areAllNotesLoaded = true;
  1922.         return _SH._areAllNotesLoaded;
  1923.         //
  1924.     }; // _SH._isDatabaseLoaded
  1925.  
  1926.     /**
  1927.      * The this pointer is DataManager
  1928.      * Idempotent
  1929.      * @author DoubleX
  1930.      * @since v1.00a
  1931.      * @version v1.00a
  1932.      */
  1933.     _SH._loadAllNotes = function() {
  1934.         _SH._dataTypes.call(this).forEach(_SH._loadDataTypeNotes, this);
  1935.     }; // _SH._loadAllNotes
  1936.  
  1937.     /**
  1938.      * The this pointer is DataManager
  1939.      * Nullipotent
  1940.      * @author DoubleX
  1941.      * @returns {Array[Object]} The list of data types to have notetags loaded
  1942.      * @since v1.00a
  1943.      * @version v1.00a
  1944.      */
  1945.     _SH._dataTypes = function() {
  1946.         return [
  1947.             $dataActors,
  1948.             $dataClasses,
  1949.             $dataWeapons,
  1950.             $dataArmors,
  1951.             $dataStates,
  1952.             $dataSkills
  1953.         ];
  1954.     }; // _SH._dataTypes
  1955.  
  1956.     /**
  1957.      * The this pointer is DataManager
  1958.      * Idempotent
  1959.      * @author DoubleX
  1960.      * @param {Object} type - The data type to have notetags loaded
  1961.      * @since v1.00a
  1962.      * @version v1.00a
  1963.      */
  1964.     _SH._loadDataTypeNotes = function(type) {
  1965.         type.forEach(_SH._loadDataNotes, this);
  1966.     }; // _SH._loadDataTypeNotes
  1967.  
  1968.     /**
  1969.      * The this pointer is DataManager
  1970.      * Idempotent
  1971.      * @author DoubleX
  1972.      * @param {Object/Nullable} data - The data to have notetags loaded
  1973.      * @since v1.00a
  1974.      * @version v1.00a
  1975.      */
  1976.     _SH._loadDataNotes = function(data) {
  1977.         if (data) _SH._loadNotes.call(this, data);
  1978.     }; // _SH._loadDataNotes
  1979.  
  1980.     /**
  1981.      * The this pointer is DataManager
  1982.      * Idempotent
  1983.      * @author DoubleX
  1984.      * @param {Object} data - The data to have notetags loaded
  1985.      * @since v1.00a
  1986.      * @version v1.00a
  1987.      */
  1988.     _SH._loadNotes = function(data) {
  1989.         // Plugin call/command
  1990.         data.note.split(/[\r\n]+/).forEach(
  1991.                 _SH._loadLineNotes.bind(this, data.meta.skillHotkeys = {}));
  1992.         //
  1993.     }; // _SH._loadNotes
  1994.  
  1995.     /**
  1996.      * The this pointer is DataManager
  1997.      * Idempotent
  1998.      * @author DoubleX
  1999.      * @param {Object[String, String]} skillHotkeys - The loaded notetag values
  2000.      * @param {String} line - The line being scanned for notetags to be loaded
  2001.      * @since v1.00a
  2002.      * @version v1.00a
  2003.      */
  2004.     _SH._loadLineNotes = function(skillHotkeys, line) {
  2005.         Object.keys(_SH._REG_EXPS).forEach(
  2006.                 _SH._loadNote.bind(this, skillHotkeys, line));
  2007.     }; // _SH._loadLineNotes
  2008.  
  2009.     /**
  2010.      * The this pointer is DataManager
  2011.      * Idempotent
  2012.      * @author DoubleX
  2013.      * @param {Object[String, String]} skillHotkeys - The loaded notetag values
  2014.      * @param {String} line - The line being scanned for notetags to be loaded
  2015.      * @param {String} note - The name of the notetag to be loaded
  2016.      * @since v1.00a
  2017.      * @version v1.00a
  2018.      */
  2019.     _SH._loadNote = function(skillHotkeys, line, note) {
  2020.         // Refer to reference tag LINE_MONO
  2021.         if (line.match(_SH._REG_EXPS[note])) skillHotkeys[note] = RegExp.$1;
  2022.         if (!skillHotkeys[note]) return;
  2023.         //
  2024.     }; // _SH._loadNote
  2025.  
  2026.     /**
  2027.      * The this pointer is DataManager
  2028.      * Idempotent
  2029.      * @author DoubleX
  2030.      * @since v1.00a
  2031.      * @version v1.00a
  2032.      */
  2033.     _SH._extractSaveContents = function() {
  2034.         _SH._extractFuncContents.call(this, "params");
  2035.         _SH._extractFuncContents.call(this, "cfgs");
  2036.         _SH._extractFuncContents.call(this, "notes");
  2037.     }; // _SH._extractSaveContents
  2038.  
  2039.     /**
  2040.      * The this pointer is DataManager
  2041.      * Idempotent
  2042.      * @author DoubleX
  2043.      * @param {String} funcType - The parameter/configuration/notetag label
  2044.      * @since v1.00a
  2045.      * @version v1.00a
  2046.      */
  2047.     _SH._extractFuncContents = function(funcType) {
  2048.         Object.keys($gameSystem.skillHotkeys[funcType]).forEach(
  2049.                 _SH._extractFuncContent.bind(this, funcType));
  2050.     }; // _SH._extractFuncContents
  2051.  
  2052.     /**
  2053.      * The this pointer is DataManager
  2054.      * Idempotent
  2055.      * @author DoubleX
  2056.      * @param {String} funcType - The parameter/configuration/notetag label
  2057.      * @param {String} content - The name of the stored function content
  2058.      * @since v1.00a
  2059.      * @version v1.00a
  2060.      */
  2061.     _SH._extractFuncContent = function(funcType, content) {
  2062.         SH[funcType][content] = $gameSystem.skillHotkeysFunc(
  2063.                 $gameSystem.skillHotkeys[funcType][content]);
  2064.     }; // _SH._extractFuncContent
  2065.  
  2066. })(DoubleX_RMMV.Skill_Hotkeys);
  2067.  
  2068. /*----------------------------------------------------------------------------
  2069.  *    # Edit class: Game_System
  2070.  *      - Stores all params/configurations for binding/using hotkeys
  2071.  *----------------------------------------------------------------------------*/
  2072.  
  2073. (function(SH) {
  2074.  
  2075.     "use strict";
  2076.  
  2077.     SH.Game_System = { orig: {}, new: {} };
  2078.     var _GS = SH.Game_System.orig, $ = Game_System.prototype;
  2079.     var _SH = SH.Game_System.new;
  2080.  
  2081.     _GS.initialize = $.initialize;
  2082.     $.initialize = function() { // v1.00a - v1.00a; Extended
  2083.         _GS.initialize.apply(this, arguments);
  2084.         // Added to setup parameters/configurations/notetags
  2085.         _SH._init.call(this);
  2086.         //
  2087.     }; // $.initialize
  2088.  
  2089.     /*------------------------------------------------------------------------
  2090.      *    New public instance variable
  2091.      *------------------------------------------------------------------------*/
  2092.     // {Object}skillHotkeys: The container of all other new variables
  2093.     // {Object}params: The container of all parameter/configuration values
  2094.     // {Object}cfgs: The container of all configuration only function contents
  2095.     // {Object}notes: The container of all notetag function contents
  2096.  
  2097.     /**
  2098.      * Pure function
  2099.      * @author DoubleX
  2100.      * @interface
  2101.      * @param {String} content - The stored function content
  2102.      * @returns {Function} The requested function with the stored content
  2103.      * @since v1.00a
  2104.      * @version v1.00a
  2105.      */
  2106.     $.skillHotkeysFunc = function(content) {
  2107.         // This argument list covers all cases so unused args' the only problem
  2108.         return new Function("skillId", "data", content);
  2109.         //
  2110.     }; // $.skillHotkeysFunc
  2111.  
  2112.     /**
  2113.      * The this pointer is Game_System.prototype
  2114.      * Idempotent
  2115.      * @author DoubleX
  2116.      * @since v1.00a
  2117.      * @version v1.00a
  2118.      */
  2119.     _SH._init = function() {
  2120.         _SH._initContainers.call(this);
  2121.         _SH._storeParams.call(this);
  2122.         _SH._storeCfgs.call(this, "cfgs");
  2123.         _SH._storeCfgs.call(this, "notes");
  2124.     }; // _SH._init
  2125.  
  2126.     /**
  2127.      * The this pointer is Game_System.prototype
  2128.      * Idempotent
  2129.      * @author DoubleX
  2130.      * @since v1.00a
  2131.      * @version v1.00a
  2132.      */
  2133.     _SH._initContainers = function() {
  2134.         this.skillHotkeys = { params: {}, cfgs: {}, notes: {} };
  2135.     }; // _SH._initContainers
  2136.  
  2137.     /**
  2138.      * The this pointer is Game_System.prototype
  2139.      * Idempotent
  2140.      * @author DoubleX
  2141.      * @since v1.00a
  2142.      * @version v1.00a
  2143.      */
  2144.     _SH._storeParams = function() {
  2145.         var params = _SH._rawParams.call(this);
  2146.         Object.keys(params).forEach(_SH._storeParam.bind(this, params));
  2147.     }; // _SH._storeParams
  2148.  
  2149.     /**
  2150.      * The this pointer is Game_System.prototype
  2151.      * Pure function
  2152.      * @author DoubleX
  2153.      * @returns {Object[String, String]} The requested name-value mapping
  2154.      * @since v1.00a
  2155.      * @version v1.00a
  2156.      */
  2157.     _SH._rawParams = function() {
  2158.         return PluginManager.parameters(DoubleX_RMMV.Skill_Hotkeys_File);
  2159.     }; // _SH._rawParams
  2160.  
  2161.     /**
  2162.      * The this pointer is Game_System.prototype
  2163.      * Idempotent
  2164.      * @author DoubleX
  2165.      * @param {Object[String, String]} params - The params/cfgs name-value map
  2166.      * @param {String} param - The name of the parameter/configuration
  2167.      * @since v1.00a
  2168.      * @version v1.00a
  2169.      */
  2170.     _SH._storeParam = function(params, param) {
  2171.         var contents = _SH._param.call(this, params, param);
  2172.         this.skillHotkeys.params[param] = contents;
  2173.         SH.params[param] = this.skillHotkeysFunc(contents);
  2174.     }; // _SH._storeParam
  2175.  
  2176.     /**
  2177.      * The this pointer is Game_System.prototype
  2178.      * Nullipotent
  2179.      * @author DoubleX
  2180.      * @param {Object[String, String]} params - The params/cfgs name-value map
  2181.      * @param {String} param - The name of the parameter/configuration
  2182.      * @retruns {String} The requested function contents as parameter values
  2183.      * @since v1.00a
  2184.      * @version v1.00a
  2185.      */
  2186.     _SH._param = function(params, param) {
  2187.         // Refer to reference tag PARAMETERS_CONFIGURATIONS
  2188.         return params[param] || _SH._cfg.call(this, SH.params[param]);
  2189.         //
  2190.     }; // _SH._param
  2191.  
  2192.     /**
  2193.      * The this pointer is Game_System.prototype
  2194.      * Idempotent
  2195.      * @author DoubleX
  2196.      * @param {String} cfgType - The configuration type label
  2197.      * @since v1.00a
  2198.      * @version v1.00a
  2199.      */
  2200.     _SH._storeCfgs = function(cfgType) {
  2201.         Object.keys(SH[cfgType]).forEach(_SH._storeCfg.bind(this, cfgType));
  2202.     }; // _SH._storeCfgs
  2203.  
  2204.     /**
  2205.      * The this pointer is Game_System.prototype
  2206.      * Idempotent
  2207.      * @author DoubleX
  2208.      * @param {String} cfgType - The configuration type label
  2209.      * @param {String} cfg - The name of the configuration
  2210.      * @since v1.00a
  2211.      * @version v1.00a
  2212.      */
  2213.     _SH._storeCfg = function(cfgType, cfg) {
  2214.         this.skillHotkeys[cfgType][cfg] = _SH._cfg.call(this, SH[cfgType][cfg]);
  2215.     }; // _SH._storeCfg
  2216.  
  2217.     /**
  2218.      * The this pointer is Game_System.prototype
  2219.      * Pure function
  2220.      * @author DoubleX
  2221.      * @param {Function} cfg - The function as the value of the configuration
  2222.      * @returns {String} The requested parameters in the configuration region
  2223.      * @since v1.00a
  2224.      * @version v1.00a
  2225.      */
  2226.     _SH._cfg = function(cfg) {
  2227.         // Only the function contents are stored in save files
  2228.         return cfg.toString().
  2229.                 replace(/^[^{]*{\s*/, '').replace(/\s*}[^}]*$/, '');
  2230.         //
  2231.     }; // _SH._cfg
  2232.  
  2233. })(DoubleX_RMMV.Skill_Hotkeys);
  2234.  
  2235. /*----------------------------------------------------------------------------
  2236.  *    # Edit class: Game_Actor
  2237.  *      - Uses all parameters/configurations/notetags to run plugin functions
  2238.  *----------------------------------------------------------------------------*/
  2239.  
  2240. (function(SH) {
  2241.  
  2242.     "use strict";
  2243.  
  2244.     SH.Game_Actor = { orig: {}, new: {} };
  2245.     var _GA = SH.Game_Actor.orig, $ = Game_Actor.prototype;
  2246.     var _SH = SH.Game_Actor.new;
  2247.     // Refer to reference tag NOTE_DATA_TYPES
  2248.     _SH._DATA_TYPE_FUNCS = {
  2249.         "actors": "actor",
  2250.         "classes": "currentClass",
  2251.         "weapons": "weapons",
  2252.         "armors": "armors",
  2253.         "states": "states"
  2254.     };
  2255.     //
  2256.     _SH._NOTE_CHAINING_RULES = ["every", "some"];
  2257.     _SH._NOTE_CHAINING_RULE_FUNCS = {
  2258.         "canBind": "bindNoteChainingRule",
  2259.         "canUse": "useNoteChainingRule"
  2260.     };
  2261.     _SH._NOTE_PRIORITIES = {
  2262.         "canBind": "bindNotePriority",
  2263.         "canUse": "useNotePriority"
  2264.     };
  2265.  
  2266.     /*------------------------------------------------------------------------
  2267.      *    New public instance variable
  2268.      *------------------------------------------------------------------------*/
  2269.     // {Object}skillHotkeys: The container of all other new variables
  2270.     // {Object}hotkeyMapping: The mapping from the hotkey symbol to the skill id
  2271.     // {Object}noteChangeFactors: (Plugin Call)Map from factor to change flag
  2272.  
  2273.     /*------------------------------------------------------------------------
  2274.      *    New private instance variable
  2275.      *------------------------------------------------------------------------*/
  2276.     // {Object}_noteResults: The mapping from the factor to the cached result
  2277.  
  2278.     _GA.initialize = $.initialize;
  2279.     $.initialize = function(actorId) {
  2280.         // v1.00a - v1.00a; Extended
  2281.         _SH._init.call(this); // Added to setup all internal skill hotkey states
  2282.         _GA.initialize.apply(this, arguments);
  2283.     }; // $.initialize
  2284.  
  2285.     _GA.refresh = $.refresh;
  2286.     $.refresh = function() { // v1.00a - v1.00a; Extended
  2287.         _GA.refresh.apply(this, arguments);
  2288.         // Added to raise the change notification flags
  2289.         this.raiseSkillHotkeyNoteChangeFactors();
  2290.         //
  2291.     }; // $.refresh
  2292.  
  2293.     /**
  2294.      * Plugin call/Idempotent
  2295.      * @author DoubleX
  2296.      * @interface
  2297.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2298.      * @param {String} hotkey - The symbol of the hotkey to be bound
  2299.      * @since v1.00a
  2300.      * @version v1.00a
  2301.      */
  2302.     $.bindSkillHotkey = function(skillId, hotkey) {
  2303.         if (!SH.params.isEnabled.call(this)) return;
  2304.         _SH._bind.call(this, +skillId, hotkey);
  2305.     }; // $.bindSkillHotkey
  2306.  
  2307.     /**
  2308.      * This function isn't nullipotent as it uses change notification flags
  2309.      * This function isn't idempotent as functions might return random values
  2310.      * Plugin call
  2311.      * @author DoubleX
  2312.      * @interface
  2313.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2314.      * @returns {Boolean} The check result
  2315.      * @since v1.00a
  2316.      * @todo: Make this function Nullipotent without losing performance
  2317.      * @version v1.00a
  2318.      */
  2319.     $.canBindSkillHotkeys = function(skillId) {
  2320.         return SH.params.isEnabled.call(this) &&
  2321.                 _SH._notesResult.call(this, +skillId, "canBind");
  2322.     }; // $.canBindSkillHotkeys
  2323.  
  2324.     /**
  2325.      * This function isn't nullipotent as it uses change notification flags
  2326.      * This function isn't idempotent as functions might return random values
  2327.      * Potential Hotspot/Plugin call
  2328.      * @author DoubleX
  2329.      * @interface
  2330.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2331.      * @returns {Boolean} The check result
  2332.      * @since v1.00a
  2333.      * @todo: Make this function Nullipotent without losing performance
  2334.      * @version v1.00a
  2335.      */
  2336.     $.canUseSkillHotkeys = function(skillId) {
  2337.         return SH.params.isEnabled.call(this) &&
  2338.                 this.canUse($dataSkills[skillId]) &&
  2339.                 this.isSkillHotkeysBound(skillId) &&
  2340.                 _SH._notesResult.call(this, +skillId, "canUse");
  2341.     }; // $.canUseSkillHotkeys
  2342.  
  2343.     /**
  2344.      * Plugin call/Potential Hotspot/Nullipotent
  2345.      * @author DoubleX
  2346.      * @interface
  2347.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2348.      * @returns {Boolean} The check result
  2349.      * @since v1.00a
  2350.      * @version v1.00a
  2351.      */
  2352.     $.isSkillHotkeysBound = function(skillId) {
  2353.         return this.boundSkillHotkeys(skillId).length > 0;
  2354.     }; // $.isSkillHotkeysBound
  2355.  
  2356.     /**
  2357.      * Plugin call/Potential Hotspot/Nullipotent
  2358.      * @author DoubleX
  2359.      * @interface
  2360.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2361.      * @returns {Array[String]} The list of smybols of hotkeys bound to skillId
  2362.      * @since v1.00a
  2363.      * @version v1.00a
  2364.      */
  2365.     $.boundSkillHotkeys = function(skillId) {
  2366.         return this.hotkeys().filter(_SH._isSameSkill.bind(this, skillId));
  2367.     }; // $.boundSkillHotkeys
  2368.  
  2369.     /**
  2370.      * Plugin call/Potential Hotspot/Nullipotent
  2371.      * @author DoubleX
  2372.      * @interface
  2373.      * @returns {Array[String]} The requested list of hotkey symbols
  2374.      * @since v1.00a
  2375.      * @version v1.00a
  2376.      */
  2377.     $.hotkeys = function() {
  2378.         return Object.keys(this.skillHotkeys.hotkeyMapping);
  2379.     }; // $.hotkeys
  2380.  
  2381.     /**
  2382.      * Plugin call/Idempotent
  2383.      * @author DoubleX
  2384.      * @interface
  2385.      * @since v1.00a
  2386.      * @version v1.00a
  2387.      */
  2388.     $.raiseSkillHotkeyNoteChangeFactors = function() {
  2389.         this.skillHotkeys.noteChangeFactors =
  2390.                 _SH._raisedNoteChangeFactors.call(this);
  2391.     }; // $.raiseSkillHotkeyNoteChangeFactors
  2392.  
  2393.     /**
  2394.      * The this pointer is Game_Actor.prototype
  2395.      * Idempotent
  2396.      * @author DoubleX
  2397.      * @since v1.00a
  2398.      * @version v1.00a
  2399.      */
  2400.     _SH._init = function() {
  2401.         // These codes are easy, simple and small enough to stick together
  2402.         this.skillHotkeys = { hotkeyMapping: {}, _noteResults: {} };
  2403.         this.raiseSkillHotkeyNoteChangeFactors();
  2404.         //
  2405.     }; // _SH._init
  2406.  
  2407.     /**
  2408.      * The this pointer is Game_Actor.prototype
  2409.      * Pure function
  2410.      * @author DoubleX
  2411.      * @returns {Object[String, Object[String, Boolean]]} The requested factors
  2412.      * @since v1.00a
  2413.      * @version v1.00a
  2414.      */
  2415.     _SH._raisedNoteChangeFactors = function() {
  2416.         return {
  2417.             canBind: _SH._raisedNoteChangeFactor.call(this),
  2418.             canUse: _SH._raisedNoteChangeFactor.call(this)
  2419.         };
  2420.     }; // _SH._raisedNoteChangeFactors
  2421.  
  2422.     /**
  2423.      * The this pointer is Game_Actor.prototype
  2424.      * Pure function
  2425.      * @author DoubleX
  2426.      * @returns {Object[String, Boolean]} The requested notetag change factors
  2427.      * @since v1.00a
  2428.      * @version v1.00a
  2429.      */
  2430.     _SH._raisedNoteChangeFactor = function() {
  2431.         return {
  2432.             "actors": true,
  2433.             "classes": true,
  2434.             "weapons": true,
  2435.             "armors": true,
  2436.             "states": true,
  2437.             "priority": true // Raised when the notetag priority may be changed
  2438.         };
  2439.     }; // _SH._raisedNoteChangeFactor
  2440.  
  2441.     /**
  2442.      * The this pointer is Game_Actor.prototype
  2443.      * Idempotent
  2444.      * @author DoubleX
  2445.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2446.      * @param {String} hotkey - The symbol of the hotkey to be bound
  2447.      * @since v1.00a
  2448.      * @version v1.00a
  2449.      */
  2450.     _SH._bind = function(skillId, hotkey) {
  2451.         this.skillHotkeys.hotkeyMapping[hotkey] = skillId;
  2452.     }; // _SH._bind
  2453.  
  2454.     /**
  2455.      * The this pointer is Game_Actor.prototype
  2456.      * Potential Hotspot/Nullipotent
  2457.      * @author DoubleX
  2458.      * @param {String} skillId - The id of the skill to have its hotkey bound
  2459.      * @param {String} hotkey - The symbol of the hotkey to be checked
  2460.      * @returns {Boolean} The check result
  2461.      * @since v1.00a
  2462.      * @version v1.00a
  2463.      */
  2464.     _SH._isSameSkill = function(skillId, hotkey) {
  2465.         return this.skillHotkeys.hotkeyMapping[hotkey] === skillId;
  2466.     }; // _SH._isSameSkill
  2467.  
  2468.     /**
  2469.      * This function isn't nullipotent as it uses change notification flags
  2470.      * This function isn't idempotent as functions might return random values
  2471.      * The this pointer is Game_Actor.prototype
  2472.      * Potential Hotspot
  2473.      * @author DoubleX
  2474.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2475.      * @param {String} note - The notetag to be checked against
  2476.      * @returns {Boolean} The notetags result
  2477.      * @since v1.00a
  2478.      * @todo: Make this function Nullipotent without losing performance
  2479.      * @version v1.00a
  2480.      */
  2481.     _SH._notesResult = function(skillId, note) {
  2482.         var skillResult =
  2483.                 _SH._noteResult.call(this, skillId, note, $dataSkills[skillId]);
  2484.         if (_SH._isSkillOnly.call(this, skillId, note)) return skillResult;
  2485.         return _SH._nonSkillNotesResult.call(this, skillId, note, skillResult);
  2486.     }; // _SH._notesResult
  2487.  
  2488.     /**
  2489.      * The this pointer is Game_Actor.prototype
  2490.      * Potential Hotspot/Pure function
  2491.      * @author DoubleX
  2492.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2493.      * @param {String} note - The notetag to be checked against
  2494.      * @returns {Boolean} The check result
  2495.      * @since v1.00a
  2496.      * @version v1.00a
  2497.      */
  2498.     _SH._isSkillOnly = function(skillId, note) {
  2499.         // Refer to reference tag DEFAULT_FIRST
  2500.         return _SH._NOTE_CHAINING_RULES.indexOf(
  2501.                 _SH._noteChainingRule.call(this, skillId, note)) < 0;
  2502.         //
  2503.     }; // _SH._isSkillOnly
  2504.  
  2505.     /**
  2506.      * This function isn't nullipotent as it uses change notification flags
  2507.      * This function isn't idempotent as functions might return random values
  2508.      * The this pointer is Game_Actor.prototype
  2509.      * Potential Hotspot
  2510.      * @author DoubleX
  2511.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2512.      * @param {String} note - The notetag to be checked against
  2513.      * @param {Boolean} initResult - The result as the start of the note chain
  2514.      * @returns {Boolean} The notetags result
  2515.      * @since v1.00a
  2516.      * @todo: Make this function Nullipotent without losing performance
  2517.      * @version v1.00a
  2518.      */
  2519.     _SH._nonSkillNotesResult = function(skillId, note, initResult) {
  2520.         // Changing the notetag chaining rule means _canNoteChanges returns true
  2521.         _SH._checkCanNoteChange.call(this, skillId, note, initResult);
  2522.         return _SH._noteResults.call(this, note).combined;
  2523.         //
  2524.     }; // _SH._nonSkillNotesResult
  2525.  
  2526.     /**
  2527.      * This function isn't idempotent as functions might return random values
  2528.      * The this pointer is Game_Actor.prototype
  2529.      * Potential Hotspot
  2530.      * @author DoubleX
  2531.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2532.      * @param {String} note - The notetag to be checked against
  2533.      * @param {Boolean} initResult - The result as the start of the note chain
  2534.      * @returns {Boolean} The notetags result
  2535.      * @since v1.00a
  2536.      * @version v1.00a
  2537.      */
  2538.     _SH._checkCanNoteChange = function(skillId, note, initResult) {
  2539.         // Changing the notetag chaining rule means _canNoteChanges returns true
  2540.         if (!_SH._canNoteChange.call(this, note)) return;
  2541.         _SH._setCombinedNoteResult.call(this, skillId, note, initResult);
  2542.         //
  2543.     }; // _SH._nonSkillNotesResult
  2544.  
  2545.     /**
  2546.      * The this pointer is Game_Actor.prototype
  2547.      * Potential Hotspot/Nullipotent
  2548.      * @author DoubleX
  2549.      * @param {String} note - The notetag to be checked against
  2550.      * @returns {Boolean} The check result
  2551.      * @since v1.00a
  2552.      * @version v1.00a
  2553.      */
  2554.     _SH._canNoteChange = function(note) {
  2555.         return Object.keys(_SH._noteChangeFactors.call(this, note)).some(
  2556.                 _SH._canNoteFactorChange.bind(this, note));
  2557.     }; // _SH._canNoteChange
  2558.  
  2559.     /**
  2560.      * The this pointer is Game_Actor.prototype
  2561.      * Potential Hotspot/Nullipotent
  2562.      * @author DoubleX
  2563.      * @param {String} note - The notetag to be checked against
  2564.      * @param {String} factor - The notetag factor to be checked against
  2565.      * @returns {Boolean} The check result
  2566.      * @since v1.00a
  2567.      * @version v1.00a
  2568.      */
  2569.     _SH._canNoteFactorChange = function(note, factor) {
  2570.         return _SH._noteChangeFactors.call(this, note)[factor];
  2571.     }; // _SH._canNoteFactorChange
  2572.  
  2573.     /**
  2574.      * This function isn't idempotent as functions might return random values
  2575.      * The this pointer is Game_Actor.prototype
  2576.      * Potential Hotspot
  2577.      * @author DoubleX
  2578.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2579.      * @param {String} note - The notetag to be checked against
  2580.      * @param {Boolean} initResult - The result as the start of the note chain
  2581.      * @since v1.00a
  2582.      * @version v1.00a
  2583.      */
  2584.     _SH._setCombinedNoteResult = function(skillId, note, initResult) {
  2585.         _SH._noteResults.call(this, note).combined =
  2586.                 _SH._combinedNoteResult.call(this, skillId, note, initResult);
  2587.     }; // _SH._setCombinedNoteResult
  2588.  
  2589.     /**
  2590.      * This function isn't nullipotent as it uses change notification flags
  2591.      * This function isn't idempotent as functions might return random values
  2592.      * The this pointer is Game_Actor.prototype
  2593.      * Potential Hotspot
  2594.      * @author DoubleX
  2595.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2596.      * @param {String} note - The notetag to be checked against
  2597.      * @param {Boolean} initResult - The result as the start of the note chain
  2598.      * @returns {Boolean} The requested combined notetag result
  2599.      * @since v1.00a
  2600.      * @todo: Make this function Nullipotent without losing performance
  2601.      * @version v1.00a
  2602.      */
  2603.     _SH._combinedNoteResult = function(skillId, note, initResult) {
  2604.         return _SH._noteFactors.call(this, skillId,
  2605.                 note)[_SH._noteChainingRule.call(this, skillId, note)](
  2606.                 _SH._noteFactorResult.bind(this, skillId, note, initResult));
  2607.     }; // _SH._combinedNoteResult
  2608.  
  2609.     /**
  2610.      * The this pointer is Game_Actor.prototype
  2611.      * Potential Hotspot/Nullipotent
  2612.      * @author DoubleX
  2613.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2614.      * @param {String} note - The notetag to be checked against
  2615.      * @returns {Array[String]} The requested list of notetag factors
  2616.      * @since v1.00a
  2617.      * @version v1.00a
  2618.      */
  2619.     _SH._noteFactors = function(skillId, note) {
  2620.         // "skill" isn't really a data but just using the initial notetag result
  2621.         return ["skill"].concat(
  2622.                 SH.params[_SH._NOTE_PRIORITIES[note]].call(this, skillId));
  2623.         //
  2624.     }; // _SH._noteFactors
  2625.  
  2626.     /**
  2627.      * This function isn't nullipotent as it uses change notification flags
  2628.      * This function isn't idempotent as functions might return random values
  2629.      * The this pointer is Game_Actor.prototype
  2630.      * Potential Hotspot
  2631.      * @author DoubleX
  2632.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2633.      * @param {String} note - The notetag to be checked against
  2634.      * @param {Boolean} initResult - The result as the start of the note chain
  2635.      * @param {String} factor - The notetag factor to have its result returned
  2636.      * @returns {Boolean} The requested notetag result
  2637.      * @since v1.00a
  2638.      * @todo: Make this function Nullipotent without losing performance
  2639.      * @version v1.00a
  2640.      */
  2641.     _SH._noteFactorResult = function(skillId, note, initResult, factor) {
  2642.         return _SH._DATA_TYPE_FUNCS[factor] ? _SH._noteDataTypeResult.call(
  2643.                 this, skillId, note, factor) : initResult;
  2644.     }; // _SH._noteFactorResult
  2645.  
  2646.     /**
  2647.      * This function isn't nullipotent as it uses change notification flags
  2648.      * This function isn't idempotent as functions might return random values
  2649.      * The this pointer is Game_Actor.prototype
  2650.      * Potential Hotspot
  2651.      * @author DoubleX
  2652.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2653.      * @param {String} note - The notetag to be checked against
  2654.      * @param {String} factor - The notetag factor to have its result returned
  2655.      * @returns {Boolean} The requested notetag result
  2656.      * @since v1.00a
  2657.      * @todo: Make this function Nullipotent without losing performance
  2658.      * @version v1.00a
  2659.      */
  2660.     _SH._noteDataTypeResult = function(skillId, note, factor) {
  2661.         _SH._checkNoteChangeFactor.call(this, skillId, note, factor);
  2662.         return _SH._noteResults.call(this, note)[factor];
  2663.     }; // _SH._noteDataTypeResult
  2664.  
  2665.     /**
  2666.      * This function isn't idempotent as functions might return random values
  2667.      * The this pointer is Game_Actor.prototype
  2668.      * Potential Hotspot
  2669.      * @author DoubleX
  2670.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2671.      * @param {String} note - The notetag to be checked against
  2672.      * @param {String} factor - The notetag factor to have its result returned
  2673.      * @since v1.00a
  2674.      * @version v1.00a
  2675.      */
  2676.     _SH._checkNoteChangeFactor = function(skillId, note, factor) {
  2677.         var noteChangeFactors = _SH._noteChangeFactors.call(this, note);
  2678.         if (!noteChangeFactors[factor]) return;
  2679.         _SH._resetNoteChangeFactors.call(
  2680.                 this, skillId, note, factor, noteChangeFactors);
  2681.     }; // _SH._checkNoteChangeFactor
  2682.  
  2683.     /**
  2684.      * The this pointer is Game_Actor.prototype
  2685.      * Potential Hotspot/Nullipotent
  2686.      * @author DoubleX
  2687.      * @param {String} note - The notetag to be checked against
  2688.      * @returns {Object[String, Boolean]} The requested notetag change factors
  2689.      * @since v1.00a
  2690.      * @version v1.00a
  2691.      */
  2692.     _SH._noteChangeFactors = function(note) {
  2693.         // Serves as a hooking point for possible future uses
  2694.         return this.skillHotkeys.noteChangeFactors[note];
  2695.         //
  2696.     }; // _SH._noteChangeFactors
  2697.  
  2698.     /**
  2699.      * This function isn't idempotent as functions might return random values
  2700.      * The this pointer is Game_Actor.prototype
  2701.      * Potential Hotspot
  2702.      * @author DoubleX
  2703.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2704.      * @param {String} note - The notetag to be checked against
  2705.      * @param {String} factor - The notetag factor to have its result returned
  2706.      * @param {Object[String, Boolean]} noteChangeFactors - The change flags
  2707.      * @since v1.00a
  2708.      * @version v1.00a
  2709.      */
  2710.     _SH._resetNoteChangeFactors = function(
  2711.             skillId, note, factor, noteChangeFactors) {
  2712.         noteChangeFactors[factor] = false;
  2713.         _SH._noteResults.call(this, note)[factor] =
  2714.                 _SH._newNoteDataTypeResult.call(this, skillId, note, factor);
  2715.     }; // _SH._resetNoteChangeFactors
  2716.  
  2717.     /**
  2718.      * The this pointer is Game_Actor.prototype
  2719.      * Potential Hotspot/Nullipotent
  2720.      * @author DoubleX
  2721.      * @param {String} note - The notetag to be checked against
  2722.      * @returns {Object[String, Boolean]} The requested notetag result mapping
  2723.      * @since v1.00a
  2724.      * @version v1.00a
  2725.      */
  2726.     _SH._noteResults = function(note) {
  2727.         // Serves as a hooking point for possible future uses
  2728.         return this.skillHotkeys._noteResults[note];
  2729.         //
  2730.     }; // _SH._noteResults
  2731.  
  2732.     /**
  2733.      * The this pointer is Game_Actor.prototype
  2734.      * Potential Hotspot/Nullipotent
  2735.      * @author DoubleX
  2736.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2737.      * @param {String} note - The notetag to be checked against
  2738.      * @param {String} factor - The notetag factor to have its result returned
  2739.      * @returns {Boolean} The requested notetag result
  2740.      * @since v1.00a
  2741.      * @version v1.00a
  2742.      */
  2743.     _SH._newNoteDataTypeResult = function(skillId, note, factor) {
  2744.         return _SH._noteDataType.call(
  2745.                 this, factor)[_SH._noteChainingRule.call(this, skillId, note)](
  2746.                 _SH._noteResult.bind(this, skillId, note));
  2747.     }; // _SH._newNoteDataTypeResult
  2748.  
  2749.     /**
  2750.      * The this pointer is Game_Actor.prototype
  2751.      * Potential Hotspot/Nullipotent
  2752.      * @author DoubleX
  2753.      * @param {String} factor - The notetag factor to have its result returned
  2754.      * @returns {Array[Object]} The requested list of data to be checked against
  2755.      * @since v1.00a
  2756.      * @version v1.00a
  2757.      */
  2758.     _SH._noteDataType = function(factor) {
  2759.         // Makes sure the result is an Array of data for all data types
  2760.         return [].concat(this[_SH._DATA_TYPE_FUNCS[factor]]());
  2761.         //
  2762.     }; // _SH._noteDataType
  2763.  
  2764.     /**
  2765.      * The this pointer is Game_Actor.prototype
  2766.      * Potential Hotspot/Pure function
  2767.      * @author DoubleX
  2768.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2769.      * @param {String} note - The notetag to be checked against
  2770.      * @returns {String} The requested name of the notetag chaining rule
  2771.      * @since v1.00a
  2772.      * @version v1.00a
  2773.      */
  2774.     _SH._noteChainingRule = function(skillId, note) {
  2775.         return SH.params[_SH._NOTE_CHAINING_RULE_FUNCS[note]].call(
  2776.                 this, skillId);
  2777.     }; // _SH._noteChainingRule
  2778.  
  2779.     /**
  2780.      * The this pointer is Game_Actor.prototype
  2781.      * Potential Hotspot/Nullipotent
  2782.      * @author DoubleX
  2783.      * @param {Number} skillId - The id of the skill to have its hotkey bound
  2784.      * @param {String} note - The notetag to be checked against
  2785.      * @param {Object/Nullable} data - The data to have its notetags checked
  2786.      * @returns {Boolean} The notetag result
  2787.      * @since v1.00a
  2788.      * @version v1.00a
  2789.      */
  2790.     _SH._noteResult = function(skillId, note, data) {
  2791.         // Refer to reference tag DEFAULT_TRUE
  2792.         var skillHotkeys = data ? data.meta.skillHotkeys : null;
  2793.         if (!skillHotkeys) return true;
  2794.         var func = skillHotkeys ? SH.notes[skillHotkeys[note]] : null;
  2795.         return !func || func.call(this, skillId, data);
  2796.         //
  2797.     }; // _SH._noteResult
  2798.  
  2799. })(DoubleX_RMMV.Skill_Hotkeys);
  2800.  
  2801. /*----------------------------------------------------------------------------
  2802.  *    # Edit class: Game_Interpreter
  2803.  *      - Intercepts plugin command coming from this plugin as plugin calls
  2804.  *----------------------------------------------------------------------------*/
  2805.  
  2806. (function(SH) {
  2807.  
  2808.     "use strict";
  2809.  
  2810.     SH.Game_Interpreter = { orig: {}, new: {} };
  2811.     var _GI = SH.Game_Interpreter.orig, $ = Game_Interpreter.prototype;
  2812.     var _SH = SH.Game_Interpreter.new;
  2813.     _SH._CMDS = [
  2814.         "bindSkillHotkey",
  2815.         "canBindSkillHotkey",
  2816.         "canUseSkillHotkey",
  2817.         "isSkillHotkeysBound",
  2818.         "boundSkillHotkeys",
  2819.         "hotkeys",
  2820.         "raiseSkillHotkeyNoteChangeFactors"
  2821.     ];
  2822.  
  2823.     _GI.pluginCommand = $.pluginCommand;
  2824.     $.pluginCommand = function(command, args) {
  2825.         // v1.00a - v1.00a; Extended
  2826.         _GI.pluginCommand.apply(this, arguments);
  2827.         // Added to invoke the plugin command from this plugin
  2828.         _SH._pluginCmd.call(this, command, args);
  2829.         //
  2830.     }; // $.pluginCommand
  2831.  
  2832.     /**
  2833.      * The this pointer is Game_Interpreter.prototype
  2834.      * Idempotent
  2835.      * @author DoubleX
  2836.      * @param {String} cmd - The plugin command name
  2837.      * @param {Array} args - The plugin command arguments
  2838.      * @since v1.00a
  2839.      * @version v1.00a
  2840.      */
  2841.     _SH._pluginCmd = function(cmd, args) {
  2842.         if (!_SH._isPluginCmd.call(this, cmd)) return;
  2843.         _SH._usePluginCmd.call(this, args);
  2844.     }; // _SH._pluginCmd
  2845.  
  2846.     /**
  2847.      * The this pointer is Game_Interpreter.prototype
  2848.      * Nullipotent
  2849.      * @author DoubleX
  2850.      * @param {String} cmd - The plugin command name
  2851.      * @returns {Boolean} The check result
  2852.      * @since v1.00a
  2853.      * @version v1.00a
  2854.      */
  2855.     _SH._isPluginCmd = function(cmd) { return _SH._CMDS.indexOf(cmd) >= 0; };
  2856.  
  2857.     /**
  2858.      * Plugin call's just another way of using plugin commands
  2859.      * The this pointer is Game_Interpreter.prototype
  2860.      * Idempotent
  2861.      * @author DoubleX
  2862.      * @param {String} cmd - The plugin command name
  2863.      * @param {Array} args - The plugin command arguments
  2864.      * @since v1.00a
  2865.      * @version v1.00a
  2866.      */
  2867.     _SH._usePluginCmd = function(cmd, args) {
  2868.         // The 1st argument must always be the id of the actor involved
  2869.         $gameActors.actor(+args.shift())[cmd].apply(this, args);
  2870.         //
  2871.     }; // _SH._usePluginCmd
  2872.  
  2873. })(DoubleX_RMMV.Skill_Hotkeys);
  2874.  
  2875. /*----------------------------------------------------------------------------
  2876.  *    # Edit class: Window_SkillList
  2877.  *      - Lets players bind hotkeys for unusable skills outside battle
  2878.  *----------------------------------------------------------------------------*/
  2879.  
  2880. (function(SH) {
  2881.  
  2882.     "use strict";
  2883.  
  2884.     SH.Window_SkillList = { orig: {}, new: {} };
  2885.     var _WSL = SH.Window_SkillList.orig, $ = Window_SkillList.prototype;
  2886.     var _SH =  SH.Window_SkillList.new;
  2887.  
  2888.     _WSL.isCurrentItemEnabled = $.isCurrentItemEnabled;
  2889.     $.isCurrentItemEnabled = function() { // v1.00a - v1.00a; Extended
  2890.         // Edited to let players bind hotkeys for unusable skills outside battle
  2891.         return _WSL.isCurrentItemEnabled.call(this) ||
  2892.                 _SH._isCurrentItemEnabled.call(this);
  2893.         //
  2894.     }; // $.isCurrentItemEnabled
  2895.  
  2896.     /**
  2897.      * The this pointer is Window_SkillList.prototype
  2898.      * Nullipotent
  2899.      * @author DoubleX
  2900.      * @returns {Boolean} The check result
  2901.      * @since v1.00a
  2902.      * @version v1.00a
  2903.      */
  2904.     _SH._isCurrentItemEnabled = function() {
  2905.         var item = this.item();
  2906.         return item && this._actor.canBindSkillHotkeys(item.id);
  2907.     }; // _SH._isCurrentItemEnabled
  2908.  
  2909. })(DoubleX_RMMV.Skill_Hotkeys);
  2910.  
  2911. /*----------------------------------------------------------------------------
  2912.  *    # Edit class: Window_ActorCommand
  2913.  *      - Adds skill hotkey commands for the currently inputable actor
  2914.  *----------------------------------------------------------------------------*/
  2915.  
  2916. (function(SH) {
  2917.  
  2918.     "use strict";
  2919.  
  2920.     SH.Window_ActorCommand = { orig: {}, new: {} };
  2921.     var _WAC = SH.Window_ActorCommand.orig, $ = Window_ActorCommand.prototype;
  2922.     var _SH = SH.Window_ActorCommand.new;
  2923.  
  2924.     _WAC.processHandling = $.processHandling;
  2925.     $.processHandling = function() { // New
  2926.         _WAC.processHandling.apply(this, arguments);
  2927.         // Added to process the bound skill hotkeys for the actor in battle
  2928.         _SH._processHandling.call(this);
  2929.         //
  2930.     }; // $.processHandling
  2931.  
  2932.     /**
  2933.      * Idempotent
  2934.      * @author DoubleX
  2935.      * @interface
  2936.      * @param {String} hotkey - The symbol of the involved hotkey
  2937.      * @since v1.00a
  2938.      * @version v1.00a
  2939.      */
  2940.     $.onUseSkillHotkey = function(hotkey) {
  2941.         if (_SH._canUseHotkey.call(this, hotkey)) {
  2942.             return _SH._onCallHandler.call(this, hotkey);
  2943.         }
  2944.         this.playBuzzerSound();
  2945.     }; // $.onUseSkillHotkey
  2946.  
  2947.     /**
  2948.      * The this pointer is Window_ActorCommand.prototype
  2949.      * Hotspot/Idempotent
  2950.      * @author DoubleX
  2951.      * @since v1.00a
  2952.      * @version v1.00a
  2953.      */
  2954.     _SH._processHandling = function() {
  2955.         if (_SH._isProcessHotkeys.call(this)) _SH._processHotkeys.call(this);
  2956.     }; // _SH._processHandling
  2957.  
  2958.     /**
  2959.      * The this pointer is Window_ActorCommand.prototype
  2960.      * Hotspot/Idempotent
  2961.      * @author DoubleX
  2962.      * @returns {Boolean} The check result
  2963.      * @since v1.00a
  2964.      * @version v1.00a
  2965.      */
  2966.     _SH._isProcessHotkeys = function() {
  2967.         return this.isOpenAndActive() && SH.params.isEnabled.call(this._actor);
  2968.     }; // _SH._isProcessHotkeys
  2969.  
  2970.     /**
  2971.      * The this pointer is Window_ActorCommand.prototype
  2972.      * Hotspot/Idempotent
  2973.      * @author DoubleX
  2974.      * @since v1.00a
  2975.      * @version v1.00a
  2976.      */
  2977.     _SH._processHotkeys = function() {
  2978.         this._actor.hotkeys().forEach(_SH._processHotkey, this);
  2979.     }; // _SH._processHotkeys
  2980.  
  2981.     /**
  2982.      * The this pointer is Window_ActorCommand.prototype
  2983.      * Hotspot/Idempotent
  2984.      * @author DoubleX
  2985.      * @param {String} hotkey - The symbol of the involved hotkey
  2986.      * @since v1.00a
  2987.      * @version v1.00a
  2988.      */
  2989.     _SH._processHotkey = function(hotkey) {
  2990.         if (Input.isTriggered(hotkey)) this.onUseSkillHotkey(hotkey);
  2991.     }; // _SH._processHotkey
  2992.  
  2993.     /**
  2994.      * The this pointer is Window_ActorCommand.prototype
  2995.      * Potential Hotspot/Nullipotent
  2996.      * @author DoubleX
  2997.      * @param {String} hotkey - The symbol of the involved hotkey
  2998.      * @returns {Boolean} The check result
  2999.      * @since v1.00a
  3000.      * @version v1.00a
  3001.      */
  3002.     _SH._canUseHotkey = function(hotkey) {
  3003.         return this._actor.canUseSkillHotkeys(
  3004.                 _SH._hotkeyMapping.call(this)[hotkey]);
  3005.     }; // _SH._canUseHotkey
  3006.  
  3007.     /**
  3008.      * The this pointer is Window_ActorCommand.prototype
  3009.      * Potential Hotspot/Nullipotent
  3010.      * @author DoubleX
  3011.      * @returns {Object[String, Number]} The requested hotkey mapping
  3012.      * @since v1.00a
  3013.      * @version v1.00a
  3014.      */
  3015.     _SH._hotkeyMapping = function() {
  3016.         return this._actor.skillHotkeys.hotkeyMapping;
  3017.     }; // _SH._hotkeyMapping
  3018.  
  3019.     /**
  3020.      * The this pointer is Window_ActorCommand.prototype
  3021.      * Potential Hotspot/Idempotent
  3022.      * @author DoubleX
  3023.      * @param {String} hotkey - The symbol of the involved hotkey
  3024.      * @since v1.00a
  3025.      * @version v1.00a
  3026.      */
  3027.     _SH._onCallHandler = function(hotkey) {
  3028.         this.playOkSound();
  3029.         this.callHandler(hotkey);
  3030.     }; // _SH._onCallHandler
  3031.  
  3032. })(DoubleX_RMMV.Skill_Hotkeys);
  3033.  
  3034. /*----------------------------------------------------------------------------
  3035.  *    # Edit class: Window_BattleSkill
  3036.  *      - Selects the skill bound to the used hotkey by the actor in battle
  3037.  *----------------------------------------------------------------------------*/
  3038.  
  3039. (function(SH) {
  3040.  
  3041.     "use strict";
  3042.  
  3043.     SH.Window_BattleSkill = { orig: {}, new: {} };
  3044.     var _WSL = SH.Window_SkillList.orig, $$ = Window_SkillList.prototype;
  3045.     var _WBS = SH.Window_BattleSkill.orig;
  3046.     var $ = Window_BattleSkill.prototype, _SH = SH.Window_BattleSkill.new;
  3047.  
  3048.     // It's to prevent unknowningly overriding that from other plugins
  3049.     if ($.isCurrentItemEnabled) {
  3050.         _WBS.isCurrentItemEnabled = $.isCurrentItemEnabled;
  3051.         $.isCurrentItemEnabled = function() { // New
  3052.             // Added to prevent unusable hotkey skills from being selected
  3053.             if (!_WSL.isCurrentItemEnabled.call(this)) return false;
  3054.             //
  3055.             return _WBS.isCurrentItemEnabled.apply(this, arguments);
  3056.         }; // $.processHandling
  3057.     } else {
  3058.         /**
  3059.          * Nullipotent
  3060.          * @author DoubleX
  3061.          * @interface
  3062.          * @since v1.01b
  3063.          * @version v1.01b
  3064.          */
  3065.         $.isCurrentItemEnabled = function() {
  3066.             if (!_WSL.isCurrentItemEnabled.call(this)) return false;
  3067.             return $$.isCurrentItemEnabled.call(this);
  3068.         }; // $.isCurrentItemEnabled
  3069.     }
  3070.     //
  3071.  
  3072.     /**
  3073.      * Idempotent
  3074.      * @author DoubleX
  3075.      * @interface
  3076.      * @param {String} hotkey - The symbol of ther hotkey involved
  3077.      * @since v1.00a
  3078.      * @version v1.00a
  3079.      */
  3080.     $.selectHotkeySkill = function(hotkey) {
  3081.         var skill = _SH._hotkeySkill.call(this, hotkey);
  3082.         // Otherwise there would have no skill to be selected
  3083.         this.setStypeId(skill.stypeId);
  3084.         this.refresh();
  3085.         //
  3086.         this.select(_SH._hotkeySkillIndex.call(this, skill));
  3087.     }; // $.selectHotkeySkill
  3088.  
  3089.     /**
  3090.      * The this pointer is Window_BattleSkill.prototype
  3091.      * Nullipotent
  3092.      * @author DoubleX
  3093.      * @param {String} hotkey - The symbol of ther hotkey involved
  3094.      * @returns {Object} The requested skill bound to the hotkey
  3095.      * @since v1.00a
  3096.      * @version v1.00a
  3097.      */
  3098.     _SH._hotkeySkill = function(hotkey) {
  3099.         return $dataSkills[_SH._hotkeyMapping.call(this)[hotkey]];
  3100.     }; // _SH._hotkeySkill
  3101.  
  3102.     /**
  3103.      * The this pointer is Window_BattleSkill.prototype
  3104.      * Nullipotent
  3105.      * @author DoubleX
  3106.      * @returns {Object[String, Number]} The requested hotkey mapping
  3107.      * @since v1.00a
  3108.      * @version v1.00a
  3109.      */
  3110.     _SH._hotkeyMapping = function() {
  3111.         return this._actor.skillHotkeys.hotkeyMapping;
  3112.     }; // _SH._hotkeyMapping
  3113.  
  3114.     /**
  3115.      * The this pointer is Window_BattleSkill.prototype
  3116.      * Nullipotent
  3117.      * @author DoubleX
  3118.      * @param {Object} skill - The skill bound to the hokey
  3119.      * @returns {Number} The requested index of the skill bound to the hotkey
  3120.      * @since v1.00a
  3121.      * @version v1.00a
  3122.      */
  3123.     _SH._hotkeySkillIndex = function(skill) {
  3124.         return this._data.indexOf(skill);
  3125.     }; // _SH._hotkeySkillIndex
  3126.  
  3127. })(DoubleX_RMMV.Skill_Hotkeys);
  3128.  
  3129. /*----------------------------------------------------------------------------
  3130.  *    # New class: Window_SkillHotkeyBase
  3131.  *      - Be the abstract base class for all the new hotkey window classes
  3132.  *----------------------------------------------------------------------------*/
  3133.  
  3134. (function(SH) {
  3135.  
  3136.     "use strict";
  3137.  
  3138.     var $ = Window_SkillHotkeyBase.prototype =
  3139.             Object.create(Window_Command.prototype);
  3140.     $.constructor = Window_SkillHotkeyBase;
  3141.  
  3142.     /*------------------------------------------------------------------------
  3143.      *    New private instance variables
  3144.      *------------------------------------------------------------------------*/
  3145.     // {Number}_lineH: The cached window line height
  3146.     // {Number}_fontSize: The cached window font size
  3147.     // {Number}_padding: The cached window padding
  3148.     // {Number}_textPadding: The cached window text padding
  3149.     // {Number}_backOpacity: The cached window back opacity
  3150.     // {Number}_spacing: The cached selectable window spacing
  3151.  
  3152.     $.update = function() {
  3153.         Window_Command.prototype.update.call(this);
  3154.         this._update();
  3155.     }; // $.update
  3156.  
  3157.     /**
  3158.      * Hotspot/Idempotent
  3159.      * @author DoubleX
  3160.      * @since v1.00a
  3161.      * @version v1.00a
  3162.      */
  3163.     $._update = function() {
  3164.         this._updateWithoutRefreshes();
  3165.         this._updateWithRefreshes();
  3166.         this._onRefresh();
  3167.     }; // $._update
  3168.  
  3169.     /**
  3170.      * Hotspot/Idempotent
  3171.      * @author DoubleX
  3172.      * @since v1.00a
  3173.      * @version v1.00a
  3174.      */
  3175.     $._updateWithoutRefreshes = function() {
  3176.         this._updateWithoutRefresh("width", this.windowWidth());
  3177.         this._updateWithoutRefresh("height", this.windowHeight());
  3178.         this._updateWithoutRefresh("x", this.windowX());
  3179.         this._updateWithoutRefresh("y", this.windowY());
  3180.     }; // $._updateWithoutRefreshes
  3181.  
  3182.     /**
  3183.      * Hotspot/Idempotent
  3184.      * @author DoubleX
  3185.      * @param {String} valName - The name of the variable to be updated
  3186.      * @param {Number} newVal - The new value of the variable to be updated
  3187.      * @since v1.00a
  3188.      * @version v1.00a
  3189.      */
  3190.     $._updateWithoutRefresh = function(valName, newVal) {
  3191.         if (this[valName] !== newVal) this[valName] = newVal;
  3192.     }; // $._updateWithoutRefresh
  3193.  
  3194.     /**
  3195.      * Hotspot/Idempotent
  3196.      * @author DoubleX
  3197.      * @since v1.00a
  3198.      * @version v1.00a
  3199.      */
  3200.     $._updateWithRefreshes = function() {
  3201.         this._updateWithRefresh("_lineH", this.lineHeight());
  3202.         this._updateWithRefresh("_fontSize", this.standardFontSize());
  3203.         this._updateWithRefresh("_padding", this.standardPadding());
  3204.         this._updateWithRefresh("_textPadding", this.textPadding());
  3205.         this._updateWithRefresh("_backOpacity", this.standardBackOpacity());
  3206.         this._updateWithRefresh(
  3207.                 "_translucentOpacity", this.translucentOpacity());
  3208.         this._updateWithRefresh("_spacing", this.spacing());
  3209.     }; // $._updateWithRefreshes
  3210.  
  3211.     /**
  3212.      * Hotspot/Idempotent
  3213.      * @author DoubleX
  3214.      * @param {String} valName - The name of the variable to be updated
  3215.      * @param {Number} newVal - The new value of the variable to be updated
  3216.      * @since v1.00a
  3217.      * @version v1.00a
  3218.      */
  3219.     $._updateWithRefresh = function(valName, newVal) {
  3220.         this._isRefresh = this[valName] !== newVal;
  3221.         if (this._isRefresh) this[valName] = newVal;
  3222.     }; // $._updateWithRefresh
  3223.  
  3224.     /**
  3225.      * Hotspot/Idempotent
  3226.      * @author DoubleX
  3227.      * @since v1.00a
  3228.      * @version v1.00a
  3229.      */
  3230.     $._onRefresh = function() {
  3231.         if (!this._isRefresh) return;
  3232.         this._isRefresh = false;
  3233.         this.refresh();
  3234.     }; // $._onRefresh
  3235.  
  3236. })(DoubleX_RMMV.Skill_Hotkeys);
  3237.  
  3238. /*----------------------------------------------------------------------------
  3239.  *    # New class: Window_SkillHotkeyCmd
  3240.  *      - Lets players bind hotkeys to skills for the actors involved
  3241.  *----------------------------------------------------------------------------*/
  3242.  
  3243. (function(SH) {
  3244.  
  3245.     "use strict";
  3246.  
  3247.     var $ = Window_SkillHotkeyCmd.prototype =
  3248.             Object.create(Window_SkillHotkeyBase.prototype);
  3249.     $.constructor = Window_SkillHotkeyCmd;
  3250.  
  3251.     /**
  3252.      * Idempotent
  3253.      * @author DoubleX
  3254.      * @constructor
  3255.      * @param {Game_Actor} actor - The actor using this window
  3256.      * @since v1.00a
  3257.      * @version v1.00a
  3258.      */
  3259.     $.initialize = function(actor) {
  3260.         // This must be run first or _makeCmdList would use a null actor
  3261.         this._actor = actor;
  3262.         //
  3263.         Window_SkillHotkeyBase.prototype.initialize.call(
  3264.                 this, this.windowX(), this.windowY());
  3265.         this.openness = 0; // This must be run last or the game would crash
  3266.         // This must be run last or the parent would activate the window again
  3267.         this.deactivate();
  3268.         //
  3269.     }; // $.initialize
  3270.  
  3271.     $.lineHeight = function() { return SH.params.hotkeyCmdLineH.call(this); };
  3272.  
  3273.     $.standardFontSize = function() {
  3274.         return SH.params.hotkeyCmdFontSize.call(this);
  3275.     }; // $.standardFontSize
  3276.  
  3277.     $.standardPadding = function() {
  3278.         return SH.params.hotkeyCmdPadding.call(this);
  3279.     }; // $.standardPadding
  3280.  
  3281.     $.textPadding = function() {
  3282.         return SH.params.hotkeyCmdTextPadding.call(this);
  3283.     }; // $.textPadding
  3284.  
  3285.     $.standardBackOpacity = function() {
  3286.         return SH.params.hotkeyCmdBackOpacity.call(this);
  3287.     }; // $.standardBackOpacity
  3288.  
  3289.     $.translucentOpacity = function() {
  3290.         return SH.params.hotkeyCmdTranslucentOpacity.call(this);
  3291.     }; // $.translucentOpacity
  3292.  
  3293.     $.spacing = function() { return SH.params.hotkeyCmdSpacing.call(this); };
  3294.  
  3295.     $.windowWidth = function() {
  3296.         return SH.params.hotkeyCmdWindowW.call(this);
  3297.     }; // $.windowWidth
  3298.  
  3299.     $.windowHeight = function() {
  3300.         return SH.params.hotkeyCmdWindowH.call(this);
  3301.     }; // $.windowHeight
  3302.  
  3303.     /**
  3304.      * Idempotent
  3305.      * @author DoubleX
  3306.      * @interface
  3307.      * @param {Number} skillId - The id of the skill involved
  3308.      * @since v1.00a
  3309.      * @version v1.00a
  3310.      */
  3311.     $.makeCommandList = function(skillId) {
  3312.         // It's just to play safe
  3313.         Window_SkillHotkeyBase.prototype.makeCommandList.call(this);
  3314.         //
  3315.         // Otherwise _makeCmdList would take the undefined skillId
  3316.         this._makeCmdList(skillId || this._skillId);
  3317.         //
  3318.     }; // $.makeCommandList
  3319.  
  3320.     /**
  3321.      * Idempotent
  3322.      * @author DoubleX
  3323.      * @interface
  3324.      * @param {Number} skillId - The id of the skill involved
  3325.      * @since v1.00a
  3326.      * @version v1.00a
  3327.      */
  3328.     $.setup = function(skillId) {
  3329.         // Otherwise makeCommandList would pass undefined to _makeCmdList
  3330.         this._skillId = skillId;
  3331.         //
  3332.         this.clearCommandList();
  3333.         this.makeCommandList(skillId);
  3334.         this.refresh();
  3335.         this.select(0);
  3336.         this.activate();
  3337.         this.open();
  3338.     }; // $.setup
  3339.  
  3340.     /**
  3341.      * Hotspot/Nullipotent
  3342.      * @author DoubleX
  3343.      * @interface
  3344.      * @returns {Number} The requested window x position
  3345.      * @since v1.00a
  3346.      * @version v1.00a
  3347.      */
  3348.     $.windowX = function() { return SH.params.hotkeyCmdWindowX.call(this); };
  3349.  
  3350.     /**
  3351.      * Hotspot/Nullipotent
  3352.      * @author DoubleX
  3353.      * @interface
  3354.      * @returns {Number} The requested window y position
  3355.      * @since v1.00a
  3356.      * @version v1.00a
  3357.      */
  3358.     $.windowY = function() { return SH.params.hotkeyCmdWindowY.call(this); };
  3359.  
  3360.     /**
  3361.      * Idempotent
  3362.      * @author DoubleX
  3363.      * @param {Number/Nullable} skillId - The id of the skill involved
  3364.      * @since v1.00a
  3365.      * @version v1.00a
  3366.      */
  3367.     $._makeCmdList = function(skillId) {
  3368.         // These commands must be available or this window wouldn't be setup
  3369.         this.addCommand(SH.params.bindHotkeyText.call(this._actor), 'bind');
  3370.         //
  3371.         this.addCommand(SH.params.useSkillText.call(this._actor, skillId),
  3372.                 'use', this._actor.canUse($dataSkills[skillId]));
  3373.     }; // $._makeCmdList
  3374.  
  3375. })(DoubleX_RMMV.Skill_Hotkeys);
  3376.  
  3377. /*----------------------------------------------------------------------------
  3378.  *    # New class: Window_SkillHotkeyList
  3379.  *      - Shows the list of hotkey slots when binding skill hotkeys
  3380.  *----------------------------------------------------------------------------*/
  3381.  
  3382. (function(SH) {
  3383.  
  3384.     "use strict";
  3385.  
  3386.     var $ = Window_SkillHotkeyList.prototype =
  3387.             Object.create(Window_SkillHotkeyBase.prototype);
  3388.     $.constructor = Window_SkillHotkeyList;
  3389.  
  3390.     /*------------------------------------------------------------------------
  3391.      *    New private instance variable
  3392.      *------------------------------------------------------------------------*/
  3393.     // {Bitmap}_unusableSkillCoverIcon: The cached unusable skill cover icon
  3394.  
  3395.     /**
  3396.      * Idempotent
  3397.      * @author DoubleX
  3398.      * @constructor
  3399.      * @param {Game_Actor} actor - The actor using this window
  3400.      * @since v1.00a
  3401.      * @version v1.00a
  3402.      */
  3403.     $.initialize = function(actor) {
  3404.         // Otherwise this._actor would be null in the function this._skillId
  3405.         this._actor = actor, this._data = this._hotkeyMapping();
  3406.         //
  3407.         Window_SkillHotkeyBase.prototype.initialize.call(
  3408.                 this, this.windowX(), this.windowY());
  3409.     }; // $.initialize
  3410.  
  3411.     $.lineHeight = function() { return SH.params.hotkeyListLineH.call(this); };
  3412.  
  3413.     $.standardFontSize = function() {
  3414.         return SH.params.hotkeyListFontSize.call(this);
  3415.     }; // $.standardFontSize
  3416.  
  3417.     $.standardPadding = function() {
  3418.         return SH.params.hotkeyListPadding.call(this);
  3419.     }; // $.standardPadding
  3420.  
  3421.     $.textPadding = function() {
  3422.         return SH.params.hotkeyListTextPadding.call(this);
  3423.     }; // $.textPadding
  3424.  
  3425.     $.standardBackOpacity = function() {
  3426.         return SH.params.hotkeyListBackOpacity.call(this);
  3427.     }; // $.standardBackOpacity
  3428.  
  3429.     $.translucentOpacity = function() {
  3430.         return SH.params.hotkeyListTranslucentOpacity.call(this);
  3431.     }; // $.translucentOpacity
  3432.  
  3433.     $.spacing = function() { return SH.params.hotkeyListSpacing.call(this); };
  3434.  
  3435.     $.windowWidth = function() {
  3436.         return SH.params.hotkeyListWindowW.call(this);
  3437.     }; // $.windowWidth
  3438.  
  3439.     $.windowHeight = function() {
  3440.         return SH.params.hotkeyListWindowH.call(this);
  3441.     }; // $.windowHeight
  3442.  
  3443.     $.maxCols = function() { return this.maxItems(); };
  3444.  
  3445.     $.maxItems = function() { return this._hotkeyList().length; };
  3446.  
  3447.     $.itemHeight = function() {
  3448.         return this.lineHeight() + Window_Base._iconHeight + 1;
  3449.     }; // $.itemHeight
  3450.  
  3451.     /** @todo: Breaks this function into smaller pieces */
  3452.     $.drawItem = function(index) {
  3453.         var skillId = this._skillId(index), rect = this.itemRect(index);
  3454.         var hotkeyCfg = this._hotkeyCfg(index), y = rect.y;
  3455.         var skillIconIndex = this._skillIconIndex(skillId);
  3456.         var canUse = this._canUse(skillId);
  3457.         if (skillIconIndex && hotkeyCfg.isShowSkillIcon) {
  3458.             this.drawIcon(skillIconIndex, rect.x, y);
  3459.             if (!canUse) this._drawUnusableSkillCoverIcon(rect.x, y);
  3460.             y += Window_Base._iconHeight + 1;
  3461.         }
  3462.         var skillName = this._skillName(skillId);
  3463.         if (skillName && hotkeyCfg.isShowSkillName) {
  3464.             this.changePaintOpacity(canUse);
  3465.             this.drawText(skillName, rect.x, y);
  3466.             y += this.lineHeight() + 1;
  3467.         }
  3468.         if (hotkeyCfg.hotkeyIconIndex) {
  3469.             this.drawIcon(hotkeyCfg.hotkeyIconIndex, rect.x, y);
  3470.             y += Window_Base._iconHeight + 1;
  3471.         }
  3472.         if (!hotkeyCfg.hotkeyName) return;
  3473.         this.changePaintOpacity(true);
  3474.         this.drawText(hotkeyCfg.hotkeyName, rect.x, y);
  3475.     }; // $.drawItem
  3476.  
  3477.     $.refresh = function() {
  3478.         Window_Selectable.prototype.refresh.call(this);
  3479.     }; // $.refresh
  3480.  
  3481.     $.isCurrentItemEnabled = function() { return true; };
  3482.  
  3483.     $.processHandling = function() {
  3484.         Window_SkillHotkeyBase.prototype.processHandling.apply(this, arguments);
  3485.         this._processHandling(this);
  3486.     }; // $.processHandling
  3487.  
  3488.     /**
  3489.      * Hotspot/Nullipotent
  3490.      * @author DoubleX
  3491.      * @interface
  3492.      * @returns {Number} The requested window x position
  3493.      * @since v1.00a
  3494.      * @version v1.00a
  3495.      */
  3496.     $.windowX = function() { return SH.params.hotkeyListWindowX.call(this); };
  3497.  
  3498.     /**
  3499.      * Hotspot/Nullipotent
  3500.      * @author DoubleX
  3501.      * @interface
  3502.      * @returns {Number} The requested window y position
  3503.      * @since v1.00a
  3504.      * @version v1.00a
  3505.      */
  3506.     $.windowY = function() { return SH.params.hotkeyListWindowY.call(this); };
  3507.  
  3508.     /**
  3509.      * Hotspot/Idempotent
  3510.      * @author DoubleX
  3511.      * @since v1.00a
  3512.      * @version v1.00a
  3513.      */
  3514.     $._update = function() {
  3515.         Window_SkillHotkeyBase.prototype._update.call(this);
  3516.         this._updateUnusableSkillCoverIcon();
  3517.     }; // $._update
  3518.  
  3519.     /**
  3520.      * Hotspot/Idempotent
  3521.      * @author DoubleX
  3522.      * @since v1.00a
  3523.      * @version v1.00a
  3524.      */
  3525.     $._updateUnusableSkillCoverIcon = function() {
  3526.         if (!this._canHaveNewUnusableSkillCoverIcon()) return;
  3527.         this._onSetNewUnusableSkillCoverIcon();
  3528.     }; // $._updateUnusableSkillCoverIcon
  3529.  
  3530.     /**
  3531.      * This function isn't nullipotent as new values will be assigned as well
  3532.      * Hotspot/Idempotent
  3533.      * @author DoubleX
  3534.      * @returns {Boolean} The check result
  3535.      * @since v1.00a
  3536.      * @todo: Make this function Nullipotent without losing performance
  3537.      * @version v1.00a
  3538.      */
  3539.     $._canHaveNewUnusableSkillCoverIcon = function() {
  3540.         return this._hasNewUnusableSkillCoverIcon("Path") ||
  3541.                 this._hasNewUnusableSkillCoverIcon("Name") ||
  3542.                 this._hasNewUnusableSkillCoverIcon("Hue") ||
  3543.                 this._hasNewUnusableSkillCoverIcon("Smooth");
  3544.     }; // $._canHaveNewUnusableSkillCoverIcon
  3545.  
  3546.     /**
  3547.      * This function isn't nullipotent as new values will be assigned as well
  3548.      * Hotspot/Idempotent
  3549.      * @author DoubleX
  3550.      * @param {String} part - The name of the part consituiting the cover icon
  3551.      * @returns {Boolean} The check result
  3552.      * @since v1.00a
  3553.      * @todo: Make this function Nullipotent without losing performance
  3554.      * @version v1.00a
  3555.      */
  3556.     $._hasNewUnusableSkillCoverIcon = function(part) {
  3557.         // These codes are easy, simple and small enough to stick together
  3558.         var newPart =
  3559.                 SH.params["unusableSkillCoverIcon" + part].call(this._actor);
  3560.         var hasNew = this["_unusableSkillCoverIcon" + part] !== newPart;
  3561.         if (hasNew) this["_unusableSkillCoverIcon" + part] = newPart;
  3562.         return hasNew;
  3563.         //
  3564.     }; // $._hasNewUnusableSkillCoverIcon
  3565.  
  3566.     /**
  3567.      * Potential Hotspot/Idempotent
  3568.      * @author DoubleX
  3569.      * @since v1.00a
  3570.      * @version v1.00a
  3571.      */
  3572.     $._onSetNewUnusableSkillCoverIcon = function() {
  3573.         this._setNewUnusableSkillCoverIcon();
  3574.         // Otherwise the new icon might not be drawn as it needs time to load
  3575.         this.refresh();
  3576.         //
  3577.     }; // $._onSetNewUnusableSkillCoverIcon
  3578.  
  3579.     /**
  3580.      * Potential Hotspot/Idempotent
  3581.      * @author DoubleX
  3582.      * @since v1.00a
  3583.      * @version v1.00a
  3584.      */
  3585.     $._setNewUnusableSkillCoverIcon = function() {
  3586.         this._unusableSkillCoverIcon = this._newUnusableSkillCoverIcon();
  3587.     }; // $._setNewUnusableSkillCoverIcon
  3588.  
  3589.     /**
  3590.      * Potential Hotspot/Nullipotent
  3591.      * @author DoubleX
  3592.      * @returns {Bitmap} The requested unusable skill ocver icon
  3593.      * @since v1.00a
  3594.      * @version v1.00a
  3595.      */
  3596.     $._newUnusableSkillCoverIcon = function() {
  3597.         return ImageManager.loadBitmap(this._unusableSkillCoverIconPath,
  3598.                 this._unusableSkillCoverIconName,
  3599.                 this._unusableSkillCoverIconHue,
  3600.                 this._unusableSkillCoverIconSmooth);
  3601.     }; // $._newUnusableSkillCoverIcon
  3602.  
  3603.     /**
  3604.      * Nullipotent
  3605.      * @author DoubleX
  3606.      * @param {Number} index - The hotkey slot index
  3607.      * @returns {Object} The requested hotkey configuration object
  3608.      * @since v1.01a
  3609.      * @version v1.01a
  3610.      */
  3611.     $._hotkeyCfg = function(index) {
  3612.         return SH.cfgs.hotkeyNames.call(this._actor)[this._hotkey(index)];
  3613.     }; // $._hotkeyCfg
  3614.  
  3615.     /**
  3616.      * Nullipotent
  3617.      * @author DoubleX
  3618.      * @param {Number} index - The hotkey slot index
  3619.      * @returns {String} The requested hotkey symbol
  3620.      * @since v1.00a
  3621.      * @version v1.00a
  3622.      */
  3623.     $._hotkey = function(index) { return this._hotkeyList()[index]; };
  3624.  
  3625.     /**
  3626.      * Nullipotent
  3627.      * @author DoubleX
  3628.      * @param {Number} index - The hotkey slot index
  3629.      * @returns {Number/Nullable} The requested skill id
  3630.      * @since v1.00a
  3631.      * @version v1.00a
  3632.      */
  3633.     $._skillId = function(index) {
  3634.         return this._hotkeyMapping()[this._hotkeyList()[index]];
  3635.     }; // $._skillId
  3636.  
  3637.     /**
  3638.      * Nullipotent
  3639.      * @author DoubleX
  3640.      * @param {Number/Nullable} skillId - The id of the skil involved
  3641.      * @returns {Number} The requested skill icon index
  3642.      * @since v1.01a
  3643.      * @version v1.01a
  3644.      */
  3645.     $._skillIconIndex = function(skillId) {
  3646.         return skillId ? $dataSkills[skillId].iconIndex : 0;
  3647.     }; // $._skillIconIndex
  3648.  
  3649.     /**
  3650.      * Nullipotent
  3651.      * @author DoubleX
  3652.      * @param {Number/Nullable} skillId - The id of the skil involved
  3653.      * @returns {String} The requested skill name
  3654.      * @since v1.01a
  3655.      * @version v1.01a
  3656.      */
  3657.     $._skillName = function(skillId) {
  3658.         return skillId ? $dataSkills[skillId].name : "";
  3659.     }; // $._skillName
  3660.  
  3661.     /**
  3662.      * Nullipotent
  3663.      * @author DoubleX
  3664.      * @returns {Object[String, Number]} The requested hotkey mapping
  3665.      * @since v1.00a
  3666.      * @version v1.00a
  3667.      */
  3668.     $._hotkeyMapping = function() {
  3669.         return this._actor.skillHotkeys.hotkeyMapping;
  3670.     }; // $._hotkeyMapping
  3671.  
  3672.     /**
  3673.      * Nullipotent
  3674.      * @author DoubleX
  3675.      * @param {Number/Nullable} skillId - The id of the skil involved
  3676.      * @returns {Boolean} The check result
  3677.      * @since v1.00a
  3678.      * @version v1.00a
  3679.      */
  3680.     $._canUse = function(skillId) {
  3681.         return skillId && this._actor.canUse($dataSkills[skillId]);
  3682.     }; // $._canUse
  3683.  
  3684.     /**
  3685.      * Idempotent
  3686.      * @author DoubleX
  3687.      * @param {Number} x - The icon x position
  3688.      * @param {Number} y - The icon y position
  3689.      * @since v1.00a
  3690.      * @version v1.00a
  3691.      */
  3692.     $._drawUnusableSkillCoverIcon = function(x, y) {
  3693.         if (!this._unusableSkillCoverIcon) return;
  3694.         this.contents.blt(this._unusableSkillCoverIcon, 0, 0,
  3695.                 Window_Base._iconWidth, Window_Base._iconHeight, x, y);
  3696.     }; // $._drawUnusableSkillCoverIcon
  3697.  
  3698.     /**
  3699.      * Hotspot/Idempotent
  3700.      * @author DoubleX
  3701.      * @since v1.00a
  3702.      * @version v1.00a
  3703.      */
  3704.     $._processHandling = function() {
  3705.         // Not enabling this plugin shouldn't be able to activate this window
  3706.         if (this.isOpenAndActive()) this._processHotkeys();
  3707.         //
  3708.     }; // $._processHandling
  3709.  
  3710.     /**
  3711.      * Hotspot/Idempotent
  3712.      * @author DoubleX
  3713.      * @since v1.00a
  3714.      * @version v1.00a
  3715.      */
  3716.     $._processHotkeys = function() {
  3717.         this._hotkeyList().forEach(this._processHotkey, this);
  3718.     }; // $._processHotkeys
  3719.  
  3720.     /**
  3721.      * Hotspot/Idempotent
  3722.      * @author DoubleX
  3723.      * @param {String} hotkey - The symbol of the involved hotkey
  3724.      * @since v1.00a
  3725.      * @version v1.00a
  3726.      */
  3727.     $._processHotkey = function(hotkey) {
  3728.         if (Input.isTriggered(hotkey)) this._useHotkey(hotkey);
  3729.     }; // $._processHotkey
  3730.  
  3731.     /**
  3732.      * Potential Hotspot/Idempotent
  3733.      * @author DoubleX
  3734.      * @param {String} hotkey - The symbol of the involved hotkey
  3735.      * @since v1.00a
  3736.      * @version v1.00a
  3737.      */
  3738.     $._useHotkey = function(hotkey) {
  3739.         // Otherwise the handlers would bind the wrong hotkey to the skill
  3740.         this.select(this._hotkeyList().indexOf(hotkey));
  3741.         //
  3742.         this.playOkSound();
  3743.         this.callHandler(hotkey);
  3744.     }; // $._useHotkey
  3745.  
  3746.     /**
  3747.      * Potential Hotspot/Nullipotent
  3748.      * @author DoubleX
  3749.      * @returns {Array[String]} The requested list of hotkey symbols
  3750.      * @since v1.00a
  3751.      * @version v1.00a
  3752.      */
  3753.     $._hotkeyList = function() {
  3754.         return Object.keys(SH.cfgs.hotkeyNames.call(this._actor));
  3755.     }; // $._hotkeyList
  3756.  
  3757. })(DoubleX_RMMV.Skill_Hotkeys);
  3758.  
  3759. /*----------------------------------------------------------------------------
  3760.  *    # New class: Window_BattleSkillHotkeys
  3761.  *      - Shows the list of hotkeys for the currently inpuable actor in battle
  3762.  *----------------------------------------------------------------------------*/
  3763.  
  3764. (function(SH) {
  3765.  
  3766.     "use strict";
  3767.  
  3768.     var $ = Window_BattleSkillHotkeys.prototype =
  3769.             Object.create(Window_SkillHotkeyList.prototype);
  3770.     $.constructor = Window_BattleSkillHotkeys;
  3771.  
  3772.     /*------------------------------------------------------------------------
  3773.      *    New private instance variable
  3774.      *------------------------------------------------------------------------*/
  3775.     // {Function(String)}_touchCallback: The function handling touched hotkey
  3776.  
  3777.     /**
  3778.      * Idempotent
  3779.      * @author DoubleX
  3780.      * @constructor
  3781.      * @param {Game_Actor} actor - The actor using this window
  3782.      * @param {Function(String)} touchCallback - The function handling the
  3783.      *                                            touched hotkey slot
  3784.      * @since v1.00a
  3785.      * @version v1.00a
  3786.      */
  3787.     $.initialize = function(actor, touchCallback) {
  3788.         Window_SkillHotkeyList.prototype.initialize.call(this, actor);
  3789.         this._touchCallback = touchCallback;
  3790.     }; // $.initialize
  3791.  
  3792.     $.lineHeight = function() {
  3793.         return SH.params.hotkeyCmdListLineH.call(this);
  3794.     }; // $.lineHeight
  3795.  
  3796.     $.standardFontSize = function() {
  3797.         return SH.params.hotkeyCmdListFontSize.call(this);
  3798.     }; // $.standardFontSize
  3799.  
  3800.     $.standardPadding = function() {
  3801.         return SH.params.hotkeyCmdListPadding.call(this);
  3802.     }; // $.standardPadding
  3803.  
  3804.     $.textPadding = function() {
  3805.         return SH.params.hotkeyCmdListTextPadding.call(this);
  3806.     }; // $.textPadding
  3807.  
  3808.     $.standardBackOpacity = function() {
  3809.         return SH.params.hotkeyCmdListBackOpacity.call(this);
  3810.     }; // $.standardBackOpacity
  3811.  
  3812.     $.translucentOpacity = function() {
  3813.         return SH.params.hotkeyCmdListTranslucentOpacity.call(this);
  3814.     }; // $.translucentOpacity
  3815.  
  3816.     $.spacing = function() {
  3817.         return SH.params.hotkeyCmdListSpacing.call(this);
  3818.     }; // $.spacing
  3819.  
  3820.     $.windowWidth = function() {
  3821.         return SH.params.hotkeyCmdListWindowW.call(this);
  3822.     }; // $.windowWidth
  3823.  
  3824.     $.windowHeight = function() {
  3825.         return SH.params.hotkeyCmdListWindowH.call(this);
  3826.     }; // $.windowHeight
  3827.  
  3828.     $.isCurrentItemEnabled = function() {
  3829.         return Window_SkillHotkeyBase.prototype.isCurrentItemEnabled.call(this);
  3830.     }; // $.isCurrentItemEnabled
  3831.  
  3832.     $.processTouch = function() {
  3833.         // Only isOpenAndActive changed to isOpen and everything else's intact
  3834.         if (!this.isOpen()) return this._touching = false;
  3835.         if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  3836.             this._touching = true;
  3837.             this.onTouch(true);
  3838.         } else if (TouchInput.isCancelled()) {
  3839.             if (this.isCancelEnabled()) this.processCancel();
  3840.         }
  3841.         if (!this._touching) return;
  3842.         TouchInput.isPressed() ? this.onTouch(false) : this._touching = false;
  3843.         //
  3844.     }; // $.processTouch
  3845.  
  3846.     $.onTouch = function(triggered) {
  3847.         // These codes are easy, simple and small enough to stick together
  3848.         if (!triggered) return;
  3849.         var hitIndex = this._hitIndex(), hotkey = this._hotkeyList()[hitIndex];
  3850.         if (this._isHitHotkey(hotkey)) this._touchCallback(hotkey);
  3851.         //
  3852.     }; // $.onTouch
  3853.  
  3854.     /**
  3855.      * Hotspot/Nullipotent
  3856.      * @author DoubleX
  3857.      * @interface
  3858.      * @returns {Number} The requested window x position
  3859.      * @since v1.00a
  3860.      * @version v1.00a
  3861.      */
  3862.     $.windowX = function() {
  3863.         return SH.params.hotkeyCmdListWindowX.call(this);
  3864.     }; // $.windowX
  3865.  
  3866.     /**
  3867.      * Hotspot/Nullipotent
  3868.      * @author DoubleX
  3869.      * @interface
  3870.      * @returns {Number} The requested window y position
  3871.      * @since v1.00a
  3872.      * @version v1.00a
  3873.      */
  3874.     $.windowY = function() {
  3875.         return SH.params.hotkeyCmdListWindowY.call(this);
  3876.     }; // $.windowY
  3877.  
  3878.     /**
  3879.      * Nullipotent
  3880.      * @author DoubleX
  3881.      * @param {Number/Nullable} skillId - The id of the skil involved
  3882.      * @returns {Boolean} The check result
  3883.      * @since v1.00a
  3884.      * @version v1.00a
  3885.      */
  3886.     $._canUse = function(skillId) {
  3887.         return Window_SkillHotkeyList.prototype._canUse.call(this, skillId) ||
  3888.                 skillId && this._actor.canUseSkillHotkeys(skillId);
  3889.     }; // $._canUse
  3890.  
  3891.     /**
  3892.      * Potential Hotspot/Nullipotent
  3893.      * @author DoubleX
  3894.      * @returns {Number} The requested hit selection index
  3895.      * @since v1.00a
  3896.      * @version v1.00a
  3897.      */
  3898.     $._hitIndex = function() {
  3899.         return this.hitTest(this.canvasToLocalX(TouchInput.x),
  3900.                 this.canvasToLocalY(TouchInput.y));
  3901.     }; // $._hitIndex
  3902.  
  3903.     /**
  3904.      * Potential Hotspot/Nullipotent
  3905.      * @author DoubleX
  3906.      * @param {String} hotkey - The symbol of the hotkey involved
  3907.      * @returns {Boolean} The check result
  3908.      * @since v1.00a
  3909.      * @version v1.00a
  3910.      */
  3911.     $._isHitHotkey = function(hotkey) { return this._hotkeyMapping()[hotkey]; };
  3912.  
  3913. })(DoubleX_RMMV.Skill_Hotkeys);
  3914.  
  3915. /*----------------------------------------------------------------------------
  3916.  *    # Edit class: Scene_Skill
  3917.  *      - Show the bind option when using skills that can do so
  3918.  *----------------------------------------------------------------------------*/
  3919.  
  3920. (function(SH) {
  3921.  
  3922.     "use strict";
  3923.  
  3924.     SH.Scene_Skill = { orig: {}, new: {} };
  3925.     var _SS = SH.Scene_Skill.orig, $ = Scene_Skill.prototype;
  3926.     var _SH = SH.Scene_Skill.new;
  3927.  
  3928.     /*------------------------------------------------------------------------
  3929.      *    New public instance variable
  3930.      *------------------------------------------------------------------------*/
  3931.     // {Object}skillHotkeys: The container of all other new variables
  3932.  
  3933.     /*------------------------------------------------------------------------
  3934.      *    New private instance variables
  3935.      *------------------------------------------------------------------------*/
  3936.     // {Window_SkillHotkeyCmd}_cmdWindow: The bind skill hotkey command window
  3937.     // {Window_SkillHotkeyList}_listWindow: The skill hotkey slot command window
  3938.  
  3939.     _SS.create = $.create;
  3940.     $.create = function() { // v1.00a - v1.00a; Extended
  3941.         _SS.create.apply(this, arguments);
  3942.         _SH._createWindows.call(this); // Added to create the hotkey windows
  3943.     }; // $.create
  3944.  
  3945.     _SS.onItemOk = $.onItemOk;
  3946.     $.onItemOk = function() { // v1.00a - v1.00a; Extended
  3947.         // Added to let players choose to bind skills that can do so
  3948.         if (_SH._isSetupCmdWindow.call(this)) {
  3949.             return _SH._setupCmdWindow.call(this);
  3950.         }
  3951.         //
  3952.         _SS.onItemOk.apply(this, arguments);
  3953.     }; // $.onItemOk
  3954.  
  3955.     /**
  3956.      * The this pointer is Scene_Skill.prototype
  3957.      * Idempotent
  3958.      * @author DoubleX
  3959.      * @since v1.00a
  3960.      * @version v1.00a
  3961.      */
  3962.     _SH._createWindows = function() {
  3963.         this.skillHotkeys = {};
  3964.         _SH._createHotkeyCmdWindow.call(this);
  3965.         _SH._createHotkeyListWindow.call(this);
  3966.     }; // _SH._createWindows
  3967.  
  3968.     /**
  3969.      * The this pointer is Scene_Skill.prototype
  3970.      * Idempotent
  3971.      * @author DoubleX
  3972.      * @since v1.00a
  3973.      * @version v1.00a
  3974.      */
  3975.     _SH._createHotkeyCmdWindow = function() {
  3976.         this.skillHotkeys._cmdWindow = _SH._hotkeyCmdWindow.call(this);
  3977.         this.addWindow(this.skillHotkeys._cmdWindow);
  3978.     }; // _SH._createHotkeyCmdWindow
  3979.  
  3980.     /**
  3981.      * The this pointer is Scene_Skill.prototype
  3982.      * Nullipotent
  3983.      * @author DoubleX
  3984.      * @returns {Window_SkillHotkeyCmd} The requested hotkey command window
  3985.      * @since v1.00a
  3986.      * @version v1.00a
  3987.      */
  3988.     _SH._hotkeyCmdWindow = function() {
  3989.         var cmdWindow = new Window_SkillHotkeyCmd(this.user());
  3990.         cmdWindow.setHandler('bind', _SH._onBind.bind(this));
  3991.         cmdWindow.setHandler('use', _SH._onUse.bind(this));
  3992.         cmdWindow.setHandler('cancel', _SH._onCmdWindowCancel.bind(this));
  3993.         cmdWindow.deselect();
  3994.         return cmdWindow;
  3995.     }; // _SH._hotkeyCmdWindow
  3996.  
  3997.     /**
  3998.      * The this pointer is Scene_Skill.prototype
  3999.      * Idempotent
  4000.      * @author DoubleX
  4001.      * @since v1.00a
  4002.      * @version v1.00a
  4003.      */
  4004.     _SH._createHotkeyListWindow = function() {
  4005.         this.skillHotkeys._listWindow = _SH._hotkeyListWindow.call(this);
  4006.         this.addWindow(this.skillHotkeys._listWindow);
  4007.     }; // _SH._createHotkeyListWindow
  4008.  
  4009.     /**
  4010.      * The this pointer is Scene_Skill.prototype
  4011.      * Nullipotent
  4012.      * @author DoubleX
  4013.      * @returns {Window_SkillHotkeyList} The requested hotkey list window
  4014.      * @since v1.00a
  4015.      * @version v1.00a
  4016.      */
  4017.     _SH._hotkeyListWindow = function() {
  4018.         var listWindow = new Window_SkillHotkeyList(this.user());
  4019.         listWindow.setHandler('ok', _SH._onchangeSlot.bind(this));
  4020.         listWindow.setHandler('cancel', _SH._onCancelChangeSlot.bind(this));
  4021.         _SH._hotkeyList.call(this).forEach(
  4022.                 _SH._setHotkeyListHandler.bind(this, listWindow));
  4023.         _SH._closeListWindow.call(this, listWindow);
  4024.         return listWindow;
  4025.     }; // _SH._hotkeyListWindow
  4026.  
  4027.     /**
  4028.      * The this pointer is Scene_Skill.prototype
  4029.      * Idempotent
  4030.      * @author DoubleX
  4031.      * @param {Window_SkillHotkeyList} listWindow - The hotkey list window
  4032.      * @param {String} hotkey - The symbol of the hotkey involved
  4033.      * @since v1.00a
  4034.      * @version v1.00a
  4035.      */
  4036.     _SH._setHotkeyListHandler = function(listWindow, hotkey) {
  4037.         // The hotkey list window will automatically adjust the selection index
  4038.         listWindow.setHandler(hotkey, _SH._onchangeSlot.bind(this));
  4039.         //
  4040.     }; // _SH._setHotkeyListHandler
  4041.  
  4042.     /**
  4043.      * The this pointer is Scene_Skill.prototype
  4044.      * Nullipotent
  4045.      * @author DoubleX
  4046.      * @returns {Boolean} The check result
  4047.      * @since v1.00a
  4048.      * @version v1.00a
  4049.      */
  4050.     _SH._isSetupCmdWindow = function() {
  4051.         return this.user().canBindSkillHotkeys(this.item().id);
  4052.     }; // _SH._isSetupCmdWindow
  4053.  
  4054.     /**
  4055.      * The this pointer is Scene_Skill.prototype
  4056.      * Idempotent
  4057.      * @author DoubleX
  4058.      * @since v1.00a
  4059.      * @version v1.00a
  4060.      */
  4061.     _SH._setupCmdWindow = function() {
  4062.         this.skillHotkeys._cmdWindow.setup(this.item().id);
  4063.         this.showSubWindow(this.skillHotkeys._cmdWindow);
  4064.     }; //_SH._setupCmdWindow
  4065.  
  4066.     /**
  4067.      * The this pointer is Scene_Skill.prototype
  4068.      * Idempotent
  4069.      * @author DoubleX
  4070.      * @since v1.00a
  4071.      * @version v1.00a
  4072.      */
  4073.     _SH._onBind = function() {
  4074.         _SH._onCmdWindowCancel.call(this);
  4075.         // Otherwise the item window would be active when calling determineItem
  4076.         this._itemWindow.deactivate();
  4077.         //
  4078.         _SH._openListWindow.call(this);
  4079.     }; // _SH._onBind
  4080.  
  4081.     /**
  4082.      * The this pointer is Scene_Skill.prototype
  4083.      * Idempotent
  4084.      * @author DoubleX
  4085.      * @since v1.00a
  4086.      * @version v1.00a
  4087.      */
  4088.     _SH._openListWindow = function() {
  4089.         this.skillHotkeys._listWindow.refresh();
  4090.         this.skillHotkeys._listWindow.show();
  4091.         this.skillHotkeys._listWindow.activate();
  4092.         // Otherwise no selection would be made for its 1st appearance
  4093.         this.skillHotkeys._listWindow.select(0);
  4094.         //
  4095.     }; // _SH._openListWindow
  4096.  
  4097.     /**
  4098.      * The this pointer is Scene_Skill.prototype
  4099.      * Idempotent
  4100.      * @author DoubleX
  4101.      * @since v1.00a
  4102.      * @version v1.00a
  4103.      */
  4104.     _SH._onUse = function() {
  4105.         _SH._onCmdWindowCancel.call(this);
  4106.         // Otherwise the item window would be active when calling determineItem
  4107.         this._itemWindow.deactivate();
  4108.         //
  4109.         _SS.onItemOk.call(this);
  4110.     }; // _SH._onUse
  4111.  
  4112.     /**
  4113.      * The this pointer is Scene_Skill.prototype
  4114.      * Idempotent
  4115.      * @author DoubleX
  4116.      * @since v1.00a
  4117.      * @version v1.00a
  4118.      */
  4119.     _SH._onCmdWindowCancel = function() {
  4120.         this.hideSubWindow(this.skillHotkeys._cmdWindow);
  4121.         this.skillHotkeys._cmdWindow.close();
  4122.     }; // _SH._onCmdWindowCancel
  4123.  
  4124.     /**
  4125.      * The this pointer is Scene_Skill.prototype
  4126.      * Idempotent
  4127.      * @author DoubleX
  4128.      * @since v1.00a
  4129.      * @version v1.00a
  4130.      */
  4131.     _SH._onchangeSlot = function() {
  4132.         _SH._changeSlot.call(this);
  4133.         _SH._onCancelChangeSlot.call(this);
  4134.         this.commandSkill();
  4135.     }; // _SH._onchangeSlot
  4136.  
  4137.     /**
  4138.      * The this pointer is Scene_Skill.prototype
  4139.      * Idempotent
  4140.      * @author DoubleX
  4141.      * @since v1.00a
  4142.      * @version v1.00a
  4143.      */
  4144.     _SH._changeSlot = function() {
  4145.         // If both flags are false then regard it as bind rather than error
  4146.         this.user().bindSkillHotkey(
  4147.                 this.item().id, _SH._changedSlot.call(this));
  4148.         //
  4149.     }; // _SH._changeSlot
  4150.  
  4151.     /**
  4152.      * The this pointer is Scene_Skill.prototype
  4153.      * Idempotent
  4154.      * @author DoubleX
  4155.      * @returns {String} The requested hotkey symbol to have its slot changed
  4156.      * @since v1.00a
  4157.      * @version v1.00a
  4158.      */
  4159.     _SH._changedSlot = function() {
  4160.         return _SH._hotkeyList.call(
  4161.                 this)[this.skillHotkeys._listWindow.index()];
  4162.     }; // _SH._changedSlot
  4163.  
  4164.     /**
  4165.      * The this pointer is Scene_Skill.prototype
  4166.      * Nullipotent
  4167.      * @author DoubleX
  4168.      * @returns {Array[String]} Ther requested list of hotkey symbols
  4169.      * @since v1.00a
  4170.      * @version v1.00a
  4171.      */
  4172.     _SH._hotkeyList = function() {
  4173.         return Object.keys(SH.cfgs.hotkeyNames.call(this.user()));
  4174.     }; // _SH._hotkeyList
  4175.  
  4176.     /**
  4177.      * The this pointer is Scene_Skill.prototype
  4178.      * Idempotent
  4179.      * @author DoubleX
  4180.      * @since v1.00a
  4181.      * @version v1.00a
  4182.      */
  4183.     _SH._onCancelChangeSlot = function() {
  4184.         _SH._closeListWindow.call(this, this.skillHotkeys._listWindow);
  4185.         this.commandSkill();
  4186.     }; // _SH._onCancelChangeSlot
  4187.  
  4188.     /**
  4189.      * The this pointer is Scene_Skill.prototype
  4190.      * Idempotent
  4191.      * @author DoubleX
  4192.      * @param {Window_SkillHotkeyList} listWindow - The hotkey list window
  4193.      * @since v1.00a
  4194.      * @version v1.00a
  4195.      */
  4196.     _SH._closeListWindow = function(listWindow) {
  4197.         listWindow.deactivate();
  4198.         listWindow.deselect();
  4199.         listWindow.hide();
  4200.     }; // _SH._closeListWindow
  4201.  
  4202. })(DoubleX_RMMV.Skill_Hotkeys);
  4203.  
  4204. /*----------------------------------------------------------------------------
  4205.  *    # Edit class: Scene_Battle
  4206.  *      - Lets players use the bound skill hotkeys for actors in battle
  4207.  *----------------------------------------------------------------------------*/
  4208.  
  4209. (function(SH) {
  4210.  
  4211.     "use strict";
  4212.  
  4213.     SH.Scene_Battle = { orig: {}, new: {} };
  4214.     var _SB = SH.Scene_Battle.orig, $ = Scene_Battle.prototype;
  4215.     var _SH = SH.Scene_Battle.new;
  4216.  
  4217.     /*------------------------------------------------------------------------
  4218.      *    New public instance variable
  4219.      *------------------------------------------------------------------------*/
  4220.     // {Object}skillHotkeys: The container of all other new variables
  4221.  
  4222.     /*------------------------------------------------------------------------
  4223.      *    New private instance variable
  4224.      *------------------------------------------------------------------------*/
  4225.     // {Window_BattleSkillHotkeys}_hotkeyWindow: The hotkey slot command window
  4226.  
  4227.     _SB.stop = $.stop;
  4228.     $.stop = function() { // v1.00a - v1.00a; Extended
  4229.         _SB.stop.apply(this, arguments);
  4230.         // Added to close the hotkey window when closing actor command window
  4231.         _SH._closeHotkeyWindow.call(this);
  4232.         //
  4233.     }; // $.stop
  4234.  
  4235.     _SB.updateStatusWindow = $.updateStatusWindow;
  4236.     $.updateStatusWindow = function() { // v1.00a - v1.00a; Extended
  4237.         _SB.updateStatusWindow.apply(this, arguments);
  4238.         // Added to close the hotkey window when closing actor command window
  4239.         if ($gameMessage.isBusy()) _SH._closeHotkeyWindow.call(this);
  4240.         //
  4241.     }; // $.updateStatusWindow
  4242.  
  4243.     _SB.startPartyCommandSelection = $.startPartyCommandSelection;
  4244.     $.startPartyCommandSelection = function() { // v1.00a - v1.00a; Extended
  4245.         _SB.startPartyCommandSelection.apply(this, arguments);
  4246.         // Added to close the hotkey window when closing actor command window
  4247.         _SH._closeHotkeyWindow.call(this);
  4248.         //
  4249.     }; // $.startPartyCommandSelection
  4250.  
  4251.     _SB.startActorCommandSelection = $.startActorCommandSelection;
  4252.     $.startActorCommandSelection = function() { // v1.00a - v1.00a; Extended
  4253.         _SB.startActorCommandSelection.apply(this, arguments);
  4254.         // Added to add the actor skill hotkey handlers
  4255.         _SH._startActorCommandSelection.call(this);
  4256.         //
  4257.     }; // $.startActorCommandSelection
  4258.  
  4259.     _SB.onActorCancel = $.onActorCancel;
  4260.     $.onActorCancel = function() { // v1.00a - v1.00a; Extended
  4261.         _SB.onActorCancel.apply(this, arguments);
  4262.         // Added to go straight back to the actor command window for hotkeys
  4263.         _SH._onHotkeyCancel.call(this);
  4264.         //
  4265.     }; // $.onActorCancel
  4266.  
  4267.     _SB.onEnemyCancel = $.onEnemyCancel;
  4268.     $.onEnemyCancel = function() { // v1.00a - v1.00a; Extended
  4269.         _SB.onEnemyCancel.apply(this, arguments);
  4270.         // Added to go straight back to the actor command window for hotkeys
  4271.         _SH._onHotkeyCancel.call(this);
  4272.         //
  4273.     }; // $.onEnemyCancel
  4274.  
  4275.     _SB.endCommandSelection = $.endCommandSelection;
  4276.     $.endCommandSelection = function() { // v1.00a - v1.00a; Extended
  4277.         _SB.endCommandSelection.apply(this, arguments);
  4278.         // Added to close the hotkey window when closing actor command window
  4279.         _SH._closeHotkeyWindow.call(this);
  4280.         //
  4281.     }; // $.endCommandSelection
  4282.  
  4283.     /**
  4284.      * The this pointer is Scene_Battle.prototype
  4285.      * Idempotent
  4286.      * @author DoubleX
  4287.      * @since v1.00a
  4288.      * @todo: Removes the performance penalty without sacrificing code qualities
  4289.      * @version v1.00a
  4290.      */
  4291.     _SH._startActorCommandSelection = function() {
  4292.         // Creating the hotkey window on the fly's clean but costs performance
  4293.         _SH._onCreateHotkeyWindow.call(this);
  4294.         //
  4295.         _SH._setHotkeyHandlers.call(this);
  4296.     }; // _SH._startActorCommandSelection
  4297.  
  4298.     /**
  4299.      * The this pointer is Scene_Battle.prototype
  4300.      * Idempotent
  4301.      * @author DoubleX
  4302.      * @since v1.00a
  4303.      * @version v1.00a
  4304.      */
  4305.     _SH._onCreateHotkeyWindow = function() {
  4306.         var actor = BattleManager.actor();
  4307.         if (!SH.params.isEnabled.call(actor)) return;
  4308.         _SH._createHotkeyWindow.call(this, actor);
  4309.     }; //  _SH._onCreateHotkeyWindow
  4310.  
  4311.     /**
  4312.      * The this pointer is Scene_Battle.prototype
  4313.      * Idempotent
  4314.      * @author DoubleX
  4315.      * @param {Game_Actor} actor - The actor involved
  4316.      * @since v1.00a
  4317.      * @version v1.00a
  4318.      */
  4319.     _SH._createHotkeyWindow = function(actor) {
  4320.         // Otherwise the old hotkey command list window would be leaked
  4321.         if (_SH._hasHotkeyWindow.call(this)) {
  4322.             this._windowLayer.removeChild(this.skillHotkeys._hotkeyWindow);
  4323.         }
  4324.         //
  4325.         this.skillHotkeys = this.skillHotkeys || {};
  4326.         this.skillHotkeys._hotkeyWindow = _SH._hotkeyWindow.call(this, actor);
  4327.         this.addWindow(this.skillHotkeys._hotkeyWindow);
  4328.     }; // _SH._createHotkeyWindow
  4329.  
  4330.     /**
  4331.      * The this pointer is Scene_Battle.prototype
  4332.      * Nullipotent
  4333.      * @author DoubleX
  4334.      * @param {Game_Actor} actor - The actor involved
  4335.      * @returns {Window_BattleSkillHotkeys} The requested hotkey window
  4336.      * @since v1.00a
  4337.      * @version v1.00a
  4338.      */
  4339.     _SH._hotkeyWindow = function(actor) {
  4340.         var hotkeyWindow = new Window_BattleSkillHotkeys(
  4341.                 actor, this._actorCommandWindow.onUseSkillHotkey.bind(
  4342.                 this._actorCommandWindow));
  4343.         hotkeyWindow.refresh();
  4344.         hotkeyWindow.show();
  4345.         // This window's only for showing the list of available hotkey commands
  4346.         hotkeyWindow.deactivate();
  4347.         hotkeyWindow.deselect();
  4348.         //
  4349.         return hotkeyWindow;
  4350.     }; // _SH._hotkeyWindow
  4351.  
  4352.     /**
  4353.      * The this pointer is Scene_Battle.prototype
  4354.      * Idempotent
  4355.      * @author DoubleX
  4356.      * @since v1.00a
  4357.      * @todo: Caching BattleManager.actor without sacrificing code qualities
  4358.      * @version v1.00a
  4359.      */
  4360.     _SH._setHotkeyHandlers = function() {
  4361.         // Caching BattleManager.actor here would lead to even more boilerplates
  4362.         _SH._hotkeyList.call(this, BattleManager.actor()).forEach(
  4363.                 _SH._setHotkeyHandler, this);
  4364.         //
  4365.     }; // _SH._setHotkeyHandlers
  4366.  
  4367.     /**
  4368.      * The this pointer is Scene_Battle.prototype
  4369.      * Idempotent
  4370.      * @author DoubleX
  4371.      * @param {String} hotkey - The symbol of the hotkey involved
  4372.      * @since v1.00a
  4373.      * @version v1.00a
  4374.      */
  4375.     _SH._setHotkeyHandler = function(hotkey) {
  4376.         this._actorCommandWindow.setHandler(hotkey,
  4377.                 _SH._onUseHotkey.bind(this, hotkey, BattleManager.actor()));
  4378.     }; // _SH._setHotkeyHandler
  4379.  
  4380.     /**
  4381.      * The this pointer is Scene_Battle.prototype
  4382.      * Idempotent
  4383.      * @author DoubleX
  4384.      * @param {String} hotkey - The symbol of the hotkey involved
  4385.      * @param {Game_Actor} actor - The actor involved
  4386.      * @since v1.00a
  4387.      * @version v1.00a
  4388.      */
  4389.     _SH._onUseHotkey = function(hotkey, actor) {
  4390.         if (_SH._hasHotkeyWindow.call(this)) {
  4391.             this.skillHotkeys._hotkeyWindow.select(
  4392.                     _SH._hotkeyIndex.call(this, hotkey, actor));
  4393.         }
  4394.         // Otherwise it'd be cancelled instead of triggering on target cancel
  4395.         this._actorCommandWindow.deactivate();
  4396.         //
  4397.         // Otherwise the skill window wouldn't know which actor's using it
  4398.         this._skillWindow.setActor(actor);
  4399.         //
  4400.         this._skillWindow.selectHotkeySkill(hotkey);
  4401.         // Otherwise the target selection window won't have time to refresh
  4402.         setTimeout(this.onSkillOk.bind(this));
  4403.         //
  4404.     }; // _SH._onUseHotkey
  4405.  
  4406.     /**
  4407.      * The this pointer is Scene_Battle.prototype
  4408.      * Nullipotent
  4409.      * @author DoubleX
  4410.      * @param {String} hotkey - The symbol of the hotkey involved
  4411.      * @param {Game_Actor} actor - The actor involved
  4412.      * @returns {Number} The requested hotkey window selection index
  4413.      * @since v1.00a
  4414.      * @version v1.00a
  4415.      */
  4416.     _SH._hotkeyIndex = function(hotkey, actor) {
  4417.         return _SH._hotkeyList.call(this, actor).indexOf(hotkey);
  4418.     }; // _SH._hotkeyIndex
  4419.  
  4420.     /**
  4421.      * The this pointer is Scene_Battle.prototype
  4422.      * Idempotent
  4423.      * @author DoubleX
  4424.      * @since v1.00a
  4425.      * @version v1.00a
  4426.      */
  4427.     _SH._onHotkeyCancel = function() {
  4428.         if (_SH._isHoykeyCancel.call(this)) this._actorCommandWindow.activate();
  4429.     }; // _SH._onHotkeyCancel
  4430.  
  4431.     /**
  4432.      * The this pointer is Scene_Battle.prototype
  4433.      * Nullipotent
  4434.      * @author DoubleX
  4435.      * @returns {Boolean} The check result
  4436.      * @since v1.00a
  4437.      * @version v1.00a
  4438.      */
  4439.     _SH._isHoykeyCancel = function() {
  4440.         return _SH._hotkeyList.call(this, BattleManager.actor()).indexOf(
  4441.                 this._actorCommandWindow.currentSymbol()) >= 0;
  4442.     }; // _SH._isHoykeyCancel
  4443.  
  4444.     /**
  4445.      * The this pointer is Scene_Battle.prototype
  4446.      * Nullipotent
  4447.      * @author DoubleX
  4448.      * @param {Game_Actor} actor - The actor involved
  4449.      * @returns {Array[String]} Ther requested list of hotkey symbols
  4450.      * @since v1.00a
  4451.      * @version v1.00a
  4452.      */
  4453.     _SH._hotkeyList = function(actor) {
  4454.         return Object.keys(SH.cfgs.hotkeyNames.call(actor));
  4455.     }; // _SH._hotkeyList
  4456.  
  4457.     /**
  4458.      * The this pointer is Scene_Battle.prototype
  4459.      * Idempotent
  4460.      * @author DoubleX
  4461.      * @since v1.00a
  4462.      * @version v1.00a
  4463.      */
  4464.     _SH._closeHotkeyWindow = function() {
  4465.         // Variable integrity check must always stick to the variable actions
  4466.         if (!_SH._hasHotkeyWindow.call(this)) return;
  4467.         this.skillHotkeys._hotkeyWindow.hide();
  4468.         this.skillHotkeys._hotkeyWindow.deselect();
  4469.         //
  4470.     }; // _SH._closeHotkeyWindow
  4471.  
  4472.     /**
  4473.      * The this pointer is Scene_Battle.prototype
  4474.      * Nullipotent
  4475.      * @author DoubleX
  4476.      * @returns {Boolean} The check result
  4477.      * @since v1.00a
  4478.      * @version v1.00a
  4479.      */
  4480.     _SH._hasHotkeyWindow = function() {
  4481.         return this.skillHotkeys && this.skillHotkeys._hotkeyWindow;
  4482.     }; // _SH._hasHotkeyWindow
  4483.  
  4484. })(DoubleX_RMMV.Skill_Hotkeys);
  4485.  
  4486. /*============================================================================*/
  4487.  
RAW Paste Data