daily pastebin goal
35%
SHARE
TWEET

Windowskin Changer Scriptlet - RGSS2/RMVX

CompanionWulf Jul 18th, 2015 210 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. # ** Windowskin Changer Scriptlet VX v1.0
  3. #    © 2013, Companion Wulf
  4. #
  5. #   Version      : 1.2
  6. #   Author       : Companion Wulf
  7. #   Release Date : 10 May 2013
  8. #   Last Update  : 24 May 2013
  9. #   Websites
  10. #     * RPG Maker Times           - http://rpgmakertimes.blogspot.com
  11. #     * RMT Companion Blog        - http://blog.rpgmakertimes.info
  12. #     * RPG Maker Times Facebook  - http://facebook.com/RPGMakerTimes
  13. #   Contact Email: companionwulf@rpgmakertimes.info
  14. #------------------------------------------------------------------------------
  15. # The Windowskin Changer scriptlet allows you to change the windowskin in the
  16. # middle of a game using the script call event command.
  17. #------------------------------------------------------------------------------
  18. #
  19. # Known Compatability Issues:
  20. #   There may only be compatability issues for other scripts that overwrite
  21. #   or modify the Scene_Menu class.
  22. #
  23. # Aliased Methods:
  24. #   Game_System - initialize
  25. #   Window_Base - initialize, update
  26. # Added Methods:
  27. #   change_windowskin, reset_windowskin
  28. #==============================================================================
  29.  
  30. #==============================================================================
  31. # ** Version History
  32. #------------------------------------------------------------------------------
  33. #   v1.2 (24-May-2013)
  34. #     * Add: Change windowskin option
  35. #     * Add: Reset windowskin option
  36. #   v1.0 (10-May-2013)
  37. #     * Began scriptlet
  38. #==============================================================================
  39.  
  40. module CWWSC_SETTINGS
  41.   #--------------------------------------------------------------------------
  42.   # These are the settings for the windowskins and to predetermine which
  43.   # windowskins are used in the game.
  44.   #
  45.   # To change the windowskin, use the following:
  46.   #
  47.   #   change_skin(windowskin)
  48.   #
  49.   # where "windowskin" corresponds to the number in the WINDOWSKINS hash - NOT
  50.   # the windowskin filename.
  51.   #
  52.   # To reset the windowskin to the system default, use the following:
  53.   #
  54.   #   reset_windowskin
  55.   #
  56.   # NOTE: ALL windowskins must be imported into the "Graphics/System" folder.
  57.   #--------------------------------------------------------------------------
  58.  
  59.   #--------------------------------------------------------------------------
  60.   # * Windowskin Settings
  61.   #--------------------------------------------------------------------------
  62.   # The list of useable windowskins in the game. 0 is the default system
  63.   # windowskin. It's best to leave this alone (unless you want to change the
  64.   # system's default windowskin completely).
  65.   WINDOWSKINS ={
  66.      0 => "Window",             # Default system windowskin
  67.      1 => "CharcoalParchment",  # Change to windowskin of your choice
  68.      # Add more windowskins here
  69.   }
  70.   #MULTI_SKINS = true           # Not implemented in v1.0
  71. end
  72.  
  73. #------------------------------------------------------------------------------
  74. # There's no need to edit beyond this point.
  75. #------------------------------------------------------------------------------
  76.  
  77. #==============================================================================
  78. # ** Game_System
  79. #==============================================================================
  80. class Game_System
  81.   include CWWSC_SETTINGS
  82.   #--------------------------------------------------------------------------
  83.   # * Public Instance Variables
  84.   #--------------------------------------------------------------------------
  85.   attr_accessor :default_windowskin
  86.   #--------------------------------------------------------------------------
  87.   # * Object Initialization
  88.   #--------------------------------------------------------------------------
  89.   alias cwwsc_gmsys_initialize initialize unless $@
  90.   def initialize(*args, &block)
  91.     cwwsc_gmsys_initialize(*args, &block)
  92.     @default_windowskin = WINDOWSKINS[0]
  93.   end
  94. end
  95.  
  96. #==============================================================================
  97. # ** Window_Base
  98. #==============================================================================
  99. class Window_Base < Window
  100.   include CWWSC_SETTINGS
  101.   #--------------------------------------------------------------------------
  102.   # * Object Initialization
  103.   #--------------------------------------------------------------------------
  104.   alias cwwsc_winbs_initialize initialize unless $@
  105.   def initialize(*args, &block)#(x, y, width, height)
  106.     cwwsc_winbs_initialize(*args, &block)#(x, y, width, height)
  107.     self.windowskin = Cache.system($game_system.default_windowskin)
  108.   end
  109. end
  110.  
  111. #==============================================================================
  112. # ** Game_Interpreter
  113. #==============================================================================
  114. class Game_Interpreter
  115.   include CWWSC_SETTINGS
  116.   #--------------------------------------------------------------------------
  117.   # * Change Windowskin
  118.   #--------------------------------------------------------------------------
  119.   def change_windowskin(ws);
  120.     $game_system.default_windowskin = WINDOWSKINS[ws]
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # * Reset Windowskin
  124.   #--------------------------------------------------------------------------
  125.   def reset_windowskin()
  126.     $game_system.default_windowskin = WINDOWSKINS[0]
  127.   end
  128. end
  129.  
  130. #==============================================================================
  131. # COPYRIGHT NOTICE
  132. #==============================================================================
  133. # This script is copyrighted to Companion Wulf under the provisions of the
  134. # Digital Millennium Copyright Act (DMCA).
  135. #
  136. # However, permission is granted to use the script in non-commercial projects
  137. # only, provided that credit (to Companion Wulf) is given somewhere in the game.
  138. # Beginning or end credits are fine (or even in the game itself!).
  139. #
  140. # The script cannot be distributed without my express written permission. It is
  141. # only allowed for distribution (at present) on the following websites:
  142. #
  143. #       RPG Maker Times                       - http://rpgmakertimes.blogspot.com
  144. #       RPG Maker Times Companion       - http://blog.rpgmakertimes.info
  145. #  
  146. #  If you would like to share the script on a website or other forum, write to me
  147. #  for permission via RPG Maker Times Companion and the likelihood is I'll grant
  148. #  it and add to the list of approved distribution sites.
  149. #  
  150. #  Not understanding the above conditions, or not understanding English, will not
  151. #  exempt you in any way, shape or form.
  152. #  
  153. #  *For use in commercial projects*, I ask that a nominal fee of $3 for non-
  154. #  exclusive rights be paid. This will then go towards domain costs and
  155. #  additional scripts.
  156. #  
  157. #  Please do NOT use that email address for anything other than asking permission
  158. #  or, of course, letting me know about your project. ~Wulf
  159. #==============================================================================
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top