Project1

标题: 菜单中绘制TP [打印本页]

作者: taroxd    时间: 2014-5-21 15:58
标题: 菜单中绘制TP
本帖最后由 taroxd 于 2014-12-26 16:11 编辑

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

RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2. # ● require Taroxd基础设置
  3. #--------------------------------------------------------------------------
  4. class Window_Base < Window
  5.   #--------------------------------------------------------------------------
  6.   # ● 绘制简单的状态
  7.   #--------------------------------------------------------------------------
  8.   def_chain :draw_actor_simple_status do |old, actor, x, y|
  9.     if actor.preserve_tp?
  10.       draw_actor_name(actor, x, y)
  11.       draw_actor_level(actor, x, y + line_height)
  12.       draw_actor_icons(actor, x, y + line_height * 2)
  13.       draw_actor_class(actor, x + 120, y)
  14.       draw_actor_hp(actor, x + 120, y + line_height)
  15.       draw_actor_mp(actor, x + 120, y + line_height * 2, 60)
  16.       draw_actor_tp(actor, x + 184, y + line_height * 2, 60)
  17.     else
  18.       old.(actor, x, y)
  19.     end
  20.   end
  21. end
  22.  
  23. class Window_Status < Window_Selectable
  24.   #--------------------------------------------------------------------------
  25.   # ● 绘制基本信息
  26.   #--------------------------------------------------------------------------
  27.   def_chain :draw_basic_info do |old, x, y|
  28.     if @actor.preserve_tp?
  29.       draw_actor_level(@actor, x, y)
  30.       draw_actor_icons(@actor, x, y + line_height)
  31.       draw_actor_hp(@actor, x, y + line_height * 2)
  32.       draw_actor_mp(@actor, x, y + line_height * 3, 60)
  33.       draw_actor_tp(@actor, x + 64, y + line_height * 3, 60)
  34.     else
  35.       old.(x, y)
  36.     end
  37.   end
  38. end





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1