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

Project1

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

[已经过期] 关于战斗脸图和菜单系统冲突的问题。

[复制链接]

Lv2.观梦者

梦石
0
星屑
799
在线时间
83 小时
注册时间
2012-2-26
帖子
62
跳转到指定楼层
1
发表于 2020-12-11 13:15:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
菜单用的steam上的:
| PHLiM2'sMenuModsACE 1.21
其中:
|► WINDOWS
RUBY 代码复制
  1. class Game_Map
  2.   def name
  3.     $map_infos = load_data("Data/MapInfos.rvdata2")
  4.     for key in $map_infos.keys
  5.       $map_infos[key] = $map_infos[key].name
  6.     end
  7.     $map_infos[@map_id]
  8.   end
  9. end
  10. class Game_Party < Game_Unit
  11.   #--------------------------------------------------------------------------
  12.   # * Get Maximum Number of Battle Members
  13.   #--------------------------------------------------------------------------
  14.   def max_battle_members
  15.     return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
  16.   end
  17. end
  18. #================================================================================#
  19. # ♦ Custom Window Base ♦                                                         #
  20. #================================================================================#
  21. # This section accesses the main Window_Base, and contains some new definitions. #
  22. #================================================================================#
  23. class Window_Base < Window
  24.   #--------------------------------------------------------------------------
  25.   # * Draw Gauge
  26.   #--------------------------------------------------------------------------
  27.   def draw_gauge(x, y, width, rate, color1, color2)
  28.     fill_w = (width * rate).to_i
  29.     gauge_y = y + line_height - 12
  30.     border_a = Color.new(0,0,0)
  31.     border_b = Color.new(255,255,255)
  32.     contents.fill_rect(x,   gauge_y,   width,   PHLiM2::WINDOWS::G_HEIGHT,     border_a)
  33.     contents.fill_rect(x+1, gauge_y+1, width-2, PHLiM2::WINDOWS::G_HEIGHT - 2, border_b)
  34.     contents.fill_rect(x+2, gauge_y+2, width-4, PHLiM2::WINDOWS::G_HEIGHT - 4, border_a)
  35.     contents.fill_rect(x+3, gauge_y+3, width-6, PHLiM2::WINDOWS::G_HEIGHT - 6, gauge_back_color)
  36.     contents.gradient_fill_rect(x+3, gauge_y+3, fill_w-6, PHLiM2::WINDOWS::G_HEIGHT - 6, color1, color2)
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # * Draw Text with Icon
  40.   #--------------------------------------------------------------------------
  41.   def draw_text_icon(x, y, width, height, text, icon_id)
  42.     reset_font_settings
  43.     contents.font.size = 24
  44.     text = convert_escape_characters(text)
  45.     pos = {:x => x + 32, :y => y, :new_x => x, :height => calc_line_height(text)}
  46.     draw_icon(icon_id, x + 4, y)
  47.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # * Draw Name
  51.   #--------------------------------------------------------------------------
  52.   def draw_actor_name(actor, x, y, width = 112, alignment = 0)
  53.     change_color(hp_color(actor))
  54.     draw_text(x, y, width, line_height, actor.name, alignment)
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # * Draw Face Graphic
  58.   #     enabled : Enabled flag. When false, draw semi-transparently.
  59.   #--------------------------------------------------------------------------
  60.   def draw_face(face_name, face_index, x, y, enabled = true,width=96,height=96)
  61.     bitmap = Cache.face(face_name)
  62.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, width, height)
  63.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  64.     bitmap.dispose
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # * Draw Actor Face Graphic
  68.   #--------------------------------------------------------------------------
  69.    def draw_actor_face(actor, x, y, enabled = true,width=96,height=96)
  70.       draw_face(actor.face_name, actor.face_index, x, y, enabled,width,height)
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Draw Face Graphic
  74.   #     enabled : Enabled flag. When false, draw semi-transparently.
  75.   #--------------------------------------------------------------------------
  76.   def draw_menuface(face_name, face_index, x, y, enabled = true,width=96,height=96)
  77.     bitmap = Cache.face("Full_"+face_name)
  78.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * PHLiM2::WINDOWS::FACE_HEIGHT, width, height)
  79.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  80.     bitmap.dispose
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # * Draw Actor Face Graphic
  84.   #--------------------------------------------------------------------------
  85.   def draw_actor_menuface(actor, x, y, enabled = true,width=96,height=PHLiM2::WINDOWS::FACE_HEIGHT)
  86.     draw_menuface(actor.face_name, actor.face_index, x, y, enabled,width,height)
  87.   end
  88. end
  89.   #--------------------------------------------------------------------------
  90.   # * Draw Level Full
  91.   #--------------------------------------------------------------------------
  92.   def draw_actor_level_full(actor, x, y, width = 96)
  93.     change_color(system_color)
  94.     draw_text(x, y, width, line_height, Vocab::level)
  95.     change_color(normal_color)
  96.     actorlevel = sprintf("%02d",actor.level)
  97.     draw_text(x, y, width, line_height, actorlevel, 2)
  98.   end
  99. class Window_Details < Window_Base
  100.   #--------------------------------------------------------------------------
  101.   # * Object Initialization
  102.   #--------------------------------------------------------------------------
  103.   def initialize
  104.     super(0, 0, window_width, fitting_height(line_number))
  105.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  106.       self.opacity = 0
  107.     end
  108.     refresh
  109.   end
  110.   def line_number
  111.     @line_count = 0
  112.     if PHLiM2::MAIN_MENU::SHOW_STEPS
  113.       @line_count += 1
  114.     end
  115.     if PHLiM2::MAIN_MENU::SHOW_GOLD
  116.       @line_count += 1
  117.     end
  118.     if PHLiM2::MAIN_MENU::SHOW_TIME
  119.       @line_count += 1
  120.     end
  121.     return @line_count
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # * Get Window Width
  125.   #--------------------------------------------------------------------------
  126.   def window_width
  127.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  128.       return 192
  129.     else
  130.       return 160
  131.     end
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # * Refresh
  135.   #--------------------------------------------------------------------------
  136.   def refresh
  137.     update
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # * Get Party Gold
  141.   #--------------------------------------------------------------------------
  142.   def value
  143.     $game_party.gold
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # Get Currency Unit
  147.   #--------------------------------------------------------------------------
  148.   def currency_unit
  149.     Vocab::currency_unit
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # * Draw Number (Gold Etc.) with Currency Unit
  153.   #--------------------------------------------------------------------------
  154.   def draw_currency_value(value, unit, x, y, width)
  155.     cx = text_size(unit).width
  156.     if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
  157.       draw_text_icon(x, y, width, line_height, value, PHLiM2::MAIN_MENU::GOLD_ICON_ID)
  158.     else
  159.       change_color(system_color)
  160.       draw_text(x+8, y, width, line_height, unit, 2)
  161.       change_color(normal_color)
  162.       draw_text(x+8, y, width - cx - 2, line_height, value, 2)
  163.     end
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # * Update Window
  167.   #--------------------------------------------------------------------------
  168.   def update
  169.     contents.clear
  170.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  171.       for i in 0..line_number
  172.         draw_text_bg_rect(line_height * i)
  173.       end
  174.     end
  175.     # Show Gold
  176.       if PHLiM2::MAIN_MENU::SHOW_GOLD
  177.         draw_currency_value(value, currency_unit, 0, line_height * gold_adjust, contents.width - 8)
  178.       end
  179.       if PHLiM2::MAIN_MENU::SHOW_STEPS
  180.         @steps = $game_party.steps
  181.         if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
  182.           draw_text_icon(0, line_height * steps_adjust,contents.width - 8,line_height, @steps, PHLiM2::MAIN_MENU::STEPS_ICON_ID)
  183.         else
  184.           contents.font.color = system_color
  185.           draw_text(8,line_height * steps_adjust, contents.width - 8,line_height, "STEPS")
  186.           contents.font.color = normal_color
  187.           draw_text(0,line_height * steps_adjust, contents.width,line_height, @steps,2)
  188.         end
  189.       end
  190.     # Show Time
  191.       if PHLiM2::MAIN_MENU::SHOW_TIME
  192.         time = Graphics.frame_count / Graphics.frame_rate
  193.         msec = Graphics.frame_count % Graphics.frame_rate * 1.6667
  194.         sec = time % 60
  195.         min = time / 60 % 60
  196.         hour = time / 60 / 60
  197.         if PHLiM2::MAIN_MENU::BLINK_MARKERS
  198.           if msec >= 50
  199.             marker = " "
  200.           else
  201.             marker = ":"
  202.           end
  203.         else
  204.           marker = ":"
  205.         end
  206.         time_text = sprintf("%02d"+marker+"%02d"+marker+"%02d",hour,min,sec)
  207.         if PHLiM2::MAIN_MENU::SHOW_MS
  208.           time_text_ms = sprintf("\\}.%02d\\{",msec)
  209.         else
  210.           time_text_ms = ""
  211.         end
  212.         if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
  213.           draw_text_icon(0, line_height*time_adjust, contents.width, line_height, time_text+time_text_ms, PHLiM2::MAIN_MENU::TIME_ICON_ID)
  214.         else
  215.           change_color(normal_color)
  216.           if PHLiM2::MAIN_MENU::SHOW_MS
  217.             draw_text_ex(64, line_height*time_adjust, time_text+time_text_ms)
  218.           else
  219.             draw_text_ex(86, line_height*time_adjust, time_text+time_text_ms)
  220.           end
  221.         end
  222.       end
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # * Line Adjustment
  226.   #--------------------------------------------------------------------------
  227.   def gold_adjust
  228.     if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_STEPS
  229.       return 0
  230.     elsif !PHLiM2::MAIN_MENU::SHOW_TIME or !PHLiM2::MAIN_MENU::SHOW_STEPS
  231.       return 1
  232.     else
  233.       return 2
  234.     end
  235.   end
  236.   def steps_adjust
  237.     if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_GOLD
  238.       return 0
  239.     elsif PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
  240.       return 1
  241.     elsif !PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
  242.       return 0
  243.     else
  244.       return 1
  245.     end
  246.   end
  247.   def time_adjust
  248.       return 0
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # * Draw_BG_Rect
  252.   #--------------------------------------------------------------------------
  253.   def draw_text_bg_rect(y)
  254.     bg_rect = Rect.new(0,y + 4,contents.width, 16)
  255.     bg_rect_c1 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O1)
  256.     bg_rect_c2 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O2)
  257.     if PHLiM2::MAIN_MENU::MENU_FLIP
  258.       contents.gradient_fill_rect(bg_rect,bg_rect_c2,bg_rect_c1)
  259.     else
  260.       contents.gradient_fill_rect(bg_rect,bg_rect_c1,bg_rect_c2)
  261.     end
  262.   end
  263. end
  264. #================================================================================#
  265. # ♦ Location Window ♦                                                            #
  266. #================================================================================#
  267. class Window_Location < Window_Base
  268.   def initialize
  269.     super(0, 0, window_width, fitting_height(2))
  270.     update
  271.   end
  272.   def window_width
  273.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  274.       Graphics.width - 192
  275.     else
  276.       Graphics.width - 160
  277.     end
  278.  
  279.   end
  280.   def update
  281.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  282.     loc_bg_rect = Rect.new(0, 4, contents.width, line_height * 2 - 8)
  283.     loc_bg_c1 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O1)
  284.     loc_bg_c2 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O2)
  285.     if PHLiM2::MAIN_MENU::MENU_FLIP
  286.       contents.gradient_fill_rect(loc_bg_rect,loc_bg_c1,loc_bg_c2)
  287.     else
  288.       contents.gradient_fill_rect(loc_bg_rect,loc_bg_c2,loc_bg_c1)
  289.     end
  290.   end
  291.     case PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE
  292.       when 0
  293.         @map_name   = sprintf($game_map.name)
  294.       when 1
  295.         @map_name   = sprintf($game_map.display_name)
  296.       when 2
  297.         @map_name   = sprintf($game_map.name)
  298.         @map_name2  =sprintf($game_map.display_name)
  299.       end
  300.     if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
  301.       if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
  302.         draw_text_icon(4, line_height * 0.5,contents.width,contents.height,"\\}"+@map_name,PHLiM2::MAIN_MENU::LOC_ICON_ID)
  303.       else
  304.         draw_text_icon(4, line_height * 0.5,contents.width,contents.height,"",PHLiM2::MAIN_MENU::LOC_ICON_ID)
  305.         draw_text_ex(36,0,"\\}"+@map_name+"\n"+@map_name2)
  306.       end
  307.     else
  308.       if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
  309.         draw_text_ex(4, line_height * 0.5,"\\c[16]LOCATION: \\}\\c[0]"+@map_name)
  310.       else
  311.         draw_text_ex(4, line_height * 0.5,"\\c[16]LOCATION: \\c[0]")
  312.         draw_text_ex(100,0,"\\}"+@map_name+"\n"+@map_name2)
  313.       end
  314.     end
  315.   end
  316. end
  317. #==============================================================================
  318. # ** Window_MenuCommand
  319. #------------------------------------------------------------------------------
  320. #  This command window appears on the menu screen.
  321. #==============================================================================
  322.  
  323. class Window_MenuCommand < Window_Command
  324.   #--------------------------------------------------------------------------
  325.   # * Initialize Command Selection Position (Class Method)
  326.   #--------------------------------------------------------------------------
  327.   def self.init_command_position
  328.     @@last_command_symbol = nil
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # * Object Initialization
  332.   #--------------------------------------------------------------------------
  333.   def initialize
  334.     super(0, 0)
  335.     select_last
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # * Get Window Width
  339.   #--------------------------------------------------------------------------
  340.   def window_width
  341.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  342.       return 192
  343.     else
  344.       return 160
  345.     end
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # * Get Number of Lines to Show
  349.   #--------------------------------------------------------------------------
  350.   def visible_line_number
  351.     item_max
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # * Create Command List
  355.   #--------------------------------------------------------------------------
  356.   def make_command_list
  357.     add_main_commands
  358.     add_formation_command
  359.     add_original_commands
  360.     add_save_command
  361.     add_game_end_command
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # * Add Main Commands to List
  365.   #--------------------------------------------------------------------------
  366.   def add_main_commands
  367.     add_command(Vocab::item,   :item,   main_commands_enabled,PHLiM2::MAIN_MENU::ITEMS_ICON_ID)
  368.     add_command(Vocab::skill,  :skill,  main_commands_enabled,PHLiM2::MAIN_MENU::SKILL_ICON_ID)
  369.     add_command(Vocab::equip,  :equip,  main_commands_enabled,PHLiM2::MAIN_MENU::EQUIP_ICON_ID)
  370.     add_command(Vocab::status, :status, main_commands_enabled,PHLiM2::MAIN_MENU::STATS_ICON_ID)
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # * Add Formation to Command List
  374.   #--------------------------------------------------------------------------
  375.   def add_formation_command
  376.     add_command(Vocab::formation, :formation, formation_enabled,PHLiM2::MAIN_MENU::FORM_ICON_ID)
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # * For Adding Original Commands
  380.   #--------------------------------------------------------------------------
  381.   def add_original_commands
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # * Add Save to Command List
  385.   #--------------------------------------------------------------------------
  386.   def add_save_command
  387.     add_command(Vocab::save, :save, save_enabled,PHLiM2::MAIN_MENU::SAVE_ICON_ID)
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # * Add Exit Game to Command List
  391.   #--------------------------------------------------------------------------
  392.   def add_game_end_command
  393.     add_command(Vocab::game_end, :game_end,PHLiM2::MAIN_MENU::QUIT_ICON_ID)
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # * Get Activation State of Main Commands
  397.   #--------------------------------------------------------------------------
  398.   def main_commands_enabled
  399.     $game_party.exists
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # * Get Activation State of Formation
  403.   #--------------------------------------------------------------------------
  404.   def formation_enabled
  405.     $game_party.members.size >= 2 && !$game_system.formation_disabled
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # * Get Activation State of Save
  409.   #--------------------------------------------------------------------------
  410.   def save_enabled
  411.     !$game_system.save_disabled
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # * Processing When OK Button Is Pressed
  415.   #--------------------------------------------------------------------------
  416.   def process_ok
  417.     @@last_command_symbol = current_symbol
  418.     super
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # * Restore Previous Selection Position
  422.   #--------------------------------------------------------------------------
  423.   def select_last
  424.     select_symbol(@@last_command_symbol)
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # * Add Command
  428.   #     name    : Command name
  429.   #     symbol  : Corresponding symbol
  430.   #     enabled : Activation state flag
  431.   #     icon_id : Icon ID of the command
  432.   #     ext     : Arbitrary extended data
  433.   #--------------------------------------------------------------------------
  434.   def add_command(name, symbol, enabled = true, icon_id = PHLiM2::MAIN_MENU::QUIT_ICON_ID, ext = nil)
  435.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :icon_id=>icon_id, :ext=>ext})
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # * Draw Item
  439.   #--------------------------------------------------------------------------
  440.   def draw_item(index)
  441.     if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
  442.       draw_command_rect(line_height*index)
  443.     end
  444.     change_color(normal_color, command_enabled?(index))
  445.     if PHLiM2::MAIN_MENU::SHOW_COMMAND_ICONS
  446.       draw_icon(icon_id(index),4,line_height*index)
  447.       draw_text2(32, line_height * index, contents.width, line_height, command_name(index), alignment)
  448.     else
  449.       draw_text(item_rect_for_text(index), command_name(index), alignment)
  450.     end
  451.   end
  452.   def draw_text2(x, y, width,height, text, alignment = 0)
  453.     contents.draw_text(x,y, width,height, text)
  454.   end
  455.   def draw_command_rect(y)
  456.     com_rect = Rect.new(0,y+4,contents.width,16)
  457.     com_rect_c1 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O1)
  458.     com_rect_c2 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O2)
  459.     if PHLiM2::MAIN_MENU::MENU_FLIP
  460.       contents.gradient_fill_rect(com_rect,com_rect_c2,com_rect_c1)
  461.     else
  462.       contents.gradient_fill_rect(com_rect,com_rect_c1,com_rect_c2)
  463.     end
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # * Get Command Name
  467.   #--------------------------------------------------------------------------
  468.   def command_name(index)
  469.     @list[index][:name]
  470.   end
  471.   def icon_id(index)
  472.     @list[index][:icon_id]
  473.   end
  474. end
  475. #==============================================================================
  476. # ** Window_MenuStatus
  477. #------------------------------------------------------------------------------
  478. #  This window displays party member status on the menu screen.
  479. #==============================================================================
  480.  
  481. class Window_MenuStatus2 < Window_Selectable
  482.   #--------------------------------------------------------------------------
  483.   # * Public Instance Variables
  484.   #--------------------------------------------------------------------------
  485.   attr_reader   :pending_index            # Pending position (for formation)
  486.   #--------------------------------------------------------------------------
  487.   # * Object Initialization
  488.   #--------------------------------------------------------------------------
  489.   def initialize(x, y)
  490.     super(x, y, window_width, window_height)
  491.     @pending_index = -1
  492.     self.opacity = 0
  493.     refresh
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # * Get Window Width
  497.   #--------------------------------------------------------------------------
  498.   def window_width
  499.    Graphics.width - 160
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # * Get Window Height
  503.   #--------------------------------------------------------------------------
  504.   def window_height
  505.     if PHLiM2::MAIN_MENU::SHOW_LOCATION_WINDOW
  506.       Graphics.height - fitting_height(2)
  507.     else
  508.       Graphics.height
  509.     end
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # * Get Number of Columns
  513.   #--------------------------------------------------------------------------
  514.   def col_max
  515.     if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE
  516.       return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
  517.     else
  518.       return 4
  519.     end
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # * Get Number of Rows
  523.   #--------------------------------------------------------------------------
  524.   def row_max
  525.     return 1
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # * Get Item Spacing
  529.   #--------------------------------------------------------------------------
  530.   def spacing
  531.     return 0
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # * Get Number of Items
  535.   #--------------------------------------------------------------------------
  536.   def item_max
  537.     if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE && PHLiM2::MAIN_MENU::LOCK_ACTIVE && $game_party.members.size >= PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
  538.       return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
  539.     else
  540.       $game_party.members.size
  541.     end
  542.   end
  543.   #--------------------------------------------------------------------------
  544.   # * Get Item Height
  545.   #--------------------------------------------------------------------------
  546.   def item_height
  547.     (height - standard_padding * 2)
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # * Draw Item
  551.   #--------------------------------------------------------------------------
  552.   def draw_item(index)
  553.     actor = $game_party.members[index]
  554.     enabled = $game_party.battle_members.include?(actor)
  555.     rect = item_rect(index)
  556.     draw_actor_bg(rect.x + 1,rect.y + 1,rect.width-2,actor)
  557.     draw_item_background(index,actor)
  558.     draw_actor_name_bg(rect.x + 1,rect.y + 1,rect.width-2,actor)
  559.     if rect.width >= 96
  560.       face_size = 96
  561.     else
  562.       face_size = rect.width - 8
  563.     end
  564.  
  565.     if PHLiM2::WINDOWS::USE_A_HEIGHT
  566.       face_size_v = rect.height - PHLiM2::WINDOWS::FACE_HEIGHT / 3
  567.       if face_size_v >= PHLiM2::WINDOWS::FACE_HEIGHT
  568.         face_size_v = PHLiM2::WINDOWS::FACE_HEIGHT
  569.       end
  570.       draw_actor_menuface(actor, rect.x + (rect.width - face_size) / 2, rect.y + line_height * 3 - 4, enabled,face_size,face_size_v)
  571.     else
  572.       draw_actor_face(actor, rect.x + (rect.width - face_size) / 2, rect.y + line_height * 3 + 2, enabled,face_size)
  573.     end
  574.     contents.font.size = 20
  575.     draw_actor_name(actor, rect.x + 1, rect.y + 1,rect.width-2, 1)
  576.     contents.font.size = Font.default_size
  577.     face_height = PHLiM2::WINDOWS::FACE_HEIGHT
  578.     draw_actor_icons(actor, rect.x + (rect.width - face_size) / 2 + 1, rect.y + line_height * 3 - 4)
  579.     make_font_smaller
  580.     draw_actor_level_full(actor, rect.x + (rect.width - face_size) / 2 + 1, rect.y + 1 + (line_height * 1),face_size)
  581.     draw_text(rect.x + 1, rect.y + 1 + (line_height * 2) - 8,rect.width-2,line_height,actor.class.name,1)
  582.     draw_actor_hp(actor, rect.x + (rect.width - (face_size+4)) / 2, rect.height - line_height * 3, face_size+4)
  583.     draw_actor_mp(actor, rect.x + (rect.width - (face_size+4)) / 2, rect.height - line_height * 2, face_size+4)
  584.     make_font_bigger
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # * Draw Background for Actor
  588.   #--------------------------------------------------------------------------
  589.   def draw_actor_bg(x,y,width,actor)
  590.     actbg = Rect.new(x, y,width,contents.height-2)
  591.     @actbg_c1 = Color.new(PHLiM2::WINDOWS::C_SCHEME_R,PHLiM2::WINDOWS::C_SCHEME_G,PHLiM2::WINDOWS::C_SCHEME_B,PHLiM2::WINDOWS::C_SCHEME_O1)
  592.     @actbg_c2 = hp_color(actor)
  593.     contents.gradient_fill_rect(actbg,@actbg_c1,@actbg_c2,true)
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # * Draw Background for Name
  597.   #--------------------------------------------------------------------------
  598.   def draw_actor_name_bg(x,y,width,actor)
  599.     actnamebg = Rect.new(x, y,width,line_height*3 - 8)
  600.     actnamebg_c = @actbg_c1
  601.     contents.fill_rect(actnamebg,actnamebg_c)
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # * Draw Background for Item
  605.   #--------------------------------------------------------------------------
  606.   def draw_item_background(index,actor)
  607.     if index == @pending_index
  608.       contents.gradient_fill_rect(item_rect(index).x + 1,item_rect(index).y + 1,item_rect(index).width-2,contents.height-2, pending_color,@actbg_c2,true)
  609.     end
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # * Processing When OK Button Is Pressed
  613.   #--------------------------------------------------------------------------
  614.   def process_ok
  615.     super
  616.     $game_party.menu_actor = $game_party.members[index]
  617.   end
  618.   #--------------------------------------------------------------------------
  619.   # * Restore Previous Selection Position
  620.   #--------------------------------------------------------------------------
  621.   def select_last
  622.     select($game_party.menu_actor.index || 0)
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # * Set Pending Position (for Formation)
  626.   #--------------------------------------------------------------------------
  627.   def pending_index=(index)
  628.     last_pending_index = @pending_index
  629.     @pending_index = index
  630.     redraw_item(@pending_index)
  631.     redraw_item(last_pending_index)
  632.   end
  633.     def contents_width
  634.     item_max * item_width
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # * Get Number of Lines to Show
  638.   #--------------------------------------------------------------------------
  639.   def visible_line_number
  640.     return 1
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # * Calculate Height of Window Contents
  644.   #--------------------------------------------------------------------------
  645.   def contents_height
  646.     item_height
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # * Get Leading Digits
  650.   #--------------------------------------------------------------------------
  651.   def top_col
  652.     ox / (item_width + spacing)
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # * Set Leading Digits
  656.   #--------------------------------------------------------------------------
  657.   def top_col=(col)
  658.     col = 0 if col < 0
  659.     #col = col_max - 1 if col > col_max - 1
  660.     self.ox = col * (item_width + spacing)
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # * Get Trailing Digits
  664.   #--------------------------------------------------------------------------
  665.   def bottom_col
  666.     top_col + col_max - 1
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # * Set Trailing Digits
  670.   #--------------------------------------------------------------------------
  671.   def bottom_col=(col)
  672.     self.top_col = col - (col_max - 1)
  673.   end
  674.   #--------------------------------------------------------------------------
  675.   # * Scroll Cursor to Position Within Screen
  676.   #--------------------------------------------------------------------------
  677.   def ensure_cursor_visible
  678.     self.top_col = index if index < top_col
  679.     self.bottom_col = index if index > bottom_col
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # * Get Rectangle for Displaying Items
  683.   #--------------------------------------------------------------------------
  684.   def item_rect(index)
  685.     rect = super
  686.     rect.x = index * (item_width + spacing)
  687.     rect.y = 0
  688.     rect
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # * Get Alignment
  692.   #--------------------------------------------------------------------------
  693.   def alignment
  694.     return 1
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # * Move Cursor Down
  698.   #--------------------------------------------------------------------------
  699.   def cursor_down(wrap = false)
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # * Move Cursor Up
  703.   #--------------------------------------------------------------------------
  704.   def cursor_up(wrap = false)
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # * Move Cursor One Page Down
  708.   #--------------------------------------------------------------------------
  709.   def cursor_pagedown
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # * Move Cursor One Page Up
  713.   #--------------------------------------------------------------------------
  714.   def cursor_pageup
  715.   end
  716. end
  717. #==============================================================================
  718. # ** Window_Formation
  719. #------------------------------------------------------------------------------
  720. #  This window is the alternative to the formation system for RMVXAce.
  721. #==============================================================================
  722. class Window_FormBG < Window_Base
  723.   def initialize(x,y)
  724.     super(x-16,y-16,Graphics.width + 32, Graphics.height + 32)
  725.     self.opacity = 0
  726.     @bg_opacity = 192
  727.   end
  728.   def banner(y)
  729.     contents.clear
  730.     fill_bg
  731.     contents.font.color = system_color
  732.     contents.font.size = 24
  733.     draw_text(0,y,contents.width,24,Vocab::formation,1)
  734.   end
  735.   def fill_bg
  736.     blackbg = Color.new(0,0,0,@bg_opacity)
  737.     contents.fill_rect(0,0,contents.width,contents.height,blackbg)
  738.   end
  739.   def clear
  740.     contents.clear
  741.   end
  742. end
  743.  
  744. class Window_FormMenuStatus < Window_Selectable
  745.   #--------------------------------------------------------------------------
  746.   # * Public Instance Variables
  747.   #--------------------------------------------------------------------------
  748.   attr_reader   :pending_index            # Pending position (for formation)
  749.   #--------------------------------------------------------------------------
  750.   # * Object Initialization
  751.   #--------------------------------------------------------------------------
  752.   def initialize(x, y)
  753.     super(x, y, window_width, window_height)
  754.     @pending_index = -1
  755.     refresh
  756.     self.openness = 0
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # * Get Window Width
  760.   #--------------------------------------------------------------------------
  761.   def window_width
  762.       return ((84 + 2) * 5) + 24
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # * Get Window Height
  766.   #--------------------------------------------------------------------------
  767.   def window_height
  768.     if $game_party.members.size >= 7 and $game_party.members.size <= 12
  769.       return ((120 + 2) * 2) + 24
  770.     elsif $game_party.members.size >= 13
  771.       return ((120 + 2) * 3) + 24
  772.     else
  773.       return (120 + 2) + 24
  774.     end
  775.   end
  776.   def col_max
  777.       return 5
  778.   end
  779.   def spacing
  780.     return 0
  781.   end
  782.   #--------------------------------------------------------------------------
  783.   # * Get Number of Items
  784.   #--------------------------------------------------------------------------
  785.   def item_max
  786.     $game_party.members.size
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # * Get Item Height
  790.   #--------------------------------------------------------------------------
  791.   def item_height
  792.     if $game_party.members.size >= (col_max + 1)
  793.       120
  794.     else
  795.       120
  796.     end
  797.   end
  798.   #--------------------------------------------------------------------------
  799.   # * Draw Item
  800.   #--------------------------------------------------------------------------
  801.   def draw_item(index)
  802.     actor = $game_party.members[index]
  803.     enabled = $game_party.battle_members.include?(actor)
  804.     rect = item_rect(index)
  805.     if index <= (PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE - 1)
  806.       new_c = Color.new(32,128,196,128)
  807.       contents.fill_rect(rect.x+1,rect.y+1,84,118,new_c)
  808.     end
  809.     draw_item_background(index)
  810.     draw_actor_face(actor, rect.x + 1, rect.y + 1,enabled,84)
  811.     make_font_smaller
  812.     draw_actor_name(actor, rect.x + 1, rect.y + (line_height * 4),84,1)
  813.     make_font_bigger
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # * Draw Background for Item
  817.   #--------------------------------------------------------------------------
  818.   def draw_item_background(index)
  819.     if index == @pending_index
  820.       pending = Color.new(255,255,255,128)
  821.       contents.fill_rect(item_rect(index).x+1,item_rect(index).y+1,84,118, pending)#pending_color)
  822.     end
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # * Processing When OK Button Is Pressed
  826.   #--------------------------------------------------------------------------
  827.   def process_ok
  828.     super
  829.     $game_party.menu_actor = $game_party.members[index]
  830.   end
  831.   #--------------------------------------------------------------------------
  832.   # * Restore Previous Selection Position
  833.   #--------------------------------------------------------------------------
  834.   def select_last
  835.     select($game_party.menu_actor.index || 0)
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # * Set Pending Position (for Formation)
  839.   #--------------------------------------------------------------------------
  840.   def pending_index=(index)
  841.     last_pending_index = @pending_index
  842.     @pending_index = index
  843.     redraw_item(@pending_index)
  844.     redraw_item(last_pending_index)
  845.   end
  846. end


这是我用的脸图战斗:
RUBY 代码复制
  1. class Window_BattleStatus < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ☆ 绘制角色战斗用肖像图
  4.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  5.   #--------------------------------------------------------------------------
  6.   def draw_face(face_name, face_index, x, y, enabled = true)
  7.     bitmap = Cache.face(face_name)
  8.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96 + 32, 96, 22)
  9.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  10.     bitmap.dispose
  11.   end
  12.   #--------------------------------------------------------------------------
  13.   # ☆ 绘制基本区域
  14.   #--------------------------------------------------------------------------
  15.   def draw_basic_area(rect, actor)
  16.  
  17.     draw_actor_face(actor, rect.x, rect.y + 1)
  18.     contents.font.size = 20
  19.     draw_actor_name(actor, rect.x + 100, rect.y, 100)
  20.     contents.font.size = Font.default_size
  21.     draw_actor_icons(actor, rect.x + 184, rect.y, rect.width - 104)
  22.   end
  23.   #-------------------
  24.   #修改HPMP的位置
  25.   #-----------------
  26.   def draw_gauge_area_without_tp(rect, actor)
  27.     draw_actor_hp(actor, rect.x + 82, rect.y, 64)
  28.     draw_actor_mp(actor, rect.x + 156,  rect.y, 64)
  29.   end
  30. end



只要进入战斗就提示|► WINDOWS
70行的代码有错误
#--------------------------------------------------------------------------
  # * Draw Actor Face Graphic
  #--------------------------------------------------------------------------
   def draw_actor_face(actor, x, y, enabled = true,width=96,height=96)
      draw_face(actor.face_name, actor.face_index, x, y, enabled,width,height)
  end

就这一段。

请问有前辈知道怎么办么??


Lv5.捕梦者

梦石
0
星屑
26264
在线时间
5355 小时
注册时间
2016-3-8
帖子
1655
2
发表于 2020-12-11 15:09:00 | 只看该作者
本帖最后由 alexncf125 于 2020-12-11 15:13 编辑

战斗脸图第6行
def draw_face(face_name, face_index, x, y, enabled = true)
改成
def draw_face(face_name, face_index, x, y, enabled = true, width = 96, height = 96)

评分

参与人数 1+1 收起 理由
老子降临 + 1 认可答案

查看全部评分

回复 支持 1 反对 0

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
8624
在线时间
1465 小时
注册时间
2012-6-6
帖子
349
3
发表于 2020-12-11 15:20:01 | 只看该作者
本帖最后由 流浪杰哥 于 2020-12-11 15:22 编辑

复制一个默认下的Window_Base里的draw_actor_face方法到Window_BattleStatus里。
你这脚本里面有些是直接是修改父类,总感觉有些不合理。。。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
799
在线时间
83 小时
注册时间
2012-2-26
帖子
62
4
 楼主| 发表于 2020-12-11 15:27:58 | 只看该作者
本帖最后由 老子降临 于 2020-12-11 15:37 编辑
alexncf125 发表于 2020-12-11 15:09
战斗脸图第6行
def draw_face(face_name, face_index, x, y, enabled = true)
改成


谢谢,这下可以了!!

残影那个我尝试了,确实不行
锁定队长那个也无效。原理我肯定是不清楚了
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
799
在线时间
83 小时
注册时间
2012-2-26
帖子
62
5
 楼主| 发表于 2020-12-11 15:28:32 | 只看该作者
流浪杰哥 发表于 2020-12-11 15:20
复制一个默认下的Window_Base里的draw_actor_face方法到Window_BattleStatus里。
你这脚本里面有些是直接是 ...

抱歉,您说的我看不懂,还没到熟悉脚本编辑的地步,顶多是应用
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
8624
在线时间
1465 小时
注册时间
2012-6-6
帖子
349
6
发表于 2020-12-11 15:44:57 | 只看该作者
老子降临 发表于 2020-12-11 15:28
抱歉,您说的我看不懂,还没到熟悉脚本编辑的地步,顶多是应用

噢。。。不好意思,我忘记贴上脚本了,不过也没什么关系,2楼已经给你解决了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 04:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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