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

Project1

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

[已经解决] 求问大佬有没有简易对话框脚本只展示头像框

[复制链接]

Lv1.梦旅人

梦石
0
星屑
127
在线时间
35 小时
注册时间
2020-8-13
帖子
5
跳转到指定楼层
1
发表于 2020-8-13 16:46:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
30星屑
本帖最后由 京鹿鹿 于 2020-8-14 09:05 编辑

我只是想要一个可以展示头像框的脚本,强化对话框脚本的其他功能我并不需要 我用的对话框脚本只要触发战斗和复杂指令就会出错,但头像框攻能和ui我非常非常满意,只想要头像框功能

最佳答案

查看完整内容

我的rpg文件 链接:https://pan.baidu.com/s/1I160RjS5MEemEnbBC0BadQ 提取码:uf98

Lv1.梦旅人

梦石
0
星屑
127
在线时间
35 小时
注册时间
2020-8-13
帖子
5
来自 2楼
 楼主| 发表于 2020-8-14 08:03:09 | 只看该作者

已解决

本帖最后由 京鹿鹿 于 2020-8-14 08:55 编辑

# ▼▲▼ XRXS 9. 真对话加强脚本 ver.2 ▼▲▼
# by 桜雅 在土
#
# update 2006/ 6/ 7
#
# SixRice 改造双重对话框功能  2006/ 8/ 18
#==============================================================================
# □ 使用习惯
#==============================================================================
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # 字体相关设定
  #--------------------------------------------------------------------------
  DEFAULT_FONT_NAME      = ""       # 字体  ( ""为系统默认 )
  DEFAULT_FONT_SIZE      =  20      # 字号  (默认22)
  DEFAULT_LINE_SPACE     =  28      # 字间距(默认32)
  #--------------------------------------------------------------------------
  # 基本设定
  #--------------------------------------------------------------------------
  DEFAULT_BG_PICTURE     = ""       # 背景SKIN ( "" 为系统默认 )
  DEFAULT_BG_X           =   0      # 背景SKIN X 位置
  DEFAULT_BG_Y           = 320      # 背景SKIN Y 位置
  DEFAULT_RECT           = Rect.new(72, 304, 496, 160) #矩形
  DEFAULT_BACK_OPACITY   = 192      # 底图的不透明度
  DEFAULT_STRETCH_ENABLE = true     # 五行以上自动翻页
  #--------------------------------------------------------------------------
  # インフォメーションウィンドウ
  #--------------------------------------------------------------------------
  INFO_RECT              = Rect.new(0, 0, 640, DEFAULT_LINE_SPACE + 38)
  #--------------------------------------------------------------------------
  # 逐字显示 (false时直接显示一页)
  #--------------------------------------------------------------------------
  DEFAULT_TYPING_ENABLE = true # 逐字显示
  DEFAULT_TYPING_SPEED  = 3    # 显示速度,越小越快
  #--------------------------------------------------------------------------
  # 高速跳过显示
  #--------------------------------------------------------------------------
  KEY_SHOW_ALL          = Input::C # 瞬间显示完当前页文章
  KEY_MESSAGE_SKIP      = Input::CTRL # 高速跳过(文章不完全显示)
  #
  # 高速スキップを有効にするスイッチのID.( 0 は常時可能)
  #
  HISKIP_ENABLE_SWITCH_ID = 0
  #
  # 高速スキップ・タイピングスキップを共に禁止するスイッチのID. ( 0 は常時可能)
  #
  SKIP_BAN_SWITCH_ID      = 0
  #--------------------------------------------------------------------------
  # 顔グラフィック
  #--------------------------------------------------------------------------
  FACE_STRETCH_ENABLE    =  false     # 顔グラフィックを↓指定のサイズに拡大する。
  FACE_WIDTH             =  116      # 拡大後の「幅」
  FACE_HEIGHT            =  116      # 拡大後の「高さ」
  #--------------------------------------------------------------------------
  # キャラポップ
  #--------------------------------------------------------------------------
  CHARPOP_HEIGHT         =  48      # キャラポップの高さ
end
module XRXS9
  #--------------------------------------------------------------------------
  # ネームウィンドウ
  #--------------------------------------------------------------------------
  NAME_WINDOW_TEXT_COLOR  = Color.new(192,240,255,255) # \name ウィンドウ文字色
  NAME_WINDOW_TEXT_SIZE   =  14     # \name ウィンドウの文字サイズ
  NAME_WINDOW_SPACE       =  10     # \name ウィンドウの余白
  NAME_WINDOW_OFFSET_X    =   0     # \name ウィンドウのオフセット位置 X
  NAME_WINDOW_OFFSET_Y    = -26     # \name ウィンドウのオフセット位置 Y
  #--------------------------------------------------------------------------
  # 終了時フェードアウト (Fade Out Before Terminate)
  #--------------------------------------------------------------------------
  FOBT_DURATION           =  20     # \fade を指定した時のフェード持続時間
end
#==============================================================================
# --- セリフ効果音 ---
#        $game_system.speak_se = RPG::AudioFile.new("")と設定し使用します。
#==============================================================================
class Game_System
  attr_accessor :speak_se
  def speak_se_play
    self.se_play(self.speak_se) if self.speak_se != nil
  end
end
class Window_Message < Window_Selectable
  # 文字描画SE除外文字
  NOT_SOUND_CHARACTERS = [" ", " ", "・", "、", "。", "─"]
end
#==============================================================================
# □ Sprite_Pause
#==============================================================================
class Sprite_Pause < Sprite
  def initialize
    super
    self.bitmap = RPG::Cache.windowskin("pause.png")
    self.x = 586
    self.y = 416
    self.z = 9999
    @count = 0
    @wait_count = 0
    update
  end
  def update
    super
    if @wait_count > 0
      @wait_count -= 1
    else
      @count = (@count + 1)%6
      x = 37*@count
      self.src_rect.set(x, 0, 37, 55)
      @wait_count = 1
    end
  end
end
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  # 定数
  LEFT   = 0
  CENTER = 1
  RIGHT  = 2
  #--------------------------------------------------------------------------
  # ○ line_height : 行の高さ(@y増加値)を返します。
  #--------------------------------------------------------------------------
  def line_height
    return DEFAULT_LINE_SPACE
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs9_initialize initialize
  def initialize
    # 初期化
    @stand_pictuers = []
    @held_windows = []
    @extra_windows = []
#======================↓双重对话框功能↓====================================   
    @held_windows2 = []
    @extra_windows2 = []
#======================↑双重对话框功能↑====================================     
    @extra_sprites = []
    # ポーズサイン
    @pause = Sprite_Pause.new
    @pause.visible = false
    # 呼び戻す
    xrxs9_initialize
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias xrxs9_dispose dispose
  def dispose   
    # ホールドされたウィンドウを開放
    @held_windows.each {|window| window.dispose}
    @held_windows.clear
#======================↓双重对话框功能↓====================================
    @held_windows2.each {|window| window.dispose}
    @held_windows2.clear
#======================↑双重对话框功能↑====================================   
    # ポーズサイン
    @pause.dispose
    # 外字キャッシュ開放
    if @gaiji_cache != nil
      @gaiji_cache.dispose
      @gaiji_cache = nil
    end
    # 呼び戻す
    xrxs9_dispose
  end
  #--------------------------------------------------------------------------
  # ● メッセージ終了処理
  #--------------------------------------------------------------------------
  alias xrxs9_terminate_message terminate_message
  def terminate_message
    # 素通りフラグをクリア
    @passable = false
    $game_player.messaging_moving = false
    # 背景ピクチャを解放
    if @bgframe_sprite != nil
      @bgframe_sprite.dispose
    end   
    # ウィンドウホールド
    if @window_hold
      # ウィンドウやスプライトの複製を作成
      @held_windows.push(Window_Copy.new(self))
      for window in @extra_windows
        next if window.disposed?
        @held_windows.push(Window_Copy.new(window))
      end
      for sprite in @extra_sprites
        next if sprite.disposed?
        @held_windows.push(Sprite_Copy.new(sprite))
      end
      # 設定をクリア
      self.opacity = 0
      self.contents_opacity = 0
      @extra_windows.clear
      @extra_sprites.clear
    else
      # ホールドされたウィンドウを開放
      @held_windows.each {|object| object.dispose}
      @held_windows.clear
    end  
#======================↓双重对话框功能↓====================================   
    # ウィンドウホールド2
    if @window_hol2
      # ウィンドウやスプライトの複製を作成
      @held_windows2.push(Window_Copy2.new(self))
      for window in @extra_windows2
        next if window.disposed?
        @held_windows2.push(Window_Copy2.new(window))
      end
      for sprite in @extra_sprites
        next if sprite.disposed?
        @held_windows.push(Sprite_Copy.new(sprite))
      end
      # 設定をクリア
      self.opacity = 0
      self.contents_opacity = 0
      @extra_windows2.clear
      @extra_sprites.clear
    else
      # ホールドされたウィンドウを開放
      @held_windows2.each {|object| object.dispose}
      @held_windows2.clear
    end
#======================↑双重对话框功能↑====================================   
    # ネームウィンドウらを解放
    if @name_window_frame != nil
      @name_window_frame.dispose
      @name_window_frame = nil
    end
    if @name_window_text  != nil
      @name_window_text.dispose
      @name_window_text  = nil
    end
    # 呼び戻す
    xrxs9_terminate_message
  end
  #--------------------------------------------------------------------------
  # ○ ポップキャラクターの設定と取得
  #--------------------------------------------------------------------------
  def pop_character=(character_id)
    @pop_character = character_id
  end
  def pop_character
    return @pop_character
  end
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  def clear
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size  = DEFAULT_FONT_SIZE
    self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
    self.opacity          = 255
    self.back_opacity     = DEFAULT_BACK_OPACITY
    self.contents_opacity = 255
    Window_Copy
    @mid_stop     = false       # \!      の中断中フラグ
    @face_file    = nil         # \f      の顔ファイル
    @current_name = nil         # \name   のネーム保持
#======================↓双重对话框功能↓====================================   
    @window_hold  = false       # \hold   のウィンドウホールドのフラグ
    @window_hol2  = false
#======================↑双重对话框功能↑====================================   
    @stand_pictuer_hold = false # \picthold のスタンドピクチャの保持フラグ
    @passable     = false       # \pass   の素通り可能フラグ
    @inforesize   = false       # \info   のインフォリサイズ
    # あと残りのここらへんのものを全て 0 で初期化
    @x = @y = @indent = @line_index = 0
    @cursor_width = @write_wait = @lines_max = 0
    # タイピングスピードを取得
    @write_speed = DEFAULT_TYPING_SPEED
    # 各行の描画幅&位置揃え設定初期化
    @line_widths = []
    @line_aligns = []
    # self.pop_character が nil の場合、標準位置。-1の場合、文字センター。
    # 0以上の場合 キャラポップ。0は主人公、1以降はイベント。
    self.pop_character = nil
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ [再定義]
  #--------------------------------------------------------------------------
  def refresh
    # ビットマップの取得と設定
    if DEFAULT_BG_PICTURE != ""
      bitmap = RPG::Cache.picture(DEFAULT_BG_PICTURE)
      @bgframe_sprite = Sprite.new
      @bgframe_sprite.x = DEFAULT_BG_X
      @bgframe_sprite.y = DEFAULT_BG_Y
      @bgframe_sprite.bitmap = bitmap
      @bgframe_sprite.z += 5
    end
    # 初期化
    self.clear
    # 表示待ちのメッセージがある場合
    if $game_temp.message_text != nil
      @now_text = $game_temp.message_text
      # 改行削除指定\_があるか?
      if (/\\_\n/.match(@now_text)) != nil
        $game_temp.choice_start -= 1
        @now_text.gsub!(/\\_\n/) { "" }
      end
      # 顔表示指定\Fがあるか?
      if (/\\[Ff]\[(.+?)(?:,(\d+))?\]/.match(@now_text)) != nil
        # ファイルチェック
        if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
          # フェイスファイルを設定
          @face_file = $1 + ".png"
          @face_index = $2.to_i
          # 全行インデントを入れる。
          src = RPG::Cache.picture(@face_file)
          self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
          if FACE_STRETCH_ENABLE
            @indent += FACE_WIDTH
          elsif $2 == nil
            @indent += src.width
            @face_index = -1
          else
            @indent += src.width/4
          end
        end
        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
      end
      # インフォ判定
      @inforesize = (@now_text.gsub!(/\\info/) { "" } != nil)
#======================↓双重对话框功能↓====================================      
      # ウィンドウ保持指定\holdがあるか?
      @window_hold = (@now_text.gsub!(/\\hold/) { "" } != nil)
            # ウィンドウ保持指定\holdがあるか?
      @window_hol2 = (@now_text.gsub!(/\\hol2/) { "" } != nil)
#======================↑双重对话框功能↑====================================      
      # \vの即時変換
      @now_text.gsub!(/\\[v]\[([0-9]+)\]/) { $game_variables[$1.to_i].to_s }
      # \Vを独自ルーチンに変更(追加部分)
      begin
        last_text = @now_text.clone
        @now_text.gsub!(/\\[V]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
      end until @now_text == last_text
      @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      # \name 判定
      if @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
        @current_name = $1
      end
      # ウィンドウポップ判定
      if @now_text.gsub!(/\\[Pp]\[([0-9]+)\]/) { "" }
        self.pop_character = $1.to_i
      end
      # 改行指定
      if (/\\n/.match(@now_text)) != nil
        $game_temp.choice_start += 1
        @now_text.gsub!(/\\n/) { "\n" }
      end
      # フェード判定
      if @now_text.gsub!(/\\fade/) { "" }
        @fade_count_before_terminate = XRXS9::FOBT_DURATION
      end
      # 素通り判定
      if @now_text.gsub!(/\\pass/) { "" }
        @passable = true
        $game_player.messaging_moving = true
      end
      # 末尾連続改行を削除
      nil while( @now_text.sub!(/\n\n\z/) { "\n" } )
      # 行数の取得
      @lines_max = @now_text.scan(/\n/).size
      # 現在搭載されている制御文字を配列化
      rxs = [/\\\w\[(\w+)\]/, /\\[.]/, /\\[|]/, /\\[>]/, /\\[<]/, /\\[!]/,
              /\\[~]/, /\\/, /\\[Oo]\[([0-9]+)\]/, /\\[Hh]\[([0-9]+)\]/,
              /\\\[([0-9]+)\]/, /\\[Rr]\[(.*?)\]/, /\\[B]/, /\\[I]/]
      @max_choice_x = 0
      # インフォウィンドウの強制センタリング
      @line_aligns[0] = CENTER if @inforesize
      #
      # [行ごとの設定]
      #
      lines = @now_text.split(/\n/)
      for i in 0..@lines_max
        # 行の取得 (インデックスは逆順)
        line = lines[@lines_max - i]
        # 空白行の場合は次へ
        next if line == nil
        # 制御文字を削る
        line.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
        for rx in rxs
          line.gsub!(rx) { "" }
        end
        # 位置揃えを取得
        @line_aligns[@lines_max - i] =
          line.sub!(/\\center/) {""} ? CENTER :
          line.sub!(/\\right/)  {""} ? RIGHT :
                                       LEFT
        # 行の横幅の取得と設定
        cx = contents.text_size(line).width
        @line_widths[@lines_max - i] = cx
      end
      # 選択肢行以降の最大横幅を取得
      choices = @line_widths[$game_temp.choice_start, @line_widths.size]
      @max_choice_x = choices == nil ? 0 : choices.max + 8
      # 位置揃え制御文字の削除
      @now_text.gsub!(/\\center/) {""}
      @now_text.gsub!(/\\right/) {""}
      # キャラポップ時のウィンドウリサイズ
      if self.pop_character != nil and self.pop_character >= 0
        max_x = @line_widths.max
        self.width = max_x + 32 + @indent + DEFAULT_FONT_SIZE/2
        self.height = [@lines_max * line_height, @indent].max  + 32
      end
      #
      # 「変換」
      #
      # 便宜上、"\\\\" を "\000" に変換
      @now_text.gsub!(/\\\\/) { "\000" }
      # "\\C" を "\001" に、"\\G" を "\002" に、
      # "\\S" を "\003" に、"\\A" を "\004" に変換
      @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
      @now_text.gsub!(/\\[Gg]/) { "\002" }
      @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
      @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
      @now_text.gsub!(/\\[.]/) { "\005" }
      @now_text.gsub!(/\\[|]/) { "\006" }
      # 競合すると何かと気まずいので、\016以降を使用する
      @now_text.gsub!(/\\[>]/) { "\016" }
      @now_text.gsub!(/\\[<]/) { "\017" }
      @now_text.gsub!(/\\[!]/) { "\020" }
      @now_text.gsub!(/\\[~]/) { "\021" }
      @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
      # インデント設定(追加部分)
      @now_text.gsub!(/\\/) { "\023" }
      # テキスト透過率指定(追加部分)
      @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
      # テキストサイズ指定(追加部分)
      @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
      # 空白挿入(追加部分)
      @now_text.gsub!(/\\\[([0-9]+)\]/) { "\026[#{$1}]" }
      # ルビ表示(追加部分)
      @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }
      # Font.bold
      @now_text.gsub!(/\\[B]/) { "\031" }
      # Font.italic
      @now_text.gsub!(/\\[I]/) { "\032" }
      # ここで一旦ウィンドウ位置更新
      reset_window
      #
      # \nameがあるか?~「ネームウィンドウの作成」
      #
      if @current_name != nil
        # フォントを一時設定
        self.contents.font.size = XRXS9::NAME_WINDOW_TEXT_SIZE
        # 枠だけウィンドウの作成
        x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
        y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
        w = self.contents.text_size(@current_name).width + 8 + XRXS9::NAME_WINDOW_SPACE
        h = 26 + XRXS9::NAME_WINDOW_SPACE
        @name_window_frame = Window_Base.new(x, y, w, h)
        @name_window_frame.opacity = 160
        @name_window_frame.z = self.z + 2
        # 擬似的な空中文字描写(ウィンドウ使用)を作成
        x = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 3 + XRXS9::NAME_WINDOW_SPACE / 2
        y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE / 2
        @name_window_text = Air_Text.new(x,y, @current_name, XRXS9::NAME_WINDOW_TEXT_SIZE, XRXS9::NAME_WINDOW_TEXT_COLOR)
        @name_window_text.z = self.z + 3
        # フォントを復旧
        self.contents.font.size = DEFAULT_FONT_SIZE
        # エクストラウィンドウに登録
        @extra_windows.push(@name_window_frame)
        @extra_windows.push(@name_window_text)
      end
    end
    # ウィンドウを更新
    reset_window
    # コンテンツの再作成
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.contents.font.color = normal_color
    self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
    unless @face_file.nil?
      # 顔グラを描画
      src = RPG::Cache.picture(@face_file)
      if @face_index == -1
        w = src.width
        h = src.height
        x = 0
        y = 0
      else
        w = src.width/4
        h = src.height/4
       x = (@face_index-1) % 4 * w
       y = (@face_index-1) / 4 * h
      end
      if FACE_STRETCH_ENABLE
        self.contents.stretch_blt(Rect.new(0,0,FACE_WIDTH,FACE_HEIGHT), src, Rect.new(x, y, w, h))
      else
        self.contents.blt(6, 6, src, Rect.new(x, y, w, h))
      end
    end
    #
    # 選択肢の場合
    #
    if $game_temp.choice_max > 0
      @item_max = $game_temp.choice_max
      self.active = true
      self.index = 0
    end
    #
    # 数値入力の場合
    #
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8 + @indent
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
    # フォントサイズを再設定
    self.contents.font.size  = DEFAULT_FONT_SIZE
    # 行初期化
    line_reset
    # 瞬間表示の場合はこのままフレーム更新へ
    update unless DEFAULT_TYPING_ENABLE
  end
  #--------------------------------------------------------------------------
  # ○ 行初期化
  #--------------------------------------------------------------------------
  def line_reset
    # 位置揃えの取得
    case @line_aligns[@line_index]
    when LEFT
      @x  = @indent
      @x += 8 if $game_temp.choice_start <= @line_index
    when CENTER
      @x = self.width / 2 - 16 - @line_widths[@line_index].to_i / 2
    when RIGHT
      @x = self.width - 40 - @line_widths[@line_index].to_i
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 [再定義]
  #--------------------------------------------------------------------------
  def update
    # メッセージ素通り中にイベントが開始した場合
    if @passable and not $game_player.messaging_moving
      self.opacity = 0
      terminate_message
      return
    end
    # ポーズサイン
    @pause.update if @pause.visible
    # 呼び戻す
    super
    # フレーム更新↓
    update_main
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  def update_main
    # 動きに対応
    if !self.pop_character.nil? and self.pop_character >= 0
      update_reset_window
    end
    # フェードインの場合
    if skippable_now? and Input.press?(KEY_MESSAGE_SKIP)
      self.contents_opacity = 255
      @fade_in = false
    elsif @fade_in
      self.contents_opacity += 24
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.contents_opacity == 255
        @fade_in = false
      end
      return
    end
    @now_text = nil if @now_text == "" # 変換
    # 表示待ちのメッセージがある場合
    if @now_text != nil and @mid_stop == false
      if @write_wait > 0
        @write_wait -= 1
        return
      end
      text_not_skip = DEFAULT_TYPING_ENABLE
      while true
        # c に 1 文字を取得 (文字が取得できなくなるまでループ)
        if (c = @now_text.slice!(/./m)) != nil
          # \\ の場合
          if c == "\000"
            # 本来の文字に戻す
            c = "\\"
          end
          # \C[n] の場合
          if c == "\001"
            # 文字色を変更
            @now_text.sub!(/\[([0-9]+)\]/, "")
            color = $1.to_i
            if color >= 0 and color <= 7
              self.contents.font.color = text_color(color)
              if @opacity != nil
                color = self.contents.font.color
                self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
              end
            end
            # 次の文字へ
            c = ""
          end
          # \G の場合
          if c == "\002"
            # ゴールドウィンドウを作成
            if @gold_window == nil
              @gold_window = Window_Gold.new
              @gold_window.x = 560 - @gold_window.width
              if $game_temp.in_battle
                @gold_window.y = 192
              else
                @gold_window.y = self.y >= 128 ? 32 : 384
              end
              @gold_window.opacity = self.opacity
              @gold_window.back_opacity = self.back_opacity
            end
            # 次の文字へ
            c = ""
          end
          # \S[n] の場合
          if c == "\003"
            # 文字色を変更
            @now_text.sub!(/\[([0-9]+)\]/, "")
            speed = $1.to_i
            if speed >= 0 and speed <= 19
              @write_speed = speed
            end
            # 次の文字へ
            c = ""
          end
          # \. の場合
          if c == "\005"
            @write_wait += 5
            c = ""
          end
          # \| の場合
          if c == "\006"
            @write_wait += 20
            c = ""
          end
          # \> の場合
          if c == "\016"
            text_not_skip = false
            c = ""
          end
          # \<の場合
          if c == "\017"
            text_not_skip = true
            c = ""
          end
          # \!の場合
          if c == "\020"
            @mid_stop = true
            c = ""
          end
          # \~の場合
          if c == "\021"
            terminate_message
            return
          end
          # \Iの場合(追加部分)
          if c == "\023"
            # 今の@xをインデント位置に設定
            @indent = @x
            c = ""
          end
          # \Oの場合(追加部分)
          if c == "\024"
            @now_text.sub!(/\[([0-9]+)\]/, "")
            @opacity = $1.to_i
            color = self.contents.font.color
            self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
            c = ""
          end
          # \Hの場合(追加部分)
          if c == "\025"
            @now_text.sub!(/\[([0-9]+)\]/, "")
            self.contents.font.size = [[$1.to_i, 6].max, 32].min
            c = ""
          end
          # \Bの場合(追加部分)
          if c == "\026"
            @now_text.sub!(/\[([0-9]+)\]/, "")
            @x += $1.to_i
            c = ""
          end
          # \Rの場合「ルビ」
          if c == "\027"
            process_ruby
            # 文字描写のSEを演奏
            $game_system.speak_se_play
            c = ""
          end
          # アイコン描画用シーケンスの場合(追加部分)
          if c == "\030"
            # アイコンファイル名を取得
            @now_text.sub!(/\[(.*?)\]/, "")
            # アイコンを描画
            self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
            @x += 24
            # 次の文字へ
            c = ""
          end
          #
          # 改行文字の場合
          #
          if c == "\n"
            # y に 1 を加算
            @y += 1
            #
            # 次の行へ (改行処理 + X位置設定)
            #
            @line_index += 1
            line_reset
            # 選択肢ならカーソルの更新
            if @line_index >= $game_temp.choice_start
              @cursor_width = @max_choice_x
            end
            # 次の文字へ
            c = ""
          end
          # 外字表示の場合
          if c == "\022"
            # []部分の除去
            @now_text.sub!(/\[([0-9]+)\]/, "")
            # 外字を表示(sr)
            @x += draw_gaiji(16 + 4 + @x, 6+@y * line_height + (line_height - self.contents.font.size), $1.to_i)
            # 次の文字へ
            c = ""
          end
          # Font.boldの場合 (排他的論理和での反転)
          if c == "\031"
            self.contents.font.bold ^= true
            c = ""
          end
          # Font.italicの場合
          if c == "\032"
            self.contents.font.italic ^= true
            c = ""
          end
          if c != ""
            # 文字を描画(sr)
            self.contents.draw_text(16 + 4 +@x, 6+line_height * @y, 40, line_height, c)
            @x += self.contents.text_size(c).width
            # 文字描写のSEを演奏
            unless NOT_SOUND_CHARACTERS.include?(c)
              $game_system.speak_se_play
            end
          end
          # Bボタンが押された場合
          if skippable_now? and
            (Input.press?(KEY_SHOW_ALL) or Input.press?(KEY_MESSAGE_SKIP)) and
            (SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID])
            text_not_skip = false
          end
        else
          text_not_skip = true
          break
        end
        # 終了判定
        break if text_not_skip
      end
      @write_wait += @write_speed
      return
    end
    # 数値入力中の場合
    if @input_number_window != nil
      @input_number_window.update
      # 決定
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
        $game_map.need_refresh = true
        # 数値入力ウィンドウを解放
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end
    #
    # メッセージ表示中の場合
    #
    if @contents_showing
      # 終了前フェーズでない場合
      unless @fade_phase_before_terminate
        # 選択肢の表示中でなければポーズサインを表示
        if $game_temp.choice_max == 0
          #self.pause = true
          @pause.visible = true
        end
        # キャンセル
        if Input.trigger?(Input::B)
          if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
            $game_system.se_play($data_system.cancel_se)
            $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
            terminate_message
            @pause.visible = false
            return
          end
        end
        # 決定
        if Input.trigger?(Input::C) or
           (skippable_now? and Input.press?(KEY_MESSAGE_SKIP))
          if $game_temp.choice_max > 0
            $game_system.se_play($data_system.decision_se)
            $game_temp.choice_proc.call(self.index)
          end
          if @mid_stop
            @mid_stop = false
            @pause.visible = false
            return
          elsif @fade_count_before_terminate.to_i > 0
            # 終了前フェーズへ
            @fade_phase_before_terminate = true
          else
            terminate_message
          end
          @pause.visible = false
        end
      end
      # 終了前:カウント + フェードアウト
      if @fade_phase_before_terminate
        # 例外補正
        @fade_count_before_terminate  = 0 if @fade_count_before_terminate == nil
        # カウント
        @fade_count_before_terminate -= 1
        # 不透明度を計算・設定
        opacity = @fade_count_before_terminate * (256 / XRXS9::FOBT_DURATION)
        self.contents_opacity = opacity
        # 終了判定
        if @fade_count_before_terminate <= 0
          @fade_count_before_terminate = 0
          @fade_phase_before_terminate = false
          terminate_message
        end
      end
      return
    end
    #
    # 以下、メッセージ表示中でない場合
    #
    # フェードアウト中以外で表示待ちのメッセージか選択肢がある場合
    if @fade_out == false and $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      refresh
      Graphics.frame_reset
      self.visible = true
      self.contents_opacity = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      @fade_in = true
      return
    end
    # 表示すべきメッセージがないが、ウィンドウが可視状態の場合
    if self.visible
      @fade_out = true
      self.opacity -= 48
      if self.opacity == 0
        self.visible = false
        @fade_out = false
        $game_temp.message_window_showing = false
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置窗口位置与不透明度[再定義]
  #--------------------------------------------------------------------------
  def reset_window
    if @inforesize
      RectalCopy.copy(self, INFO_RECT)
    elsif self.pop_character != nil and self.pop_character >= 0
      update_reset_window
    else
      RectalCopy.copy(self, DEFAULT_RECT)
      #
      case ($game_temp.in_battle ? 0 : $game_system.message_position)
      when 0  # 上 (戦闘中は上扱い)
        self.y = [16, -XRXS9::NAME_WINDOW_OFFSET_Y + 4].max

      when 1  # 中
        self.y = 160

      end
      # 自動リサイズ
      if DEFAULT_STRETCH_ENABLE and @lines_max >= 4
        # 拡張する差分を計算
        d = @lines_max * DEFAULT_LINE_SPACE + 32 - self.height
        if d > 0
          self.height += d
          case $game_system.message_position
          when 1  # 中
            self.y -= d/2

          when 2  # 下
            self.y -= d

          end
        end
      end
      if @face_file != nil
        self.width += FACE_WIDTH
        self.x -= FACE_WIDTH/2
      end
    end
    if $game_system.message_frame == 0
      self.back_opacity = DEFAULT_BACK_OPACITY
      @name_window_frame.back_opacity = DEFAULT_BACK_OPACITY unless @name_window_frame.nil?
    else
      self.opacity = 0
      @name_window_frame.back_opacity = 0 unless @name_window_frame.nil?
    end
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウの位置と不透明度の設定 (キャラポップ)
  #--------------------------------------------------------------------------
  def update_reset_window
    #
    # 「キャラポップ」
    #
    if self.pop_character == 0 or $game_map.events[self.pop_character] != nil
      character = get_character(self.pop_character)
      x = character.screen_x - self.width / 2
      case $game_system.message_position
      when 0
        if @name_window_frame != nil and @name_window_frame.y <= 4
          y = 4 - XRXS9::NAME_WINDOW_OFFSET_Y
        else
          y = character.screen_y - CHARPOP_HEIGHT - self.height
        end
      else
        y = character.screen_y
      end
      self.x = [[x, 4].max, 636 - self.width ].min
      self.y = [[y, 4].max, 476 - self.height].min
      if  @name_window_frame != nil
        @name_window_frame.x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
        @name_window_frame.y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
        @name_window_text.x  = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
        @name_window_text.y  = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ カーソルの矩形更新 [オーバーライド]
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index >= 0
      n = $game_temp.choice_start + @index
      self.cursor_rect.set(8 + @indent, n * line_height, @cursor_width, line_height)
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # ○ キャラクターの取得
  #     parameter : パラメータ
  #--------------------------------------------------------------------------
  def get_character(parameter)
    # パラメータで分岐
    case parameter
    when 0  # プレイヤー
      return $game_player
    else  # 特定のイベント
      events = $game_map.events
      return events == nil ? nil : events[parameter]
    end
  end
  #--------------------------------------------------------------------------
  # ○ 現在キースキップが可能か?
  #--------------------------------------------------------------------------
  def skippable_now?
    return ((SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID]) and
       (HISKIP_ENABLE_SWITCH_ID == 0 ? true : $game_switches[HISKIP_ENABLE_SWITCH_ID]))
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態
  #--------------------------------------------------------------------------
  def visible=(b)
    @name_window_frame.visible = b unless @name_window_frame.nil?
    @name_window_text.visible  = b unless @name_window_text.nil?
    @input_number_window.visible  = b unless @input_number_window.nil?
    super
  end
  #--------------------------------------------------------------------------
  # メソッド テンプレート
  #--------------------------------------------------------------------------
  def process_ruby
  end
  def draw_gaiji(x, y, num)
  end
  def convart_value(option, index)
  end
end
#==============================================================================
# □ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
#==============================================================================
class Air_Text < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y, designate_text, size, text_color)
    super(x-16, y-16, 32 + designate_text.size * 12, 56)
    self.opacity      = 0
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    w = self.contents.width
    h = self.contents.height
    self.contents.font.size = size
    self.contents.font.color = text_color
    self.contents.draw_text(0, 0, w, h, designate_text)
  end
end
#==============================================================================
# □ Window_Copy
#------------------------------------------------------------------------------
#   指定のウィンドウのコピーを作成します。
#==============================================================================
class Window_Copy < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(window)
    super(window.x, window.y, window.width, window.height)
    self.contents = window.contents.dup unless window.contents.nil?
    self.opacity = window.opacity
    self.back_opacity = window.back_opacity
    self.z = window.z
  end
end
#======================↓双重对话框功能↓====================================
class Window_Copy2 < Window_Base
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(window)
    super(window.x, window.y, window.width, window.height)
    self.contents = window.contents.dup unless window.contents.nil?
    self.opacity = window.opacity
    self.back_opacity = window.back_opacity
    self.z = window.z
  end
end
#======================↑双重对话框功能↑=====================================
#==============================================================================
# □ Sprite_Copy
#------------------------------------------------------------------------------
#   指定のスプライトのコピーを作成します。
#==============================================================================
class Sprite_Copy < Sprite
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(sprite)
    super()
    self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
    self.opacity = sprite.opacity
    self.x = sprite.x
    self.y = sprite.y
    self.z = sprite.z
    self.ox = sprite.ox
    self.oy = sprite.oy
  end
end
#==============================================================================
# ■ Interpreter
#==============================================================================
class Interpreter
  #--------------------------------------------------------------------------
  # ● 文章の表示
  #--------------------------------------------------------------------------
  def command_101
    # ほかの文章が message_text に設定済みの場合
    if $game_temp.message_text != nil
      # 終了
      return false
    end
    # メッセージ終了待機中フラグおよびコールバックを設定
    @message_waiting = true
    $game_temp.message_proc = Proc.new { @message_waiting = false }
    # message_text に 1 行目を設定
    $game_temp.message_text = @list[@index].parameters[0] + "\n"
    line_count = 1
    # ループ
    loop do
      # 次のイベントコマンドが文章 2 行目以降の場合
      if @list[@index+1].code == 401
        # message_text に 2 行目以降を追加
        $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
        line_count += 1
      # イベントコマンドが文章 2 行目以降ではない場合
      else
        # 次のイベントコマンドが文章の表示の場合
        if @list[@index+1].code == 101
          if (/\\next\Z/.match($game_temp.message_text)) != nil
            $game_temp.message_text.gsub!(/\\next/) { "" }
            $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
            # インデックスを進める
            @index += 1
            next
          end
        # 次のイベントコマンドが選択肢の表示の場合
        elsif @list[@index+1].code == 102
          # 選択肢が画面に収まる場合
          if @list[@index+1].parameters[0].size <= 4 - line_count
            # インデックスを進める
            @index += 1
            # 選択肢のセットアップ
            $game_temp.choice_start = line_count
            setup_choices(@list[@index].parameters)
          end
        # 次のイベントコマンドが数値入力の処理の場合
        elsif @list[@index+1].code == 103
          # 数値入力ウィンドウが画面に収まる場合
          if line_count < 4
            # インデックスを進める
            @index += 1
            # 数値入力のセットアップ
            $game_temp.num_input_start = line_count
            $game_temp.num_input_variable_id = @list[@index].parameters[0]
            $game_temp.num_input_digits_max = @list[@index].parameters[1]
          end
        end
        # 継続
        return true
      end
      # インデックスを進める
      @index += 1
    end
  end
end
#==============================================================================
# --- メッセージ中移動許可 ---
#==============================================================================
class Game_Player < Game_Character
  attr_accessor :messaging_moving
end
#==============================================================================
# --- 範囲コピー ---
#==============================================================================
module RectalCopy
  def self.copy(rect1, rect2)
    rect1.x      = rect2.x
    rect1.y      = rect2.y
    rect1.width  = rect2.width
    rect1.height = rect2.height
  end
end


回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
127
在线时间
35 小时
注册时间
2020-8-13
帖子
5
3
 楼主| 发表于 2020-8-13 16:46:34 | 只看该作者
本帖最后由 京鹿鹿 于 2020-8-13 18:47 编辑

我的rpg文件
链接:https://pan.baidu.com/s/1I160RjS5MEemEnbBC0BadQ
提取码:uf98
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3790
在线时间
1578 小时
注册时间
2006-5-5
帖子
2742
4
发表于 2020-8-13 16:46:34 | 只看该作者
为什么我从来没出过事?
  1. #============================================================================
  2. # 66加强对话框Fuki对话框整合+附送功能
  3. # By whbm
  4. #============================================================================

  5. #   说明:
  6. #     这是一个整合了66加强对话框和Fuki对话框功能脚本,你可以靠改变开关来切换
  7. #     两个脚本。
  8.    
  9. #     附送功能:
  10. #     在对话中按enter键跳过打字效果

  11. #   33号开关控制对话框的切换:
  12. #     打开--使用66加强对话框
  13. #     关闭--使用Fuki对话框
  14. #   34号开关控制附送功能的打开与关闭:
  15. #     打开--使用附送功能
  16. #     关闭--不使用附送功能

  17. #修改固定对话框大小
  18. # self.x = 80
  19. #   self.width = 480
  20. #   self.height = 160
  21. # 还有
  22. #        self.x = 80
  23. #        if @face_file == nil
  24. #         self.width = 480


  25. #============================================================================
  26. # 66加强对话框说明--66rpg
  27. #============================================================================

  28. #默认为一个字一个字的方式,如果需要一次全部显示,
  29. #请在游戏中使用脚本:$game_system.typing = true
  30.      
  31. #默认对话字没有声音,如果需要声音,
  32. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  33. #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  34. # 其他在对话中可以使用的功能:

  35. # \n[1]:显示1号角色的姓名

  36. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名

  37. # \p[1]:对话框出现在1号事件的上方
  38. # \p[0]:主人公上方出现对话框
  39. #——————————————————使用\p功能后可以自动调整对话框大小

  40. # \\:显示"\"这个符号

  41. # \v[1] :显示变量1

  42. # \v[a1] :显示防具1

  43. # \v[w1] :显示武器1

  44. # \v[i1] :显示物品1

  45. # \v[s1] :显示特技1

  46. # \c[1-8]:更改颜色
  47. # 0-白色  1-浅蓝色  2-深蓝色  3-RGB绿色  4-正红色  5-淡紫色  6-黄色  7-黑色

  48. # \g:显示金钱窗口

  49. # \a[SE文件名]:对话的时候播放SE

  50. # \s[1-19]:更改弹字的速度

  51. # \.   :停顿一刹那(1、2帧)
  52. # \|   :停顿片刻(20帧)

  53. # \>   :文字不用打字方式
  54. # \<   :文字使用打字方式

  55. # \!   :等待玩家按回车再继续
  56. # \~   :文字直接消失

  57. # \I   :下一行从这个位置开始

  58. # \o[123]:文字透明度改为123,模拟将死之人(汗)

  59. # \h[12]:改用12号字

  60. # \b[50]:空50象素

  61. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效

  62. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  63. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”

  64. # \Lk:清除左边的图像
  65. # \Rk:清除右边的图像







  66. #============================================================================
  67. # Fuki对话框说明--bbschat
  68. #============================================================================
  69. #
  70. #    呼出对话框 ver. 1.31 By パラ犬(日)
  71. #  来自 http://rpg.para.s3p.net/
  72. #
  73. #  汉化修改 66RPG bbschat(2006.1.5)
  74. #    来自
  75. #
  76. #    ●准备工作-窗口Skin
  77. #
  78. #    首先,确认自己使用的对话框窗口Skin,(数据库-系统-窗口外观图形)
  79. #    然后根据该窗口Skin制作对话框尾部使用的两个箭头图形
  80. #    尾部箭头图形命名方式:“窗口skin名-top”,“窗口skin名-under”
  81. #    将该图形文件存放在“Graphics/Windowskins”文件夹下。
  82. #
  83. #    本演示游戏内置2套窗口和箭头图形,
  84. #    一套是游戏默认的“001-Blue01”,一套是定制的“fk”
  85. #    玩家可以根据自己的需要参照样本定制自己的呼出对话框窗口Skin。
  86. #
  87. #    ●呼出对话框使用方法
  88. #
  89. #    在事件命令行使用[脚本]将事件ID代入[$mes_id]
  90. #    该事件就可以使用呼出对话框了。
  91. #   (举例:$mes_id=4)
  92. #
  93. #    ID 代入 -1 表示玩家,代入 0 表示事件自身。
  94. #    代入 nil 或者 "" 则返回成通常的信息窗口。
  95. #    对话框的表示位置可以通过事件的“更改文章选项”来设定(上、中、下)。
  96. #    表示位置为“中央”的话,不管事件位置在哪里,对话框都将显示在画面中央。
  97. #
  98. #    ●角色名字窗口的使用文字的方法
  99. #
  100. #    在事件命令行使用[脚本]将文字列代入[$mes_name]
  101. #    对话框就会显示角色名字窗口
  102. #   (举例:$mes_name="阿尔西斯")
  103. #    代入 nil 或者 "" 则不显示角色名字窗口。
  104. #
  105. #    以上两个机能是独立的,所以可以单独使用
  106. #
  107. #   $mes_id=(ID) + $mes_name="名字"  :呼出对话框显示 + 角色名字窗口
  108. #   $mes_id=(ID) + $mes_name=""      :呼出对话框显示(没有角色名字)
  109. #   $mes_id=nil  + $mes_name="名字"  :默认信息窗口 + 角色名字窗口
  110. #   $mes_id=nil  + $mes_name=""      :默认信息窗口(没有角色名字)
  111. #
  112. #    ●角色名字窗口使用角色图片的方法(汉化特别追加功能,原脚本只能使用文字)
  113. #   
  114. #    如果能在对应文件夹中找到文件名和角色名字相同的图片,   
  115. #    则角色名字窗口显示角色头像图片,角色图片最好能包括角色的名字。
  116. #    默认头像图片保存目录为“Graphics/Heads/”,玩家可自行修改。
  117. #
  118. #    如果不想使用角色名字直接作为头像文件名。
  119. #    可以使用下面在 Game_Temp 类里增加的namebmp属性。
  120. #    重新设定角色名字与文件名的对应关系。
  121. #
  122. #    ●信息表示速度的变更方法
  123. #
  124. #    在事件命令行使用[脚本]将数值代入[$mes_speed]
  125. #    速度为 0 即瞬间显示全部信息,数字越大,信息表示速度越慢。
  126. #   (举例:$mes_speed=1)
  127. #
  128. #    ●其他设置
  129. #
  130. #    请参照下面的注释
  131. #
  132. #    补一句,用脚本chat(id,"名字")就相当于$mes_id=ID;$mes_name="名字"
  133. #==============================================================================

  134. module FUKI

  135. # 头像图片保存目录的设定
  136. HEAD_PIC_DIR = "Graphics/Heads/"

  137. # 是否显示尾部图标
  138. TAIL_SHOW = true

  139. # Skin的设定
  140. # 使用数据库默认窗口Skin情况下这里使用[""]
  141. FUKI_SKIN_NAME = ""   # 呼出对话框用Skin
  142. NAME_SKIN_NAME = ""   # 角色名字窗口用Skin

  143. # 字体大小
  144. MES_FONT_SIZE = 22    # 呼出对话框
  145. NAME_FONT_SIZE = 18   # 角色名字窗口

  146. # 字体颜色
  147. #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  148. FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框
  149. NAME_COLOR = Color.new(0, 0, 0, 0)  # 角色名字窗口

  150. # 窗口透明度
  151. # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  152. FUKI_OPACITY = 255    # 呼出对话框
  153. MES_OPACITY = 255     # 默认信息窗口
  154. NAME_OPACITY = 255    # 角色名字窗口

  155. # 角色名字窗口的相对位置
  156. NAME_SHIFT_X = 0      # 横坐标
  157. NAME_SHIFT_Y = 16     # 纵坐标

  158. # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  159. # 自动改变位置( true / false )
  160. # 设置成 true 可能出现箭头图标颠倒的问题 <- bbschat
  161. POS_FIX = false

  162. # 在画面最边缘表示时的稍微挪动
  163. # 使用圆形Skin的角和方框的角重合的情况下为 true
  164. CORNER_SHIFT = false
  165. SHIFT_PIXEL = 4   # true 时挪动的象素

  166. # 角色高度尺寸
  167. CHARACTOR_HEIGHT = 48
  168. # 呼出对话框的相对位置(纵坐标)
  169. POP_SHIFT_TOP = 0         # 表示位置为上的时候
  170. POP_SHIFT_UNDER = 0       # 表示位置为下的时候

  171. # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  172. # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  173. MES_SPEED = 1

  174. end

  175. #==============================================================================
  176. # 方便用户同时设置2个常用参数而使用的函数
  177. #==============================================================================
  178. def chat(id = 0,name = "")
  179. $mes_id = id
  180. $mes_name = name
  181. end

  182. #==============================================================================
  183. # □ Game_Temp
  184. #==============================================================================

  185. class Game_Temp
  186. attr_accessor  :namebmp              #保存头像图片的Hash表
  187. alias initialize_fuki initialize
  188. def initialize
  189.   initialize_fuki
  190.   # 如果不想使用角色名字直接作为头像文件名
  191.   # 可在这里重新设定角色名字与文件名的对应关系
  192. @namebmp ={"作者"=>"Author",
  193. #【一】现代人物
  194. "主角普通"=>"zj01", "主角吃惊"=>"zj02", "主角愤怒"=>"zj03", "主角着急"=>"zj04","主角微笑"=>"zj05","主角坏笑"=>"zj06","主角平淡"=>"zj07","主角思考"=>"zj08","主角奸笑"=>"zj09",

  195. "李林普通"=>"zjA01", "李林吃惊"=>"zjA02", "李林愤怒"=>"zjA03", "李林着急"=>"zjA04","李林微笑"=>"zjA05","李林坏笑"=>"zjA06","李林平淡"=>"zjA07","李林思考"=>"zjA08","李林奸笑"=>"zjA09",

  196. "李林影子"=>"zjShadow",
  197. #————————————————————————————————————————————————————————————————
  198. "林宇豪"=>"lyh01","林宇豪愤怒"=>"lyh02","林宇豪窘迫"=>"lyh03","林宇豪高兴"=>"lyh04","林宇豪思考"=>"lyh05","林宇豪害羞"=>"lyh06",

  199. "罗迪克"=>"ldk","罗迪克愤怒"=>"ldk02","罗迪克尴尬"=>"ldk03","罗迪克窘迫"=>"ldk04","罗迪克吃惊"=>"ldk05","罗迪克忍耐"=>"ldk06",

  200. "马致远"=>"mzy01","马致远愤怒"=>"mzy02","马致远吃惊"=>"mzy03","马致远沉默"=>"mzy04","马致远头晕"=>"mzy05","马致远严肃"=>"mzy06","马致远大义"=>"mzy07",
  201. #————————————————————————————————————————————————————————————————
  202. "塞蕾娜普通"=>"Athena01","塞蕾娜伤感"=>"Athena02","塞蕾娜愤怒"=>"Athena03","塞蕾娜吃惊"=>"Athena04","塞蕾娜微笑"=>"Athena05","塞蕾娜思考"=>"Athena06","塞蕾娜哭泣"=>"Athena07","塞蕾娜坏笑"=>"Athena08","塞蕾娜高傲"=>"Athena09",

  203. "杨雪婷普通"=>"Zela01","杨雪婷绝望"=>"Zela02","杨雪婷吃惊"=>"Zela03","杨雪婷严肃"=>"Zela04","杨雪婷愤怒"=>"Zela05","杨雪婷沉默"=>"Zela06","杨雪婷哭泣"=>"Zela07",
  204. #————————————————————————————————————————————————————————————————
  205. "施蕾"=>"sl01","施蕾愤怒"=>"sl02","施蕾受伤"=>"sl03","施蕾严肃"=>"sl04","施蕾高兴"=>"sl05",
  206. "林凯丰"=>"lkf01","林凯丰严肃"=>"lkf02","林凯丰吃惊"=>"lkf03","林凯丰闭目"=>"lkf04","林凯丰怒吼"=>"lkf05","林凯丰魔化"=>"lkf06",
  207. "施月华"=>"syh01","施月华失神"=>"syh02",
  208. "徐欣菡"=>"xxh01","徐欣菡生气"=>"xxh02","徐欣菡吃惊"=>"xxh03","徐欣菡高兴"=>"xxh04","徐欣菡痛苦"=>"xxh05",
  209. #————————————————————————————————————————————————————————————————
  210. #路人专区
  211. "张光辉"=>"Tx01","刘楠"=>"Tx02","生物老头"=>"swlt","刘德勋"=>"gt01","警长"=>"PoA","警卫"=>"PoB","拉尔夫"=>"RALF","克拉克"=>"CLARK",

  212. "张帆普通"=>"ZF01","主角祖父"=>"grandpa01","祖父逝世"=>"grandpa02",

  213. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  214. # 【二】新世界人物:
  215. #<一> 人类通用版
  216. "蒙面人A"=>"MysticPeople01",

  217. "影子A"=>"ShadowA","影子B"=>"ShadowB","影子C"=>"ShadowC","影子D"=>"ShadowD",

  218. "人类杂兵A"=>"Soldier01","人类杂兵B"=>"Soldier02","人类杂兵C"=>"Soldier03","人类杂兵D"=>"Soldier04",

  219. "路人01"=>"Passerby01",

  220. "老将军"=>"General01",

  221. #<二> 基里亚斯中立国
  222. "Saber普通"=>"Saber01","Saber吃惊"=>"Saber02","Saber暴怒"=>"Saber03","Saber微笑"=>"Saber04","Saber无语"=>"Saber05","Saber严肃"=>"Saber06","Saber紧张"=>"Saber07","Saber坏笑"=>"Saber08","Saber忧愁"=>"Saber09","Saber害羞"=>"Saber10","Saber低头"=>"Saber11","Saber受伤"=>"Saber12","Saber认真"=>"Saber13","Saber重伤"=>"Saber14",
  223. #————————————————————————————————————————————————————————————————
  224. "克莉丝汀"=>"Christine01","克莉丝汀严肃"=>"Christine02","克莉丝汀奸笑"=>"Christine03","克莉丝汀高兴"=>"Christine04",
  225. #————————————————————————————————————————————————————————————————
  226. "凯瑟琳"=>"Queen01","玛莉安"=>"Marian",

  227. "安东尼"=>"Anthony","安东尼严肃"=>"Anthony01","安东尼受伤"=>"Anthony02","安东尼吃惊"=>"Anthony03","安东尼奸笑"=>"Anthony04",

  228. "亚德里安"=>"Adrian",

  229. "耶鲁夫普通"=>"Yerov01","耶鲁夫流汗"=>"Yerov02","耶鲁夫吃惊"=>"Yerov03",
  230. #<三> 斯巴达王国
  231. "伊诺克"=>"Enoch",
  232. "威廉"=>"William01","威廉严肃"=>"William02","威廉愤怒"=>"William03",

  233. "巴诺"=>"Barlow",

  234. "黛娜"=>"Dana",


  235. #<四> 斯图亚特神圣帝国

  236. #天启骑士————————————————————————————————————————————————————————————————
  237. "贝克"=>"Beck","亨利"=>"Henry","艾维斯"=>"Ives",

  238. "林恩"=>"Lynn01","林恩思考"=>"Lynn02","林恩呵斥"=>"Lynn03",

  239. "安德鲁"=>"Andrew01","安德鲁愤怒"=>"Andrew02","安德鲁吃惊"=>"Andrew03","安德鲁痛苦"=>"Andrew04","安德鲁不屑"=>"Andrew05",

  240. #教会————————————————————————————————————————————————————————————————

  241. "安德莉亚"=>"Audrey00","安德莉亚愤怒"=>"Audrey01",


  242. #<五> 沙漠帝国
  243. "多娜"=>"Dora01","多娜愤怒"=>"Dora02","多娜吃惊"=>"Dora03","多娜消沉"=>"Dora04","多娜冥想"=>"Dora05","多娜痛苦"=>"Dora06",

  244. #路人专区
  245. "古忆梅"=>"GYM",

  246. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

  247. #  【三】诸神

  248. #<一> 通用人物
  249. "魔界士兵A"=>"txzs",


  250. #<二> 神界
  251. "米迦勒"=>"Michael","帕斯卡"=>"psk","路西法"=>"Lucifer","雅典娜"=>"Athena00","雅典娜凡人"=>"Athena",

  252. "迷之女性"=>"MysticWoman",
  253. #<三> 魔界

  254. "巴尔贝雷特"=>"Balberith","多玛"=>"Douma","苏略尔"=>"Surie0l","苏略尔眼罩"=>"Surie02","默菲斯托菲里斯"=>"Mephostophilis","罗斯佛格"=>"Lucifuge ","梅利力姆"=>"Melilim","拉哈伯"=>"Rahab",

  255. #<四> 乌托邦

  256. "小碧"=>"Bi","小莎"=>"Sha",


  257. #<五> 其它

  258. "安妮普通"=>"Annie01",

  259. "赫伯特"=>"Herbert01","赫伯特吃惊"=>"Herbert02","赫伯特大惊失色"=>"Herbert03","赫伯特痛苦"=>"Herbert04",

  260. "卡玛"=>"Kama","瓦伦汀娜"=>"Valentina",
  261. #<六> 吸血鬼

  262. "尼禄"=>"Nero",

  263. #<七> 流亡

  264. "维蕾塔普通"=>"v1","维蕾塔严肃"=>"v2","维蕾塔微笑"=>"v3","维蕾塔吃惊"=>"v4","维蕾塔愤怒"=>"v5","维蕾塔伤心"=>"v6","维蕾塔难堪"=>"v7","维蕾塔无语"=>"v8","维蕾塔伤感"=>"v9",
  265. #————————————————————————————————————————————————————————————————
  266. "莉莉丝普通"=>"Eva01","莉莉丝严肃"=>"Eva02","莉莉丝愤怒"=>"Eva03","莉莉丝吃惊"=>"Eva04","莉莉丝伤心"=>"Eva05","莉莉丝奸笑"=>"Eva06",
  267. #————————————————————————————————————————————————————————————————
  268. "阿斯拉"=>"asl",

  269. "樱常态"=>"Sakura01","樱黑化"=>"Sakura02",

  270. "艾琳"=>"Erin","艾琳思考"=>"Erin2","艾琳愤怒"=>"Erin3","艾琳坏笑"=>"Erin4","艾琳高兴"=>"Erin5","艾琳吃惊"=>"Erin6",

  271. "艾丝特"=>"Geist",
  272. #————————————————————————————————————————————————————————————————


  273. #<七> 路人

  274. "僵尸莉莉"=>"Zombie-A","奥德莉"=>"Audrey","奥德莉人形"=>"Audrey00",

  275. "小次郎"=>"Assassin","斩铁"=>"ZANTETSU","魔化SaberA"=>"blacksaberA","魔化SaberB"=>"blacksaberB","英雄王"=>"Gilgamesh",
  276. }

  277. end
  278. end
  279. #==============================================================================
  280. # □ Game_System
  281. #==============================================================================
  282. class Game_System
  283. attr_accessor :typing
  284. attr_accessor :soundname_on_speak
  285. alias carol3_ini initialize
  286. def initialize
  287.   carol3_ini
  288.   @typing = true
  289.   @soundname_on_speak = nil
  290. end
  291. end
  292. #==============================================================================
  293. # □ Window_FukiMessage
  294. #==============================================================================

  295. class Window_FukiMessage < Window_Selectable

  296. #--------------------------------------------------------------------------
  297. # ● 初始化状态
  298. #--------------------------------------------------------------------------
  299. def initialize
  300.   super(80, 304, 480, 160)
  301.   self.contents = Bitmap.new(width - 32, height - 32)
  302.   self.visible = false
  303.   self.z = 9998
  304.   @fade_in = false
  305.   @fade_out = false
  306.   @contents_showing = false
  307.   @cursor_width = 0
  308.   self.active = false
  309.   self.index = -1
  310.   #........................................................................
  311.   if $game_system.soundname_on_speak == nil then
  312.     $game_system.soundname_on_speak = ""
  313.   end
  314.   @opacity_text_buf = Bitmap.new(32, 32)
  315.   #........................................................................
  316.   @w = 0
  317.   @h = 0
  318.   @wait = 0
  319.   @dx = 0
  320.   @dy = 0
  321.   $mes_speed = FUKI::MES_SPEED
  322. end

  323. #--------------------------------------------------------------------------
  324. # ○ 决定窗口尺寸并生成窗口
  325. #--------------------------------------------------------------------------
  326. def refresh_create
  327.   self.contents.clear
  328.   self.contents.font.color = normal_color
  329.   self.contents.font.size = FUKI::MES_FONT_SIZE
  330.   # 取得窗口尺寸
  331.   get_windowsize
  332.   w = @w + 32 + 8
  333.   h = @h * (self.contents.font.size + 10) + 26
  334.   # 生成呼出窗口
  335.   set_fukidasi(self.x, self.y, w, h)
  336.   # 生成角色名字窗口
  337.   set_namewindow
  338.   # 初始化信息表示使用的变量
  339.   @dx = @dy = 0
  340.   @cursor_width = 0
  341.   @contents_drawing = true
  342.   # 瞬间表示的情况下
  343.   if $mes_speed == 0
  344.     # 循环信息描绘处理
  345.     while $game_temp.message_text != ""
  346.       draw_massage
  347.     end
  348.     draw_opt_text
  349.     @contents_showing_end = true
  350.     @contents_drawing = false
  351.   else
  352.     # 一个一个描绘文字
  353.     refresh_drawtext
  354.   end
  355. end

  356. #--------------------------------------------------------------------------
  357. # ○ 一个一个描绘文字
  358. #--------------------------------------------------------------------------
  359. def refresh_drawtext
  360.   #........................................................................
  361.   if Input.trigger?(Input::C) and $game_switches[3]
  362.     # 循环信息描绘处理
  363.     while $game_temp.message_text != ""
  364.       draw_massage
  365.     end
  366.     draw_opt_text
  367.     @contents_showing_end = true
  368.     @contents_drawing = false
  369.   end
  370.   #........................................................................
  371.   if $game_temp.message_text != nil
  372.     if @wait > 0
  373.       @wait -= 1
  374.     elsif @wait == 0
  375.       # 描绘处理
  376.       draw_massage
  377.       @wait = $mes_speed
  378.     end
  379.   end
  380.   # 描绘结束
  381.   if $game_temp.message_text == ""
  382.     draw_opt_text
  383.     @contents_showing_end = true
  384.     @contents_drawing = false
  385.   end
  386. end

  387. #--------------------------------------------------------------------------
  388. # ○ 66rpg-refresh
  389. #--------------------------------------------------------------------------
  390. def refresh
  391.    # 初期化
  392.    self.contents.clear
  393.    self.contents.font.color = normal_color
  394.    self.contents.font.size = Font.default_size
  395.    @x = @y = @max_x = @max_y = @indent = @lines = 0
  396.    @left_keep = @right_keep = false
  397.    @face_indent = 0
  398.    @opacity = 255
  399.    @cursor_width = 0
  400.    @write_speed = 0
  401.    @write_wait = 0
  402.    @mid_stop = false
  403.    @face_file = nil
  404.    @popchar = -2
  405.    if $game_temp.choice_start == 0
  406.      @x = 8
  407.    end
  408.    if $game_temp.message_text != nil
  409.      @now_text = $game_temp.message_text
  410.      #——头像设置
  411.      if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
  412.        @face_file = $1 + ".png"
  413.        @x = @face_indent = 128
  414.        if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  415.          self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  416.        end
  417.        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
  418.      end
  419.      #——左半身像设置
  420.      if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  421.        @face = "66rpg_" + $1 + "_h.png"
  422.        if $加密 == true
  423.          if @left_picture != nil
  424.            @left_picture.dispose
  425.          end
  426.          @left_picture = Sprite.new
  427.          @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  428.          @left_picture.y = 480-@left_picture.bitmap.height
  429.          @left_picture.x = 0
  430.          @left_picture.mirror = true
  431.          @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  432.        else         
  433.          if FileTest.exist?("Graphics/battlers/#{@face}")
  434.            if @left_picture != nil
  435.              @left_picture.dispose
  436.            end
  437.            @left_picture = Sprite.new
  438.            @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  439.            @left_picture.y = 480-@left_picture.bitmap.height
  440.            @left_picture.x = 0
  441.            @left_picture.mirror = true
  442.            @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  443.          end
  444.        end        
  445.      end
  446.      #——右半身像设置
  447.      if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  448.        @face = "66rpg_" + $1 + "_h.png"
  449.        if $加密 == true
  450.          if @right_picture != nil
  451.            @right_picture.dispose
  452.          end
  453.          @right_picture = Sprite.new
  454.          @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  455.          @right_picture.y = 480-@right_picture.bitmap.height
  456.          @right_picture.x = 640-@right_picture.bitmap.width
  457.          @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  458.        else
  459.          if FileTest.exist?("Graphics/battlers/#{@face}")
  460.            if @right_picture != nil
  461.              @right_picture.dispose
  462.            end
  463.            @right_picture = Sprite.new
  464.            @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  465.            @right_picture.y = 480-@right_picture.bitmap.height
  466.            @right_picture.x = 640-@right_picture.bitmap.width
  467.            @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  468.          end
  469.        end
  470.      end
  471.      if (/\\[Rr]k/.match(@now_text)) != nil
  472.        @right_keep = true
  473.        @now_text.sub!(/\\[Rr]k/) { "" }
  474.      end
  475.      if (/\\[Ll]k/.match(@now_text)) != nil
  476.        @left_keep = true
  477.        @now_text.sub!(/\\[Ll]k/) { "" }
  478.      end
  479.      # 显示人物姓名
  480.      name_window_set = false
  481.      if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  482.        name_window_set = true
  483.        name_text = $1
  484.        @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  485.      end
  486.      
  487.      # 文字位置的判定
  488.      if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  489.        @popchar = $1.to_i
  490.        if @popchar == -1
  491.          @x = @indent = 48
  492.          @y = 4
  493.        end
  494.        @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  495.      end
  496.      
  497.      # 开始
  498.      begin
  499.        last_text = @now_text.clone
  500.        @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  501.      end until @now_text == last_text
  502.      @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  503.      $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  504.    end
  505.    @now_text.gsub!(/\\\\/) { "\000" }
  506.    @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  507.    @now_text.gsub!(/\\[Gg]/) { "\002" }
  508.    @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  509.    @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  510.    @now_text.gsub!(/\\[.]/) { "\005" }
  511.    @now_text.gsub!(/\\[|]/) { "\006" }

  512.    @now_text.gsub!(/\\[>]/) { "\016" }
  513.    @now_text.gsub!(/\\[<]/) { "\017" }
  514.    @now_text.gsub!(/\\[!]/) { "\020" }
  515.    @now_text.gsub!(/\\[~]/) { "\021" }
  516.    
  517.    @now_text.gsub!(/\\[Ii]/) { "\023" }
  518.    @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  519.    @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  520.    @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  521.    @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  522.    if @popchar >= 0
  523.      @text_save = @now_text.clone
  524.      @max_x = 0
  525.      @max_y = 4
  526.      for i in 0..3
  527.        line = @now_text.split(/\n/)[3-i]
  528.        @max_y -= 1 if line == nil and @max_y <= 4-i
  529.        next if line == nil
  530.        cx = contents.text_size(line).width
  531.        @max_x = cx if cx > @max_x
  532.      end
  533.      self.width = @max_x + 48 + @face_indent
  534.      self.height = (@max_y - 1) * 32 + 64
  535.    else
  536.      @max_x = self.width - 32 - @face_indent
  537.    end
  538.    reset_window
  539.      if name_window_set
  540.        off_x = 0
  541.        off_y = -40
  542.        space = 2
  543.        x = self.x + off_x - space / 2
  544.        y = self.y + off_y - space / 2
  545.        w = self.contents.text_size(name_text).width + 26 + space
  546.        h = 40 + space
  547.        @name_window_frame = Window_Frame.new(x, y, w, h)
  548.        @name_window_frame.z = self.z + 1
  549.        x = self.x + off_x + 4
  550.        y = self.y + off_y
  551.        @name_window_text = Air_Text.new(x+4, y+6, name_text)
  552.        @name_window_text.z = self.z + 2
  553.      end
  554.    end
  555.    reset_window
  556.    if $game_temp.choice_max > 0
  557.      @item_max = $game_temp.choice_max
  558.      self.active = true
  559.      self.index = 0
  560.    end
  561.    if $game_temp.num_input_variable_id > 0
  562.      digits_max = $game_temp.num_input_digits_max
  563.      number = $game_variables[$game_temp.num_input_variable_id]
  564.      @input_number_window = Window_InputNumber.new(digits_max)
  565.      @input_number_window.number = number
  566.      @input_number_window.x = self.x + 8
  567.      @input_number_window.y = self.y + $game_temp.num_input_start * 32
  568.    end
  569. end



  570. #==============================================================================
  571. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  572. #==============================================================================
  573. class Window_Frame < Window_Base
  574. #--------------------------------------------------------------------------
  575. # ● オブジェクト初期化
  576. #--------------------------------------------------------------------------
  577. def initialize(x, y, width, height)
  578.   super(x, y, width, height)
  579.   self.contents = nil
  580.   self.back_opacity = 100
  581. end
  582. #--------------------------------------------------------------------------
  583. # ● 解放
  584. #--------------------------------------------------------------------------
  585. def dispose
  586.   super
  587. end
  588. end

  589. #==============================================================================
  590. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  591. #==============================================================================
  592. class Air_Text < Window_Base
  593. #--------------------------------------------------------------------------
  594. # ● オブジェクト初期化
  595. #--------------------------------------------------------------------------
  596. def initialize(x, y, designate_text)
  597.    super(x-16, y-16, 32 + designate_text.size * 12, 56)
  598.    self.opacity = 0
  599.    self.back_opacity = 0
  600.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  601.    w = self.contents.width
  602.    h = self.contents.height
  603.    self.contents.draw_text(0, 0, w, h, designate_text)
  604. end
  605. #--------------------------------------------------------------------------
  606. # ● 解放
  607. #--------------------------------------------------------------------------
  608. def dispose
  609.    self.contents.clear
  610.    super
  611. end
  612. end


  613. #--------------------------------------------------------------------------
  614. # ○ 取得窗口尺寸
  615. #--------------------------------------------------------------------------
  616. def get_windowsize
  617.   x = y = 0
  618.   @h = @w = 0
  619.   @cursor_width = 0
  620.   # 有选择项的话,处理字的缩进
  621.   if $game_temp.choice_start == 0
  622.     x = 16
  623.   end
  624.   # 有等待显示的文字的情况下
  625.   if $game_temp.message_text != nil
  626.   text = $game_temp.message_text.clone
  627.     # 限制文字处理
  628.     begin
  629.       last_text = text.clone
  630.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  631.     end until text == last_text
  632.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  633.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  634.     end
  635.     # 为了方便、将 "\\\\" 变换为 "\000"
  636.     text.gsub!(/\\\\/) { "\000" }
  637.     # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  638.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  639.     text.gsub!(/\\[Gg]/) { "\002" }
  640.     # c 获取 1 个字 (如果不能取得文字就循环)
  641.     while ((c = text.slice!(/./m)) != nil)
  642.       # \\ 的情况下
  643.       if c == "\000"
  644.         # 还原为本来的文字
  645.         c = "\\"
  646.       end
  647.       # \C[n] 或者 \G 的情况下
  648.       if c == "\001" or c == "\002"
  649.         # 下面的文字
  650.         next
  651.       end
  652.       # 另起一行文字的情况下
  653.       if c == "\n"
  654.         # y 累加 1
  655.         y += 1
  656.         # 取得纵横尺寸
  657.         @h = y
  658.         @w = x > @w ? x : @w
  659.         if y >= $game_temp.choice_start
  660.           @w = x + 8 > @w ? x + 8 : @w
  661.         end
  662.         x = 0
  663.         # 移动到选择项的下一行
  664.         if y >= $game_temp.choice_start
  665.           x = 8
  666.         end
  667.         # 下面的文字
  668.         next
  669.       end
  670.       # x 为要描绘文字的宽度加法运算
  671.       x += self.contents.text_size(c).width
  672.     end
  673.   end
  674.   # 输入数值的情况
  675.   if $game_temp.num_input_variable_id > 0
  676.     digits_max = $game_temp.num_input_digits_max
  677.     number = $game_variables[$game_temp.num_input_variable_id]
  678.     @h += 1
  679.     x = digits_max * self.contents.font.size + 16
  680.     @w = x > @w ? x : @w
  681.   end
  682. end

  683. #--------------------------------------------------------------------------
  684. # ○ 描绘信息处理
  685. #--------------------------------------------------------------------------
  686. def draw_massage
  687.   # 有等待显示的文字的情况下
  688.   if $game_temp.message_text != nil
  689.     text = $game_temp.message_text
  690.     # 限制文字处理
  691.     begin
  692.       last_text = text.clone
  693.       text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  694.     end until text == last_text
  695.     text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  696.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  697.     end
  698.     # 为了方便、将 "\\\\" 变换为 "\000"
  699.     text.gsub!(/\\\\/) { "\000" }
  700.     # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  701.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  702.     text.gsub!(/\\[Gg]/) { "\002" }
  703.     # c 获取 1 个字
  704.     if ((c = text.slice!(/./m)) != nil)
  705.       # 选择项的情况
  706.       if @dy >= $game_temp.choice_start
  707.         # 处理字的缩进
  708.         @dx = 8
  709.         # 描绘文字      
  710.         self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  711.         # x 为要描绘文字宽度的加法运算
  712.         @dx += self.contents.text_size(c).width
  713.         # 循环
  714.         while ((c = text.slice!(/./m)) != "\n")
  715.           # 描绘文字
  716.         self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  717.           # x 为要描绘文字宽度的加法运算
  718.           @dx += self.contents.text_size(c).width
  719.         end
  720.         if c == "\n"
  721.           # 更新光标宽度
  722.           @cursor_width = [@cursor_width, @dx].max
  723.           # dy 累加 1
  724.           @dy += 1
  725.           @dx = 0
  726.         end
  727.         return
  728.       end
  729.       # \\ 的情况下
  730.       if c == "\000"
  731.         # 还原为本来的文字
  732.         c = "\\"
  733.       end
  734.       #\C[n] 的情况下
  735.       if c == "\001"
  736.         # 更改文字色
  737.         text.sub!(/\[([0-9]+)\]/, "")
  738.         color = $1.to_i
  739.         if color >= 0 and color <= 7
  740.           self.contents.font.color = text_color(color)
  741.         end
  742.       end
  743.       # \G 的情况下
  744.       if c == "\002"
  745.         # 生成金钱窗口
  746.         if @gold_window == nil
  747.           @gold_window = Window_Gold.new
  748.           @gold_window.x = 560 - @gold_window.width
  749.           if $game_temp.in_battle
  750.             @gold_window.y = 192
  751.           else
  752.             @gold_window.y = self.y >= 128 ? 32 : 384
  753.           end
  754.           @gold_window.opacity = self.opacity
  755.           @gold_window.back_opacity = self.back_opacity
  756.         end
  757.       end
  758.       # 另起一行文字的情况下
  759.       if c == "\n"
  760.         # dy 累加 1
  761.         @dy += 1
  762.         @dx = 0
  763.       end
  764.       # 描绘文字
  765.       self.contents.font.size = FUKI::MES_FONT_SIZE
  766.       font_size = self.contents.font.size
  767.           if c == "\001" or c == "\002" or c == "\003" or c == "\n"
  768.         c = ""
  769.       else
  770.         self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)
  771.       end
  772.       # dx 为要描绘文字的宽度加法运算
  773.       @dx += self.contents.text_size(c).width
  774.     end
  775.   end
  776. end

  777. #--------------------------------------------------------------------------
  778. # ○ 选择项和输入数值的情况下
  779. #--------------------------------------------------------------------------
  780. def draw_opt_text
  781.   # 选择项的情况下
  782.   if $game_temp.choice_max > 0
  783.     @item_max = $game_temp.choice_max
  784.     self.active = true
  785.     self.index = 0
  786.   end
  787.   # 输入数值的情况下
  788.   if $game_temp.num_input_variable_id > 0
  789.     digits_max = $game_temp.num_input_digits_max
  790.     number = $game_variables[$game_temp.num_input_variable_id]
  791.     @input_number_window = Window_InputNumber.new(digits_max)
  792.     @input_number_window.number = number
  793.     @input_number_window.x = self.x + 8
  794.     @input_number_window.y = self.y + $game_temp.num_input_start * 32
  795.   end
  796. end

  797. #--------------------------------------------------------------------------
  798. # ○ 设置呼出对话框
  799. #--------------------------------------------------------------------------
  800. def set_fukidasi(x, y, width, height)
  801.   # $mes_id 为空的时候,不显示呼出对话框
  802.   if $mes_id == nil or $mes_id == ""
  803.     del_fukidasi
  804.     reset_window
  805.   else
  806.     # 不显示暂停标志
  807.     self.pause = false
  808.     # 取得对话框位置
  809.     pos = get_fuki_pos(width, height)
  810.     x = pos[0]
  811.     y = pos[1]
  812.     skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  813.     # 生成呼出对话框
  814.     self.windowskin = RPG::Cache.windowskin(skin)
  815.     self.x = x
  816.     self.y = y
  817.     self.height = height
  818.     self.width = width
  819.     self.contents.dispose
  820.     self.contents = Bitmap.new(width - 32, height - 32)
  821.     self.back_opacity = FUKI::FUKI_OPACITY
  822.     self.contents.clear
  823.     self.contents.font.color = normal_color
  824.     self.contents.font.size = FUKI::MES_FONT_SIZE
  825.     # 描绘尾部图标
  826.     if $game_system.message_frame == 0
  827.       # 取得位置
  828.       tale_pos = get_tale_pos
  829.       @tale = Sprite.new
  830.       # 是否显示尾部图标 <- bbschat
  831.       if FUKI::TAIL_SHOW == true
  832.         case @message_position
  833.           when 0  # 上
  834.             @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  835.             @tale.x = tale_pos[0]
  836.             @tale.y = tale_pos[1]
  837.             @tale.z = self.z + 1
  838.           when 1  # 中
  839.             @tale.dispose
  840.             @tale = nil
  841.           when 2  # 下
  842.             @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  843.             @tale.x = tale_pos[0]
  844.             @tale.y = tale_pos[1]
  845.             @tale.z = self.z + 1
  846.         end
  847.       end
  848.     end
  849.   end
  850. end

  851. #--------------------------------------------------------------------------
  852. # ○ 计算呼出对话框的位置
  853. #--------------------------------------------------------------------------
  854. def get_fuki_pos(width, height)
  855.   
  856.   # 取得角色
  857.   @character = get_character($mes_id)
  858.   if @character == nil
  859.     # 角色不存在的情况下使用默认信息框
  860.     del_fukidasi
  861.     reset_window
  862.     return
  863.   end
  864.   # 处理坐标
  865.   x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  866.   # 为尽量显示在画面内而移动横坐标
  867.   if x + width > 640
  868.     x = 640 - width
  869.   elsif x < 0
  870.     x = 0
  871.   end
  872.   # 决定窗口位置
  873.   case $game_system.message_position
  874.     when 0  # 上
  875.       y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  876.     when 1  # 中
  877.       y = (480 - height) / 2
  878.       x = (640 - width) / 2
  879.     when 2  # 下
  880.       y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  881.   end
  882.   # 纪录文章显示位置
  883.   @message_position = $game_system.message_position
  884.   # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  885.   if FUKI::POS_FIX
  886.     case @message_position
  887.       when 0  # 上
  888.         if y <= 0
  889.           @message_position = 2
  890.           y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  891.         end
  892.       when 2  # 下
  893.         if y + height >= 480
  894.           p "上"
  895.           @message_position = 0
  896.           y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  897.         end
  898.     end
  899.   end
  900.   return [x,y]
  901.   
  902. end

  903. #--------------------------------------------------------------------------
  904. # ○ 计算尾部图标的位置
  905. #--------------------------------------------------------------------------
  906. def get_tale_pos
  907.   case @message_position
  908.     when 0  # 上
  909.       # 处理坐标
  910.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  911.       # 画面边缘的话则移动位置
  912.       if FUKI::CORNER_SHIFT
  913.         if x == 0
  914.           x = FUKI::SHIFT_PIXEL
  915.         elsif x == 640 - 32
  916.           x = 640 - 32 - FUKI::SHIFT_PIXEL
  917.         end
  918.       end
  919.       y = self.y + self.height - 16
  920.     when 1  # 中
  921.       x = nil
  922.       y = nil
  923.     when 2  # 下
  924.       # 处理坐标
  925.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  926.       # 画面边缘的话则移动位置
  927.       if FUKI::CORNER_SHIFT
  928.         if x == 0
  929.           x = FUKI::SHIFT_PIXEL
  930.         elsif @tale.x == 640 - 32
  931.           x = 640 - 32 - FUKI::SHIFT_PIXEL
  932.         end
  933.       end
  934.       y = self.y - 16
  935.   end
  936.   return [x,y]
  937. end

  938. #--------------------------------------------------------------------------
  939. # ○ 计算名字窗口的位置
  940. #--------------------------------------------------------------------------
  941. def get_name_pos
  942.   case @face_pic_txt
  943.     when 0  # 文字
  944.       x = self.x + FUKI::NAME_SHIFT_X
  945.       y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  946.     when 1  # 图片
  947.       if self.x >= @pic_width + 5
  948.         # 默认头像显示在对话框左边
  949.         x = self.x-@pic_width-5
  950.       else
  951.         # 对话框左边放不下时头像显示在右边
  952.         x = self.x + self.width
  953.       end
  954.       y = self.y+self.height/2 - (@pic_height + 5)/2
  955.     end

  956.   return [x,y]
  957. end
  958. #--------------------------------------------------------------------------
  959. # ○ 设置角色名字窗口
  960. #--------------------------------------------------------------------------
  961. def set_namewindow
  962.   
  963.   # $mes_name为空时不显示角色名字窗口
  964.   if $mes_name == nil or $mes_name == ""
  965.     return
  966.   else
  967.     # 设定变量
  968.     mes_name = $mes_name
  969.     skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  970.    
  971.     #判断名称是否有对应的图片"Graphics/heads/" +
  972.     if $game_temp.namebmp[mes_name] == nil then
  973.       sFile = "Graphics/heads/" + mes_name + ".png"
  974.     else
  975.       sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".png"
  976.     end
  977.    
  978.     if FileTest.exist?(sFile) == true then
  979.       
  980.       @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  981.       
  982.       # 生成头像
  983.       bmp = Bitmap.new(sFile)
  984.       @pic_width = bmp.width
  985.       @pic_height = bmp.height
  986.       
  987.       if self.x >= @pic_width + 5
  988.         # 默认头像显示在对话框左边
  989.         name_x = self.x-@pic_width-5
  990.       else
  991.         # 对话框左边放不下时头像显示在右边
  992.         name_x = self.x + self.width
  993.       end
  994.       name_y = self.y+self.height/2 - (@pic_height + 5)/2
  995.       
  996.       # 生成角色头像窗口
  997.       @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  998.       @name_win.windowskin = RPG::Cache.windowskin(skin)
  999.       @name_win.back_opacity =0     
  1000.       @name_win.z =   self.z + 1
  1001.       
  1002.       @name_contents = Sprite.new
  1003.       @name_contents.x = name_x + 2
  1004.       @name_contents.y = name_y + 2
  1005.       @name_contents.bitmap = bmp
  1006.       @name_contents.z = @name_win.z - 1    #这个用了似乎效果不好<- bbschat
  1007.       
  1008.     else
  1009.       
  1010.       @face_pic_txt = 0                       #名字窗口使用文字<- bbschat

  1011.       # 生成名字
  1012.       name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  1013.       name_height = FUKI::NAME_FONT_SIZE
  1014.       name_x = self.x + FUKI::NAME_SHIFT_X
  1015.       name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y

  1016.       # 生成角色名字窗口(只有边框)
  1017.       @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  1018.       @name_win.windowskin = RPG::Cache.windowskin(skin)
  1019.       @name_win.back_opacity = FUKI::NAME_OPACITY
  1020.       @name_win.z = self.z + 1
  1021.       
  1022.       # 为了使空白比Windows类限定的更小使用双重结构
  1023.       @name_contents = Sprite.new
  1024.       @name_contents.x = name_x + 12
  1025.       @name_contents.y = name_y + 8
  1026.       @name_contents.bitmap = Bitmap.new(name_width, name_height)
  1027.       @name_contents.z = @name_win.z + 2
  1028.       
  1029.       # 设定文字色
  1030.       nil_color = Color.new(0,0,0,0)
  1031.       if FUKI::NAME_COLOR != nil_color
  1032.         @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  1033.       else
  1034.         @name_contents.bitmap.font.color = normal_color
  1035.       end
  1036.       @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  1037.       # 调整窗口尺寸
  1038.       rect = @name_contents.bitmap.text_size(mes_name)
  1039.       @name_win.width = rect.width + 32
  1040.       # 描画名字
  1041.       @name_contents.bitmap.draw_text(rect, mes_name)
  1042.     end
  1043.   end

  1044. end

  1045. #--------------------------------------------------------------------------
  1046. # ○ 释放呼出对话框和角色名字窗口
  1047. #--------------------------------------------------------------------------
  1048. def del_fukidasi
  1049.   if @tale != nil
  1050.     @tale.dispose
  1051.     @tale = nil
  1052.   end
  1053.   if @name_win != nil
  1054.     @name_win.dispose
  1055.     @name_win = nil
  1056.     @name_contents.dispose
  1057.     @name_contents = nil
  1058.   end
  1059.   self.opacity = 0
  1060.   self.x = 110
  1061.   self.width = 520
  1062.   self.height = 122
  1063.   self.contents.dispose
  1064.   self.contents = Bitmap.new(width - 32, height - 32)
  1065.   self.pause = true
  1066. end

  1067. #--------------------------------------------------------------------------
  1068. # ○ 取得角色
  1069. #     parameter : 参数
  1070. #--------------------------------------------------------------------------
  1071. def get_character(parameter)
  1072. if $game_switches[2]
  1073.   #........................................................................
  1074.   case parameter
  1075.   when 0
  1076.     return $game_player
  1077.   else
  1078.     events = $game_map.events
  1079.     return events == nil ? nil : events[parameter]
  1080.   end
  1081.   #........................................................................
  1082. else
  1083.   # 参数分歧
  1084.   case parameter
  1085.   when -1  # 玩家
  1086.     return $game_player
  1087.   when 0   # 该事件
  1088.     events = $game_map.events
  1089.     return events == nil ? nil : events[$active_event_id]
  1090.   else     # 特定事件
  1091.    if parameter >0
  1092.      events = $game_map.events
  1093.      return events == nil ? nil : events[parameter]
  1094.    else
  1095.      $game_party.return_char(-parameter-2)
  1096.    end
  1097.   end
  1098. end
  1099. end

  1100. #--------------------------------------------------------------------------
  1101. # ● 设定窗口位置和不透明度
  1102. #--------------------------------------------------------------------------
  1103. def reset_window
  1104. if $game_switches[2]
  1105.    #........................................................................
  1106.    # 判定
  1107.    if @popchar >= 0
  1108.      events = $game_map.events
  1109.      if events != nil
  1110.        character = get_character(@popchar)
  1111.        x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  1112.        y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  1113.        self.x = x
  1114.        self.y = y
  1115.      end
  1116.    elsif @popchar == -1
  1117.      self.x = -4
  1118.      self.y = -4
  1119.      self.width = 648
  1120.      self.height = 488
  1121.    else
  1122.      if $game_temp.in_battle
  1123.        self.y = 16
  1124.      else
  1125.        case $game_system.message_position
  1126.        when 0 # 上
  1127.          self.y = 16
  1128.        when 1 # 中
  1129.          self.y = 160
  1130.        when 2 # 下
  1131.          self.y = 344
  1132.        end
  1133.        self.x = 65
  1134.        if @face_file == nil
  1135.          self.width = 520
  1136.        else
  1137.          self.width = 600
  1138.          self.x -= 60
  1139.        end
  1140.        self.height = 130
  1141.      end
  1142.    end
  1143.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1144.    if @face_file != nil
  1145.      self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  1146.    end
  1147.    if @popchar == -1
  1148.      self.opacity = 255
  1149.      self.back_opacity = 0
  1150.    elsif $game_system.message_frame == 0
  1151.      self.opacity = 255
  1152.      self.back_opacity = 200
  1153.    else
  1154.      self.opacity = 0
  1155.      self.back_opacity = 200
  1156.    end
  1157.    #........................................................................
  1158. else
  1159.   if $game_temp.in_battle
  1160.     self.y = 16
  1161.   else
  1162.     case $game_system.message_position
  1163.     when 0  # 上
  1164.       self.y = 16
  1165.     when 1  # 中
  1166.       self.y = 160
  1167.     when 2  # 下
  1168.       self.y = 344
  1169.     end
  1170.   end
  1171.   if $game_system.message_frame == 0
  1172.     self.opacity = 255
  1173.   else
  1174.     self.opacity = 0
  1175.   end
  1176.   self.back_opacity = FUKI::MES_OPACITY
  1177. end
  1178. end

  1179. #--------------------------------------------------------------------------
  1180. # ● line_height-66rpg
  1181. #--------------------------------------------------------------------------
  1182. # 返回値:行高
  1183. #--------------------------------------------------------------------------
  1184. def line_height
  1185.   return 32
  1186.   if self.contents.font.size >= 20 and self.contents.font.size <= 24
  1187.     return 32
  1188.   else
  1189.     return self.contents.font.size * 15 / 10
  1190.   end
  1191. end
  1192. #--------------------------------------------------------------------------
  1193. # ● \V 变换-66rpg
  1194. #--------------------------------------------------------------------------
  1195. def convart_value(option, index)
  1196.   option == nil ? option = "" : nil
  1197.   option.downcase!
  1198.   case option
  1199.     when "i"
  1200.       unless $data_items[index].name == nil
  1201.         r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  1202.       end
  1203.     when "w"
  1204.       unless $data_weapons[index].name == nil
  1205.         r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  1206.       end
  1207.     when "a"
  1208.       unless $data_armors[index].name == nil
  1209.         r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  1210.       end
  1211.     when "s"
  1212.       unless $data_skills[index].name == nil
  1213.         r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  1214.       end
  1215.     else
  1216.     r = $game_variables[index]
  1217.   end
  1218.   r == nil ? r = "" : nil
  1219.   return r
  1220. end
  1221. #--------------------------------------------------------------------------
  1222. # ● 刷新画面
  1223. #--------------------------------------------------------------------------
  1224. def update
  1225.   if $game_switches[2]
  1226.    #........................................................................
  1227.    super
  1228.    if @fade_in
  1229.      self.contents_opacity += 24
  1230.      if @input_number_window != nil
  1231.        @input_number_window.contents_opacity += 24
  1232.      end
  1233.      if self.contents_opacity == 255
  1234.        @fade_in = false
  1235.      end
  1236.      return
  1237.    end
  1238.    @now_text = nil if @now_text == ""
  1239.    
  1240.    if @now_text != nil and @mid_stop == false
  1241.      if @write_wait > 0
  1242.        @write_wait -= 1
  1243.        return
  1244.      end
  1245.      text_not_skip = $game_system.typing
  1246.      while true
  1247.        @max_x = @x if @max_x < @x
  1248.        @max_y = @y if @max_y < @y
  1249.        if (c = @now_text.slice!(/./m)) != nil
  1250.          if c == "\000"
  1251.            c = "\\"
  1252.          end
  1253.          if c == "\001"
  1254.            @now_text.sub!(/\[([0-9]+)\]/, "")
  1255.            color = $1.to_i
  1256.            if color >= 0 and color <= 7
  1257.              self.contents.font.color = text_color(color)
  1258.            end
  1259.            c = ""
  1260.          end
  1261.          if c == "\002"
  1262.            if @gold_window == nil and @popchar <= 0
  1263.              @gold_window = Window_Gold.new
  1264.              @gold_window.x = 560 - @gold_window.width
  1265.              if $game_temp.in_battle
  1266.                @gold_window.y = 192
  1267.              else
  1268.                @gold_window.y = self.y >= 128 ? 32 : 384
  1269.              end
  1270.              @gold_window.opacity = self.opacity
  1271.              @gold_window.back_opacity = self.back_opacity
  1272.            end
  1273.            c = ""
  1274.          end
  1275.          if c == "\003"
  1276.            @now_text.sub!(/\[([0-9]+)\]/, "")
  1277.            speed = $1.to_i
  1278.            if speed >= 0 and speed <= 19
  1279.              @write_speed = speed
  1280.            end
  1281.            c = ""
  1282.          end
  1283.          if c == "\004"
  1284.            @now_text.sub!(/\[(.*?)\]/, "")
  1285.            buftxt = $1.dup.to_s
  1286.            if buftxt.match(/\//) == nil and buftxt != "" then
  1287.              $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  1288.            else
  1289.              $game_system.soundname_on_speak = buftxt.dup
  1290.            end
  1291.            c = ""
  1292.          elsif c == "\004"
  1293.            c = ""
  1294.          end
  1295.          if c == "\005"
  1296.            @write_wait += 5
  1297.            c = ""
  1298.          end
  1299.          if c == "\006"
  1300.            @write_wait += 20
  1301.            c = ""
  1302.          end
  1303.          if c == "\016"
  1304.            text_not_skip = false
  1305.            c = ""
  1306.          end
  1307.          if c == "\017"
  1308.            text_not_skip = true
  1309.            c = ""
  1310.          end
  1311.          if c == "\020"
  1312.            @mid_stop = true
  1313.            c = ""
  1314.          end
  1315.          if c == "\021"
  1316.            terminate_message
  1317.            return
  1318.          end
  1319.          if c == "\023"
  1320.            @indent = @x
  1321.            c = ""
  1322.          end
  1323.          if c == "\024"
  1324.            @now_text.sub!(/\[([0-9]+)\]/, "")
  1325.            @opacity = $1.to_i
  1326.            c = ""
  1327.          end
  1328.          if c == "\025"
  1329.            @now_text.sub!(/\[([0-9]+)\]/, "")
  1330.            self.contents.font.size = [[$1.to_i, 6].max, 32].min
  1331.            c = ""
  1332.          end
  1333.          if c == "\026"
  1334.            @now_text.sub!(/\[([0-9]+)\]/, "")
  1335.            @x += $1.to_i
  1336.            c = ""
  1337.          end
  1338.          if c == "\027"
  1339.            @now_text.sub!(/\[(.*?)\]/, "")
  1340.            @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  1341.            if $game_system.soundname_on_speak != ""
  1342.              Audio.se_play($game_system.soundname_on_speak)
  1343.            end
  1344.            c = ""
  1345.          end
  1346.          if c == "\030"
  1347.            @now_text.sub!(/\[(.*?)\]/, "")
  1348.            self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  1349.           if $game_system.soundname_on_speak != ""
  1350.              Audio.se_play($game_system.soundname_on_speak)
  1351.            end
  1352.            @x += 24
  1353.            c = ""
  1354.          end
  1355.          if c == "\n"
  1356.            if @lines >= $game_temp.choice_start
  1357.              @cursor_width = [@cursor_width, @max_x - @face_indent].max
  1358.            end
  1359.            @lines += 1
  1360.            @y += 1
  1361.            @x = 0 + @indent + @face_indent
  1362.            if @lines >= $game_temp.choice_start
  1363.              @x = 8 + @indent + @face_indent
  1364.            end
  1365.            c = ""
  1366.          end
  1367.          if c != ""
  1368.            # 文字描画
  1369.            @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  1370.            if $game_system.soundname_on_speak != "" then
  1371.            Audio.se_play($game_system.soundname_on_speak)
  1372.            end
  1373.          end
  1374.          if Input.press?(Input::C) and $game_switches[3]
  1375.            text_not_skip = false
  1376.          end
  1377.          if Input.press?(Input::B)
  1378.            text_not_skip = false
  1379.          end
  1380.        else
  1381.          text_not_skip = true
  1382.          break
  1383.        end
  1384.        # 終了判定
  1385.        if text_not_skip
  1386.          break
  1387.        end
  1388.      end
  1389.      @write_wait += @write_speed
  1390.      return
  1391.    end
  1392.    if @input_number_window != nil
  1393.      @input_number_window.update
  1394.      # 決定
  1395.      if Input.trigger?(Input::C)
  1396.        $game_system.se_play($data_system.decision_se)
  1397.        $game_variables[$game_temp.num_input_variable_id] =
  1398.        @input_number_window.number
  1399.        $game_map.need_refresh = true
  1400.        @input_number_window.dispose
  1401.        @input_number_window = nil
  1402.        terminate_message
  1403.      end
  1404.      return
  1405.    end
  1406.    if @contents_showing
  1407.      if $game_temp.choice_max == 0
  1408.        self.pause = true
  1409.      end
  1410.      # 取消
  1411.      if Input.trigger?(Input::B)
  1412.        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1413.          $game_system.se_play($data_system.cancel_se)
  1414.          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1415.          terminate_message
  1416.        end
  1417.      end
  1418.      # 決定
  1419.      if Input.trigger?(Input::C)
  1420.        if $game_temp.choice_max > 0
  1421.          $game_system.se_play($data_system.decision_se)
  1422.          $game_temp.choice_proc.call(self.index)
  1423.        end
  1424.        if @mid_stop
  1425.          @mid_stop = false
  1426.          return
  1427.        else
  1428.          terminate_message
  1429.        end
  1430.      end
  1431.      return
  1432.    end
  1433.    if @fade_out == false and $game_temp.message_text != nil
  1434.      @contents_showing = true
  1435.      $game_temp.message_window_showing = true
  1436.      refresh
  1437.      Graphics.frame_reset
  1438.      self.visible = true
  1439.      self.contents_opacity = 0
  1440.    if @input_number_window != nil
  1441.      @input_number_window.contents_opacity = 0
  1442.    end
  1443.      @fade_in = true
  1444.      return
  1445.    end
  1446.    if self.visible
  1447.      @fade_out = true
  1448.      self.opacity -= 48
  1449.      if self.opacity == 0
  1450.        self.visible = false
  1451.        @fade_out = false
  1452.        $game_temp.message_window_showing = false
  1453.      end
  1454.      return
  1455.    end
  1456.    #........................................................................
  1457. else
  1458.   super
  1459.   # 呼出模式下跟随事件移动
  1460.   if @tale != nil
  1461.     pos = get_fuki_pos(self.width, self.height)
  1462.     self.x = pos[0]
  1463.     self.y = pos[1]

  1464.     tale_pos = get_tale_pos
  1465.     @tale.x = tale_pos[0]
  1466.     @tale.y = tale_pos[1]
  1467.    
  1468.     if @name_win != nil
  1469.       name_pos = get_name_pos
  1470.       @name_win.x = name_pos[0]
  1471.       @name_win.y = name_pos[1]
  1472.       case @face_pic_txt
  1473.         when 0  # 文字
  1474.           @name_contents.x = @name_win.x + 12
  1475.           @name_contents.y = @name_win.y + 8
  1476.         when 1  # 图片
  1477.           @name_contents.x = @name_win.x + 2
  1478.           @name_contents.y = @name_win.y + 2
  1479.         end
  1480.     end
  1481.   end
  1482.   
  1483.   # 渐变的情况下
  1484.   if @fade_in
  1485.     self.contents_opacity += 24
  1486.     if @name_win != nil
  1487.       @name_win.opacity += 24
  1488.     end
  1489.     if @tale != nil
  1490.       @tale.opacity += 24
  1491.     end
  1492.     if @input_number_window != nil
  1493.       @input_number_window.contents_opacity += 24
  1494.     end
  1495.     if self.contents_opacity == 255
  1496.       @fade_in = false
  1497.     end
  1498.     return
  1499.   end
  1500.   # 显示信息中的情况下
  1501.   if @contents_drawing
  1502.     refresh_drawtext
  1503.     return
  1504.   end
  1505.   # 输入数值的情况下
  1506.   if @input_number_window != nil
  1507.     @input_number_window.update
  1508.     # 确定
  1509.     if Input.trigger?(Input::C)
  1510.       $game_system.se_play($data_system.decision_se)
  1511.       $game_variables[$game_temp.num_input_variable_id] =
  1512.         @input_number_window.number
  1513.       $game_map.need_refresh = true
  1514.       # 释放输入数值窗口
  1515.       @input_number_window.dispose
  1516.       @input_number_window = nil
  1517.       terminate_message
  1518.     end
  1519.     return
  1520.   end
  1521.   # 显示信息结束的情况下
  1522.   if @contents_showing_end
  1523.     # 不是显示选择项且不是呼出对话模式则显示暂停标志
  1524.     if $game_temp.choice_max == 0 and @tale == nil
  1525.       self.pause = true
  1526.     else
  1527.       self.pause = false
  1528.     end
  1529.     # 取消
  1530.     if Input.trigger?(Input::B)
  1531.       if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1532.         $game_system.se_play($data_system.cancel_se)
  1533.         $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1534.         terminate_message
  1535.       end
  1536.     end
  1537.     # 确定
  1538.     if Input.trigger?(Input::C)
  1539.       if $game_temp.choice_max > 0
  1540.         $game_system.se_play($data_system.decision_se)
  1541.         $game_temp.choice_proc.call(self.index)
  1542.       end
  1543.       terminate_message
  1544.       # 释放呼出窗口
  1545.       del_fukidasi
  1546.     end
  1547.     return
  1548.   end
  1549.   # 在渐变以外的状态下有等待显示的信息与选择项的场合
  1550.   if @fade_out == false and $game_temp.message_text != nil
  1551.     @contents_showing = true
  1552.     $game_temp.message_window_showing = true
  1553.     reset_window
  1554.     refresh_create
  1555.     if @name_win != nil
  1556.       @name_win.opacity = 0
  1557.     end
  1558.     if @tale != nil
  1559.       @tale.opacity = 0
  1560.     end
  1561.     Graphics.frame_reset
  1562.     self.visible = true
  1563.     self.contents_opacity = 0
  1564.     if @input_number_window != nil
  1565.       @input_number_window.contents_opacity = 0
  1566.     end
  1567.     @fade_in = true
  1568.     return
  1569.   end
  1570.   # 没有可以显示的信息、但是窗口为可见的情况下
  1571.   if self.visible
  1572.     @fade_out = true
  1573.     self.opacity -= 48
  1574.     if @name_win != nil
  1575.       @name_win.opacity -= 48
  1576.     end
  1577.     if @tale != nil
  1578.       @tale.opacity -= 48
  1579.     end
  1580.     if self.opacity == 0
  1581.       self.visible = false
  1582.       @fade_out = false
  1583.       $game_temp.message_window_showing = false
  1584.       del_fukidasi
  1585.     end
  1586.     return
  1587.   end
  1588. end
  1589. end

  1590. #--------------------------------------------------------------------------
  1591. # ● 透過文字描画 - 66rpg
  1592. #--------------------------------------------------------------------------
  1593. # target :描画対象。Bitmapクラスを指定。
  1594. # x :x座標
  1595. # y :y座標
  1596. # str  :描画文字列
  1597. # opacity:透過率(0~255)
  1598. # 返回値 :文字幅(@x増加値)。
  1599. #--------------------------------------------------------------------------
  1600. def opacity_draw_text(target, x, y, str,opacity)
  1601.   height = target.font.size
  1602.   width = target.text_size(str).width
  1603.   opacity = [[opacity, 0].max, 255].min
  1604.   if opacity == 255
  1605.     target.draw_text(x, y, width, height, str)
  1606.     return width
  1607.   else
  1608.     if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  1609.       @opacity_text_buf.dispose
  1610.       @opacity_text_buf = Bitmap.new(width, height)
  1611.     else
  1612.       @opacity_text_buf.clear
  1613.     end
  1614.     @opacity_text_buf.font.size = target.font.size
  1615.     @opacity_text_buf.draw_text(0, 0, width, height, str)
  1616.     target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  1617.   return width
  1618.   end
  1619. end
  1620. def ruby_draw_text(target, x, y, str,opacity)
  1621.   sizeback = target.font.size
  1622.   target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  1623.   rubysize = [rubysize, 6].max
  1624.   
  1625.   opacity = [[opacity, 0].max, 255].min
  1626.   split_s = str.split(/,/)
  1627.   
  1628.   split_s[0] == nil ? split_s[0] = "" : nil
  1629.   split_s[1] == nil ? split_s[1] = "" : nil
  1630.   
  1631.   height = sizeback + rubysize
  1632.   width = target.text_size(split_s[0]).width
  1633.   
  1634.   target.font.size = rubysize
  1635.   ruby_width = target.text_size(split_s[1]).width
  1636.   target.font.size = sizeback
  1637.   
  1638.   buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  1639.   
  1640.   width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  1641.   
  1642.   if opacity == 255
  1643.     target.font.size = rubysize
  1644.     target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  1645.     target.font.size = sizeback
  1646.     target.draw_text(x, y, width, target.font.size, split_s[0])
  1647.     return width
  1648.   else
  1649.     if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  1650.       @opacity_text_buf.dispose
  1651.       @opacity_text_buf = Bitmap.new(buf_width, height)
  1652.     else
  1653.       @opacity_text_buf.clear
  1654.     end
  1655.     @opacity_text_buf.font.size = rubysize
  1656.     @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  1657.     @opacity_text_buf.font.size = sizeback
  1658.     @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  1659.     if sub_x >= 0
  1660.       target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1661.     else
  1662.       target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1663.     end
  1664.     return width
  1665.   end
  1666. end

  1667. #--------------------------------------------------------------------------
  1668. # ● 释放
  1669. #--------------------------------------------------------------------------
  1670. def dispose
  1671. if $game_switches[2]
  1672.   #........................................................................
  1673.   terminate_message
  1674.   if @gaiji_cache != nil
  1675.     unless @gaiji_cache.disposed?
  1676.       @gaiji_cache.dispose
  1677.     end
  1678.   end
  1679.   unless @opacity_text_buf.disposed?
  1680.     @opacity_text_buf.dispose
  1681.   end
  1682.   $game_temp.message_window_showing = false
  1683.   if @input_number_window != nil
  1684.     @input_number_window.dispose
  1685.   end
  1686.   super
  1687.   #........................................................................
  1688. else
  1689.   terminate_message
  1690.   $game_temp.message_window_showing = false
  1691.   if @input_number_window != nil
  1692.     @input_number_window.dispose
  1693.   end
  1694.   super
  1695. end
  1696. end

  1697. #--------------------------------------------------------------------------
  1698. # ● 信息结束处理
  1699. #--------------------------------------------------------------------------
  1700. def terminate_message
  1701. if $game_switches[2]
  1702.   #........................................................................
  1703.   self.active = false
  1704.   self.pause = false
  1705.   self.index = -1
  1706.   self.contents.clear
  1707.   # 清除显示中标志
  1708.   @contents_showing = false
  1709.   # 呼叫信息调用
  1710.   if $game_temp.message_proc != nil
  1711.     $game_temp.message_proc.call
  1712.   end
  1713.   # 清除文章、选择项、输入数值的相关变量
  1714.   $game_temp.message_text = nil
  1715.   $game_temp.message_proc = nil
  1716.   $game_temp.choice_start = 99
  1717.   $game_temp.choice_max = 0
  1718.   $game_temp.choice_cancel_type = 0
  1719.   $game_temp.choice_proc = nil
  1720.   $game_temp.num_input_start = 99
  1721.   $game_temp.num_input_variable_id = 0
  1722.   $game_temp.num_input_digits_max = 0
  1723.   # 开放金钱窗口
  1724.   if @gold_window != nil
  1725.     @gold_window.dispose
  1726.     @gold_window = nil
  1727.   end
  1728.   if @name_window_frame != nil
  1729.     @name_window_frame.dispose
  1730.     @name_window_frame = nil
  1731.   end
  1732.   if @name_window_text != nil
  1733.     @name_window_text.dispose
  1734.     @name_window_text = nil
  1735.   end
  1736.   if @right_picture != nil and @right_keep == true
  1737.     @right_picture.dispose
  1738.   end   
  1739.   if @left_picture != nil and @left_keep == true
  1740.     @left_picture.dispose
  1741.   end
  1742.   #........................................................................
  1743. else
  1744.   self.active = false
  1745.   self.pause = false
  1746.   self.index = -1
  1747.   self.contents.clear
  1748.   # 清除显示中标志
  1749.   @contents_showing = false
  1750.   @contents_showing_end = false
  1751.   # 呼叫信息调用
  1752.   if $game_temp.message_proc != nil
  1753.     $game_temp.message_proc.call
  1754.   end
  1755.   # 清除文章、选择项、输入数值的相关变量
  1756.   $game_temp.message_text = nil
  1757.   $game_temp.message_proc = nil
  1758.   $game_temp.choice_start = 99
  1759.   $game_temp.choice_max = 0
  1760.   $game_temp.choice_cancel_type = 0
  1761.   $game_temp.choice_proc = nil
  1762.   $game_temp.num_input_start = 99
  1763.   $game_temp.num_input_variable_id = 0
  1764.   $game_temp.num_input_digits_max = 0
  1765.   # 释放金钱窗口
  1766.   if @gold_window != nil
  1767.     @gold_window.dispose
  1768.     @gold_window = nil
  1769.   end
  1770. end
  1771. end

  1772. #--------------------------------------------------------------------------
  1773. # ● 刷新光标矩形
  1774. #--------------------------------------------------------------------------
  1775. def update_cursor_rect
  1776. if $game_switches[2]
  1777.   #.........................................................................
  1778.   if @index >= 0
  1779.     n = $game_temp.choice_start + @index
  1780.     self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  1781.   else
  1782.     self.cursor_rect.empty
  1783.   end
  1784.   #.........................................................................
  1785. else
  1786.   if @index >= 0
  1787.     n = $game_temp.choice_start + @index
  1788.     self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1789.   else
  1790.     self.cursor_rect.empty
  1791.   end
  1792. end
  1793. end
  1794. #--------------------------------------------------------------------------
  1795. # ● 取得普通文字色
  1796. #--------------------------------------------------------------------------
  1797. def normal_color
  1798.   nil_color = Color.new(0,0,0,0)
  1799.   if FUKI::FUKI_COLOR != nil_color
  1800.     color = FUKI::FUKI_COLOR
  1801.   else
  1802.     color = super
  1803.   end
  1804.   return color
  1805. end
  1806. end

  1807. #==============================================================================
  1808. # ■ Interpreter
  1809. #==============================================================================

  1810. class Interpreter
  1811. #--------------------------------------------------------------------------
  1812. # ● 设置事件
  1813. #     event_id : 事件 ID
  1814. #--------------------------------------------------------------------------
  1815. alias setup_fuki setup
  1816. def setup(list, event_id)
  1817.   setup_fuki(list, event_id)
  1818.   # 如果不是战斗中
  1819.   if !($game_temp.in_battle)
  1820.     # 记录事件 ID
  1821.     $active_event_id = event_id
  1822.   end
  1823. end
  1824. end

  1825. #==============================================================================
  1826. # ■ Scene_Map
  1827. #==============================================================================

  1828. class Scene_Map
  1829. #--------------------------------------------------------------------------
  1830. # ● 主处理
  1831. #--------------------------------------------------------------------------
  1832. def main
  1833.   # 生成活动块
  1834.   @spriteset = Spriteset_Map.new
  1835.   # 生成信息窗口
  1836.   @message_window = Window_FukiMessage.new
  1837.   # 执行过渡
  1838.   Graphics.transition
  1839.   # 主循环
  1840.   loop do
  1841.     # 刷新游戏画面
  1842.     Graphics.update
  1843.     # 刷新输入信息
  1844.     Input.update
  1845.     # 刷新画面
  1846.     update
  1847.     # 如果画面切换的话就中断循环
  1848.     if $scene != self
  1849.       break
  1850.     end
  1851.   end
  1852.   # 准备过渡
  1853.   Graphics.freeze
  1854.   # 释放活动块
  1855.   @spriteset.dispose
  1856.   # 释放信息窗口
  1857.   @message_window.dispose
  1858.   # 标题画面切换中的情况下
  1859.   if $scene.is_a?(Scene_Title)
  1860.     # 淡入淡出画面
  1861.     Graphics.transition
  1862.     Graphics.freeze
  1863.   end
  1864. end
  1865. end

  1866. #==============================================================================
  1867. # ■ Window_InputNumber
  1868. #==============================================================================

  1869. class Window_InputNumber < Window_Base
  1870. #--------------------------------------------------------------------------
  1871. # ● 初始化对像
  1872. #     digits_max : 位数
  1873. #--------------------------------------------------------------------------
  1874. def initialize(digits_max)
  1875.   @digits_max = digits_max
  1876.   @number = 0
  1877.   # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  1878.   dummy_bitmap = Bitmap.new(32, 32)
  1879.   dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  1880.   @cursor_width = dummy_bitmap.text_size("0").width + 8
  1881.   dummy_bitmap.dispose
  1882.   super(0, 0, @cursor_width * @digits_max + 32, 64)
  1883.   self.contents = Bitmap.new(width - 32, height - 32)
  1884.   self.contents.font.size = FUKI::MES_FONT_SIZE
  1885.   self.z += 9999
  1886.   self.opacity = 0
  1887.   @index = 0
  1888.   refresh
  1889.   update_cursor_rect
  1890. end
  1891. end
复制代码


每次对话完后调用一个公共事件恢复下对话框

等待:2帧
更改文章选项:下,显示
脚本:chat("","")
脚本:$mes_speed=1
等待:2帧
步兵中尉
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
127
在线时间
35 小时
注册时间
2020-8-13
帖子
5
5
 楼主| 发表于 2020-8-14 09:29:32 | 只看该作者
步兵中尉 发表于 2020-8-14 09:25
为什么我从来没出过事?

谢谢,我已经解决了~
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 09:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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