| 赞 | 169 |
| VIP | |
| 好人卡 | |
| 积分 | 158 |
| 经验 | |
| 最后登录 | 2026-10-11 |
| 在线时间 | 2319 小时 |
- 梦石
- 2
- 星屑
- 13784
- 在线时间
- 2319 小时
- 注册时间
- 2011-6-4
- 回帖
- 586
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
前几天给朋友写的,和往常一样,免费写但是会公开。
功能大致如下:
①在武器可技能界面中可以按SHIFT键打开;
②细明窗口的长宽以及皮肤可以自行设定;
③可禁用物品界面和技能界面的窗口;
④使用方法:在物品/技能的备注中写上[de](细明内容)[ta];
⑤\n换行 、 \c[n] 更改字体颜色等控制符均可以使用。
截图:
脚本:
脚本内容- #===============================================================================
- #物品界面、技能界面按SHIFT打开介绍窗口
- #2019/1/14 By:真·可乐
- #===============================================================================
- module ZCL_Detail_Set
- #窗口的皮肤名称
- WINDOWSKILL = "Window"
- #窗口的宽度
- WWIDTH = Graphics.width / 2.3
- #窗口的高度
- WHEIGHT = Graphics.height / 1.5
- #窗口物品名称栏的背景色,最后一项是不透明度,填成0的话就没颜色了
- ITEMNAMEBACKCOLOR = [0,255,0,100]
- #禁用设定 , 1 为禁用 物品界面细明窗口 ,2 为禁用 技能界面细明窗口 , 3 为全部禁用
- DISABLE = 0
- end
- module RPG
- class BaseItem
- def detail
- /\[de\](.*)\[ta\]/ =~ self.note
- return ($1.is_a?(String) ? $1 : "")
- end
- end
- end
- class Window_Detail < Window_Base
- attr_accessor :item
- include ZCL_Detail_Set
- def initialize(y)
- super(x = 0,y,WWIDTH,WHEIGHT)
- self.windowskin = Cache.system(WINDOWSKILL)
- @item = nil
- end
-
- def refresh
- self.contents.clear
- return self.hide if @item.nil?
- co = ITEMNAMEBACKCOLOR
- contents.fill_rect(0,0,self.width,32,Color.new(co[0],co[1],co[2],co[3]))
- text = @item.detail.gsub("\\n"){"\n"}
- draw_item_name(@item,0,2,true);draw_text_ex(0,36,text)
- end
-
- def item=(titem)
- @item = titem
- self.refresh
- end
- end
- class Scene_ItemBase
- attr_reader :detail_window
- alias startzcl2019114 start
- def start
- startzcl2019114;create_detail_window
- end
-
- def create_detail_window
- @detail_window = Window_Detail.new(0)
-
- @detail_window.hide
- end
- alias updatezcl2019114 update
- def update
- updatezcl2019114
- update_detail
- end
-
- def update_detail
- return @detail_window.hide unless @item_window.active
- if Input.trigger?(Input::A)
- return if self.is_a?(Scene_Item) && ZCL_Detail_Set::DISABLE == 1
- return if self.is_a?(Scene_Skill) && ZCL_Detail_Set::DISABLE == 2
- return unless ZCL_Detail_Set::DISABLE.between?(0,2)
- refresh_detail_window;end
- @detail_window.hide if Input.trigger?(:UP) || Input.trigger?(:DOWN) ||
- Input.trigger?(:LEFT) || Input.trigger?(:RIGHT)
- end
-
- def refresh_detail_window
- if @item_window.item.nil?
- @detail_window.hide
- return Sound.play_buzzer
- end
- @detail_window.y = @item_window.y
- @detail_window.z = @item_window.z + 100
- @detail_window.height = [Graphics.height - @detail_window.y , ZCL_Detail_Set::WHEIGHT ].min
- @detail_window.create_contents
- wx = Graphics.width/2 + (@item_window.index % 2 == 0 ? 0 : -@detail_window.width)
- @detail_window.item = @item_window.item
- @detail_window.x = wx
- Sound.play_ok
- @detail_window.visible = !@detail_window.visible
- end
-
- alias use_itemzcl2019114 use_item
- def use_item
- use_itemzcl2019114
- refresh_detail_window
- end
- end
复制代码
|
评分
-
查看全部评分
|