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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
44 小时
注册时间
2006-6-4
帖子
386
跳转到指定楼层
1
发表于 2015-8-7 15:08:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用的是叶子的物品分类合成增强版
RUBY 代码复制
  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. #================================
  98. # CRAFTING PROGRAM
  99. #----------------------------------------------------------------
  100. #-written by Deke
  101. #-yes_no window code created by Phsylomortis
  102. #----------------------------------------------------------------
  103. #================================
  104.  
  105. #updates to Game_Party class
  106.  
  107. class Game_Party
  108.  
  109.   attr_accessor       :recipes
  110.  
  111.   alias crafting_party_initialize initialize
  112.  
  113.   def initialize
  114.     crafting_party_initialize
  115.     @recipes=[]
  116.   end
  117.  
  118.   #----------------------------------------------------------------------
  119.   def know?(recipe, version = 1)
  120.     unless recipe.is_a?(Game_Recipe)
  121.       recipe = get_recipe_from_master_list(recipe, version)
  122.     end
  123.     return $game_party.recipes.include?(recipe)
  124.   end
  125.  
  126. #----------------------------------------------------------------------
  127.   def learn_recipe(recipe , version = 1)
  128.     unless recipe.is_a?(Game_Recipe)
  129.       recipe = get_recipe_from_master_list(recipe, version)
  130.     end
  131.     if recipe.is_a?(Game_Recipe)
  132.       unless know?(recipe)
  133.         @recipes.push(recipe)
  134.       end
  135.     end
  136.   end
  137.  
  138. #----------------------------------------------------------------------
  139.   def forget_recipe(recipe , version = 1)
  140.     if !recipe.is_a?(Game_Recipe)
  141.       recipe = get_recipe_from_master_list(recipe, version)
  142.     end
  143.     if recipe.is_a?(Game_Recipe)
  144.       for i in [email]0...@recipes.size[/email]
  145.         if recipe == @recipes[i]
  146.           index = i
  147.           break
  148.         end
  149.       end
  150.       if index != nil
  151.         @recipes.delete(@recipes[index])
  152.       end
  153.     end
  154.   end
  155.  
  156. #----------------------------------------------------------------------
  157.   def get_recipe_from_master_list(item, version)
  158.     index = nil
  159.     for i in 0...$game_temp.recipe_list.size
  160.       if item[0] == $game_temp.recipe_list[i].result and item[1] ==$game_temp.recipe_list[i].result_type
  161.         version -= 1
  162.         if version == 0
  163.           index = i
  164.           break
  165.         end
  166.       end
  167.     end
  168.     if index.is_a?(Integer)
  169.       return ($game_temp.recipe_list[index])
  170.     else
  171.       return false
  172.     end
  173.   end
  174.  
  175. end # of Game_Party updates
  176.  
  177. #================================
  178. class Game_Recipe
  179.  
  180.   attr_reader :ingredients
  181.   attr_reader :quantities
  182.   attr_reader :result
  183.   attr_reader :result_type
  184.   attr_reader :ingredient_types
  185.   attr_reader :craft_type  #物品分类
  186.  
  187. #----------------------------------------------------------------------
  188.   def initialize( ingredients, ingredient_types, quantities, result, result_type, craft_type=0)
  189.     @ingredients = ingredients
  190.     @ingredient_types = ingredient_types
  191.     @quantities = quantities
  192.     @result = result
  193.     @result_type = result_type
  194.     @craft_type = craft_type
  195.   end
  196.  
  197. #----------------------------------------------------------------------
  198.   def name
  199.     case @result_type
  200.       when 0
  201.         name = $data_items[@result].name
  202.       when 1
  203.         name = $data_armors[@result].name
  204.       when 2
  205.         name = $data_weapons[@result].name
  206.     end
  207.     return name
  208.   end
  209.  
  210. #----------------------------------------------------------------------
  211.  
  212.   def item
  213.     case @result_type
  214.       when 0
  215.         item = $data_items[@result]
  216.       when 1
  217.         item = $data_armors[@result]
  218.       when 2
  219.         item = $data_weapons[@result]
  220.     end
  221.     return item
  222.   end
  223.  
  224. #----------------------------------------------------------------------
  225.   def have
  226.     have_all = true
  227.     for i in [email]0...@ingredients.size[/email]
  228.       case @ingredient_types[i]
  229.         when 0
  230.           if $game_party.item_number(@ingredients[i]) < @quantities[i]
  231.             have_all=false
  232.           end
  233.         when 1
  234.           if $game_party.armor_number(@ingredients[i]) < @quantities[i]
  235.             have_all=false
  236.           end
  237.         when 2
  238.           if $game_party.weapon_number(@ingredients[i]) < @quantities[i]
  239.             have_all=false
  240.           end
  241.       end
  242.     end
  243.     return have_all
  244.   end
  245.  
  246. #----------------------------------------------------------------------
  247.   def decrement
  248.     for i in [email]0...@ingredients.size[/email]
  249.       case @ingredient_types[i]
  250.       when 0
  251.         $game_party.lose_item(@ingredients[i], @quantities[i])
  252.       when 1
  253.         $game_party.lose_armor(@ingredients[i], @quantities[i])
  254.       when 2
  255.         $game_party.lose_weapon(@ingredients[i], @quantities[i])
  256.       end
  257.     end
  258.   end
  259.  
  260. #----------------------------------------------------------------------
  261.   def make
  262.     if have
  263.       case @result_type
  264.       when 0
  265.         $game_party.gain_item(@result, 1)
  266.       when 1
  267.         $game_party.gain_armor(@result, 1)
  268.       when 2
  269.         $game_party.gain_weapon(@result, 1)
  270.       end
  271.       decrement
  272.     end
  273.   end
  274.  
  275. #----------------------------------------------------------------------
  276.   def == (recipe)
  277.     if recipe.is_a?(Game_Recipe)
  278.       equal = true
  279.       if recipe.ingredients != self.ingredients
  280.         equal = false
  281.       end
  282.       if recipe.ingredient_types != self.ingredient_types
  283.         equal = false
  284.       end
  285.       if recipe.quantities != self.quantities
  286.         equal = false
  287.       end
  288.       if recipe.result != self.result
  289.         equal=false
  290.       end
  291.       if recipe.result_type != self.result_type
  292.         equal = false
  293.       end
  294.     else
  295.       equal = false
  296.     end
  297.     return equal
  298.   end
  299.  
  300. end # of Game_Recipe class
  301.  
  302.  
  303. #===================================
  304.  
  305. class Window_Craft < Window_Selectable
  306.   attr_reader :data #声明数据
  307.   #--------------------------------------------------------------------------
  308.   def initialize(craft_type=0)
  309.     @craft_type = craft_type
  310.     super(0, 64, 240, 416)#super(0, 64, 240, 416)
  311.     @column_max = 1
  312.     refresh
  313.     self.index = 0
  314.   end
  315.  
  316.  
  317.   #--------------------------------------------------------------------------
  318.   def recipe
  319.     return @data[self.index]
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   def refresh
  323.     if self.contents != nil
  324.       self.contents.dispose
  325.       self.contents = nil
  326.     end
  327.     @data = []
  328.     for i in 0...$game_party.recipes.size
  329.        #@craft_type为0时就显示全部物品
  330.        #不为0时就显示对应物品
  331.       if @craft_type == 0
  332.         @data.push($game_party.recipes[i])
  333.       elsif $game_party.recipes[i].craft_type == @craft_type
  334.         @data.push($game_party.recipes[i])
  335.       end
  336.     end
  337.     @item_max = @data.size
  338.     if @item_max > 0
  339.       self.contents = Bitmap.new(width - 55, row_max * 55)#self.contents = Bitmap.new(width - 32, row_max * 32)
  340.       self.contents.font.name = "华文新魏" # = "黑体"
  341.       self.contents.font.size = 18 # = 18
  342.       for i in 0...@item_max
  343.         x = 16#16
  344.         y = i * 55#32
  345.         able = true
  346.         for ingredient in 0...@data[i].ingredients.size
  347.           case @data[i].ingredient_types[ingredient]
  348.           when 0
  349.             count = $game_party.item_number(@data[i].ingredients[ingredient])
  350.           when 1
  351.             count = $game_party.armor_number(@data[i].ingredients[ingredient])
  352.           when 2
  353.             count = $game_party.weapon_number(@data[i].ingredients[ingredient])
  354.           end
  355.           if count < @data[i].quantities[ingredient]
  356.             able = false
  357.             break
  358.           end
  359.         end
  360.         draw_item_name(@data[i].item, x, y, able)
  361.       end
  362.     end
  363.   end
  364.  
  365.   #--------------------------------------------------------------------------
  366.   def draw_item(index)
  367.     recipe = @data[index]
  368.     self.contents.font.color = recipe.have ? normal_color : disabled_color
  369.     x = 16
  370.     y = index * 55
  371.     self.contents.draw_text(x , y, self.width-55, 55, recipe.name, 0)
  372.   end
  373.  
  374.   #--------------------------------------------------------------------------
  375.   # ● 描绘物品名
  376.   #     item : 物品
  377.   #     x    : 描画目标 X 坐标
  378.   #     y    : 描画目标 Y 坐标
  379.   #--------------------------------------------------------------------------
  380.   def draw_item_name(item, x, y, able = true)
  381.     if item == nil
  382.       return
  383.     end
  384.     if !able
  385.       self.contents.font.color = disabled_color
  386.     end
  387.     bitmap = RPG::Cache.icon(item.icon_name)
  388.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 55, 55))#(x, y + 4, bitmap, Rect.new(0, 0, 55, 55))
  389.     self.contents.draw_text(x + 60, y, 212, 55, item.name)#self.contents.draw_text(x + 28, y, 212, 32, item.name)
  390.     self.contents.font.color = normal_color
  391.   end
  392.  
  393.   #--------------------------------------------------------------------------
  394.   def update_help
  395.     current_recipe = recipe
  396.     if current_recipe.is_a?(Game_Recipe)
  397.     case current_recipe.result_type
  398.       when 0
  399.         description = $data_items[current_recipe.result].description
  400.       when 1
  401.         description = $data_armors[current_recipe.result].description
  402.       when 2
  403.         description = $data_weapons[current_recipe.result].description
  404.       end
  405.     else
  406.       description = ""
  407.     end
  408.     @help_window.set_text(description)
  409.     @help_window.update
  410.   end
  411.  
  412. end # of Window_Craft
  413.  
  414. #=======================================
  415. class Window_CraftResult < Window_Base
  416.  
  417.   #--------------------------------------------------------------------------
  418.   def initialize
  419.     super(240, 64, 400, 184)
  420.     self.contents = Bitmap.new(width - 32, height - 32)# self.contents = Bitmap.new(width - 32, height - 32)
  421.     self.contents.font.name = "华文新魏" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  422.     self.contents.font.size = 18 # = 20
  423.     @result = nil
  424.     @type = nil
  425.   end
  426.  
  427.   #--------------------------------------------------------------------------
  428.   def refresh
  429.     self.contents.clear
  430.     case @type
  431.       when 0
  432.         item = $data_items[@result]
  433.         if item.recover_hp_rate > item.recover_hp
  434.           hp_string = "命回复率:"
  435.           hp_stat = item.recover_hp_rate
  436.         else
  437.           hp_string = "命回复量:"
  438.           hp_stat = item.recover_hp
  439.         end
  440.         if item.recover_sp_rate > item.recover_sp
  441.           sp_string = "气回复率:"
  442.           sp_stat = item.recover_sp_rate
  443.         else
  444.           sp_string = "气回复量:"
  445.           sp_stat = item.recover_sp
  446.         end
  447.         @strings = [hp_string, sp_string, "韧性:" , "气劲:", "命中率:", "分散度:"]
  448.         @stats = [hp_stat, sp_stat, item. pdef_f, item.mdef_f, item.hit, item.variance,
  449.                        $game_party.item_number(@result)]
  450.         @bitmap = RPG::Cache.icon(item.icon_name)
  451.       when 1
  452.         item = $data_armors[@result]
  453.         @strings = ["韧性:", "气劲:", "回避修正:", "力增:", "定增:",
  454.                        "速增:", "劲增:"]
  455.         @stats = [item.pdef, item.mdef, item.eva, item.str_plus, item.dex_plus,
  456.                     item.agi_plus, item.int_plus, $game_party.armor_number(@result) ]
  457.         @bitmap = RPG::Cache.icon(item.icon_name)
  458.       when 2
  459.         item = $data_weapons[@result]
  460.         @strings =["攻击:", "韧性:", "气劲:", "力增:", "定增:",
  461.                     "速增:", "劲增:"]
  462.         @stats = [item.atk, item.pdef, item.mdef, item.str_plus, item.dex_plus,
  463.                     item.agi_plus, item.int_plus, $game_party.weapon_number(@result) ]
  464.         @bitmap = RPG::Cache.icon(item.icon_name)
  465.     end
  466.     for i in [email]0...@strings.size[/email]
  467.       x = i%2 * 184
  468.       y = i /2 *28 +32#y = i /2 *28 +32
  469.       self.contents.font.color = normal_color
  470.       self.contents.draw_text(x,y,100, 28,@strings[i]) # self.contents.draw_text(x,y,100, 28,@strings[i])
  471.       self.contents.font.color = system_color
  472.       self.contents.draw_text(x + 110, y, 45, 28, @stats[i].to_s)
  473.     end
  474.     self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 55, 55), 255)#24
  475.     self.contents.font.color= normal_color
  476.     self.contents.draw_text(60, 0, 300, 28, "待合成物品的现有数量:")#self.contents.draw_text(40, 0, 300, 28, "待合成物品的现有数量:")
  477.     self.contents.font.color = system_color
  478.     count = @stats[@stats.size - 1].to_s
  479.     self.contents.draw_text(294, 0, 45, 28, count )
  480.   end
  481.  
  482. #----------------------------------------------------------------------
  483.   def set_result(result , type)
  484.     @result = result
  485.     @type = type
  486.     refresh
  487.   end
  488.  
  489. end #of Window_CraftResult
  490.  
  491. #=======================================
  492. class Window_CraftIngredients < Window_Base
  493.  
  494.   #--------------------------------------------------------------------------
  495.   def initialize
  496.     super(240, 248, 400, 232)
  497.     self.contents = Bitmap.new(width - 32, height - 32)
  498.     self.contents.font.name = "华文新魏" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  499.     self.contents.font.size = 18 # = 20
  500.     @ingredients = []
  501.     @types = []
  502.     @quantities = []
  503.     @item = nil
  504.     @count = 0
  505.     @counter = 0
  506.     @real_oy = 0
  507.   end
  508.  
  509.   #--------------------------------------------------------------------------
  510.   def refresh
  511.     @counter = 0
  512.     self.contents.clear
  513.     self.contents = Bitmap.new(width - 32, @ingredients.size * 55)#self.contents = Bitmap.new(width - 32, @ingredients.size * 26)
  514.     for i in [email]0...@ingredients.size[/email]
  515.       case @types[i]
  516.       when 0
  517.         @item = $data_items[@ingredients[i]]
  518.         @count = $game_party.item_number(@ingredients[i])
  519.       when 1
  520.         @item = $data_armors[@ingredients[i]]
  521.         @count = $game_party.armor_number(@ingredients[i])
  522.       when 2
  523.         @item = $data_weapons[@ingredients[i]]
  524.         @count = $game_party.weapon_number(@ingredients[i])
  525.       end
  526.       y = i *55#26
  527.       self.contents.blt(0, y, RPG::Cache.icon(@item.icon_name), Rect.new(0, 0, 55, 55), 255)#24
  528.       self.contents.font.color = @count >= @quantities[i] ? normal_color : disabled_color
  529.       self.contents.draw_text(60, y, 280, 28, @item.name)#self.contents.draw_text(30, y, 280, 28, @item.name)
  530.       self.contents.draw_text(300, y, 45, 28, @quantities[i].to_s)
  531.       self.contents.font.color = system_color
  532.       self.contents.draw_text(245, y, 45, 28, @count.to_s )     
  533.     end
  534.   end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   def set_ingredients(ingredients , types, quantities)
  538.     @ingredients = ingredients
  539.     @types = types
  540.     @quantities = quantities
  541.     refresh
  542.     if @ingredients.size > 7
  543.       self.oy = -52
  544.       @real_oy = 0
  545.     else
  546.       self.oy = 0
  547.     end
  548.   end
  549.  
  550.   def update
  551.     super
  552.     @counter += 1
  553.     if @ingredients.size > 7 and @counter > 30
  554.       @real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 55)#@real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 26)
  555.       self.oy = @real_oy - 52
  556.     end
  557.   end
  558.  
  559. end # of Window_CraftIngredients
  560.  
  561. #======================================
  562. class Scene_Craft
  563.  
  564.   #--------------------------------------------------------------------------
  565.   # @craft_type:物品种类,0就是全部
  566.   def initialize(craft_type=0,craft_index=0)
  567.     @craft_index=craft_index
  568.     @craft_type = craft_type
  569.   end
  570.  
  571.   #--------------------------------------------------------------------------
  572.   def main
  573.     @craft_window = Window_Craft.new(@craft_type)
  574.     @craft_window.index=@craft_index
  575.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  576.     @confirm_window.contents = Bitmap.new(368, 32)   # @confirm_window.contents = Bitmap.new(368, 32)
  577.     @confirm_window.contents.font.name = "华文新魏"
  578.     @confirm_window.contents.font.size = 20
  579.     @help_window = Window_Help.new
  580.     @craft_window.help_window = @help_window
  581.     @result_window=Window_CraftResult.new
  582.     @ingredients_window=Window_CraftIngredients.new
  583.     if @craft_window.data.size > 0 #本类窗口物品大于0的话
  584.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  585.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  586.                                                           @craft_window.recipe.ingredient_types,
  587.                                                           @craft_window.recipe.quantities)
  588.     end
  589.     @yes_no_window = Window_Command.new(100, ["确定", "放弃"])
  590.     @confirm_window.visible = false
  591.     @confirm_window.z = 1500
  592.     @yes_no_window.visible = false
  593.     @yes_no_window.active = false
  594.     @yes_no_window.index = 1
  595.     @yes_no_window.x = 270
  596.     @yes_no_window.y = 252
  597.     @yes_no_window.z = 1500
  598.     @label_window = Window_Base.new(450,200,190,52)# @label_window = Window_Base.new(450,200,190,52)
  599.     @label_window.contents=Bitmap.new(@label_window.width - 32,@label_window.height - 32)#(@label_window.width - 32,@label_window.height - 32)
  600.     @label_window.contents.font.size=20
  601.     @label_window.contents.font.color = @label_window.normal_color
  602.     @label_window.contents.font.name = "华文新魏"
  603.     @label_window.contents.draw_text(0, 0, @label_window.contents.width, 20, "  现有   需要")
  604.     Graphics.transition
  605.     loop do
  606.       Graphics.update
  607.       Input.update
  608.       update
  609.       if $scene != self
  610.         break
  611.       end
  612.     end
  613.     Graphics.freeze
  614.     @help_window.dispose
  615.     @craft_window.dispose
  616.     @result_window.dispose
  617.     @ingredients_window.dispose
  618.     @confirm_window.dispose
  619.     @yes_no_window.dispose
  620.     @label_window.dispose
  621.   end
  622.  
  623.   #--------------------------------------------------------------------------
  624.   def update
  625.     @craft_window.update
  626.     @ingredients_window.update
  627.     if @craft_window.active
  628.       update_craft
  629.       return
  630.     end
  631.     if @yes_no_window.active
  632.       confirm_update
  633.       return
  634.     end
  635.   end
  636.  
  637.   #--------------------------------------------------------------------------
  638.   def update_craft
  639.     if Input.dir4 != 0
  640.       if @craft_window.data.size > 0 #本类窗口物品大于0的话
  641.         @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  642.         @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  643.                                                            @craft_window.recipe.ingredient_types,
  644.                                                            @craft_window.recipe.quantities)
  645.       end
  646.     end
  647.     if Input.trigger?(Input::B)
  648.       $game_system.se_play($data_system.cancel_se)
  649.       $scene = Scene_Map.new
  650.       return
  651.     end
  652.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  653.       @recipe = @craft_window.recipe
  654.       if @recipe != nil
  655.         if @recipe.have
  656.           @yes_no_window.active = true
  657.           @craft_window.active = false
  658.         else
  659.           $game_system.se_play($data_system.buzzer_se)
  660.           return
  661.         end
  662.       else
  663.         $game_system.se_play($data_system.buzzer_se)
  664.         return
  665.       end
  666.     end
  667.   end
  668.  
  669.   #--------------------------------------------------------------------------
  670.   def confirm_update
  671.     @craft_index = @craft_window.index
  672.     @confirm_window.visible = true
  673.     @confirm_window.z = 1500
  674.     @yes_no_window.visible = true
  675.     @yes_no_window.active = true
  676.     @yes_no_window.z = 1500
  677.     @yes_no_window.update
  678.     string = "合成 " + @recipe.name + "?"
  679.     cw = @confirm_window.contents.text_size(string).width
  680.     center = @confirm_window.contents.width/2 - cw /2#center = @confirm_window.contents.width/2 - cw /2
  681.     unless @drawn
  682.       @confirm_window.contents.draw_text(center, 0, cw, 30, string)
  683.       @drawn = true
  684.     end
  685.     if Input.trigger?(Input::C)
  686.       if @yes_no_window.index == 0
  687.         $game_system.se_play($data_system.decision_se)
  688.         @recipe.make
  689.         $game_system.se_play($data_system.save_se)
  690.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  691.       else
  692.         $game_system.se_play($data_system.cancel_se)
  693.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  694.       end
  695.     end
  696.     if Input.trigger?(Input::B)
  697.       $game_system.se_play($data_system.cancel_se)
  698.       $scene=Scene_Craft.new(@craft_type,@craft_index)
  699.     end
  700.   end
  701.  
  702. end # of Scene_Craft


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

本版积分规则

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

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

GMT+8, 2024-5-13 17:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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