查看: 5043|回复: 1

[已经解决] 求个TP显示改良脚本

[复制链接]
梦石
0
星屑
50
在线时间
190 小时
注册时间
2011-2-19
回帖
128
发表于 2013-2-1 16:16:55 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 空の翼 于 2013-2-1 19:46 编辑

在菜单人物状态中显示TP
[pre lang="ruby" line="1"]
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制简单的状态
  #--------------------------------------------------------------------------
  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x, y)
    draw_actor_level(actor, x, y + line_height * 1)
    draw_actor_icons(actor, x, y + line_height * 2)
    draw_actor_class(actor, x + 120, y - line_height * 0.5)
    draw_actor_hp(actor, x + 120, y + line_height * 0.5) #绘制HP,在原有位置上略调整
    draw_actor_mp(actor, x + 120, y + line_height * 1.5) #绘制MP,在原有位置上略调整
    draw_actor_tp(actor, x + 120, y + line_height * 2.5)  #绘制TP
  end
end
[/pre]
想请大大们帮忙改改这个简单的TP绘制。
需要是在如果没有附加TP保留的特征时候,TP条变成:no reserve 之类的文字
梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2013-2-1 18:00:54 | 显示全部楼层
  1. class Window_Base
  2.   def draw_actor_simple_status(actor, x, y)
  3.     draw_actor_name(actor, x, y)
  4.     draw_actor_level(actor, x, y + line_height * 1)
  5.     draw_actor_icons(actor, x, y + line_height * 2)
  6.     draw_actor_class(actor, x + 120, y - line_height * 0.5)
  7.     draw_actor_hp(actor, x + 120, y + line_height * 0.5) #绘制HP,在原有位置上略调整
  8.     draw_actor_mp(actor, x + 120, y + line_height * 1.5) #绘制MP,在原有位置上略调整
  9.     if actor.preserve_tp?
  10.       draw_actor_tp(actor, x + 120, y + line_height * 2.5)  #绘制TP
  11.     else
  12.       draw_no_reserve(actor, x + 120, y + line_height * 2.5)
  13.     end
  14.   end
  15.   def draw_no_reserve(actor, x, y, width = 112)
  16.     draw_text(x, y, width, line_height, "no reserve") # 修改显示文字
  17.   end
  18. end
复制代码

点评

嗯,可以了。非常感谢XD  发表于 2013-2-1 19:38
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部