Project1

标题: 脚本不显示中文? [打印本页]

作者: xiaoma1013    时间: 2008-2-25 07:17
标题: 脚本不显示中文?
这个脚本只能显示英文不能显示中文,请高手帮帮忙改一下

http://rpg.blue/upload_program/files/文本文档_84323963.txt

  1. #=========================================================
  2. # This is the ffx-2 Custom Menu System by Catchm.
  3. # It is a long script and includes many alterations and images attached to it.
  4. # These images can be edited, and the script can be edited, you are free to do so
  5. # credit to Catchm is the only thing needed.
  6. # this is to be copied into a new script in the script editor
  7. #
  8. # Have fun with the script!
  9. #=========================================================

  10. class Bitmap
  11. def draw_text_shadow_rect(rect, text, align = 0)
  12.   self.font.size -= 2
  13.   old_col = self.font.color.clone
  14.   # Dark shadow
  15.   self.font.color = Color.new(0,0,0, 255)
  16.   draw_text(Rect.new(rect.x+1, rect.y+1, rect.width,
  17.     rect.height), text, align)
  18.   # Small outline
  19.   self.font.color = Color.new(96,96,96,96)
  20.   draw_text(Rect.new(rect.x+1, rect.y, rect.width,
  21.     rect.height), text, align)
  22.   draw_text(Rect.new(rect.x-1, rect.y, rect.width,
  23.     rect.height), text, align)
  24.   draw_text(Rect.new(rect.x, rect.y-1, rect.width,
  25.     rect.height), text, align)
  26.   draw_text(Rect.new(rect.x, rect.y+1, rect.width,
  27.     rect.height), text, align)
  28.   # Normal text
  29.   self.font.color = old_col
  30.   draw_text(rect, text, align)
  31.   self.font.size += 2
  32. end
  33. def draw_text_shadow(x, y, wid, hei, text, align = 0)
  34.   self.font.size -= 2
  35.   old_col = self.font.color.clone
  36.   # Dark shadow
  37.   self.font.color = Color.new(0,0,0, 255)
  38.   draw_text(x+1,y+1,wid,hei,text, align)
  39.   # Small outline
  40.   self.font.color = Color.new(96,96,96,96)
  41.   draw_text(x+1,y,wid,hei,text, align)
  42.   draw_text(x+2,y,wid,hei,text, align)
  43.   draw_text(x+2,y,wid,hei,text, align)
  44.   draw_text(x,y-1,wid,hei,text, align)
  45.   draw_text(x,y+1,wid,hei,text, align)
  46.   draw_text(x,y+2,wid,hei,text, align)
  47.   # Normal
  48.   self.font.color = old_col
  49.   draw_text(x,y,wid,hei,text, align)
  50.   self.font.size += 2
  51. end
  52. def draw_text_outline(x, y, wid, hei, text, align = 0)
  53.   self.font.color = Color.new(0, 0, 0, 255)
  54.     draw_text(x + 1,y + 1,wid,hei,text, align)
  55.     draw_text(x + 1,y - 1,wid,hei,text, align)
  56.     draw_text(x - 1,y - 1,wid,hei,text, align)
  57.     draw_text(x - 1,y + 1,wid,hei,text, align)
  58.    self.font.color = Color.new(255, 255, 255, 255)
  59.     draw_text(x,y,wid,hei,text, align)
  60.   end
  61. def draw_text_outline2(x, y, wid, hei, text, align = 0)
  62.   self.font.color = Color.new(0, 0, 0, 255)
  63.     draw_text(x + 1,y + 1,wid,hei,text, align)
  64.     draw_text(x + 1,y - 1,wid,hei,text, align)
  65.     draw_text(x - 1,y - 1,wid,hei,text, align)
  66.     draw_text(x - 1,y + 1,wid,hei,text, align)
  67.    self.font.color = Color.new(255, 255, 255, 200)
  68.     draw_text(x,y,wid,hei,text, align)
  69.   end
  70.   def draw_text_outline3(x, y, wid, hei, text, align = 0)
  71.   self.font.color = Color.new(0, 0, 0, 255)
  72.     draw_text(x + 1,y + 1,wid,hei,text, align)
  73.     draw_text(x + 1,y - 1,wid,hei,text, align)
  74.     draw_text(x - 1,y - 1,wid,hei,text, align)
  75.     draw_text(x - 1,y + 1,wid,hei,text, align)
  76.    self.font.color = Color.new(192, 224, 255, 255)
  77.     draw_text(x,y,wid,hei,text, align)
  78.   end
  79.   def draw_text_outline4(x, y, wid, hei, text, align = 0)
  80.   self.font.color = Color.new(0, 0, 0, 190)
  81.     draw_text(x + 1,y + 1,wid,hei,text, align)
  82.     draw_text(x + 1,y - 1,wid,hei,text, align)
  83.     draw_text(x - 1,y - 1,wid,hei,text, align)
  84.     draw_text(x - 1,y + 1,wid,hei,text, align)
  85.    self.font.color = Color.new(255, 255, 255, 255)
  86.     draw_text(x,y,wid,hei,text, align)
  87.   end
  88. end
  89. class Window_Base < Window
  90.   #=====================================
  91.   # Gradient Bars , thanks to Acedent Prone
  92.   def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
  93.    if type == "horizontal"
  94.      width = length
  95.      height = thick
  96.      self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
  97.      self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
  98.      w = width * e1 / e2
  99.      for i in 0..height
  100.      r = c1.red + (c2.red - c1.red)   * (height -i)/height  + 0   * i/height
  101.      g = c1.green + (c2.green - c1.green) * (height -i)/height  + 0 * i/height
  102.      b = c1.blue + (c2.blue - c1.blue)  * (height -i)/height  + 0 * i/height
  103.      a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height  + 255 * i/height
  104.      self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
  105.    end
  106. elsif type == "vertical"
  107.    width = thick
  108.    height = length
  109.      self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
  110.      self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
  111.    h = height * e1 / e2
  112.    for i in 0..width
  113.      r = c1.red + (c2.red - c1.red)   * (width -i)/width  + 0   * i/width
  114.      g = c1.green + (c2.green - c1.green) * (width -i)/width  + 0 * i/width
  115.      b = c1.blue + (c2.blue - c1.blue)  * (width -i)/width  + 0 * i/width
  116.      a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width  + 255 * i/width
  117.      self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
  118.    end
  119. end
  120. end
  121. def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
  122.    if type == "horizontal"
  123.      width = length
  124.      height = thick
  125.      self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(0, 0, 0, 255))
  126.      self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
  127.      w = width * e1 / e2
  128.      for i in 0..height
  129.      r = c1.red + (c2.red - c1.red)   * (height -i)/height  + 0   * i/height
  130.      g = c1.green + (c2.green - c1.green) * (height -i)/height  + 0 * i/height
  131.      b = c1.blue + (c2.blue - c1.blue)  * (height -i)/height  + 0 * i/height
  132.      a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height  + 255 * i/height
  133.      self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
  134.    end
  135. elsif type == "vertical"
  136.    width = thick
  137.    height = length
  138.      self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
  139.      self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
  140.    h = height * e1 / e2
  141.    for i in 0..width
  142.      r = c1.red + (c2.red - c1.red)   * (width -i)/width  + 0   * i/width
  143.      g = c1.green + (c2.green - c1.green) * (width -i)/width  + 0 * i/width
  144.      b = c1.blue + (c2.blue - c1.blue)  * (width -i)/width  + 0 * i/width
  145.      a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width  + 255 * i/width
  146.      self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
  147.    end
  148. end
  149. end
  150.   #=====================================
  151.   # New definitions
  152.   def draw_battlegraphic(actor, x, y)
  153.   bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  154.   cw = bitmap.width
  155.   ch = bitmap.height
  156.   src_rect = Rect.new(0, 0, cw, ch)
  157.   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  158. end
  159. #======================================
  160.     def draw_actor_statuswindow(actor, x, y)
  161.      bitmap = RPG::Cache.picture(actor.character_name, actor.character_hue)
  162.     cw = bitmap.width / 4
  163.     ch = bitmap.height / 4
  164.     src_rect = Rect.new(0, 0, cw, ch)
  165.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  166.   end
  167.   #=====================================
  168.   def draw_actor_face(actor, x, y)
  169.   face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
  170.   fw = face.width
  171.   fh = face.height
  172.   src_rect = Rect.new(0, 0, fw, fh)
  173.   self.contents.blt(x - fw / 23, y - fh, face, src_rect)
  174. end#=====================================
  175.   def draw_actor_name2(actor, x, y)
  176.     self.contents.font.name = $fontface
  177.     self.contents.font.color = outline_color
  178.     self.contents.draw_text(x - 1, y - 1, 120, 32, actor.name)
  179.     self.contents.draw_text(x + 1, y - 1, 120, 32, actor.name)
  180.     self.contents.draw_text(x + 1, y + 1, 120, 32, actor.name)
  181.     self.contents.draw_text(x - 1, y + 1, 120, 32, actor.name)
  182.     self.contents.font.color = normal_color
  183.     self.contents.draw_text(x, y, 120, 32, actor.name)
  184.   end
  185.   #=====================================
  186.   def draw_actor_level2(actor, x, y)
  187.     self.contents.font.name = $fontface
  188.     self.contents.font.color = outline_color
  189.     self.contents.draw_text(x - 1, y - 1, 32, 32, "Lv")
  190.     self.contents.draw_text(x - 1, y + 1, 32, 32, "Lv")
  191.     self.contents.draw_text(x + 1, y - 1, 32, 32, "Lv")
  192.     self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv")
  193.     self.contents.font.color = Color.new(254, 230, 159, 255)
  194.     self.contents.draw_text(x, y, 32, 32, "Lv")
  195.     self.contents.font.color = outline_color
  196.     self.contents.draw_text(x + 31, y + 1, 24, 32, actor.level.to_s, 2)
  197.     self.contents.draw_text(x + 31, y - 1, 24, 32, actor.level.to_s, 2)
  198.     self.contents.draw_text(x + 33, y + 1, 24, 32, actor.level.to_s, 2)
  199.     self.contents.draw_text(x + 33, y - 1, 24, 32, actor.level.to_s, 2)
  200.     self.contents.font.color = normal_color
  201.     self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
  202.   end
  203.   #=====================================
  204.   def draw_actor_class2(actor, x, y)
  205.     self.contents.font.name = "Black Chancery"
  206.     self.contents.font.color = outline_color
  207.     self.contents.draw_text(x + 1, y + 1, 236, 32, actor.class_name)
  208.     self.contents.draw_text(x + 1, y - 1, 236, 32, actor.class_name)
  209.     self.contents.draw_text(x - 1, y + 1, 236, 32, actor.class_name)
  210.     self.contents.draw_text(x - 1, y - 1, 236, 32, actor.class_name)
  211.     self.contents.font.color = Color.new(238, 139, 254, 255)
  212.     self.contents.draw_text(x, y, 236, 32, actor.class_name)
  213.   end
  214.   #======================================
  215.   def draw_actor_hp2(actor, x, y, width = 144)
  216.     self.contents.font.name = "Tahoma"
  217.     # 文字列 "HP" を描画
  218.     self.contents.font.size = 24
  219.     self.contents.font.color = outline_color
  220.     self.contents.draw_text(x + 1, y + 1, 32, 32, $data_system.words.hp)
  221.     self.contents.draw_text(x + 1, y - 1, 32, 32, $data_system.words.hp)
  222.     self.contents.draw_text(x - 1, y - 1, 32, 32, $data_system.words.hp)
  223.     self.contents.draw_text(x - 1, y + 1, 32, 32, $data_system.words.hp)
  224.     self.contents.font.color = Color.new(254, 238, 189, 255)
  225.     self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  226.     # MaxHP を描画するスペースがあるか計算
  227.     if width - 32 >= 108
  228.       hp_x = x + width - 108
  229.       flag = true
  230.     elsif width - 32 >= 48
  231.       hp_x = x + width - 48
  232.       flag = false
  233.     end
  234.     # HP を描画
  235.        self.contents.font.name = $fontface
  236.        self.contents.font.size = $fontsize
  237.        self.contents.font.color = outline_color
  238.        self.contents.draw_text(hp_x - 1, y - 1, 48, 32, actor.hp.to_s, 2)
  239.        self.contents.draw_text(hp_x - 1, y + 1, 48, 32, actor.hp.to_s, 2)
  240.        self.contents.draw_text(hp_x + 1, y + 1, 48, 32, actor.hp.to_s, 2)
  241.        self.contents.draw_text(hp_x + 1, y - 1, 48, 32, actor.hp.to_s, 2)
  242.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  243.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  244.     self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
  245.     # MaxHP を描画
  246.     if flag
  247.       self.contents.font.color = outline_color
  248.       self.contents.draw_text(hp_x + 60 - 1, y - 1, 48, 32, actor.maxhp.to_s)
  249.       self.contents.draw_text(hp_x + 60 - 1, y + 1, 48, 32, actor.maxhp.to_s)
  250.       self.contents.draw_text(hp_x + 60 + 1, y - 1, 48, 32, actor.maxhp.to_s)
  251.       self.contents.draw_text(hp_x + 60 + 1, y + 1, 48, 32, actor.maxhp.to_s)
  252.       self.contents.draw_text(hp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  253.       self.contents.draw_text(hp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  254.       self.contents.draw_text(hp_x + 48 - 1, y + 1, 12, 32, "/", 1)
  255.       self.contents.draw_text(hp_x + 48 + 1, y - 1, 12, 32, "/", 1)
  256.       self.contents.font.color = normal_color
  257.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  258.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  259.     end
  260.   end
  261.   #============================================
  262.   def draw_actor_sp2(actor, x, y, width = 144)
  263.     self.contents.font.name = "Tahoma"
  264.     # 文字列 "SP" を描画
  265.     self.contents.font.size = 24
  266.     self.contents.font.color = outline_color
  267.     self.contents.draw_text(x + 1, y + 1, 32, 32, $data_system.words.sp)
  268.     self.contents.draw_text(x + 1, y - 1, 32, 32, $data_system.words.sp)
  269.     self.contents.draw_text(x - 1, y - 1, 32, 32, $data_system.words.sp)
  270.     self.contents.draw_text(x - 1, y + 1, 32, 32, $data_system.words.sp)
  271.     self.contents.font.color = Color.new(74, 230, 51, 225)
  272.     self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  273.     # MaxSP を描画するスペースがあるか計算
  274.     if width - 32 >= 108
  275.       sp_x = x + width - 108
  276.       flag = true
  277.     elsif width - 32 >= 48
  278.       sp_x = x + width - 48
  279.       flag = false
  280.     end
  281.     # SP を描画
  282.     self.contents.font.name = $fontface
  283.     self.contents.font.size = $fontsize
  284.     self.contents.font.color = outline_color
  285.     self.contents.draw_text(sp_x - 1, y - 1, 48, 32, actor.sp.to_s, 2)
  286.     self.contents.draw_text(sp_x - 1, y + 1, 48, 32, actor.sp.to_s, 2)
  287.     self.contents.draw_text(sp_x + 1, y - 1, 48, 32, actor.sp.to_s, 2)
  288.     self.contents.draw_text(sp_x + 1, y + 1, 48, 32, actor.sp.to_s, 2)
  289.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  290.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  291.     self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
  292.     # MaxSP を描画
  293.     if flag
  294.       self.contents.font.color = outline_color
  295.       self.contents.draw_text(sp_x + 60 - 1, y - 1, 48, 32, actor.maxsp.to_s)
  296.       self.contents.draw_text(sp_x + 60 - 1, y + 1, 48, 32, actor.maxsp.to_s)
  297.       self.contents.draw_text(sp_x + 60 + 1, y + 1, 48, 32, actor.maxsp.to_s)
  298.       self.contents.draw_text(sp_x + 60 + 1, y - 1, 48, 32, actor.maxsp.to_s)
  299.       self.contents.draw_text(sp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  300.       self.contents.draw_text(sp_x + 48 - 1, y - 1, 12, 32, "/", 1)
  301.       self.contents.draw_text(sp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  302.       self.contents.draw_text(sp_x + 48 + 1, y + 1, 12, 32, "/", 1)
  303.       self.contents.font.color = normal_color
  304.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  305.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  306.     end
  307.   end
  308.   #=========================================
  309.   def draw_actor_state2(actor, x, y, width = 120)
  310.     self.contents.font.name = $fontface
  311.     text = make_battler_state_text(actor, width, true)
  312.     self.contents.font.color = outline_color
  313.     self.contents.draw_text(x - 1, y - 1, width, 32, text)
  314.     self.contents.draw_text(x - 1, y + 1, width, 32, text)
  315.     self.contents.draw_text(x + 1, y + 1, width, 32, text)
  316.     self.contents.draw_text(x + 1, y - 1, width, 32, text)
  317.     self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
  318.     self.contents.draw_text(x, y, width, 32, text)
  319.   end
  320.     #=====================================
  321.   def draw_actor_parameter2(actor, x, y, type)
  322.     case type
  323.     when 0
  324.       parameter_name = $data_system.words.atk
  325.       parameter_value = actor.atk
  326.     when 1
  327.       parameter_name = $data_system.words.pdef
  328.       parameter_value = actor.pdef
  329.     when 2
  330.       parameter_name = "Magic Def"
  331.       parameter_value = actor.mdef
  332.     when 3
  333.       parameter_name = $data_system.words.str
  334.       parameter_value = actor.str
  335.     when 4
  336.       parameter_name = $data_system.words.dex
  337.       parameter_value = actor.dex
  338.     when 5
  339.       parameter_name = $data_system.words.agi
  340.       parameter_value = actor.agi
  341.     when 6
  342.       parameter_name = $data_system.words.int
  343.       parameter_value = actor.int
  344.     end
  345.     self.contents.font.color = system_color
  346.     self.contents.draw_text_outline(x, y, 120, 32, parameter_name)
  347.     self.contents.font.color = normal_color
  348.     self.contents.draw_text_outline(x + 130, y, 36, 32, parameter_value.to_s, 2)
  349.   end
  350.   #=========================================
  351.   def draw_item_name2(item, x, y)
  352.     if item == nil
  353.        self.contents.draw_text_outline(x + 28, y, 212, 32, "EMPTY")
  354.       return
  355.     end
  356.     bitmap = RPG::Cache.icon(item.icon_name)
  357.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  358.     self.contents.draw_text_outline(x + 28, y, 212, 32, item.name)
  359.   end
  360.    # New colour for outlining text - Black
  361.   def outline_color
  362.    return Color.new(0, 0, 0, 255)
  363. end
  364.   end
  365.   #==============================================================================
  366. # ■ Window_Selectable
  367. #------------------------------------------------------------------------------
  368. #  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
  369. #==============================================================================

  370. class Window_Itemselectable < Window_Base
  371.   #--------------------------------------------------------------------------
  372.   # ● 公開インスタンス変数
  373.   #--------------------------------------------------------------------------
  374.   attr_reader   :index                    # カーソル位置
  375.   attr_reader   :help_window              # ヘルプウィンドウ
  376.   #--------------------------------------------------------------------------
  377.   # ● オブジェクト初期化
  378.   #     x      : ウィンドウの X 座標
  379.   #     y      : ウィンドウの Y 座標
  380.   #     width  : ウィンドウの幅
  381.   #     height : ウィンドウの高さ
  382.   #--------------------------------------------------------------------------
  383.   def initialize(x, y, width, height)
  384.     super(x, y, width, height)
  385.     @item_max = 1
  386.     @column_max = 1
  387.     @index = -1
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ● カーソル位置の設定
  391.   #     index : 新しいカーソル位置
  392.   #--------------------------------------------------------------------------
  393.   def index=(index)
  394.     @index = index
  395.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  396.     if self.active and @help_window != nil
  397.       update_help
  398.     end
  399.     # カーソルの矩形を更新
  400.     update_cursor_rect
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # ● 行数の取得
  404.   #--------------------------------------------------------------------------
  405.   def row_max
  406.     # 項目数と列数から行数を算出
  407.     return (@item_max + @column_max - 1) / @column_max
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # ● 先頭の行の取得
  411.   #--------------------------------------------------------------------------
  412.   def top_row
  413.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
  414.     return self.oy / 32
  415.   end
  416. #--------------------------------------------------------------------------
  417.   # ● 先頭の行の設定
  418.   #     row : 先頭に表示する行
  419.   #--------------------------------------------------------------------------
  420.   def top_row=(row)
  421.     # row が 0 未満の場合は 0 に修正
  422.     if row < 0
  423.       row = 0
  424.     end
  425.     # row が row_max - 1 超の場合は row_max - 1 に修正
  426.     if row > row_max - 1
  427.       row = row_max - 1
  428.     end
  429.     # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
  430.     self.oy = row * 32
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ● 1 ページに表示できる行数の取得
  434.   #--------------------------------------------------------------------------
  435.   def page_row_max
  436.     # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
  437.     return (self.height - 32) / 32
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● 1 ページに表示できる項目数の取得
  441.   #--------------------------------------------------------------------------
  442.   def page_item_max
  443.     # 行数 page_row_max に 列数 @column_max を掛ける
  444.     return page_row_max * @column_max
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● ヘルプウィンドウの設定
  448.   #     help_window : 新しいヘルプウィンドウ
  449.   #--------------------------------------------------------------------------
  450.   def help_window=(help_window)
  451.     @help_window = help_window
  452.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  453.     if self.active and @help_window != nil
  454.       update_help
  455.     end
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ● カーソルの矩形更新
  459.   #--------------------------------------------------------------------------
  460.   def update_cursor_rect
  461.     # カーソル位置が 0 未満の場合
  462.     if @index < 0
  463.       self.cursor_rect.empty
  464.       return
  465.     end
  466.     # 現在の行を取得
  467.     row = @index / @column_max
  468.     # 現在の行が、表示されている先頭の行より前の場合
  469.     if row < self.top_row
  470.       # 現在の行が先頭になるようにスクロール
  471.       self.top_row = row
  472.     end
  473.     # 現在の行が、表示されている最後尾の行より後ろの場合
  474.     if row > self.top_row + (self.page_row_max - 1)
  475.       # 現在の行が最後尾になるようにスクロール
  476.       self.top_row = row - (self.page_row_max - 1)
  477.     end
  478.     # カーソルの幅を計算
  479.     cursor_width = self.width / @column_max - 32
  480.     # カーソルの座標を計算
  481.     x = @index % @column_max * (cursor_width + 6) + 10
  482.     y = @index / @column_max * 32 - self.oy
  483.     # カーソルの矩形を更新
  484.     self.cursor_rect.set(x, y, cursor_width, 32)
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ● フレーム更新
  488.   #--------------------------------------------------------------------------
  489.   def update
  490.     super
  491.     # カーソルの移動が可能な状態の場合
  492.     if self.active and @item_max > 0 and @index >= 0
  493.       # 方向ボタンの下が押された場合
  494.       if Input.repeat?(Input::DOWN)
  495.         # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、
  496.         # またはカーソル位置が(項目数 - 列数)より前の場合
  497.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  498.            @index < @item_max - @column_max
  499.           # カーソルを下に移動
  500.           $game_system.se_play($data_system.cursor_se)
  501.           @index = (@index + @column_max) % @item_max
  502.         end
  503.       end
  504.       # 方向ボタンの上が押された場合
  505.       if Input.repeat?(Input::UP)
  506.         # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、
  507.         # またはカーソル位置が列数より後ろの場合
  508.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  509.            @index >= @column_max
  510.           # カーソルを上に移動
  511.           $game_system.se_play($data_system.cursor_se)
  512.           @index = (@index - @column_max + @item_max) % @item_max
  513.         end
  514.       end
  515.       # 方向ボタンの右が押された場合
  516.       if Input.repeat?(Input::RIGHT)
  517.         # 列数が 2 以上で、カーソル位置が(項目数 - 1)より前の場合
  518.         if @column_max >= 2 and @index < @item_max - 1
  519.           # カーソルを右に移動
  520.           $game_system.se_play($data_system.cursor_se)
  521.           @index += 1
  522.         end
  523.       end
  524.       # 方向ボタンの左が押された場合
  525.       if Input.repeat?(Input::LEFT)
  526.         # 列数が 2 以上で、カーソル位置が 0 より後ろの場合
  527.         if @column_max >= 2 and @index > 0
  528.           # カーソルを左に移動
  529.           $game_system.se_play($data_system.cursor_se)
  530.           @index -= 1
  531.         end
  532.       end
  533.       # R ボタンが押された場合
  534.       if Input.repeat?(Input::R)
  535.         # 表示されている最後尾の行が、データ上の最後の行よりも前の場合
  536.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  537.           # カーソルを 1 ページ後ろに移動
  538.           $game_system.se_play($data_system.cursor_se)
  539.           @index = [@index + self.page_item_max, @item_max - 1].min
  540.           self.top_row += self.page_row_max
  541.         end
  542.       end
  543.       # L ボタンが押された場合
  544.       if Input.repeat?(Input::L)
  545.         # 表示されている先頭の行が 0 より後ろの場合
  546.         if self.top_row > 0
  547.           # カーソルを 1 ページ前に移動
  548.           $game_system.se_play($data_system.cursor_se)
  549.           @index = [@index - self.page_item_max, 0].max
  550.           self.top_row -= self.page_row_max
  551.         end
  552.       end
  553.     end
  554.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  555.     if self.active and @help_window != nil
  556.       update_help
  557.     end
  558.     # カーソルの矩形を更新
  559.     update_cursor_rect
  560.   end
  561. end
  562. #==============================================================================
  563. # ■ Window_Menuselectable
  564. #------------------------------------------------------------------------------
  565. #  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
  566. #==============================================================================

  567. class Window_Menuselectable < Window_Base
  568.   #--------------------------------------------------------------------------
  569.   # ● 公開インスタンス変数
  570.   #--------------------------------------------------------------------------
  571.   attr_reader   :index                    # カーソル位置
  572.   attr_reader   :help_window              # ヘルプウィンドウ
  573.   #--------------------------------------------------------------------------
  574.   # ● オブジェクト初期化
  575.   #     x      : ウィンドウの X 座標
  576.   #     y      : ウィンドウの Y 座標
  577.   #     width  : ウィンドウの幅
  578.   #     height : ウィンドウの高さ
  579.   #--------------------------------------------------------------------------
  580.   def initialize(x, y, width, height)
  581.     super(x, y, width, height)
  582.     @item_max = 1
  583.     @column_max = 1
  584.     @index = -1
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ● カーソル位置の設定
  588.   #     index : 新しいカーソル位置
  589.   #--------------------------------------------------------------------------
  590.   def index=(index)
  591.     @index = index
  592.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  593.     if self.active and @help_window != nil
  594.       update_help
  595.     end
  596.     # カーソルの矩形を更新
  597.     update_cursor_rect
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 行数の取得
  601.   #--------------------------------------------------------------------------
  602.   def row_max
  603.     # 項目数と列数から行数を算出
  604.     return (@item_max + @column_max - 1) / @column_max
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # ● 先頭の行の取得
  608.   #--------------------------------------------------------------------------
  609.   def top_row
  610.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
  611.     return self.oy / 32
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● 先頭の行の設定
  615.   #     row : 先頭に表示する行
  616.   #--------------------------------------------------------------------------
  617.   def top_row=(row)
  618.     # row が 0 未満の場合は 0 に修正
  619.     if row < 0
  620.       row = 0
  621.     end
  622.     # row が row_max - 1 超の場合は row_max - 1 に修正
  623.     if row > row_max - 1
  624.       row = row_max - 1
  625.     end
  626.     # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
  627.     self.oy = row * 32
  628.   end
  629.   #--------------------------------------------------------------------------
  630.   # ● 1 ページに表示できる行数の取得
  631.   #--------------------------------------------------------------------------
  632.   def page_row_max
  633.     # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
  634.     return (self.height - 32) / 32
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # ● 1 ページに表示できる項目数の取得
  638.   #--------------------------------------------------------------------------
  639.   def page_item_max
  640.     # 行数 page_row_max に 列数 @column_max を掛ける
  641.     return page_row_max * @column_max
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # ● ヘルプウィンドウの設定
  645.   #     help_window : 新しいヘルプウィンドウ
  646.   #--------------------------------------------------------------------------
  647.   def help_window=(help_window)
  648.     @help_window = help_window
  649.     # ヘルプテキストを更新 (update_help は継承先で定義される)
  650.     if self.active and @help_window != nil
  651.       update_help
  652.     end
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● カーソルの矩形更新
  656.   #--------------------------------------------------------------------------
复制代码


[LINE]1,#dddddd[/LINE]此贴于 2008-2-27 1:13:35 被版主水迭澜提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
----------------版务----------------
如果问题未解决,请继续提问
如果问题已解决,请结贴
若到末贴发贴时间后一周仍未结贴
管理员会自动为你过期帖子、结贴或强行认可答案(好人卡-1)

作者: xiaoma1013    时间: 2008-2-25 07:24
def update_cursor_rect
    # カーソル位置が 0 未満の場合
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 現在の行を取得
    row = @index / @column_max
    # 現在の行が、表示されている先頭の行より前の場合
    if row < self.top_row
      # 現在の行が先頭になるようにスクロール
      self.top_row = row
    end
    # 現在の行が、表示されている最後尾の行より後ろの場合
    if row > self.top_row + (self.page_row_max - 1)
      # 現在の行が最後尾になるようにスクロール
      self.top_row = row - (self.page_row_max - 1)
    end
    # カーソルの幅を計算
    cursor_width = self.width / @column_max - 32
    # カーソルの座標を計算
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 40 - self.oy
    # カーソルの矩形を更
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # カーソルの移動が可能な状態の場合
    if self.active and @item_max > 0 and @index >= 0
      # 方向ボタンの下が押された場合
      if Input.repeat?(Input::DOWN)
        # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、
        # またはカーソル位置が(項目数 - 列数)より前の場合
        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @column_max
          # カーソルを下に移動
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @column_max) % @item_max
        end
      end
      # 方向ボタンの上が押された場合
      if Input.repeat?(Input::UP)
        # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、
        # またはカーソル位置が列数より後ろの場合
        if (@column_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @column_max
          # カーソルを上に移動
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @column_max + @item_max) % @item_max
        end
      end
      # 方向ボタンの右が押された場合
      if Input.repeat?(Input::RIGHT)
        # 列数が 2 以上で、カーソル位置が(項目数 - 1)より前の場合
        if @column_max >= 2 and @index < @item_max - 1
          # カーソルを右に移動
          $game_system.se_play($data_system.cursor_se)
          @index += 1
        end
      end
      # 方向ボタンの左が押された場合
      if Input.repeat?(Input::LEFT)
        # 列数が 2 以上で、カーソル位置が 0 より後ろの場合
        if @column_max >= 2 and @index > 0
          # カーソルを左に移動
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
        end
      end
      # R ボタンが押された場合
      if Input.repeat?(Input::R)
        # 表示されている最後尾の行が、データ上の最後の行よりも前の場合
        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
          # カーソルを 1 ページ後ろに移動
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.top_row += self.page_row_max
        end
      end
      # L ボタンが押された場合
      if Input.repeat?(Input::L)
        # 表示されている先頭の行が 0 より後ろの場合
        if self.top_row > 0
          # カーソルを 1 ページ前に移動
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.top_row -= self.page_row_max
        end
      end
    end
    # ヘルプテキストを更新 (update_help は継承先で定義される)
    if self.active and @help_window != nil
      update_help
    end
    # カーソルの矩形を更新
    update_cursor_rect
  end
end
#==============================================================================
# ■ Window_Menucommand
#------------------------------------------------------------------------------
#  一般的なコマンド選択を行うウィンドウです。
#==============================================================================

class Window_Menucommand < Window_Menuselectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     width    : ウィンドウの幅
  #     commands : コマンド文字列の配列
  #--------------------------------------------------------------------------
  def initialize(width, commands)
    # コマンドの個数からウィンドウの高さを算出
    super(0, 0, width, commands.size * 32 + 32)
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index : 項目番号
  #     color : 文字色
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # ● 項目の無効化
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================

class Window_Menuhelp < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, - 77, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = 18
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● テキスト設定
  #     text  : ウィンドウに表示する文字列
  #     align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # テキストとアラインメントの少なくとも一方が前回と違っている場合
    if text != @text or align != @align
      # テキストを再描画
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
      @text = text
      @align = align
      @actor = nil
    end
    self.visible = true
  end
  #--------------------------------------------------------------------------
  # ● アクター設定
  #     actor : ステータスを表示するアクター
  #--------------------------------------------------------------------------
  def set_actor(actor)
    if actor != @actor
      self.contents.clear
      draw_actor_name(actor, 4, 0)
      draw_actor_state(actor, 140, 0)
      draw_actor_hp(actor, 284, 0)
      draw_actor_sp(actor, 460, 0)
      @actor = actor
      @text = nil
      self.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # ● エネミー設定
  #     enemy : 名前とステートを表示するエネミー
  #--------------------------------------------------------------------------
  def set_enemy(enemy)
    text = enemy.name
    state_text = make_battler_state_text(enemy, 112, false)
    if state_text != ""
      text += "  " + state_text
    end
    set_text(text, 1)
  end
end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
#  ゴールドを表示するウィンドウです。
#==========================================================================
class Window_Gold < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 200, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = 21
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    cx = contents.text_size("Gold").width
    self.contents.font.color = outline_color
    self.contents.draw_text(81, - 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.draw_text(81, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.draw_text(79, 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.draw_text(79, - 1, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(80, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = outline_color
    self.contents.draw_text(- 1, - 1, cx, 32, "Gold", 2)
    self.contents.draw_text(1, 1, cx, 32, "Gold", 2)
    self.contents.draw_text(- 1, 1, cx, 32, "Gold", 2)
    self.contents.draw_text(1, - 1, cx, 32, "Gold", 2)
    self.contents.font.color = Color.new(254, 230, 159, 255)
    self.contents.draw_text(0, 0, cx, 32, "Gold", 2)
  end
end
#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
#  メニュー画面でプレイ時間を表示するウィンドウです。
#==============================================================================

class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 200, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = 21
    self.opacity = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = outline_color
    self.contents.draw_text(1, - 1, 120, 32, "Play Time")
    self.contents.draw_text(1, 1, 120, 32, "Play Time")
    self.contents.draw_text(-1, - 1, 120, 32, "Play Time")
    self.contents.draw_text(-1, 1, 120, 32, "Play Time")
    self.contents.font.color =  Color.new(254, 230, 159, 255)
    self.contents.draw_text(0, 0, 120, 32, "Play Time")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = outline_color
    self.contents.draw_text(39, - 1, 120, 32, text, 2)
    self.contents.draw_text(39, 1, 120, 32, text, 2)
    self.contents.draw_text(41, 1, 120, 32, text, 2)
    self.contents.draw_text(41, -1, 120, 32, text, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(40, 0, 120, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 430)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 100 - i * 18
      y = i * 100
      actor = $game_party.actors
      draw_actor_face(actor, x - 40, y + 80)
      draw_actor_name2(actor, x + 50, y)
      draw_actor_class2(actor, x + 50, y + 50)
      draw_actor_level2(actor, x + 50, y + 25)
      draw_actor_state2(actor, x + 155, y + 50)
      draw_actor_hp2(actor, x + 140, y )
      draw_actor_sp2(actor, x + 140, y + 25)
      draw_actor_barz(actor, x + 140, y + 25, "horizontal", 130, 1, actor.hp, actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
      draw_actor_barz(actor, x + 140, y + 50, "horizontal", 130, 1, actor.sp, actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
      self.cursor_rect.empty
end
end
#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  アイテム画面、バトル画面で、所持アイテムの一覧を表示するウィンドウです。
#==============================================================================

class Window_Menuitem < Window_Itemselectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 500, 640, 380)
    @column_max = 2
    refresh
    self.index = 0
    self.opacity = 0
    # 戦闘中の場合はウィンドウを画面中央へ移動し、半透明にする
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテムの取得
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # アイテムを追加
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items)
      end
    end
    # 戦闘中以外なら武器と防具も追加
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons)
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors)
        end
      end
    end
    # 項目数が 0 でなければビットマップを作成し、全項目を描画
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = Color.new(255, 255, 255, 200)
    end
    x = 4 + index % 2 * (270 + 25) + 12
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
    self.contents.draw_text_outline(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text_outline(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text_outline(x + 256, y, 24, 32, number.to_s, 2)
    else
    self.contents.draw_text_outline2(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text_outline2(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text_outline2(x + 256, y, 24, 32, number.to_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
#==============================================================================
# ■ Window_Menuskill
#------------------------------------------------------------------------------
#
#==============================================================================

class Window_Menuskill < Window_Itemselectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(- 3, 531, 640, 352)
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0
    # 戦闘中の場合はウィンドウを画面中央へ移動し、半透明にする
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
#--------------------------------------------------------------------------
  # ● スキルの取得
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in [email protected]
      skill = $data_skills[@actor.skills]
      if skill != nil
        @data.push(skill)
      end
    end
    # 項目数が 0 でなければビットマップを作成し、全項目を描画
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = Color.new(255, 255, 255, 200)
    end
    x = 4 + index % 2 * (270 + 25) + 12
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
     if @actor.skill_can_use?(skill.id)
    self.contents.draw_text_outline(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text_outline(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
    else
    self.contents.draw_text_outline2(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text_outline2(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end
#==============================================================================
# ■ Window_SkillStatus
#------------------------------------------------------------------------------
#  スキル画面で、スキル使用者のステータスを表示するウィンドウです。
#==============================================================================

class Window_SkillStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(630, 35, 410, 109)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.opacity = 0
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    x = 100
    y = 0
      draw_actor_face(@actor, x - 40, y + 80)
      draw_actor_name2(@actor, x + 50, y)
      draw_actor_class2(@actor, x + 50, y + 50)
      draw_actor_level2(@actor, x + 50, y + 25)
      draw_actor_state2(@actor, x + 155, y + 50)
      draw_actor_hp2(@actor, x + 140, y )
      draw_actor_sp2(@actor, x + 140, y + 25)
      draw_actor_barz(@actor, x + 140, y + 25, "horizontal", 130, 1, @actor.hp, @actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
      draw_actor_barz(@actor, x + 140, y + 50, "horizontal", 130, 1, @actor.sp, @actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
  end
end
#==============================================================================
# ■ Window_Target
#------------------------------------------------------------------------------
#  アイテム画面とスキル画面で、使用対象のアクターを選択するウィンドウです。
#==============================================================================

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 336, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.z += 10
    @item_max = $game_party.actors.size
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 4
      y = i * 116
      actor = $game_party.actors
      draw_actor_name2(actor, x, y)
      draw_actor_class2(actor, x + 144, y)
      draw_actor_level2(actor, x + 8, y + 32)
      draw_actor_state2(actor, x + 8, y + 64)
      draw_actor_hp2(actor, x + 152, y + 32)
      draw_actor_sp2(actor, x + 152, y + 64)
      draw_actor_barz(actor, x + 152, y + 57, "horizontal", 130, 1, actor.hp, actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
      draw_actor_barz(actor, x + 152, y + 89, "horizontal", 130, 1, actor.sp, actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # カーソル位置 -1 は全選択、-2 以下は単独選択 (使用者自身)
    if @index <= -2
      self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
    elsif @index == -1
      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end
#==============================================================================
# ■ Window_EquipRight
#------------------------------------------------------------------------------
#  装備画面で、アクターが現在装備しているアイテムを表示するウィンドウです。
#==============================================================================

class Window_EquipRight < Window_Menuselectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(- 100, 125, 200, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.opacity = 0
    @actor = actor
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● アイテムの取得
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @data = []
    @data.push($data_weapons[@actor.weapon_id])
    @data.push($data_armors[@actor.armor1_id])
    @data.push($data_armors[@actor.armor2_id])
    @data.push($data_armors[@actor.armor3_id])
    @data.push($data_armors[@actor.armor4_id])
    @item_max = @data.size
    draw_item_name2(@data[0], 0, 68 * 0)
    draw_item_name2(@data[1], 0, 68 * 1)
    draw_item_name2(@data[2], 0, 68 * 2)
    draw_item_name2(@data[3], 0, 68 * 3)
    draw_item_name2(@data[4], 0, 68 * 4 - 2)
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
#  装備画面で、装備変更の候補となるアイテムの一覧を表示するウィンドウです。
#==============================================================================

class Window_EquipItem < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor      : アクター
  #     equip_type : 装備部位 (0~3)
  #--------------------------------------------------------------------------
  def initialize(actor, equip_type)
    super(233, 573, 413, 224)
    @actor = actor
    @equip_type = equip_type
    @column_max = 2
    refresh
    self.active = false
    self.index = -1
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● アイテムの取得
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 装備可能な武器を追加
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
          @data.push($data_weapons)
        end
      end
    end
    # 装備可能な防具を追加
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors.kind == @equip_type-1
            @data.push($data_armors)
          end
        end
      end
    end
    # 空白を追加
    @data.push(nil)
    # ビットマップを作成し、全項目を描画
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.font.name = $fontface
    self.contents.font.size = 22
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 2 * (176 + 16)
    y = index / 2 * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text_shadow(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text_shadow(x + 140, y, 16, 32, ":", 1)
    self.contents.draw_text_shadow(x + 156, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
    def update_cursor_rect
    # カーソル位置が 0 未満の場合
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 現在の行を取得
    row = @index / @column_max
    # 現在の行が、表示されている先頭の行より前の場合
    if row < self.top_row
      # 現在の行が先頭になるようにスクロール
      self.top_row = row
    end
    # 現在の行が、表示されている最後尾の行より後ろの場合
    if row > self.top_row + (self.page_row_max - 1)
      # 現在の行が最後尾になるようにスクロール
      self.top_row = row - (self.page_row_max - 1)
    end
    # カーソルの幅を計算
    cursor_width = self.width / @column_max - 32
    # カーソルの座標を計算
    x = @index % @column_max * (cursor_width + 16)
    y = @index / @column_max * 32 - self.oy
    # カーソルの矩形を更新
    self.cursor_rect.set(x + 2, y, cursor_width + 15, 32)
  end
作者: xiaoma1013    时间: 2008-2-25 07:26
# ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 418, 133)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_face(@actor, 0, 90)
    draw_actor_name2(@actor, 90, 0)
    draw_actor_class2(@actor, 250, 0)
    draw_actor_level2(@actor, 90, 32)
    draw_actor_state2(@actor, 90, 64)
    draw_actor_hp2(@actor, 210, 32, 172)
    draw_actor_sp2(@actor, 210, 64, 172)
    draw_actor_barz(@actor, 210, 57, "horizontal", 158, 1, @actor.hp, @actor.maxhp, Color.new(254, 238, 189, 255), Color.new(182, 137, 2, 255))
    draw_actor_barz(@actor, 210, 89, "horizontal", 158, 1, @actor.sp, @actor.maxsp, Color.new(74, 230, 51, 225), Color.new(35, 150, 19, 225))
    end
  end
  #==============================================================================
# ■ Window_Status2
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status2 < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 418, 178)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
          self.contents.font.size = 24
    draw_actor_parameter2(@actor, 0, 10, 0)
    draw_actor_parameter2(@actor, 0, 40, 1)
    draw_actor_parameter2(@actor, 0, 70, 2)
    draw_actor_parameter2(@actor, 0, 100, 3)
    draw_actor_parameter2(@actor, 190, 20, 4)
    draw_actor_parameter2(@actor, 190, 50, 5)
    draw_actor_parameter2(@actor, 190, 80, 6)
    draw_actor_barz(@actor, 0, 37, "horizontal", 168, 1, @actor.atk, 500, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
    draw_actor_barz(@actor, 0, 67, "horizontal", 168, 1, @actor.pdef, 500, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
    draw_actor_barz(@actor, 0, 97, "horizontal", 168, 1, @actor.mdef, 500, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
    draw_actor_barz(@actor, 0, 127, "horizontal", 168, 1, @actor.str, 500, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
    draw_actor_barz(@actor, 190, 47, "horizontal", 168, 1, @actor.dex, 500, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
    draw_actor_barz(@actor, 190, 77, "horizontal", 168, 1, @actor.agi, 500, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
    draw_actor_barz(@actor, 190, 107, "horizontal", 168, 1, @actor.int, 500, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
        if @new_atk != nil
        draw_actor_barz(@actor, 0, 37, "horizontal", 168, 1, @new_atk, 500, Color.new(255, 0, 0, 255), Color.new(255, 0, 0, 255))
      end
        if @new_pdef != nil
        draw_actor_barz(@actor, 0, 67, "horizontal", 168, 1, @new_pdef, 500, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
       end
        if @new_mdef != nil
        draw_actor_barz(@actor, 0, 97, "horizontal", 168, 1, @new_mdef, 500, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
      end
       if  @new_str != nil
       draw_actor_barz(@actor, 0, 127, "horizontal", 168, 1, @new_str, 500, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
      end
       if  @new_dex != nil
       draw_actor_barz(@actor, 190, 47, "horizontal", 168, 1, @new_dex, 500, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
      end
       if  @new_agi != nil
       draw_actor_barz(@actor, 190, 77, "horizontal", 168, 1, @new_agi, 500, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
     end
       if @new_int != nil
       draw_actor_barz(@actor, 190, 107, "horizontal", 168, 1, @new_int, 500, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
    end
end
    def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
    if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or
       @new_agi != new_agi or @new_int != new_int
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int
      refresh
    end
  end
end
#==============================================================================
# ■ Window_Status3
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status3 < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 418, 229)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.size = 24
    self.contents.font.color = system_color
    self.contents.draw_text_outline3(150, 0, 96, 32, "Equipment")
    draw_item_name2($data_weapons[@actor.weapon_id], 15 + 16, 48)
    draw_item_name2($data_armors[@actor.armor1_id], 15 + 16, 86)
    draw_item_name2($data_armors[@actor.armor2_id], 15 + 16, 124)
    draw_item_name2($data_armors[@actor.armor3_id], 15 + 186, 68)
    draw_item_name2($data_armors[@actor.armor4_id], 15 + 186, 106)
      end
    end
    #==============================================================================
# ■ Window_Status4
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status4 < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 252, 100)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.size = 26
    self.contents.font.color = system_color
    self.contents.draw_text_outline3(10, 0, 80, 32, "EXP")
    self.contents.draw_text_outline3(10, 32, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text_outline(10 + 80, 0, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text_outline(10 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
      end
    end
    #==============================================================================
# ■ Window_Status5
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status5 < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 300, 380)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
       draw_battlegraphic(@actor, 100, 300)
      end
    end
    #==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
#  セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :filename                 # ファイル名
  attr_reader   :selected                 # 選択状態
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     file_index : セーブファイルのインデックス (0~3)
  #     filename   : ファイル名
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 64 + file_index % 4 * 104, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.opacity = 0
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # ファイル番号を描画
    self.contents.font.color = normal_color
    name = "File #{@file_index + 1}"
    self.contents.draw_text_outline(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    # セーブファイルが存在する場合
    if @file_exist
      # キャラクターを描画
      for i in [email protected]
        bitmap = RPG::Cache.character(@characters[0], @characters[1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 64 - cw / 2
        self.contents.blt(x, 68 - ch, bitmap, src_rect)
      end
      # プレイ時間を描画
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text_outline(4, 8, 600, 32, time_string, 2)
      # タイムスタンプを描画
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text_outline(4, 40, 600, 32, time_string, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 選択状態の設定
  #     selected : 新しい選択状態 (true=選択 false=非選択)
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, 32)
    else
      self.cursor_rect.empty
    end
  end
end
#==============================================================================
# ■ Window_Location
#------------------------------------------------------------------------------
#  メニュー画面で歩数を表示するウィンドウです。
class Game_Map

def name
$map_infos[@map_id]
end
end

class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end


#==============================================================================
# ■ Window_Mapname
#------------------------------------------------------------------------------
#  メニュー画面でプレイ時間を表示するウィンドウです。
#==============================================================================

class Window_Mapname < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text(4, 0, 220, 32, "Location")
  self.contents.font.size = $fontsize
self.contents.font.color = normal_color
self.contents.draw_text(110, 15, 80, 32, $game_map.name)
end
end
#==================================================
class Window_End < Window_Base

def initialize
super(0, 0, 240, 150)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 30
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
  self.contents.clear
  self.contents.draw_text_outline(24, 0, 240, 32, "To Title")
  self.contents.draw_text_outline(10, 45, 240, 32, "Shutdown")
  self.contents.draw_text_outline(25, 85, 240, 32, "Cancel")
end
#==========================================
end
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  メニュー画面の処理を行うクラスです。
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     menu_index : コマンドのカーソル初期位置
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    #========================================
    # This is setting up the background picture
    @background = Sprite.new
    @background.bitmap = RPG::Cache.picture("background")
    @background.x = 0
    @background.y = 0
    #========================================
    # This is setting up the command pictures for 'item' etc..
    @command1 = Sprite.new
    @command1.bitmap = RPG::Cache.picture("cmscommand1")
    @command1.x = 15
    @command1.y = 40
    @command1.z = 100
    #========================================
    @command2 = Sprite.new
    @command2.bitmap = RPG::Cache.picture("cmscommand2")
    @command2.x = 15
    @command2.y = 40
    @command2.z = 100
    #========================================
    @command3 = Sprite.new
    @command3.bitmap = RPG::Cache.picture("cmscommand3")
    @command3.x = 15
    @command3.y = 40
    @command3.z = 100
    #========================================
    @command4 = Sprite.new
    @command4.bitmap = RPG::Cache.picture("cmscommand4")
    @command4.x = 15
    @command4.y = 40
    @command4.z = 100
    #========================================
    @command5 = Sprite.new
    @command5.bitmap = RPG::Cache.picture("cmscommand5")
    @command5.x = 15
    @command5.y = 40
    @command5.z = 100
    #========================================
    @command6 = Sprite.new
    @command6.bitmap = RPG::Cache.picture("cmscommand6")
    @command6.x = 15
    @command6.y = 40
    @command6.z = 100
    #========================================
    # This setting up the shadows for the commands.
    @commands1 = Sprite.new
    @commands1.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands1.x = 20
    @commands1.y = 45
    @commands1.z = 1
    @commands1.opacity = 155
    @commands1.visible = false
    #========================================
    @commands2 = Sprite.new
    @commands2.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands2.x = 20
    @commands2.y = 45
    @commands2.z = 1
    @commands2.opacity = 155
    @commands2.visible = false
    #========================================
    @commands3 = Sprite.new
    @commands3.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands3.x = 20
    @commands3.y = 45
    @commands3.z = 1
    @commands3.opacity = 155
    @commands3.visible = false
    #========================================
    @commands4 = Sprite.new
    @commands4.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands4.x = 20
    @commands4.y = 45
    @commands4.z = 1
    @commands4.opacity = 155
    @commands4.visible = false
    #========================================
    @commands5 = Sprite.new
    @commands5.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands5.x = 20
    @commands5.y = 45
    @commands5.z = 1
    @commands5.opacity = 155
    @commands5.visible = false
    #========================================
    @commands6 = Sprite.new
    @commands6.bitmap = RPG::Cache.picture("cmscommandshadow")
    @commands6.x = 20
    @commands6.y = 45
    @commands6.z = 1
    @commands6.opacity = 155
    @commands6.visible = false
    #========================================
    # This is setting up the arrow cursor used in the command window..
    @arrow = Sprite.new
    @arrow.bitmap = RPG::Cache.picture("arrow4")
    @arrow.x = 0
    @arrow.y = 45
    @arrow.z = 1000
    #========================================
    # This is setting up the arrow for the status window
    @arrow_status = Sprite.new
    @arrow_status.bitmap = RPG::Cache.picture("arrow4")
    @arrow_status.x = 260
    @arrow_status.y = 37
    @arrow_status.z = 1000
    @arrow_status.visible = false
    #========================================
    # This is setting up the status windows, making them not visible for the moment..
    @status_window1 = Sprite.new
    @status_window1.bitmap = RPG::Cache.picture("status window 1")
    @status_window1.x = 693
    @status_window1.y = 7
    @status_window1.z = 100
    @status_window1.visible = false
    #========================================
    @status_window2 = Sprite.new
    @status_window2.bitmap = RPG::Cache.picture("status window 2")
    @status_window2.x = 676
    @status_window2.y = 106
    @status_window2.z = 100
    @status_window2.visible = false
    #========================================
    @status_window3 = Sprite.new
    @status_window3.bitmap = RPG::Cache.picture("status window 3")
    @status_window3.x = 659
    @status_window3.y = 206
    @status_window3.z = 100
    @status_window3.visible = false
    #========================================
    @status_window4 = Sprite.new
    @status_window4.bitmap = RPG::Cache.picture("status window 4")
    @status_window4.x = 640
    @status_window4.y = 306
    @status_window4.z = 100
    @status_window4.visible = false
    #========================================
    # The shadows are set up for the status windows..
    @status_windowshadow1 = Sprite.new
    @status_windowshadow1.bitmap = RPG::Cache.picture("blackwindow2")
    @status_windowshadow1.x = 697
    @status_windowshadow1.y = 13
    @status_windowshadow1.z = 1
    @status_windowshadow1.opacity = 155
    @status_windowshadow1.visible = false
    #========================================
    @status_windowshadow2 = Sprite.new
    @status_windowshadow2.bitmap = RPG::Cache.picture("blackwindow2")
    @status_windowshadow2.x = 681
    @status_windowshadow2.y = 112
    @status_windowshadow2.z = 1
    @status_windowshadow2.opacity = 155
    @status_windowshadow2.visible = false
    #========================================
    @status_windowshadow3 = Sprite.new
    @status_windowshadow3.bitmap = RPG::Cache.picture("blackwindow2")
    @status_windowshadow3.x = 664
    @status_windowshadow3.y = 212
    @status_windowshadow3.z = 1
    @status_windowshadow3.opacity = 155
    @status_windowshadow3.visible = false
    #========================================
    @status_windowshadow4 = Sprite.new
    @status_windowshadow4.bitmap = RPG::Cache.picture("blackwindow2")
    @status_windowshadow4.x = 645
    @status_windowshadow4.y = 312
    @status_windowshadow4.z = 1
    @status_windowshadow4.opacity = 155
    @status_windowshadow4.visible = false
    #========================================
    # Here, certain status window pictures are made visible depending on
    # how many actors or players there are..
    if $game_party.actors.size == 1
      @status_window1.visible = true
      @status_windowshadow1.visible = true
    end
     if $game_party.actors.size == 2
       @status_window1.visible = true
       @status_windowshadow1.visible = true
       @status_window2.visible = true
       @status_windowshadow2.visible = true
     end
     if $game_party.actors.size == 3
       @status_window1.visible = true
       @status_windowshadow1.visible = true
       @status_window2.visible = true
       @status_windowshadow2.visible = true
       @status_window3.visible = true
       @status_windowshadow3.visible = true
     end
      if $game_party.actors.size == 4
       @status_window1.visible = true
       @status_windowshadow1.visible = true
       @status_window2.visible = true
       @status_windowshadow2.visible = true
       @status_window3.visible = true
       @status_windowshadow3.visible = true
       @status_window4.visible = true
       @status_windowshadow4.visible = true
     end
作者: xiaoma1013    时间: 2008-2-25 07:31
#===========================================
     # The window displaying the gold, and playtime is set up...
     @playtimegoldpicture = Sprite.new
     @playtimegoldpicture.bitmap = RPG::Cache.picture("goldplaytimewindow")
     @playtimegoldpicture.x = 646
     @playtimegoldpicture.y = 404
     @playtimegoldpicture.z = 100
     #============================================
     # And its shadow
     @playtimegoldshadow = Sprite.new
     @playtimegoldshadow.bitmap = RPG::Cache.picture("goldplaytimeshadow")
     @playtimegoldshadow.x = 651
     @playtimegoldshadow.y = 409
     @playtimegoldshadow.z = 1
     @playtimegoldshadow.opacity = 155
     #============================================
     # Setting up the location window's bar....
     @location_bar = Sprite.new
     @location_bar.bitmap = RPG::Cache.picture("locationbar")
     @location_bar.x = 15
     @location_bar.y = 635
     #============================================
     # Setting up the actual window for the map, opacity - 0
     @location_window = Window_Mapname.new
     @location_window.x = 0
     @location_window.y = 609
     #============================================
     # Setting up a white bar below the location
     @location_white = Sprite.new
     @location_white.bitmap = RPG::Cache.picture("locationwhite")
     @location_white.x = - 8
     @location_white.y = 622
     @location_white.z = 120
     #============================================
     @playtime_window = Window_PlayTime.new
     @playtime_window.x = 645
     @playtime_window.y = 390
    # コマンドウィンドウを作成
    # Command window, opacity - 0 so it is invisible, and commands are set to ""
    # - nothing so no text shows, as there is pictures used instead..
    s1 = ""
    s2 = ""
    s3 = ""
    s4 = ""
    s5 = ""
    s6 = ""
    @command_window = Window_Menucommand.new(200, [s1, s2, s3, s4, s5, s6])
    @command_window.opacity = 0
    @command_window.index = @menu_index
    # パーティ人数が 0 人の場合
    if $game_party.actors.size == 0
      # アイテム、スキル、装備、ステータスを無効化
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # セーブ禁止の場合
    if $game_system.save_disabled
      # セーブを無効にする
      @command_window.disable_item(4)
    end
    # ゴールドウィンドウを作成
    @gold_window = Window_Gold.new
    @gold_window.x = 645
    @gold_window.y = 415
    @gold_window.opacity = 0
    # ステータスウィンドウを作成
    @status_window = Window_MenuStatus.new
    @status_window.x = 630
    @status_window.y = - 6
    @status_window.opacity = 0
    @status_window.visible = true
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @background.dispose
    @command1.dispose
    @command2.dispose
    @command3.dispose
    @command4.dispose
    @command5.dispose
    @command6.dispose
    @commands1.dispose
    @commands2.dispose
    @commands3.dispose
    @commands4.dispose
    @commands5.dispose
    @commands6.dispose
    @arrow.dispose
    @status_window1.dispose
    @status_window2.dispose
    @status_window3.dispose
    @status_window4.dispose
    @status_windowshadow1.dispose
    @status_windowshadow2.dispose
    @status_windowshadow3.dispose
    @status_windowshadow4.dispose
    @playtimegoldpicture.dispose
    @playtimegoldshadow.dispose
    @location_bar.dispose
    @location_window.dispose
    @location_white.dispose
    @playtime_window.dispose
    @arrow_status.dispose
  end
  #--------------------------------------------------------------------------
  def delay(seconds)
  for i in 0...(seconds * 1)
    sleep 0.01
    Graphics.update
  end
end
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    if @command2.y < 100
      @command2.y += 20
    end
    if @command3.y < 160
      @command3.y += 20
    end
    if @command4.y < 220
      @command4.y += 20
    end
    if @command5.y < 280
      @command5.y += 20
    end
    if @command6.y < 340
      @command6.y += 20
    end
    if @command6.y >= 340
     @commands1.visible = true
     @commands2.visible = true
     @commands3.visible = true
     @commands4.visible = true
     @commands5.visible = true
     @commands6.visible = true
     end
    if @status_window1.x > 293
     @status_window1.x -= 50
    end
    if @status_window2.x > 276
     @status_window2.x -= 50
    end
    if @status_window3.x > 259
     @status_window3.x -= 50
    end
    if @status_window4.x > 240
     @status_window4.x -= 50
    end
    if @status_windowshadow1.x > 297
      @status_windowshadow1.x -= 50
    end
    if @status_windowshadow2.x > 281
      @status_windowshadow2.x -= 50
    end
    if @status_windowshadow3.x > 264
      @status_windowshadow3.x -= 50
    end
    if @status_windowshadow4.x > 245
      @status_windowshadow4.x -= 50
    end
    if @status_window.x > 230
      @status_window.x -= 50
      end
    if @playtimegoldpicture.x > 446
     @playtimegoldpicture.x -= 25
    end
    if @playtimegoldshadow.x > 451
     @playtimegoldshadow.x -= 25
   end
   if @playtime_window.x > 445
     @playtime_window.x -= 25
   end
   if @gold_window.x > 445
     @gold_window.x -= 25
   end
   if @location_bar.y > 435
     @location_bar.y -= 25
   end
   if @location_window.y > 409
     @location_window.y -= 25
   end
   if @location_white.y > 422
     @location_white.y -= 25
     end
     # ウィンドウを更新
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @arrow.update
    @playtime_window.update
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ
    if @command_window.active
      update_command
      return
    end
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_command
     case @command_window.index
    when 0
      @arrow.y = 45
      @commands1.y = 45
      @commands2.y = 105
      @commands3.y = 165
      @commands4.y = 225
      @commands5.y = 285
      @commands6.y = 345
      @status_windowshadow1.y = 13
      @status_windowshadow2.y = 112
      @status_windowshadow3.y = 212
      @status_windowshadow4.y = 312
      @playtimegoldshadow.y = 409
    when 1
      @arrow.y = 105
      @commands1.y = 42
      @commands2.y = 100
      @commands3.y = 162
      @commands4.y = 222
      @commands5.y = 282
      @commands6.y = 342
      @status_windowshadow1.y = 11
      @status_windowshadow2.y = 110
      @status_windowshadow3.y = 210
      @status_windowshadow4.y = 310
      @playtimegoldshadow.y = 406
    when 2
      @arrow.y = 165
      @commands1.y = 39
      @commands2.y = 97
      @commands3.y = 159
      @commands4.y = 219
      @commands5.y = 279
      @commands6.y = 339
      @status_windowshadow1.y = 8
      @status_windowshadow2.y = 107
      @status_windowshadow3.y = 207
      @status_windowshadow4.y = 307
      @playtimegoldshadow.y = 403
    when 3
      @arrow.y = 225
      @commands1.y = 36
      @commands2.y = 94
      @commands3.y = 156
      @commands4.y = 216
      @commands5.y = 276
      @commands6.y = 336
      @status_windowshadow1.y = 5
      @status_windowshadow2.y = 104
      @status_windowshadow3.y = 204
      @status_windowshadow4.y = 304
      @playtimegoldshadow.y = 400
    when 4
      @arrow.y = 285
      @commands1.y = 33
      @commands2.y = 91
      @commands3.y = 153
      @commands4.y = 213
      @commands5.y = 273
      @commands6.y = 333
      @status_windowshadow1.y = 2
      @status_windowshadow2.y = 101
      @status_windowshadow3.y = 201
      @status_windowshadow4.y = 301
      @playtimegoldshadow.y = 397
    when 5
      @arrow.y = 345
      @commands1.y = 30
      @commands2.y = 88
      @commands3.y = 150
      @commands4.y = 210
      @commands5.y = 270
      @commands6.y = 330
      @status_windowshadow1.y = - 1
      @status_windowshadow2.y = 99
      @status_windowshadow3.y = 199
      @status_windowshadow4.y = 299
      @playtimegoldshadow.y = 394
    end
    #======================
  # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      @arrow.visible = false
      loop do
     if @command1.x > - 200
       @command1.x -= 40
       end
       if @command2.x > - 200
      @command2.x -= 40
    end
    if @command3.x > - 200
      @command3.x -= 40
    end
    if @command4.x > - 200
      @command4.x -= 40
    end
    if @command5.x > - 200
      @command5.x -= 40
    end
    if @command6.x > - 200
      @command6.x -= 40
    end
     @commands1.visible = false
     @commands2.visible = false
     @commands3.visible = false
     @commands4.visible = false
     @commands5.visible = false
     @commands6.visible = false
    if @status_window1.x < 640
     @status_window1.x += 50
    end
    if @status_window2.x < 640
     @status_window2.x += 50
    end
    if @status_window3.x < 640
     @status_window3.x += 50
    end
    if @status_window4.x < 640
     @status_window4.x += 50
    end
    if @status_windowshadow1.x < 640
      @status_windowshadow1.x += 50
    end
    if @status_windowshadow2.x < 640
      @status_windowshadow2.x += 50
    end
    if @status_windowshadow3.x < 640
      @status_windowshadow3.x += 50
    end
    if @status_windowshadow4.x < 640
      @status_windowshadow4.x += 50
    end
    if @status_window.x < 640
      @status_window.x += 50
      end
    if @playtimegoldpicture.x < 640
     @playtimegoldpicture.x += 25
    end
    if @playtimegoldshadow.x < 640
     @playtimegoldshadow.x += 25
   end
   if @playtime_window.x < 640
     @playtime_window.x += 25
   end
   if @gold_window.x < 640
     @gold_window.x += 25
   end
   if @location_bar.y < 480
     @location_bar.y += 25
   end
   if @location_window.y < 480
     @location_window.y += 25
   end
   if @location_white.y < 480
     @location_white.y += 25
   end
   delay(0.1)
   if @status_window.x >= 640
     break
   end
   end
      $game_system.se_play($data_system.cancel_se)
      # マップ画面に切り替え
      $scene = Scene_Map.new
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合
      if $game_party.actors.size == 0 and @command_window.index < 4
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # コマンドウィンドウのカーソル位置で分岐
      case @command_window.index
      when 0  # アイテム
        @command1.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
        @arrow.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
        # 決定  SE を演奏
        $game_system.se_play($data_system.decision_se)
        # アイテム画面に切り替え
        $scene = Scene_Item.new
      when 1  # スキル
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
        @arrow_status.visible = true
      when 2  # 装備
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
        @arrow_status.visible = true
      when 3  # ステータス
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
        @arrow_status.visible = true
      when 4  # セーブ
        # セーブ禁止の場合
        if $game_system.save_disabled
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        #=====================
                @command5.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
         @arrow.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
# 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # セーブ画面に切り替え
        $scene = Scene_Save.new
      when 5  # ゲーム終了
                @command6.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
        @arrow.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ゲーム終了画面に切り替え
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_status
    case @command_window.index
    when 1
      @arrow.y = 105
      @commands1.y = 42
      @commands2.y = 100
      @commands3.y = 162
      @commands4.y = 222
      @commands5.y = 282
      @commands6.y = 342
      @status_windowshadow1.y = 11
      @status_windowshadow2.y = 110
      @status_windowshadow3.y = 210
      @status_windowshadow4.y = 310
      @playtimegoldshadow.y = 406
    when 2
      @arrow.y = 165
      @commands1.y = 39
      @commands2.y = 97
      @commands3.y = 159
      @commands4.y = 219
      @commands5.y = 279
      @commands6.y = 339
      @status_windowshadow1.y = 8
      @status_windowshadow2.y = 107
      @status_windowshadow3.y = 207
      @status_windowshadow4.y = 307
      @playtimegoldshadow.y = 403
    when 3
      @arrow.y = 225
      @commands1.y = 36
      @commands2.y = 94
      @commands3.y = 156
      @commands4.y = 216
      @commands5.y = 276
      @commands6.y = 336
      @status_windowshadow1.y = 5
      @status_windowshadow2.y = 104
      @status_windowshadow3.y = 204
      @status_windowshadow4.y = 304
      @playtimegoldshadow.y = 400
      end
  #========================
    case @status_window.index
    when 0
      @arrow_status.y = 37
      @arrow_status.x = 260
    when 1
      @arrow_status.y = 137
      @arrow_status.x = 265 - @status_window.index * 25
    when 2
      @arrow_status.y = 237
      @arrow_status.x = 265 - @status_window.index * 25
    when 3
      @arrow_status.y = 337
      @arrow_status.x = 265 - @status_window.index * 23
      end
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # コマンドウィンドウをアクティブにする
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      @arrow_status.visible = false
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # コマンドウィンドウのカーソル位置で分岐
      case @command_window.index
      when 1  # スキル
        # このアクターの行動制限が 2 以上の場合
        if $game_party.actors[@status_window.index].restriction >= 2
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @command2.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
        @arrow.visible = false
        @arrow_status.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # スキル画面に切り替え
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # 装備
                @command3.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
        @arrow.visible = false
        @arrow_status.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # 装備画面に切り替え
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # ステータス
                @command4.z = 999
        loop do
        if @status_window.x < 640
          @status_window.x += 50
          end
        if @status_window1.x < 640
          @status_window1.x += 50
        end
        if @status_window2.x < 640
          @status_window2.x += 50
        end
        if @status_window3.x < 640
          @status_window3.x += 50
        end
        if @status_window4.x < 640
          @status_window4.x += 50
        end
        if @status_windowshadow1.x < 640
          @status_windowshadow1.x += 50
        end
        if @status_windowshadow2.x < 640
          @status_windowshadow2.x += 50
        end
        if @status_windowshadow3.x < 640
          @status_windowshadow3.x += 50
        end
        if @status_windowshadow4.x < 640
          @status_windowshadow4.x += 50
        end
        if @playtimegoldpicture.x < 640
          @playtimegoldpicture.x += 50
        end
        if @playtimegoldshadow.x < 640
          @playtimegoldshadow.x += 50
        end
        if @gold_window.x < 640
          @gold_window.x += 50
        end
        if @playtime_window.x < 640
          @playtime_window.x += 50
        end
        if @command2.y > 40
          @command2.y -= 30
        end
        if @command3.y > 40
          @command3.y -= 30
        end
        if @command4.y > 40
          @command4.y -= 30
        end
        if @command5.y > 40
          @command5.y -= 30
        end
        if @command6.y > 40
          @command6.y -= 30
        end
        @commands2.visible = false
        @commands3.visible = false
        @commands4.visible = false
        @commands5.visible = false
        @commands6.visible = false
        @arrow.visible = false
        @arrow_status.visible = false
        if @location_bar.y < 480
          @location_bar.y += 30
        end
        if @location_white.y < 480
          @location_white.y += 30
        end
        if @location_window.y < 480
          @location_window.y += 30
        end
        delay(0.1)
        if @command6.y <= 40
        break
      end
      end
作者: xiaoma1013    时间: 2008-2-25 07:34
主题:《如何让脚本显示中文?》 原帖[LINE]1,#dddddd[/LINE]一个脚本只能显示英文,中文在游戏中不显示,脚本太大贴不出来,请高手帮帮忙,如何修改脚本就能显示中文了?
作者: 暴风の龙    时间: 2008-2-25 08:01
re:主题:《如何让脚本显示中文?》 [LINE]1,#dddddd[/LINE]什么意思?
如果不显示中文或许是你使用的软件系统不一样?




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