设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 774|回复: 1
打印 上一主题 下一主题

[已经解决] 如何在此脚本某部分添加文字

[复制链接]

Lv1.梦旅人

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
帖子
2394
跳转到指定楼层
1
发表于 2015-4-9 17:59:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 VIPArcher 于 2015-4-9 22:15 编辑

RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Status Menu v1.01
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-StatusMenu"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.26 - Compatibility Update: Rename Actor
  17. # 2011.12.23 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # This script changes the status screen completely to something the player can
  23. # interact with more and be able to view actor data with more clarity. The
  24. # player is able to view the general information for an actor (parameters and
  25. # experience), a parameters bar graph, the various hidden extra parameters
  26. # (named properties in the script), and a customizable biography for the actor.
  27. # Also with this script, biographies can be changed at any time using a script
  28. # call to add more of a personal touch to characters.
  29. #
  30. #==============================================================================
  31. # ▼ Instructions
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # To install this script, open up your script editor and copy/paste this script
  34. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  35. #
  36. # -----------------------------------------------------------------------------
  37. # Script Calls - These commands are used with script calls.
  38. # -----------------------------------------------------------------------------
  39. # $game_actors[x].description = string
  40. # Changes the biography description for actor x to that of the string. Use \n
  41. # to designate linebreaks in the string. If you wish to use text codes, write
  42. # them in the strings as \\n[2] or \\c[3] to make them work properly.
  43. #
  44. #==============================================================================
  45. # ▼ Compatibility
  46. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  47. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  48. # it will run with RPG Maker VX without adjusting.
  49. #
  50. #==============================================================================
  51.  
  52. module YEA
  53.   module STATUS
  54.  
  55.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.     # - Command Window Settings -
  57.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58.     # This section adjusts the commands that appear in the command window used
  59.     # for the status screen. Rearrange the commands, add new ones, remove them
  60.     # as you see fit.
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     COMMANDS =[ # The order at which the menu items are shown.
  63.     # [    :command,    "Display"],
  64.       [    :general,    "基本信息"],
  65.       [ :properties, "属性"],
  66.     # [    :custom1,     "Skills"],
  67.     # [    :custom2,  "Equipment"],
  68.     # [    :custom3,      "Class"],
  69.       [     :rename,     "Rename"],  # Requires YEA - Rename Actor
  70.       [    :retitle,    "Retitle"],  # Requires YEA - Rename Actor
  71.     ] # Do not remove this.
  72.  
  73.     #--------------------------------------------------------------------------
  74.     # - Status Custom Commands -
  75.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  76.     # For those who use scripts to that may produce unique effects for the
  77.     # status menu, use this hash to manage the custom commands for the Status
  78.     # Command Window. You can disable certain commands or prevent them from
  79.     # appearing by using switches. If you don't wish to bind them to a switch,
  80.     # set the proper switch to 0 for it to have no impact.
  81.     #--------------------------------------------------------------------------
  82.     CUSTOM_STATUS_COMMANDS ={
  83.     # :command => [EnableSwitch, ShowSwitch, Handler Method, Window Draw],
  84.       :custom1 => [           0,          0, :command_name1, :draw_custom1],
  85.       :custom2 => [           0,          0, :command_name2, :draw_custom2],
  86.       :custom3 => [           0,          0, :command_name3, :draw_custom3],
  87.     } # Do not remove this.
  88.  
  89.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90.     # - General Window Settings -
  91.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  92.     # These settings adjust the way the general window visually appears.
  93.     # Not many changes need to be done here other than vocab changes.
  94.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  95.     PARAMETERS_VOCAB = "数据"         # Title used for Parameters.
  96.     EXPERIENCE_VOCAB = "经验值"         # Title used for Experience.
  97.     NEXT_TOTAL_VOCAB = "下次 %s 经验值总数"  # Label used for total experience.
  98.  
  99.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  100.     # - Parameters Window Settings -
  101.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  102.     # These settings adjust the way the parameters window visually appears.
  103.     # Each of the stats have a non-window colour. Adjust them as you see fit.
  104.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  105.     PARAM_COLOUR ={
  106.     # ParamID => [:stat,       Colour1,                   Colour2          ],
  107.             2 => [ :atk, Color.new(225, 100, 100), Color.new(240, 150, 150)],
  108.             3 => [ :def, Color.new(250, 150,  30), Color.new(250, 180, 100)],
  109.             4 => [ :mat, Color.new( 70, 140, 200), Color.new(135, 180, 230)],
  110.             5 => [ :mdf, Color.new(135, 130, 190), Color.new(170, 160, 220)],
  111.             6 => [ :agi, Color.new( 60, 180,  80), Color.new(120, 200, 120)],
  112.             7 => [ :luk, Color.new(255, 240, 100), Color.new(255, 250, 200)],
  113.     } # Do not remove this.
  114.  
  115.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  116.     # - Properties Window Settings -
  117.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  118.     # These settings adjust the way the properties window visually appears.
  119.     # The properties have abbreviations, but leaving them as such makes things
  120.     # confusing (as it's sometimes hard to figure out what the abbreviations
  121.     # mean). Change the way the appear, whether or not they appear, and what
  122.     # order they will appear in.
  123.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  124.     PROPERTIES_FONT_SIZE = 16        # Font size used for properties.
  125.  
  126.     # These are the properties that appear in column 1.
  127.     PROPERTIES_COLUMN1 =[
  128.       [:hit, "命中"],
  129.       [:eva, "躲避"],
  130.       [:cri, "暴击"],
  131.       [:cev, "暴击闪避"],
  132.       [:mev, "魔法躲避"],
  133.       [:mrf, "魔法反射"],
  134.       [:cnt, "反击"],
  135.       [:tgr, "目标攻击"],
  136.     ] # Do not remove this.
  137.  
  138.     # These are the properties that appear in column 2.
  139.     PROPERTIES_COLUMN2 =[
  140.       [:hrg, "hp恢复"],
  141.       [:mrg, "mp再生"],
  142.       [:trg, "TP再生"],
  143.       [:rec, "恢复"],
  144.       [:grd, "防御力"],
  145.       [:pha, "物品使用"],
  146.       [:exr, "经验值获得"],
  147.       [:tcr, "TP模式"],
  148.     ] # Do not remove this.
  149.  
  150.     # These are the properties that appear in column 3.
  151.     PROPERTIES_COLUMN3 =[
  152.       [:hcr, "士兵消费伤害"],    # Requires YEA - Skill Cost Manager
  153.       [:mcr, "魔法消费伤害"],
  154.       [:tcr, "士气消费伤害"],    # Requires YEA - Skill Cost Manager
  155.       [:cdr, "硬直伤害"],   # Requires YEA - Skill Restrictions
  156.       [:wur, "激励伤害"],     # Requires YEA - Skill Restrictions
  157.       [:pdr, "物理伤害"],
  158.       [:mdr, "魔法伤害"],
  159.       [:fdr, "基本伤害"],
  160.     ] # Do not remove this.
  161.  
  162.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  163.     # - Biography Window Settings -
  164.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  165.     # These settings adjust the way the biography appears including the title
  166.     # used at the top, the font size, and whatnot.
  167.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  168.     BIOGRAPHY_NICKNAME_TEXT = "%s    %s"   # How the nickname will appear.
  169.     BIOGRAPHY_NICKNAME_SIZE = 32            # Size of the font used.
  170.  
  171.  
  172.  
  173.   end # STATUS
  174. end # YEA
  175.  
  176. #==============================================================================
  177. # ▼ Editting anything past this point may potentially result in causing
  178. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  179. # halitosis so edit at your own risk.
  180. #==============================================================================
  181.  
  182. #==============================================================================
  183. # ■ Numeric
  184. #==============================================================================
  185.  
  186. class Numeric
  187.  
  188.   #--------------------------------------------------------------------------
  189.   # new method: group_digits
  190.   #--------------------------------------------------------------------------
  191.   unless $imported["YEA-CoreEngine"]
  192.   def group; return self.to_s; end
  193.   end # $imported["YEA-CoreEngine"]
  194.  
  195. end # Numeric
  196.  
  197. #==============================================================================
  198. # ■ Game_Temp
  199. #==============================================================================
  200.  
  201. class Game_Temp
  202.  
  203.   #--------------------------------------------------------------------------
  204.   # public instance variables
  205.   #--------------------------------------------------------------------------
  206.   attr_accessor :scene_status_index
  207.   attr_accessor :scene_status_oy
  208.  
  209. end # Game_Temp
  210.  
  211. #==============================================================================
  212. # ■ Game_Actor
  213. #==============================================================================
  214.  
  215. class Game_Actor < Game_Battler
  216.  
  217.   #--------------------------------------------------------------------------
  218.   # new method: description=
  219.   #--------------------------------------------------------------------------
  220.   def description=(text)
  221.     @description = text
  222.   end
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # overwrite method: description
  226.   #--------------------------------------------------------------------------
  227.   def description
  228.     return @description unless @description.nil?
  229.     return actor.description
  230.   end
  231.  
  232. end # Game_Actor
  233.  
  234. #==============================================================================
  235. # ■ Window_StatusCommand
  236. #==============================================================================
  237.  
  238. class Window_StatusCommand < Window_Command
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # public instance variables
  242.   #--------------------------------------------------------------------------
  243.   attr_accessor :item_window
  244.  
  245.   #--------------------------------------------------------------------------
  246.   # initialize
  247.   #--------------------------------------------------------------------------
  248.   def initialize(dx, dy)
  249.     super(dx, dy)
  250.     @actor = nil
  251.   end
  252.  
  253.   #--------------------------------------------------------------------------
  254.   # window_width
  255.   #--------------------------------------------------------------------------
  256.   def window_width; return 160; end
  257.  
  258.   #--------------------------------------------------------------------------
  259.   # actor=
  260.   #--------------------------------------------------------------------------
  261.   def actor=(actor)
  262.     return if @actor == actor
  263.     @actor = actor
  264.     refresh
  265.   end
  266.  
  267.   #--------------------------------------------------------------------------
  268.   # visible_line_number
  269.   #--------------------------------------------------------------------------
  270.   def visible_line_number; return 4; end
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # ok_enabled?
  274.   #--------------------------------------------------------------------------
  275.   def ok_enabled?
  276.     return handle?(current_symbol)
  277.   end
  278.  
  279.   #--------------------------------------------------------------------------
  280.   # make_command_list
  281.   #--------------------------------------------------------------------------
  282.   def make_command_list
  283.     return unless @actor
  284.     for command in YEA::STATUS::COMMANDS
  285.       case command[0]
  286.       #--- Default ---
  287.       when :general, :parameters, :properties, :biography
  288.         add_command(command[1], command[0])
  289.       #--- Yanfly Engine Ace ---
  290.       when :rename
  291.         next unless $imported["YEA-RenameActor"]
  292.         add_command(command[1], command[0], @actor.rename_allow?)
  293.       when :retitle
  294.         next unless $imported["YEA-RenameActor"]
  295.         add_command(command[1], command[0], @actor.retitle_allow?)
  296.       #--- Custom Commands ---
  297.       else
  298.         process_custom_command(command)
  299.       end
  300.     end
  301.     if !$game_temp.scene_status_index.nil?
  302.       select($game_temp.scene_status_index)
  303.       self.oy = $game_temp.scene_status_oy
  304.     end
  305.     $game_temp.scene_status_index = nil
  306.     $game_temp.scene_status_oy = nil
  307.   end
  308.  
  309.   #--------------------------------------------------------------------------
  310.   # process_ok
  311.   #--------------------------------------------------------------------------
  312.   def process_ok
  313.     $game_temp.scene_status_index = index
  314.     $game_temp.scene_status_oy = self.oy
  315.     super
  316.   end
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # process_custom_command
  320.   #--------------------------------------------------------------------------
  321.   def process_custom_command(command)
  322.     return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  323.     show = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][1]
  324.     continue = show <= 0 ? true : $game_switches[show]
  325.     return unless continue
  326.     text = command[1]
  327.     switch = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][0]
  328.     enabled = switch <= 0 ? true : $game_switches[switch]
  329.     add_command(text, command[0], enabled)
  330.   end
  331.  
  332.   #--------------------------------------------------------------------------
  333.   # update
  334.   #--------------------------------------------------------------------------
  335.   def update
  336.     super
  337.     update_item_window
  338.   end
  339.  
  340.   #--------------------------------------------------------------------------
  341.   # update_item_window
  342.   #--------------------------------------------------------------------------
  343.   def update_item_window
  344.     return if @item_window.nil?
  345.     return if @current_index == current_symbol
  346.     @current_index = current_symbol
  347.     @item_window.refresh
  348.   end
  349.  
  350.   #--------------------------------------------------------------------------
  351.   # item_window=
  352.   #--------------------------------------------------------------------------
  353.   def item_window=(window)
  354.     @item_window = window
  355.     update
  356.   end
  357.  
  358.   #--------------------------------------------------------------------------
  359.   # update_help
  360.   #--------------------------------------------------------------------------
  361.   def update_help
  362.     return if @actor.nil?
  363.     @help_window.set_text(@actor.actor.description)
  364.   end
  365.  
  366. end # Window_StatusCommand
  367.  
  368. #==============================================================================
  369. # ■ Window_StatusActor
  370. #==============================================================================
  371.  
  372. class Window_StatusActor < Window_Base
  373.  
  374.   #--------------------------------------------------------------------------
  375.   # initialize
  376.   #--------------------------------------------------------------------------
  377.   def initialize(dx, dy)
  378.     super(dx, dy, window_width, fitting_height(4))
  379.     @actor = nil
  380.   end
  381.  
  382.   #--------------------------------------------------------------------------
  383.   # window_width
  384.   #--------------------------------------------------------------------------
  385.   def window_width; return Graphics.width - 160; end
  386.  
  387.   #--------------------------------------------------------------------------
  388.   # actor=
  389.   #--------------------------------------------------------------------------
  390.   def actor=(actor)
  391.     return if @actor == actor
  392.     @actor = actor
  393.     refresh
  394.   end
  395.  
  396.   #--------------------------------------------------------------------------
  397.   # refresh
  398.   #--------------------------------------------------------------------------
  399.   def refresh
  400.     contents.clear
  401.     return unless @actor
  402.     draw_actor_face(@actor, 0, 0)
  403.     draw_actor_simple_status(@actor, 108, line_height / 2)
  404.   end
  405.  
  406. end # Window_StatusActor
  407.  
  408. #==============================================================================
  409. # ■ Window_StatusItem
  410. #==============================================================================
  411.  
  412. class Window_StatusItem < Window_Base
  413.  
  414.   #--------------------------------------------------------------------------
  415.   # initialize
  416.   #--------------------------------------------------------------------------
  417.   def initialize(dx, dy, command_window)
  418.     super(dx, dy, Graphics.width, Graphics.height - dy)
  419.     @command_window = command_window
  420.     @actor = nil
  421.     refresh
  422.   end
  423.  
  424.   #--------------------------------------------------------------------------
  425.   # actor=
  426.   #--------------------------------------------------------------------------
  427.   def actor=(actor)
  428.     return if @actor == actor
  429.     @actor = actor
  430.     refresh
  431.   end
  432.  
  433.   #--------------------------------------------------------------------------
  434.   # refresh
  435.   #--------------------------------------------------------------------------
  436.   def refresh
  437.     contents.clear
  438.     reset_font_settings
  439.     return unless @actor
  440.     draw_window_contents
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # draw_window_contents
  445.   #--------------------------------------------------------------------------
  446.   def draw_window_contents
  447.     case @command_window.current_symbol
  448.     when :general
  449.       draw_actor_general
  450.     when :parameters
  451.       draw_parameter_graph
  452.     when :properties
  453.       draw_properties_list
  454.     when :biography, :rename, :retitle
  455.       draw_actor_biography
  456.     else
  457.       draw_custom
  458.     end
  459.   end
  460.  
  461.   #--------------------------------------------------------------------------
  462.   # draw_actor_general
  463.   #--------------------------------------------------------------------------
  464.   def draw_actor_general
  465.     change_color(system_color)
  466.     text = YEA::STATUS::PARAMETERS_VOCAB
  467.     draw_text(0, 0, contents.width/2, line_height, text, 1)
  468.     text = YEA::STATUS::EXPERIENCE_VOCAB
  469.     draw_text(contents.width/2, 0, contents.width/2, line_height, text, 1)
  470.     draw_general_parameters
  471.     draw_general_experience
  472.   end
  473.  
  474.   #--------------------------------------------------------------------------
  475.   # draw_general_parameters
  476.   #--------------------------------------------------------------------------
  477.   def draw_general_parameters
  478.     dx = 24
  479.     dy = line_height / 2
  480.     draw_actor_level(dx, line_height*1+dy, contents.width/2 - 24)
  481.     draw_actor_param(0, dx, line_height*2+dy, contents.width/2 - 24)
  482.     draw_actor_param(1, dx, line_height*3+dy, contents.width/2 - 24)
  483.     draw_actor_param(2, dx, line_height*4+dy, contents.width/4 - 12)
  484.     draw_actor_param(4, dx, line_height*5+dy, contents.width/4 - 12)
  485.     draw_actor_param(6, dx, line_height*6+dy, contents.width/4 - 12)
  486.     dx += contents.width/4 - 12
  487.     draw_actor_param(3, dx, line_height*4+dy, contents.width/4 - 12)
  488.     draw_actor_param(5, dx, line_height*5+dy, contents.width/4 - 12)
  489.     draw_actor_param(7, dx, line_height*6+dy, contents.width/4 - 12)
  490.   end
  491.  
  492.   #--------------------------------------------------------------------------
  493.   # draw_actor_level
  494.   #--------------------------------------------------------------------------
  495.   def draw_actor_level(dx, dy, dw)
  496.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  497.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  498.     contents.fill_rect(rect, colour)
  499.     change_color(system_color)
  500.     draw_text(dx+4, dy, dw-8, line_height, Vocab::level)
  501.     change_color(normal_color)
  502.     draw_text(dx+4, dy, dw-8, line_height, @actor.level.group, 2)
  503.   end
  504.  
  505.   #--------------------------------------------------------------------------
  506.   # draw_actor_param
  507.   #--------------------------------------------------------------------------
  508.   def draw_actor_param(param_id, dx, dy, dw)
  509.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  510.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  511.     contents.fill_rect(rect, colour)
  512.     change_color(system_color)
  513.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  514.     change_color(normal_color)
  515.     draw_text(dx+4, dy, dw-8, line_height, @actor.param(param_id).group, 2)
  516.   end
  517.  
  518.   #--------------------------------------------------------------------------
  519.   # draw_general_experience
  520.   #--------------------------------------------------------------------------
  521.   def draw_general_experience
  522.     if @actor.max_level?
  523.       s1 = @actor.exp.group
  524.       s2 = "-------"
  525.       s3 = "-------"
  526.     else
  527.       s1 = @actor.exp.group
  528.       s2 = (@actor.next_level_exp - @actor.exp).group
  529.       s3 = @actor.next_level_exp.group
  530.     end
  531.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  532.     total_next_text = sprintf(YEA::STATUS::NEXT_TOTAL_VOCAB, Vocab::level)
  533.     change_color(system_color)
  534.     dx = contents.width/2 + 12
  535.     dy = line_height * 3 / 2
  536.     dw = contents.width/2 - 36
  537.     draw_text(dx, dy + line_height * 0, dw, line_height, Vocab::ExpTotal)
  538.     draw_text(dx, dy + line_height * 2, dw, line_height, s_next)
  539.     draw_text(dx, dy + line_height * 4, dw, line_height, total_next_text)
  540.     change_color(normal_color)
  541.     draw_text(dx, dy + line_height * 1, dw, line_height, s1, 2)
  542.     draw_text(dx, dy + line_height * 3, dw, line_height, s2, 2)
  543.     draw_text(dx, dy + line_height * 5, dw, line_height, s3, 2)
  544.   end
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # draw_parameter_graph
  548.   #--------------------------------------------------------------------------
  549.   def draw_parameter_graph
  550.     draw_parameter_title
  551.     dy = line_height * 3/2
  552.     maximum = 1
  553.     minimum = @actor.param_max(2)
  554.     for i in 2..7
  555.       maximum = [@actor.param(i), maximum].max
  556.       minimum = [@actor.param(i), minimum].min
  557.     end
  558.     maximum += minimum * 0.33 unless maximum == minimum
  559.     for i in 2..7
  560.       rate = calculate_rate(maximum, minimum, i)
  561.       dy = line_height * i - line_height/2
  562.       draw_param_gauge(i, dy, rate)
  563.       change_color(system_color)
  564.       draw_text(28, dy, contents.width - 56, line_height, Vocab::param(i))
  565.       dw = (contents.width - 48) * rate - 8
  566.       change_color(normal_color)
  567.       draw_text(28, dy, dw, line_height, @actor.param(i).group, 2)
  568.     end
  569.   end
  570.  
  571.   #--------------------------------------------------------------------------
  572.   # calculate_rate
  573.   #--------------------------------------------------------------------------
  574.   def calculate_rate(maximum, minimum, param_id)
  575.     return 1.0 if maximum == minimum
  576.     rate = (@actor.param(param_id).to_f - minimum) / (maximum - minimum).to_f
  577.     rate *= 0.67
  578.     rate += 0.33
  579.     return rate
  580.   end
  581.  
  582.   #--------------------------------------------------------------------------
  583.   # draw_param_gauge
  584.   #--------------------------------------------------------------------------
  585.   def draw_param_gauge(param_id, dy, rate)
  586.     dw = contents.width - 48
  587.     colour1 = param_gauge1(param_id)
  588.     colour2 = param_gauge2(param_id)
  589.     draw_gauge(400, dy, dw, rate, colour1, colour2)
  590.   end
  591.  
  592.   #--------------------------------------------------------------------------
  593.   # param_gauge1
  594.   #--------------------------------------------------------------------------
  595.   def param_gauge1(param_id)
  596.     return YEA::STATUS::PARAM_COLOUR[param_id][1]
  597.   end
  598.  
  599.   #--------------------------------------------------------------------------
  600.   # param_gauge2
  601.   #--------------------------------------------------------------------------
  602.   def param_gauge2(param_id)
  603.     return YEA::STATUS::PARAM_COLOUR[param_id][2]
  604.   end
  605.  
  606.   #--------------------------------------------------------------------------
  607.   # draw_parameter_title
  608.   #--------------------------------------------------------------------------
  609.   def draw_parameter_title
  610.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  611.     rect = Rect.new(0, 0, contents.width, contents.height)
  612.     contents.fill_rect(rect, colour)
  613.     change_color(system_color)
  614.     text = YEA::STATUS::PARAMETERS_VOCAB
  615.     draw_text(0, line_height/3, contents.width, line_height, text, 1)
  616.   end
  617.  
  618.   #--------------------------------------------------------------------------
  619.   # draw_properties_list
  620.   #--------------------------------------------------------------------------
  621.   def draw_properties_list
  622.     contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  623.     draw_properties_column1
  624.     draw_properties_column2
  625.     draw_properties_column3
  626.     reset_font_settings
  627.   end
  628.  
  629.   #--------------------------------------------------------------------------
  630.   # draw_properties_column1
  631.   #--------------------------------------------------------------------------
  632.   def draw_properties_column1
  633.     dx = 24
  634.     dw = (contents.width - 24) / 3 - 24
  635.     dy = 0
  636.     for property in YEA::STATUS::PROPERTIES_COLUMN1
  637.       dy = draw_property(property, dx, dy, dw)
  638.     end
  639.   end
  640.  
  641.   #--------------------------------------------------------------------------
  642.   # draw_properties_column2
  643.   #--------------------------------------------------------------------------
  644.   def draw_properties_column2
  645.     dx = 24 + (contents.width - 24) / 3
  646.     dw = (contents.width - 24) / 3 - 24
  647.     dy = 0
  648.     for property in YEA::STATUS::PROPERTIES_COLUMN2
  649.       dy = draw_property(property, dx, dy, dw)
  650.     end
  651.   end
  652.  
  653.   #--------------------------------------------------------------------------
  654.   # draw_properties_column3
  655.   #--------------------------------------------------------------------------
  656.   def draw_properties_column3
  657.     dx = 24 + (contents.width - 24) / 3 * 2
  658.     dw = (contents.width - 24) / 3 - 24
  659.     dy = 0
  660.     for property in YEA::STATUS::PROPERTIES_COLUMN3
  661.       dy = draw_property(property, dx, dy, dw)
  662.     end
  663.   end
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # draw_property
  667.   #--------------------------------------------------------------------------
  668.   def draw_property(property, dx, dy, dw)
  669.     case property[0]
  670.     #---
  671.     when :hit
  672.       fmt = "%1.2f%%"
  673.       value = sprintf(fmt, @actor.hit * 100)
  674.     when :eva
  675.       fmt = "%1.2f%%"
  676.       value = sprintf(fmt, @actor.eva * 100)
  677.     when :cri
  678.       fmt = "%1.2f%%"
  679.       value = sprintf(fmt, @actor.cri * 100)
  680.     when :cev
  681.       fmt = "%1.2f%%"
  682.       value = sprintf(fmt, @actor.cev * 100)
  683.     when :mev
  684.       fmt = "%1.2f%%"
  685.       value = sprintf(fmt, @actor.mev * 100)
  686.     when :mrf
  687.       fmt = "%1.2f%%"
  688.       value = sprintf(fmt, @actor.mrf * 100)
  689.     when :cnt
  690.       fmt = "%1.2f%%"
  691.       value = sprintf(fmt, @actor.cnt * 100)
  692.     when :hrg
  693.       fmt = "%1.2f%%"
  694.       value = sprintf(fmt, @actor.hrg * 100)
  695.     when :mrg
  696.       fmt = "%1.2f%%"
  697.       value = sprintf(fmt, @actor.mrg * 100)
  698.     when :trg
  699.       fmt = "%1.2f%%"
  700.       value = sprintf(fmt, @actor.trg * 100)
  701.     when :tgr
  702.       fmt = "%1.2f%%"
  703.       value = sprintf(fmt, @actor.tgr * 100)
  704.     when :grd
  705.       fmt = "%1.2f%%"
  706.       value = sprintf(fmt, @actor.grd * 100)
  707.     when :rec
  708.       fmt = "%1.2f%%"
  709.       value = sprintf(fmt, @actor.rec * 100)
  710.     when :pha
  711.       fmt = "%1.2f%%"
  712.       value = sprintf(fmt, @actor.pha * 100)
  713.     when :mcr
  714.       fmt = "%1.2f%%"
  715.       value = sprintf(fmt, @actor.mcr * 100)
  716.     when :tcr
  717.       fmt = "%1.2f%%"
  718.       value = sprintf(fmt, @actor.tcr * 100)
  719.     when :pdr
  720.       fmt = "%1.2f%%"
  721.       value = sprintf(fmt, @actor.pdr * 100)
  722.     when :mdr
  723.       fmt = "%1.2f%%"
  724.       value = sprintf(fmt, @actor.mdr * 100)
  725.     when :fdr
  726.       fmt = "%1.2f%%"
  727.       value = sprintf(fmt, @actor.fdr * 100)
  728.     when :exr
  729.       fmt = "%1.2f%%"
  730.       value = sprintf(fmt, @actor.exr * 100)
  731.     when :hcr
  732.       return dy unless $imported["YEA-SkillCostManager"]
  733.       fmt = "%1.2f%%"
  734.       value = sprintf(fmt, @actor.hcr * 100)
  735.     when :tcr
  736.       return dy unless $imported["YEA-SkillCostManager"]
  737.       fmt = "%1.2f%%"
  738.       value = sprintf(fmt, @actor.tcr * 100)
  739.     when :gcr
  740.       return dy unless $imported["YEA-SkillCostManager"]
  741.       fmt = "%1.2f%%"
  742.       value = sprintf(fmt, @actor.gcr * 100)
  743.     when :cdr
  744.       return dy unless $imported["YEA-SkillRestrictions"]
  745.       fmt = "%1.2f%%"
  746.       value = sprintf(fmt, @actor.cdr * 100)
  747.     when :wur
  748.       return dy unless $imported["YEA-SkillRestrictions"]
  749.       fmt = "%1.2f%%"
  750.       value = sprintf(fmt, @actor.wur * 100)
  751.     #---
  752.     else; return dy
  753.     end
  754.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  755.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  756.     contents.fill_rect(rect, colour)
  757.     change_color(system_color)
  758.     draw_text(dx+4, dy, dw-8, line_height, property[1], 0)
  759.     change_color(normal_color)
  760.     draw_text(dx+4, dy, dw-8, line_height, value, 2)
  761.     return dy + line_height
  762.   end
  763.  
  764.   #--------------------------------------------------------------------------
  765.   # draw_actor_biography
  766.   #--------------------------------------------------------------------------
  767.   def draw_actor_biography
  768.     fmt = YEA::STATUS::BIOGRAPHY_NICKNAME_TEXT
  769.     text = sprintf(fmt,@actor.nickname, @actor.name )
  770.     contents.font.size = YEA::STATUS::BIOGRAPHY_NICKNAME_SIZE
  771.     draw_text(0, 0, contents.width, line_height*2, text, 1)
  772.     reset_font_settings
  773.     draw_text_ex(24, line_height*2, @actor.description)
  774.   end
  775.  
  776.   #--------------------------------------------------------------------------
  777.   # draw_custom
  778.   #--------------------------------------------------------------------------
  779.   def draw_custom
  780.     current_symbol = @command_window.current_symbol
  781.     return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(current_symbol)
  782.     method(YEA::STATUS::CUSTOM_STATUS_COMMANDS[current_symbol][3]).call
  783.   end
  784.  
  785.   #--------------------------------------------------------------------------
  786.   # draw_custom1
  787.   #--------------------------------------------------------------------------
  788.   def draw_custom1
  789.     dx = 0; dy = 0
  790.     for skill in @actor.skills
  791.       next if skill.nil?
  792.       next unless @actor.added_skill_types.include?(skill.stype_id)
  793.       draw_item_name(skill, dx, dy)
  794.       dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16
  795.       dy += line_height if dx == 0
  796.       return if dy + line_height > contents.height
  797.     end
  798.   end
  799.  
  800.   #--------------------------------------------------------------------------
  801.   # draw_custom2
  802.   #--------------------------------------------------------------------------
  803.   def draw_custom2
  804.     dx = 4; dy = 0; slot_id = 0
  805.     for equip in @actor.equips
  806.       change_color(system_color)
  807.       text = Vocab.etype(@actor.equip_slots[slot_id])
  808.       draw_text(dx, dy, contents.width - dx, line_height, text)
  809.       reset_font_settings
  810.       draw_item_name(equip, dx+92, dy) unless equip.nil?
  811.       slot_id += 1
  812.       dy += line_height
  813.       break if dy + line_height > contents.height
  814.     end
  815.     dw = Graphics.width * 2 / 5 - 24
  816.     dx = contents.width - dw; dy = 0
  817.     param_id = 0
  818.     8.times do
  819.       colour = Color.new(0, 0, 0, translucent_alpha/2)
  820.       rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  821.       contents.fill_rect(rect, colour)
  822.       size = $imported["YEA-AceEquipEngine"] ? YEA::EQUIP::STATUS_FONT_SIZE : 20
  823.       contents.font.size = size
  824.       change_color(system_color)
  825.       draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  826.       change_color(normal_color)
  827.       dwa = (Graphics.width * 2 / 5 - 2) / 2
  828.       draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  829.       reset_font_settings
  830.       change_color(system_color)
  831.       draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  832.       param_id += 1
  833.       dy += line_height
  834.       break if dy + line_height > contents.height
  835.     end
  836.   end
  837.  
  838.   #--------------------------------------------------------------------------
  839.   # draw_custom3
  840.   #--------------------------------------------------------------------------
  841.   def draw_custom3
  842.     return unless $imported["YEA-ClassSystem"]
  843.     data = []
  844.     for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
  845.       next if $data_classes[class_id].nil?
  846.       item = $data_classes[class_id]
  847.       next unless @actor.unlocked_classes.include?(item.id) or
  848.         YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
  849.       data.push(item)
  850.     end
  851.     dx = 0; dy = 0; class_index = 0
  852.     for class_id in data
  853.       item = data[class_index]
  854.       reset_font_settings
  855.       if item == @actor.class
  856.         change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
  857.       elsif item == @actor.subclass
  858.         change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
  859.       else
  860.         change_color(normal_color)
  861.       end
  862.       icon = item.icon_index
  863.       draw_icon(icon, dx, dy)
  864.       text = item.name
  865.       draw_text(24, dy, contents.width-24, line_height, text)
  866.       next if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  867.       level = @actor.class_level(item.id)
  868.       contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
  869.       text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
  870.       dwa = contents.width - (Graphics.width * 2 / 5 - 24) - 28
  871.       draw_text(dx, dy, dwa, line_height, text, 2)
  872.       class_index += 1
  873.       dy += line_height
  874.       break if dy + line_height > contents.height
  875.     end
  876.     dw = Graphics.width * 2 / 5 - 24
  877.     dx = contents.width - dw; dy = 0
  878.     param_id = 0
  879.     8.times do
  880.       colour = Color.new(0, 0, 0, translucent_alpha/2)
  881.       rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  882.       contents.fill_rect(rect, colour)
  883.       contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  884.       change_color(system_color)
  885.       draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  886.       change_color(normal_color)
  887.       dwa = (Graphics.width * 2 / 5 - 2) / 2
  888.       draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  889.       reset_font_settings
  890.       change_color(system_color)
  891.       draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  892.       param_id += 1
  893.       dy += line_height
  894.       break if dy + line_height > contents.height
  895.     end
  896.   end
  897.  
  898. end # Window_StatusItem
  899.  
  900. #==============================================================================
  901. # ■ Scene_Status
  902. #==============================================================================
  903.  
  904. class Scene_Status < Scene_MenuBase
  905.  
  906.   #--------------------------------------------------------------------------
  907.   # start
  908.   #--------------------------------------------------------------------------
  909.   def start
  910.     super
  911.  
  912.     create_help_window
  913.     create_command_window
  914.     create_status_window
  915.     create_item_window
  916.     relocate_windows
  917.   end
  918.  
  919.   #--------------------------------------------------------------------------
  920.   # create_command_window
  921.   #--------------------------------------------------------------------------
  922.   def create_command_window
  923.     wy = @help_window.height
  924.     @command_window = Window_StatusCommand.new(0, wy)
  925.     @command_window.viewport = @viewport
  926.     @command_window.actor = @actor
  927.     @command_window.help_window = @help_window
  928.     @command_window.set_handler(:cancel,   method(:return_scene))
  929.     @command_window.set_handler(:pagedown, method(:next_actor))
  930.     @command_window.set_handler(:pageup,   method(:prev_actor))
  931.     process_custom_status_commands
  932.   end
  933.  
  934.   #--------------------------------------------------------------------------
  935.   # process_custom_status_commands
  936.   #--------------------------------------------------------------------------
  937.   def process_custom_status_commands
  938.     for command in YEA::STATUS::COMMANDS
  939.       next unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  940.       called_method = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][2]
  941.       @command_window.set_handler(command[0], method(called_method))
  942.     end
  943.   end
  944.  
  945.   #--------------------------------------------------------------------------
  946.   # create_status_window
  947.   #--------------------------------------------------------------------------
  948.   def create_status_window
  949.     wy = @help_window.height
  950.     @status_window = Window_StatusActor.new(@command_window.width, wy)
  951.     @status_window.viewport = @viewport
  952.     @status_window.actor = @actor
  953.   end
  954.  
  955.   #--------------------------------------------------------------------------
  956.   # create_item_window
  957.   #--------------------------------------------------------------------------
  958.   def create_item_window
  959.     dy = @command_window.y + @command_window.height
  960.     @item_window = Window_StatusItem.new(0, dy, @command_window)
  961.     @item_window.viewport = @viewport
  962.     @item_window.actor = @actor
  963.     @command_window.item_window = @item_window
  964.   end
  965.  
  966.   #--------------------------------------------------------------------------
  967.   # relocate_windows
  968.   #--------------------------------------------------------------------------
  969.   def relocate_windows
  970.     return unless $imported["YEA-AceMenuEngine"]
  971.     case Menu.help_window_location
  972.     when 0 # Top
  973.       @help_window.y = 0
  974.       @command_window.y = @help_window.height
  975.       @item_window.y = @command_window.y + @command_window.height
  976.     when 1 # Middle
  977.       @command_window.y = 0
  978.       @help_window.y = @command_window.height
  979.       @item_window.y = @help_window.y + @help_window.height
  980.     else # Bottom
  981.       @command_window.y = 0
  982.       @item_window.y = @command_window.height
  983.       @help_window.y = @item_window.y + @item_window.height
  984.     end
  985.     @status_window.y = @command_window.y
  986.   end
  987.  
  988.   #--------------------------------------------------------------------------
  989.   # on_actor_change
  990.   #--------------------------------------------------------------------------
  991.   def on_actor_change
  992.     @command_window.actor = @actor
  993.     @status_window.actor = @actor
  994.     @item_window.actor = @actor
  995.     @command_window.activate
  996.   end
  997.  
  998.   #--------------------------------------------------------------------------
  999.   # new method: command_name1
  1000.   #--------------------------------------------------------------------------
  1001.   def command_name1
  1002.     SceneManager.call(Scene_Skill)
  1003.   end
  1004.  
  1005.   #--------------------------------------------------------------------------
  1006.   # new method: command_name2
  1007.   #--------------------------------------------------------------------------
  1008.   def command_name2
  1009.     SceneManager.call(Scene_Equip)
  1010.   end
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # new method: command_name3
  1014.   #--------------------------------------------------------------------------
  1015.   def command_name3
  1016.     unless $imported["YEA-ClassSystem"]
  1017.       @command_window.activate
  1018.       return
  1019.     end
  1020.     SceneManager.call(Scene_Class)
  1021.   end
  1022.  
  1023. end # Scene_Status
  1024.  
  1025. #==============================================================================
  1026. #
  1027. # ▼ End of File
  1028. #
  1029. #==============================================================================
  1030.  
  1031. #==============================================================================
  1032. # ■ Window_Status
  1033. #==============================================================================
  1034.  
  1035. class Window_Status < Window_Selectable
  1036.   #--------------------------------------------------------------------------
  1037.   # ● 経験値情報の描画
  1038.   #--------------------------------------------------------------------------
  1039.   def draw_exp_info(x, y)
  1040.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  1041.     change_color(system_color)
  1042.     draw_text(x , y + line_height * 0, 180, line_height, Vocab::ExpTotal)
  1043.     draw_text(x , y + line_height * 2, 180, line_height, s_next)
  1044.     change_color(normal_color)
  1045.     draw_actor_exp(     @actor, x, y + line_height * 1)
  1046.     draw_actor_next_exp(@actor, x, y + line_height * 3)
  1047.   end
  1048. end

脚本用代码框,而不是引用框,谢谢。这次帮你编辑了 —— VIPArcher留


我希望可以在最上面空白的窗口添加某些文字,可是内容太长英语不是很好找不到…………拜托了

坑的进度如上                                                                                                        点击↑

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10074
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

2
发表于 2015-4-9 22:25:39 | 只看该作者
上面那个是帮助窗口。你可以用
  1. @help_window.set_text("内容")
复制代码
来添加文字
比如你可以这样,(我只是说比如,有其他问题请自行解决。
  1. class Scene_Status < Scene_MenuBase
  2.   alias viparcher_update update
  3.   def update
  4.     viparcher_update
  5.     text = case @command_window.index
  6.     when 0 then @actor.actor.description
  7.     when 1 then "这是第二个选项的帮助内容"
  8.     when 2 then "这是第三个选项的帮助内容"
  9.     end
  10.     @help_window.set_text(text)
  11.   end
  12. end
复制代码

点评

回复错了= =  发表于 2015-4-9 22:33
如此轻易!OWO  发表于 2015-4-9 22:30

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-15 22:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表