Traverse

Veteran
Veteran
Joined
Jul 3, 2014
Messages
193
Reaction score
125
First Language
English
Primarily Uses
Not sure how much use this will be to anyone by now, since VXAce is two generations of RM old and there are other windowskin-changing scripts available. But I also don't know whether any of them allow you to globally set a windowskin for specific Scenes in the game.

So this one allows you to do so.

Note: It does not add any functionality to "dynamically" change the windowskin by script call, only to set windowskin for different Scenes (and types of Windows) before the game is loaded.

Ruby:
#==============================================================================
# ** Windowskin Manager
# Author: Traverse
# Version 1.0 (5/4/2021)
#
# Terms of Use:
# - Free to use for any commercial/non-commercial project.
# - Free to modify (there's not really much to modify).
# - Credit Traverse if used/modified.
#------------------------------------------------------------------------------
# Instructions:
#
# Type the name of the windowskin image file you wish to use into the field
# DEFAULT_WINDOWSKIN to use it instead of the RTP's default "window.png".
#
# Type the name of a Scene object and a windowskin filename into the hash
# Scene_Windowskins to globally set that windowskin for all windows created by
# that Scene.
#
# Type the name of a Window object and a windowskin filename into the hash
# Window_Windowskins to globally set that windowskin for all windows of that
# specified type created in the game.
#
# For Scene_Windowskins and Window_Windowskins, the correct syntax is:
#   "name_of_scene_or_window" => "filename_of_windowskin",
#
# The names must be in quotations, the arrow must not have a space between
# the = and > and there must be a comma at the end (unless it's the last entry in
# the list) otherwise it will crash.
#
# All windowskin image files must be located inside the Graphics/System folder.
# Sub-folders under Graphics/System can be specified as part of the filename:
#   i.e. "/subfolder/window.png"
#
# File extensions can be specified, but do not have to be unless you have multiple
# different files with the same name, but different file extensions
# (i.e. "window.png", "window.jpeg").
#
# Blank strings ("") will be treated as though nothing was specified for the
# field. A string with only spaces (" ") is NOT considered "blank", but there
# shouldn't be any possible filenames that have only spaces.
#
# !! N.B. !!
# Window_Windowskins will take priority over Scene_Windowskins, which will take
# priority over the DEFAULT_WINDOWSKIN.
#
# Example: If there was a skin specified for Window_Message AND one specified for
# Scene_Map, the message window on Scene_Map will use the one specified for
# Window_Message instead of Scene_Map.
#
# Otherwise, if there was nothing specified for Window_Message, the message window
# will use the one specified for Scene_Map (or Scene_Battle, if that was where
# the message window was created).
#
# If there was nothing specified for Window_Message or the scene it was made in,
# it will then try to use the file specified in DEFAULT_WINDOWSKIN. And if there
# was also nothing specified in DEFAULT_WINDOWSKIN, it will default back to using
# the engine's typical windowskin ("window.png").
#
#==============================================================================
# ** WindowskinManager - SCRIPT SETTINGS
#==============================================================================
module WindowskinManager

  DEFAULT_WINDOWSKIN = "Window"

  Scene_Windowskins = {
    "Scene_Title" => "",
    "Scene_Battle" => "",
    "Scene_Map" => "",
    # Add more scenes here.
  }

  Window_Windowskins = {
    "Window_Help" => "",
    "Window_Message" => "",
    "Window_SaveFile" => "",
    # Add more windows here.
  }

end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
  alias_method :winbase_init_traverse_050421, :initialize
  def initialize(x, y, width, height)
    # Call original method.
    winbase_init_traverse_050421(x, y, width, height)
    # New functionality.
    default_windowskin = WindowskinManager::DEFAULT_WINDOWSKIN
    if default_windowskin.is_a?(String) && !default_windowskin.empty?
      self.windowskin = Cache.system(default_windowskin)
    end
    if WindowskinManager::Scene_Windowskins[SceneManager.scene.class.to_s]
      skin = WindowskinManager::Scene_Windowskins[SceneManager.scene.class.to_s]
      self.windowskin = Cache.system(skin) if (skin.is_a?(String) && !skin.empty?)
    end
    if WindowskinManager::Window_Windowskins[self.class.to_s]
      skin = WindowskinManager::Window_Windowskins[self.class.to_s]
      self.windowskin = Cache.system(skin) if (skin.is_a?(String) && !skin.empty?)
    end
  end
end
#==============================================================================
# **
#==============================================================================
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

The full estate map(include 1F,2F,3F and backyard), yes the backyard is a small labyrinth as well as an entrance to a real labyrinth!
Sometimes you Just need to realise someone is beyond help... Still hard to walk away tho :(
100 Horror/Tragedy Sample Maps, Penguin Mech Sprite, & TileD Templates | RPG Maker News #70

Continuing working on abs. So far I have done the workout twice. I am excited to see the results after a couple of weeks. How is everyone doing? :)
MZ: oh boy imma work today
Me, excited: Really?
MZ, doesn't do what I tell It too
Me: I Thought-
MZ: I am Working!

Forum statistics

Threads
112,227
Messages
1,066,701
Members
145,835
Latest member
Silverizer
Top