- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 
- #_/    ◆ あらすじ - KGC_Outline ◆ 
- #_/    ◇ Last update : 2007/05/28 ◇ 
- #_/---------------------------------------------------------------------------- 
- #_/  あらすじを閲覧する機能を追加します。 
- #_/  Provides the function to show "Outline". 
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 
-   
- #============================================================================== 
- # ★ カスタマイズ項目 - Customize ★ 
- #============================================================================== 
-   
- module KGC 
-   # ◆あらすじ画面背景透過 
-   OLINE_BACK_TRANSPARENT = true 
-   # ◆スクロール速度【単位:px】 
-   OLINE_SCROLL_SPEED = 8 
-   
-   # ◆通し番号を描画 
-   OLINE_SERIAL_NUMBER = false 
-   # ◆通し番号の桁数 
-   OLINE_SERIAL_NUMBER_DIGITS = 3 
-   
-   # ◆無効なあらすじのタイトル 
-   OLINE_DISABLED_TITLE = "- - - - - - - -" 
-   # ◆無効なあらすじは表示しない 
-   OLINE_HIDE_DISABLED  = true 
-   
-   # ◆完了記号 
-   OLINE_COMPLETION_SYMBOL   = "★" 
-   # ◆未完記号 
-   OLINE_INCOMPLETION_SYMBOL = " " 
-   
-   # ◆あらすじ内容 
-   #  ≪["タイトル", ["本文", ...]], ...≫ 
-   #  本文は、配列の各要素が1行に相当。 
-   #    **** 制御コマンド **** 
-   #  \\V[n]  : 変数 ID:n 
-   #  \\G     : 所持金 
-   #  \\N[n]  : ID:n のアクター名 
-   #  \\EN[n] : ID:n のエネミー名 
-   #  \\IN[n] : ID:n のアイテム名 
-   #  \\WN[n] : ID:n の武器名 
-   #  \\AN[n] : ID:n の防具名 
-   OLINE_CONTENTS = [ 
-     ["操作方法",  # No.0 
-       ["遊戲基本操作:", 
-       "ENTER、SPACE、C鍵:確認/調查/對話    ", 
-       "ESC、X鍵   :取消/呼叫選單", 
-       "↑↓←→     :方向移動", 
-       "同時按下ALT+ENTER鍵:切換全螢幕/視窗畫面",]], 
-     ["魔法屬性",  # No.1 
-       ["突然見知らぬ場所へ飛ばされてしまった。", 
-       "ここは一体どこなのだろうか?", 
-       "", 
-       "……むぅ。", 
-       "ここで腐っていても仕方が無いので、とりあえず周囲の", 
-       "探索をすることになってしまったらしい。", 
-       "はぁ、めんどくさ(´・ω・`)", 
-       "早く帰って風呂入って寝てぇ。", 
-       "", 
-       "\\N[2]「\\N[1]、真面目に書け。」", 
-       "", 
-       "\\N[2]…、見てたの?", 
-       "", 
-       "\\N[2]「当たり前だ。」", 
-       "", 
-       "いや、てか何でお前も書いてるんだ?", 
-       "今日は俺の当番 うわなにをするやめ(ry", 
-       "", 
-       "\\N[2]「まったく、お前に任せるとロクなことを書かないな。", 
-       "明日からお前抜きで書かせて貰うぞ。」", 
-       "", 
-       "そ、そりゃちっとヒドイんではないかい?", 
-       "", 
-       "\\N[2]「反省したか?」", 
-       "", 
-       "うぐ…、すいません。"]], 
-      ["狀態一覽表",  # No.0 
-       ["行動狀態:", 
-       "ENTER、SPACE、C鍵:確認/調查/對話    ", 
-       "ESC、X鍵:  取消/呼叫選單", 
-       "↑↓←→:  方向移動", 
-       "同時按下ALT+ENTER鍵: 切換全螢幕/視窗畫面",]]  
-   ]  # -- Don't delete this line! -- 
- end 
-   
- #### OLINE_BACK_TRANSPARENT 
- ### Makes the background of "Outline" transparency. 
-   
- #### OLINE_SCROLL_SPEED 
- ### Scroll speed. {Unit : pixel} 
-   
- #### OLINE_SERIAL_NUMBER 
- ### Draws the serial number. 
-   
- #### OLINE_SERIAL_NUMBER_DIGITS 
- ### Digits of the serial number. 
-   
- #### OLINE_HIDE_DISABLED 
- ### Hides disabled "Outline". 
-   
- #### OLINE_COMPLETION_SYMBOL 
- ### Completion symbol. 
-   
- #### OLINE_INCOMPLETION_SYMBOL 
- ### Incompletion symbol. 
-   
-   
- #### OLINE_CONTENTS 
- ### Contents of "Outline". 
- #  << ["Title", ["Body", ...]], ... >> 
- #  In the "Body", each element of the array corresponds to one line.  
- #    **** Control statement **** 
- #  \\V[n]  : Variable of ID:n 
- #  \\G     : Money 
- #  \\N[n]  : Actor's name of ID:n 
- #  \\EN[n] : Enemies' name of ID:n 
- #  \\IN[n] : Item's name of ID:n 
- #  \\WN[n] : Weapon's name of ID:n 
- #  \\AN[n] : Armor's name of ID:n 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- $imported = {} if $imported == nil 
- $imported["Outline"] = true 
-   
- #-------------------------------------------------------------------------- 
- # ● あらすじ画面呼び出し 
- #-------------------------------------------------------------------------- 
- def call_outline 
-   # プレイヤーの姿勢を矯正 
-   $game_player.straighten 
-   # あらすじ画面に切り替え 
-   $scene = Scene_Outline.new(true) 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Module - KGC_Outline 
- #============================================================================== 
-   
- module KGC::Outline 
-   #-------------------------------------------------------------------------- 
-   # ● あらすじ有効化 
-   #     index : あらすじ番号 
-   #     value : 有効状態 (true | false) 
-   #-------------------------------------------------------------------------- 
-   def self.set_enabled(index, value = true) 
-     if $game_system.outline_enable == nil 
-       $game_system.outline_enable = [] 
-     end 
-     $game_system.outline_enable[index] = value 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● あらすじ完了 
-   #     index : あらすじ番号 
-   #     value : 完了状態 (true | false) 
-   #-------------------------------------------------------------------------- 
-   def self.set_completed(index, value = true) 
-     if $game_system.outline_complete == nil 
-       $game_system.outline_complete = [] 
-     end 
-     $game_system.outline_complete[index] = value 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 制御コマンド処理 
-   #     string : 処理対象文字列 
-   #-------------------------------------------------------------------------- 
-   def self.apply_control_statement(string) 
-     buf = string.dup 
-     buf.gsub!(/\\V\[(\d+)\]/i) { $game_variables[$1.to_i].to_s } 
-     buf.gsub!(/\\G/i) { $game_party.gold.to_s } 
-     buf.gsub!(/\\N\[(\d+)\]/i) { $game_actors[$1.to_i].name } 
-     buf.gsub!(/\\EN\[(\d+)\]/i) { $data_enemies[$1.to_i].name } 
-     buf.gsub!(/\\IN\[(\d+)\]/i) { $data_items[$1.to_i].name } 
-     buf.gsub!(/\\WN\[(\d+)\]/i) { $data_weapons[$1.to_i].name } 
-     buf.gsub!(/\\AN\[(\d+)\]/i) { $data_armors[$1.to_i].name } 
-     return buf 
-   end 
-   # 
-   # 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Game_System 
- #============================================================================== 
-   
- class Game_System 
-   attr_accessor :outline_enable, :outline_complete 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   alias initialize_KGC_Outline initialize 
-   def initialize 
-     initialize_KGC_Outline 
-   
-     @outline_enable = [] 
-     @outline_complete = [] 
-   end 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Window_OutlineList 
- #------------------------------------------------------------------------------ 
- #  あらすじ一覧を表示するウィンドウです。 
- #============================================================================== 
-   
- class Window_OutlineList < Window_Selectable 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   def initialize 
-     super(0, 64, 160, 400) 
-     self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT 
-     self.index = 0 
-     self.z = 1000 
-     refresh 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 選択あらすじ内容 
-   #-------------------------------------------------------------------------- 
-   def outline 
-     return @data[self.index] 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● リフレッシュ 
-   #-------------------------------------------------------------------------- 
-   def refresh 
-     self.contents.dispose if self.contents != nil 
-     @data = [] 
-     @data_index = [] 
-     # リスト作成 
-     $game_system.outline_enable = [] if $game_system.outline_enable == nil 
-     $game_system.outline_complete = [] if $game_system.outline_complete == nil 
-     KGC::OLINE_CONTENTS.each_with_index { |oline, i| 
-       if $game_system.outline_enable[i] 
-         @data << OutlineList_Info.new(oline[0], oline[1], i) 
-       elsif !KGC::OLINE_HIDE_DISABLED 
-         @data << OutlineList_Info.new(KGC::OLINE_DISABLED_TITLE, nil, i) 
-       end 
-     } 
-     # リスト描画 
-     @item_max = [@data.size, 1].max 
-     self.contents = Bitmap.new(self.width - 32, 32 * @item_max) 
-     if @data.size == 0 
-       @data << OutlineList_Info.new 
-     else 
-       @data.each_index { |i| draw_item(i) } 
-     end 
-     # 根据列表项的数量计算窗口的高度 
-     window_height = [32 * @item_max+32, 400].min 
-     # 设置窗口的高度 
-     self.height = window_height 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 項目描画 
-   #-------------------------------------------------------------------------- 
-   def draw_item(index) 
-     self.contents.fill_rect(0, 32 * index, self.width - 32, 32, Color.new(0, 0, 0, 0)) 
-     # タイトル生成 
-     text = ($game_system.outline_complete[@data[index].index] ? 
-       KGC::OLINE_COMPLETION_SYMBOL : KGC::OLINE_INCOMPLETION_SYMBOL) + 
-       (KGC::OLINE_SERIAL_NUMBER ? sprintf("%0*d : ", 
-       KGC::OLINE_SERIAL_NUMBER_DIGITS, @data[index].index + 1) : "") + 
-       KGC::Outline.apply_control_statement(@data[index].title) 
-     # 描画色設定 
-     self.contents.font.color = $game_system.outline_enable[@data[index].index] ? 
-       normal_color : disabled_color 
-     self.contents.draw_text(0, 32 * index, self.width - 32, 32, text) 
-   end 
- end 
-   
- #============================================================================== 
- # ■ OutlineList_Info 
- #------------------------------------------------------------------------------ 
- #   あらすじ一覧の情報を保持するクラスです。 
- #============================================================================== 
-   
- class OutlineList_Info 
-   attr_accessor :title, :contents, :index 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   def initialize(title = "", contents = nil, index = 0) 
-     @title = title 
-     @contents = contents 
-     @index = index 
-   end 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Window_OutlineTitle 
- #------------------------------------------------------------------------------ 
- #  あらすじの題名を表示するウィンドウです。 
- #============================================================================== 
-   
- class Window_OutlineTitle < Window_Base 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   def initialize 
-     super(0, 0, 640, 64) 
-     self.contents = Bitmap.new(width - 32, height - 32) 
-     self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● リフレッシュ 
-   #     text  : 表示する文字列 
-   #-------------------------------------------------------------------------- 
-   def refresh(text) 
-     self.contents.clear 
-     text2 = KGC::Outline.apply_control_statement(text) 
-     self.contents.draw_text(0, 0, self.width - 32, 32, text2, 1) 
-   end 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Window_Outline 
- #------------------------------------------------------------------------------ 
- #  あらすじ(の内容)を表示するウィンドウです。 
- #============================================================================== 
-   
- class Window_Outline < Window_Base 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #-------------------------------------------------------------------------- 
-   def initialize 
-     super(160, 64, 480, 416) 
-     self.back_opacity = 160 if KGC::OLINE_BACK_TRANSPARENT 
-     self.active = false 
-     refresh 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● リフレッシュ 
-   #     oline : あらすじ 
-   #-------------------------------------------------------------------------- 
-   def refresh(oline = nil) 
-     self.oy = 0 
-     self.contents.dispose if self.contents != nil 
-     return if oline == nil 
-     # 本文を描画 
-     self.contents = Bitmap.new(self.width - 32, 32 * oline.size) 
-     oline.each_with_index { |l ,i| 
-       next if l == nil 
-       text = KGC::Outline.apply_control_statement(l) 
-      self.contents.draw_text(0, i * 32, self.width - 32, 32, text) 
-     } 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● 更新 
-   #-------------------------------------------------------------------------- 
-   def update 
-     super 
-     # スクロール 
-     if self.active 
-       scroll_max = [self.contents.height - (self.height - 32), 0].max 
-       if Input.press?(Input::UP) 
-         self.oy = [self.oy - KGC::OLINE_SCROLL_SPEED, 0].max 
-       elsif Input.press?(Input::DOWN) 
-         self.oy = [self.oy + KGC::OLINE_SCROLL_SPEED, scroll_max].min 
-       elsif Input.repeat?(Input::L) 
-         self.oy = [self.oy - (self.height - 32), 0].max 
-       elsif Input.repeat?(Input::R) 
-         self.oy = [self.oy + (self.height - 32), scroll_max].min 
-       end 
-     end 
-   end 
-   # 
-   # 
- end 
-   
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ 
-   
- #============================================================================== 
- # ■ Scene_Outline 
- #------------------------------------------------------------------------------ 
- #  あらすじ画面の処理を行うクラスです。 
- #============================================================================== 
-   
- class Scene_Outline 
-   #-------------------------------------------------------------------------- 
-   # ● オブジェクト初期化 
-   #     map_call : マップからの呼び出しフラグ 
-   #-------------------------------------------------------------------------- 
-   def initialize(map_call = false) 
-     @map_call = map_call 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● メイン処理 
-   #-------------------------------------------------------------------------- 
-   def main 
-     # スプライトセットを作成 
-     @spriteset = Spriteset_Map.new if KGC::OLINE_BACK_TRANSPARENT 
-     # ウィンドウを作成 
-     @list_window = Window_OutlineList.new 
-     @title_window = Window_OutlineTitle.new 
-     @content_window = Window_Outline.new 
-     # トランジション実行 
-     Graphics.transition 
-     # メインループ 
-     loop { 
-       Graphics.update 
-       Input.update 
-       update 
-       if $scene != self 
-         break 
-       end 
-     } 
-     # トランジション準備 
-     Graphics.freeze 
-     # ウィンドウを解放 
-     @list_window.dispose 
-     @title_window.dispose 
-     @content_window.dispose 
-     @spriteset.dispose if KGC::OLINE_BACK_TRANSPARENT 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● フレーム更新 
-   #-------------------------------------------------------------------------- 
-   def update 
-     # ウィンドウ更新 
-     @list_window.update 
-     @title_window.update 
-     @content_window.update 
-     # アクティブウィンドウ操作 
-     if @list_window.active 
-       update_list 
-     elsif @content_window.active 
-       update_content 
-     end 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● フレーム更新 (リスト) 
-   #-------------------------------------------------------------------------- 
-   def update_list 
-     # B ボタンが押された場合 
-     if Input.trigger?(Input::B) 
-       # キャンセル SE を演奏 
-       $game_system.se_play($data_system.cancel_se) 
-       if @map_call 
-         # マップ画面に切り替え 
-         $scene = Scene_Map.new 
-       else 
-         # メニュー画面に切り替え 
-         if $imported["MenuAlter"] 
-           index = KGC::MA_COMMANDS.index(12) 
-           if index != nil 
-             $scene = Scene_Menu.new(index) 
-           else 
-             $scene = Scene_Menu.new 
-           end 
-         else 
-           $scene = Scene_Menu.new 
-         end 
-       end 
-       return 
-     end 
-     # C ボタンが押された場合 
-     if Input.trigger?(Input::C) 
-       outline = @list_window.outline 
-       # 閲覧できない場合 
-       if outline.contents == nil 
-         # ブザー SE を演奏 
-         $game_system.se_play($data_system.buzzer_se) 
-         return 
-       end 
-       # 決定 SE を演奏 
-       $game_system.se_play($data_system.decision_se) 
-       # あらすじを更新 
-       @title_window.refresh(outline.title) 
-       @content_window.refresh(outline.contents) 
-       # ウィンドウ切り替え 
-       @list_window.active = false 
-       @list_window.z = 0 
-       @content_window.active = true 
-       @content_window.z = 1000 
-       return 
-     end 
-   end 
-   #-------------------------------------------------------------------------- 
-   # ● フレーム更新 (本文) 
-   #-------------------------------------------------------------------------- 
-   def update_content 
-     # B ボタンが押された場合 
-     if Input.trigger?(Input::B) 
-       # キャンセル SE を演奏 
-       $game_system.se_play($data_system.cancel_se) 
-       # ウィンドウ切り替え 
-       @list_window.active = true 
-       @list_window.z = 1000 
-       @content_window.active = false 
-       @content_window.z = 0 
-       return 
-     end 
-   end 
- end