赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 3 |
经验 | 0 |
最后登录 | 2024-6-1 |
在线时间 | 39 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 322
- 在线时间
- 39 小时
- 注册时间
- 2020-5-21
- 帖子
- 20
|
这个...?
虽然不是思路oz....
参考一下应该可以??
- #===============================================================================#
- # N.A.S.T.Y. 将窗口替换成图片
- # Nelderson's Awesome Scripts To You
- # By: Nelderson
- # Made On: 3/11/2015
- # Last Updated: 3/12/2015
- #===============================================================================
- # Update History:
- # - Version 0.5 - Initial Release - Technically BETA/Tesing Stage
- # - Version 1.0 - Fixed issues with the Message window and added
- # feature to change picture to a window with a script call
- #===============================================================================
- # *Notes:
- # -This script uses pictures instead of windows you specify.
- #===============================================================================
- # Credits:
- # -Nelderson
- #===============================================================================
- # 安装:
- #
- # -在下面设定 PICWINDOW 这个哈希表. 本脚本不仅适用于默认窗口,其他脚本的自定义
- # 窗口也同样有效.
- #
- # -如果你想要知道你的窗口需要多大的图片,最好的方式是查看各窗口类的初始化方法
- # (initialize)一般的格式是(x, y, 宽度, 高度).
- # 所以你的图片大小要和窗口的宽高度相同.
- #
- # -可以使用脚本来改变窗口图片:
- # change_nelwinpic(window, "图片文件名")
- # 其中 window 是窗口的类名称 class .
- # Ex. change_nelwinpic(Window_Gold, "Gold")
- #===============================================================================
- # 请输入 窗口类名称 => 图片文件名
- # 例子:
- # Window_Gold => "Gold",
- module NEL
-
- PICWINDOW ={ # <=== 别删
- Window_GameEnd => "Window_GameEnd",
- Window_Status=> "Window_Status",
- Window_Help => "物品窗口-1",
- Window_ItemCategory => "物品窗口-2",
- Window_ItemList => "物品窗口-3",
-
- }# <=== 别删
- end
- #==============================================================================#
- # END OF CUSTOMIZATION #
- #==============================================================================#
- class Game_System
- attr_accessor :nelpicwindow
- alias nel_winpic_sysinit initialize
- def initialize
- nel_winpic_sysinit
- @nelpicwindow = {}
- for i in NEL::PICWINDOW
- @nelpicwindow[i[0]] = i[1]
- end
- end
- end
- class Window_Base < Window
- attr_accessor :nelwinpic
- alias nel_winpic_scrpt_init initialize
- def initialize(*args)
- nel_winpic_scrpt_init(*args)
- create_nelpicture
- end
-
- def create_nelpicture
- for i in $game_system.nelpicwindow
- #Stupid Gold Window....
- next if SceneManager.scene_is?(Scene_Map) && self.instance_of?(Window_Gold)
- next if SceneManager.scene_is?(Scene_Battle) && self.instance_of?(Window_Gold)
- next if i[1] == nil #In case in game is changed. Goes back to default
- if self.instance_of?(i[0]) ###Where all the magic happens!###
- @nelwinpic = ::Sprite.new(self.viewport)
- @nelwinpic.visible = false
- @nelwinpic.bitmap = Cache.picture(i[1])
- @nelwinpic.x = self.x
- @nelwinpic.y = self.y
- @nelwinpic.opacity = self.opacity
- self.opacity = 0
- end
- end
- end
-
- alias nel_winpic_scrpt_dispose dispose
- def dispose
- if @nelwinpic != nil
- @nelwinpic.bitmap.dispose
- @nelwinpic = nil
- end
- nel_winpic_scrpt_dispose
- end
-
- alias nel_winpic_srpt_update update
- def update
- nel_winpic_srpt_update
- if @nelwinpic != nil
- @nelwinpic.x = self.x
- @nelwinpic.y = self.y
- @nelwinpic.viewport = self.viewport
- @nelwinpic.visible = self.visible
- if self.instance_of?(Window_Message) && $game_system.nelpicwindow[Window_Message] != nil
- @nelwinpic.visible = $game_message.visible
- self.opacity = 0
- end
- end
- end
- end
-
- class Game_Interpreter
- def change_nelwinpic(window, pic)
- $game_system.nelpicwindow[window] = pic
- if SceneManager.scene_is?(Scene_Map)
- SceneManager.goto(Scene_Map) if window == Window_Message
- end
- end
- end
复制代码 |
|