赞 | 7 |
VIP | 0 |
好人卡 | 1 |
积分 | 18 |
经验 | 34644 |
最后登录 | 2024-6-30 |
在线时间 | 951 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1784
- 在线时间
- 951 小时
- 注册时间
- 2012-7-5
- 帖子
- 245
|
{:2_264:} 就是弄个合适的位置竟然弄了那么久
脚本:
#encoding:utf-8
class Window_MenuSkillList < Window_Selectable
attr_reader :skills
def initialize
super(400,0,144,416)
make_skill_list
open
select(0)
activate
end
def make_skill_list
@skills = $game_party.members[0].skills
idx = 0
@skills.each do |each_skill|
draw_item(idx,each_skill.name)
#msgbox(each_skill.name)
idx += 1
end
end
def draw_item(index,text)
draw_text(item_rect_for_text(index), text)
end
def item_max
return @skills? @skills.size : 1
end
end
class Window_Status_SpecialChg < Window_Status
def initialize(actor)
super(actor)
end
def draw_block1(y)
draw_actor_name(@actor, 4, y)
draw_actor_class(@actor, 80, y)
draw_actor_nickname(@actor, 128, y)
end
def draw_block2(y)
draw_actor_face(@actor, 8, y)
draw_basic_info(126, y)
draw_exp_info(218, y)
end
def draw_block3(y)
draw_parameters(32, y)
draw_equipments(144, y)
end
def draw_actor_param(actor, x, y, param_id)
change_color(system_color)
draw_text(x, y, 120, line_height, Vocab::param(param_id))
change_color(normal_color)
draw_text(x + 40, y, 36, line_height, actor.param(param_id), 2)
end
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-" : @actor.exp
s2 = @actor.max_level? ? "-" : @actor.next_level_exp - @actor.exp
s_next = sprintf(Vocab::ExpNext, Vocab::level)
change_color(system_color)
draw_text(x-40, y + line_height * 0, 100, line_height, Vocab::ExpTotal)
draw_text(x-40, y + line_height * 1, 100, line_height, s_next)
change_color(normal_color)
draw_text(x+60, y + line_height * 0, 60, line_height, s1, 2)
draw_text(x+60, y + line_height * 1, 60, line_height, s2, 2)
end
end
class Window_MenuSkillHelp < Window_Help
def initialize
super(3)
close
end
end
class Scene_Menu < Scene_Base
def start
super
create_status_window
create_skill_list
end
def create_status_window
@status_window = Window_Status_SpecialChg.new($game_party.members[0])
@status_window.x = 0
@status_window.y = 0
@status_window.height = Graphics.height
@status_window.width = 360
end
def create_skill_list
@skill_list = Window_MenuSkillList.new
@skill_list.height = @status_window.height
@skill_list.width = Graphics.width - @status_window.width
@skill_list.x = @status_window.width
@skill_list.y = 0
#@skill_list.set_handler(:cancel,method(:skill_list_cancel))
#这个不好用啦,直接重载update(好bao力 O(∩_∩))
@skill_list.set_handler(:ok, method(:skill_list_ok))
end
def skill_list_ok
@help ||= Window_MenuSkillHelp.new
@help.set_text(@skill_list.skills[@skill_list.index].description)
@help.open
end
def update
super
if Input.trigger?(:B)
if @help != nil && @help.open?
@help.close
@skill_list.activate
else
SceneManager.return
end
end
end
end |
|