累计送礼: 0 个 累计收礼: 1 个 TA的每日心情 开心 2026-7-12 04:10
签到天数: 209 天
连续签到: 2 天
[LV.7]常住居民III
管理员
VIP
7
卡币
58883
OK点
16
推广点
0
同能卷
50
积分 68848
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.
Spoiler 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 #============================================================================== # ** #============================================================================== 复制代码
本贴来自国际rpgmaker官方论坛作者:Traverse处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/windowskin-manager.135224/