Guest User

Michael Window Changer

a guest
Jan 21st, 2014
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. #
  3. # Michael Windows Changer
  4. # Last Updated: 2014.01.21
  5. # Requirement: RPG Maker VX Ace
  6. #             -Knowledge of 'how to use scripts'
  7. #             -Knowledge of Window Designation (basically know which window is
  8. #              which)
  9. #
  10. #==============================================================================
  11.  
  12. #==============================================================================
  13. #Compability: - Script should be compatible with any other script(s).
  14. #             - If the picture you use doesn't have the right size as the
  15. #               window's size, then use window_show_all to show picture in full size,
  16. #               then move it using window_show_all_move.
  17. #             - Bitmap cannot convert .gif file yet.
  18. #
  19. #==============================================================================
  20.  
  21. #==============================================================================
  22. #Credit:
  23. # - Big thanks to Mithran for the efficiency check and error analyzis
  24. # - Other scripters in the discussion
  25. #==============================================================================
  26.  
  27. #==============================================================================
  28. # Self-To-Do-List
  29. #==============================================================================
  30. # Just take this as upcoming features
  31. #
  32. # - Add more sprite layers (both cursor and window)
  33. # - Do the animation attachment
  34. #
  35. #==============================================================================
  36.  
  37. #==============================================================================
  38. # Script Biography lol
  39. #==============================================================================
  40. # 2013.01.21 --Increasing efficiency + Installing interpreter
  41. #            --Demo is added
  42. # 2013.01.20 --Increasing efficiency
  43. # 2013.01.19 --Window is up to customized.
  44. # 2013.01.18 --Window hash table is created.
  45. # 2013.01.17 --Implementing interpreter for cursor -- Demo is out :D
  46. # 2013.01.16 --cursor_rect is up to customization.
  47. # 2013.01.15 --Fixed resize -- Credit to Mithram for zoom's behavior
  48. #            --window_r_default is combined with default assignment.
  49. # 2013.01.14 --Fixed resize math
  50. # 2013.01.13 --Enabled Psuedo name
  51. # 2013.01.12 --Improve option on resize and add feature for color
  52. # 2013.01.11 --Add feature to resizing picture based on height & width ratio / user input
  53. # 2013.01.09 --Auto-Generate all Window sub-classes. -Add feature for auto and manual.
  54. # 2013.01.08 --Can't keep track on what happened today.
  55. # 2013.01.07 --FLICKER GOODBYE - flicker bug is fixed. 100% working. I'll give up if I found another  bug.
  56. # 2013.01.06 --Increaseeeeeeeeeeeeddddddd readibility. .______________________.
  57. #            --File is trimmed down and readibility is increased - Credit to Mithran
  58. # 2013.01.05 --File is trimmed down
  59. # 2013.01.03 --window_show_all and window_move_origin and their counter-parts
  60. #              are introduced
  61. #            --Reforming the arrays
  62. #            --Increased readibility :/
  63. # 2013.01.02 --Naming convention is improved
  64. #            --Some methods are simplified
  65. #            --File is trimmed down
  66. #            --@temp1 & @temp2 variables are removed
  67. #            --Replacing switch on the windows itself instead of scenes
  68. # 2013.01.01 --window_opacity(i, opacity) is introduced
  69. # 2013.12.30 --Trimmed down the file size
  70. # 2013.12.27 --Fixed window_default(i)
  71. #            --window_depth(i, depth) is introduced & implemented
  72. #            --Fixed window_default(i) and window_center(i) is introduced
  73. #            --Fixed Scene_File
  74. # 2013.12.26 --Fixed Scene_Title - Sprite is now in correlation with the window
  75. #            --Raising Compatibility
  76. #            --window_move(i, x, y, width, height) is introduced
  77. #            --window_default(i) is introduced
  78. #            --All Scenes are overloaded with the new switch
  79. # 2013.12.25 --Fixed bugs on local @temp1 and @temp2 disposal
  80. #            --Scene_MenuBase is added
  81. #            --Fixed bugs for 'name'
  82. #            --Fixed bugs on various Scenes
  83. # 2013.12.24 --Script is uploaded << Ver. 1.0
  84. # 2013.12.23 --Window_Message is completed
  85. # 2013.12.22 --Scene_Equip is completed
  86. #            --Scene_Skill is completed
  87. #            --Scene_Item is completed
  88. #            --Scene_ItemBase is completed
  89. #            --Scene_Menu is completed
  90. #            --Scene_Map is completed
  91. #            --Scene_Title is completed
  92. #            --Scene_Menu is completed
  93. #            --All Scenes that need to be overloaded have been overloaded
  94. #            --Updating array to store image name
  95. # 2013.12.21 --Installing Game_Interpreter
  96. #            --Scene_Battle is completed
  97. #            --Scene_Debug is completed
  98. #            --Scene_Name is completed
  99. #            --Scene_Shop is completed
  100. #            --Scene_End is completed
  101. #            --Scene_Save and Scene_Load skipped -- No Window yield
  102. #            --Scene_File is completed
  103. #            --Scene_Status is completed
  104. # 2013.12.20 --Scene_Battle is completed
  105. # 2013.12.19 --Works for Windows_BattleStatus
  106. # 2013.12.18 --Script is initialized -- Getting know Ruby + RGSS Libraries
  107. #==============================================================================
  108. # Description
  109. #==============================================================================
  110. # This script is used to stick image(s) to windows with your desired image(s)
  111. # by overloading all windows. You can also edit it's location.
  112. #
  113. #==============================================================================
  114. # Installation
  115. #==============================================================================
  116. # - This script will OVERLOAD all DEFAULT windows.
  117. # - Place this script to be below other overloading windows script. If you are
  118. #   not sure where, place it to be the lowest of the material section.
  119. # - If you have a bust script, put the bust script anywhere below this script.
  120. # - Place the window Images (by default) in that folder
  121. #   <your project>/Graphics/Windows/(type of windows)/
  122. #
  123. #==============================================================================
  124. # How to Use:
  125. #
  126. # #====================== Only Make Window Transparent =======================#
  127. #
  128. #  - window_blank(window_type)
  129. #  For Example:
  130. #  window_blank(Window_Gold)
  131. #             -> Make window_gold to be transparent (content is not transparent
  132. #                though, you can still see your gold amount)
  133. #
  134. # #============================= On/Off Switch ===============================#
  135. #
  136. #  - window_on(window_type, 'file_name.extention_name')
  137. #  For Example:
  138. #  window_on(Window_Gold, 'ex.jpg')
  139. #             -> activate Window_Gold background with ex.jpg as the content
  140. #             -> If you want to change the picture, just do the same
  141. #                thing, but use different file_name.
  142. #             -> picture will be resized as how big the window is.
  143. #
  144. #  - window_off(window_type)
  145. #  For Example:
  146. #  window_off(Window_Gold)
  147. #             -> deactivate Window_Gold background and its content
  148. #             -> deactivating will hide the background and return the
  149. #                window rectangle back to the boring blue color with its
  150. #                redundant white padding.
  151. #
  152. # #================================ Nickname =================================#
  153. #
  154. #  - window_nickname(window_type, nickname)
  155. #  For Example:
  156. #  window_nickname(Window_Gold, 'gold')
  157. #             -> introduce a nickname to Window_Gold. Next time you need to type
  158. #                a window_type for Window_Gold, you could just use the nickname.
  159. #             -> For example: window_on('gold', 'ex.jpg')
  160. #             -> Please don't forget the quotation marks!
  161. #             -> Don't do window_nickname('gold_lol', gold)
  162. #             -> If you want to change the nickname, just do
  163. #                window_nickname(Window_Gold, 'gold')
  164. #
  165. # #================================ Movement =================================#
  166. #
  167. #  - window_show_all(window_type)
  168. #             -> JUST USE THIS COMMAND and window_on if you're confused with
  169. #                coordination. Basically window_show_all will display
  170. #                your picture from the center of the window.
  171. #             -> Do I have to use this for every picture that's oversized?
  172. #             -> No, just do window_on(Window_Help, 'ex.jpg', 'show_all') <<< see the 'show_all'?
  173. #                (don't forget the quotation mark!)
  174. #
  175. #  - window_show_all_move(window_type, x, y)
  176. #             -> To move from show_all position
  177. #
  178. #  - window_center(window_type)
  179. #  For Example:
  180. #  window_center(Window_Gold)
  181. #             -> Move the Window_Gold background content to center position
  182. #                Default position is at the center (272,208) of the graphic and
  183. #                occupy the size of the graphic (if your picture has size
  184. #                larger than the graphic (544 x 416), it will fill the graphic)
  185. #             -> Make sure that switch is 'on' or else nothing would happen.
  186. #
  187. #  - window_move_full(window_type, x, y, width, height)
  188. #  For Example:
  189. #  window_move_full(Window_Gold, 24, -24, 400, 400)
  190. #  -> TIPS: If you are not sure how to adjust, the coordinate, starts with
  191. #           window_move first.
  192. #  -> move the Window_Gold background content to (24,-24) position. Remember that
  193. #     center coordinate is (0,0) and to move up, y needs to be negative, to move
  194. #     down, y needs to be positive, to move left, x needs to be negative, to move
  195. #     right, x needs to be positive.
  196. #  -> width and height are there as a border to make sure that your picture doesn't
  197. #     go beyond the given size (400 x 400).
  198. #  -> TIPS: If you don't want to have border, simply set the border to be the
  199. #           Graphics' height and width.
  200. #           To set Graphics' height and width:
  201. #           window_move(5, 24, -24, Graphics.width, Graphics.height)
  202. #
  203. # #============================ Default ======================================#
  204. #
  205. #  - window_default(window_type)
  206. #  For Example:
  207. #  window_default(Window_Gold)
  208. #              -> Turn off movement switch for Window_Gold background
  209. #              -> This will return Window_Gold to the original position
  210. #
  211. # #============================= Depth =======================================#
  212. #
  213. #  - window_depth(window_type, depth)
  214. #  For Example:
  215. #  window_depth(Window_Gold, -1)
  216. #               -> Increases the depthness of Window_Gold background content
  217. #                  by -1, which means, if there's other window background
  218. #                  in the graphic beside Window_Gold background, that window
  219. #                  background will appear to be above Window_Gold background.
  220. #               -> Make sure that switch is 'on' or else nothing would happen.
  221. #
  222. # #============================ Opacity ======================================#
  223. #
  224. # - window_opacity(window_type, opacity)
  225. # For Example:
  226. # window_opacity(Window_Gold, 0)
  227. #               -> Set Window_Gold background opacity to 0 (100% transparent).
  228. #               -> Opacity value is from 0 (fully see-through) to 255 (solid).
  229. #               -> Make sure that switch is 'on' or else nothing would happen.
  230. #               -> Default opacity is 255 when window background is on.
  231. #
  232. # #============================= Color =======================================#
  233. #
  234. # - window_color(window_type, red, green, blue, alpha)
  235. #               -> I don't think I need to explain this one. .-.
  236. #               -> Just remember that red, green, blue, alpha are from 0 - 255.
  237. #
  238. # #============================ Resizing =====================================#
  239. #
  240. # window_r_pixel(class_type, _zoom_x, _zoom_y) -> resize by full_size of the picture/bitmap/sprite
  241. # window_r(class_type, _zoom_x, zoom_y) -> resize after resizing from window
  242. # window_r_i(class_type, streched_width, streched_height) -> resize by integer (Window_Gold,200,200) -> resized into a box
  243. # window_r_fit_w(class_type) -> resized based on window.width
  244. # window_r_fit_h(class_type) -> resized based on window.height
  245. #
  246. # #============================= Cursor ======================================#
  247. #
  248. # How to apply:
  249. #  cursor and window background need to have similar name.
  250. #  if you use 'file_name' as your background, your cursor name should be
  251. #  'file_name_select'. (You need to add '_select' (see the underscore) to the end of the file_name
  252. #  Another example would be:
  253. #  window background file_name = testing_if_picture_come_out.png
  254. #  then your cursor name should be
  255. #  cursor file_name = testing_if_picture_come_out_select.png
  256. #
  257. #  If cursor doesn't work, let me know.
  258. #
  259. #  If you don't want to change the cursor, no need to create the
  260. #  'file_name_select', script will use the default cursor in that case.
  261. #
  262. # Interpreters that come with cursor:
  263. #
  264. #  cursor_depth(class_type, depth)
  265. #  cursor_opacity(class_type, opacity)
  266. #  cursor_default(class_type)
  267. #  cursor_show_all(class_type)
  268. #  cursor_show_all_move(class_type, x, y)
  269. #  cursor_move_origin(class_type,x,y)
  270. #  cursor_r_fit_w(class_type)
  271. #  cursor_r_fit_h(class_type)
  272. #  cursor_r_pixel(class_type, _zoom_x, _zoom_y)
  273. #  cursor_r(class_type, _zoom_x, zoom_y)
  274. #  cursor_r_i(class_type, streched_width, streched_height)
  275. #  cursor_color(class_type, red, green, blue, alpha)
  276. #
  277. # They all have same functionality as the window background intrepreter, but they
  278. # modify the cursor instead of the window.
  279. #
  280. # #============================= Window ======================================#
  281. #
  282. # Warning: Adjusting window's width and height will adjust the content
  283. #          This script is purely graphic, it doesn't include interpreter to adjust
  284. #          content due to various scripts using different naming and measurement
  285. #          for their content
  286. #
  287. # Note: Window_Message's content would do weird stuff when adjusted. I suggest to
  288. #       avoid adjusting Window_Message's window though adding sprite is fine.
  289. #
  290. # How to apply:
  291. #
  292. # - Use window_on(class_type, 'doesnt_need_to_have_actual_picture_here_but_still_insert_something')
  293. # - if window_on isn't used, then flicker will happen.
  294. # - if flicker happens, that means you forgot to use window_on for the particular window
  295. #
  296. # Interpreters that come with window:
  297. #
  298. # window_w_default(class_type) -> Set window to default position, size and depth
  299. # window_w_coordinate(class_type, x, y) -> set window at x, y coordinate
  300. # window_w_change_all(class_type, x, y, w, h) -> set window at x,y coordinate and w,h size
  301. # window_w_move_ori(class_type, x, y) -> move from original position by x,y
  302. # window_w_move_ori(class_type, x, y, w, h) -> move & strech from original position by x,y,w,h
  303. # window_w_center(class_type) -> place window at the center of screen
  304. # window_w_r_pixel(class_type, w, h) -> resize window width and height by w, h
  305. # window_w_r_ratio(class_type, w, h) -> resize window width and height by ratio w, h
  306. # window_w_depth(class_type, z) -> increase window depth by z, put z as negative number to decrease depth
  307. #
  308. # #============================== End =======================================#
  309. #
  310. #  Have Fun!
  311. #
  312. #==============================================================================
  313.  
  314.   #================ Gotta Insert the member function first! ================#
  315.  
  316. class Window
  317.  
  318.   def self.get_all_descendants
  319.  
  320.     ObjectSpace.each_object(Class).select { |klass| klass < self }
  321.  
  322.   end
  323.  
  324. end
  325.  
  326. module Wndw_Cgr #Window Changer
  327.  
  328.   #============================================================================
  329.   #STARTING_SWITCH_POINT
  330.   #Modify this number if script clash with other script(s)
  331.   #If clash still happened, remove this script. Most likely I won't
  332.   #be active for several months.
  333.   #============================================================================
  334.  
  335.   SSP = 500
  336.  
  337.   #============================================================================
  338.   #Folder_Name
  339.   # - Fill it in if you want to keep the picture for 'ALL' windows in 1 folder.
  340.   # - Default folder would be as many as Window types there are (at least 46 folders!)
  341.   #============================================================================
  342.  
  343.   Folder_Name = ''
  344.  
  345.   #============================================================================
  346.   #Special_Window
  347.   # - Fill it in to keep special window in separate folder.
  348.   # - How to fill-in
  349.   #
  350.   # Ex:
  351.   # Special_Window = {Window_Base => 'folder_name',
  352.   #                   Window_Selectable => 'folder_name',
  353.   #                   Window_GameEnd => 'folder_name'}
  354.   #
  355.   #============================================================================
  356.  
  357.   Special_Window = {
  358.                    }
  359.  
  360.   #============================================================================
  361.   # Auto Mode: Default is true
  362.   #            Change to false to add/change window manually
  363.   #            If confused no need to read further! Get out from this script! >:(
  364.   #============================================================================
  365.  
  366.   Auto = true
  367.  
  368.   if Auto
  369.  
  370.     ##============================ Auto Procedure =========================##
  371.  
  372.     Michael_Wndw_Bg_Ary = Hash.new {|h,k| h[k]=[]}
  373.     Michael_Wndw_Cursor = Hash.new {|h,k| h[k]=[]} #I believe there should be a better way
  374.                                                    #but I'm in a bit of rush here. .-.
  375.     Michael_Windows_Ary = Hash.new {|h,k| h[k]=[]} #I really need to hash these hash tables...
  376.  
  377.         #==================== Start Window Initializer =================#
  378.  
  379.     Michael_Wndw_Bg_Ary[Window] << 0                      #indexed for game_switch purpose
  380.     Michael_Wndw_Cursor[Window] << 0
  381.     Michael_Windows_Ary[Window] << 0
  382.  
  383.     Michael_Wndw_Bg_Ary[Window] << "file_name"
  384.     Michael_Wndw_Cursor[Window] << "file_name"
  385.  
  386.     Michael_Wndw_Bg_Ary[Window] << ((Folder_Name == '') ?  #Windows folder should be
  387.     "Graphics\\Windows" : Folder_Name)                     #created unless user only
  388.                                                            #want to put everything in folder.
  389.     Michael_Wndw_Cursor[Window] << ((Folder_Name == '') ?
  390.     "Graphics\\Windows" : Folder_Name)
  391.  
  392.           #================ z, opacity, modify_type ================#
  393.  
  394.     Michael_Wndw_Bg_Ary[Window] << nil << nil << ''
  395.     Michael_Wndw_Cursor[Window] << nil << nil << ''
  396.     Michael_Windows_Ary[Window] << ''
  397.  
  398.           #=========== x, y, rect_x, rect_y, rect_w, rect_h ==========#
  399.  
  400.     Michael_Wndw_Bg_Ary[Window] << nil << nil << nil << nil << nil << nil
  401.     Michael_Wndw_Cursor[Window] << nil << nil << nil << nil << nil << nil
  402.     Michael_Windows_Ary[Window] << nil << nil << nil << nil #Only x, y, w, h necessary
  403.  
  404.  
  405.           #================ extend(zoom) width, height ===============#
  406.  
  407.     Michael_Wndw_Bg_Ary[Window] << nil << nil
  408.     Michael_Wndw_Cursor[Window] << nil << nil
  409.     Michael_Windows_Ary[Window] << nil << nil
  410.  
  411.           #============== color :red :green :blue :alpha =============#
  412.  
  413.     Michael_Wndw_Bg_Ary[Window] << nil << nil << nil << nil
  414.     Michael_Wndw_Cursor[Window] << nil << nil << nil << nil
  415.  
  416.           #======================== add-ons... =======================#
  417.  
  418.     Michael_Windows_Ary[Window] << nil #I forgot about the depth :(
  419.  
  420.         #===================== End Window Initializer ==================#
  421.  
  422.       #================ Start Window Descendants Initializer =============#
  423.  
  424.     Window.get_all_descendants.each.with_index(1) do |derived_classes,i|
  425.  
  426.       Michael_Wndw_Bg_Ary[derived_classes] << i
  427.       Michael_Wndw_Bg_Ary[derived_classes] << "file_name"
  428.       Michael_Wndw_Bg_Ary[derived_classes] <<
  429.       ((Special_Window.has_key?(derived_classes)) ?
  430.       Special_Window[derived_classes] : (Folder_Name == '') ?
  431.       "Graphics\\Windows\\#{derived_classes}" : Folder_Name)
  432.       Michael_Wndw_Bg_Ary[derived_classes] << nil << nil << ''
  433.       Michael_Wndw_Bg_Ary[derived_classes] << nil << nil << nil << nil << nil << nil
  434.       Michael_Wndw_Bg_Ary[derived_classes] << nil << nil
  435.       Michael_Wndw_Bg_Ary[derived_classes] << nil << nil << nil << nil
  436.  
  437.       Michael_Wndw_Cursor[derived_classes] << i
  438.       Michael_Wndw_Cursor[derived_classes] << "file_name"
  439.       Michael_Wndw_Cursor[derived_classes] <<
  440.       ((Special_Window.has_key?(derived_classes)) ?
  441.       Special_Window[derived_classes] : (Folder_Name == '') ?
  442.       "Graphics\\Windows\\#{derived_classes}" : Folder_Name)
  443.       Michael_Wndw_Cursor[derived_classes] << nil << nil << ''
  444.       Michael_Wndw_Cursor[derived_classes] << nil << nil << nil << nil << nil << nil
  445.       Michael_Wndw_Cursor[derived_classes] << nil << nil
  446.       Michael_Wndw_Cursor[derived_classes] << nil << nil << nil << nil
  447.  
  448.       Michael_Windows_Ary[derived_classes] << i
  449.       Michael_Windows_Ary[derived_classes] << ''
  450.       Michael_Windows_Ary[derived_classes] << nil << nil << nil << nil
  451.       Michael_Windows_Ary[derived_classes] << nil << nil
  452.       Michael_Windows_Ary[derived_classes] << nil #I forgot about the depth :(
  453.  
  454.     end
  455.  
  456.       #================= End Window Descendants Initializer ==============#
  457.  
  458.       #============================= Psuedo List =========================#
  459.  
  460.       Wndw_Psuedo_Names = {}
  461.  
  462.   else
  463.  
  464.     ##=========================== Manual Procedure ========================##
  465.  
  466.     #==============================================================================
  467.     # How to Use:
  468.     #  - window_on(window #, 'file_name.extention_name')
  469.     #  For Example:
  470.     #  window_on(6, 'ex.jpg') -> activate window #6 background(window_gold_changer)
  471.     #                            with ex.jpg as the content
  472.     #                         -> Btw, window #6 is Window_Gold
  473.     #                         -> If you want to change the picture, just do the same
  474.     #                            thing, but use different file_name.
  475.     #
  476.     #  - window_off(window #)
  477.     #  For Example:
  478.     #  window_off(5) -> deactivate window #5 background and its content
  479.     #                -> deactivating will hide the background and return the
  480.     #                   window rectangle back to the boring blue color with its
  481.     #                   redundant white padding.
  482.     #
  483.     #  - window_show_all(i) -> JUST USE THIS COMMAND and window_on if you're confused with
  484.     #                          coordination. Basically window_show_all will display
  485.     #                          your picture from the center of the window.
  486.     #                       -> Do I have to use this for every picture that's oversized?
  487.     #                       -> No, just do window_on(6, 'ex.jpg', 'show_all') <<< see the 'show_all'?
  488.     #                          (don't forget the quotation mark)
  489.     #  - window_show_all_move(i, x, y) -> To move the fixed position
  490.     #
  491.     #  - window_center(i)
  492.     #  For Example:
  493.     #  window_center(6) -> Move the window #6 background content to center position
  494.     #                       Default position is at the center (272,208) of the graphic and
  495.     #                       occupy the size of the graphic (if your picture has size
  496.     #                       larger than the graphic (544 x 416), it will fill the graphic)
  497.     #                    -> Make sure that switch is 'on' or else nothing would happen.
  498.     #
  499.     #  - window_move_full(i, x, y, width, height)
  500.     #  For Example:
  501.     #  window_move_full(6, 24, -24, 400, 400)
  502.     #  -> TIPS: If you are not sure how to adjust, the coordinate, starts with
  503.     #           window_move first.
  504.     #  -> move the window #6 background content to (24,-24) position. Remember that
  505.     #     center coordinate is (0,0) and to move up, y needs to be negative, to move
  506.     #     down, y needs to be positive, to move left, x needs to be negative, to move
  507.     #     right, x needs to be positive.
  508.     #  -> width and height are there as a border to make sure that your picture doesn't
  509.     #     go beyond the given size (400 x 400).
  510.     #  -> TIPS: If you don't want to have border, simply set the border to be the
  511.     #           Graphics' height and width.
  512.     #           To set Graphics' height and width:
  513.     #           window_move(5, 24, -24, Graphics.width, Graphics.height)
  514.     #
  515.     #  - window_default(i)
  516.     #  For Example:
  517.     #  window_default(6) -> Turn off movement switch for window #6 background
  518.     #                    -> This will return window #6 to the original position
  519.     #
  520.     #  - window_depth(i, depth)
  521.     #  For Example:
  522.     #  window_depth(6, -1) -> Increases the depthness of window #6 background content
  523.     #                         by -1, which means, if there's other window background
  524.     #                         in the graphic beside window #6 background, that window
  525.     #                         background will appear to be above window #6 background.
  526.     #                      -> Make sure that switch is 'on' or else nothing would happen.
  527.     #
  528.     # - window_opacity(i, opacity)
  529.     # For Example:
  530.     # window_opacity(6, 0) -> Set window #6 background opacity to 0 (100% transparent).
  531.     #                      -> Opacity value is from 0 (fully see-through) to 255 (solid).
  532.     #                      -> Make sure that switch is 'on' or else nothing would happen.
  533.     #                      -> Default opacity is 255 when window background is on.
  534.     #
  535.     #  There might be some features that I haven't discussed here in the manual section
  536.     #  but that's because I believe that you have read the auto-section first, and basically
  537.     #  you should be able to see the pattern by now. If you couldn't see the pattern, then
  538.     #  I would suggest that you play around with the auto first before start tweaking around.
  539.     #
  540.     #
  541.     #==============================================================================
  542.  
  543.     #============================================================================
  544.     # Windows Changer = USE Game_Interpret for activation (scroll all the way
  545.     #                   down for the key words (window_on and window_off))
  546.     # Use the element # list below for 'window #'.
  547.     #
  548.     # Default Switch = off (switch only available for activate windows)
  549.     # This is for Original Windows - Scroll Down for Windows from other scripts
  550.     # the array stores these values:
  551.     # [window number,
  552.     #  file_name,
  553.     #  file_directory,
  554.     #  sprite.z,
  555.     #  sprite.opacity,
  556.     #  sprite.type_of_movement_change,
  557.     #  sprite.x,
  558.     #  sprite.y,
  559.     #  sprite.src_rect.x,
  560.     #  sprite.src_rect.y,
  561.     #  sprite.src_rect.width,
  562.     #  sprite.src_rect.height]
  563.     #============================================================================
  564.     Michael_Wndw_Bg_Ary = { #Window Background Array
  565.     Window =>
  566.     [0,"Element #0","Graphics\\Windows",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  567.     Window_Base =>
  568.     [1,"Element #1","Graphics\\Windows\\Window_Base",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  569.     Window_Selectable =>
  570.     [2,"Element #2","Graphics\\Windows\\Window_Selectable",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  571.     Window_Command =>
  572.     [3,"Element #3","Graphics\\Windows\\Window_Command",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  573.     Window_HorzCommand =>
  574.     [4,"Element #4","Graphics\\Windows\\Window_HorzCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  575.     Window_Help =>
  576.     [5,"Element #5","Graphics\\Windows\\Window_Help",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  577.     Window_Gold =>
  578.     [6,"Element #6","Graphics\\Windows\\Window_Gold",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  579.     Window_MenuCommand =>
  580.     [7,"Element #7","Graphics\\Windows\\Window_MenuCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  581.     Window_MenuStatus =>
  582.     [8,"Element #8","Graphics\\Windows\\Window_MenuStatus",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  583.     Window_MenuActor =>
  584.     [9,"Element #9","Graphics\\Windows\\Window_MenuActor",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  585.     Window_ItemCategory =>
  586.     [10,"Element #10","Graphics\\Windows\\Window_ItemCategory",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  587.     Window_ItemList =>
  588.     [11,"Element #11","Graphics\\Windows\\Window_ItemList",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  589.     Window_SkillCommand =>
  590.     [12,"Element #12","Graphics\\Windows\\Window_SkillCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  591.     Window_SkillStatus =>
  592.     [13,"Element #13","Graphics\\Windows\\Window_SkillStatus",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  593.     Window_SkillList =>
  594.     [14,"Element #14","Graphics\\Windows\\Window_SkillList",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  595.     Window_EquipStatus =>
  596.     [15,"Element #15","Graphics\\Windows\\Window_EquipStatus",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  597.     Window_EquipCommand =>
  598.     [16,"Element #16","Graphics\\Windows\\Window_EquipCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  599.     Window_EquipSlot =>
  600.     [17,"Element #17","Graphics\\Windows\\Window_EquipSlot",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  601.     Window_EquipItem =>
  602.     [18,"Element #18","Graphics\\Windows\\Window_EquipItem",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  603.     Window_Status =>
  604.     [19,"Element #19","Graphics\\Windows\\Window_Status",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  605.     Window_SaveFile =>
  606.     [20,"Element #20","Graphics\\Windows\\Window_SaveFile",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  607.     Window_ShopCommand =>
  608.     [21,"Element #21","Graphics\\Windows\\Window_ShopCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  609.     Window_ShopBuy =>
  610.     [22,"Element #22","Graphics\\Windows\\Window_ShopBuy",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  611.     Window_ShopSell =>
  612.     [23,"Element #23","Graphics\\Windows\\Window_ShopSell",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  613.     Window_ShopNumber =>
  614.     [24,"Element #24","Graphics\\Windows\\Window_ShopNumber",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  615.     Window_ShopStatus =>
  616.     [25,"Element #25","Graphics\\Windows\\Window_ShopStatus",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  617.     Window_NameEdit =>
  618.     [26,"Element #26","Graphics\\Windows\\Window_NameEdit",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  619.     Window_NameInput =>
  620.     [27,"Element #27","Graphics\\Windows\\Window_NameInput",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  621.     Window_ChoiceList =>
  622.     [28,"Element #28","Graphics\\Windows\\Window_ChoiceList",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  623.     Window_NumberInput =>
  624.     [29,"Element #29","Graphics\\Windows\\Window_NumberInput",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  625.     Window_KeyItem =>
  626.     [30,"Element #30","Graphics\\Windows\\Window_KeyItem",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  627.     Window_Message =>
  628.     [31,"Element #31","Graphics\\Windows\\Window_Message",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  629.     Window_ScrollText =>
  630.     [32,"Element #32","Graphics\\Windows\\Window_ScrollText",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  631.     Window_MapName =>
  632.     [33,"Element #33","Graphics\\Windows\\Window_MapName",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  633.     Window_BattleLog =>
  634.     [34,"Element #34","Graphics\\Windows\\Window_BattleLog",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  635.     Window_PartyCommand =>
  636.     [35,"Element #35","Graphics\\Windows\\Window_PartyCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  637.     Window_ActorCommand =>
  638.     [36,"Element #36","Graphics\\Windows\\Window_ActorCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  639.     Window_BattleStatus =>
  640.     [37,"Element #37","Graphics\\Windows\\Window_BattleStatus",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  641.     Window_BattleActor =>
  642.     [38,"Element #38","Graphics\\Windows\\Window_BattleActor",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  643.     Window_BattleEnemy =>
  644.     [39,"Element #39","Graphics\\Windows\\Window_BattleEnemy",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  645.     Window_BattleSkill =>
  646.     [40,"Element #40","Graphics\\Windows\\Window_BattleSkill",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  647.     Window_BattleItem =>
  648.     [41,"Element #41","Graphics\\Windows\\Window_BattleItem",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  649.     Window_TitleCommand =>
  650.     [42,"Element #42","Graphics\\Windows\\Window_TitleCommand",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  651.     Window_GameEnd =>
  652.     [43,"Element #43","Graphics\\Windows\\Window_GameEnd",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  653.     Window_DebugLeft =>
  654.     [44,"Element #44","Graphics\\Windows\\Window_DebugLeft",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  655.     Window_DebugRight =>
  656.     [45,"Element #45","Graphics\\Windows\\Window_DebugRight",nil,nil,nil,nil,nil,nil,nil,nil,nil],
  657.     }  #Add more elements manually here
  658.  
  659.     NOE = 46 #NUMBER_OF_ELEMENT
  660.              #Modify this number as more elements are added
  661.   end
  662.  
  663. end
  664.  
  665. #==============================================================================
  666. # Cache
  667. #==============================================================================
  668.  
  669. module Cache
  670.  
  671.   def self.cache_extended(folder, filename)
  672.  
  673.     load_bitmap("#{folder}/", "#{filename}")
  674.  
  675.   end
  676.  
  677. end
  678.  
  679. #==============================================================================
  680. # Window
  681. #==============================================================================
  682.  
  683. class Window
  684.  
  685.   attr_accessor :oh_I_got_changed
  686.   attr_accessor :michael_bg_vp
  687.   attr_accessor :michael_bg_sp
  688.   attr_accessor :michael_cursor_rect
  689.   attr_accessor :michael_x_offset
  690.   attr_accessor :michael_y_offset
  691.   attr_accessor :michael_w_offset
  692.   attr_accessor :michael_h_offset
  693.   attr_accessor :michael_ary_dup
  694.  
  695.   alias michael_Window_initialize initialize
  696.   alias michael_Window_update update
  697.   alias michael_Window_dispose dispose
  698.   alias michael_sp_visible_asgn visible=
  699.   alias michael_sp_openness_asgn openness=
  700.   alias michael_sp_x_asgn x=
  701.   alias michael_sp_y_asgn y=
  702.   alias michael_sp_width_asgn width=
  703.   alias michael_sp_height_asgn height=
  704.  
  705.   def initialize(w_x, w_y, w_w, w_h)
  706.  
  707.     self.oh_I_got_changed = false
  708.  
  709.     initialize_window_offset
  710.  
  711.     update_michael_window_offset($game_message.michael_windows_ary[self.class],
  712.                                  w_x, w_y, w_w, w_h)
  713.  
  714.     self.michael_ary_dup = $game_message.michael_windows_ary[self.class].dup
  715.  
  716.     create_michael_bg_sp(w_x + self.michael_x_offset,
  717.                          w_y + self.michael_y_offset,
  718.                          w_w + self.michael_w_offset,
  719.                          w_h + self.michael_h_offset)
  720.  
  721.     michael_Window_initialize(w_x + self.michael_x_offset,
  722.                               w_y + self.michael_y_offset,
  723.                               w_w + self.michael_w_offset,
  724.                               w_h + self.michael_h_offset)
  725.  
  726.     update_michael_window_depth($game_message.michael_windows_ary[self.class])
  727.  
  728.     create_michael_bg_vp
  729.  
  730.     self.michael_bg_sp.michael_sp_updt(self, $game_message.michael_wndw_bg_ary[self.class])
  731.  
  732.     customize_michael_cursor_rect(w_x + self.michael_x_offset,
  733.                                   w_y + self.michael_y_offset)
  734.  
  735.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_updt(self, $game_message.michael_wndw_cursor[self.class])
  736.  
  737.     @do_usual_update_once = true
  738.  
  739.   end
  740.  
  741.    #======================== Start Operator Overloading ========================#
  742.  
  743.   def visible=(arg)
  744.  
  745.     self.michael_sp_visible_asgn(arg)
  746.     self.michael_bg_sp.visible = (self.open? && self.visible)
  747.  
  748.     unless $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  749.  
  750.       self.michael_bg_sp.visible = false
  751.       cursor_rect.michael_cursor_rect_bg_sp.visible = false
  752.  
  753.     end
  754.  
  755.   end
  756.  
  757.   def openness=(arg)
  758.  
  759.     self.michael_sp_openness_asgn(arg)
  760.     self.michael_bg_sp.visible = (self.open? && self.visible)
  761.  
  762.     unless $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  763.  
  764.       self.michael_bg_sp.visible = false
  765.       cursor_rect.michael_cursor_rect_bg_sp.visible = false
  766.  
  767.     end
  768.  
  769.   end
  770.  
  771.   def x=(arg)
  772.  
  773.     if $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  774.  
  775.       michael_update_x_offset(arg, $game_message.michael_windows_ary[self.class])
  776.       self.michael_sp_x_asgn(arg + self.michael_x_offset)
  777.       self.michael_bg_sp.x = arg + self.michael_x_offset
  778.       self.cursor_rect.michael_cursor_rect_bg_sp.x = arg +
  779.       self.cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_x_offset +
  780.       self.michael_x_offset
  781.  
  782.     else; self.michael_sp_x_asgn(arg); end
  783.  
  784.   end
  785.  
  786.   def y=(arg)
  787.  
  788.     if $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  789.  
  790.       michael_update_y_offset(arg, $game_message.michael_windows_ary[self.class])
  791.       self.michael_sp_y_asgn(arg + self.michael_y_offset)
  792.       self.michael_bg_sp.y = arg + self.michael_y_offset
  793.       self.cursor_rect.michael_cursor_rect_bg_sp.y = arg +
  794.       self.cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_y_offset +
  795.       self.michael_y_offset
  796.  
  797.     else; self.michael_sp_y_asgn(arg); end
  798.  
  799.   end
  800.  
  801.   def width=(arg)
  802.  
  803.     if $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  804.  
  805.       michael_update_w_offset(arg, $game_message.michael_windows_ary[self.class])
  806.       self.michael_sp_width_asgn(arg + self.michael_w_offset)
  807.       self.michael_bg_sp.src_rect.width = arg + self.michael_w_offset
  808.  
  809.     else; self.michael_sp_width_asgn(arg); end
  810.  
  811.   end
  812.  
  813.   def height=(arg)
  814.  
  815.     if $game_switches[Wndw_Cgr::SSP + $game_message.michael_wndw_bg_ary[self.class][0]]
  816.  
  817.       michael_update_h_offset(arg, $game_message.michael_windows_ary[self.class])
  818.       self.michael_sp_height_asgn(arg + self.michael_h_offset)
  819.       self.michael_bg_sp.src_rect.height = arg + self.michael_h_offset
  820.  
  821.     else; self.michael_sp_height_asgn(arg); end
  822.  
  823.   end
  824.  
  825.   #========================= End Operator Overloading =========================#
  826.  
  827.   #============================ Start New Methods ============================#
  828.  
  829.   def initialize_window_offset
  830.  
  831.     self.michael_x_offset = 0
  832.     self.michael_y_offset = 0
  833.     self.michael_w_offset = 0
  834.     self.michael_h_offset = 0
  835.  
  836.   end
  837.  
  838.   def update_michael_window_offset(i, w_x = nil, w_y = nil, w_w = nil, w_h = nil)
  839.  
  840.     i[1].match('mtype') do
  841.  
  842.       i[1].match('mtype_coordinate__') do
  843.  
  844.         if w_x
  845.  
  846.           self.michael_x_offset = i[2] - w_x
  847.           self.michael_y_offset = i[3] - w_y
  848.  
  849.         else
  850.  
  851.           self.michael_x_offset = i[2] - self.x
  852.           self.michael_y_offset = 1[3] - self.y
  853.  
  854.         end
  855.  
  856.       end
  857.  
  858.       i[1].match('mtype_everything__') do
  859.  
  860.         if w_x
  861.  
  862.           self.michael_x_offset = i[2] - w_x
  863.           self.michael_y_offset = i[3] - w_y
  864.           self.michael_w_offset = i[4] - w_w
  865.           self.michael_h_offset = i[5] - w_h
  866.  
  867.         else
  868.  
  869.           self.michael_x_offset = i[2] - self.x
  870.           self.michael_y_offset = 1[3] - self.y
  871.           self.michael_w_offset = i[4] - self.width
  872.           self.michael_h_offset = i[5] - self.height
  873.  
  874.         end
  875.  
  876.       end
  877.  
  878.       i[1].match('mtype_extend_original__') do
  879.  
  880.         self.michael_x_offset = i[2]
  881.         self.michael_y_offset = i[3]
  882.         self.michael_w_offset = i[4] unless i[4].nil?
  883.         self.michael_h_offset = i[5] unless i[5].nil?
  884.  
  885.       end
  886.  
  887.       i[1].match('mtype_center__') do
  888.  
  889.         if w_x
  890.  
  891.           self.michael_x_offset = 272 - w_x - w_w / 2
  892.           self.michael_y_offset = 208 - w_y - w_h / 2
  893.  
  894.         else
  895.  
  896.           self.michael_x_offset = 272 - self.x - self.width / 2
  897.           self.michael_y_offset = 208 - self.y - self.height / 2
  898.  
  899.         end
  900.  
  901.       end
  902.  
  903.     end
  904.  
  905.     i[1].match('rtype') do
  906.  
  907.       i[1].match('rtype_by_integer__') do
  908.  
  909.         if w_w
  910.  
  911.           self.michael_w_offset = i[6] - w_w
  912.           self.michael_h_offset = i[7] - w_h
  913.  
  914.         else
  915.  
  916.           self.michael_w_offset = i[6] - self.width
  917.           self.michael_h_offset = i[7] - self.height
  918.  
  919.         end
  920.  
  921.       end
  922.  
  923.       i[1].match('rtype_by_ratio__') do
  924.  
  925.         if w_w
  926.  
  927.           self.michael_w_offset = w_w * (i[6] - 1)
  928.           self.michael_h_offset = w_h * (i[7] - 1)
  929.  
  930.         else
  931.  
  932.           self.michael_w_offset = self.width * (i[6] - 1)
  933.           self.michael_h_offset = self.height * (i[7] - 1)
  934.  
  935.         end
  936.  
  937.       end
  938.  
  939.     end
  940.  
  941.   end
  942.  
  943.   def michael_update_x_offset(a_v, i) #assigned value
  944.  
  945.     i[1].match('mtype') do
  946.  
  947.       i[1].match('mtype_coordinate__') do; self.michael_x_offset = i[2] - a_v; end
  948.  
  949.       i[1].match('mtype_everything__') do; self.michael_x_offset = i[2] - a_v; end
  950.  
  951.       i[1].match('mtype_extend_original__') do; self.michael_x_offset = i[2]; end
  952.  
  953.       i[1].match('mtype_center__') do; self.michael_x_offset = 272 - a_v - self.width / 2; end
  954.  
  955.     end
  956.  
  957.   end
  958.  
  959.   def michael_update_y_offset(a_v, i)
  960.  
  961.     i[1].match('mtype') do
  962.  
  963.       i[1].match('mtype_coordinate__') do; self.michael_y_offset = i[3] - a_v; end
  964.  
  965.       i[1].match('mtype_everything__') do; self.michael_y_offset = i[3] - a_v; end
  966.  
  967.       i[1].match('mtype_extend_original__') do; self.michael_y_offset = i[3]; end
  968.  
  969.       i[1].match('mtype_center__') do; self.michael_y_offset = 208 - a_v - self.width / 2; end
  970.  
  971.     end
  972.  
  973.   end
  974.  
  975.   def michael_update_w_offset(a_v, i)
  976.  
  977.     i[1].match('mtype') do
  978.  
  979.       i[1].match('mtype_everything__') do; self.michael_w_offset = i[4] - a_v; end
  980.  
  981.       i[1].match('mtype_extend_original__') do; self.michael_w_offset = i[4] unless i[4].nil?; end
  982.  
  983.     end
  984.  
  985.     i[1].match('rtype') do
  986.  
  987.       i[1].match('rtype_by_integer__') do; self.michael_w_offset = i[6] - a_v; end
  988.  
  989.       i[1].match('rtype_by_original__') do; self.michael_w_offset = i[6]; end
  990.  
  991.       i[1].match('rtype_by_ratio__') do; self.michael_w_offset = a_v * (i[6] - 1); end
  992.  
  993.     end
  994.  
  995.   end
  996.  
  997.   def michael_update_h_offset(a_v, i)
  998.  
  999.     i[1].match('mtype') do
  1000.  
  1001.       i[1].match('mtype_everything__') do; self.michael_h_offset = i[5] - a_v; end
  1002.  
  1003.       i[1].match('mtype_extend_original__') do; self.michael_h_offset = i[5] unless i[5].nil?; end
  1004.  
  1005.     end
  1006.  
  1007.     i[1].match('rtype') do
  1008.  
  1009.       i[1].match('rtype_by_integer__') do; self.michael_h_offset = i[7] - a_v; end
  1010.  
  1011.       i[1].match('rtype_by_original__') do; self.michael_h_offset = i[7]; end
  1012.  
  1013.       i[1].match('rtype_by_ratio__') do; self.michael_h_offset = a_v * (i[7] - 1); end
  1014.  
  1015.     end
  1016.  
  1017.   end
  1018.  
  1019.   def create_michael_bg_sp(w_x = nil, w_y = nil, w_w = nil, w_h = nil)
  1020.  
  1021.     self.michael_bg_sp = Sprite.new
  1022.     self.michael_bg_sp.x = w_x unless w_x.nil?
  1023.     self.michael_bg_sp.y = w_y unless w_y.nil?
  1024.     self.michael_bg_sp.src_rect.width = w_w unless w_w.nil?
  1025.     self.michael_bg_sp.src_rect.height = w_h unless w_h.nil?
  1026.  
  1027.   end
  1028.  
  1029.   def update_michael_window_depth(i)
  1030.  
  1031.     self.z += i[8] unless i[8].nil?
  1032.  
  1033.   end
  1034.  
  1035.   def create_michael_bg_vp
  1036.  
  1037.     self.michael_bg_vp = Viewport.new  #The only locations where new member functions are created
  1038.     self.michael_bg_vp.z = self.z - 1  #are class Window_Base, class Sprite, module Cache
  1039.                                        #and class Game_Interpreter. Everything else is aliased.
  1040.  
  1041.   end
  1042.  
  1043.   def customize_michael_cursor_rect(w_x, w_y)
  1044.  
  1045.     cursor_rect.michael_nickname_the_cursor_rect = 'cursor_rect'
  1046.     initialize_michael_cursor_bg_sp
  1047.     initialize_michael_cursor_bg_sp_offset
  1048.     initialize_michael_cursor_bg_ppt(w_x, w_y)
  1049.  
  1050.   end
  1051.  
  1052.   def initialize_michael_cursor_bg_sp
  1053.  
  1054.     cursor_rect.michael_cursor_rect_bg_sp = Sprite.new
  1055.     cursor_rect.michael_cursor_rect_bg_sp.visible = false
  1056.  
  1057.   end
  1058.  
  1059.   def initialize_michael_cursor_bg_sp_offset
  1060.  
  1061.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_x_offset = 0
  1062.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_y_offset = 0
  1063.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_w_offset = 0
  1064.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_h_offset = 0
  1065.  
  1066.   end
  1067.  
  1068.   def initialize_michael_cursor_bg_ppt(w_x, w_y)
  1069.  
  1070.     cursor_rect.michael_cursor_rect_bg_sp.viewport = michael_bg_vp
  1071.     cursor_rect.michael_cursor_rect_bg_sp.src_rect.width = cursor_rect.width
  1072.     cursor_rect.michael_cursor_rect_bg_sp.src_rect.height = cursor_rect.height
  1073.     cursor_rect.michael_cursor_rect_bg_sp.x = w_x +
  1074.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_x_offset #I'll need a better naming convention here .-.
  1075.     cursor_rect.michael_cursor_rect_bg_sp.y = w_y +
  1076.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_sp_y_offset
  1077.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_updt(self, $game_message.michael_wndw_cursor[self.class])
  1078.  
  1079.   end
  1080.  
  1081.   def reset_michael_offset
  1082.  
  1083.     self.x -= self.michael_x_offset
  1084.     self.y -= self.michael_y_offset
  1085.     self.width -= self.michael_w_offset
  1086.     self.height -= self.michael_h_offset
  1087.     #self.michael_sp_x_asgn(self.x - self.michael_x_offset)
  1088.     #self.michael_sp_y_asgn(self.y - self.michael_y_offset)
  1089.     #self.michael_sp_width_asgn(self.width - self.michael_w_offset)
  1090.     #self.michael_sp_height_asgn(self.height - self.michael_h_offset)
  1091.  
  1092.   end
  1093.  
  1094.   def apply_michael_offset
  1095.  
  1096.     self.x += self.michael_x_offset
  1097.     self.y += self.michael_y_offset
  1098.     self.width += self.michael_w_offset
  1099.     self.height += self.michael_h_offset
  1100.     #self.michael_sp_x_asgn(self.x + self.michael_x_offset)
  1101.     #self.michael_sp_y_asgn(self.y + self.michael_y_offset)
  1102.     #self.michael_sp_width_asgn(self.width + self.michael_w_offset)
  1103.     #self.michael_sp_height_asgn(self.height + self.michael_h_offset)
  1104.  
  1105.   end
  1106.  
  1107.   def did_I_get_changed?
  1108.  
  1109.     return self.oh_I_got_changed
  1110.  
  1111.   end
  1112.  
  1113.   def change_me_by_michael
  1114.  
  1115.     self.oh_I_got_changed = true
  1116.  
  1117.   end
  1118.  
  1119.   #============================= End New Methods =============================#
  1120.  
  1121.   def dispose                                  #Everything is disposed here
  1122.                                                #Basically every window made,
  1123.     self.michael_bg_sp.dispose                 #1 viewport and 1 sprite are also made
  1124.     cursor_rect.michael_cursor_rect_bg_sp.dispose
  1125.     self.michael_bg_vp.dispose
  1126.     michael_Window_dispose
  1127.  
  1128.   end
  1129.  
  1130.   def update
  1131.  
  1132.     michael_Window_update
  1133.     if self.michael_ary_dup != $game_message.michael_windows_ary[self.class]
  1134.       self.michael_ary_dup = $game_message.michael_windows_ary[self.class]
  1135.       reset_michael_offset
  1136.       update_michael_window_offset(self.michael_ary_dup)
  1137.       update_michael_window_depth($game_message.michael_windows_ary[self.class])
  1138.       apply_michael_offset
  1139.     else
  1140.       if @do_usual_update_once
  1141.         @do_usual_update_once = false
  1142.         reset_michael_offset
  1143.         update_michael_window_offset(self.michael_ary_dup)
  1144.         update_michael_window_depth($game_message.michael_windows_ary[self.class])
  1145.         apply_michael_offset
  1146.       end
  1147.     end
  1148.     self.michael_bg_sp.michael_sp_updt(self, $game_message.michael_wndw_bg_ary[self.class])
  1149.     cursor_rect.michael_cursor_rect_bg_sp.michael_cursor_updt(self, $game_message.michael_wndw_cursor[self.class])
  1150.  
  1151.   end
  1152.  
  1153. end
  1154.  
  1155. #==============================================================================
  1156. # Sprite
  1157. #==============================================================================
  1158.  
  1159. class Sprite
  1160.  
  1161.   attr_accessor :michael_sp_ppts_dup
  1162.   attr_accessor :michael_sp_x_offset
  1163.   attr_accessor :michael_sp_y_offset
  1164.   attr_accessor :michael_cursor_sp_x_offset
  1165.   attr_accessor :michael_cursor_sp_y_offset
  1166.   attr_accessor :michael_cursor_sp_w_offset
  1167.   attr_accessor :michael_cursor_sp_h_offset
  1168.   attr_accessor :_I_do_have_bitmap
  1169.  
  1170.   def michael_sp_updt(wndw, i, cursor = 'none')
  1171.  
  1172.     $game_switches[Wndw_Cgr::SSP + i[0]] ? michael_bg_on(wndw,i, cursor) : michael_bg_off(wndw, i)
  1173.  
  1174.   end
  1175.  
  1176.   def michael_bg_on(window, i, cursor)
  1177.  
  1178.     self.michael_sp_ppts_dup = [nil, '', '', nil, nil, '', nil, nil, nil, nil,
  1179.                                 nil, nil, nil, nil, nil, nil, nil, nil] if self.michael_sp_ppts_dup.nil?
  1180.  
  1181.     michael_set_self_vp(window)
  1182.     michael_save_wndw_opa(window) unless window.did_I_get_changed?
  1183.     michael_clear_wndw_opa(window)
  1184.     michael_mandatory_update(window)
  1185.     michael_apply_change(window, i, cursor)
  1186.  
  1187.   end
  1188.  
  1189.   def michael_set_self_vp(window)
  1190.  
  1191.     self.viewport = (window.viewport) ? window.viewport : window.michael_bg_vp
  1192.  
  1193.   end
  1194.  
  1195.   def michael_save_wndw_opa(window)
  1196.  
  1197.     @michael_wndw_b_opa = window.back_opacity unless window.back_opacity.nil?
  1198.     @michael_wndw_opa = window.opacity unless window.opacity.nil?
  1199.  
  1200.   end
  1201.  
  1202.   def michael_clear_wndw_opa(window)
  1203.  
  1204.     window.back_opacity = 0 unless window.back_opacity.nil?
  1205.     window.opacity = 0 unless window.opacity.nil?
  1206.     window.change_me_by_michael
  1207.  
  1208.   end
  1209.  
  1210.   def michael_mandatory_update(window)
  1211.  
  1212.     self.x = window.x
  1213.     self.src_rect.x = 0 if self.x < 0
  1214.  
  1215.     self.y = window.y
  1216.     self.src_rect.y = 0 if self.y < 0
  1217.  
  1218.     self.visible = (window.open? && window.visible)
  1219.  
  1220.   end
  1221.  
  1222.   def michael_apply_change(window, i, cursor)
  1223.  
  1224.     unless i[1] == 'THIS_IS_A_BLANK_PICTURE_YES_USER_WANTS_A_BLANK_WINDOW_ONLY'
  1225.       michael_set_dflt_ppts(window, i, cursor) #SET DEFAULT PROPERTIES
  1226.       michael_modify_self(window, i) if i[5] != '' && self._I_do_have_bitmap
  1227.     else
  1228.       self.visible = false
  1229.     end
  1230.  
  1231.   end
  1232.  
  1233.   def michael_set_dflt_ppts(window, i, cursor)
  1234.  
  1235.     #======================= Where picture is loaded =======================#
  1236.  
  1237.     begin
  1238.  
  1239.       if self.michael_sp_ppts_dup[1] != i[1] ||
  1240.          self.michael_sp_ppts_dup[2] != i[2]
  1241.  
  1242.  
  1243.  
  1244.         if cursor == 'select'
  1245.           self.bitmap = Cache.cache_extended( i[2], (i[1] + '_select'))
  1246.         elsif cursor == 'unselect'
  1247.           self.bitmap = Cache.cache_extended( i[2], (i[1] + '_unselect'))
  1248.         else
  1249.           self.bitmap = Cache.cache_extended( i[2], i[1])
  1250.         end
  1251.  
  1252.         self._I_do_have_bitmap = true
  1253.  
  1254.         self.michael_sp_ppts_dup = i.dup
  1255.  
  1256.       end
  1257.  
  1258.       self.viewport.z += i[3] unless i[3].nil?
  1259.  
  1260.       self.opacity = i[4] if (self.visible) && !(i[4].nil?)
  1261.  
  1262.  
  1263.       unless i[5].match('rtype')
  1264.  
  1265.         #============================ Resized ============================#
  1266.  
  1267.         store_sp_w_float = self.bitmap.width.to_f
  1268.         store_sp_h_float = self.bitmap.height.to_f
  1269.  
  1270.         if window.is_a?(Rect)
  1271.  
  1272.           store_wndw_w_float = michael_cursor_sp_w_offset.to_f
  1273.           store_wndw_h_float = michael_cursor_sp_h_offset.to_f
  1274.  
  1275.         else
  1276.  
  1277.           store_wndw_w_float = window.width.to_f
  1278.           store_wndw_h_float = window.height.to_f
  1279.  
  1280.         end
  1281.  
  1282.         self.zoom_x = store_wndw_w_float / store_sp_w_float
  1283.         self.zoom_y = store_wndw_h_float / store_sp_h_float
  1284.         self.src_rect.width = self.bitmap.width
  1285.         self.src_rect.height = self.bitmap.height
  1286.  
  1287.       end
  1288.  
  1289.     rescue
  1290.  
  1291.       michael_bg_off(window, i) if window.is_a?(Window)
  1292.       michael_cursor_off(i) if window.is_a?(Rect)
  1293.  
  1294.     end
  1295.  
  1296.   end
  1297.  
  1298.   def michael_modify_self(window, i)
  1299.  
  1300.     i[5].match('mtype') do
  1301.  
  1302.       if window.is_a?(Rect)
  1303.  
  1304.         i[5].match('mtype_show_all__') do
  1305.  
  1306.           self.x -= ((self.bitmap.width - michael_cursor_sp_w_offset) / 2)
  1307.           self.src_rect.x = 0 if self.x < 0
  1308.           self.y -= ((self.bitmap.height - michael_cursor_sp_h_offset) / 2)
  1309.           self.src_rect.y = 0 if self.y < 0
  1310.           self.src_rect.width = self.bitmap.width
  1311.           self.src_rect.height = self.bitmap.height
  1312.  
  1313.         end
  1314.  
  1315.         i[5].match('mtype_move__') do
  1316.  
  1317.           self.x += (i[6] - ((self.bitmap.width - michael_cursor_sp_w_offset) / 2))
  1318.           self.src_rect.x = 0 if self.x < 0
  1319.           self.y += (i[7] - ((self.bitmap.height - michael_cursor_sp_h_offset) / 2))
  1320.           self.src_rect.y = 0 if self.y < 0
  1321.           self.src_rect.width = self.bitmap.width
  1322.           self.src_rect.height = self.bitmap.height
  1323.  
  1324.         end
  1325.  
  1326.         i[5].match('mtype_move_origin__') do
  1327.  
  1328.           self.x += i[6]
  1329.           self.src_rect.x = 0 if self.x < 0
  1330.           self.y += i[7]
  1331.           self.src_rect.y = 0 if self.y < 0
  1332.  
  1333.         end
  1334.  
  1335.       else
  1336.  
  1337.         i[5].match('mtype_show_all__') do
  1338.  
  1339.           self.x -= ((self.bitmap.width - window.width) / 2)
  1340.           self.src_rect.x = 0 if self.x < 0
  1341.           self.y -= ((self.bitmap.height - window.height) / 2)
  1342.           self.src_rect.y = 0 if self.y < 0
  1343.           self.src_rect.width = self.bitmap.width
  1344.           self.src_rect.height = self.bitmap.height
  1345.  
  1346.         end
  1347.  
  1348.         i[5].match('mtype_move__') do
  1349.  
  1350.           self.x += (i[6] - ((self.bitmap.width - window.width) / 2))
  1351.           self.src_rect.x = 0 if self.x < 0
  1352.           self.y += (i[7] - ((self.bitmap.height - window.height) / 2))
  1353.           self.src_rect.y = 0 if self.y < 0
  1354.           self.src_rect.width = self.bitmap.width
  1355.           self.src_rect.height = self.bitmap.height
  1356.  
  1357.         end
  1358.  
  1359.         i[5].match('mtype_move_origin__') do
  1360.  
  1361.           self.x += i[6]
  1362.           self.src_rect.x = 0 if self.x < 0
  1363.           self.y += i[7]
  1364.           self.src_rect.y = 0 if self.y < 0
  1365.  
  1366.         end
  1367.  
  1368.         i[5].match('mtype_center__') do
  1369.  
  1370.           self.x = (Graphics.width - self.bitmap.width) / 2
  1371.           self.src_rect.x = 0 if self.x < 0
  1372.           self.y = (Graphics.height - self.bitmap.height) / 2
  1373.           self.src_rect.y = 0 if self.y < 0
  1374.           self.src_rect.width = self.bitmap.width
  1375.           self.src_rect.height = self.bitmap.height
  1376.  
  1377.         end
  1378.  
  1379.         i[5].match('mtype_move_all__') do
  1380.  
  1381.           self.x = i[6]
  1382.           self.y = i[7]
  1383.           self.src_rect.x = i[8]
  1384.           self.src_rect.y = i[9]
  1385.           self.src_rect.width = i[10]
  1386.           self.src_rect.height = i[11]
  1387.  
  1388.         end
  1389.  
  1390.       end
  1391.  
  1392.     end
  1393.  
  1394.  
  1395.     i[5].match('rtype') do
  1396.  
  1397.       if window.is_a?(Rect)
  1398.  
  1399.         i[5].match('rtype_window_width__') do
  1400.  
  1401.           #============================ Resized ============================#
  1402.  
  1403.           store_sp_w_float = self.bitmap.width.to_f
  1404.           store_sp_h_float = self.bitmap.height.to_f
  1405.           store_wndw_w_float = michael_cursor_sp_w_offset.to_f
  1406.           store_wndw_h_float = michael_cursor_sp_h_offset.to_f
  1407.  
  1408.           self.zoom_x = store_wndw_w_float / store_sp_w_float
  1409.           self.zoom_y = store_wndw_w_float / store_sp_w_float
  1410.           self.src_rect.width = self.bitmap.width
  1411.           self.src_rect.height = self.bitmap.height
  1412.  
  1413.           #=========================== Relocate ============================#
  1414.  
  1415.           self.y += ((michael_cursor_sp_w_offset - self.bitmap.height) / 2)
  1416.           self.src_rect.y = 0 if self.y < 0
  1417.  
  1418.         end
  1419.  
  1420.         i[5].match('rtype_window_height__') do
  1421.  
  1422.           #============================ Resized ============================#
  1423.  
  1424.           store_sp_w_float = self.bitmap.width.to_f
  1425.           store_sp_h_float = self.bitmap.height.to_f
  1426.           store_wndw_w_float = michael_cursor_sp_w_offset.to_f
  1427.           store_wndw_h_float = michael_cursor_sp_h_offset.to_f
  1428.  
  1429.           self.zoom_x = store_wndw_h_float / store_sp_h_float
  1430.           self.zoom_y = store_wndw_h_float / store_sp_h_float
  1431.           self.src_rect.width = self.bitmap.width
  1432.           self.src_rect.height = self.bitmap.height
  1433.  
  1434.           #=========================== Relocate ============================#
  1435.  
  1436.           self.x -= ((store_sp_w_float * (store_wndw_h_float / store_sp_h_float) -
  1437.           store_sp_w_float) / 2)
  1438.           self.src_rect.x = 0 if self.x < 0
  1439.  
  1440.         end
  1441.  
  1442.         i[5].match('rtype_actual_pixel__') do
  1443.  
  1444.           #============================ Resized ============================#
  1445.  
  1446.           store_sp_w_float = self.bitmap.width.to_f
  1447.           store_sp_h_float = self.bitmap.height.to_f
  1448.  
  1449.           self.zoom_x = i[12]
  1450.           self.zoom_y = i[13]
  1451.           self.src_rect.width = self.bitmap.width
  1452.           self.src_rect.height = self.bitmap.height
  1453.  
  1454.  
  1455.           #=========================== Relocate ============================#
  1456.  
  1457.           self.x -=((i[12] * store_sp_w_float - store_sp_w_float) / 2)
  1458.           self.src_rect.x = 0 if self.x < 0
  1459.           self.y -= ((i[13] * store_sp_h_float - store_sp_h_float) / 2)
  1460.           self.src_rect.y = 0 if self.y < 0
  1461.  
  1462.         end
  1463.  
  1464.         i[5].match('rtype_by_window__') do
  1465.  
  1466.           #============================ Resized ============================#
  1467.  
  1468.           store_sp_w_float = self.bitmap.width.to_f
  1469.           store_sp_h_float = self.bitmap.height.to_f
  1470.           store_wndw_w_float = michael_cursor_sp_w_offset.to_f
  1471.           store_wndw_h_float = michael_cursor_sp_h_offset.to_f
  1472.  
  1473.           self.zoom_x = (i[12] * store_wndw_w_float / store_sp_w_float)
  1474.           self.zoom_y = (i[13] * store_wndw_h_float / store_sp_h_float)
  1475.  
  1476.           self.src_rect.width = self.bitmap.width
  1477.           self.src_rect.height = self.bitmap.height
  1478.  
  1479.           #=========================== Relocate ============================#
  1480.  
  1481.           self.x -= ((i[12] * store_sp_w_float /  store_sp_w_float -
  1482.           store_sp_w_float / store_sp_w_float) / 2)
  1483.           self.src_rect.x = 0 if self.x < 0
  1484.           self.y -= ((i[13] * store_sp_h_float / store_wndw_h_float -
  1485.           store_sp_h_float / store_wndw_h_float) / 2)
  1486.           self.src_rect.y = 0 if self.y < 0
  1487.  
  1488.         end
  1489.  
  1490.         i[5].match('rtype_by_integer__') do
  1491.  
  1492.           #============================ Resized ============================#
  1493.  
  1494.           store_sp_w_float = self.bitmap.width.to_f
  1495.           store_sp_h_float = self.bitmap.height.to_f
  1496.  
  1497.           self.zoom_x = (i[12] / store_sp_w_float)
  1498.           self.zoom_y = (i[13] / store_sp_h_float)
  1499.           self.src_rect.width = self.bitmap.width
  1500.           self.src_rect.height = self.bitmap.height
  1501.  
  1502.           #=========================== Relocate ============================#
  1503.  
  1504.           self.x -= ((i[12] / store_sp_w_float - store_sp_w_float) / 2)
  1505.           self.src_rect.x = 0 if self.x < 0
  1506.           self.y -= ((i[13] / store_sp_h_float - store_sp_h_float) / 2)
  1507.           self.src_rect.y = 0 if self.y < 0
  1508.  
  1509.         end
  1510.  
  1511.       else
  1512.  
  1513.         i[5].match('rtype_window_width__') do
  1514.  
  1515.           #============================ Resized ============================#
  1516.  
  1517.           store_sp_w_float = self.bitmap.width.to_f
  1518.           store_sp_h_float = self.bitmap.height.to_f
  1519.           store_wndw_w_float = window.width.to_f
  1520.  
  1521.           self.zoom_x = store_wndw_w_float / store_sp_w_float
  1522.           self.zoom_y = store_wndw_w_float / store_sp_w_float
  1523.           self.src_rect.width = self.bitmap.width
  1524.           self.src_rect.height = self.bitmap.height
  1525.  
  1526.           #=========================== Relocate ============================#
  1527.  
  1528.           self.y += ((window.height - self.bitmap.height) / 2)
  1529.           self.src_rect.y = 0 if self.y < 0
  1530.  
  1531.         end
  1532.  
  1533.         i[5].match('rtype_window_height__') do
  1534.  
  1535.           #============================ Resized ============================#
  1536.  
  1537.           store_sp_w_float = self.bitmap.width.to_f
  1538.           store_sp_h_float = self.bitmap.height.to_f
  1539.           store_wndw_h_float = window.height.to_f
  1540.  
  1541.           self.zoom_x = store_wndw_h_float / store_sp_h_float
  1542.           self.zoom_y = store_wndw_h_float / store_sp_h_float
  1543.           self.src_rect.width = self.bitmap.width
  1544.           self.src_rect.height = self.bitmap.height
  1545.  
  1546.           #=========================== Relocate ============================#
  1547.  
  1548.           self.x -= ((store_sp_w_float * (store_wndw_h_float / store_sp_h_float) -
  1549.           store_sp_w_float) / 2)
  1550.           self.src_rect.x = 0 if self.x < 0
  1551.  
  1552.         end
  1553.  
  1554.         i[5].match('rtype_actual_pixel__') do
  1555.  
  1556.           #============================ Resized ============================#
  1557.  
  1558.           store_sp_w_float = self.bitmap.width.to_f
  1559.           store_sp_h_float = self.bitmap.height.to_f
  1560.  
  1561.           self.zoom_x = i[12]
  1562.           self.zoom_y = i[13]
  1563.           self.src_rect.width = self.bitmap.width
  1564.           self.src_rect.height = self.bitmap.height
  1565.  
  1566.  
  1567.           #=========================== Relocate ============================#
  1568.  
  1569.           self.x -=((i[12] * store_sp_w_float - store_sp_w_float) / 2)
  1570.           self.src_rect.x = 0 if self.x < 0
  1571.           self.y -= ((i[13] * store_sp_h_float - store_sp_h_float) / 2)
  1572.           self.src_rect.y = 0 if self.y < 0
  1573.  
  1574.         end
  1575.  
  1576.         i[5].match('rtype_by_window__') do
  1577.  
  1578.           #============================ Resized ============================#
  1579.  
  1580.           store_sp_w_float = self.bitmap.width.to_f
  1581.           store_sp_h_float = self.bitmap.height.to_f
  1582.           store_wndw_w_float = window.width.to_f
  1583.           store_wndw_h_float = window.height.to_f
  1584.  
  1585.           self.zoom_x = (i[12] * store_wndw_w_float / store_sp_w_float)
  1586.           self.zoom_y = (i[13] * store_wndw_h_float / store_sp_h_float)
  1587.           self.src_rect.width = self.bitmap.width
  1588.           self.src_rect.height = self.bitmap.height
  1589.  
  1590.           #=========================== Relocate ============================#
  1591.  
  1592.           self.x -= ((i[12] * store_sp_w_float /  store_sp_w_float -
  1593.           store_sp_w_float / store_sp_w_float) / 2)
  1594.           self.src_rect.x = 0 if self.x < 0
  1595.           self.y -= ((i[13] * store_sp_h_float / store_wndw_h_float -
  1596.           store_sp_h_float / store_wndw_h_float) / 2)
  1597.           self.src_rect.y = 0 if self.y < 0
  1598.  
  1599.         end
  1600.  
  1601.         i[5].match('rtype_by_integer__') do
  1602.  
  1603.           #============================ Resized ============================#
  1604.  
  1605.           store_sp_w_float = self.bitmap.width.to_f
  1606.           store_sp_h_float = self.bitmap.height.to_f
  1607.  
  1608.           self.zoom_x = (i[12] / store_sp_w_float)
  1609.           self.zoom_y = (i[13] / store_sp_h_float)
  1610.           self.src_rect.width = self.bitmap.width
  1611.           self.src_rect.height = self.bitmap.height
  1612.  
  1613.           #=========================== Relocate ============================#
  1614.  
  1615.           self.x -= ((i[12] / store_sp_w_float - store_sp_w_float) / 2)
  1616.           self.src_rect.x = 0 if self.x < 0
  1617.           self.y -= ((i[13] / store_sp_h_float - store_sp_h_float) / 2)
  1618.           self.src_rect.y = 0 if self.y < 0
  1619.  
  1620.         end
  1621.  
  1622.       end
  1623.  
  1624.     end
  1625.  
  1626.     i[5].match('ctype__') do; self.color.set(i[14], i[15], i[16], i[17]); end;
  1627.  
  1628.   end
  1629.  
  1630.   def michael_bg_off(window, i)
  1631.  
  1632.     self._I_do_have_bitmap = false
  1633.     self.visible = false
  1634.     window.oh_I_got_changed = false
  1635.  
  1636.  
  1637.     if (window.open? && window.visible)
  1638.       window.back_opacity = @michael_wndw_b_opa unless @michael_wndw_b_opa.nil?
  1639.       window.opacity = @michael_wndw_opa unless @michael_wndw_opa.nil?
  1640.  
  1641.     end
  1642.  
  1643.   end
  1644.  
  1645.  
  1646.   def michael_cursor_updt(window, i, cursor = 'select')
  1647.  
  1648.     $game_switches[Wndw_Cgr::SSP + i[0]] ? michael_cursor_on(window, i, cursor) : michael_cursor_off(i)
  1649.  
  1650.   end
  1651.  
  1652.   def michael_cursor_on(window, i, cursor)
  1653.  
  1654.     self.michael_sp_ppts_dup = [nil, '', '', nil, nil, '', nil, nil, nil, nil,
  1655.                                 nil, nil, nil, nil, nil, nil, nil, nil] if self.michael_sp_ppts_dup.nil?
  1656.  
  1657.     michael_set_self_vp(window)
  1658.     michael_cursor_mandatory_update(window)
  1659.     michael_cursor_apply_change(window, i, cursor)
  1660.  
  1661.   end
  1662.  
  1663.   def michael_cursor_mandatory_update(window)
  1664.  
  1665.     self.x = window.x + self.michael_cursor_sp_x_offset
  1666.     self.y = window.y + self.michael_cursor_sp_y_offset
  1667.     self.visible = (window.open? && window.visible)
  1668.     self.visible = false if window.cursor_rect.michael_window_sp_counter
  1669.  
  1670.   end
  1671.  
  1672.   def michael_cursor_apply_change(window, i, cursor)
  1673.  
  1674.       michael_set_dflt_ppts(window.cursor_rect, i, cursor) #SET DEFAULT PROPERTIES
  1675.       michael_modify_self(window.cursor_rect, i) if i[5] != '' && self._I_do_have_bitmap
  1676.  
  1677.   end
  1678.  
  1679.  
  1680.  
  1681.   def michael_cursor_off(i)
  1682.  
  1683.     self._I_do_have_bitmap = false
  1684.     self.visible = false
  1685.     self._I_do_have_bitmap = false
  1686.  
  1687.   end
  1688.  
  1689. end
  1690.  
  1691. #==============================================================================
  1692. # Rect
  1693. #==============================================================================
  1694.  
  1695. class Rect
  1696.  
  1697.   attr_accessor :michael_nickname_the_cursor_rect
  1698.   attr_accessor :michael_cursor_rect_bg_sp
  1699.   attr_accessor :michael_cursor_sp_counter
  1700.   attr_accessor :michael_window_sp_counter
  1701.  
  1702.   alias michael_Rect_set set
  1703.   alias michael_Rect_empty empty
  1704.  
  1705.  
  1706.  
  1707.   def set(*args)
  1708.  
  1709.     michael_Rect_set(*args)
  1710.  
  1711.     if self.michael_nickname_the_cursor_rect == 'cursor_rect' &&
  1712.        self.michael_cursor_rect_bg_sp._I_do_have_bitmap
  1713.  
  1714.       self.michael_cursor_rect_bg_sp.michael_cursor_sp_x_offset = self.x + 12
  1715.       self.michael_cursor_rect_bg_sp.michael_cursor_sp_y_offset = self.y + 12
  1716.       self.michael_cursor_rect_bg_sp.michael_cursor_sp_w_offset = self.width
  1717.       self.michael_cursor_rect_bg_sp.michael_cursor_sp_h_offset = self.height
  1718.       self.michael_cursor_sp_counter = false
  1719.       empty
  1720.  
  1721.     end
  1722.  
  1723.     self.michael_cursor_sp_counter = true
  1724.  
  1725.   end
  1726.  
  1727.   def empty
  1728.  
  1729.     michael_Rect_empty
  1730.  
  1731.     self.michael_window_sp_counter = michael_cursor_sp_counter
  1732.  
  1733.   end
  1734.  
  1735. end
  1736.  
  1737. #==============================================================================
  1738. # Game_Message
  1739. #==============================================================================
  1740.  
  1741. class Game_Message
  1742.  
  1743.   attr_accessor :michael_windows_ary
  1744.   attr_accessor :michael_wndw_bg_ary
  1745.   attr_accessor :michael_wndw_cursor
  1746.   attr_accessor :michael_wndw_bg_psuedo
  1747.  
  1748.   alias michael_ini initialize
  1749.  
  1750.   def initialize
  1751.  
  1752.     michael_ini
  1753.     @michael_windows_ary = Wndw_Cgr::Michael_Windows_Ary
  1754.     @michael_wndw_bg_ary = Wndw_Cgr::Michael_Wndw_Bg_Ary
  1755.     @michael_wndw_cursor = Wndw_Cgr::Michael_Wndw_Cursor
  1756.     @michael_wndw_bg_psuedo = Wndw_Cgr::Wndw_Psuedo_Names
  1757.  
  1758.   end
  1759.  
  1760. end
  1761. #==============================================================================
  1762. # DataManager
  1763. #==============================================================================
  1764.  
  1765. module DataManager
  1766.  
  1767.   class << self
  1768.  
  1769.     alias michael_dt_mngr_init init
  1770.     alias michael_DataManager_create_game_objects create_game_objects
  1771.  
  1772.   end
  1773.  
  1774.   def self.init
  1775.  
  1776.     michael_dt_mngr_init
  1777.     create_Wndw_Cgr_directory
  1778.  
  1779.   end
  1780.  
  1781.   def self.create_Wndw_Cgr_directory
  1782.  
  1783.     $game_message.michael_wndw_bg_ary.each_value {
  1784.       |value| Dir.mkdir(value[2]) if !File.exists?(value[2])
  1785.     }
  1786.  
  1787.   end
  1788.  
  1789.   def self.create_game_objects
  1790.  
  1791.     michael_DataManager_create_game_objects
  1792.  
  1793.     #======================== Default setting = false ========================#
  1794.  
  1795.     (Wndw_Cgr::Auto) ?
  1796.     $game_switches[Wndw_Cgr::SSP...Wndw_Cgr::SSP +
  1797.     $game_message.michael_wndw_bg_ary.size] = false :
  1798.     $game_switches[Wndw_Cgr::SSP...Wndw_Cgr::SSP + Wndw_Cgr::NOE] = false
  1799.  
  1800.   end
  1801.  
  1802. end
  1803. #===============================================================================
  1804. # Game Interpreter
  1805. #===============================================================================
  1806.  
  1807. class Game_Interpreter
  1808.  
  1809.   if Wndw_Cgr::Auto
  1810.  
  1811.     def window_blank(class_type)
  1812.  
  1813.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1814.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1815.  
  1816.       $game_switches[Wndw_Cgr::SSP +
  1817.       $game_message.michael_wndw_bg_ary[name][0]] = true
  1818.       $game_message.michael_wndw_bg_ary[name][1] = 'THIS_IS_A_BLANK_PICTURE_YES_USER_WANTS_A_BLANK_WINDOW_ONLY'
  1819.  
  1820.     end
  1821.  
  1822.     def window_off(class_type)
  1823.  
  1824.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1825.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1826.  
  1827.       $game_switches[Wndw_Cgr::SSP +
  1828.       $game_message.michael_wndw_bg_ary[name][0]] = false
  1829.       window_default(name)
  1830.  
  1831.     end
  1832.  
  1833.     def window_on(class_type, file_name, type_movement = '')
  1834.  
  1835.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1836.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1837.  
  1838.       $game_switches[Wndw_Cgr::SSP +
  1839.       $game_message.michael_wndw_bg_ary[name][0]] = true
  1840.       $game_message.michael_wndw_bg_ary[name][1] = file_name
  1841.       $game_message.michael_wndw_cursor[name][1] = file_name
  1842.  
  1843.       if type_movement.match(/(show_all)/)
  1844.         $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1845.         $game_message.michael_wndw_bg_ary[name][5] << 'mtype_' << type_movement << '__'
  1846.         $game_message.michael_wndw_cursor[name][5].slice!(/mtype+\w+?(__)/)
  1847.         $game_message.michael_wndw_cursor[name][5] << 'mtype_' << type_movement << '__'
  1848.       else
  1849.         window_default(name)
  1850.       end
  1851.  
  1852.     end
  1853.  
  1854.     def window_depth(class_type, depth)
  1855.  
  1856.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1857.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1858.  
  1859.       $game_message.michael_wndw_bg_ary[name][3] = depth
  1860.  
  1861.     end
  1862.  
  1863.     def window_opacity(class_type, opacity)
  1864.  
  1865.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1866.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1867.  
  1868.       $game_message.michael_wndw_bg_ary[name][4] = opacity
  1869.  
  1870.     end
  1871.  
  1872.     def window_default(class_type)
  1873.  
  1874.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1875.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1876.  
  1877.       $game_message.michael_wndw_bg_ary[name][3] = nil
  1878.       $game_message.michael_wndw_bg_ary[name][4] = nil
  1879.       $game_message.michael_wndw_bg_ary[name][5] = ''
  1880.  
  1881.     end
  1882.  
  1883.     def window_show_all(class_type)
  1884.  
  1885.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1886.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1887.  
  1888.       $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1889.       $game_message.michael_wndw_bg_ary[name][5] << 'mtype_show_all__'
  1890.  
  1891.     end
  1892.  
  1893.     def window_show_all_move(class_type, x, y)
  1894.  
  1895.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1896.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1897.  
  1898.       $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1899.       $game_message.michael_wndw_bg_ary[name][5] << 'mtype_move__'
  1900.       $game_message.michael_wndw_bg_ary[name][6] = x
  1901.       $game_message.michael_wndw_bg_ary[name][7] = y
  1902.  
  1903.     end
  1904.  
  1905.     def window_move_origin(class_type,x,y)
  1906.  
  1907.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1908.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1909.  
  1910.       $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1911.       $game_message.michael_wndw_bg_ary[name][5] << 'mtype_move_origin__'
  1912.       $game_message.michael_wndw_bg_ary[name][6] = x
  1913.       $game_message.michael_wndw_bg_ary[name][7] = y
  1914.  
  1915.     end
  1916.  
  1917.     def window_center(class_type)
  1918.  
  1919.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1920.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1921.  
  1922.       $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1923.       $game_message.michael_wndw_bg_ary[name][5] << 'mtype_center__'
  1924.  
  1925.     end
  1926.  
  1927.     def window_move_all(class_type, x, y, rect_x, rect_y, rect_width, rect_height)
  1928.  
  1929.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1930.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1931.  
  1932.       $game_message.michael_wndw_bg_ary[name][5].slice!(/mtype+\w+?(__)/)
  1933.       $game_message.michael_wndw_bg_ary[name][5] << 'mtype_move_all__'
  1934.       $game_message.michael_wndw_bg_ary[name][6] = x
  1935.       $game_message.michael_wndw_bg_ary[name][7] = y
  1936.       $game_message.michael_wndw_bg_ary[name][8] = rect_x
  1937.       $game_message.michael_wndw_bg_ary[name][9] = rect_y
  1938.       $game_message.michael_wndw_bg_ary[name][10] = rect_width
  1939.       $game_message.michael_wndw_bg_ary[name][11] = rect_height
  1940.  
  1941.     end
  1942.  
  1943.     def window_nickname(class_type, name)
  1944.  
  1945.       $game_message.michael_wndw_bg_psuedo[name] = class_type
  1946.  
  1947.     end
  1948.  
  1949.     #Index :D
  1950.     #mtype = movement type
  1951.     #r = resize
  1952.     #rtype = resize type
  1953.     #ctype = color type
  1954.  
  1955.     def window_r_fit_w(class_type)
  1956.  
  1957.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1958.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1959.  
  1960.       $game_message.michael_wndw_bg_ary[name][5].slice!(/rtype+\w+?(__)/)
  1961.       $game_message.michael_wndw_bg_ary[name][5] << 'rtype_window_width__'
  1962.  
  1963.     end
  1964.  
  1965.     def window_r_fit_h(class_type)
  1966.  
  1967.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1968.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1969.  
  1970.       $game_message.michael_wndw_bg_ary[name][5].slice!(/rtype+\w+?(__)/)
  1971.       $game_message.michael_wndw_bg_ary[name][5] << 'rtype_window_height__'
  1972.  
  1973.     end
  1974.  
  1975.     def window_r_pixel(class_type, _zoom_x, _zoom_y)
  1976.  
  1977.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1978.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1979.  
  1980.       $game_message.michael_wndw_bg_ary[name][5].slice!(/rtype+\w+?(__)/)
  1981.       $game_message.michael_wndw_bg_ary[name][5] << 'rtype_actual_pixel__'
  1982.       $game_message.michael_wndw_bg_ary[name][12] = _zoom_x
  1983.       $game_message.michael_wndw_bg_ary[name][13] = _zoom_y
  1984.  
  1985.     end
  1986.  
  1987.     def window_r(class_type, _zoom_x, zoom_y)
  1988.  
  1989.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  1990.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  1991.  
  1992.       $game_message.michael_wndw_bg_ary[name][5].slice!(/rtype+\w+?(__)/)
  1993.       $game_message.michael_wndw_bg_ary[name][5] << 'rtype_by_window__'
  1994.       $game_message.michael_wndw_bg_ary[name][12] = _zoom_x
  1995.       $game_message.michael_wndw_bg_ary[name][13] = _zoom_y
  1996.  
  1997.     end
  1998.  
  1999.     def window_r_i(class_type, streched_width, streched_height)
  2000.  
  2001.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2002.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2003.  
  2004.       $game_message.michael_wndw_bg_ary[name][5].slice!(/rtype+\w+?(__)/)
  2005.       $game_message.michael_wndw_bg_ary[name][5] << 'rtype_by_integer__'
  2006.       $game_message.michael_wndw_bg_ary[name][12] = streched_width
  2007.       $game_message.michael_wndw_bg_ary[name][13] = streched_height
  2008.  
  2009.     end
  2010.  
  2011.     def window_color(class_type, red, green, blue, alpha)
  2012.  
  2013.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2014.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2015.  
  2016.       $game_message.michael_wndw_bg_ary[name][5].slice!(/ctype+\w+?(__)/)
  2017.       #there's only 1 ctype for now. Maybe more will be added when I got some coloring ideas.
  2018.       #I'm open for suggestions & advices. :D
  2019.       $game_message.michael_wndw_bg_ary[name][5] << 'ctype__'
  2020.       $game_message.michael_wndw_bg_ary[name][14] = red
  2021.       $game_message.michael_wndw_bg_ary[name][15] = green
  2022.       $game_message.michael_wndw_bg_ary[name][16] = blue
  2023.       $game_message.michael_wndw_bg_ary[name][17] = alpha
  2024.  
  2025.     end
  2026.  
  2027.     #========================= Cursor Interpreter =========================#
  2028.  
  2029.     #soon to be filled :p
  2030.  
  2031.     def cursor_depth(class_type, depth)
  2032.  
  2033.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2034.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2035.  
  2036.       $game_message.michael_wndw_cursor[name][3] = depth
  2037.  
  2038.     end
  2039.  
  2040.     def cursor_opacity(class_type, opacity)
  2041.  
  2042.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2043.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2044.  
  2045.       $game_message.michael_wndw_cursor[name][4] = opacity
  2046.  
  2047.     end
  2048.  
  2049.     def cursor_default(class_type)
  2050.  
  2051.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2052.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2053.  
  2054.       $game_message.michael_wndw_cursor[name][3] = nil
  2055.       $game_message.michael_wndw_cursor[name][4] = nil
  2056.       $game_message.michael_wndw_cursor[name][5] = ''
  2057.  
  2058.     end
  2059.  
  2060.     def cursor_show_all(class_type)
  2061.  
  2062.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2063.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2064.  
  2065.       $game_message.michael_wndw_cursor[name][5].slice!(/mtype+\w+?(__)/)
  2066.       $game_message.michael_wndw_cursor[name][5] << 'mtype_show_all__'
  2067.  
  2068.     end
  2069.  
  2070.     def cursor_show_all_move(class_type, x, y)
  2071.  
  2072.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2073.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2074.  
  2075.       $game_message.michael_wndw_cursor[name][5].slice!(/mtype+\w+?(__)/)
  2076.       $game_message.michael_wndw_cursor[name][5] << 'mtype_move__'
  2077.       $game_message.michael_wndw_cursor[name][6] = x
  2078.       $game_message.michael_wndw_cursor[name][7] = y
  2079.  
  2080.     end
  2081.  
  2082.     def cursor_move_origin(class_type,x,y)
  2083.  
  2084.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2085.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2086.  
  2087.       $game_message.michael_wndw_cursor[name][5].slice!(/mtype+\w+?(__)/)
  2088.       $game_message.michael_wndw_cursor[name][5] << 'mtype_move_origin__'
  2089.       $game_message.michael_wndw_cursor[name][6] = x
  2090.       $game_message.michael_wndw_cursor[name][7] = y
  2091.  
  2092.     end
  2093.  
  2094.     def cursor_r_fit_w(class_type)
  2095.  
  2096.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2097.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2098.  
  2099.       $game_message.michael_wndw_cursor[name][5].slice!(/rtype+\w+?(__)/)
  2100.       $game_message.michael_wndw_cursor[name][5] << 'rtype_window_width__'
  2101.  
  2102.     end
  2103.  
  2104.     def cursor_r_fit_h(class_type)
  2105.  
  2106.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2107.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2108.  
  2109.       $game_message.michael_wndw_cursor[name][5].slice!(/rtype+\w+?(__)/)
  2110.       $game_message.michael_wndw_cursor[name][5] << 'rtype_window_height__'
  2111.  
  2112.     end
  2113.  
  2114.     def cursor_r_pixel(class_type, _zoom_x, _zoom_y)
  2115.  
  2116.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2117.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2118.  
  2119.       $game_message.michael_wndw_cursor[name][5].slice!(/rtype+\w+?(__)/)
  2120.       $game_message.michael_wndw_cursor[name][5] << 'rtype_actual_pixel__'
  2121.       $game_message.michael_wndw_cursor[name][12] = _zoom_x
  2122.       $game_message.michael_wndw_cursor[name][13] = _zoom_y
  2123.  
  2124.     end
  2125.  
  2126.     def cursor_r(class_type, _zoom_x, zoom_y)
  2127.  
  2128.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2129.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2130.  
  2131.       $game_message.michael_wndw_cursor[name][5].slice!(/rtype+\w+?(__)/)
  2132.       $game_message.michael_wndw_cursor[name][5] << 'rtype_by_window__'
  2133.       $game_message.michael_wndw_cursor[name][12] = _zoom_x
  2134.       $game_message.michael_wndw_cursor[name][13] = _zoom_y
  2135.  
  2136.     end
  2137.  
  2138.     def cursor_r_i(class_type, streched_width, streched_height)
  2139.  
  2140.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2141.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2142.  
  2143.       $game_message.michael_wndw_cursor[name][5].slice!(/rtype+\w+?(__)/)
  2144.       $game_message.michael_wndw_cursor[name][5] << 'rtype_by_integer__'
  2145.       $game_message.michael_wndw_cursor[name][12] = streched_width
  2146.       $game_message.michael_wndw_cursor[name][13] = streched_height
  2147.  
  2148.     end
  2149.  
  2150.     def cursor_color(class_type, red, green, blue, alpha)
  2151.  
  2152.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2153.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2154.  
  2155.       $game_message.michael_wndw_cursor[name][5].slice!(/ctype+\w+?(__)/)
  2156.       $game_message.michael_wndw_cursor[name][5] << 'ctype__'
  2157.       $game_message.michael_wndw_cursor[name][14] = red
  2158.       $game_message.michael_wndw_cursor[name][15] = green
  2159.       $game_message.michael_wndw_cursor[name][16] = blue
  2160.       $game_message.michael_wndw_cursor[name][17] = alpha
  2161.  
  2162.     end
  2163.  
  2164.     #========================= Window Interpreter =========================#
  2165.  
  2166.     def window_w_default(class_type)
  2167.  
  2168.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2169.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2170.  
  2171.       $game_message.michael_windows_ary[name][1] = ''
  2172.       $game_message.michael_windows_ary[name][8] = nil
  2173.  
  2174.     end
  2175.  
  2176.     def window_w_coordinate(class_type, x, y)
  2177.  
  2178.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2179.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2180.  
  2181.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2182.       $game_message.michael_windows_ary[name][1] << 'mtype_coordinate__'
  2183.       $game_message.michael_windows_ary[name][2] = x
  2184.       $game_message.michael_windows_ary[name][3] = y
  2185.  
  2186.     end
  2187.  
  2188.     def window_w_change_all(class_type, x, y, w, h)
  2189.  
  2190.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2191.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2192.  
  2193.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2194.       $game_message.michael_windows_ary[name][1] << 'mtype_everything__'
  2195.       $game_message.michael_windows_ary[name][2] = x
  2196.       $game_message.michael_windows_ary[name][3] = y
  2197.       $game_message.michael_windows_ary[name][4] = w
  2198.       $game_message.michael_windows_ary[name][5] = h
  2199.  
  2200.     end
  2201.  
  2202.     def window_w_move_ori(class_type, x, y, w = nil, h = nil)
  2203.  
  2204.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2205.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2206.  
  2207.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2208.       $game_message.michael_windows_ary[name][1] << 'mtype_extend_original__'
  2209.       $game_message.michael_windows_ary[name][2] = x
  2210.       $game_message.michael_windows_ary[name][3] = y
  2211.       $game_message.michael_windows_ary[name][4] = w unless w.nil?
  2212.       $game_message.michael_windows_ary[name][5] = h unless h.nil?
  2213.  
  2214.     end
  2215.  
  2216.     def window_w_center(class_type)
  2217.  
  2218.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2219.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2220.  
  2221.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2222.       $game_message.michael_windows_ary[name][1] << 'mtype_center__'
  2223.  
  2224.     end
  2225.  
  2226.     def window_w_r_pixel(class_type, w, h)
  2227.  
  2228.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2229.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2230.  
  2231.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2232.       $game_message.michael_windows_ary[name][1] << 'rtype_by_integer__'
  2233.       $game_message.michael_windows_ary[name][6] = w
  2234.       $game_message.michael_windows_ary[name][7] = h
  2235.  
  2236.     end
  2237.  
  2238.     def window_w_r_ratio(class_type, w, h)
  2239.  
  2240.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2241.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2242.  
  2243.       $game_message.michael_windows_ary[name][1].slice!(/mtype+\w+?(__)/)
  2244.       $game_message.michael_windows_ary[name][1] << 'rtype_by_ratio__'
  2245.       $game_message.michael_windows_ary[name][6] = w
  2246.       $game_message.michael_windows_ary[name][7] = h
  2247.  
  2248.     end
  2249.  
  2250.     def window_w_depth(class_type, z)
  2251.  
  2252.       name = ($game_message.michael_wndw_bg_psuedo.has_key?(class_type)) ?
  2253.       $game_message.michael_wndw_bg_psuedo[class_type] : class_type
  2254.  
  2255.       $game_message.michael_windows_ary[name][8] = z
  2256.  
  2257.     end
  2258.  
  2259.   else
  2260.  
  2261.     def window_off(i)
  2262.  
  2263.       $game_switches[i + Wndw_Cgr::SSP] = false
  2264.       window_default(i)
  2265.  
  2266.     end
  2267.  
  2268.     def window_on(i, name, type_movement = '')
  2269.  
  2270.       $game_switches[i + Wndw_Cgr::SSP] = true
  2271.       $game_message.michael_wndw_bg_ary.each_value {
  2272.         |value| value[1] = name if value[0] == i
  2273.       }
  2274.  
  2275.       if type_movement == /(show_all|center)/
  2276.  
  2277.         $game_message.michael_wndw_bg_ary.each_value { |value|
  2278.  
  2279.           if value[0] == i
  2280.  
  2281.             value[5].slice!(/mtype+\w+?(__)/)
  2282.             value[5] << 'mtype_' << type_movement << '__'
  2283.  
  2284.           end
  2285.         }
  2286.  
  2287.       end
  2288.  
  2289.     end
  2290.  
  2291.     def window_depth(i, depth)
  2292.  
  2293.       $game_message.michael_wndw_bg_ary.each_value {
  2294.         |value| value[3] = depth if value[0] == i
  2295.       }
  2296.  
  2297.     end
  2298.  
  2299.     def window_opacity(i, opacity)
  2300.  
  2301.       $game_message.michael_wndw_bg_ary.each_value {
  2302.         |value| value[4] = opacity if value[0] == i
  2303.       }
  2304.  
  2305.     end
  2306.  
  2307.     def window_default(i)
  2308.  
  2309.       $game_message.michael_wndw_bg_ary.each_value {
  2310.         |value| value[3] = nil if value[0] == i
  2311.       }
  2312.  
  2313.       $game_message.michael_wndw_bg_ary.each_value {
  2314.         |value| value[4] = nil if value[0] == i
  2315.       }
  2316.  
  2317.       $game_message.michael_wndw_bg_ary.each_value {
  2318.         |value| value[5] = '' if value[0] == i
  2319.       }
  2320.  
  2321.     end
  2322.  
  2323.     def window_show_all(i)
  2324.  
  2325.       $game_message.michael_wndw_bg_ary.each_value {
  2326.         |value| value[5] << 'mtype_show_all__' if value[0] == i
  2327.       }
  2328.  
  2329.     end
  2330.  
  2331.     def window_show_all_move(i, x, y)
  2332.  
  2333.       $game_message.michael_wndw_bg_ary.each_value {
  2334.         |value| value[5] << 'mtype_move__' if value[0] == i
  2335.       }
  2336.  
  2337.       $game_message.michael_wndw_bg_ary.each_value {
  2338.         |value| value[6] = x if value[0] == i
  2339.       }
  2340.  
  2341.       $game_message.michael_wndw_bg_ary.each_value {
  2342.         |value| value[7] = y if value[0] == i
  2343.       }
  2344.  
  2345.     end
  2346.  
  2347.     def window_move_origin(i,x,y)
  2348.  
  2349.       $game_message.michael_wndw_bg_ary.each_value {
  2350.         |value| value[5] << 'mtype_move_origin__' if value[0] == i
  2351.       }
  2352.  
  2353.       $game_message.michael_wndw_bg_ary.each_value {
  2354.         |value| value[6] = x if value[0] == i
  2355.       }
  2356.  
  2357.       $game_message.michael_wndw_bg_ary.each_value {
  2358.         |value| value[7] = y if value[0] == i
  2359.       }
  2360.  
  2361.     end
  2362.  
  2363.     def window_center(i)
  2364.  
  2365.       $game_message.michael_wndw_bg_ary.each_value {
  2366.         |value| value[5] << 'mtype_center__' if value[0] == i
  2367.       }
  2368.  
  2369.     end
  2370.  
  2371.     def window_move_all(i, x, y, rect_x, rect_y, rect_width, rect_height)
  2372.  
  2373.       $game_message.michael_wndw_bg_ary.each_value {
  2374.         |value| value[5] << 'mtype_move_all__'if value[0] == i
  2375.       }
  2376.  
  2377.       $game_message.michael_wndw_bg_ary.each_value {
  2378.         |value| value[6] = x if value[0] == i
  2379.       }
  2380.  
  2381.       $game_message.michael_wndw_bg_ary.each_value {
  2382.         |value| value[7] = y if value[0] == i
  2383.       }
  2384.  
  2385.       $game_message.michael_wndw_bg_ary.each_value {
  2386.         |value| value[8] = rect_x if value[0] == i
  2387.       }
  2388.       $game_message.michael_wndw_bg_ary.each_value {
  2389.         |value| value[9] = rect_y if value[0] == i
  2390.       }
  2391.  
  2392.       $game_message.michael_wndw_bg_ary.each_value {
  2393.         |value| value[10] = rect_width if value[0] == i
  2394.       }
  2395.  
  2396.       $game_message.michael_wndw_bg_ary.each_value {
  2397.         |value| value[11] = rect_height if value[0] == i
  2398.       }
  2399.  
  2400.     end
  2401.  
  2402.   end
  2403.  
  2404. end
RAW Paste Data