Advertisement
cekobico

JahwsUF - Status Menu Core, edited by cekobico

Jun 4th, 2016
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // JahwsUF - Status Menu Core
  3. // JAH_StatusMenuCore.js
  4. // Version: 1.1.1
  5. //=============================================================================
  6.  
  7. var Imported = Imported || {};           // If YEP_CoreEngine is imported, this has a boolean variable stating so.
  8. Imported.JahwsUF_StatusMenuCore = true;  // Oh yeah, may as well say we're here, too.
  9.  
  10. var JahwsUF = JahwsUF || {};
  11.  
  12. //=============================================================================
  13. /*:
  14.  * @plugindesc v1.1.1 Creates an advanced Status window with multiple pages for each Actor.  Supports profiles and portraits.
  15.  * @author JahwsUF, with heavy edit by cekobico
  16.  *
  17.  * @param ---Scrolling Params---
  18.  * @default
  19.  *
  20.  * @param Scroll Multiplier
  21.  * @desc The number of lines that the profile page should scroll at a time.  Default: 1
  22.  * @default 1
  23.  *
  24.  * @param Scrolling Headers
  25.  * @desc true if the header should be subject to scrolling.
  26.  * false if they should remain stationary.  Default:  true
  27.  * @default true
  28.  *
  29.  * @param ---Portrait Params---
  30.  * @default
  31.  *
  32.  * @param Portrait Img Adjust
  33.  * @desc Adds buffer space before all Actor portraits, except on profiles.  Default: 0
  34.  * @default 0
  35.  *
  36.  * @param Portraits On All
  37.  * @desc All pages will display an Actor's portrait if available.
  38.  * A more vanilla version will be used if not.  Default: true
  39.  * @default true
  40.  *
  41.  *
  42.  * @param ---TP Gauge Params---
  43.  * @default
  44.  *
  45.  * @param Add TP Gauge
  46.  * @desc Add the TP Gauge between MP and EXP on the default header.
  47.  * Blank imports from Yanfly, false = hide, true = show.
  48.  * @default
  49.  *
  50.  * @param Blank after TP
  51.  * @desc If the TP gauge is visible, adds a blank line after.
  52.  * Default: true
  53.  * @default true
  54.  *
  55.  * @param ---XP + Level Params---
  56.  * @default
  57.  *
  58.  * @param Hide Levels
  59.  * @desc Hide each Actor's level, rendering it invisible on the Status pages.
  60.  * @default false
  61.  *
  62.  * @param Hide XP Bar
  63.  * @desc Hide all XP information from the Status windows.
  64.  * Default:  false
  65.  * @default false
  66.  *
  67.  * @param XP - Show Remaining
  68.  * @desc true - Gauges show the remaining XP until the next level.
  69.  * false - Gauges show XP since last level + total XP needed for next.
  70.  *
  71.  * (Values are not cumulative - 0 marks the beginning of the current level for both values.)
  72.  * Default: true
  73.  * @default true
  74.  *
  75.  * @param Color: XP Gauge 1
  76.  * @desc Color gradient component for the XP gauge.
  77.  * Default: 30
  78.  * @default 30
  79.  *
  80.  * @param Color: XP Gauge 2
  81.  * @desc The other color gradient component for the XP gauge.
  82.  * Default: 31
  83.  * @default 31
  84.  *
  85.  *
  86.  * @param ---Nickname Settings---
  87.  * @default
  88.  *
  89.  * @param Header - Name + Nick
  90.  * @desc true - Display both name and nickname in page headers.
  91.  * false - Only shows the nickname on the profile page.
  92.  * Default: true
  93.  * @default true
  94.  *
  95.  * @param Nickname Format
  96.  * @desc The pattern used to insert nicknames in page headers.
  97.  * Default: , "%1"    (%1 = position for nickname.)
  98.  * @default , "%1"
  99.  *
  100.  *
  101.  * @param ---Page 1---
  102.  * @default
  103.  *
  104.  * @param Page 1 Name
  105.  * @desc Menu name for the first page.
  106.  * Default:  Parameters
  107.  * @default Parameters
  108.  *
  109.  * @param Page 1 Window
  110.  * @desc Window corresponding to the first status page.
  111.  * Default:  JAH_Window_Status_Params
  112.  * @default JAH_Window_Status_Params
  113.  *
  114.  * @param ---Page 2---
  115.  * @default
  116.  *
  117.  * @param Page 2 Name
  118.  * @desc Menu name for the second page.
  119.  * Default: Elemental Rates
  120.  * @default Elemental Rates
  121.  *
  122.  * @param Page 2 Window
  123.  * @desc Window corresponding to the first status page.
  124.  * Default: JAH_Window_Status_Resistances
  125.  * @default JAH_Window_Status_Resistances
  126.  *
  127.  * @param ---Page 3---
  128.  * Default:
  129.  * @default
  130.  *
  131.  * @param Page 3 Name
  132.  * @desc Menu name for the third page.
  133.  * Default: State Rates
  134.  * @default State Rates
  135.  *
  136.  * @param Page 3 Window
  137.  * @desc Window corresponding to the third status page.
  138.  * Default: JAH_Window_State_Resistances
  139.  * @default JAH_Window_State_Resistances
  140.  *
  141.  * @param ---Page 4---
  142.  * @default
  143.  *
  144.  * @param Page 4 Name
  145.  * @desc Menu name for the fourth page.
  146.  * Default: Profile
  147.  * @default Profile
  148.  *
  149.  * @param Page 4 Window
  150.  * @desc Window corresponding to the fourth status page.
  151.  * Default: JAH_Window_Status_Profile
  152.  * @default JAH_Window_Status_Profile
  153.  *
  154.  * @param ---Page 5---
  155.  * @default
  156.  *
  157.  * @param Page 5 Name
  158.  * @desc Menu name for the fifth page.
  159.  * Default:
  160.  * @default
  161.  *
  162.  * @param Page 5 Window
  163.  * @desc Window corresponding to the fifth status page.
  164.  * Default:
  165.  * @default
  166.  *
  167.  *
  168.  * @param ---Page 6---
  169.  * @default
  170.  *
  171.  * @param Page 6 Name
  172.  * @desc Menu name for the sixth page.
  173.  * Default:
  174.  * @default
  175.  *
  176.  * @param Page 6 Window
  177.  * @desc Window corresponding to the sixth status page.
  178.  * Default:
  179.  * @default
  180.  *
  181.  *
  182.  * @param ---Extended Params---
  183.  * @default
  184.  *
  185.  * @param Parameter 1 Symbol
  186.  * @desc The system abbreviation for parameter #1.
  187.  * Default: atk
  188.  * @default atk
  189.  *
  190.  * @param Parameter 1 Name
  191.  * @desc The text name of parameter #1.
  192.  * Default:          - leave blank to use the database's entry.
  193.  * @default
  194.  *
  195.  * @param Parameter 1 as %
  196.  * @desc true - parameter should be displayed as a percent.
  197.  * false - otherwise.
  198.  * Default: false
  199.  * @default false
  200.  *
  201.  * @param Parameter 2 Symbol
  202.  * @desc The system abbreviation for parameter #2.
  203.  * Default: def
  204.  * @default def
  205.  *
  206.  * @param Parameter 2 Name
  207.  * @desc The text name of parameter #2.
  208.  * Default:          - leave blank to use the database's entry.
  209.  * @default
  210.  *
  211.  * @param Parameter 2 as %
  212.  * @desc true - parameter should be displayed as a percent.
  213.  * false - otherwise.
  214.  * Default: false
  215.  * @default false
  216.  *
  217.  * @param Parameter 3 Symbol
  218.  * @desc The system abbreviation for parameter #3.
  219.  * Default: mat
  220.  * @default mat
  221.  *
  222.  * @param Parameter 3 Name
  223.  * @desc The text name of parameter #3.
  224.  * Default:          - leave blank to use the database's entry.
  225.  * @default
  226.  *
  227.  * @param Parameter 3 as %
  228.  * @desc true - parameter should be displayed as a percent.
  229.  * false - otherwise.
  230.  * Default: false
  231.  * @default false
  232.  *
  233.  * @param Parameter 4 Symbol
  234.  * @desc The system abbreviation for parameter #4.
  235.  * Default: mdf
  236.  * @default mdf
  237.  *
  238.  * @param Parameter 4 Name
  239.  * @desc The text name of parameter #4.
  240.  * Default:          - leave blank to use the database's entry.
  241.  * @default
  242.  *
  243.  * @param Parameter 4 as %
  244.  * @desc true - parameter should be displayed as a percent.
  245.  * false - otherwise.
  246.  * Default: false
  247.  * @default false
  248.  *
  249.  * @param Parameter 5 Symbol
  250.  * @desc The system abbreviation for parameter #5.
  251.  * Default: agi
  252.  * @default agi
  253.  *
  254.  * @param Parameter 5 Name
  255.  * @desc The text name of parameter #5.
  256.  * Default:          - leave blank to use the database's entry.
  257.  * @default
  258.  *
  259.  * @param Parameter 5 as %
  260.  * @desc true - parameter should be displayed as a percent.
  261.  * false - otherwise.
  262.  * Default: false
  263.  * @default false
  264.  *
  265.  * @param Parameter 6 Symbol
  266.  * @desc The system abbreviation for parameter #6.
  267.  * Default: luk
  268.  * @default luk
  269.  *
  270.  * @param Parameter 6 Name
  271.  * @desc The text name of parameter #6.
  272.  * Default:          - leave blank to use the database's entry.
  273.  * @default
  274.  *
  275.  * @param Parameter 6 as %
  276.  * @desc true - parameter should be displayed as a percent.
  277.  * false - otherwise.
  278.  * Default: false
  279.  * @default false
  280.  *
  281.  * @param Parameter 7 Symbol
  282.  * @desc The system abbreviation for parameter #7.
  283.  * Space = blank.
  284.  * @default
  285.  *
  286.  * @param Parameter 7 Name
  287.  * @desc The text name of parameter #7.
  288.  * Default:          - leave blank to use the database's entry.
  289.  *
  290.  * @default
  291.  *
  292.  * @param Parameter 7 as %
  293.  * @desc true - parameter should be displayed as a percent.
  294.  * false - otherwise.
  295.  * Default:
  296.  * @default
  297.  *
  298.  * @param Parameter 8 Symbol
  299.  * @desc The system abbreviation for parameter #8.
  300.  * Default: hit
  301.  * @default hit
  302.  *
  303.  * @param Parameter 8 Name
  304.  * @desc The text name of parameter #8.
  305.  * Default:          - leave blank to use the database's entry.
  306.  * @default
  307.  *
  308.  * @param Parameter 8 as %
  309.  * @desc true - parameter should be displayed as a percent.
  310.  * false - otherwise.
  311.  * Default:
  312.  * @default
  313.  *
  314.  * @param Parameter 9 Symbol
  315.  * @desc The system abbreviation for parameter #9.
  316.  * Default: eva
  317.  * @default eva
  318.  *
  319.  * @param Parameter 9 Name
  320.  * @desc The text name of parameter #9.
  321.  * Default:
  322.  * @default
  323.  *
  324.  * @param Parameter 9 as %
  325.  * @desc true - parameter should be displayed as a percent.
  326.  * false - otherwise.
  327.  * Default:
  328.  * @default
  329.  *
  330.  * @param Parameter 10 Symbol
  331.  * @desc The system abbreviation for parameter #10.
  332.  * Space = blank.
  333.  * @default
  334.  *
  335.  * @param Parameter 10 Name
  336.  * @desc The text name of parameter #10.
  337.  * Default:
  338.  * @default
  339.  *
  340.  * @param Parameter 10 as %
  341.  * @desc true - parameter should be displayed as a percent.
  342.  * false - otherwise.
  343.  * Default:
  344.  * @default
  345.  *
  346.  * @param Parameter 11 Symbol
  347.  * @desc The system abbreviation for parameter #11.
  348.  * Space = blank.
  349.  * @default
  350.  *
  351.  * @param Parameter 11 Name
  352.  * @desc The text name of parameter #11.
  353.  * Default:
  354.  * @default
  355.  *
  356.  * @param Parameter 11 as %
  357.  * @desc true - parameter should be displayed as a percent.
  358.  * false - otherwise.
  359.  * Default:
  360.  * @default
  361.  *
  362.  * @param Parameter 12 Symbol
  363.  * @desc The system abbreviation for parameter #12.
  364.  * Space = blank.
  365.  * @default
  366.  *
  367.  * @param Parameter 12 Name
  368.  * @desc The text name of parameter #12.
  369.  * Default:
  370.  * @default
  371.  *
  372.  * @param Parameter 12 as %
  373.  * @desc true - parameter should be displayed as a percent.
  374.  * false - otherwise.
  375.  * Default:
  376.  * @default
  377.  *
  378.  * @param Parameter 13 Symbol
  379.  * @desc The system abbreviation for parameter #13.
  380.  * Space = blank.
  381.  * @default
  382.  *
  383.  * @param Parameter 13 Name
  384.  * @desc The text name of parameter #13.
  385.  * Default:
  386.  * @default
  387.  *
  388.  * @param Parameter 13 as %
  389.  * @desc true - parameter should be displayed as a percent.
  390.  * false - otherwise.
  391.  * Default:
  392.  * @default
  393.  *
  394.  * @param Parameter 14 Symbol
  395.  * @desc The system abbreviation for parameter #14.
  396.  * Space = blank.
  397.  * @default
  398.  *
  399.  * @param Parameter 14 Name
  400.  * @desc The text name of parameter #14.
  401.  * Default:
  402.  * @default
  403.  *
  404.  * @param Parameter 14 as %
  405.  * @desc true - parameter should be displayed as a percent.
  406.  * false - otherwise.
  407.  * Default:
  408.  * @default
  409.  *
  410.  * @param Parameter 15 Symbol
  411.  * @desc The system abbreviation for parameter #15.
  412.  * Space = blank.
  413.  * @default
  414.  *
  415.  * @param Parameter 15 Name
  416.  * @desc The text name of parameter #15.
  417.  * Default:
  418.  * @default
  419.  *
  420.  * @param Parameter 15 as %
  421.  * @desc true - parameter should be displayed as a percent.
  422.  * false - otherwise.
  423.  * Default:
  424.  * @default
  425.  *
  426.  * @param Parameter 16 Symbol
  427.  * @desc The system abbreviation for parameter #16.
  428.  * Space = blank.
  429.  * @default
  430.  *
  431.  * @param Parameter 16 Name
  432.  * @desc The text name of parameter #16.
  433.  * Default:
  434.  * @default
  435.  *
  436.  * @param Parameter 16 as %
  437.  * @desc true - parameter should be displayed as a percent.
  438.  * false - otherwise.
  439.  * Default:
  440.  * @default
  441.  *
  442.  * @param Parameter 17 Symbol
  443.  * @desc The system abbreviation for parameter #17.
  444.  * Space = blank.
  445.  * @default
  446.  *
  447.  * @param Parameter 17 Name
  448.  * @desc The text name of parameter #17.
  449.  * Default:
  450.  * @default
  451.  *
  452.  * @param Parameter 17 as %
  453.  * @desc true - parameter should be displayed as a percent.
  454.  * false - otherwise.
  455.  * Default:
  456.  * @default
  457.  *
  458.  * @param Parameter 18 Symbol
  459.  * @desc The system abbreviation for parameter #18.
  460.  * Space = blank.
  461.  * @default
  462.  *
  463.  * @param Parameter 18 Name
  464.  * @desc The text name of parameter #18.
  465.  * Default:
  466.  * @default
  467.  *
  468.  * @param Parameter 18 as %
  469.  * @desc true - parameter should be displayed as a percent.
  470.  * false - otherwise.
  471.  * Default:
  472.  * @default
  473.  *
  474.  * @param Parameter 19 Symbol
  475.  * @desc The system abbreviation for parameter #19.
  476.  * Default:
  477.  * @default
  478.  *
  479.  * @param Parameter 19 Name
  480.  * @desc The text name of parameter #19.
  481.  * Default:
  482.  * @default
  483.  *
  484.  * @param Parameter 19 as %
  485.  * @desc true - parameter should be displayed as a percent.
  486.  * false - otherwise.
  487.  * Default:
  488.  * @default
  489.  *
  490.  * @param Parameter 20 Symbol
  491.  * @desc The system abbreviation for parameter #20.
  492.  * Space = blank.
  493.  * @default
  494.  *
  495.  * @param Parameter 20 Name
  496.  * @desc The text name of parameter #20.
  497.  * Default:
  498.  * @default
  499.  *
  500.  * @param Parameter 20 as %
  501.  * @desc true - parameter should be displayed as a percent.
  502.  * false - otherwise.
  503.  * Default:
  504.  * @default
  505.  *
  506.  * @param Parameter 21 Symbol
  507.  * @desc The system abbreviation for parameter #21.
  508.  * Space = blank.
  509.  * @default
  510.  *
  511.  * @param Parameter 21 Name
  512.  * @desc The text name of parameter #21.
  513.  * Default:
  514.  * @default
  515.  *
  516.  * @param Parameter 21 as %
  517.  * @desc true - parameter should be displayed as a percent.
  518.  * false - otherwise.
  519.  * Default:
  520.  * @default
  521.  *
  522.  * @param Parameter 22 Symbol
  523.  * @desc The system abbreviation for parameter #22.
  524.  * Space = blank.
  525.  * @default
  526.  *
  527.  * @param Parameter 22 Name
  528.  * @desc The text name of parameter #22.
  529.  * Default:
  530.  * @default
  531.  *
  532.  * @param Parameter 22 as %
  533.  * @desc true - parameter should be displayed as a percent.
  534.  * false - otherwise.
  535.  * Default:
  536.  * @default
  537.  *
  538.  * @param Parameter 23 Symbol
  539.  * @desc The system abbreviation for parameter #23.
  540.  * Space = blank.
  541.  * @default
  542.  *
  543.  * @param Parameter 23 Name
  544.  * @desc The text name of parameter #23.
  545.  * Default:
  546.  * @default
  547.  *
  548.  * @param Parameter 23 as %
  549.  * @desc true - parameter should be displayed as a percent.
  550.  * false - otherwise.
  551.  * Default:
  552.  * @default
  553.  *
  554.  * @param Parameter 24 Symbol
  555.  * @desc The system abbreviation for parameter #24.
  556.  * Space = blank.
  557.  * @default
  558.  *
  559.  * @param Parameter 24 Name
  560.  * @desc The text name of parameter #24.
  561.  * Default:
  562.  * @default
  563.  *
  564.  * @param Parameter 24 as %
  565.  * @desc true - parameter should be displayed as a percent.
  566.  * false - otherwise.
  567.  * Default:
  568.  * @default
  569.  *
  570.  * @param Parameter 25 Symbol
  571.  * @desc The system abbreviation for parameter #25.
  572.  * Space = blank.
  573.  * @default
  574.  *
  575.  * @param Parameter 25 Name
  576.  * @desc The text name of parameter #25.
  577.  * Default:
  578.  * @default
  579.  *
  580.  * @param Parameter 25 as %
  581.  * @desc true - parameter should be displayed as a percent.
  582.  * false - otherwise.
  583.  * Default:
  584.  * @default
  585.  *
  586.  * @param Parameter 26 Symbol
  587.  * @desc The system abbreviation for parameter #26.
  588.  * Space = blank.
  589.  * @default
  590.  *
  591.  * @param Parameter 26 Name
  592.  * @desc The text name of parameter #26.
  593.  * Default:
  594.  * @default
  595.  *
  596.  * @param Parameter 26 as %
  597.  * @desc true - parameter should be displayed as a percent.
  598.  * false - otherwise.
  599.  * Default:
  600.  * @default
  601.  *
  602.  * @param Parameter 27 Symbol
  603.  * @desc The system abbreviation for parameter #27.
  604.  * Space = blank.
  605.  * @default
  606.  *
  607.  * @param Parameter 27 Name
  608.  * @desc The text name of parameter #27.
  609.  * Default:
  610.  * @default
  611.  *
  612.  * @param Parameter 27 as %
  613.  * @desc true - parameter should be displayed as a percent.
  614.  * false - otherwise.
  615.  * Default:
  616.  * @default
  617.  *
  618.  * @param Parameter 28 Symbol
  619.  * @desc The system abbreviation for parameter #28.
  620.  * Space = blank.
  621.  * @default
  622.  *
  623.  * @param Parameter 28 Name
  624.  * @desc The text name of parameter #28.
  625.  * Default:
  626.  * @default
  627.  *
  628.  * @param Parameter 28 as %
  629.  * @desc true - parameter should be displayed as a percent.
  630.  * false - otherwise.
  631.  * Default:
  632.  * @default
  633.  *
  634.  * @param Parameter 29 Symbol
  635.  * @desc The system abbreviation for parameter #29.
  636.  * Space = blank.
  637.  * @default
  638.  *
  639.  * @param Parameter 29 Name
  640.  * @desc The text name of parameter #29.
  641.  * Default:
  642.  * @default
  643.  *
  644.  * @param Parameter 29 as %
  645.  * @desc true - parameter should be displayed as a percent.
  646.  * false - otherwise.
  647.  * Default:
  648.  * @default
  649.  *
  650.  * @param Parameter 30 Symbol
  651.  * @desc The system abbreviation for parameter #30.
  652.  * Space = blank.
  653.  * @default
  654.  *
  655.  * @param Parameter 30 Name
  656.  * @desc The text name of parameter #30.
  657.  * Default:
  658.  * @default
  659.  *
  660.  * @param Parameter 30 as %
  661.  * @desc true - parameter should be displayed as a percent.
  662.  * false - otherwise.
  663.  * Default:
  664.  * @default
  665.  *
  666.  * @param Parameter 31 Symbol
  667.  * @desc The system abbreviation for parameter #31.
  668.  * Space = blank.
  669.  * @default
  670.  *
  671.  * @param Parameter 31 Name
  672.  * @desc The text name of parameter #31.
  673.  * Default:
  674.  * @default
  675.  *
  676.  * @param Parameter 31 as %
  677.  * @desc true - parameter should be displayed as a percent.
  678.  * false - otherwise.
  679.  * Default:
  680.  * @default
  681.  *
  682.  * @param Parameter 32 Symbol
  683.  * @desc The system abbreviation for parameter #32.
  684.  * Space = blank.
  685.  * @default
  686.  *
  687.  * @param Parameter 32 Name
  688.  * @desc The text name of parameter #32.
  689.  * Default:
  690.  * @default
  691.  *
  692.  * @param Parameter 32 as %
  693.  * @desc true - parameter should be displayed as a percent.
  694.  * false - otherwise.
  695.  * Default:
  696.  * @default
  697.  *
  698.  * @param Parameter 33 Symbol
  699.  * @desc The system abbreviation for parameter #33.
  700.  * Space = blank.
  701.  * @default
  702.  *
  703.  * @param Parameter 33 Name
  704.  * @desc The text name of parameter #33.
  705.  * Default:
  706.  * @default
  707.  *
  708.  * @param Parameter 33 as %
  709.  * @desc true - parameter should be displayed as a percent.
  710.  * false - otherwise.
  711.  * Default:
  712.  * @default
  713.  *
  714.  * @param Parameter 34 Symbol
  715.  * @desc The system abbreviation for parameter #34.
  716.  * Space = blank.
  717.  * @default
  718.  *
  719.  * @param Parameter 34 Name
  720.  * @desc The text name of parameter #34.
  721.  * Default:
  722.  * @default
  723.  *
  724.  * @param Parameter 34 as %
  725.  * @desc true - parameter should be displayed as a percent.
  726.  * false - otherwise.
  727.  * Default:
  728.  * @default
  729.  *
  730.  * @param Parameter 35 Symbol
  731.  * @desc The system abbreviation for parameter #35.
  732.  * Space = blank.
  733.  * @default
  734.  *
  735.  * @param Parameter 35 Name
  736.  * @desc The text name of parameter #35.
  737.  * Default:
  738.  * @default
  739.  *
  740.  * @param Parameter 35 as %
  741.  * @desc true - parameter should be displayed as a percent.
  742.  * false - otherwise.
  743.  * Default:
  744.  * @default
  745.  *
  746.  * @param Parameter 36 Symbol
  747.  * @desc The system abbreviation for parameter #36.
  748.  * Space = blank.
  749.  * @default
  750.  *
  751.  * @param Parameter 36 Name
  752.  * @desc The text name of parameter #36.
  753.  * Default:
  754.  * @default
  755.  *
  756.  * @param Parameter 36 as %
  757.  * @desc true - parameter should be displayed as a percent.
  758.  * false - otherwise.
  759.  * Default:
  760.  * @default
  761.  *
  762.  * @param Parameter 37 Symbol
  763.  * @desc The system abbreviation for parameter #37.
  764.  * Space = blank.
  765.  * @default
  766.  *
  767.  * @param Parameter 37 Name
  768.  * @desc The text name of parameter #37.
  769.  * Default:
  770.  * @default
  771.  *
  772.  * @param Parameter 37 as %
  773.  * @desc true - parameter should be displayed as a percent.
  774.  * false - otherwise.
  775.  * Default:
  776.  * @default
  777.  *
  778.  * @param Parameter 38 Symbol
  779.  * @desc The system abbreviation for parameter #38.
  780.  * Space = blank.
  781.  * @default
  782.  *
  783.  * @param Parameter 38 Name
  784.  * @desc The text name of parameter #38.
  785.  * Default:
  786.  * @default
  787.  *
  788.  * @param Parameter 38 as %
  789.  * @desc true - parameter should be displayed as a percent.
  790.  * false - otherwise.
  791.  * Default:
  792.  * @default
  793.  *
  794.  * @param Parameter 39 Symbol
  795.  * @desc The system abbreviation for parameter #39.
  796.  * Space = blank.
  797.  * @default
  798.  *
  799.  * @param Parameter 39 Name
  800.  * @desc The text name of parameter #39.
  801.  * Default:
  802.  * @default
  803.  *
  804.  * @param Parameter 39 as %
  805.  * @desc true - parameter should be displayed as a percent.
  806.  * false - otherwise.
  807.  * Default:
  808.  * @default
  809.  *
  810.  * @param Parameter 40 Symbol
  811.  * @desc The system abbreviation for parameter #40.
  812.  * Space = blank.
  813.  * @default
  814.  *
  815.  * @param Parameter 40 Name
  816.  * @desc The text name of parameter #40.
  817.  * Default:
  818.  * @default
  819.  *
  820.  * @param Parameter 40 as %
  821.  * @desc true - parameter should be displayed as a percent.
  822.  * false - otherwise.
  823.  * Default:
  824.  * @default
  825.  *
  826.  * @param Parameter 41 Symbol
  827.  * @desc The system abbreviation for parameter #41.
  828.  * Space = blank.
  829.  * @default
  830.  *
  831.  * @param Parameter 41 Name
  832.  * @desc The text name of parameter #41.
  833.  * Default:
  834.  * @default
  835.  *
  836.  * @param Parameter 41 as %
  837.  * @desc true - parameter should be displayed as a percent.
  838.  * false - otherwise.
  839.  * Default:
  840.  * @default
  841.  *
  842.  * @param Parameter 42 Symbol
  843.  * @desc The system abbreviation for parameter #42.
  844.  * Space = blank.
  845.  * @default
  846.  *
  847.  * @param Parameter 42 Name
  848.  * @desc The text name of parameter #42.
  849.  * Default:
  850.  * @default
  851.  *
  852.  * @param Parameter 42 as %
  853.  * @desc true - parameter should be displayed as a percent.
  854.  * false - otherwise.
  855.  * Default:
  856.  * @default
  857.  *
  858.  * @param Parameter 43 Symbol
  859.  * @desc The system abbreviation for parameter #43.
  860.  * Space = blank.
  861.  * @default
  862.  *
  863.  * @param Parameter 43 Name
  864.  * @desc The text name of parameter #43.
  865.  * Default:
  866.  * @default
  867.  *
  868.  * @param Parameter 43 as %
  869.  * @desc true - parameter should be displayed as a percent.
  870.  * false - otherwise.
  871.  * Default:
  872.  * @default
  873.  *
  874.  * @param Parameter 44 Symbol
  875.  * @desc The system abbreviation for parameter #44.
  876.  * Space = blank.
  877.  * @default
  878.  *
  879.  * @param Parameter 44 Name
  880.  * @desc The text name of parameter #44.
  881.  * Default:
  882.  * @default
  883.  *
  884.  * @param Parameter 44 as %
  885.  * @desc true - parameter should be displayed as a percent.
  886.  * false - otherwise.
  887.  * Default:
  888.  * @default
  889.  *
  890.  * @param Parameter 45 Symbol
  891.  * @desc The system abbreviation for parameter #45.
  892.  * Space = blank.
  893.  * @default
  894.  *
  895.  * @param Parameter 45 Name
  896.  * @desc The text name of parameter #45.
  897.  * Default:
  898.  * @default
  899.  *
  900.  * @param Parameter 45 as %
  901.  * @desc true - parameter should be displayed as a percent.
  902.  * false - otherwise.
  903.  * Default:
  904.  * @default
  905.  *
  906.  * @param Parameter 46 Symbol
  907.  * @desc The system abbreviation for parameter #46.
  908.  * Space = blank.
  909.  * @default
  910.  *
  911.  * @param Parameter 46 Name
  912.  * @desc The text name of parameter #46.
  913.  * Default:
  914.  * @default
  915.  *
  916.  * @param Parameter 46 as %
  917.  * @desc true - parameter should be displayed as a percent.
  918.  * false - otherwise.
  919.  * Default:
  920.  * @default
  921.  *
  922.  * @param Parameter 47 Symbol
  923.  * @desc The system abbreviation for parameter #47.
  924.  * Space = blank.
  925.  * @default
  926.  *
  927.  * @param Parameter 47 Name
  928.  * @desc The text name of parameter #47.
  929.  * Default:
  930.  * @default
  931.  *
  932.  * @param Parameter 47 as %
  933.  * @desc true - parameter should be displayed as a percent.
  934.  * false - otherwise.
  935.  * Default:
  936.  * @default
  937.  *
  938.  * @param Parameter 48 Symbol
  939.  * @desc The system abbreviation for parameter #48.
  940.  * Space = blank.
  941.  * @default
  942.  *
  943.  * @param Parameter 48 Name
  944.  * @desc The text name of parameter #48.
  945.  * Default:
  946.  * @default
  947.  *
  948.  * @param Parameter 48 as %
  949.  * @desc true - parameter should be displayed as a percent.
  950.  * false - otherwise.
  951.  * Default:
  952.  * @default
  953.  *
  954.  * @param ---Param Formatting---
  955.  * @default
  956.  *
  957.  * @param Column 1 Height
  958.  * @desc The number of parameters to list in the first column.
  959.  * Default: 9
  960.  * @default 9
  961.  *
  962.  * @param Column 1 Text Width
  963.  * @desc Width (pixels) alloted to column 1's parameter names.
  964.  * Default: 160
  965.  * @default 160
  966.  *
  967.  * @param Column 1 Value Width
  968.  * @desc Width (pixels) alloted to column 1's parameter values.
  969.  * Default: 60
  970.  * @default 60
  971.  *
  972.  * @param Column 2 Height
  973.  * @desc The number of parameters to list in the second column.
  974.  * If zero or blank, all parameters will be listed in a single column.
  975.  * Default: 0
  976.  * @default 0
  977.  *
  978.  * @param Column 2 Text Width
  979.  * @desc Width (pixels) alloted to column 2's parameter names.
  980.  * Default: 160
  981.  * @default 160
  982.  *
  983.  * @param Column 2 Value Width
  984.  * @desc Width (pixels) alloted to column 2's parameter values.
  985.  * Default: 60
  986.  * @default 60
  987.  *
  988.  * @param Column 3 Height
  989.  * @desc The number of parameters to list in the third column.
  990.  * Zero hides the column.
  991.  * Default: 0
  992.  * @default 0
  993.  *
  994.  * @param Column 3 Text Width
  995.  * @desc Width (pixels) alloted to column 3's parameter names.
  996.  * Default: 160
  997.  * @default 160
  998.  *
  999.  * @param Column 3 Value Width
  1000.  * @desc Width (pixels) alloted to column 3's parameter values.
  1001.  * Default: 60
  1002.  * @default 60
  1003.  *
  1004.  * @param Display Equips?
  1005.  * @desc true - Attempt to show equips on the parameter page.
  1006.  * false - hide the equips.
  1007.  * Default: true
  1008.  * @default true
  1009.  *
  1010.  * @param Equip Column Width
  1011.  * @desc Width (pixels) for equipment listings on pages if shown.
  1012.  * Default: 320
  1013.  * @default 320
  1014.  *
  1015.  * @param ---Category Options---
  1016.  * @desc The common set of text classifications for elemental or state resistance rates.
  1017.  *
  1018.  * @param Use Color
  1019.  * @desc true - color all resistance values (text or %age)
  1020.  * false - disables all color options below.
  1021.  * @default true
  1022.  *
  1023.  * @param Threshold 1
  1024.  * @desc The minimum %-value required for the highest category. (#1)
  1025.  * Default: 201
  1026.  * @default 201
  1027.  *
  1028.  * @param Category 1 Text
  1029.  * @desc The label for this resistance category.
  1030.  * Default: Very Weak
  1031.  * @default Very Weak
  1032.  *
  1033.  * @param Category 1 Color
  1034.  * @desc The color for values from this category.
  1035.  * Leave blank to use the default color.
  1036.  * @default 10
  1037.  *
  1038.  * @param Threshold 2
  1039.  * @desc The minimum %-value required for this category.
  1040.  * Default: 101
  1041.  * @default 101
  1042.  *
  1043.  * @param Category 2 Text
  1044.  * @desc The label for this resistance category.
  1045.  * Default: Weak
  1046.  * @default Weak
  1047.  *
  1048.  * @param Category 2 Color
  1049.  * @desc The color for values from this category.
  1050.  * Leave blank to use the default color.
  1051.  * @default 2
  1052.  *
  1053.  * @param Threshold 3
  1054.  * @desc The minimum %-value required for this category.
  1055.  * Default: 100
  1056.  * @default 100
  1057.  *
  1058.  * @param Category 3 Text
  1059.  * @desc The label for this resistance category.
  1060.  * Default: Normal
  1061.  * @default Normal
  1062.  *
  1063.  * @param Category 3 Color
  1064.  * @desc The color for values from this category.
  1065.  * Leave blank to use the default color.
  1066.  * @default
  1067.  *
  1068.  * @param Threshold 4
  1069.  * @desc The minimum %-value required for this category.
  1070.  * Default: 50
  1071.  * @default 50
  1072.  *
  1073.  * @param Category 4 Text
  1074.  * @desc The label for this resistance category.
  1075.  * Default: Resist
  1076.  * @default Resist
  1077.  *
  1078.  * @param Category 4 Color
  1079.  * @desc The color for values from this category.
  1080.  * Leave blank to use the default color.
  1081.  * @default 5
  1082.  *
  1083.  * @param Threshold 5
  1084.  * @desc The minimum %-value required for this category.
  1085.  * Default: 1
  1086.  * @default 1
  1087.  *
  1088.  * @param Category 5 Text
  1089.  * @desc The label for this resistance category.
  1090.  * Default: Resist
  1091.  * @default Resist
  1092.  *
  1093.  * @param Category 5 Color
  1094.  * @desc The color for values from this category.
  1095.  * Leave blank to use the default color.
  1096.  * @default 13
  1097.  *
  1098.  * @param Threshold 6
  1099.  * @desc The minimum %-value required for this category.
  1100.  * Default: 0
  1101.  * @default 0
  1102.  *
  1103.  * @param Category 6 Text
  1104.  * @desc The label for this resistance category.
  1105.  * Default: Immune
  1106.  * @default Immune
  1107.  *
  1108.  * @param Category 6 Color
  1109.  * @desc The color for values from this category.
  1110.  * Leave blank to use the default color.
  1111.  * @default 14
  1112.  *
  1113.  * @param Threshold 7
  1114.  * @desc The minimum %-value required for this category.
  1115.  * Default: -99
  1116.  * @default -99
  1117.  *
  1118.  * @param Category 7 Text
  1119.  * @desc The label for this resistance category.
  1120.  * Default: Absorb
  1121.  * @default Absorb
  1122.  *
  1123.  * @param Category 7 Color
  1124.  * @desc The color for values from this category.
  1125.  * Leave blank to use the default color.
  1126.  * @default 3
  1127.  *
  1128.  * @param Threshold 8
  1129.  * @desc The minimum %-value required for this category.
  1130.  * Default: -1000
  1131.  * @default -1000
  1132.  *
  1133.  * @param Category 8 Text
  1134.  * @desc The label for this resistance category.
  1135.  * Default: Absorb
  1136.  * @default Absorb
  1137.  *
  1138.  * @param Category 8 Color
  1139.  * @desc The color for values from this category.
  1140.  * Leave blank to use the default color.
  1141.  * @default 11
  1142.  *
  1143.  *
  1144.  * @param ---Element Options---
  1145.  * @default
  1146.  *
  1147.  * @param Ele. Resist Header
  1148.  * @desc The text header explaining the elemental defense rates listed on
  1149.  * the Resistances page.  Can be removed if this is left blank.
  1150.  * Default:  Elemental Damage Received
  1151.  * @default Elemental Damage Received
  1152.  *
  1153.  * @param Column 1 Elements
  1154.  * @desc The number of elements to list in the first column.
  1155.  * Setting this to zero will erase all columns and empty the Resistances page.
  1156.  * Default: 4
  1157.  * @default 4
  1158.  *
  1159.  * @param Column 2 Elements
  1160.  * @desc The number of elements to list in the second column.
  1161.  * Setting this to zero will eliminate columns 2 and 3.
  1162.  * Default: 4
  1163.  * @default 4
  1164.  *
  1165.  * @param Column 3 Elements
  1166.  * @desc The number of elements to list in the third column.
  1167.  * Setting this to zero will eliminate the column.
  1168.  * Default: 0
  1169.  * @default 0
  1170.  *
  1171.  * @param Hidden Elements
  1172.  * @desc A list of the element IDs to keep hidden.
  1173.  * Example: 1, 2 will hide Physical and Fire if unchanged.
  1174.  * @default 1
  1175.  *
  1176.  * @param Display Ele. Percent
  1177.  * @desc true - show exact resistance percent
  1178.  * false - categorize resistance strength (like "weak")
  1179.  * @default false
  1180.  *
  1181.  * @param Center Ele. Values
  1182.  * @desc true - element rates / categories will be centered.
  1183.  * false - right-aligned instead.
  1184.  * @default true
  1185.  *
  1186.  * @param ---State Options---
  1187.  * @default
  1188.  *
  1189.  * @param State Resist Header
  1190.  * @desc The text header explaining the state defense rates listed on
  1191.  * the State Resistances page.  Can be removed if this is left blank.
  1192.  * Default: State Resistance
  1193.  * @default State Resistance
  1194.  *
  1195.  * @param Column 1 States
  1196.  * @desc The number of states to list in the first column.
  1197.  * Setting this to zero will erase all columns and empty the page.
  1198.  * Default: 4
  1199.  * @default 4
  1200.  *
  1201.  * @param Column 2 States
  1202.  * @desc The number of elements to list in the second column.
  1203.  * Setting this to zero will eliminate columns 2 and 3.
  1204.  * Default: 4
  1205.  * @default 4
  1206.  *
  1207.  * @param Column 3 States
  1208.  * @desc The number of elements to list in the third column.
  1209.  * Setting this to zero will eliminate the column.
  1210.  * Default: 0
  1211.  * @default 0
  1212.  *
  1213.  * @param Hidden States
  1214.  * @desc A list of the state IDs to keep hidden.
  1215.  * Example: 1, 2, 3 will hide Knockout, Guard, and Immortal.
  1216.  * @default 1, 2, 3
  1217.  *
  1218.  * @param Display State Percent
  1219.  * @desc true - show exact resistance percent
  1220.  * false - categorize resistance strength (like "weak")
  1221.  * @default true
  1222.  *
  1223.  * @param Center State Values
  1224.  * @desc true - state rates / categories will be centered.
  1225.  * false - right-aligned instead.
  1226.  * @default true
  1227.  *
  1228.  *
  1229.  * @help
  1230.  * ============================================================================
  1231.  * Introduction
  1232.  * ============================================================================
  1233.  *
  1234.  * For those who might desire to customize their Status further than the
  1235.  * default behavior provided by this plugin, note that this plugin takes
  1236.  * parameters allowing you to specify the menu name and window corresponding to
  1237.  * each Status page.
  1238.  *
  1239.  * Even without any editing, this plugin automatically provides for extended
  1240.  * Status functionality for use in your own projects.
  1241.  *
  1242.  * ============================================================================
  1243.  * How to Use This Plugin
  1244.  * ============================================================================
  1245.  *
  1246.  *
  1247.  * Extended Parameters
  1248.  * ===================
  1249.  * Rather than assume that you always want the parameters listed in a specific
  1250.  * order, this plugin allows you to choose what order all parameters are listed
  1251.  * in.  This is also helpful to allow some degree of control of how they're
  1252.  * arranged on the screen.
  1253.  *
  1254.  * By default, RPG Maker doesn't provide any in-text names or abbreviations for
  1255.  * many extended or special parameters.  As a result, you need to specify these
  1256.  * values for any such additional parameters.  If left blank, this plugin will
  1257.  * attempt to find the names and abbreviations from the database's TextManager,
  1258.  * which will succeed for the basic parameters.
  1259.  *
  1260.  * Table of built-in parameters:
  1261.  *
  1262.  * ==========================================
  1263.  * | Symbol |      Name       | %age-based? |
  1264.  * ==========================================
  1265.  * | atk    | Attack          | false       |
  1266.  * | def    | Defense         | false       |
  1267.  * | mat    | M.Attack        | false       |
  1268.  * | mdf    | M.Defense       | false       |
  1269.  * | agi    | Agility         | false       |
  1270.  * | luk    | Luck            | false       |
  1271.  * ==========================================
  1272.  * | hit    | Hit Rate        | true        |
  1273.  * | eva    | Evasion         | true        |
  1274.  * | cri    | Critical Rate   | true        |
  1275.  * | cev    | Crit Evasion    | true        |
  1276.  * | mev    | Magic Evasion   | true        |
  1277.  * | mrf    | M. Reflection   | true        |
  1278.  * | cnt    | Counterattack   | true        |
  1279.  * | hrg    | HP Regen Rate   | true        |
  1280.  * | mrg    | MP Regen Rate   | true        |
  1281.  * | trg    | TP Regen Rate   | true        |
  1282.  * ==========================================
  1283.  * | tgr    | Target Rate     | true        |
  1284.  * | grd    | Guard Effect    | true        |
  1285.  * | rec    | Recovery Effect | true        |
  1286.  * | pha    | Pharmacology    | true        |
  1287.  * | mcr    | MP Cost Rate    | true        |
  1288.  * | tcr    | TP Cost Rate    | true        |
  1289.  * | pdr    | Phys Damage %   | true        |
  1290.  * | mdr    | Magic Damage %  | true        |
  1291.  * | fdr    | Floor Damage %  | true        |
  1292.  * | exr    | Exp Gain Rate   | true        |
  1293.  * ==========================================
  1294.  *
  1295.  * Additionally, you can control how the Parameter page is organized through
  1296.  * the "Param Formatting" options.  The parameters may be listed on their
  1297.  * respective page in up to three columns, and each column may independently
  1298.  * be given a different length and width for its information in order to
  1299.  * fine-tune the page's visual appearance.  The default values provided
  1300.  * match those used by default for the original parameters in the vanilla
  1301.  * version of the Status window.
  1302.  *
  1303.  * If any parameter location has a blank symbol, it will be interpreted as a blank
  1304.  * to be left on the parameter page and will be counted as one of the parameters in
  1305.  * its column.  This allows you to create visual groupings of parameters should you so desire.
  1306.  *
  1307.  * Note that assigning any column 0 parameters hides that column and those
  1308.  * after it.
  1309.  *
  1310.  * Want even more options with this?
  1311.  *
  1312.  * In place of a symbol, you can use elementRate(1) - with 1 being the element's ID here -
  1313.  * to put elemental rate data on the parameters page.  Likewise, stateRate(1) - with 1 as
  1314.  * the state's ID - will put state rate / resistance data on the parameters page in that slot.
  1315.  *
  1316.  * For both of these, the name will be autodetected if left blank.
  1317.  * Furthermore, if you leave the "Parameter # as %" option blank, it will
  1318.  * default to the global setting for elements or states set toward the bottom
  1319.  * of the options.
  1320.  *
  1321.  * You can select whether or not the value/category (again, global option) is
  1322.  * centered or right-aligned via option.  This can be set differently for elements and
  1323.  * states as a group, but not individually.  (If not centered, they will be right-aligned.)
  1324.  *
  1325.  *
  1326.  * Resistance Options
  1327.  * ==================
  1328.  * This plugin also provides a page to display elemental resistances on the
  1329.  * status page.  As the Elements are included in the "Terms" part of the
  1330.  * game database and are nearly all relevant in many game types, this page
  1331.  * is far easier to automatically generate.
  1332.  *
  1333.  * It is possible to hide certain elements by listing them within the
  1334.  * "Hidden Elements" parameter - make sure the values therein are
  1335.  * comma-separated.  Past that, you can control the arrangement of elements
  1336.  * into columns, though their ordering is determined by their numerical IDs.
  1337.  *
  1338.  * New in v 1.02 is the ability to classify resistance levels by text and/or
  1339.  * color visually within the Resistances tab.  You can set up to 8 thresholds
  1340.  * that define the different tiers of resistance, and all colors can be killed
  1341.  * with a single swap of the "Use Color" option.
  1342.  *
  1343.  * As for selecting the colors, you can go with one of the system default 32
  1344.  * options provided by RPG Maker (see img/system/Window.png), OR you can
  1345.  * define a color via hexadecimal value, like 0x006600 for a dark green.
  1346.  * This plugin will adapt to whichever choice you take.
  1347.  *
  1348.  *
  1349.  * Profile Options
  1350.  * ===============
  1351.  * By default, RPG Maker provides limited space to provide background info
  1352.  * for each actor.  With the extended Status window functionality provided
  1353.  * by this plugin, we gain more space, and as a result a more in-depth
  1354.  * profile can be provided in-game.
  1355.  *
  1356.  * To provide an extended profile for any particular actor, use the following
  1357.  * tags:
  1358.  *
  1359.  *
  1360.  * <portrait: x> - x must be the corresponding filename from the img/pictures
  1361.  * folder.  If an actor lacks this tag, a vanilla version of the Profile
  1362.  * will appear that is organized more closely to the standard Status window
  1363.  * appearance.
  1364.  *
  1365.  * For those who purchased the "Cover Art Characters Pack" and copied the data
  1366.  * into their projects, <Portrait: Package1_1> would be a good example use.
  1367.  *
  1368.  * <portrait scale: x> - Specifies the desired default scaling of the profile portrait.
  1369.  * x = 1 provides the default scaling behavior; x = 0.5 halve the size, while
  1370.  * x = 2 doubles it.  Note that the image is confined to within the profile
  1371.  * portrait window.
  1372.  *
  1373.  * If not provided, the scaling factor will default to 1 and use the original
  1374.  * image size.
  1375.  *
  1376.  *
  1377.  * <portrait offset: x, y> - Specifies a default offset from baseline automatic positioning
  1378.  * to use for the portrait.  (Enables somewhat manual positioning.)  Positive
  1379.  * x moves the image further right, while positive y moves the image further
  1380.  * down - but note that the image will be clipped as a result of such adjustments.
  1381.  * The profile window's border will automatically overwrite such parts of the
  1382.  * image; this cannot be helped.
  1383.  *
  1384.  *
  1385.  * <portrait anti-buffer: x> - Use to set a default adjustment for any transparency/whitespace
  1386.  * that your portraits cause on non-profile pages.  Positive values allow each page
  1387.  * to display over the left side of the portrait by the amount set, while negative values
  1388.  * provide additional buffering between the image and text.
  1389.  *
  1390.  * If this is too confusing, you can always edit the portrait to add/remove
  1391.  * whitespace - the system DOES look at image width, just not its contents.
  1392.  * This tag exists so that you don't HAVE to edit the contents.
  1393.  *
  1394.  *  * To provide full custom specs on a per-portrait basis, use the following tag structure
  1395.  * for any "portrait switch".  The default behavior for missing options can be selected
  1396.  * globally via plugin option.
  1397.  *
  1398.  *
  1399.  * If you want different portraits at different times for your actors:
  1400.  *
  1401.  * <portrait "filename" switch: s scale: z offset: x, y antibuffer: b>
  1402.  *
  1403.  * Note that filename and switch are absolutely required, while you can leave out the
  1404.  * scale, offset, and antibuffer components at your leisure.  (They'll use the default
  1405.  * values set by their individual tags as listed above.)  All data per portrait is
  1406.  * to be specified inside a single complex tag.  Aside from filename, all the other
  1407.  * details may be specified in whatever order you prefer; the restrictions mentioned here
  1408.  * are necessary to distinguish between tag types.
  1409.  *
  1410.  * The portrait switching behavior follows the same rules as for profile switching, as
  1411.  * mentioned later below.
  1412.  *
  1413.  * Please note that "filename" must be enclosed within double quotes - this is necessary
  1414.  * to allow spaces in the middle of a portrait's filename without breaking the ability
  1415.  * of this plugin to actually process the tag.
  1416.  *
  1417.  *
  1418.  * <profile>
  1419.  * Line 1 of extended backstory here...
  1420.  * Line 2...
  1421.  *
  1422.  * Even more backstory...
  1423.  * </profile>
  1424.  *
  1425.  *
  1426.  * Not satisfied with the limited two lines of background text alloted to you
  1427.  * by the base engine?  Feel free to write something much more in-depth via this
  1428.  * set of tags!  All whitespace will be recognized and preserved, allowing you
  1429.  * to easily write a paragraph or two.
  1430.  *
  1431.  * Do note, however, that there is no automatic line-breaking, as well as nothing
  1432.  * preventing your text from overlapping with your Actors' portraits.
  1433.  *
  1434.  * <profile Switch: x>
  1435.  * Line 1 of extended backstory here...
  1436.  * Line 2...
  1437.  *
  1438.  * Even more backstory...
  1439.  * </profile>
  1440.  *
  1441.  *
  1442.  * Want your baseline extended backstory to change after certain game events?
  1443.  * You can use the "Profile Switch" tag to create alternate text that only
  1444.  * activates when the selected Switch is On.
  1445.  *
  1446.  * In the case of conflict (via multiple Profile Switch tags meeting their
  1447.  * conditions) the earliest defined Profile Switch will be used.
  1448.  *
  1449.  *
  1450.  * One extra thing - you may freely use <hr> on its own line within a <profile> tag
  1451.  * to produce a horizontal line within the text profile!  (Any other text on that
  1452.  * line will block this.)
  1453.  *
  1454.  *
  1455.  * Page Selection
  1456.  * ==============
  1457.  * Each "Page _ Name" parameter allows you to specify the name of its
  1458.  * corresponding page on the Status menu.
  1459.  *
  1460.  * Each "Page _ Window" parameter allows you to choose a Window object to act
  1461.  * as a Status menu page.  Two have been provided by default, both based upon
  1462.  * the JAH_Window_Status_Base class.
  1463.  *
  1464.  * Extending the JAH_Window_Status_Base class will allow you to create your OWN
  1465.  * custom windows that can be included as part of your game's status menu
  1466.  * option!  For the simplest provided example on how to use it, should you be
  1467.  * up to the coding involved, check the JAH_Window_Status_Profile class for how
  1468.  * to effectively do so.
  1469.  */
  1470.  
  1471.  //========= OBJECT DEFINITIONS - RESULTS FROM PARAMETER PROCESSING ==========
  1472.  
  1473. // -------------------------------------------------------
  1474. // JAH_StatusMenuCore_ParamEntry
  1475. //
  1476. // Stores all data for one Parameter listing on the Parameter page.
  1477. // Localizes all its info and saves certain details for mild optimization.
  1478.  
  1479. function JAH_StatusMenuCore_ParamEntry() {
  1480.     this.initialize.apply(this, arguments);
  1481. }
  1482.  
  1483. JAH_StatusMenuCore_ParamEntry.prototype.constructor = JAH_StatusMenuCore_ParamEntry;
  1484.  
  1485. JAH_StatusMenuCore_ParamEntry.prototype.initialize = function(symbol, name, asPercent, txtWidth, valWidth, align) {
  1486.     this._eval = "window._actor." + symbol;
  1487.  
  1488.     this._symbol = symbol;
  1489.     this._name = name;
  1490.     this._asPercent = asPercent || false;
  1491.     this._txtWidth = txtWidth;
  1492.     this._valWidth = valWidth;
  1493.     this._align = align || 'right';
  1494. };
  1495.  
  1496. JAH_StatusMenuCore_ParamEntry.prototype.initName = function() {
  1497.  
  1498.     var name = this._name;
  1499.     // Grab default name.
  1500.     if(name == undefined || name.trim() == "")
  1501.     {
  1502.         switch(this._symbol)
  1503.         {
  1504.             case 'atk':
  1505.                 name = TextManager.param(2);
  1506.                 break;
  1507.             case 'def':
  1508.                 name = TextManager.param(3);
  1509.                 break;
  1510.             case 'mat':
  1511.                 name = TextManager.param(4);
  1512.                 break;
  1513.             case 'mdf':
  1514.                 name = TextManager.param(5);
  1515.                 break;
  1516.             case 'agi':
  1517.                 name = TextManager.param(6);
  1518.                 break;
  1519.             case 'luk':
  1520.                 name = TextManager.param(7);
  1521.                 break;
  1522.             case 'hit':
  1523.                 name = TextManager.param(8);
  1524.                 break;
  1525.             case 'eva':
  1526.                 name = TextManager.param(9);
  1527.                 break;
  1528.             default:
  1529.                 name = "undefined";
  1530.         }
  1531.     }
  1532.  
  1533.     this._name = name;
  1534. }
  1535.  
  1536. JAH_StatusMenuCore_ParamEntry.prototype.draw = function(window, x, y) {
  1537.  
  1538.     if(!this._name) this.initName();
  1539.  
  1540.     window.changeTextColor(window.systemColor());
  1541.     window.drawTextEx(this._name, x-20, y, this._txtWidth);
  1542.     window.resetTextColor();
  1543.     var value = eval(this._eval);
  1544.  
  1545.     if(this._asPercent)
  1546.     {
  1547.         value = Math.round(value * 100) + "%";
  1548.     }
  1549.  
  1550.     window.drawText(value, x + this._txtWidth, y-4, this._valWidth, this._align);
  1551. };
  1552.  
  1553. // -------------------------------------------------------
  1554. // JAH_StatusMenuCore_ResistEntry
  1555. //
  1556. // Stores all data for one Resistance listing on the Parameter page.
  1557. // Localizes all its info and saves certain details for mild optimization.
  1558.  
  1559. function JAH_StatusMenuCore_ResistEntry() {
  1560.     this.initialize.apply(this, arguments);
  1561. }
  1562.  
  1563. JAH_StatusMenuCore_ResistEntry.prototype.constructor = JAH_StatusMenuCore_ResistEntry;
  1564.  
  1565. JAH_StatusMenuCore_ResistEntry.prototype.initialize = function(symbol, name, asPercent, txtWidth, valWidth, align) {
  1566.     this._eval = "window._actor." + symbol;
  1567.  
  1568.     this._symbol = symbol;
  1569.     this._name = name;
  1570.  
  1571.     if(asPercent === undefined || asPercent == "")
  1572.     {
  1573.         if(symbol.indexOf("elementRate") > -1)
  1574.         {
  1575.             asPercent = JahwsUF.StatusMenuCore.Param.DisplayElePercents;
  1576.         }
  1577.         else asPercent = JahwsUF.StatusMenuCore.Param.DisplayStatePercents;
  1578.     }
  1579.  
  1580.     this._asPercent = asPercent || false;
  1581.     this._txtWidth = txtWidth;
  1582.     this._valWidth = valWidth;
  1583.     this._align = align || 'right';
  1584. };
  1585.  
  1586. JAH_StatusMenuCore_ResistEntry.prototype.initName = function() {
  1587.  
  1588.     var name = this._name;
  1589.  
  1590.     // Grab default name.
  1591.     if(name === undefined || name.trim() == "")
  1592.     {
  1593.         if(this._symbol.match(/elementRate\((\d+)\)/i))
  1594.         {
  1595.             var elementID = RegExp.$1;
  1596.  
  1597.             name = $dataSystem.elements[elementID];
  1598.  
  1599.             if(name == undefined) name = "undefined";
  1600.         }
  1601.         else if(this._symbol.match(/stateRate\((\d+)\)/i))
  1602.         {
  1603.             var stateID = RegExp.$1;
  1604.  
  1605.             var state = $dataStates[stateID];
  1606.  
  1607.             if(!!state)
  1608.             {
  1609.                 name = state.name;
  1610.             }
  1611.             else name = "undefined";
  1612.         }
  1613.         else name = "undefined";
  1614.     }
  1615.  
  1616.     this._name = name;
  1617. }
  1618.  
  1619. JAH_StatusMenuCore_ResistEntry.prototype.categorizePercentValue = function(val) {
  1620.  
  1621.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.ResistanceCategories; i++)
  1622.     {
  1623.         if(val >= JahwsUF.StatusMenuCore.Param.ResistanceThresholds[i])
  1624.         {
  1625.             return i;
  1626.         }
  1627.     }
  1628.  
  1629.     return 7;
  1630. }
  1631.  
  1632. JAH_StatusMenuCore_ResistEntry.prototype.draw = function(window, x, y) {
  1633.  
  1634.     if(!this._name) this.initName();
  1635.  
  1636.     window.changeTextColor(window.systemColor());
  1637.     window.drawText(this._name, x, y, this._txtWidth);
  1638.     window.resetTextColor();
  1639.  
  1640.     var value = eval(this._eval);
  1641.     var categoryIndex = this.categorizePercentValue(value);
  1642.  
  1643.     if(this._asPercent)
  1644.     {
  1645.         value = Math.round(value * 100) + "%";
  1646.     }
  1647.     else
  1648.     {
  1649.         // Resistance categorization.
  1650.         value = JahwsUF.StatusMenuCore.Param.ResistanceLabels[categoryIndex];
  1651.     }
  1652.  
  1653.     // Check color details too!
  1654.     var color = JahwsUF.StatusMenuCore.Param.ResistanceColors[categoryIndex];
  1655.  
  1656.     // Initialization automatically undefines all colors if they're not to be used.
  1657.     if(color != undefined)
  1658.     {
  1659.         if(JahwsUF.StatusMenuCore.Param.ResistanceSysColors[categoryIndex] == false)
  1660.             window.changeTextColor(color);  // We interpreted a hex color.
  1661.         else window.changeTextColor(window.textColor(color));
  1662.     }
  1663.  
  1664.     window.drawText(value, x + this._txtWidth, y, this._valWidth, this._align);
  1665.     window.resetTextColor();
  1666. };
  1667.  
  1668. function JAH_StatusMenuCore_EnhancedPortrait() {
  1669.     this.initialize.apply(this, arguments);
  1670. }
  1671.  
  1672. JAH_StatusMenuCore_EnhancedPortrait.prototype.constructor = JAH_StatusMenuCore_EnhancedPortrait;
  1673.  
  1674. JAH_StatusMenuCore_EnhancedPortrait.prototype.initialize = function(imageName, switchID, scale, offset, padding) {
  1675.     this.Portrait = imageName;
  1676.     this.Switch = switchID;
  1677.     this.Scale = scale;
  1678.     this.Offset = offset;
  1679.     this.BorderAdjustment = padding;
  1680. };
  1681.  
  1682.  //=============== START PARAMETER INITIALIZATION ===========================
  1683.  
  1684. JahwsUF.StatusMenuCore = JahwsUF.StatusMenuCore || {};
  1685.  
  1686. JahwsUF.StatusMenuCore.Parameters = PluginManager.parameters('JAH_StatusMenuCore');
  1687.  
  1688. JahwsUF.StatusMenuCore.Param = JahwsUF.StatusMenuCore.Param || {};
  1689.  
  1690. // For extra parameter pages - a plugin extension.
  1691. // Each parameter page will store its data in the array under its own page ID.
  1692. // The page will be constructed from a base window class that takes in the ID,
  1693. // making the copied code in the extension absolutely minimal.
  1694.  
  1695. JahwsUF.StatusMenuCore.Param.ParamPages           = [];
  1696. JahwsUF.StatusMenuCore.Param.ParamPages[0]        = {};
  1697.  
  1698. // Column data is implied with the data storage pattern here.
  1699. JahwsUF.StatusMenuCore.Param.ParamPages[0].Columns       = [];
  1700.  
  1701. // JahwsUF.StatusMenuCore.Param.ParamPages[0].Columns[i].TextWidth
  1702. // JahwsUF.StatusMenuCore.Param.ParamPages[0].Columns[i].ValueWidth
  1703. // JahwsUF.StatusMenuCore.Param.ParamPages[0].Columns[i].Entries = [];  // Entries will contain special organization objects!
  1704. // JahwsUF.StatusMenuCore.Param.ParamPages[0].DisplayEquips
  1705.  
  1706. JahwsUF.StatusMenuCore.Param.PageNames            = [];
  1707. JahwsUF.StatusMenuCore.Param.PageWindows          = [];
  1708.  
  1709. JahwsUF.StatusMenuCore.Param.ResistanceColors     = [];
  1710. JahwsUF.StatusMenuCore.Param.ResistanceSysColors  = [];
  1711. JahwsUF.StatusMenuCore.Param.ResistanceLabels     = [];
  1712. JahwsUF.StatusMenuCore.Param.ResistanceThresholds = [];
  1713.  
  1714. JahwsUF.StatusMenuCore.Param.EleResistsInColumn   = [];
  1715. JahwsUF.StatusMenuCore.Param.StateResistsInColumn = [];
  1716.  
  1717. JahwsUF.StatusMenuCore.Param.Portraits            = [];
  1718. // JahwsUF.StatusMenuCore.Param.PortraitScales       = [];
  1719. JahwsUF.StatusMenuCore.Param.ExtendedProfiles     = [];
  1720. JahwsUF.StatusMenuCore.Param.SwitchedProfiles     = [];
  1721. // JahwsUF.StatusMenuCore.Param.PortraitOffsets      = [];
  1722. // JahwsUF.StatusMenuCore.Param.PortraitAdjusts      = [];
  1723.  
  1724. JahwsUF.StatusMenuCore.Param.ResistanceCategories = 8; // Too lazy to parameterize this at the moment.
  1725.  
  1726. // Keep all local variables in here as purely local.
  1727. // Used to obtain and initialize all plugin parameters.
  1728. (function() {
  1729.  
  1730. // For the core plugin, the page ID is automatically set, rather than read from the plugin.
  1731.  
  1732. var paramPageId = 0;
  1733.  
  1734. // Read in page specification data.
  1735.  
  1736. var totalPages = 0;
  1737.  
  1738. for (var i = 1; i <= 6; i++) {
  1739.   var line = "JahwsUF.StatusMenuCore.Parameters['Page " + i + " Name']";
  1740.   var name = eval(line);
  1741.   line = "JahwsUF.StatusMenuCore.Parameters['Page " + i + " Window']";
  1742.   var page = eval(line);
  1743.  
  1744.   if(!(name == undefined || page == undefined || name == '' || page == ''))
  1745.   {
  1746.     JahwsUF.StatusMenuCore.Param.PageNames[totalPages] = name;
  1747.     JahwsUF.StatusMenuCore.Param.PageWindows[totalPages] = page;
  1748.  
  1749.     totalPages++;
  1750.   }
  1751. }
  1752.  
  1753. JahwsUF.StatusMenuCore.Param.TotalPages = totalPages;
  1754.  
  1755. // Param column formatting data.
  1756.  
  1757. var colCount = 1;
  1758. var column = {};
  1759.  
  1760. var totalColumnWidths = 0;
  1761.  
  1762. for (var i = 1; i <= 3; i++)
  1763. {
  1764.     var line = "Number(JahwsUF.StatusMenuCore.Parameters['Column " + i + " Height'])";
  1765.     var count = eval(line);
  1766.  
  1767.     if(count == '' || count == undefined || isNaN(count))
  1768.     {
  1769.         if(i == 1) count = 8;
  1770.         else count = 0;
  1771.     }
  1772.  
  1773.     line = "Number(JahwsUF.StatusMenuCore.Parameters['Column " + i + " Text Width'])";
  1774.     var textWidth = eval(line);
  1775.  
  1776.     if(textWidth == '' || textWidth == undefined || isNaN(textWidth))
  1777.     {
  1778.         textWidth = 160;
  1779.     }
  1780.  
  1781.     line = "Number(JahwsUF.StatusMenuCore.Parameters['Column " + i + " Value Width'])";
  1782.     var valWidth = eval(line);
  1783.  
  1784.     if(valWidth == '' || valWidth == undefined || isNaN(valWidth))
  1785.     {
  1786.         valWidth = 60;
  1787.     }
  1788.  
  1789.     column.Size = count;
  1790.     column.TextWidth = textWidth;
  1791.     column.ValueWidth = valWidth;
  1792.  
  1793.     if(count == 0)
  1794.     {
  1795.         break;
  1796.     }
  1797.     else
  1798.     {
  1799.         JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].Columns[i-1] = column;
  1800.         column = {};
  1801.  
  1802.         colCount = i;
  1803.         totalColumnWidths += textWidth + valWidth;
  1804.     }
  1805. }
  1806.  
  1807. // Display equipment options.
  1808.  
  1809. JahwsUF.StatusMenuCore.Param.DisplayEquips = JahwsUF.StatusMenuCore.Parameters['Display Equips?'];
  1810. JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].DisplayEquips = JahwsUF.StatusMenuCore.Parameters['Display Equips?'];
  1811.  
  1812. var equipWidth = Number(JahwsUF.StatusMenuCore.Parameters['Equip Column Width']);
  1813.  
  1814.     if(equipWidth == '' || equipWidth == undefined || isNaN(equipWidth))
  1815.     {
  1816.         equipWidth = 320;
  1817.     }
  1818.  
  1819. JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].EquipColumnWidth = equipWidth;
  1820. JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].RequiredColumnWidth = totalColumnWidths;
  1821.  
  1822. // Resistance alignment formatting data (needs to be passed into the param page entries.)
  1823.  
  1824. JahwsUF.StatusMenuCore.Param.CenterEleValues   = eval(JahwsUF.StatusMenuCore.Parameters['Center Ele. Values']);
  1825. JahwsUF.StatusMenuCore.Param.CenterStateValues = eval(JahwsUF.StatusMenuCore.Parameters['Center State Values']);
  1826.  
  1827. JahwsUF.StatusMenuCore.Param.CenterEleValues   = JahwsUF.StatusMenuCore.Param.CenterEleValues || false;
  1828. JahwsUF.StatusMenuCore.Param.CenterStateValues = JahwsUF.StatusMenuCore.Param.CenterStateValues || false;
  1829.  
  1830. // Read in parameter specification data.
  1831.  
  1832. var totalParams = 0;
  1833. var columnPlacement = 0;
  1834. var rowPlacement = 0;
  1835.  
  1836. var i = 1;
  1837.  
  1838. for (var columnPlacement = 0; columnPlacement < JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].Columns.length; columnPlacement++) {
  1839.  
  1840.     var currentColumn = JahwsUF.StatusMenuCore.Param.ParamPages[paramPageId].Columns[columnPlacement];
  1841.     currentColumn.Entries = [];
  1842.  
  1843.     for (var rowPlacement = 0; rowPlacement < currentColumn.Size; rowPlacement++) {
  1844.  
  1845.         var line = "JahwsUF.StatusMenuCore.Parameters['Parameter " + i + " Symbol']";
  1846.         var symbol = eval(line);
  1847.         line = "JahwsUF.StatusMenuCore.Parameters['Parameter " + i + " Name']";
  1848.         var name = eval(line);
  1849.         line = "JahwsUF.StatusMenuCore.Parameters['Parameter " + i + " as %']";
  1850.         var percent = eval(eval(line));
  1851.  
  1852.         // Undefined = blank space on the parameter page.
  1853.         if(symbol == '')
  1854.             symbol = undefined;
  1855.  
  1856.         if(!(symbol == undefined))
  1857.         {
  1858.             if(symbol.trim() == "")
  1859.                 symbol = undefined;
  1860.         }
  1861.  
  1862.         if(symbol)
  1863.         {
  1864.             if(symbol.indexOf("elementRate") != -1)
  1865.             {
  1866.                 currentColumn.Entries[rowPlacement] = new JAH_StatusMenuCore_ResistEntry(symbol, name, percent, currentColumn.TextWidth, currentColumn.ValueWidth, JahwsUF.StatusMenuCore.Param.CenterEleValues ? 'center' : 'right');
  1867.             }
  1868.             else if(symbol.indexOf("stateRate") != -1)
  1869.             {
  1870.                 currentColumn.Entries[rowPlacement] = new JAH_StatusMenuCore_ResistEntry(symbol, name, percent, currentColumn.TextWidth, currentColumn.ValueWidth, JahwsUF.StatusMenuCore.Param.CenterStateValues ? 'center' : 'right');
  1871.             }
  1872.             else
  1873.             {
  1874.                 if(percent == undefined)
  1875.                     percent = true;
  1876.  
  1877.                 currentColumn.Entries[rowPlacement] = new JAH_StatusMenuCore_ParamEntry(symbol, name, percent, currentColumn.TextWidth, currentColumn.ValueWidth);
  1878.             }
  1879.         }
  1880.  
  1881.         totalParams++;
  1882.         i++;
  1883.     }
  1884. }
  1885.  
  1886. JahwsUF.StatusMenuCore.Param.TotalParams = totalParams;
  1887.  
  1888. // Elemental resistances page option.
  1889.  
  1890. var resistanceColumnCount = 1;
  1891.  
  1892. for (var i = 1; i <= 3; i++)
  1893. {
  1894.     var line = "Number(JahwsUF.StatusMenuCore.Parameters['Column " + i + " Elements'])";
  1895.  
  1896.     var eles = eval(line);
  1897.     JahwsUF.StatusMenuCore.Param.EleResistsInColumn[i-1] = eles;
  1898.  
  1899.     if(eles == 0 || eles == '' || isNaN(eles))
  1900.     {
  1901.         break;
  1902.     }
  1903.     else
  1904.     {
  1905.         resistanceColumnCount = i;
  1906.     }
  1907. }
  1908.  
  1909. JahwsUF.StatusMenuCore.Param.EleResistsColumnCount = resistanceColumnCount;
  1910.  
  1911. var elementsToOmit = eval("[" + JahwsUF.StatusMenuCore.Parameters['Hidden Elements'] + "]");
  1912.  
  1913. if(elementsToOmit == undefined)
  1914. {
  1915.     elementsToOmit = [];
  1916. }
  1917.  
  1918. JahwsUF.StatusMenuCore.Param.EleResistsToHide = elementsToOmit;
  1919.  
  1920. JahwsUF.StatusMenuCore.Param.EleResistsHeader = JahwsUF.StatusMenuCore.Parameters['Ele. Resist Header'];
  1921.  
  1922. var displayPercents = eval(JahwsUF.StatusMenuCore.Parameters['Display Ele. Percent']);
  1923. if(displayPercents == undefined) displayPercents = true;
  1924. JahwsUF.StatusMenuCore.Param.DisplayElePercents = displayPercents;
  1925.  
  1926. // -----------------------------
  1927.  
  1928. // State resistances page option.
  1929.  
  1930. resistanceColumnCount = 1;
  1931.  
  1932. for (var i = 1; i <= 3; i++)
  1933. {
  1934.     var line = "Number(JahwsUF.StatusMenuCore.Parameters['Column " + i + " States'])";
  1935.  
  1936.     var state = eval(line);
  1937.     JahwsUF.StatusMenuCore.Param.StateResistsInColumn[i-1] = state;
  1938.  
  1939.     if(state == 0 || state == '' || isNaN(state))
  1940.     {
  1941.         break;
  1942.     }
  1943.     else
  1944.     {
  1945.         resistanceColumnCount = i;
  1946.     }
  1947. }
  1948.  
  1949. JahwsUF.StatusMenuCore.Param.StateResistsColumnCount = resistanceColumnCount;
  1950.  
  1951. var statesToOmit = eval("[" + JahwsUF.StatusMenuCore.Parameters['Hidden States'] + "]");
  1952.  
  1953. if(statesToOmit == undefined)
  1954. {
  1955.     statesToOmit = [];
  1956. }
  1957.  
  1958. JahwsUF.StatusMenuCore.Param.StateResistsToHide = statesToOmit;
  1959.  
  1960. JahwsUF.StatusMenuCore.Param.StateResistsHeader = JahwsUF.StatusMenuCore.Parameters['State Resist Header'];
  1961.  
  1962. var displayStatePercents = eval(JahwsUF.StatusMenuCore.Parameters['Display State Percent']);
  1963. if(displayStatePercents == undefined) displayStatePercents = true;
  1964. JahwsUF.StatusMenuCore.Param.DisplayStatePercents = displayStatePercents;
  1965.  
  1966. // Resistance classification data loading
  1967.  
  1968. var useColors = eval(JahwsUF.StatusMenuCore.Parameters['Use Color']);
  1969. if(useColors == undefined) useColors = true;
  1970. JahwsUF.StatusMenuCore.Param.ResistancesInColor = useColors;
  1971.  
  1972. for (var i = 1; i <= 8; i++)
  1973. {
  1974.     var line = "JahwsUF.StatusMenuCore.Parameters['Category " + i + " Color']";
  1975.     var colorID = eval(line);
  1976.  
  1977.     if(colorID == undefined) colorID = "";
  1978.  
  1979.     if(colorID.trim() == "")
  1980.         colorID = undefined;
  1981.  
  1982.     var sysColor = true;
  1983.  
  1984.     if(useColors == false || colorID == undefined)
  1985.         colorID = undefined;
  1986.     else {
  1987.         if(colorID.indexOf("0x") != -1)
  1988.         {
  1989.             sysColor = false;
  1990.             colorID = "#" + colorID.substring(colorID.indexOf("0x") + 2);
  1991.         }
  1992.         else if(colorID.indexOf("#") != -1)
  1993.         {
  1994.             sysColor = false;
  1995.         }
  1996.         else colorID = Number(colorID);
  1997.     }
  1998.  
  1999.     line = "JahwsUF.StatusMenuCore.Parameters['Category " + i + " Text']";
  2000.     var text = eval(line);
  2001.  
  2002.     line = "Number(JahwsUF.StatusMenuCore.Parameters['Threshold " + i + "'])";
  2003.     var percent = eval(line);
  2004.  
  2005.     JahwsUF.StatusMenuCore.Param.ResistanceLabels[i-1] = text;
  2006.     JahwsUF.StatusMenuCore.Param.ResistanceColors[i-1] = colorID;
  2007.     JahwsUF.StatusMenuCore.Param.ResistanceSysColors[i-1] = sysColor;
  2008.     JahwsUF.StatusMenuCore.Param.ResistanceThresholds[i-1] = percent / 100.0;
  2009. }
  2010.  
  2011.  
  2012. // Other parameters
  2013.  
  2014. var colorID = JahwsUF.StatusMenuCore.Parameters['Color: XP Gauge 1'];
  2015. if(colorID == undefined) colorID = 30;
  2016. JahwsUF.StatusMenuCore.Param.ColorXpGauge1 = colorID;
  2017.  
  2018. var colorID = JahwsUF.StatusMenuCore.Parameters['Color: XP Gauge 2'];
  2019. if(colorID == undefined) colorID = 31;
  2020. JahwsUF.StatusMenuCore.Param.ColorXpGauge2 = colorID;
  2021.  
  2022. var hideXP = eval(JahwsUF.StatusMenuCore.Parameters['Hide XP Bar']);
  2023. if(hideXP == undefined) hideXP = false;
  2024. JahwsUF.StatusMenuCore.Param.XpHidden = hideXP;
  2025.  
  2026. var hideLv = eval(JahwsUF.StatusMenuCore.Parameters['Hide Levels']);
  2027. if(hideLv == undefined) hideLv = false;
  2028. JahwsUF.StatusMenuCore.Param.LvHidden = hideLv;
  2029.  
  2030. var xpDisplayMode = eval(JahwsUF.StatusMenuCore.Parameters['XP - Show Remaining']);
  2031. if(xpDisplayMode == undefined) xpDisplayMode = false;
  2032. JahwsUF.StatusMenuCore.Param.XpDisplayOnlyRemaining = xpDisplayMode;
  2033.  
  2034. var nicknameSetting = eval(JahwsUF.StatusMenuCore.Parameters['Header - Name + Nick']);
  2035. if(nicknameSetting == undefined) nicknameSetting = true;
  2036. JahwsUF.StatusMenuCore.Param.NicknameInHeaders = nicknameSetting;
  2037.  
  2038. var nicknameFormat = JahwsUF.StatusMenuCore.Parameters['Nickname Format'];
  2039. if(nicknameFormat == undefined) nicknameSetting = "";
  2040. JahwsUF.StatusMenuCore.Param.NicknameFormat = nicknameFormat;
  2041.  
  2042. var scrollFactor = eval(JahwsUF.StatusMenuCore.Parameters['Scroll Multiplier']);
  2043. if(scrollFactor == undefined) scrollFactor = 1;
  2044. JahwsUF.StatusMenuCore.Param.ScrollFactor = scrollFactor;
  2045.  
  2046. var imgBuffer = Number(JahwsUF.StatusMenuCore.Parameters['Portrait Img Adjust']);
  2047. if(imgBuffer == undefined) imgBuffer = 0;
  2048. JahwsUF.StatusMenuCore.Param.ImgBuffer = imgBuffer;
  2049.  
  2050. var portraitsAll = eval(JahwsUF.StatusMenuCore.Parameters['Portraits On All']);
  2051. if(portraitsAll == undefined) portraitsAll = true;
  2052. JahwsUF.StatusMenuCore.Param.DefaultPortrait = portraitsAll;
  2053.  
  2054. var headerScrolling = eval(JahwsUF.StatusMenuCore.Parameters['Scrolling Headers']);
  2055. if(headerScrolling == undefined) headerScrolling = true;
  2056. JahwsUF.StatusMenuCore.Param.HeaderScrolling = headerScrolling;
  2057.  
  2058. var tpDisplay = JahwsUF.StatusMenuCore.Parameters['Add TP Gauge'];
  2059.  
  2060. if (tpDisplay == undefined)
  2061.     tpDisplay = "";
  2062.  
  2063. if(tpDisplay.trim() == "" && Imported.YEP_CoreEngine)
  2064. {
  2065.     tpDisplay = eval(Yanfly.Param.MenuTpGauge);
  2066. }
  2067. else
  2068. {
  2069.     tpDisplay = eval(tpDisplay);
  2070.  
  2071.     if(tpDisplay == undefined) tpDisplay = false;
  2072. }
  2073.  
  2074. JahwsUF.StatusMenuCore.Param.TpGauge = tpDisplay;
  2075.  
  2076. var blankAfterTP = eval(JahwsUF.StatusMenuCore.Parameters['Blank after TP']);
  2077. if(blankAfterTP == undefined) blankAfterTP = true;
  2078. JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank = blankAfterTP && tpDisplay;
  2079.  
  2080.  
  2081. }());
  2082.  
  2083.  
  2084.  
  2085.  
  2086. //=============================================================================
  2087. // DataManager
  2088. //=============================================================================
  2089.  
  2090. JahwsUF.StatusMenuCore.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  2091. DataManager.isDatabaseLoaded = function() {
  2092.     if (!JahwsUF.StatusMenuCore.DataManager_isDatabaseLoaded.call(this)) return false;
  2093.         this.processActorNotetags($dataActors);
  2094.         return true;
  2095. };
  2096.  
  2097. // It's not a method that exists in the base RPG Maker, but it's still wise to back up any older
  2098. // versions of this method.
  2099. JahwsUF.StatusMenuCore.DataManager_processActorNotetags = DataManager.processActorNotetags;
  2100.  
  2101. DataManager.processActorNotetags = function(group) {
  2102.  
  2103.     if(!!JahwsUF.StatusMenuCore.DataManager_processActorNotetags)
  2104.     {
  2105.         JahwsUF.StatusMenuCore.DataManager_processActorNotetags.call(this, group);
  2106.     }
  2107.  
  2108.     // Stage 1 - analyze all baseline content.
  2109.  
  2110.     var profileStart = /<(?:PROFILE)>/i;
  2111.     var profileEnd = /<\/(?:PROFILE)>/i;
  2112.  
  2113.     var switchedProfileStart = /<(?:PROFILE SWITCH):[ ]*(\d+)>/i;
  2114.     var switchedProfileEnd = /<\/(?:PROFILE SWITCH)>/i;
  2115.  
  2116.     var offsetMatcher = /<(?:PORTRAIT OFFSET):[ ]*(\d+)\s*,\s*(\d+)>/i;
  2117.     var adjustMatcher = /<(?:PORTRAIT ANTI-BUFFER):[ ]*(-?\d+)>/i;
  2118.  
  2119.     for (var n = 1; n < group.length; n++) {
  2120.         var obj = group[n];
  2121.  
  2122.         var profile = "";
  2123.         var profileSpec = false;
  2124.         var profileSwitch = undefined;
  2125.  
  2126.         // Set default value.
  2127.         JahwsUF.StatusMenuCore.Param.SwitchedProfiles[n] = [];
  2128.  
  2129.         // Base portrait parameters.
  2130.  
  2131.         var portrait = undefined;
  2132.         var DefaultScale = 1;
  2133.         var DefaultOffset = [0, 0];
  2134.         var DefaultAdjust = 0;
  2135.  
  2136.         var notedata = obj.note.split(/\r?\n/);
  2137.  
  2138.         for (var i = 0; i < notedata.length; i++) {
  2139.  
  2140.             var line = notedata[i];
  2141.             if (line.match(/<(?:PORTRAIT):[ ]([\w\s]+)>/i)) {
  2142.                 portrait = RegExp.$1;
  2143.                 if (portrait == '') portrait = undefined;
  2144.                 else ImageManager.loadPicture(portrait);  // Pre-load it!  Otherwise, the first attempt to do so later will fail.
  2145.             }
  2146.             else if (line.match(/<(?:PORTRAIT SCALE):[ ]*(\d+.?\d+)>/i)) {
  2147.                 DefaultScale = parseFloat(RegExp.$1);
  2148.                 if (DefaultScale < 0) DefaultScale = 0;
  2149.             } else if (line.match(offsetMatcher)) {
  2150.                 DefaultOffset = [parseInt(RegExp.$1), parseInt(RegExp.$2)];
  2151.             } else if (line.match(adjustMatcher)) {
  2152.                 DefaultAdjust = parseInt(RegExp.$1);
  2153.             } else if (line.match(profileStart)) {
  2154.                 profileSpec = true;
  2155.                 profile = "";
  2156.                 profileSwitch = undefined;
  2157.             } else if (line.match(switchedProfileStart)){
  2158.                 profileSpec = true;
  2159.                 profile = "";
  2160.                 profileSwitch = parseInt(RegExp.$1);
  2161.             } else if (line.match(profileEnd) || line.match(switchedProfileEnd)) {
  2162.                 if(profileSwitch == undefined)
  2163.                     JahwsUF.StatusMenuCore.Param.ExtendedProfiles[n] = profile;
  2164.                 else
  2165.                 {
  2166.                     JahwsUF.StatusMenuCore.Param.SwitchedProfiles[n].push([profileSwitch, profile]);
  2167.                 }
  2168.  
  2169.                 profileSpec = false;
  2170.             } else if (profileSpec) {
  2171.                 if(profile != "")
  2172.                     profile += "\n";
  2173.                 profile += line;
  2174.             }
  2175.         }
  2176.  
  2177.         // This sets the character's base portrait for this actor.
  2178.         JahwsUF.StatusMenuCore.Param.Portraits[n] = [];
  2179.         JahwsUF.StatusMenuCore.Param.Portraits[n][0]
  2180.             = new JAH_StatusMenuCore_EnhancedPortrait(portrait, 0, DefaultScale, DefaultOffset, DefaultAdjust);
  2181.     }
  2182.  
  2183.     // Stage 2 - now that default parameters for Actor portraits are in place, we
  2184.     // read in all switched profiles.
  2185.  
  2186.     // New format:   <portrait "filename" switch: s scale: z offset: x, y antibuffer: b>
  2187.  
  2188.     // The below ought be safe - ':' is not a legal character in filenames.
  2189.  
  2190.     var portraitDetector = /<(?:PORTRAIT) \s*\"(.+?)\".+>/i;
  2191.     var offsetMatcher = /(?:OFFSET):[ ]*(\d+)\s*,\s*(\d+)/i;
  2192.     var adjustMatcher = /(?:ANTI-BUFFER):[ ]*(-?\d+)/i;
  2193.     var switchMatcher = /(?:SWITCH):[ ]*(\d+)\s*/i;
  2194.     var scaleMatcher  = /(?:SCALE):[ ]*(\d+.?\d+)/i
  2195.  
  2196.     for (var n = 1; n < group.length; n++) {
  2197.         var obj = group[n];
  2198.  
  2199.         var profile = "";
  2200.         var profileSpec = false;
  2201.         var profileSwitch = undefined;
  2202.  
  2203.         // Assimilate the original portrait data here.
  2204.         var DefaultScale = JahwsUF.StatusMenuCore.Param.Portraits[n][0].Scale;
  2205.         var DefaultOffset = JahwsUF.StatusMenuCore.Param.Portraits[n][0].Offset;
  2206.         var DefaultAdjust = JahwsUF.StatusMenuCore.Param.Portraits[n][0].BorderAdjustment;
  2207.  
  2208.         var notedata = obj.note.split(/\r?\n/);
  2209.  
  2210.         for (var i = 0; i < notedata.length; i++) {
  2211.  
  2212.             var line = notedata[i];
  2213.             if (line.match(portraitDetector)) {
  2214.                 var portrait = RegExp.$1;
  2215.  
  2216.                 if (portrait == '') portrait = undefined;
  2217.                 else ImageManager.loadPicture(portrait);  // Pre-load it!  Otherwise, the first attempt to do so later will fail.
  2218.  
  2219.                 // Now to read in the parameters.
  2220.  
  2221.                 var switchID = -1;
  2222.                 var scale  = DefaultScale;
  2223.                 var offset = DefaultOffset;
  2224.                 var adjust = DefaultAdjust;
  2225.  
  2226.                 if (line.match(switchMatcher)) {
  2227.                     switchID = parseInt(RegExp.$1);
  2228.                 }
  2229.  
  2230.                 if (line.match(scaleMatcher)) {
  2231.                     scale = parseFloat(RegExp.$1);
  2232.                     if (scale < 0) scale = 0;
  2233.                 }
  2234.  
  2235.                 if (line.match(offsetMatcher)) {
  2236.                     offset = [parseInt(RegExp.$1), parseInt(RegExp.$2)];
  2237.                 }
  2238.  
  2239.                 if (line.match(adjustMatcher)) {
  2240.                     adjust = parseInt(RegExp.$1);
  2241.                 }
  2242.  
  2243.                 if(switchID == 0)
  2244.                 {
  2245.                     JahwsUF.StatusMenuCore.Param.Portraits[n][0] = new JAH_StatusMenuCore_EnhancedPortrait(portrait, switchID, scale, offset, adjust);
  2246.                 }
  2247.                 else JahwsUF.StatusMenuCore.Param.Portraits[n].push(new JAH_StatusMenuCore_EnhancedPortrait(portrait, switchID, scale, offset, adjust));
  2248.             }
  2249.         }
  2250.     }
  2251. };
  2252.  
  2253. //================== END PARAMETER INITIALIZATION ===========================
  2254.  
  2255.  
  2256. //-----------------------------------------------------------------------------
  2257. // Window_Base
  2258. //
  2259. // A few extra methods/extensions for windows.
  2260.  
  2261. // It maps to Window.png, final row, last two colors.  A nice purple gradient by default.
  2262. Window_Base.prototype.xpGaugeColor1 = function() {
  2263.     return this.textColor(JahwsUF.StatusMenuCore.Param.ColorXpGauge1);
  2264. };
  2265.  
  2266. Window_Base.prototype.xpGaugeColor2 = function() {
  2267.     return this.textColor(JahwsUF.StatusMenuCore.Param.ColorXpGauge2);
  2268. };
  2269.  
  2270. Window_Base.prototype.xpColor = function(actor) {
  2271.     return this.normalColor();
  2272. };
  2273.  
  2274. Window_Base.prototype.drawActorXp = function(actor, x, y, width, hideNextLv) {
  2275.     width = width || 186;  // default value = 186.
  2276.     var color1 = this.xpGaugeColor1();
  2277.     var color2 = this.xpGaugeColor2();
  2278.  
  2279.     // Compute ratio and format appropriate values.
  2280.  
  2281.     var value1 = this._actor.currentExp() - this._actor.currentLevelExp();
  2282.     var value2 = this._actor.nextRequiredExp() + value1;
  2283.  
  2284.     var xpRate = value1 / value2;
  2285.  
  2286.     if (this._actor.isMaxLevel()) {
  2287.         value1 = 0;
  2288.         value2 = 0;
  2289.         xpRate = 1;
  2290.     }
  2291.  
  2292.     var value3 = value2 - value1;
  2293.  
  2294.     // Only attempt this if YEP_CoreEngine is loaded; the digit-grouping function is defined there.
  2295.     if(Imported.YEP_CoreEngine)
  2296.     {
  2297.         value1 = Yanfly.Util.toGroup(value1);
  2298.         value2 = Yanfly.Util.toGroup(value2);
  2299.         value3 = Yanfly.Util.toGroup(value3);
  2300.     }
  2301.  
  2302.     // Draw the gauge itself...
  2303.     this.drawGauge(x, y, width, xpRate, color1, color2);  // Should link to Yanfly's correctly.
  2304.     this.changeTextColor(this.systemColor());
  2305.  
  2306.     // Now for the text.  The FUN part.
  2307.     var spaceWidth = this.textWidth(" ");
  2308.     var expLabelWidth = this.textWidth(TextManager.expA);
  2309.  
  2310.     var expNext = TextManager.expNext.format(TextManager.levelA);
  2311.     var nextLvWidth = this.textWidth(expNext);
  2312.  
  2313.     this.drawText(TextManager.expA, x + width - expLabelWidth, y, expLabelWidth, 'right');
  2314.  
  2315.     if(!hideNextLv)
  2316.         this.drawText(expNext, x, y, nextLvWidth);
  2317.  
  2318.     if(JahwsUF.StatusMenuCore.Param.XpDisplayOnlyRemaining)
  2319.         this.drawExpRemaining(value3, x, y, width - expLabelWidth - spaceWidth, this.xpColor(actor));
  2320.     else
  2321.         this.drawExpCurrentAndMax(value1, value2, x, y, width - expLabelWidth - spaceWidth,
  2322.                            this.xpColor(actor), this.normalColor());
  2323. };
  2324.  
  2325. Window_Base.prototype.drawExpRemaining = function(current, x, y, width, color) {
  2326.     this.changeTextColor(color);
  2327.     this.drawText(current, x, y, width, 'right');
  2328. };
  2329.  
  2330. Window_Base.prototype.drawExpCurrentAndMax = function(current, max, x, y,
  2331.                                                    width, color1, color2) {
  2332.     var labelWidth = this.textWidth('EXP');
  2333.     var valueWidth = Math.max(this.textWidth('0000'), this.textWidth(max));  // Expands for more digits when necessary.
  2334.     var slashWidth = this.textWidth('/');
  2335.     var x1 = x + width - valueWidth;
  2336.     var x2 = x1 - slashWidth;
  2337.     var x3 = x2 - valueWidth;
  2338.  
  2339.     var fontSizeChange = 0;
  2340.  
  2341.     //Dynamic resizing if things get too cramped for the values.
  2342.     while(x3 < x + labelWidth)
  2343.     {
  2344.         fontSizeChange += 4;
  2345.         this.contents.fontSize -= 4;
  2346.  
  2347.         valueWidth = Math.max(this.textWidth('0000'), this.textWidth(max));
  2348.         slashWidth = this.textWidth('/');
  2349.         x1 = x + width - valueWidth;
  2350.         x2 = x1 - slashWidth;
  2351.         x3 = x2 - valueWidth;
  2352.     }
  2353.  
  2354.     this.changeTextColor(color1);
  2355.     this.drawText(current, x3, y, valueWidth, 'right');
  2356.     this.changeTextColor(color2);
  2357.     this.drawText('/', x2, y, slashWidth, 'right');
  2358.     this.drawText(max, x1, y, valueWidth, 'right');
  2359.  
  2360.     this.contents.fontSize += fontSizeChange;
  2361. };
  2362.  
  2363.  
  2364.  
  2365. //-----------------------------------------------------------------------------
  2366. // Scene_Status
  2367. //
  2368. // The scene class of the status screen.  Based upon the original status screen,
  2369. // replacing it.
  2370.  
  2371. function Scene_Status() {
  2372.     this.initialize.apply(this, arguments);
  2373. }
  2374.  
  2375. Scene_Status.prototype = Object.create(Scene_MenuBase.prototype);
  2376. Scene_Status.prototype.constructor = Scene_Status;
  2377.  
  2378. Scene_Status.prototype.initialize = function() {
  2379.     Scene_MenuBase.prototype.initialize.call(this);
  2380. };
  2381.  
  2382. Scene_Status.prototype.create = function() {
  2383.     Scene_MenuBase.prototype.create.call(this);
  2384.  
  2385.     // Create the various status subwindows, pass them off to the pageMenuWindow.
  2386.     // It'll control which of them shows at any given point.
  2387.  
  2388.     // These two arrays track all needed data.
  2389.     // I'd use a Map, but apparently they're not supported well on mobile devices.  :(
  2390.     this._pageNames = [];
  2391.     this._pageWindows = [];
  2392.  
  2393.     // Each page is actually a window.
  2394.     // Now that we've got this structure in place, this could be parameterized on a plugin level!
  2395.  
  2396.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.TotalPages; i++)
  2397.     {
  2398.         var page = eval("new " + JahwsUF.StatusMenuCore.Param.PageWindows[i] + "()");
  2399.         this.addWindow(page);
  2400.  
  2401.         if(i != 0) page.hide(); // Page 0 shows by default.
  2402.  
  2403.         this._pageNames.push(JahwsUF.StatusMenuCore.Param.PageNames[i]);
  2404.         this._pageWindows.push(page);
  2405.     }
  2406.  
  2407.     // Now to initialize the core control window.
  2408.     this._statusWindow = new JAH_Window_Status_PageSelect(this._pageNames, this._pageWindows);
  2409.     this._statusWindow.setHandler('cancel',   this.popScene.bind(this));
  2410.     this._statusWindow.setHandler('pagedown', this.nextActor.bind(this));
  2411.     this._statusWindow.setHandler('pageup',   this.previousActor.bind(this));
  2412.     this.addWindow(this._statusWindow);
  2413.  
  2414.     this.refreshActor();
  2415. };
  2416.  
  2417. Scene_Status.prototype.refreshActor = function() {
  2418.     var actor = this.actor();
  2419.  
  2420.     for (var page of this._pageWindows) {
  2421.         page.setActor(actor);
  2422.         page.refresh();
  2423.     }
  2424. };
  2425.  
  2426. Scene_Status.prototype.onActorChange = function() {
  2427.     Scene_MenuBase.prototype.onActorChange.call(this);
  2428.  
  2429.     for(var page of this._pageWindows)
  2430.     {
  2431.         page.setActor(this.actor());
  2432.     }
  2433.  
  2434.     this._statusWindow.activate();  // By default, the system will DEACTIVATE this window on page up or page down.
  2435. }
  2436.  
  2437.  
  2438.  
  2439. //-----------------------------------------------------------------------------
  2440. // JAH_Window_Status_PageSelect
  2441. //
  2442. // The Status menu window - allows selection of the Status page to be viewed.
  2443.  
  2444. function JAH_Window_Status_PageSelect() {
  2445.     this.initialize.apply(this, arguments);
  2446. }
  2447.  
  2448. JAH_Window_Status_PageSelect.prototype = Object.create(Window_HorzCommand.prototype);
  2449. JAH_Window_Status_PageSelect.prototype.constructor = JAH_Window_Status_PageSelect;
  2450.  
  2451. JAH_Window_Status_PageSelect.prototype.initialize = function(pageNames, pageWindows) {
  2452.  
  2453.     this._pageNames = pageNames;
  2454.     this._pageWindows = pageWindows;
  2455.  
  2456.     Window_HorzCommand.prototype.initialize.call(this, 0, 0);
  2457.     this.activate();
  2458.  
  2459.     this._activePage = this.currentSymbol();  // Tracks the previously-open window.
  2460. };
  2461.  
  2462. JAH_Window_Status_PageSelect.prototype.windowWidth = function() {
  2463.     return Graphics.boxWidth;
  2464. };
  2465.  
  2466. JAH_Window_Status_PageSelect.prototype.maxCols = function() {
  2467.     return this._pageNames.length;
  2468. };
  2469.  
  2470. JAH_Window_Status_PageSelect.prototype.update = function() {
  2471.  
  2472.     Window_HorzCommand.prototype.update.call(this);
  2473.  
  2474.     // Each "page" is actually a window.  We need to hide the old page and show the new one
  2475.     // upon any change in selected Status page option.
  2476.     this._activePage.hide();
  2477.     this._activePage = this.currentSymbol();
  2478.     this._activePage.show();
  2479.  
  2480. };
  2481.  
  2482. // Extended with wiring + linking for compatibility with other plugins, should they have
  2483. // a need to manually refresh the status windows.
  2484. JAH_Window_Status_PageSelect.prototype.refresh = function() {
  2485.  
  2486.     Window_HorzCommand.prototype.refresh.call(this);
  2487.  
  2488.     if(this._pageWindows)
  2489.     {
  2490.         for(var i=0; i < this._pageWindows.length; i++)
  2491.         {
  2492.             this._pageWindows[i].refresh();
  2493.         }
  2494.     }
  2495. };
  2496.  
  2497. JAH_Window_Status_PageSelect.prototype.makeCommandList = function() {
  2498.  
  2499.     // Dynamically constructs the menu given the setup command text and pre-made windows
  2500.     // from Scene_Status.
  2501.  
  2502.     for(var i=0; i < this._pageNames.length; i++)
  2503.     {
  2504.         this.addCommand(this._pageNames[i], this._pageWindows[i]);
  2505.     }
  2506. };
  2507.  
  2508. JAH_Window_Status_PageSelect.prototype.setPageWindow = function(pageWindow) {
  2509.     this._pageWindow = pageWindow;
  2510.     this.update();
  2511. };
  2512.  
  2513. JAH_Window_Status_PageSelect.prototype.isOkEnabled = function() {
  2514.     return false;
  2515. };
  2516.  
  2517. JAH_Window_Status_PageSelect.prototype.cursorUp = function(wrap) {
  2518.  
  2519.     Window_Selectable.prototype.cursorUp.call(this, wrap);
  2520.  
  2521.     //if(this._activePage instanceof JAH_Window_Status_Profile)
  2522.     //{
  2523.         for(var i = 0; i < JahwsUF.StatusMenuCore.Param.ScrollFactor; i++)
  2524.             this._activePage.scrollUp();
  2525.     //}
  2526. }
  2527.  
  2528. JAH_Window_Status_PageSelect.prototype.cursorDown = function(wrap) {
  2529.  
  2530.     Window_Selectable.prototype.cursorDown.call(this, wrap);
  2531.  
  2532.     //if(this._activePage instanceof JAH_Window_Status_Profile)
  2533.     //{
  2534.         for(var i = 0; i < JahwsUF.StatusMenuCore.Param.ScrollFactor; i++)
  2535.             this._activePage.scrollDown();
  2536.     //}
  2537. }
  2538.  
  2539.  
  2540.  
  2541. //-----------------------------------------------------------------------------
  2542. // JAH_Window_Status_Base
  2543. //
  2544. // Implements standard functionality needed for all Status pages.
  2545.  
  2546. function JAH_Window_Status_Base() {
  2547.     this.initialize.apply(this, arguments);
  2548. }
  2549.  
  2550. JAH_Window_Status_Base.prototype = Object.create(Window_Selectable.prototype);
  2551. JAH_Window_Status_Base.prototype.constructor = JAH_Window_Status_Base;
  2552.  
  2553. // the this.redraw variable is an experimental variable - if the windows are redrawn too often, it could help reduce the unnecessary redraws?
  2554.  
  2555. JAH_Window_Status_Base.prototype.initialize = function() {
  2556.  
  2557.     var lineHeight = this.lineHeight();
  2558.     var width = Graphics.boxWidth;
  2559.     //this.redraw = true;
  2560.  
  2561.     //  It turns out that lineHeight * 2 is exactly the space taken up by the Status page selection menu.
  2562.     var height = Graphics.boxHeight - lineHeight * 2;
  2563.     Window_Selectable.prototype.initialize.call(this, 0, lineHeight*2, width, height);
  2564.     this.refresh();
  2565. };
  2566.  
  2567. JAH_Window_Status_Base.prototype.scrollDown = function() {
  2568.     //this.redraw = true;
  2569.     Window_Selectable.prototype.scrollDown.call(this);
  2570. }
  2571.  
  2572. JAH_Window_Status_Base.prototype.scrollUp = function() {
  2573.     //this.redraw = true;
  2574.     Window_Selectable.prototype.scrollUp.call(this);
  2575. }
  2576.  
  2577. JAH_Window_Status_Base.prototype.setActor = function(actor) {
  2578.     if (this._actor !== actor) {
  2579.         this._actor = actor;
  2580.         //this.redraw = true;
  2581.  
  2582.         this.resetScroll(); // Always reset scrolling when changing Actor.
  2583.         this.refresh();
  2584.     }
  2585. };
  2586.  
  2587. JAH_Window_Status_Base.prototype.refresh = function() {
  2588.  
  2589.     //if(this.redraw == false) return;
  2590.     //redraw = false;
  2591.  
  2592.     this.contents.clear();
  2593.  
  2594.     if (this._actor) {
  2595.  
  2596.         var lineHeight = this.lineHeight();
  2597.  
  2598.         var lineIndex = 0;
  2599.  
  2600.         if(JahwsUF.StatusMenuCore.Param.HeaderScrolling == true)
  2601.             lineIndex -= this.topIndex();  // What is our scroll position?  We've gotta make adjustments based on this.
  2602.  
  2603.         // I like to think as the scroll position as the number of lines from the top we must remove.
  2604.         // We have to "print negative lines" to even our balance before we print actual lines.
  2605.         // It's probably quirky, but that line of reasoning helped me out.  That's why "lineIndex" is always <= 0 here.
  2606.  
  2607.         var headerSize = this.drawHeaderBlock(lineHeight * 0, lineIndex);
  2608.  
  2609.         var y = headerSize >= 0 ? headerSize : 0;     // Is our "print marker" off the top of the page (still offscreen) or not?
  2610.         lineIndex = headerSize < 0 ? headerSize : 0;
  2611.  
  2612.         if(JahwsUF.StatusMenuCore.Param.HeaderScrolling == true)
  2613.             this.drawPageBlock(lineHeight * y, lineIndex);
  2614.         else this.drawPageBlock(lineHeight * y, -this.topIndex());  // If our header is fixed-position, then the page block must absorb all scrolling req'ts.
  2615.     }
  2616. };
  2617.  
  2618. // Override this in derived pages/windows for their particular contents.
  2619. JAH_Window_Status_Base.prototype.drawPageBlock = function(y, lineIndex) {
  2620. }
  2621.  
  2622. JAH_Window_Status_Base.prototype.availableWidth = function(portraitMode) {
  2623.     if(portraitMode || this.isPortraitMode())
  2624.     {
  2625.         var portraitInfo = this.getActorPortraitInfo();
  2626.         var portrait = ImageManager.loadPicture(portraitInfo.Portrait);
  2627.         var scale = portraitInfo.Scale;
  2628.         var xOffset = portraitInfo.Offset[0];
  2629.         var adjust = portraitInfo.BorderAdjustment;
  2630.  
  2631.         return this.contentsWidth() - Math.floor(portrait.width * scale) - JahwsUF.StatusMenuCore.Param.ImgBuffer + xOffset + adjust;
  2632.     }
  2633.     else return this.contentsWidth();
  2634. }
  2635.  
  2636. JAH_Window_Status_Base.prototype.getActorPortraitInfo = function() {
  2637.  
  2638.     var switchedPortraitList = JahwsUF.StatusMenuCore.Param.Portraits[this._actor._actorId];
  2639.  
  2640.     // Index 0 is the default portrait instead.
  2641.  
  2642.     for(var i = 1; i < switchedPortraitList.length; i++)
  2643.     {
  2644.         if($gameSwitches.value(switchedPortraitList[i].Switch))
  2645.             return switchedPortraitList[i];
  2646.     }
  2647.  
  2648.     return JahwsUF.StatusMenuCore.Param.Portraits[this._actor._actorId][0];
  2649. };
  2650.  
  2651. // JAH_Window_Status_Base.prototype.getActorPortraitName = function() {
  2652.     // return this.getActorPortraitInfo().Portrait;
  2653. // };
  2654.  
  2655. // JAH_Window_Status_Base.prototype.getActorPortraitScale = function() {
  2656.     // return this.getActorPortraitInfo().Scale;
  2657. // };
  2658.  
  2659. // JAH_Window_Status_Base.prototype.getActorPortraitOffsets = function() {
  2660.     // return this.getActorPortraitInfo().Offset;
  2661. // };
  2662.  
  2663. // JAH_Window_Status_Base.prototype.getActorPortraitBorderAdjustment = function() {
  2664.     // return this.getActorPortraitInfo().BorderAdjustment;
  2665. // };
  2666.  
  2667. JAH_Window_Status_Base.prototype.drawHeaderBlock = function(y, lineIndex) {
  2668.  
  2669.     if(this.isPortraitMode())
  2670.     {
  2671.         return this.drawPortraitHeader(y, lineIndex);
  2672.     }
  2673.     else
  2674.     {
  2675.         return this.drawVanillaHeader(y, lineIndex);
  2676.     }
  2677. };
  2678.  
  2679. JAH_Window_Status_Base.prototype.drawPortraitHeader = function(y, lineIndex)
  2680. {
  2681.     // Top-left of header:  name + nickname.
  2682.     var lineHeight = this.lineHeight();
  2683.  
  2684.     if(lineIndex == 0)
  2685.     {
  2686. //      this.drawActorName(this._actor, this.standardPadding(), y);
  2687.  
  2688.  
  2689.         this.changeTextColor(this.systemColor());
  2690.  
  2691.         var fullNameText = "Full Name: ";
  2692.         var fullNameWidth = this.textWidth(fullNameText);
  2693.         this.drawText("Full Name: ", this.standardPadding(), y, fullNameText);
  2694.  
  2695.         this.resetTextColor();
  2696.  
  2697.         var x = fullNameWidth;
  2698.         var nickname = this._actor.nickname();
  2699.         var nicknameWidth = this.textWidth(nickname);
  2700.  
  2701.         nickname = JahwsUF.StatusMenuCore.Param.NicknameFormat.format(nickname);
  2702.         this.drawText(nickname, x + this.standardPadding(), y, this.textWidth(nickname));
  2703.  
  2704.         this.changeTextColor(this.systemColor());
  2705.  
  2706.         // Top-right of header: lv + class.
  2707.         var classText = " " + this._actor.currentClass().name;
  2708.         var classWidth = this.textWidth(classText);
  2709.         var classPrefix = " Class: ";
  2710.         var classPrefixWidth = this.textWidth(classPrefix);
  2711.         this.drawText(classPrefix, x + nicknameWidth + this.standardPadding()*2, y, this.textWidth());
  2712.  
  2713.         this.resetTextColor();
  2714.  
  2715.         this.drawText(classText, x + nicknameWidth + classPrefixWidth + this.standardPadding()*2, y, this.textWidth());
  2716.  
  2717.         this.changeTextColor(this.systemColor());
  2718.  
  2719.         if(JahwsUF.StatusMenuCore.Param.LvHidden != true)
  2720.         {
  2721. //          var topRightWidth = classWidth;
  2722.             var levelValueWidth = this.textWidth(" ") + this.textWidth(this._actor.level);
  2723. //          topRightWidth += levelValueWidth;
  2724. //          this.drawText(this._actor.level, this.contentsWidth() - topRightWidth, y, levelValueWidth, 'right');
  2725.  
  2726.             this.drawText("  Level: ", x + nicknameWidth + classPrefixWidth + classWidth + this.standardPadding()*2, y, this.textWidth());
  2727.             this.resetTextColor();
  2728.             this.drawText(this._actor.level, x + nicknameWidth + classPrefixWidth + classWidth + this.textWidth("  Level: ") + this.standardPadding()*2, y, this.textWidth());
  2729.  
  2730. //          var levelTextWidth = this.textWidth(TextManager.level);
  2731. //          topRightWidth += levelTextWidth;
  2732.  
  2733. //          this.drawText(TextManager.level, this.contentsWidth() - topRightWidth, y, levelTextWidth);
  2734.         }
  2735.         this.resetTextColor();
  2736.     }
  2737.  
  2738.     // Other left-side header lines:
  2739.     //this.drawActorIcons(this._actor, this.standardPadding(), y + lineHeight * (1 + lineIndex));
  2740.  
  2741.  
  2742.     var xpBarWidth = Math.max(Math.floor(this.contentsWidth() / (2 * 1.61803398875)) - this.standardPadding(), 320);  // 1.618... = golden ratio, hence its use.
  2743.     var gaugeWidthCK = xpBarWidth*2/3
  2744.     //this.drawActorIcons(this._actor, (xpBarWidth*2)+60, y);
  2745.     this.drawActorIcons(this._actor, this.standardPadding()+gaugeWidthCK*2+75, y + lineHeight * (1 + lineIndex));
  2746.  
  2747.     this.drawActorHp(this._actor, this.standardPadding(), y + lineHeight * (1 + lineIndex), gaugeWidthCK)
  2748.     this.drawActorMp(this._actor, this.standardPadding()+gaugeWidthCK+45, y + lineHeight * (1 + lineIndex), gaugeWidthCK);
  2749.     this.drawActorTp(this._actor, this.standardPadding(), y + lineHeight * (2 + lineIndex), gaugeWidthCK*2/3);
  2750.  
  2751.     if(JahwsUF.StatusMenuCore.Param.XpHidden != true)
  2752.     {
  2753.         this.drawActorXp(this._actor, this.standardPadding()+gaugeWidthCK*2/3+20, y + lineHeight * (2 + lineIndex), xpBarWidth-10);
  2754.         this.drawHorzLine(y + lineHeight * (3 + lineIndex));
  2755.     }
  2756.     else
  2757.     {
  2758.         this.drawHorzLine(y + lineHeight * (2 + lineIndex));
  2759.     }
  2760.  
  2761.     // Bottom-left of page - auto-display the character's portrait.
  2762.     var portraitInfo = this.getActorPortraitInfo();
  2763.     var portrait = ImageManager.loadPicture(portraitInfo.Portrait);
  2764.     var scale = portraitInfo.Scale;
  2765.  
  2766.     //Bitmap object is specified in rpg_core.js.  You can check the specs there.
  2767.     //Profile image first in case anyone wants to get fancy and put text on top of it for some crazy reason.
  2768.  
  2769.     var offsets = portraitInfo.Offset;
  2770.  
  2771.     this.contents.blt(portrait, 0, 0, portrait.width, portrait.height,  // Image, top-left (x,y) from source image, source width + height to use
  2772.     this.contentsWidth() - Math.floor(portrait.width * scale) + offsets[0], this.contentsHeight() - Math.floor(portrait.height * scale) + offsets[1], // destination (x, y) to use.  Of note - anything past contentsWidth() + contentsHeight() is auto-clipped!
  2773.     Math.floor(portrait.width * scale), Math.floor(portrait.height * scale)); // destination width, height - can be used to scale!
  2774.  
  2775.     if(JahwsUF.StatusMenuCore.Param.XpHidden == true)
  2776.         return 3 + lineIndex;
  2777.     else
  2778.         return 4 + lineIndex;  // Number of lines drawn.  Includes horizontal line.
  2779. }
  2780.  
  2781. JAH_Window_Status_Base.prototype.drawVanillaHeader = function(y, lineIndex)
  2782. {
  2783.     var lineHeight = this.lineHeight();
  2784.  
  2785.     var offset = 0;
  2786.  
  2787.     var dropLine = JahwsUF.StatusMenuCore.Param.LvHidden && JahwsUF.StatusMenuCore.Param.XpHidden;
  2788.  
  2789.     if(JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank == true && !dropLine)
  2790.         offset = Math.ceil(lineHeight / 2);
  2791.  
  2792.     this.drawActorFace(this._actor, this.standardPadding(), y + lineIndex * lineHeight + offset);
  2793.  
  2794.     var w = Math.max(367, 204 + this.width * 0.45);
  2795.     this.drawBasicInfo(204, y, w, lineIndex);
  2796.  
  2797.     var gaugeX = Math.max(571, w);
  2798.     this.drawGauges(gaugeX, y, this.contentsWidth() - gaugeX - this.standardPadding(), lineIndex);
  2799.  
  2800.  
  2801.     var dropLine = JahwsUF.StatusMenuCore.Param.LvHidden && JahwsUF.StatusMenuCore.Param.XpHidden;
  2802.  
  2803.     if(JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank == true)
  2804.     {
  2805.         this.drawHorzLine(lineHeight * (5 + lineIndex - (dropLine ? 1 : 0)) + y);
  2806.  
  2807.         return 6 + lineIndex - (dropLine ? 1 : 0);
  2808.     }
  2809.     else
  2810.     {
  2811.         // The standard Actor images need 4 lines for display.  Leave them enough space.
  2812.  
  2813.         this.drawHorzLine(lineHeight * (4 + lineIndex) + y);
  2814.  
  2815.         return 5 + lineIndex;  // Number of lines drawn.  Includes horizontal line.
  2816.     }
  2817. }
  2818.  
  2819. JAH_Window_Status_Base.prototype.getHeaderLineCount = function(portraitMode) {
  2820.  
  2821.     if(portraitMode || this.isPortraitMode())
  2822.     {
  2823.         if(JahwsUF.StatusMenuCore.Param.XpHidden == true)
  2824.             return 4;
  2825.         else
  2826.             return 5;
  2827.     }
  2828.     else
  2829.     {
  2830.         var dropLine = JahwsUF.StatusMenuCore.Param.LvHidden && JahwsUF.StatusMenuCore.Param.XpHidden;
  2831.  
  2832.         if(JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank == true)
  2833.             return 7 - (dropLine ? 1 : 0);
  2834.         else return 6; // Minimum amount of space b/c of Actor image.
  2835.     }
  2836. }
  2837.  
  2838. JAH_Window_Status_Base.prototype.getVisibleHeaderLineCount = function(portraitMode) {
  2839.     return this.getHeaderLineCount() - this.topIndex();
  2840. }
  2841.  
  2842. JAH_Window_Status_Base.prototype.getLineCount = function(portraitMode) {
  2843.     return this.getHeaderLineCount();
  2844. }
  2845.  
  2846. JAH_Window_Status_Base.prototype.maxItems = function() {
  2847.     if(this._actor == undefined)
  2848.         return 1;
  2849.     else return this.getLineCount();
  2850. }
  2851.  
  2852. JAH_Window_Status_Base.prototype.hasAvailablePortrait = function() {
  2853.     return this.getActorPortraitInfo().Portrait != undefined;
  2854. }
  2855.  
  2856. if(JahwsUF.StatusMenuCore.Param.DefaultPortrait)
  2857. {
  2858.     JAH_Window_Status_Base.prototype.isPortraitMode = function() {
  2859.     return this.hasAvailablePortrait();
  2860.     };
  2861. }
  2862. else
  2863. {
  2864.     JAH_Window_Status_Base.prototype.isPortraitMode = function() {
  2865.     return false;
  2866.     };
  2867. }
  2868.  
  2869. JAH_Window_Status_Base.prototype.drawHorzLine = function(y, width) {
  2870.  
  2871.     if(width == undefined)
  2872.         width = this.contentsWidth();
  2873.  
  2874.     var lineY = y + this.lineHeight() / 2 - 1;
  2875.     this.contents.paintOpacity = 48;
  2876.     this.contents.fillRect(0, lineY, width, 2, this.lineColor());
  2877.     this.contents.paintOpacity = 255;
  2878. };
  2879.  
  2880. JAH_Window_Status_Base.prototype.lineColor = function() {
  2881.     return this.normalColor();
  2882. };
  2883.  
  2884. // TODO:  Fix printing "Experience to next level" string.  It should be part of the gauges, really.
  2885. JAH_Window_Status_Base.prototype.drawBasicInfo = function(x, y, width, lineIndex) {
  2886.  
  2887.     var lineHeight = this.lineHeight();
  2888.  
  2889.     if(JahwsUF.StatusMenuCore.Param.NicknameInHeaders)
  2890.     {
  2891.         var nameWidth = this.textWidth(this._actor.name());
  2892.  
  2893.         //this.drawActorName(this._actor, x, y); // Happens anyway below.
  2894.         if(this._actor.nickname() != undefined && this._actor.nickname() != "")
  2895.         {
  2896.             var nickname = this._actor.nickname();
  2897.  
  2898.             nickname = JahwsUF.StatusMenuCore.Param.NicknameFormat.format(nickname);
  2899.  
  2900.             this.drawText(nickname, x + nameWidth, y + lineHeight * lineIndex, width - nameWidth - this.standardPadding());
  2901.         }
  2902.     }
  2903.     this.drawActorName    (this._actor, x      , y + lineHeight * (0 + lineIndex));
  2904.  
  2905.     this.drawActorClass   (this._actor, x      , y + lineHeight * (1 + lineIndex));
  2906.     this.drawActorIcons   (this._actor, x      , y + lineHeight * (2 + lineIndex));
  2907.  
  2908.     if(JahwsUF.StatusMenuCore.Param.LvHidden != true)
  2909.     {
  2910.         if(JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank == true)
  2911.              this.drawActorLevel   (this._actor, x      , y + lineHeight * (4 + lineIndex));
  2912.         else this.drawActorLevel   (this._actor, x      , y + lineHeight * (3 + lineIndex));
  2913.     }
  2914. };
  2915.  
  2916. JAH_Window_Status_Base.prototype.drawGauges = function(x, y, width, lineIndex) {
  2917.     var lineHeight = this.lineHeight();
  2918.  
  2919.     this.changeTextColor(this.systemColor());
  2920.  
  2921.     this.drawActorHp(this._actor, x, y + lineHeight * (1 + lineIndex), width);
  2922.     this.drawActorMp(this._actor, x, y + lineHeight * (2 + lineIndex), width);
  2923.  
  2924.     if(JahwsUF.StatusMenuCore.Param.TpGauge)
  2925.         this.drawActorTp(this._actor, x, y + lineHeight * (3 + lineIndex), width);
  2926.  
  2927.     var xpBarWidth = Math.max(width, 120);  // Make sure the bar gets plenty of room.
  2928.     if(JahwsUF.StatusMenuCore.Param.ExtraVanillaBlank == true && JahwsUF.StatusMenuCore.Param.XpHidden != true)
  2929.         this.drawActorXp(this._actor, x + width - xpBarWidth, y + lineHeight * (5 + lineIndex), xpBarWidth);
  2930.     else if(JahwsUF.StatusMenuCore.Param.XpHidden != true)
  2931.         this.drawActorXp(this._actor, x + width - xpBarWidth, y + lineHeight * (4 + lineIndex), xpBarWidth);
  2932. };
  2933.  
  2934.  
  2935. //-----------------------------------------------------------------------------
  2936. // JAH_Window_Status_ParamsBase
  2937. //
  2938. // Implements a Status page that displays a single Actor's parameters.
  2939.  
  2940. function JAH_Window_Status_ParamsBase() {
  2941.     this.initialize.apply(this, arguments);
  2942. }
  2943.  
  2944. JAH_Window_Status_ParamsBase.prototype = Object.create(JAH_Window_Status_Base.prototype);
  2945. JAH_Window_Status_ParamsBase.prototype.constructor = JAH_Window_Status_ParamsBase;
  2946.  
  2947. JAH_Window_Status_ParamsBase.prototype.initialize = function(pageId) {
  2948.     JAH_Window_Status_Base.prototype.initialize.call(this);
  2949.  
  2950.     this.pageId = pageId;
  2951.     this._pageParameterization = JahwsUF.StatusMenuCore.Param.ParamPages[pageId];
  2952. };
  2953.  
  2954. JAH_Window_Status_ParamsBase.prototype.drawPageBlock = function(y, lineIndex) {
  2955.  
  2956.     var lineHeight = this.lineHeight();
  2957.  
  2958.     var paramColumnsRequested = this._pageParameterization.Columns.length;
  2959.     //JahwsUF.StatusMenuCore.Param.ColumnCount;
  2960.  
  2961.  
  2962.     // Optimization note - much of this data can be precomputed for the page!
  2963.     // Analyze the amount of available horizontal space - can we show equipment?
  2964.  
  2965.     var requestedColumnSpacing = this._pageParameterization.RequiredColumnWidth + 2 * paramColumnsRequested * this.standardPadding();
  2966.     var availableWidth = this.availableWidth();  // Account for window margins + visual whitespace.
  2967.  
  2968.     var displayEquips = false;
  2969.  
  2970.     var totalRequiredWidthWithEquips = requestedColumnSpacing + this._pageParameterization.EquipColumnWidth + 2 * this.standardPadding();
  2971.  
  2972.     if(totalRequiredWidthWithEquips < availableWidth && eval(this._pageParameterization.DisplayEquips) == true)
  2973.     {
  2974.         displayEquips = true;
  2975.     }
  2976.  
  2977.     // Determine the optimum padding from the margins (1 * evenPaddingAmount) and between columns (2 * evenPaddingAmount).
  2978.     var totalRequestedSpacing = displayEquips == true ? totalRequiredWidthWithEquips : requestedColumnSpacing;
  2979.     var totalActivatedColumns = paramColumnsRequested + (displayEquips == true ? 1 : 0);
  2980.  
  2981.     // Determine the actual spacings to be utilized.
  2982.  
  2983.     //var evenPaddingAmount = (availableWidth - columnsRequested * columnWidth - (displayEquips == true ? 2 * this.standardPadding() : 0)) / (2 * columnsRequested);
  2984.     var evenPaddingAmount = (availableWidth - totalRequestedSpacing) / (2 * totalActivatedColumns) + this.standardPadding();
  2985.  
  2986.     // Start of the drawing process.
  2987.     var x = evenPaddingAmount;
  2988.     var column = 0;
  2989.  
  2990.  
  2991.     // Aethestics calculations now complete.  Time to actually display ALL the things!
  2992.     for (column = 0; column < this._pageParameterization.Columns.length; column++) {
  2993.  
  2994.         // Start of column.
  2995.         var y2 = y;
  2996.         var l2 = lineIndex;
  2997.  
  2998.         if(column > 0)
  2999.         {
  3000.             x += this._pageParameterization.Columns[column - 1].TextWidth + this._pageParameterization.Columns[column - 1].ValueWidth + 2 * evenPaddingAmount;
  3001.         }
  3002.  
  3003.         for (var row = 0; row < this._pageParameterization.Columns[column].Size; row++) {
  3004.  
  3005.             var paramEntry = this._pageParameterization.Columns[column].Entries[row];
  3006.  
  3007.             if(!(paramEntry == undefined))
  3008.             {
  3009.                 if(l2 >= 0)
  3010.                 {
  3011.                     paramEntry.draw(this, x, y2);
  3012.                 }
  3013.             }
  3014.  
  3015.             l2 += 1;
  3016.  
  3017.             if(l2 > 0)
  3018.                 y2 += lineHeight;
  3019.  
  3020.         }
  3021.     }
  3022.  
  3023.     x += this._pageParameterization.Columns[column - 1].TextWidth + this._pageParameterization.Columns[column - 1].ValueWidth + 2 * evenPaddingAmount;
  3024.  
  3025.     if(displayEquips)
  3026.         this.drawEquipments(x, y + lineHeight * lineIndex);
  3027. };
  3028.  
  3029. JAH_Window_Status_ParamsBase.prototype.getLineCount = function(portraitMode) {
  3030.  
  3031.     var maxCol = 0;
  3032.  
  3033.     for(var i = 0; i < this._pageParameterization.Columns.length; i++)
  3034.     {
  3035.         if(maxCol < this._pageParameterization.Columns[i].Size)
  3036.             maxCol = this._pageParameterization.Columns[i].Size;
  3037.  
  3038.     }
  3039.  
  3040.     return maxCol + this.getHeaderLineCount();
  3041. }
  3042.  
  3043. JAH_Window_Status_ParamsBase.prototype.drawEquipments = function(x, y) {
  3044.     var equips = this._actor.equips();
  3045.     var count = equips.length;
  3046.     for (var i = 0; i < count; i++) {
  3047.         this.drawItemName(equips[i], x, y + this.lineHeight() * i - 6);
  3048.     }
  3049.  
  3050. };
  3051.  
  3052. //-----------------------------------------------------------------------------
  3053. // JAH_Window_Status_Params
  3054. //
  3055. // Implements a Status page that displays a single Actor's parameters.
  3056.  
  3057. function JAH_Window_Status_Params() {
  3058.     this.initialize.apply(this, arguments);
  3059. }
  3060.  
  3061. JAH_Window_Status_Params.prototype = Object.create(JAH_Window_Status_ParamsBase.prototype);
  3062. JAH_Window_Status_Params.prototype.constructor = JAH_Window_Status_Params;
  3063.  
  3064. JAH_Window_Status_Params.prototype.initialize = function() {
  3065.     JAH_Window_Status_ParamsBase.prototype.initialize.call(this, 0);
  3066. };
  3067.  
  3068.  
  3069. //-----------------------------------------------------------------------------
  3070. // JAH_Window_Status_Resistances
  3071. //
  3072. // Implements a Status page that displays a single Actor's ELEMENTAL resistance data.
  3073. // I'd love to change the name to something more fitting, but it'd break a few things.
  3074.  
  3075. function JAH_Window_Status_Resistances() {
  3076.     this.initialize.apply(this, arguments);
  3077. }
  3078.  
  3079. JAH_Window_Status_Resistances.prototype = Object.create(JAH_Window_Status_Base.prototype);
  3080. JAH_Window_Status_Resistances.prototype.constructor = JAH_Window_Status_Resistances;
  3081.  
  3082. JAH_Window_Status_Resistances.prototype.initialize = function() {
  3083.     JAH_Window_Status_Base.prototype.initialize.call(this);
  3084. };
  3085.  
  3086. JAH_Window_Status_Resistances.prototype.categorizePercentValue = function(val) {
  3087.  
  3088.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.ResistanceCategories; i++)
  3089.     {
  3090.         if(val >= JahwsUF.StatusMenuCore.Param.ResistanceThresholds[i])
  3091.         {
  3092.             return i;
  3093.         }
  3094.     }
  3095.  
  3096.     return 7;
  3097. }
  3098.  
  3099. JAH_Window_Status_Resistances.prototype.drawPageBlock = function(y, lineIndex) {
  3100.  
  3101.     var lineHeight = this.lineHeight();
  3102.  
  3103.     var columnCount = JahwsUF.StatusMenuCore.Param.EleResistsColumnCount;
  3104.  
  3105.     var maxNameWidth = 0;
  3106.     var maxLabelWidth = 0;
  3107.     var percentWidth = 80;
  3108.  
  3109.     for (var i = 1; i < $dataSystem.elements.length; i++)
  3110.     {
  3111.         var name = $dataSystem.elements[i];  // TextManager is not configured to provide this String, so I grab it from the global variables instead.
  3112.         var width = this.textWidth(name);
  3113.  
  3114.         if(width > maxNameWidth) maxNameWidth = width;
  3115.     }
  3116.  
  3117.     maxNameWidth += this.standardPadding();
  3118.  
  3119.     for (var i = 0; i < JahwsUF.StatusMenuCore.Param.ResistanceCategories; i++)
  3120.     {
  3121.         var name = JahwsUF.StatusMenuCore.Param.ResistanceLabels[i];
  3122.         var width = this.textWidth(name);
  3123.  
  3124.         if(width > maxLabelWidth) maxLabelWidth = width;
  3125.     }
  3126.  
  3127.     var valueWidth = JahwsUF.StatusMenuCore.Param.DisplayElePercents == true ? percentWidth : maxLabelWidth;
  3128.  
  3129.     var totalElements = $dataSystem.elements.length - 1;  // Remember, the system leaves index 0 as null.  We don't count that.
  3130.  
  3131.     var availableWidth = this.availableWidth();  // Account for window margins + visual whitespace.
  3132.     var evenPaddingAmount = (availableWidth - (maxNameWidth + valueWidth) * columnCount) / (2 * columnCount);
  3133.  
  3134.     var headerWidth = (availableWidth - 4 * this.standardPadding());
  3135.  
  3136.     var header = JahwsUF.StatusMenuCore.Param.EleResistsHeader;
  3137.  
  3138.     if(header == undefined)
  3139.         header == "";
  3140.  
  3141.     if(header.trim() == "")
  3142.         header = "";
  3143.  
  3144.     if(lineIndex == 0 && header != "")
  3145.     {
  3146.         this.drawText(header, (availableWidth - headerWidth) / 2, y, headerWidth, 'center');
  3147.         lineIndex = lineIndex + 2;
  3148.     }
  3149.  
  3150.     //If there's a header.
  3151.  
  3152.     y = y + Math.max(Math.min(2, lineIndex), 0) * this.lineHeight();
  3153.  
  3154.     // Start of the drawing process.
  3155.     var x = evenPaddingAmount;
  3156.  
  3157.     var column = 0;
  3158.     var columnRemaining = JahwsUF.StatusMenuCore.Param.EleResistsInColumn[0];
  3159.  
  3160.     var y2 = y;
  3161.     var l2 = lineIndex;
  3162.     var eleId = 352;
  3163.     for (i = 1; i <= totalElements; i++) {
  3164.  
  3165.         //Is this an element to skip?
  3166.  
  3167.         var skip = false;
  3168.  
  3169.         for(var j = 0; j < JahwsUF.StatusMenuCore.Param.EleResistsToHide.length; j++)
  3170.         {
  3171.             if(JahwsUF.StatusMenuCore.Param.EleResistsToHide[j] == i)
  3172.             {
  3173.                 skip = true;
  3174.                 break;
  3175.             }
  3176.         }
  3177.  
  3178.         if(skip) continue;
  3179.  
  3180.         // No skipping this one - proceed to display!
  3181.  
  3182.  
  3183.  
  3184.         if(l2 >= 0)
  3185.         {
  3186.             this.changeTextColor(this.systemColor());
  3187.  
  3188.             var name = $dataSystem.elements[i];
  3189.  
  3190.             this.drawText(name, x+40, y2, maxNameWidth, "left");
  3191.             this.drawIcon(eleId, x, y2+5, valueWidth, align);
  3192.  
  3193.             this.resetTextColor();
  3194.  
  3195.             var value = this._actor.elementRate(i);
  3196.             var categoryIndex = this.categorizePercentValue(value);
  3197.  
  3198.             var color = JahwsUF.StatusMenuCore.Param.ResistanceColors[categoryIndex];
  3199.  
  3200.             if(color != undefined)
  3201.             {
  3202.                 if(JahwsUF.StatusMenuCore.Param.ResistanceSysColors[categoryIndex] == false)
  3203.                     this.changeTextColor(color);  // We interpreted a hex color.
  3204.                 else this.changeTextColor(this.textColor(color));  //this.textColor RETRIEVES the color based on its ID!  Interesting, so you can specify other colors.
  3205.             }
  3206.  
  3207.             var align = "right";
  3208.  
  3209.             if(JahwsUF.StatusMenuCore.Param.CenterEleValues)
  3210.                 align = "center";
  3211.  
  3212.             if(JahwsUF.StatusMenuCore.Param.DisplayElePercents)
  3213.             {
  3214.                 var formattedValue = Math.round(value * 100) + "%";
  3215.                 this.drawText(formattedValue, x + maxNameWidth, y2-4, valueWidth, align);
  3216.             }
  3217.             else
  3218.             {
  3219.                 var resistText = JahwsUF.StatusMenuCore.Param.ResistanceLabels[categoryIndex];
  3220.                 this.drawText(resistText, x + maxNameWidth, y2, valueWidth, align);
  3221. //              this.drawText(resistText, x + maxNameWidth, y2-4, valueWidth, align);
  3222.             }
  3223.  
  3224.             this.resetTextColor();
  3225.  
  3226.             y2 += lineHeight;
  3227.         }
  3228.  
  3229.         eleId++;
  3230.  
  3231.         l2++;
  3232.  
  3233.         columnRemaining--;
  3234.         if(columnRemaining == 0) // Column done!
  3235.         {
  3236.             x += maxNameWidth + valueWidth + 2 * evenPaddingAmount;
  3237.             y2 = y;
  3238.             l2 = lineIndex;
  3239.  
  3240.             column++;
  3241.  
  3242.             if(column == columnCount)
  3243.                 break;
  3244.  
  3245.             columnRemaining = JahwsUF.StatusMenuCore.Param.EleResistsInColumn[column];
  3246.         }
  3247.     }
  3248. };
  3249.  
  3250. JAH_Window_Status_Resistances.prototype.getLineCount = function(portraitMode) {
  3251.  
  3252.     var maxCol = 0;
  3253.  
  3254.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.EleResistsColumnCount; i++)
  3255.     {
  3256.         if(maxCol < JahwsUF.StatusMenuCore.Param.EleResistsInColumn[i])
  3257.             maxCol = JahwsUF.StatusMenuCore.Param.EleResistsInColumn[i];
  3258.     }
  3259.  
  3260.     var header = JahwsUF.StatusMenuCore.Param.EleResistsHeader;
  3261.  
  3262.     if(header == undefined)
  3263.         header == "";
  3264.  
  3265.     if(header.trim() == "")
  3266.         header = "";
  3267.  
  3268.     if(header != "")
  3269.         maxCol += 2;  // Two lines taken to print the header.
  3270.  
  3271.     return maxCol + this.getHeaderLineCount();
  3272. }
  3273.  
  3274. //-----------------------------------------------------------------------------
  3275. // JAH_Window_State_Resistances
  3276. //
  3277. // Implements a Status page that displays a single Actor's state resistance data.
  3278.  
  3279. function JAH_Window_State_Resistances() {
  3280.     this.initialize.apply(this, arguments);
  3281. }
  3282.  
  3283. JAH_Window_State_Resistances.prototype = Object.create(JAH_Window_Status_Base.prototype);
  3284. JAH_Window_State_Resistances.prototype.constructor = JAH_Window_State_Resistances;
  3285.  
  3286. JAH_Window_State_Resistances.prototype.initialize = function() {
  3287.     JAH_Window_Status_Base.prototype.initialize.call(this);
  3288. };
  3289.  
  3290. JAH_Window_State_Resistances.prototype.categorizePercentValue = function(val) {
  3291.  
  3292.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.ResistanceCategories; i++)
  3293.     {
  3294.         if(val >= JahwsUF.StatusMenuCore.Param.ResistanceThresholds[i])
  3295.         {
  3296.             return i;
  3297.         }
  3298.     }
  3299.  
  3300.     return 7;
  3301. }
  3302.  
  3303. JAH_Window_State_Resistances.prototype.drawPageBlock = function(y, lineIndex) {
  3304.  
  3305.     var lineHeight = this.lineHeight();
  3306.  
  3307.     var columnCount = JahwsUF.StatusMenuCore.Param.StateResistsColumnCount;
  3308.  
  3309.     var maxNameWidth = 0;
  3310.     var maxLabelWidth = 0;
  3311.     var percentWidth = 80;
  3312.  
  3313.     for (var i = 1; i < $dataStates.length; i++)
  3314.     {
  3315.         var name = $dataStates[i].name;  // TextManager is not configured to provide this String, so I grab it from the global variables instead.
  3316.         var width = this.textWidth(name);
  3317.  
  3318.         if(width > maxNameWidth) maxNameWidth = width;
  3319.     }
  3320.  
  3321.     maxNameWidth += this.standardPadding();
  3322.  
  3323.     for (var i = 0; i < JahwsUF.StatusMenuCore.Param.ResistanceCategories; i++)
  3324.     {
  3325.         var name = JahwsUF.StatusMenuCore.Param.ResistanceLabels[i];
  3326.         var width = this.textWidth(name);
  3327.  
  3328.         if(width > maxLabelWidth) maxLabelWidth = width;
  3329.     }
  3330.  
  3331.     var valueWidth = JahwsUF.StatusMenuCore.Param.DisplayStatePercents == true ? percentWidth : maxLabelWidth;
  3332.  
  3333.     var totalStates = $dataStates.length - 1;  // Remember, the system leaves index 0 as null.  We don't count that.
  3334.  
  3335.     var availableWidth = this.availableWidth();  // Account for window margins + visual whitespace.
  3336.     var evenPaddingAmount = (availableWidth - (maxNameWidth + valueWidth) * columnCount) / (2 * columnCount);
  3337.  
  3338.     var headerWidth = (availableWidth - 4 * this.standardPadding());
  3339.  
  3340.     var header = JahwsUF.StatusMenuCore.Param.StateResistsHeader;
  3341.  
  3342.     if(header == undefined)
  3343.         header == "";
  3344.  
  3345.     if(header.trim() == "")
  3346.         header = "";
  3347.  
  3348.     if(lineIndex == 0 && header != "")
  3349.     {
  3350.         this.drawText(header, (availableWidth - headerWidth) / 2, y, headerWidth, 'center');
  3351.         lineIndex = lineIndex + 2;
  3352.     }
  3353.  
  3354.     //If there's a header.
  3355.  
  3356.     y = y + Math.max(Math.min(2, lineIndex), 0) * this.lineHeight();
  3357.  
  3358.     // Start of the drawing process.
  3359.     var x = evenPaddingAmount;
  3360.  
  3361.     var column = 0;
  3362.     var columnRemaining = JahwsUF.StatusMenuCore.Param.StateResistsInColumn[0];
  3363.  
  3364.     var y2 = y;
  3365.     var l2 = lineIndex;
  3366.  
  3367.     for (i = 1; i <= totalStates; i++) {
  3368.  
  3369.         //Is this a state to skip?
  3370.  
  3371.         var skip = false;
  3372.  
  3373.         for(var j = 0; j < JahwsUF.StatusMenuCore.Param.StateResistsToHide.length; j++)
  3374.         {
  3375.             if(JahwsUF.StatusMenuCore.Param.StateResistsToHide[j] == i)
  3376.             {
  3377.                 skip = true;
  3378.                 break;
  3379.             }
  3380.         }
  3381.  
  3382.         if(skip) continue;
  3383.  
  3384.         // No skipping this one - proceed to display!
  3385.  
  3386.         if(l2 >= 0)
  3387.         {
  3388.             this.changeTextColor(this.systemColor());
  3389.  
  3390.             var name = $dataStates[i].name;
  3391.             this.drawIcon($dataStates[i].iconIndex, x, y2+5, valueWidth, align);
  3392.             this.drawText(name, x+40, y2, maxNameWidth);
  3393.             this.resetTextColor();
  3394.  
  3395.             var value = this._actor.stateRate(i);
  3396.  
  3397.             if(this._actor.isStateResist(i))  // This state is utterly, 100% negated.  Undeniable immunity.
  3398.                 value = 0;
  3399.  
  3400.             var categoryIndex = this.categorizePercentValue(value);
  3401.  
  3402.             var color = JahwsUF.StatusMenuCore.Param.ResistanceColors[categoryIndex];
  3403.  
  3404.             if(color != undefined)
  3405.             {
  3406.                 if(JahwsUF.StatusMenuCore.Param.ResistanceSysColors[categoryIndex] == false)
  3407.                     this.changeTextColor(color);  // We interpreted a hex color.
  3408.                 else this.changeTextColor(this.textColor(color));  //this.textColor RETRIEVES the color based on its ID!  Interesting, so you can specify other colors.
  3409.             }
  3410.  
  3411.             var align = "right";
  3412.  
  3413.             if(JahwsUF.StatusMenuCore.Param.CenterStateValues)
  3414.                 align = "center";
  3415.  
  3416.             if(JahwsUF.StatusMenuCore.Param.DisplayStatePercents)
  3417.             {
  3418.                 var formattedValue = Math.round(value * 100) + "%";
  3419.                 this.drawText(formattedValue, x + maxNameWidth, y2, valueWidth, align);
  3420.             }
  3421.             else
  3422.             {
  3423.                 var resistText = JahwsUF.StatusMenuCore.Param.ResistanceLabels[categoryIndex];
  3424.                 this.drawText(resistText, x + maxNameWidth, y2, valueWidth, align);
  3425.             }
  3426.  
  3427.             this.resetTextColor();
  3428.  
  3429.             y2 += lineHeight;
  3430.         }
  3431.  
  3432.  
  3433.         l2++;
  3434.  
  3435.         columnRemaining--;
  3436.         if(columnRemaining == 0) // Column done!
  3437.         {
  3438.             x += maxNameWidth + valueWidth + 2 * evenPaddingAmount;
  3439.             y2 = y;
  3440.             l2 = lineIndex;
  3441.  
  3442.             column++;
  3443.  
  3444.             if(column == columnCount)
  3445.                 break;
  3446.  
  3447.             columnRemaining = JahwsUF.StatusMenuCore.Param.StateResistsInColumn[column];
  3448.         }
  3449.     }
  3450. };
  3451.  
  3452. JAH_Window_State_Resistances.prototype.getLineCount = function(portraitMode) {
  3453.  
  3454.     var maxCol = 0;
  3455.  
  3456.     for(var i = 0; i < JahwsUF.StatusMenuCore.Param.StateResistsColumnCount; i++)
  3457.     {
  3458.         if(maxCol < JahwsUF.StatusMenuCore.Param.StateResistsInColumn[i])
  3459.             maxCol = JahwsUF.StatusMenuCore.Param.StateResistsInColumn[i];
  3460.     }
  3461.  
  3462.     var header = JahwsUF.StatusMenuCore.Param.StateResistsHeader;
  3463.  
  3464.     if(header == undefined)
  3465.         header == "";
  3466.  
  3467.     if(header.trim() == "")
  3468.         header = "";
  3469.  
  3470.     if(header != "")
  3471.         maxCol += 2;  // Two lines taken to print the header.
  3472.  
  3473.     return maxCol + this.getHeaderLineCount();
  3474. }
  3475.  
  3476. //-----------------------------------------------------------------------------
  3477. // JAH_Window_Profile_Texter
  3478. //
  3479. // A hidden window utilized by the Profile page in order to do profile text operations.
  3480. // Facilitates escape codes, aids compatibility with word-wrapping plugins.
  3481. //
  3482.  
  3483. function JAH_Window_Profile_Texter() {
  3484.     this.initialize.apply(this, arguments);
  3485. }
  3486.  
  3487. JAH_Window_Profile_Texter.prototype = Object.create(Window_Base.prototype);
  3488. JAH_Window_Profile_Texter.prototype.constructor = JAH_Window_Profile_Texter;
  3489.  
  3490. JAH_Window_Profile_Texter.prototype.initialize = function(cWidth, cHeight) {
  3491.     Window_Base.prototype.initialize.call(this, 0, 0, cWidth + 2 * this.standardPadding(),
  3492.                                                       cHeight + 2 * this.standardPadding());
  3493.  
  3494.     this.hide();
  3495. }
  3496.  
  3497. // Duplicate these methods from the base class.  It's actually safe, 'cause Javascript logic.
  3498. JAH_Window_Profile_Texter.prototype.drawHorzLine = JAH_Window_Status_Base.prototype.drawHorzLine;
  3499. JAH_Window_Profile_Texter.prototype.lineColor = JAH_Window_Status_Base.prototype.lineColor;
  3500.  
  3501. JAH_Window_Profile_Texter.prototype.convertEscapeCharacters = function(text) {
  3502.  
  3503.     text = Window_Base.prototype.convertEscapeCharacters.call(this, text);
  3504.  
  3505.     // Our custom conversion comes after the others; they eliminate '\n's.
  3506.     text = text.replace(/<hr>/g, '\x1bhr');
  3507.  
  3508.     return text;
  3509. }
  3510.  
  3511. JAH_Window_Profile_Texter.prototype.processEscapeCharacter = function(code, textState) {
  3512.     Window_Base.prototype.processEscapeCharacter.call(this, code, textState)
  3513.  
  3514.     if(code == "HR")
  3515.     {
  3516.         this.drawHorzLine(textState.y);
  3517.     }
  3518. }
  3519. //-----------------------------------------------------------------------------
  3520. // JAH_Window_Status_Profile
  3521. //
  3522. // Implements a Status page that displays a single Actor's parameters.
  3523. //
  3524.  
  3525. function JAH_Window_Status_Profile() {
  3526.     this.initialize.apply(this, arguments);
  3527. }
  3528.  
  3529. JAH_Window_Status_Profile.prototype = Object.create(JAH_Window_Status_Base.prototype);
  3530. JAH_Window_Status_Profile.prototype.constructor = JAH_Window_Status_Profile;
  3531.  
  3532. JAH_Window_Status_Profile.prototype.initialize = function() {
  3533.  
  3534.     JAH_Window_Status_Base.prototype.initialize.call(this);
  3535.  
  3536.     this.hiddenTextWindow = new JAH_Window_Profile_Texter(this.contentsWidth(), this.contentsHeight());
  3537.     this.totalLineCount = undefined; // Stores pre-computed line count information; it's an expensive calculation.
  3538.     //this.scrolledLines = 0;
  3539. };
  3540.  
  3541. //// Needed to be able to scroll.  Each item is one line height by default, anyway, which makes this REALLY convenient.
  3542. //JAH_Window_Status_Profile.prototype.maxItems = function(){
  3543. //  return this.getLineCount();
  3544. //}
  3545.  
  3546. JAH_Window_Status_Profile.prototype.getExtendedActorProfile = function() {
  3547.     var profile = JahwsUF.StatusMenuCore.Param.ExtendedProfiles[this._actor._actorId];
  3548.  
  3549.     var switchedProfileList = JahwsUF.StatusMenuCore.Param.SwitchedProfiles[this._actor._actorId];
  3550.  
  3551.     for(var i = 0; i < switchedProfileList.length; i++)
  3552.     {
  3553.         if($gameSwitches.value(switchedProfileList[i][0]))
  3554.             return switchedProfileList[i][1];
  3555.     }
  3556.  
  3557.     return profile;
  3558. };
  3559.  
  3560. JAH_Window_Status_Profile.prototype.setActor = function(actor) {
  3561.  
  3562.     this.totalLineCount = undefined;
  3563.     JAH_Window_Status_Base.prototype.setActor.call(this, actor);
  3564.     this.totalLineCount = this.getLineCount();
  3565.  
  3566.     //this.refresh();
  3567. }
  3568.  
  3569. JAH_Window_Status_Profile.prototype.getLineCount = function() {
  3570.  
  3571.     if(this._actor == undefined) return 1;  // Nothing to see here if we've not yet loaded an Actor.
  3572.  
  3573.     if(this.totalLineCount) return this.totalLineCount;
  3574.  
  3575.     this.hiddenTextWindow.width = this.availableWidth() + 2 * this.standardPadding();
  3576.     this.hiddenTextWindow.height = this.contentsHeight() + 2 * this.standardPadding() - this.getVisibleHeaderLineCount() * this.lineHeight();
  3577.     this.hiddenTextWindow.updateTransform();
  3578.  
  3579.     this.hiddenTextWindow.contents = new Bitmap(this.availableWidth(), this.contentsHeight());
  3580.  
  3581.     var exProfile = this.getExtendedActorProfile();
  3582.     var totalHeight = 0;
  3583.  
  3584.     if(exProfile != undefined)
  3585.     {
  3586.         //totalLines = exProfile.split('\n').length;
  3587.         var textState = { index: 0, x: 12, y: 0, left: 12 };
  3588.         textState.text = this.hiddenTextWindow.convertEscapeCharacters.call(this.hiddenTextWindow, exProfile);
  3589.  
  3590.         totalHeight = this.calcTextHeight.call(this.hiddenTextWindow, textState, true);
  3591.     }
  3592.  
  3593.     if(this._actor.profile() != undefined && this._actor.profile() != "")
  3594.     {
  3595.         //totalLines += 3;
  3596.  
  3597.         var textState = { index: 0, x: 12, y: 0, left: 12 };
  3598.         textState.text = this.convertEscapeCharacters.call(this.hiddenTextWindow, this._actor.profile());
  3599.  
  3600.         totalHeight += this.calcTextHeight.call(this.hiddenTextWindow, textState, true) + this.lineHeight();
  3601.     }
  3602.  
  3603.     var totalLines = Math.ceil(totalHeight / this.lineHeight());
  3604.  
  3605.     totalLines += this.getHeaderLineCount();
  3606.  
  3607.     if(!(this.isPortraitMode() || JahwsUF.StatusMenuCore.Param.NicknameInHeaders))
  3608.     {
  3609.         totalLines += 2; // Include space for the nickname!
  3610.     }
  3611.  
  3612.     this.totalLineCount = totalLines;
  3613.  
  3614.     return totalLines;
  3615. };
  3616.  
  3617. JAH_Window_Status_Profile.prototype.drawPageBlock = function(y, lineIndex) {
  3618.     this.drawProfile(12, y, lineIndex);
  3619. };
  3620.  
  3621. // Profiles will ALWAYS use the portrait if it's available.
  3622. JAH_Window_Status_Profile.prototype.isPortraitMode = function() {
  3623.     return this.hasAvailablePortrait();
  3624. };
  3625.  
  3626. JAH_Window_Status_Profile.prototype.drawProfile = function(x, y, lineOffset) {
  3627.  
  3628.     //var topIndex = this.topIndex();  // Gotta make adjustments based on this.
  3629.     //var lineOffset = -topIndex;
  3630.  
  3631.     // If anything should be printed above the original y, based upon topIndex, it should never be printed.
  3632.     // Otherwise, offset.
  3633.  
  3634.     if(!this.isPortraitMode())
  3635.     {
  3636.         var nickname = this._actor.nickname();
  3637.  
  3638.         if(nickname == '') nickname = undefined;
  3639.  
  3640.         // If we don't have a portrait...
  3641.         if(!JahwsUF.StatusMenuCore.Param.NicknameInHeaders && nickname != undefined)
  3642.         {
  3643.             if(lineOffset == 0)
  3644.             {
  3645.                 var nickname = this._actor.nickname();
  3646.  
  3647.                 if(JahwsUF.StatusMenuCore.Param.NicknameFormat.indexOf("\"") != -1)
  3648.                 nickname = "\"" + nickname + "\"";
  3649.  
  3650.                 this.drawText(nickname, x, y, this.textWidth(nickname));
  3651.             }
  3652.  
  3653.             lineOffset += 2;
  3654.         }
  3655.  
  3656.         if(this._actor.profile() != undefined && this._actor.profile() != "")
  3657.         {
  3658.             // Would need a "calc line height" fix.
  3659.             //this.drawTextEx(this._actor.profile(), x, y + lineOffset);
  3660.             this.printScrolledText(this._actor.profile(), x, y, lineOffset);
  3661.  
  3662.             lineOffset += 3;
  3663.         }
  3664.  
  3665.         var exProfile = this.getExtendedActorProfile();
  3666.  
  3667.         if(exProfile != undefined)
  3668.             this.printScrolledText(exProfile, x, y, lineOffset);
  3669.     }
  3670.     else
  3671.     {
  3672.         // In profile mode, the Base window class draws the image as part of the command of "portrait" mode when
  3673.         // drawing the actor block.  (This makes things more general for future extensions, in case future pages
  3674.         // want to use the profile image.)
  3675.  
  3676.         // If we DO have a standard profile entry.
  3677.         if(this._actor.profile() != undefined && this._actor.profile() != "")
  3678.         {
  3679.             //this.drawTextEx(this._actor.profile(), x, y + lineOffset);
  3680.             this.printScrolledText(this._actor.profile(), x, y, lineOffset);
  3681.  
  3682.             lineOffset += 3;
  3683.         }
  3684.  
  3685.         var exProfile = this.getExtendedActorProfile();
  3686.  
  3687.         if(exProfile != undefined)
  3688.             this.printScrolledText(exProfile, x, y, lineOffset);
  3689.             //this.drawTextEx(exProfile, x, y + lineOffset);
  3690.     }
  3691.  
  3692. }
  3693.  
  3694. JAH_Window_Status_Profile.prototype.printScrolledText = function(text, x, y, scroll) {
  3695.  
  3696.     // 1.0.3 - dramatic change in the code:  scrolling control is way different now, but
  3697.     // in a way that won't break word-wrapping plugin output.
  3698.     //
  3699.     // Word-wrap plugins still need to implement calcTextHeight properly for scrolling to work, however.
  3700.  
  3701.     var lineHeight = this.lineHeight();
  3702.     var lines = text.split('\n');
  3703.  
  3704.     var headerSize = 0;
  3705.     var saveState = undefined;
  3706.  
  3707.     y += scroll * lineHeight;
  3708.  
  3709.     this.hiddenTextWindow.contents.clear();
  3710.     this.hiddenTextWindow.drawTextEx.call(this.hiddenTextWindow, text, x, y);
  3711.  
  3712.     var yDelt = y > 0 ? y : 0;
  3713.  
  3714.     var heightToCopy = this.contentsHeight() - yDelt;
  3715.  
  3716.     this.contents.blt(this.hiddenTextWindow.contents, 0, yDelt, this.hiddenTextWindow.contentsWidth(), heightToCopy, 0, yDelt);
  3717. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement