设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 106|回复: 0

[转载发布] Windowskin Manager

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 17:50:35 | 显示全部楼层 |阅读模式
    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:       
    1. #==============================================================================
    2. # ** Windowskin Manager
    3. # Author: Traverse
    4. # Version 1.0 (5/4/2021)
    5. #
    6. # Terms of Use:
    7. # - Free to use for any commercial/non-commercial project.
    8. # - Free to modify (there's not really much to modify).
    9. # - Credit Traverse if used/modified.
    10. #------------------------------------------------------------------------------
    11. # Instructions:
    12. #
    13. # Type the name of the windowskin image file you wish to use into the field
    14. # DEFAULT_WINDOWSKIN to use it instead of the RTP's default "window.png".
    15. #
    16. # Type the name of a Scene object and a windowskin filename into the hash
    17. # Scene_Windowskins to globally set that windowskin for all windows created by
    18. # that Scene.
    19. #
    20. # Type the name of a Window object and a windowskin filename into the hash
    21. # Window_Windowskins to globally set that windowskin for all windows of that
    22. # specified type created in the game.
    23. #
    24. # For Scene_Windowskins and Window_Windowskins, the correct syntax is:
    25. #   "name_of_scene_or_window" => "filename_of_windowskin",
    26. #
    27. # The names must be in quotations, the arrow must not have a space between
    28. # the = and > and there must be a comma at the end (unless it's the last entry in
    29. # the list) otherwise it will crash.
    30. #
    31. # All windowskin image files must be located inside the Graphics/System folder.
    32. # Sub-folders under Graphics/System can be specified as part of the filename:
    33. #   i.e. "/subfolder/window.png"
    34. #
    35. # File extensions can be specified, but do not have to be unless you have multiple
    36. # different files with the same name, but different file extensions
    37. # (i.e. "window.png", "window.jpeg").
    38. #
    39. # Blank strings ("") will be treated as though nothing was specified for the
    40. # field. A string with only spaces (" ") is NOT considered "blank", but there
    41. # shouldn't be any possible filenames that have only spaces.
    42. #
    43. # !! N.B. !!
    44. # Window_Windowskins will take priority over Scene_Windowskins, which will take
    45. # priority over the DEFAULT_WINDOWSKIN.
    46. #
    47. # Example: If there was a skin specified for Window_Message AND one specified for
    48. # Scene_Map, the message window on Scene_Map will use the one specified for
    49. # Window_Message instead of Scene_Map.
    50. #
    51. # Otherwise, if there was nothing specified for Window_Message, the message window
    52. # will use the one specified for Scene_Map (or Scene_Battle, if that was where
    53. # the message window was created).
    54. #
    55. # If there was nothing specified for Window_Message or the scene it was made in,
    56. # it will then try to use the file specified in DEFAULT_WINDOWSKIN. And if there
    57. # was also nothing specified in DEFAULT_WINDOWSKIN, it will default back to using
    58. # the engine's typical windowskin ("window.png").
    59. #
    60. #==============================================================================
    61. # ** WindowskinManager - SCRIPT SETTINGS
    62. #==============================================================================
    63. module WindowskinManager
    64.   DEFAULT_WINDOWSKIN = "Window"
    65.   Scene_Windowskins = {
    66.     "Scene_Title" => "",
    67.     "Scene_Battle" => "",
    68.     "Scene_Map" => "",
    69.     # Add more scenes here.
    70.   }
    71.   Window_Windowskins = {
    72.     "Window_Help" => "",
    73.     "Window_Message" => "",
    74.     "Window_SaveFile" => "",
    75.     # Add more windows here.
    76.   }
    77. end
    78. #==============================================================================
    79. # ** Window_Base
    80. #==============================================================================
    81. class Window_Base < Window
    82.   alias_method :winbase_init_traverse_050421, :initialize
    83.   def initialize(x, y, width, height)
    84.     # Call original method.
    85.     winbase_init_traverse_050421(x, y, width, height)
    86.     # New functionality.
    87.     default_windowskin = WindowskinManager::DEFAULT_WINDOWSKIN
    88.     if default_windowskin.is_a?(String) && !default_windowskin.empty?
    89.       self.windowskin = Cache.system(default_windowskin)
    90.     end
    91.     if WindowskinManager::Scene_Windowskins[SceneManager.scene.class.to_s]
    92.       skin = WindowskinManager::Scene_Windowskins[SceneManager.scene.class.to_s]
    93.       self.windowskin = Cache.system(skin) if (skin.is_a?(String) && !skin.empty?)
    94.     end
    95.     if WindowskinManager::Window_Windowskins[self.class.to_s]
    96.       skin = WindowskinManager::Window_Windowskins[self.class.to_s]
    97.       self.windowskin = Cache.system(skin) if (skin.is_a?(String) && !skin.empty?)
    98.     end
    99.   end
    100. end
    101. #==============================================================================
    102. # **
    103. #==============================================================================
    复制代码








    本贴来自国际rpgmaker官方论坛作者:Traverse处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/windowskin-manager.135224/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 09:25 , Processed in 0.143025 second(s), 58 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表