| 赞 | 2  | 
 
| VIP | 19 | 
 
| 好人卡 | 10 | 
 
| 积分 | 3 | 
 
| 经验 | 57661 | 
 
| 最后登录 | 2019-5-20 | 
 
| 在线时间 | 574 小时 | 
 
 
 
 
 
Lv2.观梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 253 
 
        - 在线时间
 - 574 小时
 
        - 注册时间
 - 2006-8-25
 
        - 帖子
 - 969
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
脚本分3个窗口(日记名/目录/日记内容) 
"目录"窗口宽640 
    super(0, 96, 640, 416) 
    @column_max = 2  #分两排(就好像"物品"栏一样) 
我改成 
    super(0, 96, 320, 416) 
    @column_max = 1 
这样目录就只显示在左边,并且"选项"窗口只有一排 
本来是: 
1   2 
3   4 
5 
现在成了: 
1 
3 
5 
右边的没有放到左边...反而消失了...是不是文字在别的地方设置?我应该怎么把文字设置过来左边...? 
全段脚本: 
  #-------------------------------------------------------------------------- 
  # ● オブジェクト初期化 
  #-------------------------------------------------------------------------- 
  def initialize 
    super(0, 96, 320, 416) 
    @column_max = 1 
    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 = Data_Questdiary.new(i) 
      next if (!NO_DATA_VISIBLE and !@diary_data.title_visible?) 
      @data.push(@diary_data) if @diary_data.exist 
    end 
  end 
 
 
整体脚本: 
- #冒険日記
 
 - #
 
 - #使用脚本:$scene = Scene_Questdiary.new
 
 - #
 
 - #ただ単に文字を描画するだけなので日記以外にも使えるかもしれません。
 
 - #使える制御文字は以下の通り。
 
 - #
 
 - #\N[n]                         ID n番のアクターの名前を表示します。 
 
 - #\V[n]                         変数 n番の値を表示します。
 
 - #\C[n]                         フォントカラーを変更します。
 
 - #\G                            現在の所持金を表示します。
 
 - #\O[n]                         不透明度を変更します。(0~255)
 
 - #\H[n]                         フォントサイズを変更します。(6~32)
 
 - #\R[本文,ルビ]                 ルビ付きの文字を表示します。
 
 - #\Pic[x,y,ファイルネーム]      Pictures画像を表示します。
 
 - #\Bat[x,y,ファイルネーム,hue]  Battlers画像を表示します。
 
 - #\Cha[x,y,ファイルネーム,hue,向き,パターン]  Characters画像を表示します。
 
 - #※向き テンキーの配置と同じ、下2左4右6上8
 
 - #  パターン1~4
 
 - #
 
 - #日記内容の設定で使う時は「\\n[1]」のように
 
 - #「\」を一つ余分につけてください。
 
 - #
 
 - #サンプルを色々いじってみれば、分かりやすいと思います。
 
  
- 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 = "\\c[1]日记!\\c[0]" # タイトル
 
 -       @variable = 0 # 出現変数番号0なら常時出現
 
 -       @comment[0] = <<-EOS # ここから内容を書く
 
 - \\r[るびびびです,るびー]るるるるー
 
 - \\h[32]でけー\\h[22]ふつー\\h[12]ちっけー\\h[22]
 
 - \\c[2]色変えてすと\\c[0]\\o[128]うっすいぜ\\o[255]
 
 - \\gごーるど  変数1の値=\\v[1]
 
 - \\r[るび,るびーびーびーびーですよ]るるるるびー
 
 - \\h[32]\\r[でっかいるび,おおきなふりがな]\\h[22]らららー
 
  
- \\h[12]\\r[ちっさいるび,ちいさなふりがな]\\h[22]ららりらー
 
 - ↓ピクチャ表示てすと
 
 - \\pic[0,288,TR2_P05·小雏的逆推]\\bat[480,160,001-Fighter01,160]\\cha[360,160,001-Fighter01,160,8,4]
 
 -       EOS
 
 -       # ここまで
 
 -       @variable_max = @comment.size
 
 -       @exist = true # 存在フラグ trueにしといてください
 
 -     when 2
 
 -       @title[0] = "ちょっとした説明"
 
 -       @variable = 0
 
 -       @comment[0] = <<-EOS
 
 - variableに設定した変数番号の値で
 
 - 出現する・しないを設定可能
 
 - 変数の値が0の時は出現しない
 
 - 1以上の時はそれぞれ対応したメッセージが表示されます
 
  
- このサンプルでは
 
 - 変数番号10番の値で4つ目の日記が変化します
 
 - 値を1か2にするとそれぞれメッセージが表示されます
 
 -       EOS
 
 -       @variable_max = @comment.size
 
 -       @exist = true
 
 -     when 3
 
 -       @title[0] = "すくろーる"
 
 -       @variable = 0
 
 -       @comment[0] = <<-EOS
 
 - 1 スクロールします
 
 - 2 上下キーで1行ずつ移動
 
 - 3 左右キーでページ単位で移動
 
 - 4
 
 - 5
 
 - 6
 
 - 7
 
 - 8
 
 - 9
 
 - 10
 
 - 11
 
 - 12この先スクロールてすと
 
 - 13↓
 
 - 14↓
 
 - 15↓
 
 - 16↓
 
 - 17↓
 
 - 18↓
 
 - 19↓
 
 - 20↓
 
 - 21↓
 
 - 22↓
 
 - 23↓
 
 - 24こんな感じ
 
 -       EOS
 
 -       @variable_max = @comment.size
 
 -       @exist = true
 
 -     when 4
 
 -       @title[0] = "\\n[1]の必殺技1"
 
 -       @title[1] = "\\n[1]の必殺技2"
 
 -       @variable = 1
 
 -       @comment[0] = <<-EOS
 
 - 内容その1
 
 - \\pic[0,240,TR2_P05·小雏的逆推]
 
 -       EOS
 
 -       @comment[1] = <<-EOS
 
 - 内容その2
 
 - \\pic[0,240,TR2_P05·小雏的逆推]
 
 -       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
 
 -     # 便宜上、"\\\\" を "\000" に変換
 
 -     text.gsub!(/\\\\/) { "\000" }
 
 -     # "\\C" を "\001" に、"\\G" を "\002" に変換
 
 -     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
 
 -     text.gsub!(/\\[Gg]/) { "\002" }
 
 -     # 不透明度
 
 -     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 == "\000"
 
 -         # 本来の文字に戻す
 
 -         c = "\\"
 
 -       end
 
 -       # \C[n] の場合
 
 -       if c == "\001"
 
 -         # 文字色を変更
 
 -         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 == "\002"
 
 -         # 所持ゴールドに変換
 
 -         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, 96, 320, 416)
 
 -     @column_max = 1
 
 -     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(320, 94, 320, 416)
 
 -     self.contents = Bitmap.new(width - 32, height - 32)
 
 -     @menu_com = Sprite.new
 
 -     @menu_com.bitmap = RPG::Cache.picture("index_top")
 
 -   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, 96)
 
 -     @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
 
 -     @title_window.contents.draw_text(0, 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
 
 -     @title_window.opacity = 150   #日记名窗口透明度
 
 -     @main_window.opacity = 150    #目录窗口透明度
 
 -     @info_window.opacity = 150    #日记内容窗口透明度
 
 -     @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
 
  复制代码 |   
 
 
 
 |