赞 | 13 |
VIP | 118 |
好人卡 | 28 |
积分 | 12 |
经验 | 35779 |
最后登录 | 2017-7-6 |
在线时间 | 1564 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1210
- 在线时间
- 1564 小时
- 注册时间
- 2008-7-30
- 帖子
- 4418
|
本帖最后由 DeathKing 于 2010-8-28 16:59 编辑
其实很早就打算写一个窗口脚本的,但是苦于没有很好的界面布局。
YetAnotherMenu,命名来源于奇怪的Yahoo(yet another hierarchical officious oracle)
小优化一下,过会儿放出 ^_^
目前就是这么简简单单
fallow the FSL so there is no charge!- #===============================================================================
- # ■ YAM菜单
- # Yet Another Menu
- #-------------------------------------------------------------------------------
- # YAM菜单只是一个小小的对默认脚本的改进。还在不断的加强中。
- #
- # 请将此脚本放在默认脚本后,Main脚本前。
- #-------------------------------------------------------------------------------
- # 更新作者: DeathKing
- # 许可协议: FSL
- # 项目版本: 1.0.0828
- # 引用网址:
- #-------------------------------------------------------------------------------
- #
- # - 1.0.0828 By DeathKing
- # * 初始版本完成;
- #===============================================================================
- $fscript = {} if $fscript == nil
- $fscript["YetAnotherMenu"] = "1.0.0828"
- #-------------------------------------------------------------------------------
- # ▼ 通用配置模块
- #-------------------------------------------------------------------------------
- module FSL
- module YetAnotherMenu
- # X Y
- Glod_Scale = [ 20, 330 ] # 金币窗体的坐标
- State_Scale = [ 45, 0 ] # 状态窗体的坐标
- Command_Scale = [ 390, 40 ] # 命令窗体的坐标
- Command_Width = 120 # 命令窗体的宽度
-
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # x : 窗口 X 座标
- # y : 窗口 Y 座标
- #--------------------------------------------------------------------------
- def initialize(x, y)
- # 根据队员调整高度
- height = $game_party.members.size * 92 + WLH / 2 + 32
- # 水平置中
- y = ( ( 416 - height ) / 2 ).to_i
- super(x, y, 384, height)
- 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
- face_x = self.width - 130
- draw_actor_face(actor, face_x, actor.index * 96 + 2, 92)
- x = 2
- y = actor.index * 96 + WLH / 2
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 120, y)
- draw_actor_level(actor, x, y + WLH * 1)
- draw_actor_state(actor, x, y + WLH * 2)
- draw_actor_hp(actor, x + 120, y + WLH * 1)
- draw_actor_mp(actor, x + 120, y + WLH * 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 活动状态
- #--------------------------------------------------------------------------
- alias yam_active= active=
- def active=(value)
- # 和visible相关联
- self.yam_active = value
- self.visible = value
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu < Scene_Base
-
- include FSL::YetAnotherMenu
-
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # 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( *Glod_Scale )
- @status_window = Window_MenuStatus.new( *State_Scale )
- @status_window.visible = false
- end
- #--------------------------------------------------------------------------
- # ● 生成命令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::save
- s6 = Vocab::game_end
- # 新建命令窗口
- @command_window = Window_Command.new(Command_Width, [s1, s2, s3, s4, s5, s6])
- # 设定命令窗口的X、Y坐标
- @command_window.x, @command_window.y = Command_Scale
- # 命令窗口的垂直置中
- @command_window.y = ( ( 416 - @command_window.height ) / 2 ).to_i
- @command_window.index = @menu_index
- if $game_party.members.size == 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(4, false) # 无效化存档选项
- end
- end
- end
复制代码 |
|