查看: 1956|回复: 0

菜单中绘制TP

[复制链接]

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2014-5-21 15:58:23 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 taroxd 于 2014-12-26 16:11 编辑

使用方法:为角色增加「特技专注」属性,或在设置常量脚本中的PRESERVE_TP常量设为true,即可自动在菜单上绘制TP

[pre lang="ruby" line="1"]

#--------------------------------------------------------------------------
# ● require Taroxd基础设置
#--------------------------------------------------------------------------
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 绘制简单的状态
  #--------------------------------------------------------------------------
  def_chain :draw_actor_simple_status do |old, actor, x, y|
    if actor.preserve_tp?
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x, y + line_height)
      draw_actor_icons(actor, x, y + line_height * 2)
      draw_actor_class(actor, x + 120, y)
      draw_actor_hp(actor, x + 120, y + line_height)
      draw_actor_mp(actor, x + 120, y + line_height * 2, 60)
      draw_actor_tp(actor, x + 184, y + line_height * 2, 60)
    else
      old.(actor, x, y)
    end
  end
end

class Window_Status < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 绘制基本信息
  #--------------------------------------------------------------------------
  def_chain :draw_basic_info do |old, x, y|
    if @actor.preserve_tp?
      draw_actor_level(@actor, x, y)
      draw_actor_icons(@actor, x, y + line_height)
      draw_actor_hp(@actor, x, y + line_height * 2)
      draw_actor_mp(@actor, x, y + line_height * 3, 60)
      draw_actor_tp(@actor, x + 64, y + line_height * 3, 60)
    else
      old.(x, y)
    end
  end
end[/pre]

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本发帖返回顶部