查看: 2179|回复: 0

[已经过期] 请问怎么修改合成界面光标选框的大小?

[复制链接]
梦石
0
星屑
55
在线时间
44 小时
注册时间
2006-6-4
回帖
377
发表于 2015-8-7 15:08:36 | 显示全部楼层 |阅读模式

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

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

×
用的是叶子的物品分类合成增强版
  1. class Game_Temp
  2.   attr_reader :recipe_list  
  3.   alias crafting_temp_initialize initialize
  4.   def initialize
  5.     crafting_temp_initialize
  6.     @recipe_list=[]
  7.     get_recipe_list
  8.   end  
  9.   def get_recipe_list   
  10.     ##########################################################################
  11.     # 1 号合成物品设定 (物品小药水×2 + 中药水 = 大药水) 成品分类:1
  12.     ##########################################################################
  13.     材料 = [125]             # 需要材料的数据库编号
  14.     材料种类 = [0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  15.     材料数量 = [3]         # 需要材料的数量
  16.     成品 = 1                  # 获得物品编号
  17.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  18.     成品分类 = 1              # 获得成品分类
  19.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  20.    
  21.     ##########################################################################
  22.     # 2 号合成物品设定 (武器铜剑3、铁剑2、钢剑1 = 密切斯特剑) 成品分类:2
  23.     ##########################################################################
  24.     材料 = [1, 2, 3]          # 需要材料的数据库编号
  25.     材料种类 = [2, 2, 2]      # 需要材料的种类,0是普通物品,1是防具,2是武器
  26.     材料数量 = [3, 2, 1]      # 需要材料的数量
  27.     成品 = 4                  # 获得物品编号
  28.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  29.     成品分类 = 2              # 获得成品分类
  30.     @recipe_list[2] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  31.    
  32.     ##########################################################################
  33.     # 3 号合成物品设定 (物品力量之石×2 + 防具钢盾×1 = 密切斯特盾) 成品分类:3
  34.     ##########################################################################
  35.     材料 = [13, 3]            # 需要材料的数据库编号
  36.     材料种类 = [0, 1]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  37.     材料数量 = [2, 1]         # 需要材料的数量
  38.     成品 = 4                  # 获得物品编号
  39.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  40.     成品分类 = 3              # 获得成品分类
  41.     @recipe_list[3] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  42.    
  43.     ##########################################################################
  44.     # 4 号合成物品设定 (生命之种×2 + 香水×1 = 完全滋补液) 成品分类:3
  45.     ##########################################################################
  46.     材料 = [17, 4]            # 需要材料的数据库编号
  47.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  48.     材料数量 = [2, 1]         # 需要材料的数量
  49.     成品 = 10                  # 获得物品编号
  50.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  51.     成品分类 = 3              # 获得成品分类
  52.     @recipe_list[4] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  53.     ##########################################################################
  54.     # 5 号合成物品设定 成品分类:3
  55.     ##########################################################################
  56.     材料 = [1,2,3,4,5,6,7,8,9,10]            # 需要材料的数据库编号
  57.     材料种类 = [0,0,0,0,0,0,0,0,0,0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  58.     材料数量 = [1,1,1,1,1,1,1,1,1,1]         # 需要材料的数量
  59.     成品 = 28                  # 获得物品编号
  60.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  61.     成品分类 = 3              # 获得成品分类
  62.     @recipe_list[5] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  63.     ##########################################################################
  64.     # 6 号合成物品设定 成品分类:3
  65.     ##########################################################################
  66.     材料 = [1,2,3,4,5,6,7,8,9,10]            # 需要材料的数据库编号
  67.     材料种类 = [0,0,0,0,0,0,0,0,0,0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  68.     材料数量 = [1,1,1,1,1,1,1,1,1,1]         # 需要材料的数量
  69.     成品 = 28                  # 获得物品编号
  70.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  71.     成品分类 = 3              # 获得成品分类
  72.     @recipe_list[6] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  73.     ##########################################################################
  74.     # 7 号合成物品设定 成品分类:3
  75.     ##########################################################################
  76.     材料 = [1,2,3,4,5,6,7,8,9,10]            # 需要材料的数据库编号
  77.     材料种类 = [0,0,0,0,0,0,0,0,0,0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  78.     材料数量 = [1,1,1,1,1,1,1,1,1,1]         # 需要材料的数量
  79.     成品 = 28                  # 获得物品编号
  80.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  81.     成品分类 = 3              # 获得成品分类
  82.     @recipe_list[7] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  83.     ##########################################################################
  84.     # 8 号合成物品设定 成品分类:3
  85.     ##########################################################################
  86.     材料 = [1,2,3,4,5,6,7,8,9,10]            # 需要材料的数据库编号
  87.     材料种类 = [0,0,0,0,0,0,0,0,0,0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  88.     材料数量 = [1,1,1,1,1,1,1,1,1,1]         # 需要材料的数量
  89.     成品 = 28                  # 获得物品编号
  90.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  91.     成品分类 = 3              # 获得成品分类
  92.     @recipe_list[8] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  93.   
  94.     end # of get_recipe_list method
  95. end # of updates to Game_Temp Class

  96. #================================
  97. # CRAFTING PROGRAM
  98. #----------------------------------------------------------------
  99. #-written by Deke
  100. #-yes_no window code created by Phsylomortis
  101. #----------------------------------------------------------------
  102. #================================

  103. #updates to Game_Party class

  104. class Game_Party
  105.   
  106.   attr_accessor       :recipes
  107.   
  108.   alias crafting_party_initialize initialize
  109.   
  110.   def initialize
  111.     crafting_party_initialize
  112.     @recipes=[]
  113.   end
  114.   
  115.   #----------------------------------------------------------------------
  116.   def know?(recipe, version = 1)
  117.     unless recipe.is_a?(Game_Recipe)
  118.       recipe = get_recipe_from_master_list(recipe, version)
  119.     end
  120.     return $game_party.recipes.include?(recipe)
  121.   end
  122.   
  123. #----------------------------------------------------------------------
  124.   def learn_recipe(recipe , version = 1)
  125.     unless recipe.is_a?(Game_Recipe)
  126.       recipe = get_recipe_from_master_list(recipe, version)
  127.     end
  128.     if recipe.is_a?(Game_Recipe)
  129.       unless know?(recipe)
  130.         @recipes.push(recipe)
  131.       end
  132.     end
  133.   end
  134.   
  135. #----------------------------------------------------------------------
  136.   def forget_recipe(recipe , version = 1)
  137.     if !recipe.is_a?(Game_Recipe)
  138.       recipe = get_recipe_from_master_list(recipe, version)
  139.     end
  140.     if recipe.is_a?(Game_Recipe)
  141.       for i in [email]0...@recipes.size[/email]
  142.         if recipe == @recipes[i]
  143.           index = i
  144.           break
  145.         end
  146.       end
  147.       if index != nil
  148.         @recipes.delete(@recipes[index])
  149.       end
  150.     end
  151.   end
  152.   
  153. #----------------------------------------------------------------------
  154.   def get_recipe_from_master_list(item, version)
  155.     index = nil
  156.     for i in 0...$game_temp.recipe_list.size
  157.       if item[0] == $game_temp.recipe_list[i].result and item[1] ==$game_temp.recipe_list[i].result_type
  158.         version -= 1
  159.         if version == 0
  160.           index = i
  161.           break
  162.         end
  163.       end
  164.     end
  165.     if index.is_a?(Integer)
  166.       return ($game_temp.recipe_list[index])
  167.     else
  168.       return false
  169.     end
  170.   end
  171.   
  172. end # of Game_Party updates

  173. #================================
  174. class Game_Recipe

  175.   attr_reader :ingredients
  176.   attr_reader :quantities
  177.   attr_reader :result
  178.   attr_reader :result_type
  179.   attr_reader :ingredient_types
  180.   attr_reader :craft_type  #物品分类
  181.   
  182. #----------------------------------------------------------------------
  183.   def initialize( ingredients, ingredient_types, quantities, result, result_type, craft_type=0)
  184.     @ingredients = ingredients
  185.     @ingredient_types = ingredient_types
  186.     @quantities = quantities
  187.     @result = result
  188.     @result_type = result_type
  189.     @craft_type = craft_type
  190.   end
  191.   
  192. #----------------------------------------------------------------------
  193.   def name
  194.     case @result_type
  195.       when 0
  196.         name = $data_items[@result].name
  197.       when 1
  198.         name = $data_armors[@result].name
  199.       when 2
  200.         name = $data_weapons[@result].name
  201.     end
  202.     return name
  203.   end
  204.   
  205. #----------------------------------------------------------------------

  206.   def item
  207.     case @result_type
  208.       when 0
  209.         item = $data_items[@result]
  210.       when 1
  211.         item = $data_armors[@result]
  212.       when 2
  213.         item = $data_weapons[@result]
  214.     end
  215.     return item
  216.   end

  217. #----------------------------------------------------------------------
  218.   def have
  219.     have_all = true
  220.     for i in [email]0...@ingredients.size[/email]
  221.       case @ingredient_types[i]
  222.         when 0
  223.           if $game_party.item_number(@ingredients[i]) < @quantities[i]
  224.             have_all=false
  225.           end
  226.         when 1
  227.           if $game_party.armor_number(@ingredients[i]) < @quantities[i]
  228.             have_all=false
  229.           end
  230.         when 2
  231.           if $game_party.weapon_number(@ingredients[i]) < @quantities[i]
  232.             have_all=false
  233.           end
  234.       end
  235.     end
  236.     return have_all
  237.   end

  238. #----------------------------------------------------------------------
  239.   def decrement
  240.     for i in [email]0...@ingredients.size[/email]
  241.       case @ingredient_types[i]
  242.       when 0
  243.         $game_party.lose_item(@ingredients[i], @quantities[i])
  244.       when 1
  245.         $game_party.lose_armor(@ingredients[i], @quantities[i])
  246.       when 2
  247.         $game_party.lose_weapon(@ingredients[i], @quantities[i])
  248.       end
  249.     end
  250.   end

  251. #----------------------------------------------------------------------
  252.   def make
  253.     if have
  254.       case @result_type
  255.       when 0
  256.         $game_party.gain_item(@result, 1)
  257.       when 1
  258.         $game_party.gain_armor(@result, 1)
  259.       when 2
  260.         $game_party.gain_weapon(@result, 1)
  261.       end
  262.       decrement
  263.     end
  264.   end
  265.   
  266. #----------------------------------------------------------------------
  267.   def == (recipe)
  268.     if recipe.is_a?(Game_Recipe)
  269.       equal = true
  270.       if recipe.ingredients != self.ingredients
  271.         equal = false
  272.       end
  273.       if recipe.ingredient_types != self.ingredient_types
  274.         equal = false
  275.       end
  276.       if recipe.quantities != self.quantities
  277.         equal = false
  278.       end
  279.       if recipe.result != self.result
  280.         equal=false
  281.       end
  282.       if recipe.result_type != self.result_type
  283.         equal = false
  284.       end
  285.     else
  286.       equal = false
  287.     end
  288.     return equal
  289.   end
  290.   
  291. end # of Game_Recipe class


  292. #===================================

  293. class Window_Craft < Window_Selectable
  294.   attr_reader :data #声明数据
  295.   #--------------------------------------------------------------------------
  296.   def initialize(craft_type=0)
  297.     @craft_type = craft_type
  298.     super(0, 64, 240, 416)#super(0, 64, 240, 416)
  299.     @column_max = 1
  300.     refresh
  301.     self.index = 0
  302.   end


  303.   #--------------------------------------------------------------------------
  304.   def recipe
  305.     return @data[self.index]
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   def refresh
  309.     if self.contents != nil
  310.       self.contents.dispose
  311.       self.contents = nil
  312.     end
  313.     @data = []
  314.     for i in 0...$game_party.recipes.size
  315.        #@craft_type为0时就显示全部物品
  316.        #不为0时就显示对应物品
  317.       if @craft_type == 0
  318.         @data.push($game_party.recipes[i])
  319.       elsif $game_party.recipes[i].craft_type == @craft_type
  320.         @data.push($game_party.recipes[i])
  321.       end
  322.     end
  323.     @item_max = @data.size
  324.     if @item_max > 0
  325.       self.contents = Bitmap.new(width - 55, row_max * 55)#self.contents = Bitmap.new(width - 32, row_max * 32)
  326.       self.contents.font.name = "华文新魏" # = "黑体"
  327.       self.contents.font.size = 18 # = 18
  328.       for i in 0...@item_max
  329.         x = 16#16
  330.         y = i * 55#32
  331.         able = true
  332.         for ingredient in 0...@data[i].ingredients.size
  333.           case @data[i].ingredient_types[ingredient]
  334.           when 0
  335.             count = $game_party.item_number(@data[i].ingredients[ingredient])
  336.           when 1
  337.             count = $game_party.armor_number(@data[i].ingredients[ingredient])
  338.           when 2
  339.             count = $game_party.weapon_number(@data[i].ingredients[ingredient])
  340.           end
  341.           if count < @data[i].quantities[ingredient]
  342.             able = false
  343.             break
  344.           end
  345.         end
  346.         draw_item_name(@data[i].item, x, y, able)
  347.       end
  348.     end
  349.   end

  350.   #--------------------------------------------------------------------------
  351.   def draw_item(index)
  352.     recipe = @data[index]
  353.     self.contents.font.color = recipe.have ? normal_color : disabled_color
  354.     x = 16
  355.     y = index * 55
  356.     self.contents.draw_text(x , y, self.width-55, 55, recipe.name, 0)
  357.   end
  358.   
  359.   #--------------------------------------------------------------------------
  360.   # ● 描绘物品名
  361.   #     item : 物品
  362.   #     x    : 描画目标 X 坐标
  363.   #     y    : 描画目标 Y 坐标
  364.   #--------------------------------------------------------------------------
  365.   def draw_item_name(item, x, y, able = true)
  366.     if item == nil
  367.       return
  368.     end
  369.     if !able
  370.       self.contents.font.color = disabled_color
  371.     end
  372.     bitmap = RPG::Cache.icon(item.icon_name)
  373.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 55, 55))#(x, y + 4, bitmap, Rect.new(0, 0, 55, 55))
  374.     self.contents.draw_text(x + 60, y, 212, 55, item.name)#self.contents.draw_text(x + 28, y, 212, 32, item.name)
  375.     self.contents.font.color = normal_color
  376.   end
  377.   
  378.   #--------------------------------------------------------------------------
  379.   def update_help
  380.     current_recipe = recipe
  381.     if current_recipe.is_a?(Game_Recipe)
  382.     case current_recipe.result_type
  383.       when 0
  384.         description = $data_items[current_recipe.result].description
  385.       when 1
  386.         description = $data_armors[current_recipe.result].description
  387.       when 2
  388.         description = $data_weapons[current_recipe.result].description
  389.       end
  390.     else
  391.       description = ""
  392.     end
  393.     @help_window.set_text(description)
  394.     @help_window.update
  395.   end
  396.   
  397. end # of Window_Craft

  398. #=======================================
  399. class Window_CraftResult < Window_Base

  400.   #--------------------------------------------------------------------------
  401.   def initialize
  402.     super(240, 64, 400, 184)
  403.     self.contents = Bitmap.new(width - 32, height - 32)# self.contents = Bitmap.new(width - 32, height - 32)
  404.     self.contents.font.name = "华文新魏" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  405.     self.contents.font.size = 18 # = 20
  406.     @result = nil
  407.     @type = nil
  408.   end

  409.   #--------------------------------------------------------------------------
  410.   def refresh
  411.     self.contents.clear
  412.     case @type
  413.       when 0
  414.         item = $data_items[@result]
  415.         if item.recover_hp_rate > item.recover_hp
  416.           hp_string = "命回复率:"
  417.           hp_stat = item.recover_hp_rate
  418.         else
  419.           hp_string = "命回复量:"
  420.           hp_stat = item.recover_hp
  421.         end
  422.         if item.recover_sp_rate > item.recover_sp
  423.           sp_string = "气回复率:"
  424.           sp_stat = item.recover_sp_rate
  425.         else
  426.           sp_string = "气回复量:"
  427.           sp_stat = item.recover_sp
  428.         end
  429.         @strings = [hp_string, sp_string, "韧性:" , "气劲:", "命中率:", "分散度:"]
  430.         @stats = [hp_stat, sp_stat, item. pdef_f, item.mdef_f, item.hit, item.variance,
  431.                        $game_party.item_number(@result)]
  432.         @bitmap = RPG::Cache.icon(item.icon_name)
  433.       when 1
  434.         item = $data_armors[@result]
  435.         @strings = ["韧性:", "气劲:", "回避修正:", "力增:", "定增:",
  436.                        "速增:", "劲增:"]
  437.         @stats = [item.pdef, item.mdef, item.eva, item.str_plus, item.dex_plus,
  438.                     item.agi_plus, item.int_plus, $game_party.armor_number(@result) ]
  439.         @bitmap = RPG::Cache.icon(item.icon_name)
  440.       when 2
  441.         item = $data_weapons[@result]
  442.         @strings =["攻击:", "韧性:", "气劲:", "力增:", "定增:",
  443.                     "速增:", "劲增:"]
  444.         @stats = [item.atk, item.pdef, item.mdef, item.str_plus, item.dex_plus,
  445.                     item.agi_plus, item.int_plus, $game_party.weapon_number(@result) ]
  446.         @bitmap = RPG::Cache.icon(item.icon_name)
  447.     end
  448.     for i in [email]0...@strings.size[/email]
  449.       x = i%2 * 184
  450.       y = i /2 *28 +32#y = i /2 *28 +32
  451.       self.contents.font.color = normal_color
  452.       self.contents.draw_text(x,y,100, 28,@strings[i]) # self.contents.draw_text(x,y,100, 28,@strings[i])
  453.       self.contents.font.color = system_color
  454.       self.contents.draw_text(x + 110, y, 45, 28, @stats[i].to_s)
  455.     end
  456.     self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 55, 55), 255)#24
  457.     self.contents.font.color= normal_color
  458.     self.contents.draw_text(60, 0, 300, 28, "待合成物品的现有数量:")#self.contents.draw_text(40, 0, 300, 28, "待合成物品的现有数量:")
  459.     self.contents.font.color = system_color
  460.     count = @stats[@stats.size - 1].to_s
  461.     self.contents.draw_text(294, 0, 45, 28, count )
  462.   end
  463.    
  464. #----------------------------------------------------------------------
  465.   def set_result(result , type)
  466.     @result = result
  467.     @type = type
  468.     refresh
  469.   end

  470. end #of Window_CraftResult

  471. #=======================================
  472. class Window_CraftIngredients < Window_Base

  473.   #--------------------------------------------------------------------------
  474.   def initialize
  475.     super(240, 248, 400, 232)
  476.     self.contents = Bitmap.new(width - 32, height - 32)
  477.     self.contents.font.name = "华文新魏" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  478.     self.contents.font.size = 18 # = 20
  479.     @ingredients = []
  480.     @types = []
  481.     @quantities = []
  482.     @item = nil
  483.     @count = 0
  484.     @counter = 0
  485.     @real_oy = 0
  486.   end

  487.   #--------------------------------------------------------------------------
  488.   def refresh
  489.     @counter = 0
  490.     self.contents.clear
  491.     self.contents = Bitmap.new(width - 32, @ingredients.size * 55)#self.contents = Bitmap.new(width - 32, @ingredients.size * 26)
  492.     for i in [email]0...@ingredients.size[/email]
  493.       case @types[i]
  494.       when 0
  495.         @item = $data_items[@ingredients[i]]
  496.         @count = $game_party.item_number(@ingredients[i])
  497.       when 1
  498.         @item = $data_armors[@ingredients[i]]
  499.         @count = $game_party.armor_number(@ingredients[i])
  500.       when 2
  501.         @item = $data_weapons[@ingredients[i]]
  502.         @count = $game_party.weapon_number(@ingredients[i])
  503.       end
  504.       y = i *55#26
  505.       self.contents.blt(0, y, RPG::Cache.icon(@item.icon_name), Rect.new(0, 0, 55, 55), 255)#24
  506.       self.contents.font.color = @count >= @quantities[i] ? normal_color : disabled_color
  507.       self.contents.draw_text(60, y, 280, 28, @item.name)#self.contents.draw_text(30, y, 280, 28, @item.name)
  508.       self.contents.draw_text(300, y, 45, 28, @quantities[i].to_s)
  509.       self.contents.font.color = system_color
  510.       self.contents.draw_text(245, y, 45, 28, @count.to_s )     
  511.     end
  512.   end
  513.       
  514.   #--------------------------------------------------------------------------
  515.   def set_ingredients(ingredients , types, quantities)
  516.     @ingredients = ingredients
  517.     @types = types
  518.     @quantities = quantities
  519.     refresh
  520.     if @ingredients.size > 7
  521.       self.oy = -52
  522.       @real_oy = 0
  523.     else
  524.       self.oy = 0
  525.     end
  526.   end

  527.   def update
  528.     super
  529.     @counter += 1
  530.     if @ingredients.size > 7 and @counter > 30
  531.       @real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 55)#@real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 26)
  532.       self.oy = @real_oy - 52
  533.     end
  534.   end
  535.    
  536. end # of Window_CraftIngredients

  537. #======================================
  538. class Scene_Craft

  539.   #--------------------------------------------------------------------------
  540.   # @craft_type:物品种类,0就是全部
  541.   def initialize(craft_type=0,craft_index=0)
  542.     @craft_index=craft_index
  543.     @craft_type = craft_type
  544.   end
  545.   
  546.   #--------------------------------------------------------------------------
  547.   def main
  548.     @craft_window = Window_Craft.new(@craft_type)
  549.     @craft_window.index=@craft_index
  550.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  551.     @confirm_window.contents = Bitmap.new(368, 32)   # @confirm_window.contents = Bitmap.new(368, 32)
  552.     @confirm_window.contents.font.name = "华文新魏"
  553.     @confirm_window.contents.font.size = 20
  554.     @help_window = Window_Help.new
  555.     @craft_window.help_window = @help_window
  556.     @result_window=Window_CraftResult.new
  557.     @ingredients_window=Window_CraftIngredients.new
  558.     if @craft_window.data.size > 0 #本类窗口物品大于0的话
  559.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  560.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  561.                                                           @craft_window.recipe.ingredient_types,
  562.                                                           @craft_window.recipe.quantities)
  563.     end
  564.     @yes_no_window = Window_Command.new(100, ["确定", "放弃"])
  565.     @confirm_window.visible = false
  566.     @confirm_window.z = 1500
  567.     @yes_no_window.visible = false
  568.     @yes_no_window.active = false
  569.     @yes_no_window.index = 1
  570.     @yes_no_window.x = 270
  571.     @yes_no_window.y = 252
  572.     @yes_no_window.z = 1500
  573.     @label_window = Window_Base.new(450,200,190,52)# @label_window = Window_Base.new(450,200,190,52)
  574.     @label_window.contents=Bitmap.new(@label_window.width - 32,@label_window.height - 32)#(@label_window.width - 32,@label_window.height - 32)
  575.     @label_window.contents.font.size=20
  576.     @label_window.contents.font.color = @label_window.normal_color
  577.     @label_window.contents.font.name = "华文新魏"
  578.     @label_window.contents.draw_text(0, 0, @label_window.contents.width, 20, "  现有   需要")
  579.     Graphics.transition
  580.     loop do
  581.       Graphics.update
  582.       Input.update
  583.       update
  584.       if $scene != self
  585.         break
  586.       end
  587.     end
  588.     Graphics.freeze
  589.     @help_window.dispose
  590.     @craft_window.dispose
  591.     @result_window.dispose
  592.     @ingredients_window.dispose
  593.     @confirm_window.dispose
  594.     @yes_no_window.dispose
  595.     @label_window.dispose
  596.   end

  597.   #--------------------------------------------------------------------------
  598.   def update
  599.     @craft_window.update
  600.     @ingredients_window.update
  601.     if @craft_window.active
  602.       update_craft
  603.       return
  604.     end
  605.     if @yes_no_window.active
  606.       confirm_update
  607.       return
  608.     end
  609.   end

  610.   #--------------------------------------------------------------------------
  611.   def update_craft
  612.     if Input.dir4 != 0
  613.       if @craft_window.data.size > 0 #本类窗口物品大于0的话
  614.         @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  615.         @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  616.                                                            @craft_window.recipe.ingredient_types,
  617.                                                            @craft_window.recipe.quantities)
  618.       end
  619.     end
  620.     if Input.trigger?(Input::B)
  621.       $game_system.se_play($data_system.cancel_se)
  622.       $scene = Scene_Map.new
  623.       return
  624.     end
  625.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  626.       @recipe = @craft_window.recipe
  627.       if @recipe != nil
  628.         if @recipe.have
  629.           @yes_no_window.active = true
  630.           @craft_window.active = false
  631.         else
  632.           $game_system.se_play($data_system.buzzer_se)
  633.           return
  634.         end
  635.       else
  636.         $game_system.se_play($data_system.buzzer_se)
  637.         return
  638.       end
  639.     end
  640.   end

  641.   #--------------------------------------------------------------------------
  642.   def confirm_update
  643.     @craft_index = @craft_window.index
  644.     @confirm_window.visible = true
  645.     @confirm_window.z = 1500
  646.     @yes_no_window.visible = true
  647.     @yes_no_window.active = true
  648.     @yes_no_window.z = 1500
  649.     @yes_no_window.update
  650.     string = "合成 " + @recipe.name + "?"
  651.     cw = @confirm_window.contents.text_size(string).width
  652.     center = @confirm_window.contents.width/2 - cw /2#center = @confirm_window.contents.width/2 - cw /2
  653.     unless @drawn
  654.       @confirm_window.contents.draw_text(center, 0, cw, 30, string)
  655.       @drawn = true
  656.     end
  657.     if Input.trigger?(Input::C)
  658.       if @yes_no_window.index == 0
  659.         $game_system.se_play($data_system.decision_se)
  660.         @recipe.make
  661.         $game_system.se_play($data_system.save_se)
  662.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  663.       else
  664.         $game_system.se_play($data_system.cancel_se)
  665.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  666.       end
  667.     end
  668.     if Input.trigger?(Input::B)
  669.       $game_system.se_play($data_system.cancel_se)
  670.       $scene=Scene_Craft.new(@craft_type,@craft_index)
  671.     end
  672.   end

  673. end # of Scene_Craft
复制代码

未标题-1.jpg
由于图标是55*55的,变成这个样子不太美观
顺便问问怎样设置才能让右边的数值显示更美观点,攻击那项被挡住了,整体移动不好看。。。谢谢了!
迷宫````
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部