Advertisement
Guest User

XS - Core

a guest
Apr 5th, 2012
2,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.51 KB | None | 0 0
  1. #==============================================================================
  2. #   XaiL System - Core
  3. #   Author: Nicke
  4. #   Created: 07/01/2012
  5. #   Edited: 17/01/2012
  6. #   Version: 1.0a
  7. #==============================================================================
  8. # Instructions
  9. # -----------------------------------------------------------------------------
  10. # To install this script, open up your script editor and copy/paste this script
  11. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  12. #
  13. # Core script for XaiL System.
  14. # Note: This needs to be located before every other XS scripts.
  15. #
  16. # *** Only for RPG Maker VX Ace. ***
  17. #==============================================================================
  18. ($imported ||= {})["XAIL-XS-CORE"] = true
  19.  
  20. module Colors
  21.   #--------------------------------------------------------------------------#
  22.   # * Colors
  23.   #--------------------------------------------------------------------------#
  24.   White = Color.new(255,255,255)
  25.   LightRed = Color.new(255,150,150)
  26.   LightGreen = Color.new(150,255,150)
  27.   LightBlue = Color.new(150,150,255)
  28.   DarkYellow = Color.new(225, 225, 20)
  29.   Alpha = Color.new(0,0,0,128)
  30.   AlphaMenu = 100
  31. end
  32. module XAIL
  33.   module CORE
  34.   #--------------------------------------------------------------------------#
  35.   # * Settings
  36.   #--------------------------------------------------------------------------#
  37.   # Graphics.resize_screen(width, height )
  38.   Graphics.resize_screen(544, 416)
  39.  
  40.   # FONT DEFAULTS:
  41.   Font.default_name = ["VL Gothic"]
  42.   Font.default_size = 20
  43.   Font.default_bold = false
  44.   Font.default_italic = false
  45.   Font.default_shadow = true
  46.   Font.default_outline = true
  47.   Font.default_color = Colors::White
  48.   Font.default_out_color = Colors::Alpha
  49.  
  50.   # USE_TONE = true/false:
  51.   # Window tone for all windows ingame. Default: true.
  52.   USE_TONE = true
  53.  
  54.   # SAVE
  55.   SAVE_MAX = 20       # Default 16.
  56.   SAVE_FILE_VIS = 4   # Default 4.
  57.  
  58.   end
  59. end
  60. # *** Don't edit below unless you know what you are doing. ***
  61. #==============================================================================
  62. # ** DataManager
  63. #==============================================================================
  64. class << DataManager
  65.  
  66.   def savefile_max
  67.     # // Method override, save file max.
  68.     return XAIL::CORE::SAVE_MAX
  69.   end
  70.  
  71. end
  72. #==============================================================================
  73. # ** Scene_File
  74. #==============================================================================
  75. class Scene_File < Scene_MenuBase
  76.  
  77.   def visible_max
  78.     # // Method override, visible_max for save files.
  79.     return XAIL::CORE::SAVE_FILE_VIS
  80.   end
  81.  
  82. end
  83. #==============================================================================
  84. # ** Window_Base
  85. #==============================================================================
  86. class Window_Base < Window
  87.  
  88.   alias xail_core_upt_tone update_tone
  89.   def update_tone
  90.     # // Method to change tone of the window.
  91.     return if !XAIL::CORE::USE_TONE
  92.     self.tone.set($game_system.window_tone)
  93.     xail_core_upt_tone
  94.   end
  95.  
  96. end
  97. #==============================================================================#
  98. # ** Window_Icon
  99. #------------------------------------------------------------------------------
  100. #  New Window :: Window_Icon - A window for drawing icon(s).
  101. #==============================================================================#
  102. class Window_Icon < Window_Base
  103.  
  104.   attr_accessor :enabled
  105.   attr_accessor :alignment
  106.  
  107.   def initialize(x, y, window_width, hsize)
  108.     # // Method to initialize the icon window.
  109.     super(0, 0, window_width, window_height(hsize))
  110.     @icons = []
  111.     @index = 0
  112.     @enabled = true
  113.     @alignment = 0
  114.     refresh
  115.   end
  116.  
  117.   def window_height(hsize)
  118.     # // Method to return the height.
  119.     fitting_height(hsize)
  120.   end
  121.  
  122.   def refresh
  123.     # // Method to refresh the icon window.
  124.     contents.clear
  125.   end
  126.  
  127.   def draw_cmd_icons(icons, index)
  128.     # // Draw all of the icons.
  129.     return if !@enabled
  130.     count = 0
  131.     for i in icons
  132.       align = 0
  133.       x = 110
  134.       next if i[index].nil?
  135.       case @alignment
  136.       when 1, 2 ; align = -110
  137.       end
  138.       draw_icon(i[index], x + align, 24 * count)
  139.       count += 1
  140.       break if (24 * count > height - 24)
  141.     end
  142.   end
  143.  
  144. end # END OF FILE
  145.  
  146. #=*==========================================================================*=#
  147. # ** END OF FILE
  148. #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement