赞 | 11 |
VIP | 302 |
好人卡 | 162 |
积分 | 62 |
经验 | 108302 |
最后登录 | 2024-11-2 |
在线时间 | 6592 小时 |
Lv4.逐梦者 醉啸 长风万里
- 梦石
- 0
- 星屑
- 6157
- 在线时间
- 6592 小时
- 注册时间
- 2007-12-16
- 帖子
- 4501
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
一款重新排版的菜单,还算不错,对于不愿意更改菜单的新手来说可以替换掉原菜单
更改方法:见脚本
脚本内容
- #==============================================================================
- # VX菜单重新排版 by 仲秋启明
- #------------------------------------------------------------------------------
- #同伴窗口可以使用左右键
- #如插入菜单背景音,可在第247行插入
- #更改图标在第118行
- #金钱图标在第203行定义
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● HP的描画
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 宽
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 90)
- draw_actor_hp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
- self.contents.font.color = hp_color(actor)
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxhp, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● HP矩形的描画
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 宽
- #--------------------------------------------------------------------------
- def draw_actor_hp_gauge(actor, x, y, width = 90)
- gw = width * actor.hp / actor.maxhp
- gc1 = hp_gauge_color1
- gc2 = hp_gauge_color2
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- #--------------------------------------------------------------------------
- # ● SP的描画
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 宽
- #--------------------------------------------------------------------------
- def draw_actor_mp(actor, x, y, width = 90)
- draw_actor_mp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
- self.contents.font.color = mp_color(actor)
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.mp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.mp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxmp, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● MP矩形的描画
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 宽
- #--------------------------------------------------------------------------
- def draw_actor_mp_gauge(actor, x, y, width = 90)
- gw = width * actor.mp / [actor.maxmp, 1].max
- gc1 = mp_gauge_color1
- gc2 = mp_gauge_color2
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- end
- #==============================================================================
- # ■ Window_ActorCommand
- #------------------------------------------------------------------------------
- # 菜单画面显示角色指令的窗口。
- #==============================================================================
- class Window_MenuCommand < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :commands # 命令
- WLH = 28
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # width : 窗口的宽
- # commands : 命令字符串序列
- # column_max : 行数 (2 行以上时选择)
- # row_max : 列数 (0:列数加起来)
- # spacing : 选项横向排列时间隔空白宽度
- #--------------------------------------------------------------------------
- def initialize(width = 128, commands = [], column_max = 1, row_max = 8, spacing = 32)
- if row_max == 0
- row_max = (commands.size + column_max - 1) / column_max
- end
- super(0, 0, width, row_max * 32 + 32, spacing)
- @commands = commands
- @item_max = commands.size
- @column_max = column_max
- @remember_index = -1
- self.index = 0
- self.y = (Graphics.height - self.height) / 2 - 8
- update
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @icon_list = [144, 128, 52, 137, 158, 189]
- for i in 0...@item_max
- draw_item(i)
- end
- end
-
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # enabled : 有效标记录。是false 的时候半透明绘画
- #--------------------------------------------------------------------------
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- draw_icon(@icon_list[index], rect.x, rect.y, true) if index == self.index
- self.contents.font.color = normal_color
- if !enabled or self.index != index
- self.contents.font.color.alpha = 64
- else
- self.contents.font.color.alpha = 255
- end
- rect.x += 26
- self.contents.draw_text(rect, @commands[index])
- end
- #--------------------------------------------------------------------------
- # ● 获取项目描画矩形
- # index : 项目编号
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new(0, 0, 0, 0)
- rect.width = (contents.width + @spacing) / @column_max - @spacing
- rect.height = WLH
- rect.x = index % @column_max * (rect.width + @spacing)
- rect.y = index / @column_max * WLH
- return rect
- end
- #--------------------------------------------------------------------------
- # ● 刷新类型
- #--------------------------------------------------------------------------
- def update
- super
- @remember_index = self.index if self.index == -1
- if @remember_index != self.index
- @remember_index = self.index
- refresh
- end
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 544, 416)
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- draw_actor_face(actor,actor.index * 96 + 2,42, 92)
- x = actor.index * 96 + WLH / 2
- y = 144
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x , y+60)
- draw_actor_level(actor, x, y + WLH * 1)
- draw_actor_state(actor, x , y )
- draw_actor_hp(actor, x -10, y +60+ WLH*1)
- draw_actor_mp(actor, x -10, y +60+ WLH*2)
- end
- draw_icon(252 - 58, 384+5, 284-32)
- end
- #--------------------------------------------------------------------------
- # ● 更新光标
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # 没有光标
- self.cursor_rect.empty
- elsif @index < @item_max # 普通
- self.cursor_rect.set(@index * 96,30, 96,264)
- elsif @index >= 100 # 自己
- self.cursor_rect.set((@index - 100) * 96,30,96,264)
- else # 全体
- self.cursor_rect.set(0, 3, @item_max * 96, 264)
- end
- if Input.trigger?(Input::LEFT)
- @index-=1
- else
- if Input.trigger?(Input::RIGHT)
- @index+=1
- end
- if @index>3
- return @index=0
- else
- if @index<-1
- return @index=3
- end
- end
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # menu_index : 指令光标初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @gold_window = Window_Gold.new(384, 284-32)
- @status_window = Window_MenuStatus.new(0, 0)
- @status_window.opacity = 0
- @gold_window.opacity = 0
- @command_window.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @gold_window.dispose
- @status_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- @gold_window.update
- @status_window.update
- if @command_window.active
- update_command_selection
- elsif @status_window.active
- update_actor_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成指令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = "查看物品"
- s2 = "使用特技"
- s3 = "更换装备"
- s4 = "查看状态"
- s5 = "存储档案"
- s6 = "结束游戏"
- @command_window = Window_MenuCommand.new(160, [s1, s2, s3, s4, s5, s6])
- @command_window.index = @menu_index
- @command_window.x = 384
- @command_window.y = 40
- if $game_party.members.size == 0 # 同伴人数为 0 的情况下
- @command_window.draw_item(0, false) # 物品无效化
- @command_window.draw_item(1, false) # 特技无效化
- @command_window.draw_item(2, false) # 装备无效化
- @command_window.draw_item(3, false) # 状态无效化
- end
- if $game_system.save_disabled # 禁止存档的情况下
- @command_window.draw_item(5, false) # 存档无效化
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新指令选择
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # 物品
- $scene = Scene_Item.new
- when 1,2,3 # 特技、装备、状态
- start_actor_selection
- when 4 # 存档
- $scene = Scene_File.new(true, false, false)
- when 5 # 游戏结束
- $scene = Scene_End.new
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の開始
- #--------------------------------------------------------------------------
- def start_actor_selection
- @command_window.active = false
- @status_window.active = true
- if $game_party.last_actor_index < @status_window.item_max
- @status_window.index = $game_party.last_actor_index
- else
- @status_window.index = 0
- end
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の終了
- #--------------------------------------------------------------------------
- def end_actor_selection
- @command_window.active = true
- @status_window.active = false
- @status_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の更新
- #--------------------------------------------------------------------------
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- case @command_window.index
- when 1 # スキル
- $scene = Scene_Skill.new(@status_window.index)
- when 2 # 装備
- $scene = Scene_Equip.new(@status_window.index)
- when 3 # ステータス
- $scene = Scene_Status.new(@status_window.index)
- end
- end
- end
- end
复制代码
截图:
如不能显示,点击图片 |
|