XP 스크립트

#모험 일기
#
#다만 단지 문자를 묘화 할 뿐(만큼)이므로 일기 이외에도 사용할 수 있을지도 모릅니다.
#사용할 수 있는 제어 문자는 이하와 같다.
#
#N[n]                         ID n차례의 엑터의 이름을 표시합니다. 
#V[n]                         변수 n차례의 값을 표시합니다.
#C[n]                         폰트 칼라를 변경합니다.
#G                            현재의 소지금을 표시합니다.
#O[n]                         불투명도를 변경합니다. (0~255)
#H[n]                         font size를 변경합니다. (6~32)
#R[본문,루비]                 루비 첨부의 문자를 표시합니다.
#Pic[x,y,파일 네임]      픽처에 임포트 된 화상을 표시합니다.
#Bat[x,y,파일 네임,hue]  버틀러에 임포트 된 화상을 표시합니다.
#Cha[x,y,파일 네임,hue,방향,패턴]  캐릭터에 임포트 된 화상을 표시하는.
#※방향 숫자 패드의 배치와 같은 , 하2좌4우6상8
#  패턴1~4
#
#일기 내용의 설정으로 사용할 때는 「n[1]」과 같이
#「」을 하나 여분으로 붙여 주세요.
#
#샘플을 여러가지 만져 보면 , 알기 쉽다고 생각합니다.
#
#2005.4.2 기능 추가
#타이틀도 변수에 의해 변경할 수 있도록(듯이).
#거기에 따라@title의 취급이 변합니다만(캐릭터 라인→캐릭터 라인의 배열)
#지금까지인 채에서도 사용할 수 있게 되어 있습니다. (캐릭터 라인의 경우는 그대로 돌려주는)
#코멘트와 같이 @title[0] = "타이틀" 같은 느끼고로 설정해 주세요.
#일기4번째의 항목을 참고로 하면 , 알기 쉽다고 생각합니다.
#
#2005.4.16 기능 추가
#타이틀 부분에도 제어 문자를 사용 가능하게.
#일부 제어 문자(엑터명등)은 전전부터 사용할 수 있었습니다만
#문자색 변경등도 사용할 수 있게 되었습니다.
#다만 , 약간의 부작용이라든지도 있다고 생각하므로
#선택식에 해 두었습니다.
#
#2005.4.30 기능 추가
#픽쳐 표시 외에도 , 버틀러 표시와 캐릭터 표시를 추가했습니다.
#하는 김에 , 현재의 불투명도로 픽쳐등 을 표시하도록(듯이).
#픽쳐 표시의 직전에O[160]라든지 하면 불투명도를 조정할 수 있습니다.
#
#2005.4.30 더욱 추가
#NO_DATA_VISIBLE 로 출현하고 있지 않는 항목은 비표시(윳돈?듯이) 설정할 수 있도록(듯이).
#일기 번호의 표기를 할까 하지 않는가 선택할 수 있도록(듯이).
#그리고 미묘하게 버그 수정. Window_Base#transfer, Window_Base#draw_ex_text (을)를 조정.

class Window_Questdiary_Select < Window_Selectable
  QUESTDIARY_DATA_MAX = 10  #일기 데이터의 최대수
  TITLE_TEXT_EX = true      #일기의 타이틀에도 제어 문자를 사용할까?
                            #사용했을 경우 긴 타이틀을 표시 다 할 수 없는 경우 개미
                            #(draw_text를 사용하지 않기 때문에 , 자동 축소 기능이 일하지 않기 때문에)
  NO_DATA_VISIBLE = true    #아직 출현하고 있지 않는 항목을 표시하는지 어떤지
  DRAW_ID = true            #일기 번호를 표기하는지 어떤지
end
class Data_Questdiary
  VISIBLE_JUDGE_MODE = 1  #출현 판정에 스윗치를 사용할까 변수를 사용할까 0:스윗치 1:변수
                          #스윗치로 하면(자) ,1개의 항목에 복수의 메세지를
                          #설정할 수 없게 됩니다.
  attr_reader   :exist
  attr_reader   :title
  attr_reader   :id
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize(id)
    @id = id
    @title = []
    @title[0] = "?" # 디폴트 타이틀(통상 사용하지 않는)
    @variable = 0
    @variable_max = 1
    @comment = []
    @exist = false
    set_data(id)
  end
  # 타이틀 취득
  def title
    # 배열이 아니면 그대로 돌려주는
    return @title unless @title.is_a?(Array)
    # 스윗치로 판정이나 변수 번호가0인가 타이틀이 존재하지 않는 경우는 배열의 최초를 돌려주는
    if VISIBLE_JUDGE_MODE == 0 or @variable == 0 or
       not @title[$game_variables[@variable]].nil?
      return @title[0]
    end
    # 변수 번호에 의해 돌려주는 타이틀을 결정하는
    return @title[$game_variables[@variable]-1]
  end
  #--------------------------------------------------------------------------
  # ● 일기 내용의 설정
  #--------------------------------------------------------------------------
  def set_data(id)
    @id = id
    case @id
    when 1 # ID
      @title = "제목" # 타이틀
      @variable = 0 # 출현 변수 번호0라면 상시 출현
      @comment[0] = <<-EOS # 여기로부터 내용을 쓰는
쓸내용
      EOS
      # ここまで
      @variable_max = @comment.size
      @exist = true # 存在フラグ trueにしといてください
    when 2
      @title[0] = "제목"
      @variable = 0
      @comment[0] = <<-EOS
쓸내용
      EOS
      @variable_max = @comment.size
      @exist = true
    when 3
      @title[0] = "제목"
      @variable = 0
      @comment[0] = <<-EOS
쓸내용
      EOS
      @variable_max = @comment.size
      @exist = true
    when 4
      @title[0] = "n[1]의 필살기술1"
      @title[1] = "n[1]의 필살기술2"
      @variable = 10
      @comment[0] = <<-EOS
내용 그1
pic[0,240,アルシェス?]
      EOS
      @comment[1] = <<-EOS
내용 그2
pic[0,240,超アルシェス?]
      EOS
      @variable_max = @comment.size
      @exist = true
    when 5
      @title[0] = "아"
      @variable = 0
      @comment[0] = <<-EOS
있어라 있어라 와입니다.
      EOS
      @variable_max = @comment.size
      @exist = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 일기 내용을 돌려주는
  #--------------------------------------------------------------------------
  def show_comment
    return @comment[0] if VISIBLE_JUDGE_MODE == 0
    if @comment.size == 1
      return @comment[0]
    else
      temp = [[$game_variables[@variable]-1, 0].max, @variable_max-1].min
      return @comment[temp]
    end
  end
  #--------------------------------------------------------------------------
  # ● 일기 타이틀 출현 판정
  #--------------------------------------------------------------------------
  def title_visible?
    return true if @variable == 0
    if VISIBLE_JUDGE_MODE == 0
      if $game_switches[@variable]
        return true
      else
        return false
      end
    else
      if $game_variables[@variable] == 0
        return false
      else
        return true
      end
    end
  end
end

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 캐릭터 라인 변환
  #--------------------------------------------------------------------------
  def transfer(str)
    text = str.clone
    # 制御文字?理
    begin
    text.gsub!(/[Vv][([0-9]+)]/) { $game_variables[$1.to_i] }
    end
    text.gsub!(/[Nn][([0-9]+)]/) do
      $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
    end
    # 편의상 ,"\" 을 "00" 에 변환
    text.gsub!(/\/) { "00" }
    # "C" を "01" に、"G" を "02" に?換
    text.gsub!(/[Cc][([0-9]+)]/) { "01[#{$1}]" }
    text.gsub!(/[Gg]/) { "02" }
    # 불투명도
    text.gsub!(/[Oo][([0-9]+)]/) { "200[#{$1}]" }
    # 문자 사이즈
    text.gsub!(/[Hh][([0-9]+)]/) { "201[#{$1}]" }
    # 루비
    text.gsub!(/[Rr][(.+?),(.+?)]/) { "202[#{$1},#{$2}]" }
    # 픽쳐 표시
    text.gsub!(/[Pp]ic[([0-9]+),([0-9]+),([^,]]+)]/) { "250[#{$1},#{$2},#{$3}]" }
    # 버틀러 표시
    text.gsub!(/[Bb]at[([0-9]+),([0-9]+),([^,]]+),([0-9]+)]/) { "251[#{$1},#{$2},#{$3},#{$4}]" }
    # 캐릭터 그래픽 표시
    text.gsub!(/[Cc]ha[([0-9]+),([0-9]+),([^,]]+),([0-9]+),([0-9]+),([0-9]+)]/) { "252[#{$1},#{$2},#{$3},#{$4},#{$5},#{$6}]" }
   
    return text
  end
  #--------------------------------------------------------------------------
  # ● 변환한 캐릭터 라인을 묘화
  #--------------------------------------------------------------------------
  def draw_ex_text(ox, oy, str, align=0)
    text = str.clone
    x = 0
    y = 0
    # c に 1 文字を取得 (文字が取得できなくなるまでル?プ)
    while ((c = text.slice!(/./m)) != nil)
      # の場合
      if c == "00"
        # 본래의 문자에 되돌리는
        c = ""
      end
      # C[n] 의 경우
      if c == "01"
        # 문자색을 변경
        text.sub!(/[([0-9]+)]/, "")
        color = $1.to_i
        if color >= 0 and color <= 7
          self.contents.font.color = text_color(color)
        end
        # 다음의 문자에
        next
      end
      # G の場合
      if c == "02"
        # 소지 골드에 변환
        c = $game_party.gold.to_s
        # 문자를 묘화
        self.contents.draw_text(ox+4+x, oy+4+ 32 * y, self.contents.text_size(c).width, 32, c)
        # x 에 묘화 한 문자의 폭을 가산
        x += self.contents.text_size(c).width
        # 다음의 문자에
        next
      end
     
      # O 의 경우
      if c == "200"
        text.sub!(/[([0-9]+)]/, "")
        opacity = $1.to_i
        temp = self.contents.font.color
        self.contents.font.color = Color.new(temp.red, temp.green, temp.blue, opacity)
        # 次の文字へ
        next
      end
      # H の場合
      if c == "201"
        text.sub!(/[([0-9]+)]/, "")
        self.contents.font.size = [[$1.to_i, 6].max, 32].min
        # 次の文字へ
        next
      end
      # R の場合
      if c == "202"
        text.sub!(/[(.+?),(.+?)]/, "")
        x += ruby_set(ox+x,oy+(y*32),$1,$2)
        # 次の文字へ
        next
      end
      # Pic の場合
      if c == "250"
        text.sub!(/[([0-9]+),([0-9]+),([^,]]+)]/, "")
        ope = self.contents.font.color.alpha
        set_picture($1.to_i, $2.to_i, $3, ope)
        # 次の文字へ
        next
      end
      # Bat の場合
      if c == "251"
        text.sub!(/[([0-9]+),([0-9]+),([^,]]+),([0-9]+)]/, "")
        ope = self.contents.font.color.alpha
        set_battler($1.to_i, $2.to_i, $3, $4.to_i, ope)
        # 次の文字へ
        next
      end
      # Cha の場合
      if c == "252"
        text.sub!(/[([0-9]+),([0-9]+),([^,]]+),([0-9]+),([0-9]+),([0-9]+)]/, "")
        ope = self.contents.font.color.alpha
        set_character($1.to_i, $2.to_i, $3, $4.to_i, $5.to_i, $6.to_i, ope)
        # 次の文字へ
        next
      end
      # 改行文字の場合
      if c == "n"
        # y に 1 を加算
        y += 1
        x = 0
        # 次の文字へ
        next
      end
      # 文字を描?
      self.contents.draw_text(ox+4+x, 4+oy+ 32 * y, 40, 32, c)
      # x に描?した文字の幅を加算
      x += self.contents.text_size(c).width
    end
  end
  #--------------------------------------------------------------------------
  # ● ルビ描?
  #--------------------------------------------------------------------------
  def ruby_set(x,y,str,ruby)
    text_w = self.contents.text_size(str).width
    text_h = self.contents.text_size(str).height
    f_size_back = self.contents.font.size
    ruby_size = 10
    self.contents.font.size = ruby_size
    ruby_w = self.contents.text_size(ruby).width
    self.contents.draw_text(4+x, 4+4+y-ruby_size+1, text_w, ruby_size, ruby, 1)
    self.contents.font.size = f_size_back
    self.contents.draw_text(4+x, 4+4+y, text_w, text_h, str)
    return text_w
  end
  #--------------------------------------------------------------------------
  # ● ピクチャ?描?
  #--------------------------------------------------------------------------
  def set_picture(x, y, filename, opacity=255)
    bitmap = RPG::Cache.picture(filename)
    self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ● バトラ?描?
  #--------------------------------------------------------------------------
  def set_battler(x, y, filename, hue, opacity=255)
    bitmap =RPG::Cache.battler(filename, hue)
    self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ● キャラクタ?描?
  #--------------------------------------------------------------------------
  def set_character(x, y, filename, hue, dir, pat, opacity=255)
    bitmap = RPG::Cache.character(filename, hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    cy = ch * (dir / 2 - 1)
    cx = cw * (pat - 1)
    src_rect = Rect.new(cx, cy, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ● テキストの行?を返す
  #--------------------------------------------------------------------------
  def text_row(str)
    text = str.clone
    num = 0
    # c に 1 文字を取得 (文字が取得できなくなるまでル?プ)
    while ((c = text.slice!(/./m)) != nil)
      # 改行文字の場合
      if c == "n"
        # num に 1 を加算
        num += 1
        # 次の文字へ
        next
      end
    end
    return num
  end
end

#==============================================================================
# ■ Window_Scroll
#------------------------------------------------------------------------------
#  スクロ?ルの機能を持つウィンドウクラスです。
#==============================================================================
class Window_Scroll < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス??
  #--------------------------------------------------------------------------
  attr_reader   :index                    # カ?ソル位置
  attr_reader   :help_window              # ヘルプウィンドウ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     x      : ウィンドウの X 座標
  #     y      : ウィンドウの Y 座標
  #     width  : ウィンドウの幅
  #     height : ウィンドウの高さ
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @column_max = 1
    @index = 0
    self.cursor_rect.empty
  end
  #--------------------------------------------------------------------------
  # ● カ?ソル位置の設定
  #     index : 新しいカ?ソル位置
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    # ヘルプテキストを更新 (update_help は?承先で定義される)
    #if self.active and @help_window != nil
    #  update_help
    #end
    # カ?ソルの矩形を更新
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 行?の取得
  #--------------------------------------------------------------------------
  def row_max
    # 項目?と列?から行?を算出
    return (@item_max + @column_max - 1) / @column_max
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の取得
  #--------------------------------------------------------------------------
  def top_row
    # ウィンドウ?容の?送元 Y 座標を、1 行の高さ 32 で割る
    return self.oy / 32
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の設定
  #     row : 先頭に表示する行
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row が 0 未?の場合は 0 に修正
    if row < 0
      row = 0
    end
    # row が row_max - 1 超の場合は row_max - 1 に修正
    if row > row_max - 1
      row = row_max - 1
    end
    # row に 1 行の高さ 32 を掛け、ウィンドウ?容の?送元 Y 座標とする
    self.oy = row * 32
  end
  #--------------------------------------------------------------------------
  # ● 1 ペ?ジに表示できる行?の取得
  #--------------------------------------------------------------------------
  def page_row_max
    # ウィンドウの高さから、フレ?ムの高さ 32 を引き、1 行の高さ 32 で割る
    return 1#(self.height - 32) / 32
  end
  #--------------------------------------------------------------------------
  # ● 1 ペ?ジに表示できる項目?の取得
  #--------------------------------------------------------------------------
  def page_item_max
    # 行? page_row_max に 列? @column_max を掛ける
    return (self.height - 32) / 32#page_row_max #* @column_max
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウの設定
  #     help_window : 新しいヘルプウィンドウ
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    # ヘルプテキストを更新 (update_help は?承先で定義される)
    if self.active and @help_window != nil
      update_help
    end
  end
  #--------------------------------------------------------------------------
  # ● カ?ソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # カ?ソル位置が 0 未?の場合
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 現在の行を取得
    row = @index #/ @column_max
    # 現在の行が、表示されている先頭の行より前の場合
    if row < self.top_row
      # 現在の行が先頭になるようにスクロ?ル
      self.top_row = row
    end
    # 現在の行が、表示されている最後尾の行より後ろの場合
    if row > self.top_row + (self.page_row_max - 1)
      # 現在の行が最後尾になるようにスクロ?ル
      self.top_row = row - (self.page_row_max - 1)
    end
    # カ?ソルの幅を計算
    #cursor_width = self.width / @column_max - 32
    # カ?ソルの座標を計算
    #x = @index % @column_max * (cursor_width + 32)
    #y = @index / @column_max * 32 - self.oy
    # カ?ソルの矩形を更新
    #self.cursor_rect.set(x, y, cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新
  #--------------------------------------------------------------------------
  def update
    super
    # カ?ソルの移動が可能な?態の場合
    if self.active and @item_max > 0 and @index >= 0 and
       self.contents.height / 32 > (self.height - 32) / 32
      # 方向ボタンの下が押された場合
      if Input.repeat?(Input::DOWN)
        # 列?が 1 かつ 方向ボタンの下の押下?態がリピ?トでない場合か、
        # またはカ?ソル位置が(項目? - 列?)より前の場合
        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @column_max
          # カ?ソルを下に移動
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @column_max) % @item_max
        end
      end
      # 方向ボタンの上が押された場合
      if Input.repeat?(Input::UP)
        # 列?が 1 かつ 方向ボタンの上の押下?態がリピ?トでない場合か、
        # またはカ?ソル位置が列?より後ろの場合
        if (@column_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @column_max
          # カ?ソルを上に移動
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @column_max + @item_max) % @item_max
        end
      end
      # 方向ボタンの右が押された場合
      if Input.repeat?(Input::RIGHT)
        # 表示されている最後尾の行が、デ?タ上の最後の行よりも前の場合
        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
          # カ?ソルを 1 ペ?ジ後ろに移動
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.top_row += self.page_row_max
        end
      end
      # 方向ボタンの左が押された場合
      if Input.repeat?(Input::LEFT)
        # 表示されている先頭の行が 0 より後ろの場合
        if self.top_row > 0
          # カ?ソルを 1 ペ?ジ前に移動
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.top_row -= self.page_row_max
        end
      end
    end
    # ヘルプテキストを更新 (update_help は?承先で定義される)
    if self.active and @help_window != nil
      update_help
    end
    # カ?ソルの矩形を更新
    update_cursor_rect
  end
end
class Window_Questdiary_Select < Window_Selectable
  attr_reader   :data
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    data_set
    @item_max = @data.size
    self.index = 0
    refresh
  end
  def data_set
    @data = []
    @diary_data = [0]
    for i in 1..QUESTDIARY_DATA_MAX
      @diary_data[i] = Data_Questdiary.new(i)
      next if (!NO_DATA_VISIBLE and !@diary_data[i].title_visible?)
      @data.push(@diary_data[i]) if @diary_data[i].exist
    end
  end
  #--------------------------------------------------------------------------
  # ● 日記デ?タ取得
  #--------------------------------------------------------------------------
  def diary
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    #項目?が 0 でなければビットマップを作成し、全項目を描?
    return if @item_max == 0
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 32, 32, item.id.to_s) if DRAW_ID
    if item.title_visible?
      diary_title = transfer(item.title)
      if TITLE_TEXT_EX
        draw_ex_text(x+48, y - 4, diary_title, 0)
      else
        self.contents.draw_text(x+48, y, 212, 32, diary_title, 0)
      end
    else
      self.contents.draw_text(x+48, y, 212, 32, "-----", 0)
    end
  end
end
class Window_Questdiary_Info < Window_Scroll
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh(comment)
    self.index = 0
    self.contents.dispose
    contents_row = text_row(comment)
    self.contents = Bitmap.new(width - 32, [contents_row * 32, self.height - 32].max)
    @item_max = [(contents_row + 1 - (self.height - 32) / 32), 0].max
    self.contents.font.color = normal_color
    self.contents.font.size = 22
    new_text = transfer(comment)
    draw_ex_text(0, 0, new_text)
  end
end

class Scene_Questdiary
  #--------------------------------------------------------------------------
  # ● メイン?理
  #--------------------------------------------------------------------------
  def main
    # ウィンドウを作成
    @title_window = Window_Base.new(0, 0, 640, 64)
    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
    @title_window.contents.draw_text(4, 0, 320, 32, "정보", 0)
    @main_window = Window_Questdiary_Select.new
    @main_window.active = true
    # インフォウィンドウを作成 (不可視?非アクティブに設定)
    @info_window = Window_Questdiary_Info.new
    @info_window.z = 110
    @info_window.visible = false
    @info_window.active = false
    @visible_index = 0
    # トランジション?行
    Graphics.transition
    # メインル?プ
    loop do
      # ゲ?ム?面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレ?ム更新
      update
      # ?面が切り替わったらル?プを中?
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @title_window.dispose
    @main_window.dispose
    @info_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新
  #--------------------------------------------------------------------------
  def update
    # ウィンドウを更新
    @main_window.update
    @info_window.update
    if @info_window.active
      update_info
      return
    end
    # メインウィンドウがアクティブの場合: update_target を呼ぶ
    if @main_window.active
      update_main
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新 (メインウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_main
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      if @main_window.diary.title_visible? == false
        # ブザ? SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      @main_window.active = false
      @info_window.active = true
      @info_window.visible = true
      @visible_index = @main_window.index
      @info_window.refresh(@main_window.diary.show_comment)
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新 (インフォウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_info
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      @main_window.active = true
      @info_window.active = false
      @info_window.visible = false
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      return
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      if @comment_on
        @comment_on = false
        @comment_window.visible = false
      else
        @comment_on = true
        @comment_window.visible = true
      end
      return
    end
    if Input.trigger?(Input::L)
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      loop_end = false
      while loop_end == false
        if @visible_index != 0
          @visible_index -= 1
        else
          @visible_index = @main_window.data.size - 1
        end
        loop_end = true if @main_window.data[@visible_index].title_visible?
      end
      diary = @main_window.data[@visible_index]
      @info_window.refresh(diary.show_comment)
      return
    end
    if Input.trigger?(Input::R)
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      loop_end = false
      while loop_end == false
        if @visible_index != @main_window.data.size - 1
          @visible_index += 1
        else
          @visible_index = 0
        end
        loop_end = true if @main_window.data[@visible_index].title_visible?
      end
      diary = @main_window.data[@visible_index]
      @info_window.refresh(diary.show_comment)
      return
    end
  end
end

불러오는법은 이벤트커맨드 스크립트 $scene = Scene_Questdiary.new

 

Comment '5'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
941 상태/속성 Cool Edited Status Screen. 10 아방스 2009.01.12 2430
» 기타 모험일기 5 키라링 2009.01.18 1825
939 메뉴 KGC스크립트모음 12 file 키라링 2009.01.18 2687
938 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
937 기타 몬스터 게이지바 턴알 22 file 키라링 2009.01.22 4011
936 아이템 아이템도감 14 키라링 2009.01.22 2299
935 기타 타이머스크립트 ps인간 2009.01.23 1765
934 아이템 아이템획득스크립트 ps인간 2009.01.23 2993
933 아이템 아이템제한스크립트 ps인간 2009.01.23 1680
932 전투 캐릭터고르기스크립트? ps인간 2009.01.23 3263
931 상점 Mog- 상점업그레이드 ps인간 2009.01.23 2682
930 스킬 스킬창 업그레이드? ps인간 2009.01.23 3061
929 메뉴 Mog-메뉴업그레이드? ps인간 2009.01.23 2948
928 아이템 mog-아이템창업그레이드? ps인간 2009.01.23 2555
927 장비 장비창업그레이드 ps인간 2009.01.23 2478
926 기타 mog-스테이터스 업그레이드? ps인간 2009.01.23 1904
925 타이틀/게임오버 게..임..오버.. ps인간 2009.01.23 2636
924 이름입력 이름입력스크립트 ps인간 2009.01.23 3632
923 HUD 맵이름표시 ps인간 2009.01.23 3441
922 전투 오버드라이브 8 file 키라링 2009.01.23 2193
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52