查看: 2343|回复: 2

[已经解决] 关于修改单个窗口的字体大小问题

[复制链接]
梦石
0
星屑
50
在线时间
395 小时
注册时间
2012-1-12
回帖
155
发表于 2015-6-27 17:49:08 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 yl51379 于 2015-6-28 09:46 编辑

我用的是 图书馆中升级自由加点的脚本

这里是原脚本的地址---https://rpg.blue/thread-295517-1-1.html

刚刚找到调字体的地方了  但是又遇到了新的问题  

必杀属性中   数字把箭头给挡住了   有没有办法把所有数字调整得靠前面一点

以下是截图


不好意思    已经找到地方调了

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-6-27 18:04:42 | 显示全部楼层
然而放大了就写不下了

点评

可以考虑换字体?雅黑好像是会显得比较小。只改这个窗口的字体是可以做到的  发表于 2015-6-27 18:42
原来是这样,那来看只能如此了...  发表于 2015-6-27 18:06
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-6-27 18:39:50 | 显示全部楼层
把整個画面放大也是一個方法
1.png
コンフィグ機能追加
  1. =begin

  2.   コンフィグ機能追加スクリプト ver1.111
  3.   
  4.   メニューやタイトルにコンフィグ機能を追加するスクリプトです。
  5.   
  6.   ・画面表示倍率の変更
  7.   ・BGM・MEボリューム
  8.   ・SE・BGSボリューム
  9.   ・戦闘メッセージ速度の変更
  10.   ・ウィンドウトーンの変更
  11.   ・ウィンドウスキンの変更
  12.   ・キー配置の変更、
  13.   ・アニメーション速度の変更
  14.   ・アニメーションの表示の切替
  15.   ・ダッシュ方式の変更
  16.   ・ログカラーの変更
  17.   ・ショートカットの設定
  18.   ・変数の操作
  19.   ・スイッチの操作
  20.   ・GC頻度の設定
  21.   
  22.   が可能です。
  23.   
  24.   
  25.   ------------------------------------------------------------------------------
  26.   ※タイトルでのコンフィグ変更について
  27.   ------------------------------------------------------------------------------
  28.   ver1.10より、タイトルでコンフィグを変更すると、シーンを抜けたときに、
  29.   Config.rvdata2が生成されるようになりました。
  30.   これは、ゲーム起動時とニューゲーム時に読み込まれ、コンフィグの設定を変更します。
  31.   配布の際はこのデータの削除を忘れないように気を付けてください。
  32.   
  33.   ------------------------------------------------------------------------------
  34.   ※パッドについて
  35.   ------------------------------------------------------------------------------
  36.   キー設定があると、環境によってパッドの動作が不安定になる可能性があるため、
  37.   ゲームの解説文やreadme等に無効化の方法を記述することをお勧めします。
  38.   キー設定が設定項目になければ何もしないため、それらの状態を確実に回避したい場合、
  39.   キー設定は項目から除外することをお勧めします。
  40.   
  41.   ver1.11より、iniからキー設定機能を無効化できるようになりました。
  42.   Game.iniに以下の文を追加することで、キー設定機能を無効化し、操作をデフォルトの
  43.   みに設定することができます。記述する際はスペースは削除してください。
  44.   
  45.   [KeyConfig]
  46.   UseKeySetting=false
  47.   
  48.   また、キー設定はパッドのハットスイッチ(十字キー)を使用可能にするため、JoytoKey
  49.   などの外部ツールでハットスイッチにキーを割り当てていた場合、正常な動作をしなく
  50.   なる可能性が高くなります。
  51.   ハットスイッチの設定のみをiniで無効化する場合、以下の記述をiniに加えてください。
  52.   記述する際はスペースは削除してください。
  53.   
  54.   [KeyConfig]
  55.   UsePOV=false
  56.   
  57.   ------------------------------------------------------------------------------
  58.   ※GCの頻度設定について
  59.   ------------------------------------------------------------------------------
  60.   GCとは、ガーベージコレクションというRubyの機能です。
  61.   この機能はプログラムを実行する上で発生したデータのゴミを収集し、掃除するための
  62.   機能ですが、ゲームのデータ領域が拡大しすぎると、この機能の処理に時間がかかり、
  63.   フレームレート低下の原因になるため、頻度を制御することで、フレームレートを安定
  64.   させるのが目的です。
  65.   ただし、この項目の数値を大きく設定するとメモリの消費量が増えるため、基本的には
  66.   導入せず、デフォルトのままで動作させる方が良いので、この設定項目は基本的には利
  67.   用しないことをお勧めします。
  68.   
  69.   ※オートバトルより下に配置してください
  70.   ※インタセプト能力拡張より下に配置してください
  71.   ※このスクリプトはできるだけ下の方に配置してください。
  72.   ※特に理由がない限り、GC頻度の設定はオフを推奨します。
  73.   
  74.   ver1.111:インタセプト拡張と併用時バリア消滅時のメッセージが正常でないバグを修正
  75.   ver1.11:キー設定の項目をiniで無効化する機能を追加
  76.            ウィンドウスキンを変更した後で内部にウィンドウを持つ項目を選択した時、
  77.            正常にスキンが変更されていないバグを修正
  78.            設定を戻すでキー設定が初期化されないバグを修正
  79.            解説を追記、内容を調整
  80.            POVを使用するかどうかを設定する項目を追加
  81.            POVの機能をiniで無効化する機能を追加
  82.            8方向判定用のメソッドの記述が間違っていたのを修正
  83.   ver1.10:キー設定の項目を追加
  84.            ウィンドウサイズ変更時に、変更前のウィンドウの位置を保存するように変更
  85.            タイトル画面にコンフィグの項目を追加
  86.            タイトルへの追加に伴い、タイトルでコンフィグ設定をした場合、設定を出力
  87.            するように変更。ニューゲーム時にこの設定を読み込んで使用します
  88.            メニューなどで表示するコンフィグの名称を設定する項目を追加
  89.            画面サイズの変更をウィンドウの左上基準からウィンドウの中心基準に変更
  90.   ver1.091:ゲームを終了してタイトルに戻った際、画面サイズが元に戻らないバグを修正
  91.            ver2.00未満のインタセプト拡張と同時に導入した場合、エラーがでるバグを修正
  92.   ver1.09:ログカラーの項目を追加
  93.            変数の項目を追加
  94.            スイッチの項目を追加
  95.            導入していない項目が設定初期化で初期化されていたバグを修正
  96.            設定初期化でGC頻度が初期化されないバグを修正
  97.   ver1.081:画面サイズ変更した時、ロード時に自動で画面サイズが変わらないバグを修正
  98.   ver1.08:GC頻度の項目を追加
  99.            ショートカットが正常に動作しないことのあるバグを修正
  100.            低いバージョンのインタセプト拡張と同時に導入した場合、エラー落ちする
  101.            バグを修正
  102.   ver1.071:オーグメント合成と同時に導入していない場合エラー落ちするバグを修正
  103.   ver1.07:ウィンドウスキン変更の項目を追加
  104.            ショートカットの項目を追加
  105.   ver1.06:アニメーションを高速化していた場合、マップで表示されるアニメーションも
  106.            高速化されてしまっていたバグを修正
  107.            アニメーションの高速化を無効化する機能をアニメーションをオフにするスイ
  108.            ッチに追加
  109.   ver1.05:アニメーション高速化の項目を追加
  110.            インタセプト能力拡張のアップデートに合わせて、処理を修正
  111.   ver1.04:アニメーションオフスイッチを戦闘速度通常化スイッチに変更。このスイッチ
  112.            がオンの時、アニメが強制的に表示状態になり、戦闘メッセージ速度が通常に
  113.            戻ります
  114.            戦闘メッセージ速度の下限値を設定する項目を追加
  115.            途中導入時の初期化処理にバグがあったのを修正
  116.   ver1.03:ウィンドウ倍化表示をウィンドウそのものではなくクライアント領域が倍化
  117.            するように変更
  118.            アニメーションOFF機能を無効化するスイッチを追加、これをONにすることで
  119.            アニメーションがOFF設定でもアニメーションを表示することができます
  120.   ver1.02:ヘルプ表示機能を追加
  121.   ver1.01:アニメーション表示のオンオフ機能を追加
  122.            各項目に説明を追加
  123.   ver1.00:公開

  124. =end

  125. $imported_yana_scripts ||= {}
  126. $imported_yana_scripts["Config"] = true

  127. module Config_Setting
  128.   # メニューなどに表示するコンフィグの名称
  129.   ConfigName = "コンフィグ"
  130.   
  131.   # タイトルにコンフィグの項目を追加するか
  132.   TitleConfigEnable = true
  133.   
  134.   # アニメーションOFFを無効化するスイッチ番号(オンの時機能が無効化)
  135.   # アニメーションの高速化も同時に無効化します
  136.   AnimationInvalidSwitch = 11
  137.   
  138.   # ヘルプウィンドウを利用するか
  139.   Use_Help = true
  140.   # 選択したログを非表示にする機能を利用するか
  141.   # この機能がオンの時、:Aキーで選択中のログを非表示にできます
  142.   Hide_Log = true
  143.   # キー設定でデフォルトのキーの編集を許可するか
  144.   # ここをtrueにすると、設定次第ではキーが重複する可能性があります
  145.   # 重複してキー設定が起動できなくなった場合、F1でデフォルトのキー設定を調整してください
  146.   DefaultKeyChangable = true
  147.   
  148.   # キー設定導入時、ハットスイッチ(パッドの十字キー)を使用するか?
  149.   Use_POV = true
  150.             
  151.   Volume_Gauge = {
  152.               :color1 => Color.new(128,255,128), #有効なボリューム値の色
  153.               :color2 => Color.new(128,128,128)  #無効なボリューム値の色
  154.               }
  155.   
  156.   Dash_Cursor = {
  157.               :color1 => Color.new(255,255,255,128), #ダッシュカーソルの色1
  158.               :color2 => Color.new(128,128,255,128)  #ダッシュカーソルの色2
  159.               }
  160.               
  161.   Anime_Cursor = {
  162.               :color1 => Color.new(255,255,255,128), #アニメ表示カーソルの色1
  163.               :color2 => Color.new(255,165,0,128)    #アニメ表示カーソルの色2
  164.               }
  165.               
  166.   Skin_Cursor = {
  167.               :color1 => Color.new(255,255,255,128), #スキン変更カーソルの色1
  168.               :color2 => Color.new(168,255,128,128)  #スキン変更カーソルの色2
  169.               }
  170.               
  171.   Shortcut_Cursor = {
  172.               :color1 => Color.new(255,255,255,128), #ショートカットカーソルの色1
  173.               :color2 => Color.new(255,128,128,128)  #ショートカットカーソルの色2
  174.               }
  175.               
  176.   # 配置 ここからキーを削除すると、コンフィグの項目からも消えます。
  177.   #       また、各項目の順番もここで変更することができます。
  178.   Alignment = [
  179.                :screen_size,       # 画面倍率の設定
  180.                :bgm,               # BGM/MEのボリューム設定
  181.                :se,                # SE/BGSのボリューム設定
  182.                :windowskin,        # ウィンドウスキンの設定
  183.                :window_tone,       # ウィンドウトーンの設定
  184.                :key_setting,       # キーの設定
  185.                :animation_switch,  # アニメーション表示の設定
  186.                :battle_message,    # 戦闘メッセージ速度の設定
  187.                :animation_speed,   # アニメーション速度の設定
  188.                :dash_type,         # ダッシュタイプの設定
  189.                :log_color,         # ログカラーの設定
  190.                :shortcut,          # ショートカットの設定
  191.                :variables1,        # 変数の設定1
  192.                :variables2,        # 変数の設定2
  193.                :switches1,         # スイッチの設定1
  194. #~                :gc_sec,            # GC頻度の設定 この項目を消せばGCは通常通り実行されます。
  195.                :reset              # 全項目のリセット
  196.               ]
  197.   # ショートカットのリスト コマンド名,クラス,メニューシンボル
  198.   # 2つ目の項目を数字に変えることで、コモンイベントをショートカットで呼び出す
  199.   # こともできます。
  200.   # ※エラー回避のため、クラスチェンジ、スキル設定、合成のショートカットをコメントアウト
  201.   def self.shortcut_list
  202.     [
  203.       [Vocab.item,Scene_Item,:item],
  204.       [Vocab.skill,Scene_Skill,:skill],
  205.       [Vocab.equip,Scene_Equip,:equip],
  206.       [Vocab.status,Scene_Status,:status],
  207.       [Vocab.config,Scene_Config,:config],
  208.       ["ロード",Scene_Load,:load],
  209.       [Vocab.save,Scene_Save,:save],
  210.       [Vocab.game_end,Scene_End,:game_end],
  211. #~       [Vocab.class_change,Scene_ClassChange,:class_change],
  212. #~       [Vocab.skill_setting,Scene_SkillSetting,:skill_setting],
  213. #~       [Vocab.compose,Scene_AugmentCompose,:compose],
  214.       ["コモン1",7,:common1],
  215.     ]
  216.   end
  217.   
  218.   # ショートカットを無効化するスイッチのID オンの時無効化
  219.   DisableShortcutSID = 30
  220.   
  221.   # キー => [項目名,初期設定,説明文,追加設定]         
  222.   Contents = {
  223.              # 画面の表示倍率 初期値は等倍
  224.              :screen_size       => ["画面表示倍率",1.0,"画面サイズを変更します。",[1.0,3.0]],
  225.              # BGM,MEの音量 初期値は50%
  226.              :bgm               => ["BGM・ME",0.5,"BGM,MEのボリュームを変更します。"],
  227.              # SE,BGSの音量 初期値は50%
  228.              :se                => ["SE・BGS",0.5,"SE,BGSのボリュームを変更します。"],
  229.              # 背景ウィンドウのスキン 追加設定で項目数を設定します。
  230.              # Graphics/Systemのフォルダ内にWindow○.png(○は数字1~)を項目数-1個分だけ用意してください。
  231.              :windowskin        => ["ウィンドウスキン",0,"ウィンドウのスキンを変更します。",8],
  232.              # 背景ウィンドウの色 初期値はデータベースで設定したもの
  233.              :window_tone       => ["ウィンドウトーン",nil,"ウィンドウのカラーを変更します。"],
  234.              # キー設定の変更 初期値はツクールデフォルトと同じ
  235.                                     # 使用しないキーはnilに、使用するキーは:defaultに設定してください
  236.                                     # ここで順番を変更すると、設定画面でも順番が変更されますが、
  237.                                     # 変更した場合は、下のヘルプやボタン名称の項目も併せて変更してください。
  238.              :key_setting       => ["キー設定",{:C=>:default,:A=>:default,:B=>:default,:X=>:default,
  239.                                                 :Y=>:default,:Z=>nil,:L=>:default,:R=>:default,
  240.                                                 :PAD_C=>:default,:PAD_A=>:default,:PAD_B=>:default,:PAD_X=>:default,
  241.                                                 :PAD_Y=>:default,:PAD_Z=>nil,:PAD_L=>:default,:PAD_R=>:default},
  242.                                     # コンフィグ画面のヘルプに表示する文章
  243.                                     "キー設定を変更します。\nデフォルト設定以外では複数のキーは設定できません。",
  244.                                     # 各項目にカーソルを合わせたときに出るヘルプ。↑の設定と順番を合わせてください
  245.                                     ["決定や会話などに使用します。","ダッシュなどに使用します。",
  246.                                      "キャンセルやメニューなどに使用します。","アイテム画面などでアイテムをソートするのに使用します。",
  247.                                      "アイテム画面やストレージ画面などでアイテムを売ったり\n捨てたりするのに使用します。","使用しません。",
  248.                                      "ショートカット1やオートの起動に使用します。","ショートカット2に使用します。"],
  249.                                      # 各ボタンの名称 こちらも↑の設定と順番を合わせてください
  250.                                      [["C","A","B","X","Y","Z","L","R",  # キーボード用
  251.                                        "PAD_C","PAD_A","PAD_B","PAD_X","PAD_Y","PAD_Z","PAD_L","PAD_R"],# パッド用
  252.                                      # 各用語
  253.                                      "キーボード","ゲームパッド","変更して終了","デフォルトに戻す",
  254.                                      # ヘルプ用のテキスト
  255.                                      "カーソルを合わせて設定したいキーを押してください", # キー設定の一番上に表示するテキスト
  256.                                      "変更内容を決定してキー設定を終了します。",# 終了にカーソルを合わせたときにヘルプに表示するテキスト
  257.                                      "変更内容をデフォルト設定に戻します。"]],# デフォルト設定にカーソルを合わせたときにヘルプに表示するテキスト
  258.              # 戦闘メッセージ速度 初期値は100% 追加設定で下限値が設定できます。
  259.              :battle_message    => ["戦闘メッセージ速度",0.4,"戦闘メッセージの速度を変更します。\n早くしすぎると戦況を理解しづらくなるので注意してください。",0.1],
  260.              # アニメーション表示のオンオフ 初期値はオン
  261.              :animation_switch  => ["アニメーション表示",:on,"アニメーションの表示非表示を変更します。"],
  262.              # アニメーション表示速度 初期値は4
  263.              :animation_speed  => ["アニメーション速度",2,"アニメーションの表示速度を変更します。\nアニメーション非表示の場合は変更できません。",1],
  264.              # ダッシュ方式の設定 :normalでデフォルト、:alwaysで常時ダッシュ 初期値はデフォルト
  265.              :dash_type         => ["ダッシュ方式",:normal,"ダッシュの設定を変更できます。\n通常はボタンを押しているときのみダッシュです。"],  
  266.              # ログカラーの設定 初期値は詳細設定に準拠
  267.              :log_color         => ["ログカラー",nil,"戦闘ログの色を詳細に変更できます。"],  
  268.              # 変数の設定 追加設定で[変数ID,[[項目1の名称,設定値],[項目2の名称,設定値],…]]という風に設定します。
  269.              # また、[変数ID,最低値,最大値]という設定も可能で、こちらで設定すると数値変更式になります。
  270.              # 変数は:variables1,:variables2,:variables3…と複数設定することが可能です。
  271.              :variables1        => ["変数1",105,"変数の値を変更します。",[21,[["変数設定のテスト",1],["テスト2",4],["テスト3",16],["テスト4",33],["テスト終わり",105]]]],
  272.              :variables2        => ["変数2", 10,"変数の値を変更します。",[22,0,20]],
  273.              # スイッチの設定1 追加設定の0番目に対応するスイッチID、以降でオンオフそれぞれに対応する項目名を設定します。
  274.              # スイッチは:switches1,:switches2,:switches3…と複数設定することが可能です。
  275.              :switches1         => ["スイッチ1",true,"スイッチのオンオフ変更します。",[35,"オン","オフ"]],
  276.              # ショートカットの設定 初期値はLがセーブ、Rがロード
  277.              :shortcut          => ["ショートカット",[[:L,0],[:R,2]],"ショートカットの設定を変更できます。\n↑↓キーで設定を変更、←→キーで項目を選択します。"],
  278.              # ガーベージコレクション頻度の設定、初期値は5秒
  279.              :gc_sec            => ["GC頻度",5,"ガーベージコレクションの発生頻度を設定します。\n設定値秒に一度実行されます。",3,30],
  280.              # 設定の初期化
  281.              :reset             => ["設定を戻す",nil,"設定を初期化します。"],
  282.              }
  283.             
  284.   GlobalLogColor = []
  285.   LogColor = []
  286.   
  287.   # グローバルログカラーの設定
  288.   # 各設定項目をひとまとめにした設定を行うことができます。
  289.   # [設定色,設定を行うログカラーインデックスの配列,表示するタイトル,ヘルプに表示する説明]
  290.   # の順で設定します。
  291.   # この中に詳細ログカラーのインデックスを入れることで、詳細ログの設定を追加します。
  292.   GlobalLogColor[0]  = [10,[19,40,44,48],"被ダメージ","味方へのダメージに関するメッセージの色設定。"]
  293.   GlobalLogColor[1]  = [ 2,[18,41,45,49],"与ダメージ","敵へのダメージに関するメッセージの色設定。"]
  294.   GlobalLogColor[2]  = [24,[38,42,46],"味方回復","味方への回復に関するメッセージの色設定。"]
  295.   GlobalLogColor[3]  = [29,[39,43,47],"敵回復","敵への回復に関するメッセージの色設定。"]
  296.   GlobalLogColor[4]  = [ 6,[2,4,6,8,10,12,14,30,32],"味方行動","味方の行動に関するメッセージの色設定。"]
  297.   GlobalLogColor[5]  = [ 5,[3,5,7,9,11,13,15,31,33],"敵行動","敵の行動に関するメッセージの色設定。"]
  298.   GlobalLogColor[6]  = [21,[16,20,23,29,37],"味方ミス","味方の行動が失敗した時のメッセージの色設定。"]
  299.   GlobalLogColor[7]  = [ 4,[17,21,22,28,36],"敵ミス","敵の行動が失敗した時のメッセージの色設定。"]
  300.   GlobalLogColor[8]  = [27,[24,26,34,50,52,54],"味方ステート","味方がステートやバフの効果を受けた時のメッセージの色設定。"]
  301.   GlobalLogColor[9]  = [31,[25,27,35,51,53,55],"敵ステート","敵がステートやバフの効果を受けた時のメッセージの色設定。"]
  302.   GlobalLogColor[10] = [ 0,[0,1,56],"その他","その他のメッセージの色設定。"]
  303.   GlobalLogColor[11] = [10]
  304.   
  305.   # ログカラーの詳細設定
  306.   # インデックスとの対応は各説明に準拠します。
  307.   # -1を設定するとグローバル設定を使用します。
  308.   # グローバル設定がない場合、0が代入されます。
  309.   # 現在継続中のステートの表示:味方
  310.   LogColor[0]  = [-1,"味方:ステート継続","味方側の継続中ステートの継続メッセージの色設定。"]
  311.   # 現在継続中のステートの表示:敵
  312.   LogColor[1]  = [-1,"敵:ステート継続","敵側の継続中ステートの継続メッセージの色設定。"]
  313.   # スキルやアイテムの使用:味方
  314.   LogColor[2]  = [-1,"味方:使用","味方側のスキルやアイテムの使用メッセージの色設定。"]
  315.   # スキルやアイテムの使用:敵
  316.   LogColor[3]  = [-1,"敵:使用","敵側のスキルの使用メッセージの色設定。"]
  317.   # 追撃の発動:味方
  318.   LogColor[4]  = [-1,"味方:追撃","味方側の追撃発動時のメッセージの色設定。"]
  319.   # 追撃の発動:敵
  320.   LogColor[5]  = [-1,"敵:追撃","敵側の追撃発動時のメッセージの色設定。"]
  321.   # 仕返しの発動:味方
  322.   LogColor[6]  = [-1,"味方:仕返し","味方側の仕返し発動時のメッセージの色設定。"]
  323.   # 仕返しの発動:敵
  324.   LogColor[7]  = [-1,"敵:仕返し","敵側の仕返し発動時のメッセージの色設定。"]
  325.   # 割込みの発動:味方
  326.   LogColor[8]  = [-1,"味方:割込み","味方側の割込み発動時のメッセージの色設定。"]
  327.   # 割込みの発動:敵
  328.   LogColor[9]  = [-1,"敵:割込み","敵側の割込み発動時のメッセージの色設定。"]
  329.   # 身代わりの発動:味方
  330.   LogColor[10] = [-1,"味方:身代わり","味方側の身代わり発動時のメッセージの色設定。"]
  331.   # 身代わりの発動:敵
  332.   LogColor[11] = [-1,"敵:身代わり","敵側の身代わり発動時のメッセージの色設定。"]
  333.   # 反撃の発動:味方
  334.   LogColor[12] = [-1,"味方:反撃","味方側の反撃発動時のメッセージの色設定。"]
  335.   # 反撃の発動:敵
  336.   LogColor[13] = [-1,"敵:反撃","敵側の反撃発動時のメッセージの色設定。"]
  337.   # 反射の発動:味方
  338.   LogColor[14] = [-1,"味方:反射","味方側の反射発動時のメッセージの色設定。"]
  339.   # 反射の発動:敵
  340.   LogColor[15] = [-1,"敵:反射","敵側の反射発動時のメッセージの色設定。"]
  341.   # 行動の失敗:味方
  342.   LogColor[16] = [-1,"味方:行動失敗","味方側の行動失敗時のメッセージの色設定。"]
  343.   # 行動の失敗:敵
  344.   LogColor[17] = [-1,"敵:行動失敗","敵側の行動失敗時のメッセージの色設定。"]
  345.   # 会心の発動:味方
  346.   LogColor[18] = [-1,"味方:会心","味方側の会心発生時のメッセージの色設定。"]
  347.   # 会心の発動:敵
  348.   LogColor[19] = [-1,"敵:痛恨","敵側の痛恨発生時のメッセージの色設定。"]
  349.   # ミスの表示:味方
  350.   LogColor[20] = [-1,"味方:ミス","味方側のミス発生時のメッセージの色設定。"]
  351.   # ミスの表示:敵
  352.   LogColor[21] = [-1,"敵:ミス","敵側のミス発生時のメッセージの色設定。"]
  353.   # 回避の表示:味方
  354.   LogColor[22] = [-1,"味方:回避","味方側の回避発生時のメッセージの色設定。"]
  355.   # 回避の表示:敵
  356.   LogColor[23] = [-1,"敵:回避","敵側の回避発生時のメッセージの色設定。"]
  357.   # 付与されたステートの表示:味方
  358.   LogColor[24] = [-1,"味方:ステート付与","味方側にステートが付与された時のメッセージの色設定。"]
  359.   # 付与されたステートの表示:敵
  360.   LogColor[25] = [-1,"敵:ステート付与","敵側にステートが付与された時のメッセージの色設定。"]
  361.   # 解除されたステートの表示:味方
  362.   LogColor[26] = [-1,"味方:ステート解除","味方側のステートが解除された時のメッセージの色設定。"]
  363.   # 解除されたステートの表示:敵
  364.   LogColor[27] = [-1,"敵:ステート解除","敵側のステートが解除された時のメッセージの色設定。"]
  365.   # パリィの表示:味方
  366.   LogColor[28] = [-1,"味方:パリィ","味方側のパリィ発生時のメッセージの色設定。"]
  367.   # パリィの表示:敵
  368.   LogColor[29] = [-1,"敵:パリィ","敵側のパリィ発生時のメッセージの色設定。"]
  369.   # ガードの表示:味方
  370.   LogColor[30] = [-1,"味方:ガード","味方側のガード発生時のメッセージの色設定。"]
  371.   # ガードの表示:敵
  372.   LogColor[31] = [-1,"敵:ガード","敵側のパリィ発生時のメッセージの色設定。"]
  373.   # バリアの表示:味方
  374.   LogColor[32] = [-1,"味方:バリア","味方側のバリア発生時のメッセージの色設定。"]
  375.   # バリアの表示:敵
  376.   LogColor[33] = [-1,"敵:バリア","敵側のバリア発生時のメッセージの色設定。"]
  377.   # バリア破壊の表示:味方
  378.   LogColor[34] = [-1,"味方:バリア破壊","味方側のバリアが壊れた時のメッセージの色設定。"]
  379.   # バリア破壊の表示:敵
  380.   LogColor[35] = [-1,"敵:バリア破壊","敵側のバリアが壊れた時のメッセージの色設定。"]
  381.   # 幻影回避の表示:味方
  382.   LogColor[36] = [-1,"味方:幻影回避","味方側の幻影回避が発生した時のメッセージの色設定。"]
  383.   # 幻影回避の表示:敵
  384.   LogColor[37] = [-1,"敵:幻影回避","敵側の幻影回避が発生した時のメッセージの色設定。"]
  385.   # HP回復の表示:味方
  386.   LogColor[38] = [-1,"味方:HP回復","味方側のHPが回復した時のメッセージの色設定。"]
  387.   # HP回復の表示:敵
  388.   LogColor[39] = [-1,"敵:HP回復","敵側のHPが回復した時のメッセージの色設定。"]
  389.   # HPダメージの表示:味方
  390.   LogColor[40] = [-1,"味方:HPダメ―ジ","味方側がダメージを受けた時のメッセージの色設定。"]
  391.   # HPダメージの表示:敵
  392.   LogColor[41] = [-1,"敵:HPダメージ","敵側にダメージを与えた時のメッセージの色設定。"]
  393.   # MP回復の表示:味方
  394.   LogColor[42] = [-1,"味方:MP回復","味方側のMPが回復した時のメッセージの色設定。"]
  395.   # MP回復の表示:敵
  396.   LogColor[43] = [-1,"敵:MP回復","敵側のMPが回復した時のメッセージの色設定。"]
  397.   # MPダメージの表示:味方
  398.   LogColor[44] = [-1,"味方:MPダメージ","味方側がMPダメージを受けた時のメッセージの色設定。"]
  399.   # MPダメージの表示:敵
  400.   LogColor[45] = [-1,"敵:MPダメージ","敵側にMPダメージを与えた時のメッセージの色設定。"]
  401.   # TP回復の表示:味方
  402.   LogColor[46] = [-1,"味方:TP回復","味方側のTPが回復した時のメッセージの色設定。"]
  403.   # TP回復の表示:敵
  404.   LogColor[47] = [-1,"敵:TP回復","敵側のTPが回復した時のメッセージの色設定。"]
  405.   # TPダメージの表示:味方
  406.   LogColor[48] = [-1,"味方:TPダメ―ジ","味方側がTPダメージを受けた時のメッセージの色設定。"]
  407.   # TPダメージの表示:敵
  408.   LogColor[49] = [-1,"敵:TPダメージ","敵側にTPダメージを与えた時のメッセージの色設定。"]
  409.   # 付与されたバフの表示:味方
  410.   LogColor[50] = [-1,"味方:バフ付与","味方側にバフが付与された時のメッセージの色設定。"]
  411.   # 付与されたバフの表示:敵
  412.   LogColor[51] = [-1,"敵:バフ付与","敵側にバフが付与された時のメッセージの色設定。"]
  413.   # 付与されたデバフの表示:味方
  414.   LogColor[52] = [-1,"味方:デバフ付与","味方側にデバフが付与された時のメッセージの色設定。"]
  415.   # 付与されたデバフの表示:敵
  416.   LogColor[53] = [-1,"敵:デバフ付与","敵側にデバフが付与された時のメッセージの色設定。"]
  417.   # 解除されたバフの表示:味方
  418.   LogColor[54] = [-1,"味方:バフ解除","味方側のバフが解除された時のメッセージの色設定。"]
  419.   # 解除されたバフの表示:敵
  420.   LogColor[55] = [-1,"敵:バフ解除","敵側のバフが解除された時のメッセージの色設定。"]
  421.   # その他、設定されていないログの表示
  422.   LogColor[56] = [-1,"その他","その他のメッセージの色設定。"]
  423. end

  424. module Keycode
  425.   JoyInfo = [:size,:flags,:AxisX,:AxisY,:AxisZ,:AngleZ,
  426.              :ext1,:ext2,:Button,:Input,:POV,:ext3,:ext4]
  427.   JoyButton = {:button1 =>  1, :button2 => 2, :button3 => 4,:button4 => 8,
  428.                :button5 => 16,:button6 => 32,:button7 =>64,:button8 => 128,
  429.                :button9 =>256,:button10=>512,:button11=>1024,:button12=>2048}
  430.                
  431.   POV = {:UP=>0,:RIGHT=>9000,:DOWN=>18000,:LEFT=>27000,
  432.          :UR=>4500,:DR=>13500,:DL=>22500,:UL=>31500}
  433.   Code = {
  434.     8=>[:V_BS,"BackSpace"],
  435.     9=>[:V_TAB,"Tab"],
  436.     12=>[:V_CLEAR,"Clear"],
  437.     13=>[:V_RETURN,"Enter"],
  438.     16=>[:V_SHIFT,"Shift"],
  439.     17=>[:V_CTRL,"Ctrl"],
  440.     18=>[:V_ALT,"Alt"],
  441.     19=>[:V_PAUSE,"Pause"],
  442.     20=>[:V_CAPSLOCK,"CapsLock"],
  443.     27=>[:V_ESC,"Esc"],
  444.     29 => [:V_NC,"無変換"],   #        無変換
  445.     32 => [:V_SPACE,"Space"],#  Space
  446.     33 => [:V_PU,"PageUp"],   #        PageUp
  447.     34 => [:V_PD,"PageDown"],   #        PageDown
  448.     35 => [:V_END,"End"],  #        End
  449.     36 => [:V_HOME,"Home"], #        Home
  450.     37 => [:V_LEFT,"←"], #        ←
  451.     38 => [:V_UP,"↑"],   #        ↑
  452.     39 => [:V_RIGHT,"→"],#        →
  453.     40 => [:V_DOWN,"↓"], #        ↓
  454.     44 => [:V_PS,"PrintScreen"],   #        PrintScreen
  455.     45 => [:V_INS,"Insert"],  #        Insert
  456.     46 => [:VK_DEL,"Delete"], #        Delete
  457.     48 => [:V_0,"0"],    #        0
  458.     49 => [:V_1,"1"],    #        1
  459.     50 => [:V_2,"2"],    #        2
  460.     51 => [:V_3,"3"],    #        3
  461.     52 => [:V_4,"4"],    #        4
  462.     53 => [:V_5,"5"],    #        5
  463.     54 => [:V_6,"6"],    #  6
  464.     55 => [:V_7,"7"],    #  7
  465.     56 => [:V_8,"8"],    #  8
  466.     57 => [:V_9,"9"],    #        9
  467.     65 => [:V_A,"A"],    #        A
  468.     66 => [:V_B,"B"],    #        B
  469.     67 => [:V_C,"C"],    #        C
  470.     68 => [:V_D,"D"],    #        D
  471.     69 => [:V_E,"E"],    #        E
  472.     70 => [:V_F,"F"],    #        F
  473.     71 => [:V_G,"G"],    #        G
  474.     72 => [:V_H,"H"],    #        H
  475.     73 => [:V_I,"I"],    #        I
  476.     74 => [:V_J,"J"],    #        J
  477.     75 => [:V_K,"K"],    #        K
  478.     76 => [:V_L,"L"],    #        L
  479.     77 => [:V_M,"M"],    #        M
  480.     78 => [:V_N,"N"],   #        N
  481.     79 => [:V_O,"O"],    #        O
  482.     80 => [:V_P,"P"],    #        P
  483.     81 => [:V_Q,"Q"],    #        Q
  484.     82 => [:V_R,"R"],    #        R
  485.     83 => [:V_S,"S"],    #        S
  486.     84 => [:V_T,"T"],    #        T
  487.     85 => [:V_U,"U"],    #        U
  488.     86 => [:V_V,"V"],    #        V
  489.     87 => [:V_W,"W"],    #        W
  490.     88 => [:V_X,"X"],    #        X
  491.     89 => [:V_Y,"Y"],    #        Y
  492.     90 => [:V_Z,"Z"],    #        Z
  493.     91 => [:V_LWIN,"左Windows"], #        左Windows
  494.     92 => [:V_RWIN,"右Windows"], #        右Windows
  495.     93 => [:V_APP,"AppMenu"],  #        ApplicationMenu
  496.     96 => [:V_N0,"NumPad_0"],   #        VK_NUMPAD0        0
  497.     97 => [:V_N1,"NumPad_1"],   #        VK_NUMPAD1        1
  498.     98 => [:V_N2,"NumPad_2"],   #        VK_NUMPAD2        2
  499.     99 => [:V_N3,"NumPad_3"],   #        VK_NUMPAD3        3
  500.     100 => [:V_N4,"NumPad_4"],  #        VK_NUMPAD4        4
  501.     101 => [:V_N5,"NumPad_5"],  #        VK_NUMPAD5        5
  502.     102 => [:V_N6,"NumPad_6"],  #        VK_NUMPAD6        6
  503.     103 => [:V_N7,"NumPad_7"],  #        VK_NUMPAD7        7
  504.     104 => [:V_N8,"NumPad_8"],  #        VK_NUMPAD8        8
  505.     105 => [:V_N9,"NumPad_9"],  #        VK_NUMPAD9        9
  506.     106 => [:V_MULTI,"NumPad_*"],#        VK_MULTIPLY        *
  507.     107 => [:V_ADD,"NumPad_+"], #        VK_ADD        +
  508.     109 => [:V_SUB,"NumPad_-"], #        VK_SUBTRACT        -
  509.     110 => [:V_DEC,"NumPad_."], #        VK_DECIMAL        .
  510.     111 => [:V_DIV,"NumPad_/"], #        VK_DIVIDE        /
  511.     112 => [:V_F1,"F1"],#        VK_F1        F1
  512.     113 => [:V_F2,"F2"],#        VK_F2        F2
  513.     114 => [:V_F3,"F3"],#        VK_F3        F3
  514.     115 => [:V_F4,"F4"],#        VK_F4        F4
  515.     116 => [:V_F5,"F5"],#        VK_F5        F5
  516.     117 => [:V_F6,"F6"],#        VK_F6        F6
  517.     118 => [:V_F7,"F7"],#        VK_F7        F7
  518.     119 => [:V_F8,"F8"],#        VK_F8        F8
  519.     120 => [:V_F9,"F9"],#        VK_F9        F9
  520.     121 => [:V_F10,"F10"],#        VK_F10        F10
  521.     122 => [:V_F11,"F11"],#        VK_F11        F11
  522.     123 => [:V_F12,"F12"],#        VK_F12        F12
  523.     144 => [:V_NL,"NumLock"],#        VK_NUMLOCK        NumLock
  524.     145 => [:V_SCL,"ScrollLock"],#        VK_SCROLL        ScrollLock
  525.     186 => [:V_CR, ":"],#        :
  526.     187 => [:V_SCR,";"],#        ;
  527.     188 => [:V_CNM,","],#        ,
  528.     189 => [:V_HI, "-"],#        -
  529.     190 => [:V_PI,"."],#        .
  530.     191 => [:V_SL,"/"],#        /
  531.     192 => [:V_AT,"@"],#        @
  532.     219 => [:V_KS,"["],#        [
  533.     220 => [:V_EN,"\"],#        \
  534.     221 => [:V_KE,"]"],#        ]
  535.     222 => [:V_BEKI,"#"],#^
  536.     226 => [:V_EN2,"\"],#        \
  537.     229 => [:V_HZ,"半角/全角"],#        半角/全角
  538.     229 => [:V_MK,"前候補"],#        前候補
  539.     242 => [:V_KH,"カタカナひらがな"],#        カタカナひらがな
  540. #~     240 => [:V_CL,"CapsLock"],#        CapsLock
  541.   }
  542.   
  543.   def self.press?(joyinfo)
  544.     r = []
  545.     JoyButton.each{|key,value|
  546.       r.push(key) if (value & joyinfo) != 0
  547.     }
  548.     r
  549.   end
  550. end

  551. #==============================================================================
  552. #■ Audio
  553. #------------------------------------------------------------------------------
  554. #   音楽再生用のモジュール。エイリアスを行い、ボリュームコントロールを追加します。
  555. #==============================================================================
  556. module Audio
  557.   # 特異メソッドのエイリアス
  558.   instance_eval{alias bgm_play_config bgm_play}
  559.   instance_eval{alias bgs_play_config bgs_play}
  560.   instance_eval{alias se_play_config se_play}
  561.   instance_eval{alias me_play_config me_play}
  562.   
  563.   # bgmの再生
  564.   def self.bgm_play(filename, volume=100, pitch=100, pos=0)
  565.     tune_volume = $game_system.nil? ? 1.0 : $game_system.bgm_volume
  566.     bgm_play_config(filename, volume * tune_volume, pitch, pos)
  567.   end

  568.   # bgsの再生
  569.   def self.bgs_play(filename, volume=100, pitch=100, pos=0)
  570.     tune_volume = $game_system.nil? ? 1.0 : $game_system.se_volume
  571.     bgs_play_config(filename, volume * tune_volume, pitch, pos)
  572.   end
  573.   
  574.   # seの再生
  575.   def self.se_play(filename, volume=100, pitch=100)
  576.     tune_volume = $game_system.nil? ? 1.0 : $game_system.se_volume
  577.     se_play_config(filename, volume * tune_volume, pitch)
  578.   end
  579.   
  580.   # meの再生
  581.   def self.me_play(filename, volume=100, pitch=100)
  582.     tune_volume = $game_system.nil? ? 1.0 : $game_system.bgm_volume
  583.     me_play_config(filename, volume * tune_volume, pitch)
  584.   end
  585. end

  586. class << Cache
  587.   alias config_system system
  588.   def system(filename)
  589.     if filename == "Window" && $game_system && $game_system.windowskin > 0
  590.       filename += $game_system.windowskin.to_s
  591.     end
  592.     config_system(filename)
  593.   end
  594. end

  595. #==============================================================================
  596. # ■ Vocab
  597. #------------------------------------------------------------------------------
  598. #  用語とメッセージを定義するモジュールです。定数でメッセージなどを直接定義す
  599. # るほか、グローバル変数 $data_system から用語データを取得します。
  600. # コンフィグを追加します。
  601. #==============================================================================

  602. module Vocab
  603.   def self.config;Config_Setting::ConfigName; end
  604. end

  605. class << DataManager
  606.   #--------------------------------------------------------------------------
  607.   # ● ロードの実行(例外処理なし)
  608.   #--------------------------------------------------------------------------
  609.   alias config_load_game_without_rescue load_game_without_rescue
  610.   def load_game_without_rescue(index)
  611.     f = config_load_game_without_rescue(index)
  612.     return f unless f
  613.     $game_system.resize_screen($game_system.screen_size)
  614.     f
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● セーブヘッダの作成
  618.   #--------------------------------------------------------------------------
  619.   alias config_make_save_header make_save_header
  620.   def make_save_header
  621.     header = config_make_save_header
  622.     header[:windowskin] = $game_system.windowskin
  623.     header[:window_tone] = $game_system.window_tone.dup
  624.     header
  625.   end
  626.   
  627.   alias config_create_game_objects create_game_objects
  628.   def create_game_objects
  629.     config_create_game_objects
  630.     if config_file_exists?
  631.       load_config_data
  632.       $game_system.resize_screen($game_system.screen_size)
  633.       if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] } ||
  634.          Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
  635.         $game_system.set_variables_and_switches
  636.       end
  637.     else
  638.       $game_system.setting_reset
  639.     end
  640.   end
  641.   
  642.   def save_config_parameters_without_rescue
  643.     File.open("Config.rvdata2", "wb") do |file|
  644.       Marshal.dump(make_save_config_contents, file)
  645.     end
  646.     return true
  647.   end
  648.   
  649.   def save_config_parameters
  650.     begin
  651.       save_config_parameters_without_rescue
  652.     rescue
  653.       delete_config_file
  654.       false
  655.     end
  656.   end
  657.   
  658.   def delete_config_file
  659.     File.delete("Config.rvdata2") rescue nil
  660.   end
  661.   
  662.   def make_save_config_contents
  663.     contents = {}
  664.     contents[:bgm_volume]          = $game_system.bgm_volume          if Config_Setting::Alignment.include?(:bgm)
  665.     contents[:se_volume]           = $game_system.se_volume           if Config_Setting::Alignment.include?(:se)
  666.     contents[:dash_type]           = $game_system.dash_type           if Config_Setting::Alignment.include?(:dash_type)
  667.     contents[:battle_message]      = $game_system.battle_message      if Config_Setting::Alignment.include?(:battle_message)
  668.     contents[:screen_size]         = $game_system.screen_size         if Config_Setting::Alignment.include?(:screen_size)
  669.     contents[:default_window_tone] = $game_system.default_window_tone if Config_Setting::Alignment.include?(:window_tone)
  670.     contents[:window_tone]         = $game_system.window_tone         if Config_Setting::Alignment.include?(:window_tone)
  671.     contents[:windowskin]          = $game_system.windowskin          if Config_Setting::Alignment.include?(:windowskin)
  672.     contents[:animation_switch]    = $game_system.animation_switch    if Config_Setting::Alignment.include?(:animation_switch)
  673.     contents[:animation_speed]     = $game_system.animation_speed     if Config_Setting::Alignment.include?(:animation_speed)
  674.     contents[:shortcut]            = $game_system.shortcut            if Config_Setting::Alignment.include?(:shortcut)
  675.     contents[:gc_sec]              = $game_system.gc_sec              if Config_Setting::Alignment.include?(:gc_sec)
  676.     contents[:key_setting]         = $game_system.key_setting         if Config_Setting::Alignment.include?(:key_setting)
  677.     contents[:log_colors]          = $game_system.log_colors          if Config_Setting::Alignment.include?(:log_colors)
  678.     contents[:variables]           = $game_system.variables           if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] }
  679.     contents[:switches]            = $game_system.switches            if Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
  680.     contents
  681.   end
  682.   
  683.   def load_config_data
  684.     contents = load_data("Config.rvdata2")
  685.     $game_system.bgm_volume          = contents[:bgm_volume]            if Config_Setting::Alignment.include?(:bgm)
  686.     $game_system.se_volume           = contents[:se_volume]             if Config_Setting::Alignment.include?(:se)
  687.     $game_system.dash_type           = contents[:dash_type]             if Config_Setting::Alignment.include?(:dash_type)
  688.     $game_system.battle_message      = contents[:battle_message]        if Config_Setting::Alignment.include?(:battle_message)
  689.     $game_system.screen_size         = contents[:screen_size]           if Config_Setting::Alignment.include?(:screen_size)
  690.     $game_system.default_window_tone = contents[:default_window_tone]   if Config_Setting::Alignment.include?(:window_tone)
  691.     $game_system.window_tone         = contents[:window_tone]           if Config_Setting::Alignment.include?(:window_tone)
  692.     $game_system.windowskin          = contents[:windowskin]            if Config_Setting::Alignment.include?(:windowskin)
  693.     $game_system.animation_switch    = contents[:animation_switch]      if Config_Setting::Alignment.include?(:animation_switch)
  694.     $game_system.animation_speed     = contents[:animation_speed]       if Config_Setting::Alignment.include?(:animation_speed)
  695.     $game_system.shortcut            = contents[:shortcut]              if Config_Setting::Alignment.include?(:shortcut)
  696.     $game_system.gc_sec              = contents[:gc_sec]                if Config_Setting::Alignment.include?(:gc_sec)
  697.     $game_system.key_setting         = contents[:key_setting]           if Config_Setting::Alignment.include?(:key_setting)
  698.     $game_system.log_colors          = contents[:log_colors]            if Config_Setting::Alignment.include?(:log_colors)
  699.     $game_system.variables           = contents[:variables]             if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] }
  700.     $game_system.switches            = contents[:switches]              if Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
  701.   end
  702.   
  703.   def config_file_exists?
  704.     !Dir.glob('Config.rvdata2').empty?
  705.   end
  706. end

  707. class Game_Temp
  708.   attr_accessor :use_key_setting
  709.   attr_accessor :use_pov
  710. end


  711. #==============================================================================
  712. # ■ Game_System
  713. #------------------------------------------------------------------------------
  714. #  システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
  715. # します。このクラスのインスタンスは $game_system で参照されます。
  716. # BGM・ME、BGS・SEのボリューム、ダッシュタイプを設定するための変数を追加します。
  717. #==============================================================================

  718. class Game_System
  719.   attr_accessor :bgm_volume
  720.   attr_accessor :se_volume
  721.   attr_accessor :dash_type
  722.   attr_accessor :battle_message
  723.   attr_accessor :screen_size
  724.   attr_accessor :default_window_tone
  725.   attr_accessor :windowskin
  726.   attr_accessor :animation_switch
  727.   attr_accessor :animation_speed
  728.   attr_accessor :shortcut
  729.   attr_accessor :gc_sec
  730.   attr_accessor :key_setting
  731.   attr_accessor :log_colors
  732.   attr_accessor :variables
  733.   attr_accessor :switches
  734.   
  735.   def setting_reset
  736.     @bgm_volume = default(:bgm)                    if Config_Setting::Alignment.include?(:bgm)
  737.     @se_volume = default(:se)                      if Config_Setting::Alignment.include?(:se)
  738.     @dash_type = default(:dash_type)               if Config_Setting::Alignment.include?(:dash_type)
  739.     @battle_message = default(:battle_message)     if Config_Setting::Alignment.include?(:battle_message)
  740.     @windowskin = default(:windowskin)             if Config_Setting::Alignment.include?(:windowskin)
  741.     @window_tone = default_window_tone             if Config_Setting::Alignment.include?(:window_tone)
  742.     @animation_switch = default(:animation_switch) if Config_Setting::Alignment.include?(:animation_switch)
  743.     @animation_speed = default(:animation_speed)   if Config_Setting::Alignment.include?(:animation_speed)
  744.     @shortcut = default(:shortcut)                 if Config_Setting::Alignment.include?(:shortcut)
  745.     @log_colors = default(:log_color)              if Config_Setting::Alignment.include?(:log_color)
  746.     @gc_sec = default(:gc_sec)                     if Config_Setting::Alignment.include?(:gc_sec)
  747.     @key_setting = default(:key_setting)           if Config_Setting::Alignment.include?(:key_setting)
  748.    
  749.     if Config_Setting::Alignment.include?(:screen_size)
  750.       @screen_size = default(:screen_size)
  751.       resize_screen(@screen_size)
  752.     end
  753.    
  754.     @variables = {}
  755.     @switches  = {}
  756.     Config_Setting::Alignment.select{|a|
  757.       if a.to_s[/^variables(\d+)/]
  758.         @variables[extend_setting(a)[0]] = default(a)
  759.       elsif a.to_s[/^switches(\d+)/]
  760.         @switches[extend_setting(a)[0]]  = default(a)
  761.       end
  762.     }
  763.     set_variables_and_switches
  764.   end
  765.   
  766.   def set_variables_and_switches
  767.     @variables.each{|key,value| $game_variables[key] = value }
  768.     @switches.each{|key,value| $game_switches[key] = value }
  769.   end
  770.   
  771.   def default(content)
  772.     Marshal.load(Marshal.dump(Config_Setting::Contents[content][1]))
  773.   end
  774.   
  775.   def extend_setting(content)
  776.     Config_Setting::Contents[content][3]
  777.   end
  778.   
  779.   def description(content)
  780.     Config_Setting::Contents[content][2]
  781.   end
  782.   
  783.   # BGM・MEのボリューム nil対策を導入します。
  784.   def bgm_volume
  785.     @bgm_volume = default(:bgm) unless @bgm_volume
  786.     return @bgm_volume
  787.   end
  788.   
  789.   # SE・BGSのボリューム nil対策を導入します。
  790.   def se_volume
  791.     @se_volume = default(:se) unless @se_volume
  792.     return @se_volume
  793.   end
  794.   
  795.   # ダッシュタイプ nil対策を導入します。
  796.   def dash_type
  797.     @dash_type = default(:dash_type) unless @dash_type
  798.     return @dash_type
  799.   end
  800.   
  801.   # アニメーション表示 nil対策を導入します。
  802.   def animation_switch
  803.     @animation_switch = default(:animation_switch) unless @animation_switch
  804.     return @animation_switch
  805.   end
  806.   
  807.   # アニメーション速度 nil対策を導入します。
  808.   def animation_speed
  809.     @animation_speed = default(:animation_speed) unless @animation_speed
  810.     return @animation_speed
  811.   end
  812.   # 戦闘メッセージ速度
  813.   def battle_message
  814.     @battle_message = default(:battle_message) unless @battle_message
  815.     return @battle_message
  816.   end
  817.   # 画面のズーム率
  818.   def screen_size
  819.     @screen_size = default(:screen_size) unless @screen_size
  820.     return @screen_size
  821.   end
  822.   # ウィンドウスキン
  823.   def windowskin
  824.     @windowskin = default(:windowskin) unless @windowskin
  825.     return @windowskin
  826.   end
  827.   
  828.   def windowskin_size
  829.     extend_setting(:windowskin)
  830.   end
  831.   # ショートカット
  832.   def shortcut
  833.     @shortcut = default(:shortcut) unless @shortcut
  834.     @shortcut = default(:shortcut) if @shortcut.empty?
  835.     return @shortcut
  836.   end
  837.   
  838.   def shortcut_size
  839.     default(:shortcut).size
  840.   end
  841.   # GC
  842.   def gc_sec
  843.     @gc_sec = default(:gc_sec) unless @gc_sec
  844.     return @gc_sec
  845.   end
  846.   def gc_sec_min
  847.     Config_Setting::Contents[:gc_sec][3]
  848.   end
  849.   def gc_sec_max
  850.     Config_Setting::Contents[:gc_sec][4]
  851.   end
  852.   # ログカラー
  853.   def log_colors
  854.     unless @log_colors
  855.       @log_colors = Config_Setting::LogColor.inject([]){|r,c| r += [c[0]]}
  856.       @log_colors.each_with_index{|c,i|
  857.         Config_Setting::GlobalLogColor.each{|gc|
  858.             @log_colors[i] = gc[0] if gc[1] && gc[1].include?(i)}
  859.       }
  860.     end
  861.     return @log_colors
  862.   end
  863.   # 画面のリサイズ
  864.   def resize_screen(n)
  865.     Graphics.resize_window(n)
  866.     @screen_size = n
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ● ウィンドウカラーの設定
  870.   #--------------------------------------------------------------------------
  871.   alias extend_window_tone window_tone=
  872.   def window_tone=(window_tone)
  873.     @default_window_tone = @window_tone unless @default_window_tone
  874.     extend_window_tone(window_tone)
  875.   end
  876.   
  877.   def set_default_window_tone
  878.     extend_window_tone(@default_window_tone)
  879.   end
  880.   
  881.   def default_window_tone
  882.     return @default_window_tone if @default_window_tone
  883.     return @window_tone
  884.   end
  885.   
  886.   def variables
  887.     return @variables if @variables
  888.     @variables = {} unless @variables
  889.     Config_Setting::Alignment.select{|a|
  890.       @variables[extend_setting(a)[0]] = default(a) if a.to_s[/^variables(\d+)/]
  891.     }
  892.     return @variables
  893.   end
  894.   
  895.   def switches
  896.     return @switches if @switches
  897.     @switches = {} unless @switches
  898.     Config_Setting::Alignment.select{|a|
  899.       @switches[extend_setting(a)[0]] = default(a) if a.to_s[/^switches(\d+)/]
  900.     }
  901.     return @switches
  902.   end
  903.   
  904.   def log_color(type,actor=false,sup=false)
  905.     case type
  906.     when :current_state ;return actor ? log_colors[0] : log_colors[1]
  907.     when :use_item      ;return actor ? log_colors[2] : log_colors[3]
  908.     when :chase         ;return actor ? log_colors[4] : log_colors[5]
  909.     when :retaliation   ;return actor ? log_colors[6] : log_colors[7]
  910.     when :interrupt     ;return actor ? log_colors[8] : log_colors[9]
  911.     when :substitute    ;return actor ? log_colors[10] : log_colors[11]
  912.     when :counter       ;return actor ? log_colors[12] : log_colors[13]
  913.     when :reflection    ;return actor ? log_colors[14] : log_colors[15]
  914.     when :failure       ;return actor ? log_colors[16] : log_colors[17]
  915.     when :critical      ;return actor ? log_colors[18] : log_colors[19]
  916.     when :miss          ;return actor ? log_colors[20] : log_colors[21]
  917.     when :evasion       ;return actor ? log_colors[22] : log_colors[23]
  918.     when :added_states  ;return actor ? log_colors[24] : log_colors[25]
  919.     when :removed_states;return actor ? log_colors[26] : log_colors[27]
  920.     when :parry         ;return actor ? log_colors[28] : log_colors[29]
  921.     when :guard         ;return actor ? log_colors[30] : log_colors[31]
  922.     when :barrier       ;return actor ? log_colors[32] : log_colors[33]
  923.     when :barrier_broken;return actor ? log_colors[34] : log_colors[35]
  924.     when :genei_evasion ;return actor ? log_colors[36] : log_colors[37]
  925.     when :hp_damage
  926.       if sup
  927.         return actor ? log_colors[38] : log_colors[39]
  928.       else
  929.         return actor ? log_colors[40] : log_colors[41]
  930.       end
  931.     when :mp_damage
  932.       if sup
  933.         return actor ? log_colors[42] : log_colors[43]
  934.       else
  935.         return actor ? log_colors[44] : log_colors[45]
  936.       end
  937.     when :tp_damage
  938.       if sup
  939.         return actor ? log_colors[46] : log_colors[47]
  940.       else
  941.         return actor ? log_colors[48] : log_colors[49]
  942.       end
  943.     when :buffs
  944.       if sup == :add_buff
  945.         return actor ? log_colors[50] : log_colors[51]
  946.       elsif sup == :remove_buff
  947.         return actor ? log_colors[52] : log_colors[53]
  948.       else
  949.         return actor ? log_colors[54] : log_colors[55]
  950.       end
  951.     when :others
  952.       return log_colors[56]
  953.     end
  954.   end
  955.   
  956.   def key_setting
  957.     @key_setting = default(:key_setting) unless @key_setting
  958.     @key_setting
  959.   end
  960.   
  961.   def use_key_setting?
  962.     f = Config_Setting::Alignment.include?(:key_setting)
  963.     return $game_temp.use_key_setting && f if $game_temp.use_key_setting != nil
  964.     r = "\0" * 5
  965.     n = Win32API.new('kernel32', 'GetPrivateProfileString', "pppplp", 'i')
  966.     n.call('KeyConfig','UseKeySetting','true', r ,32,'./Game.ini')
  967.     r = "true" if r != "false"
  968.     $game_temp.use_key_setting = eval(r)
  969.     return $game_temp.use_key_setting && f
  970.   end
  971.   
  972.   def key_setting_ext
  973.     Config_Setting::Contents[:key_setting][4]
  974.   end
  975.   
  976.   def use_pov?
  977.     f = Config_Setting::Use_POV
  978.     return $game_temp.use_pov && f if $game_temp.use_pov != nil
  979.     r = "\0" * 5
  980.     n = Win32API.new('kernel32', 'GetPrivateProfileString', "pppplp", 'i')
  981.     n.call('KeyConfig','UsePOV','true', r ,32,'./Game.ini')
  982.     r = "true" if r != "false"
  983.     $game_temp.use_pov = eval(r)
  984.     return $game_temp.use_pov && f
  985.   end
  986. end
  987. #==============================================================================
  988. # ■ Sprite_Base
  989. #------------------------------------------------------------------------------
  990. #  アニメーションの表示処理を追加したスプライトのクラスです。
  991. #==============================================================================
  992. class Sprite_Base < Sprite
  993.   #--------------------------------------------------------------------------
  994.   # ● アニメーションの速度を設定 ※再定義
  995.   #--------------------------------------------------------------------------
  996.   alias yy_config_set_animation_rate set_animation_rate
  997.   def set_animation_rate
  998.     if SceneManager.scene_is?(Scene_Battle) && !$game_switches[Config_Setting::AnimationInvalidSwitch]
  999.       @ani_rate = $game_system.animation_speed
  1000.     else
  1001.       yy_config_set_animation_rate
  1002.     end
  1003.   end
  1004. end
  1005. #==============================================================================
  1006. # ■ Window_BattleLog
  1007. #==============================================================================
  1008. class Window_BattleLog < Window_Selectable

  1009.   #--------------------------------------------------------------------------
  1010.   # ● メッセージ速度の取得 エイリアス
  1011.   #--------------------------------------------------------------------------
  1012.   alias yy_config_message_speed message_speed
  1013.   def message_speed
  1014.     return yy_config_message_speed if $game_switches[Config_Setting::AnimationInvalidSwitch]
  1015.     speed = (20 * $game_system.battle_message).to_i
  1016.     if $imported_yana_scripts["AutoBattle"]
  1017.       speed2 = yy_config_message_speed
  1018.       return [speed,speed2].min if BattleManager.auto_battle
  1019.     end
  1020.     return speed
  1021.   end
  1022. end

  1023. #==============================================================================
  1024. # ■ Game_Player
  1025. #------------------------------------------------------------------------------
  1026. #  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
  1027. # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
  1028. # ダッシュタイプの設定を追加します。
  1029. #==============================================================================
  1030. class Game_Player < Game_Character
  1031.   #--------------------------------------------------------------------------
  1032.   # ● ダッシュ状態判定 ※再定義
  1033.   # ダッシュタイプによる設定を追加します。
  1034.   #--------------------------------------------------------------------------
  1035.   def dash?
  1036.     return false if @move_route_forcing
  1037.     return false if $game_map.disable_dash?
  1038.     return false if vehicle
  1039.     return Input.press?(:A) if $game_system.dash_type == :normal
  1040.     return !Input.press?(:A) if $game_system.dash_type == :always
  1041.   end
  1042. end

  1043. class Scene_Map < Scene_Base
  1044.   #--------------------------------------------------------------------------
  1045.   # ● シーン遷移に関連する更新
  1046.   #--------------------------------------------------------------------------
  1047.   alias config_update_scene update_scene
  1048.   def update_scene
  1049.     config_update_scene
  1050.     update_shortcut if !scene_changing? && !$game_map.interpreter.running?
  1051.   end
  1052.   
  1053.   def update_shortcut
  1054.     return if $game_switches[Config_Setting::DisableShortcutSID]
  1055.     list = Config_Setting.shortcut_list
  1056.     $game_system.shortcut.each{|s|
  1057.       if Input.trigger?(s[0])
  1058.         Input.update
  1059.         return Sound.play_buzzer if $game_system.menu_disabled
  1060.         case list[s[1]][1]
  1061.         when Scene_Save;return Sound.play_buzzer if $game_system.save_disabled
  1062.         end
  1063.         if $imported_yana_scripts["SortMenuCommand"]
  1064.           SortMenuCommand::List.each_with_index{|l,i|
  1065.             next if $game_switches[SortMenuCommand::EnableSwitch + i]
  1066.             return Sound.play_buzzer if list[s[1]][2] == l
  1067.           }
  1068.         end
  1069.         if list[s[1]][1].is_a?(Integer)
  1070.           $game_temp.reserve_common_event(list[s[1]][1])
  1071.         else
  1072.           SceneManager.call(list[s[1]][1])
  1073.           SceneManager.scene.prepare_basic if $imported_yana_scripts["AugmentCompose"] && list[s[1]][1] == Scene_AugmentCompose
  1074.         end
  1075.       end
  1076.     }
  1077.   end
  1078. end
  1079. #==============================================================================
  1080. # ■ Window_Config
  1081. #------------------------------------------------------------------------------
  1082. #  コンフィグの処理を行うウィンドウです。
  1083. #==============================================================================

  1084. class Window_Config < Window_Selectable
  1085.   attr_accessor :log_color_window
  1086.   attr_accessor :key_setting_window
  1087.   attr_reader   :list
  1088.   
  1089.   # 初期化処理
  1090.   def initialize
  1091.     init_list
  1092.     height = line_height*[item_max,13].min+standard_padding*2
  1093.     super(64,(Graphics.height-height)/2,416,height)
  1094.     @sub_index = -1
  1095.     @ws_index = (($game_system.screen_size - 1.0) * 5).round(0)
  1096.     refresh
  1097.   end
  1098.   
  1099.   # 項目数
  1100.   def item_max
  1101.     list.size
  1102.   end
  1103.   
  1104.   def enable?(index)
  1105.     if list[index] == :animation_speed && $game_system.animation_switch == :off
  1106.       return false
  1107.     end
  1108.     return true
  1109.   end
  1110.   
  1111.   # 項目の横幅
  1112.   def item_width
  1113.     128
  1114.   end
  1115.   
  1116.   def init_list
  1117.     @list = Config_Setting::Alignment.dup
  1118.     @list.delete(:key_setting) unless $game_system.use_key_setting?
  1119.   end
  1120.   
  1121.   # ボリュームコントロール用の処理
  1122.   def update_volume_control
  1123.     cnt = nil
  1124.     cnt = 1   if Input.repeat?(:RIGHT)
  1125.     cnt = -1  if Input.repeat?(:LEFT)
  1126.     control_volume(cnt) if cnt
  1127.   end
  1128.   
  1129.   # ダッシュ設定用の処理
  1130.   def update_dash_cursor
  1131.     if Input.trigger?(:RIGHT)
  1132.       Sound.play_cursor unless $game_system.dash_type == :always
  1133.       $game_system.dash_type = :always
  1134.       refresh
  1135.     elsif Input.trigger?(:LEFT)
  1136.       Sound.play_cursor unless $game_system.dash_type == :normal
  1137.       $game_system.dash_type = :normal
  1138.       refresh
  1139.     end
  1140.   end
  1141.   
  1142.   # アニメ表示用の処理
  1143.   def update_anime_cursor
  1144.     if Input.trigger?(:RIGHT)
  1145.       Sound.play_cursor unless $game_system.animation_switch == :off
  1146.       $game_system.animation_switch = :off
  1147.       refresh
  1148.     elsif Input.trigger?(:LEFT)
  1149.       Sound.play_cursor unless $game_system.animation_switch == :on
  1150.       $game_system.animation_switch = :on
  1151.       refresh
  1152.     end
  1153.   end
  1154.   
  1155.   # 戦闘メッセージ速度用の処理
  1156.   def update_battle_message
  1157.     if Input.repeat?(:RIGHT)
  1158.       Sound.play_cursor unless $game_system.battle_message <= 0
  1159.       $game_system.battle_message = [$game_system.battle_message-0.05,$game_system.extend_setting(:battle_message)].max
  1160.       refresh
  1161.     elsif Input.repeat?(:LEFT)
  1162.       Sound.play_cursor unless $game_system.battle_message >= 2.0
  1163.       $game_system.battle_message = [$game_system.battle_message+0.05,2.0].min
  1164.       refresh
  1165.     end
  1166.   end
  1167.   
  1168.   # アニメーション速度用の処理
  1169.   def update_animation_speed
  1170.     if Input.repeat?(:RIGHT)
  1171.       Sound.play_cursor unless $game_system.animation_speed <= 1
  1172.       $game_system.animation_speed = [$game_system.animation_speed-1,$game_system.extend_setting(:animation_speed)].max
  1173.       refresh
  1174.     elsif Input.repeat?(:LEFT)
  1175.       Sound.play_cursor unless $game_system.animation_speed >= 8
  1176.       $game_system.animation_speed = [$game_system.animation_speed+1,8].min
  1177.       refresh
  1178.     end
  1179.   end
  1180.   
  1181.   # ウィンドウスキンのアップデート
  1182.   def update_windowskin
  1183.     if Input.trigger?(:RIGHT)
  1184.       Sound.play_cursor unless ($game_system.windowskin + 1) == $game_system.windowskin_size
  1185.       $game_system.windowskin = ($game_system.windowskin + 1) % $game_system.windowskin_size
  1186.       refresh_skin
  1187.       refresh
  1188.       @help_window.refresh
  1189.       SceneManager.scene.reload_skin
  1190.     elsif Input.trigger?(:LEFT)
  1191.       Sound.play_cursor unless $game_system.windowskin == 0
  1192.       $game_system.windowskin = ($game_system.windowskin + ($game_system.windowskin_size - 1)) % $game_system.windowskin_size
  1193.       Sound.play_cursor
  1194.       refresh_skin
  1195.       refresh
  1196.       @help_window.refresh
  1197.       SceneManager.scene.reload_skin
  1198.     end
  1199.   end
  1200.   
  1201.   # GC頻度のアップデート
  1202.   def update_gc_sec
  1203.     pgc = $game_system.gc_sec
  1204.     if Input.repeat?(:RIGHT)
  1205.       $game_system.gc_sec = [($game_system.gc_sec + 1),$game_system.gc_sec_max].min
  1206.       refresh
  1207.       @help_window.refresh
  1208.     elsif Input.repeat?(:LEFT)
  1209.       $game_system.gc_sec = [($game_system.gc_sec - 1),$game_system.gc_sec_min].max
  1210.       refresh
  1211.       @help_window.refresh
  1212.     end
  1213.     Sound.play_cursor unless pgc == $game_system.gc_sec
  1214.   end
  1215.   
  1216.   def update_log_color
  1217.     if self.active && Input.trigger?(:C)
  1218.       Sound.play_ok
  1219.       @log_color_window.refresh
  1220.       @log_color_window.activate.open.select(0)
  1221.       self.deactivate
  1222.     end
  1223.   end
  1224.   
  1225.   def update_key_setting
  1226.     if self.active && Input.trigger?(:C)
  1227.       Sound.play_ok
  1228.       @key_setting_window.refresh
  1229.       @key_setting_window.activate.open.select(@key_setting_window.item_max-2)
  1230.       self.deactivate.close
  1231.     end
  1232.   end
  1233.   
  1234.   # アップデート
  1235.   def update
  1236.     super
  1237.     unless enable?(index)
  1238.       Sound.play_buzzer if Input.trigger?(:C) or Input.trigger?(:RIGHT) or Input.trigger?(:LEFT)
  1239.       return
  1240.     end
  1241.     case list[@index]
  1242.     when :bgm,:se;update_volume_control
  1243.     when :battle_message;update_battle_message
  1244.     when :animation_speed;update_animation_speed
  1245.     when :window_tone
  1246.       switch_sub_content if Input.trigger?(:C)
  1247.       update_window_tone unless active
  1248.     when :windowskin;update_windowskin
  1249.     when :dash_type;update_dash_cursor
  1250.     when :animation_switch;update_anime_cursor
  1251.     when :reset;clear_setting if Input.trigger?(:C)
  1252.     when :screen_size;update_screen_size
  1253.     when :shortcut
  1254.       switch_sub_content if Input.trigger?(:C)
  1255.       update_shortcut unless active
  1256.     when :gc_sec;update_gc_sec
  1257.     when :log_color;update_log_color
  1258.     when :key_setting;update_key_setting
  1259.     else
  1260.       a = list[@index]
  1261.       if a.to_s[/^variables(\d+)/]
  1262.         update_variables($1.to_i)
  1263.       elsif a.to_s[/^switches(\d+)/]
  1264.         update_switches($1.to_i)
  1265.       end
  1266.     end
  1267.   end
  1268.   
  1269.   def switch_sub_content
  1270.     deactivate
  1271.     Sound.play_ok
  1272.     @sub_index = 0
  1273.     refresh
  1274.   end
  1275.   
  1276.   def update_screen_size
  1277.     limit = $game_system.extend_setting(:screen_size)
  1278.     limit = [1.0,2.0] unless limit
  1279.     n = (limit[1] - limit[0]) / 5.0
  1280.     if Input.repeat?(:RIGHT)
  1281.       Sound.play_cursor unless @ws_index == 5
  1282.       @ws_index = [@ws_index + 1,5].min
  1283.       $game_system.resize_screen([$game_system.screen_size+n,limit[1]].min)
  1284.       refresh
  1285.     elsif Input.repeat?(:LEFT)
  1286.       Sound.play_cursor unless @ws_index == 0
  1287.       @ws_index = [@ws_index - 1,0].max
  1288.       $game_system.resize_screen([$game_system.screen_size-n,limit[0]].max)
  1289.       refresh
  1290.     end
  1291.   end
  1292.   
  1293.   def update_window_tone
  1294.     if Input.trigger?(:B)
  1295.       activate
  1296.       Sound.play_cancel
  1297.       refresh
  1298.     elsif Input.trigger?(:RIGHT)
  1299.       Sound.play_cursor
  1300.       @sub_index = (@sub_index + 1) % 3
  1301.       refresh
  1302.     elsif Input.trigger?(:LEFT)
  1303.       Sound.play_cursor
  1304.       @sub_index = (@sub_index + 2) % 3
  1305.       refresh
  1306.     elsif Input.press?(:UP)
  1307.       Sound.play_cursor if change_tone(1)
  1308.       refresh
  1309.     elsif Input.press?(:DOWN)
  1310.       Sound.play_cursor if change_tone(-1)
  1311.       refresh
  1312.     end
  1313.   end
  1314.   
  1315.   def change_tone(value)
  1316.     tone = $game_system.window_tone.dup
  1317.     case @sub_index
  1318.     when 0;tone.red+=value
  1319.     when 1;tone.green+=value
  1320.     when 2;tone.blue+=value
  1321.     end
  1322.     return false if $game_system.window_tone == tone
  1323.     $game_system.window_tone = tone.dup
  1324.     return true
  1325.   end
  1326.   
  1327.   def change_shortcut(value)
  1328.     n = $game_system.shortcut[@sub_index][1]
  1329.     $game_system.shortcut[@sub_index][1] = (n + value) % shortcut_content_size
  1330.     return true
  1331.   end
  1332.   
  1333.   def update_shortcut
  1334.     if Input.trigger?(:B)
  1335.       @sub_index = -1
  1336.       activate
  1337.       Sound.play_cancel
  1338.       refresh
  1339.     elsif Input.trigger?(:RIGHT)
  1340.       Sound.play_cursor
  1341.       @sub_index = (@sub_index + 1) % shortcut_size
  1342.       refresh
  1343.     elsif Input.trigger?(:LEFT)
  1344.       Sound.play_cursor
  1345.       @sub_index = (@sub_index + (shortcut_size - 1)) % shortcut_size
  1346.       refresh
  1347.     elsif Input.trigger?(:UP)
  1348.       Sound.play_cursor if change_shortcut(1)
  1349.       refresh
  1350.     elsif Input.trigger?(:DOWN)
  1351.       Sound.play_cursor if change_shortcut(shortcut_content_size-1)
  1352.       refresh
  1353.     end
  1354.   end
  1355.   
  1356.   def shortcut_size
  1357.     $game_system.shortcut_size
  1358.   end
  1359.   
  1360.   def shortcut_content_size
  1361.     Config_Setting.shortcut_list.size
  1362.   end
  1363.   
  1364.   # 設定の初期化処理
  1365.   def clear_setting
  1366.     $game_system.setting_reset
  1367.     bgm_restart
  1368.     bgs_restart
  1369.     Sound.play_ok
  1370.     refresh_skin
  1371.     refresh
  1372.   end
  1373.   
  1374.   def refresh_skin
  1375.     self.windowskin = Cache.system("Window")
  1376.     @help_window.windowskin = Cache.system("Window")
  1377.   end
  1378.   
  1379.   # ボリュームを設定する処理
  1380.   def control_volume(cnt)
  1381.     return unless cnt
  1382.     volume = cnt * 0.05
  1383.     case list[@index]
  1384.     when :bgm
  1385.       vol = $game_system.bgm_volume + volume
  1386.       $game_system.bgm_volume = [[vol,0].max,1.0].min.round(2)
  1387.       bgm_restart
  1388.       Sound.play_cursor if vol >= 0 && vol <= 1.0
  1389.       refresh
  1390.     when :se
  1391.       vol = $game_system.se_volume + volume
  1392.       $game_system.se_volume = [[vol,0].max,1.0].min.round(2)
  1393.       bgs_restart
  1394.       Sound.play_cursor if vol >= 0 && vol <= 1.0
  1395.       refresh
  1396.     end
  1397.   end
  1398.   
  1399.   # BGMをリスタート
  1400.   def bgm_restart
  1401.     bgm = RPG::BGM.last
  1402.     Audio.bgm_play('Audio/BGM/'+ bgm.name,bgm.volume,bgm.pitch,bgm.pos) unless bgm.name.empty?
  1403.   end
  1404.   
  1405.   # BGSをリスタート
  1406.   def bgs_restart
  1407.     bgs = RPG::BGS.last
  1408.     Audio.bgs_play('Audio/BGS/'+ bgs.name,bgs.volume,bgs.pitch,bgs.pos) unless bgs.name.empty?
  1409.   end
  1410.   
  1411.   def update_variables(id)
  1412.     s = ("variables#{id}").to_sym
  1413.     es = $game_system.extend_setting(s)
  1414.     n = $game_variables[es[0]]
  1415.     min = es[1]
  1416.     max = es[2]
  1417.     flag = es[1].is_a?(Array)
  1418.     i = n
  1419.     if flag
  1420.       min,max = 0,es[1].size - 1
  1421.       text = es[1].find{|ss| ss[1] == n }[0]
  1422.       i = es[1].index([text,n])
  1423.     end
  1424.     if Input.repeat?(:RIGHT)
  1425.       i = [(i + 1),max].min
  1426.       $game_system.variables[es[0]] = flag ? es[1][i][1] : i
  1427.       $game_variables[es[0]] = $game_system.variables[es[0]]
  1428.       refresh
  1429.     elsif Input.repeat?(:LEFT)
  1430.       i = [(i - 1),min].max
  1431.       $game_system.variables[es[0]] = flag ? es[1][i][1] : i
  1432.       $game_variables[es[0]] = $game_system.variables[es[0]]
  1433.       refresh
  1434.     end
  1435.     i = es[1][i][1] if flag
  1436.     Sound.play_cursor unless n == i
  1437.   end
  1438.   
  1439.   def update_switches(id)
  1440.     s = ("switches#{id}").to_sym
  1441.     es = $game_system.extend_setting(s)
  1442.     if Input.trigger?(:RIGHT)
  1443.       Sound.play_cursor if $game_switches[es[0]]
  1444.       $game_system.switches[es[0]] = false
  1445.       $game_switches[es[0]] = $game_system.switches[es[0]]
  1446.       refresh
  1447.     elsif Input.trigger?(:LEFT)
  1448.       Sound.play_cursor unless $game_switches[es[0]]
  1449.       $game_system.switches[es[0]] = true
  1450.       $game_switches[es[0]] = $game_system.switches[es[0]]
  1451.       refresh
  1452.     end
  1453.   end
  1454.   
  1455.   # 項目の描画
  1456.   def draw_item(index)
  1457.     change_color(normal_color, enable?(index))
  1458.     draw_text(0,line_height*index,128,line_height,config_name(index),1)
  1459.     draw_contents_list(index)
  1460.   end
  1461.   
  1462.   def config_name(index)
  1463.     Config_Setting::Contents[list[index]][0]
  1464.   end
  1465.   
  1466.   # 項目の内容の描画
  1467.   def draw_contents_list(index)
  1468.     case list[index]
  1469.     when :bgm;draw_bgm_bar(index)
  1470.     when :se;draw_se_bar(index)
  1471.     when :windowskin;draw_windowskin(index)
  1472.     when :window_tone;draw_window_color(index)
  1473.     when :battle_message;draw_battle_speed(index)
  1474.     when :dash_type;draw_dash_setting(index)
  1475.     when :animation_switch;draw_anime_switch(index)
  1476.     when :animation_speed;draw_anime_speed(index)
  1477.     when :screen_size;draw_screen_setting(index)
  1478.     when :shortcut;draw_shortcut(index)
  1479.     when :gc_sec;draw_gc_sec(index)
  1480.     when :log_color;draw_log_color(index)
  1481.     when :skill_setting;draw_skill_setting(index)
  1482.     else
  1483.       a = list[index]
  1484.       if a.to_s[/^variables(\d+)/]
  1485.         draw_variables($1.to_i,index)
  1486.       elsif a.to_s[/^switches(\d+)/]
  1487.         draw_switches($1.to_i,index)
  1488.       end
  1489.     end
  1490.   end
  1491.   
  1492.   # BGMボリューム用の項目描画
  1493.   def draw_bgm_bar(index)
  1494.     draw_volume_score($game_system.bgm_volume,index)
  1495.   end
  1496.   
  1497.   # SEボリューム用の項目描画
  1498.   def draw_se_bar(index)
  1499.     draw_volume_score($game_system.se_volume,index)
  1500.   end
  1501.   
  1502.   # ボリューム用の項目描画
  1503.   def draw_volume_score(vol,index)
  1504.     volume = (vol * 10 * 2).to_i
  1505.     20.times{|i|
  1506.       color = volume > i ? Config_Setting::Volume_Gauge[:color1] : Config_Setting::Volume_Gauge[:color2]
  1507.       contents.fill_rect(144 + i * 12, line_height * index + 2, 10, line_height-4,color)
  1508.     }
  1509.   end
  1510.   
  1511.   # ダッシュ設定の項目描画
  1512.   def draw_dash_setting(index)
  1513.     ofset = $game_system.dash_type == :normal ? 0 : 124
  1514.     color1 = Config_Setting::Dash_Cursor[:color1]
  1515.     color2 = Config_Setting::Dash_Cursor[:color2]
  1516.     contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
  1517.     draw_text(144,index*line_height,124,line_height,"通常",1)
  1518.     draw_text(144+124,index*line_height,124,line_height,"常時ダッシュ",1)
  1519.   end
  1520.   
  1521.   # アニメーション表示の項目描画
  1522.   def draw_anime_switch(index)
  1523.     ofset = $game_system.animation_switch == :on ? 0 : 124
  1524.     color1 = Config_Setting::Anime_Cursor[:color1]
  1525.     color2 = Config_Setting::Anime_Cursor[:color2]
  1526.     contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
  1527.     draw_text(144,index*line_height,124,line_height,"ON",1)
  1528.     draw_text(144+124,index*line_height,124,line_height,"OFF",1)
  1529.   end
  1530.   # ウィンドウスキンの項目描画
  1531.   def draw_windowskin(index)
  1532.     color1 = Config_Setting::Skin_Cursor[:color1]
  1533.     color2 = Config_Setting::Skin_Cursor[:color2]
  1534.     i = $game_system.windowskin
  1535.     size = $game_system.windowskin_size
  1536.     contents.gradient_fill_rect(144+(268/size)*i,index*line_height+2,24,line_height-4,color1,color2)
  1537.     size.times{|i|
  1538.       draw_text(144+(268/size)*i,index*line_height,24,line_height,(i+1).to_i,1)
  1539.     }
  1540.   end
  1541.   # ガーベージコレクションの項目描画
  1542.   def draw_gc_sec(index)
  1543.     draw_left_arrow(180,index*line_height) unless $game_system.gc_sec == $game_system.gc_sec_min
  1544.     draw_text(144,index*line_height,268,line_height,$game_system.gc_sec,1)
  1545.     draw_right_arrow(180+184,index*line_height) unless $game_system.gc_sec == $game_system.gc_sec_max
  1546.   end
  1547.   # ウィンドウトーンの項目描画
  1548.   def draw_window_color(index)
  1549.     text = ["R:","G:","B:"]
  1550.     wt = $game_system.window_tone
  1551.     color = [Color.new(255,0,0),Color.new(0,255,0),Color.new(0,0,255)]
  1552.     cs    = [wt.red,wt.green,wt.blue]
  1553.     color1 = Config_Setting::Dash_Cursor[:color1]
  1554.     3.times{|i|
  1555.       if list[@index] == :window_tone
  1556.         unless active
  1557.           if @sub_index == i
  1558.             contents.gradient_fill_rect(140+i*82,index*line_height,72,line_height,color1,color[i])
  1559.           end
  1560.         end
  1561.       end
  1562.       draw_text(144+i*82,index*line_height,64,line_height,text[i])
  1563.       draw_text(144+i*82,index*line_height,64,line_height,(cs[i].to_i).to_s,2)
  1564.     }
  1565.   end
  1566.   
  1567.   # 戦闘メッセージ速度の項目描画
  1568.   def draw_battle_speed(index)
  1569.     text = ["遅い","標準","早い"]
  1570.     gs1 = 244
  1571.     gs2 = (gs1 / (1.0 - $game_system.extend_setting(:battle_message)/2)).to_i
  1572.     bm = 1.0 - ($game_system.battle_message / 2)
  1573.     contents.fill_rect(144,index*line_height+17,gs1,6,Color.new(64,64,64))
  1574.     contents.fill_rect(144,index*line_height+17,(gs2*bm).to_i,6,Color.new(64,128,255))
  1575.     text.each_with_index{|t,i|
  1576.       draw_text(144+i*82,index*line_height,82,line_height,t,1)
  1577.     }
  1578.   end
  1579.    
  1580.   # アニメーション速度の項目描画
  1581.   def draw_anime_speed(index)
  1582.     text = ["遅い","標準","早い"]
  1583.     gs1 = 244
  1584.     gs2 = (gs1 / (1.0 - $game_system.extend_setting(:animation_speed)/8.0)).to_i
  1585.     bm = 1.0 - ($game_system.animation_speed / 8.0)
  1586.     contents.fill_rect(144,index*line_height+17,gs1,6,Color.new(64,64,64))
  1587.     contents.fill_rect(144,index*line_height+17,(gs2*bm).to_i,6,Color.new(128,64,255))
  1588.     text.each_with_index{|t,i|
  1589.       draw_text(144+i*82,index*line_height,82,line_height,t,1)
  1590.     }
  1591.   end
  1592.   # 画面倍率の項目描画
  1593.   def draw_screen_setting(index)
  1594.     limit = $game_system.extend_setting(:screen_size)
  1595.     limit = [1.0,2.0] unless limit
  1596.     n = (limit[1] - limit[0]) / 5.0
  1597.     text = []
  1598.     6.times{|i| text.push("x#{limit[0] + n*i}") }
  1599.     color1 = Config_Setting::Dash_Cursor[:color1]
  1600.     color2 = Config_Setting::Dash_Cursor[:color2]
  1601.     text.each_with_index{|t,i|
  1602.       if @ws_index == i
  1603.         contents.gradient_fill_rect(144+@ws_index*40+2,index*line_height+2,40,line_height-4,color1,color2)
  1604.       end
  1605.       draw_text(144+i*40,index*line_height,40,line_height,t,1)
  1606.     }
  1607.   end
  1608.   # ショートカットの描画
  1609.   def draw_shortcut(index)
  1610.     color1 = Config_Setting::Shortcut_Cursor[:color1]
  1611.     color2 = Config_Setting::Shortcut_Cursor[:color2]
  1612.     size = shortcut_size
  1613.     width = (248/size)
  1614.     c = $game_system.shortcut
  1615.     i = @sub_index
  1616.     list = Config_Setting.shortcut_list
  1617.     if list[@index] == :shortcut && i >= 0
  1618.       contents.gradient_fill_rect(144+(248/size)*i,index*line_height+4,width,line_height-4,color1,color2)
  1619.     end
  1620.     c.each_with_index{|s,i|
  1621.       draw_text(144+(248/size)*i,index*line_height+2,width,line_height,s[0].to_s+":"+list[s[1]][0],1) if list[s[1]]
  1622.     }
  1623.   end
  1624.   # ログカラーの描画
  1625.   def draw_log_color(index)
  1626.     width = 248 / Config_Setting::GlobalLogColor.size
  1627.     r = (248 - width * Config_Setting::GlobalLogColor.size) / 2
  1628.     Config_Setting::GlobalLogColor.each_with_index{|c,i|
  1629.       color = c[1] ? $game_system.log_colors[c[1][0]] : $game_system.log_colors[c[0]]
  1630.       if color >= 0
  1631.         contents.fill_rect(144+r+i*width,index*line_height+4,width-1,line_height-8,text_color(color))
  1632.       else
  1633.         contents.fill_rect(144+r+i*width,index*line_height+4,width-1,line_height-8,text_color(0))
  1634.         contents.clear_rect(144+r+i*width+1,index*line_height+5,width-3,line_height-10)
  1635.       end
  1636.     }
  1637.   end
  1638.   def draw_key_setting(index)
  1639.    
  1640.   end
  1641.   # 変数の描画
  1642.   def draw_variables(id,index)
  1643.     s = ("variables#{id}").to_sym
  1644.     es = $game_system.extend_setting(s)
  1645.     n = $game_system.variables[es[0]]
  1646.     text = n
  1647.     min = es[1].is_a?(Array) ? 0 : es[1]
  1648.     max = es[1].is_a?(Array) ? es[1].size - 1 : es[2]
  1649.     i = n
  1650.     if es[1].is_a?(Array)
  1651.       text = es[1].find{|ss| ss[1] == n }[0]
  1652.       i = es[1].index([text,n])
  1653.     end
  1654.     draw_left_arrow(180,index*line_height) unless i == min
  1655.     draw_text(144,index*line_height,268,line_height,text,1)
  1656.     draw_right_arrow(180+184,index*line_height) unless i == max
  1657.   end
  1658.   # スイッチの描画
  1659.   def draw_switches(id,index)
  1660.     s = ("switches#{id}").to_sym
  1661.     es = $game_system.extend_setting(s)
  1662.     n = $game_system.switches[es[0]]
  1663.     ofset = n ? 0 : 124
  1664.     color1 = Config_Setting::Anime_Cursor[:color1]
  1665.     color2 = Config_Setting::Anime_Cursor[:color2]
  1666.     contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
  1667.     draw_text(144,index*line_height,124,line_height,"ON",1)
  1668.     draw_text(144+124,index*line_height,124,line_height,"OFF",1)
  1669.   end
  1670.   
  1671.   def update_help
  1672.     super
  1673.     @help_window.set_text($game_system.description(list[@index]))
  1674.   end
  1675.   
  1676.   def draw_left_arrow(x,y)
  1677.     bitmap = self.windowskin
  1678.     rect = Rect.new(80,24,8,16)
  1679.     contents.blt(x,y+4,bitmap,rect)
  1680.   end
  1681.   def draw_right_arrow(x,y)
  1682.     bitmap = self.windowskin
  1683.     rect = Rect.new(104,24,8,16)
  1684.     contents.blt(x,y+4,bitmap,rect)
  1685.   end
  1686. end

  1687. class Window_LogColor < Window_Selectable
  1688.   def initialize(help_window)
  1689.     super(32,32+help_window.height,Graphics.width-64,row_max*line_height + standard_padding*2)
  1690.     self.openness = 0
  1691.     @help_window = help_window
  1692.     refresh
  1693.   end
  1694.   
  1695.   def item_max; Config_Setting::GlobalLogColor.size; end
  1696.   def col_max ; 2 ; end
  1697.   def row_max ; (item_max / col_max.to_f).ceil ;end
  1698.    
  1699.   def refresh
  1700.     contents.clear
  1701.     Config_Setting::GlobalLogColor.each_with_index{|gc,i|
  1702.       text = gc[1] ? gc[2] : Config_Setting::LogColor[gc[0]][1]
  1703.       color = gc[1] ? $game_system.log_colors[gc[1][0]] : $game_system.log_colors[gc[0]]
  1704.       rect = Rect.new(contents_width/col_max*(i%col_max),line_height*(i/col_max)+2,width/col_max,line_height)
  1705.       draw_text(rect.x,rect.y,rect.width-40,rect.height,text)
  1706.       if color >= 0
  1707.         contents.fill_rect(rect.x+(contents_width/col_max)-40,rect.y,20,20,text_color(color))
  1708.       else
  1709.         contents.fill_rect(rect.x+(contents_width/col_max)-40,rect.y,20,20,text_color(0))
  1710.         contents.clear_rect(rect.x+(contents_width/col_max)-38,rect.y+2,16,16)
  1711.       end
  1712.     }
  1713.   end
  1714.   
  1715.   def item_rect(index)
  1716.     Rect.new(contents_width/col_max*(index%col_max)+(contents_width/col_max)-42,
  1717.              line_height*(index/col_max) ,24,24)
  1718.   end
  1719.   
  1720.   def update_help
  1721.     super
  1722.     gc = Config_Setting::GlobalLogColor[index]
  1723.     text = gc[3] ? gc[3] : Config_Setting::LogColor[gc[0]][2]
  1724.     @help_window.set_text(text)
  1725.   end
  1726.   

  1727.   
  1728.   def process_unequip_log
  1729.     Sound.play_equip
  1730.     Input.update
  1731.     gc = Config_Setting::GlobalLogColor[index]
  1732.     if gc[1]
  1733.       gc[1].each{|c| $game_system.log_colors[c] = -1 }
  1734.     else
  1735.       $game_system.log_colors[gc[0]] = -1
  1736.     end
  1737.     refresh
  1738.     call_handler(:unequip)
  1739.   end
  1740. end

  1741. class Window_Palette < Window_Selectable
  1742.   def initialize
  1743.     super(0,0,8*(11)+standard_padding+4,4*(8+2)+standard_padding*2)
  1744.     self.openness = 0
  1745.     self.arrows_visible = false
  1746.     refresh
  1747.   end
  1748.   def stadard_padding;6;end
  1749.   def col_max;8;end
  1750.   def row_max;4;end
  1751.   def item_max;col_max*row_max;end
  1752.   def update_padding_bottom;standard_padding;end
  1753.   def line_height;8;end
  1754.   
  1755.   def refresh
  1756.     contents.clear
  1757.     item_max.times{|i|
  1758.       contents.fill_rect(10*(i%col_max)+1,10*(i/col_max)+1,8,8,text_color(i))
  1759.     }
  1760.   end
  1761.   
  1762.   def item_rect(index)
  1763.     Rect.new(10*(index%col_max),10*(index/col_max),10,10)
  1764.   end
  1765.   
  1766.   def adjust_position(window)
  1767.     self.x = [window.x + window.item_rect(window.index).x,Graphics.width-self.width].min
  1768.     self.y = [window.y + window.item_rect(window.index).y + 38,Graphics.height-self.height].min
  1769.   end
  1770. end

  1771. class Window_KeySetting < Window_Selectable
  1772.   def initialize(help_window)
  1773.     super(32,help_window.height,Graphics.width-64,Graphics.height - help_window.height)
  1774.     self.openness = 0
  1775.     @help_window = help_window
  1776.     self.padding_bottom = 12
  1777.     self.arrows_visible = false
  1778.     create_contents
  1779.     refresh
  1780.   end
  1781.   
  1782.   def standard_padding;8;end

  1783.   def contents_height
  1784.     self.height - standard_padding * 2
  1785.   end
  1786.   
  1787.   def item_max; $game_system.default(:key_setting).size + 2; end
  1788.   def col_max ; 2 ; end
  1789.   def row_max ; ((item_max - 2) / col_max) ;end
  1790.   
  1791.   def item_rect(index)
  1792.     return Rect.new(40,line_height*(row_max+1)+60,self.width - 100, 24) if index == (item_max - 2)
  1793.     return Rect.new(40,line_height*(row_max+1)+84,self.width - 100, 24) if index == (item_max - 1)
  1794.     sup = index >= row_max ? line_height : 0
  1795.     Rect.new(((contents_width - 24) / 2) * (index % col_max) + 112,
  1796.              line_height*(index/col_max)+line_height*2+sup,((contents_width - 36) / 2) - 96,24)
  1797.   end
  1798.            
  1799.   def current_item_enabled?
  1800.     enable?(index)
  1801.   end
  1802.   def enable?(index)
  1803.     return true if index >= item_max - 2
  1804.     enable = $game_system.key_setting.values[index]
  1805.     return Input.connect_joypad == 0 if index > (row_max - 1) && enable
  1806.     return enable
  1807.   end
  1808.   def ext
  1809.     $game_system.key_setting_ext
  1810.   end
  1811.   def refresh
  1812.     contents.clear
  1813.     ext = $game_system.key_setting_ext
  1814.     draw_text(8,0,self.width,line_height,ext[5])
  1815.     draw_horz_line(30)
  1816.     change_color(system_color)
  1817.     draw_text(8,22,self.width,line_height,ext[1])
  1818.     draw_horz_line(line_height*(row_max/2) + 54)
  1819.     change_color(system_color)
  1820.     draw_text(8,line_height*((row_max/2)+1)+22,contents_width,line_height,ext[2])
  1821.     if Input.connect_joypad != 0
  1822.       change_color(normal_color)
  1823.       contents.font.size = 20
  1824.       draw_text(128,line_height*((row_max/2)+1)+24,contents_width,line_height,"(接続されていません)")
  1825.       contents.font.size = line_height
  1826.     end
  1827.     i = 0
  1828.     $game_system.key_setting.each{|key,value|
  1829.       change_color_button(key,value && enable?(i))
  1830.       x = 16+((contents_width - 24) / 2) * (i % col_max)
  1831.       y = line_height*(i / col_max)+line_height*(2+(i/row_max))
  1832.       draw_text(x,y,96,line_height,ext[0][i])
  1833.       change_color(normal_color,value && enable?(i))
  1834.       rect = item_rect(i)
  1835.       if value
  1836.         if value == :default
  1837.           change_color(text_color(21),value && enable?(i))
  1838.           text = "デフォルト"
  1839.         else
  1840.           text = value.is_a?(Array) ? value[1] : value.to_s
  1841.         end
  1842.       else
  1843.         text = "使用しない"
  1844.       end
  1845.       draw_text(rect,text,1)
  1846.       i += 1
  1847.     }
  1848.     change_color(normal_color,true)
  1849.     draw_text(item_rect(item_max-2),ext[3],1)
  1850.     draw_text(item_rect(item_max-1),ext[4],1)
  1851.   end
  1852.   
  1853.   def change_color_button(key,enable)
  1854.     return change_color(system_color,enable)
  1855. #~     case key
  1856. #~     when :A,:PAD_A;change_color(text_color(25),enable)
  1857. #~     when :B,:PAD_B;change_color(text_color(22),enable)
  1858. #~     when :C,:PAD_C;change_color(text_color(2),enable)
  1859. #~     when :X,:PAD_X;change_color(text_color(24),enable)
  1860. #~     when :Y,:PAD_Y;change_color(text_color(17),enable)
  1861. #~     when :Z,:PAD_Z;change_color(text_color(27),enable)
  1862. #~     when :L,:PAD_L;change_color(text_color(6),enable)
  1863. #~     when :R,:PAD_R;change_color(text_color(7),enable)
  1864. #~     end
  1865.   end
  1866.    
  1867.   def update_help
  1868.     super
  1869.     ks = $game_system.extend_setting(:key_setting)
  1870.     text = ks[index % row_max]
  1871.     text = ext[6] if index == item_max - 2
  1872.     text = ext[7] if index == item_max - 1
  1873.     @help_window.set_text(text)
  1874.   end
  1875.   def draw_horz_line(y)
  1876.     line_y = y + line_height / 2 - 1
  1877.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  1878.   end
  1879.   def line_color
  1880.     color = normal_color
  1881.     color.alpha = 48
  1882.     color
  1883.   end
  1884.   def process_handling
  1885.     return unless self.active
  1886.     return process_ok if index >= (item_max - 2) && Input.trigger?(:C)
  1887.     if index < row_max && !Input.input_key_without_cursor.empty? && Input.key_update?
  1888.       return Sound.play_buzzer unless current_item_enabled?
  1889.       ip = Input.input_key
  1890.       return Sound.play_buzzer if include_cursor?(ip)
  1891.       key = $game_system.key_setting.keys[index]
  1892.       n = $game_system.key_setting[key]
  1893.       return Sound.play_buzzer if (!Config_Setting::DefaultKeyChangable && press_exclude_input?(key))
  1894.       $game_system.key_setting.each{|ky,value|
  1895.         next if value == :default
  1896.         $game_system.key_setting[ky] = n if value == ip[0]
  1897.       }
  1898.       $game_system.key_setting[key] = ip[0]
  1899.       refresh
  1900.       Sound.play_ok
  1901.     elsif (index >= row_max && index < (item_max - 2)) &&
  1902.           !Input.press_joybutton.empty? && Input.joy_button_update?
  1903.       return Sound.play_buzzer unless current_item_enabled?
  1904.       ip = Input.press_joybutton
  1905.       key = $game_system.key_setting.keys[index]
  1906.       n = $game_system.key_setting[key]
  1907.       return Sound.play_buzzer if (!Config_Setting::DefaultKeyChangable && press_exclude_input?(key))
  1908.       $game_system.key_setting.each{|ky,value|
  1909.         next if value == :default
  1910.         $game_system.key_setting[ky] = n if value == ip[0]
  1911.       }
  1912.       $game_system.key_setting[key] = ip[0]
  1913.       refresh
  1914.       Sound.play_ok
  1915.     end
  1916.   end
  1917.   def include_cursor?(array)
  1918.     return true if array.include?(Keycode::Code[37])
  1919.     return true if array.include?(Keycode::Code[38])
  1920.     return true if array.include?(Keycode::Code[39])
  1921.     return true if array.include?(Keycode::Code[40])
  1922.     return false
  1923.   end
  1924.   def process_ok
  1925.     if index == item_max - 2
  1926.       Sound.play_ok
  1927.       Input.update
  1928.       deactivate
  1929.       call_ok_handler
  1930.     elsif index == item_max - 1
  1931.       Sound.play_ok
  1932.       Input.update
  1933.       $game_system.key_setting.each{|key,value|
  1934.         next unless value
  1935.         $game_system.key_setting[key] = :default
  1936.       }
  1937.       refresh
  1938.     end
  1939.   end
  1940.   def cursor_right(wrap = false)
  1941.     super(wrap)
  1942.     super(wrap) until current_item_enabled?
  1943.   end
  1944.   def cursor_left(wrap = false)
  1945.     super(wrap)
  1946.     super(wrap) until current_item_enabled?
  1947.   end
  1948.   def cursor_up(wrap = false)
  1949.     loop do
  1950.       if index == (item_max - 2)
  1951.         select(item_max - 3)
  1952.       elsif index == (item_max - 1)
  1953.         select(item_max - 2)
  1954.       elsif index >= col_max || (wrap && col_max == 1)
  1955.         select((index - col_max + item_max) % item_max)
  1956.       end
  1957.       break if current_item_enabled?
  1958.     end
  1959.   end
  1960.   
  1961.   def cursor_down(wrap = false)
  1962.     loop do
  1963.       if (index == (item_max - 3)) or (index == (item_max - 4))
  1964.         select(item_max - 2)
  1965.       elsif index == (item_max - 2)
  1966.         select(item_max - 1)
  1967.       elsif index < item_max - col_max || (wrap && col_max == 1)
  1968.         select((index + col_max) % item_max)
  1969.       end
  1970.       break if current_item_enabled?
  1971.     end
  1972.   end
  1973.   def press_exclude_input?(key)
  1974.     a = [:A,:B,:C,:X,:Y,:Z,:L,:R]
  1975.     f = key.to_s.include?("PAD_") ? true : false
  1976.     a.any?{|sym|
  1977.       nn = f ? ("PAD_" + sym.to_s).to_sym : sym
  1978.       next if nn == key
  1979.       Input._config_press?(sym) && (!$game_system.key_setting[nn] or $game_system.key_setting[nn] == :default)
  1980.     }
  1981.   end
  1982. end

  1983. #==============================================================================
  1984. # ■ Scene_Config
  1985. #------------------------------------------------------------------------------
  1986. #  コンフィグ画面の処理を行うクラスです。
  1987. #==============================================================================

  1988. class Scene_Config < Scene_MenuBase
  1989.   def start
  1990.     super
  1991.     create_help_window
  1992.     create_palette_window if Config_Setting::Alignment.include?(:log_color)
  1993.     create_log_color_window if Config_Setting::Alignment.include?(:log_color)
  1994.     create_key_setting_window if $game_system.use_key_setting?
  1995.     create_config_window
  1996.     @help_window.hide unless Config_Setting::Use_Help
  1997.   end
  1998.   
  1999.   # コンフィグウィンドウの作成
  2000.   def create_config_window
  2001.     @config_window = Window_Config.new
  2002.     @config_window.set_handler(:cancel,   method(:return_scene))
  2003.     @config_window.activate
  2004.     @config_window.select(0)
  2005.     @config_window.help_window = @help_window
  2006.     @config_window.y = [@config_window.y,@help_window.height+@help_window.y].max
  2007.     @config_window.log_color_window = @log_color_window if Config_Setting::Alignment.include?(:log_color)
  2008.     @config_window.key_setting_window = @key_setting_window if Config_Setting::Alignment.include?(:key_setting)
  2009.   end
  2010.   
  2011.   def create_log_color_window
  2012.     @log_color_window = Window_LogColor.new(@help_window)
  2013.     @log_color_window.set_handler(:cancel,   method(:cancel_log_color))
  2014.     @log_color_window.set_handler(:ok,   method(:ok_log_color))
  2015.     @log_color_window.set_handler(:unequip,   method(:unequip_log))
  2016.     @log_color_window.z = 200
  2017.     @log_color_window.deactivate
  2018.   end
  2019.   
  2020.   def create_palette_window
  2021.     @palette_window = Window_Palette.new
  2022.     @palette_window.set_handler(:cancel, method(:cancel_palette))
  2023.     @palette_window.set_handler(:ok, method(:ok_palette))
  2024.     @palette_window.z = 210
  2025.     @palette_window.deactivate
  2026.   end
  2027.   
  2028.   def create_key_setting_window
  2029.     @key_setting_window = Window_KeySetting.new(@help_window)
  2030.     @key_setting_window.set_handler(:ok,   method(:ok_key_setting))
  2031.     @key_setting_window.z = 200
  2032.     @key_setting_window.deactivate
  2033.   end
  2034.   
  2035.   def reload_skin
  2036.     instance_variables.each do |varname|
  2037.       ivar = instance_variable_get(varname)
  2038.       ivar.windowskin = Cache.system("Window") if ivar.is_a?(Window)
  2039.     end
  2040.   end
  2041.   
  2042.   def cancel_log_color
  2043.     @log_color_window.deactivate.close.unselect
  2044.     @config_window.activate
  2045.   end
  2046.   
  2047.   def ok_log_color
  2048.     @log_color_window.deactivate
  2049.     @palette_window.adjust_position(@log_color_window)
  2050.     @palette_window.activate.open.select(0)
  2051.   end
  2052.   
  2053.   def ok_key_setting
  2054.     @key_setting_window.deactivate.close.unselect
  2055.     @config_window.activate.open
  2056.   end
  2057.   
  2058.   def unequip_log
  2059.     @config_window.refresh
  2060.   end
  2061.   
  2062.   def cancel_palette
  2063.     @log_color_window.activate
  2064.     @palette_window.deactivate.close.unselect
  2065.   end
  2066.   
  2067.   def ok_palette
  2068.     set_color
  2069.     @log_color_window.activate.refresh
  2070.     @config_window.refresh
  2071.     @palette_window.deactivate.close.unselect
  2072.   end
  2073.   
  2074.   def set_color
  2075.     gc = Config_Setting::GlobalLogColor[@log_color_window.index]
  2076.     if gc[1]
  2077.       gc[1].each{|c|
  2078.         $game_system.log_colors[c] = @palette_window.index
  2079.       }
  2080.     else
  2081.       $game_system.log_colors[gc[0]] = @palette_window.index
  2082.     end
  2083.   end
  2084.   
  2085.   def return_scene
  2086.     if SceneManager.stack[0].is_a?(Scene_Title)
  2087.       DataManager.save_config_parameters
  2088.     end
  2089.     super
  2090.   end
  2091. end

  2092. #==============================================================================
  2093. # ■ Window_MenuCommand
  2094. #==============================================================================
  2095. class Window_MenuCommand < Window_Command
  2096.   # メニューにオリジナルコマンドを追加
  2097.   # コンフィグを追加します。
  2098.   alias add_original_commands_config add_original_commands
  2099.   def add_original_commands
  2100.     add_original_commands_config
  2101.     add_command(Vocab::config,   :config,   main_commands_enabled)
  2102.   end
  2103. end
  2104. #==============================================================================
  2105. # ■ Scene_Menu
  2106. #==============================================================================
  2107. class Scene_Menu < Scene_MenuBase
  2108.   #--------------------------------------------------------------------------
  2109.   # ● コマンドウィンドウの作成 エイリアス
  2110.   #--------------------------------------------------------------------------
  2111.   alias create_command_window_config create_command_window
  2112.   def create_command_window
  2113.     create_command_window_config
  2114.     @command_window.set_handler(:config,    method(:command_config))
  2115.   end
  2116.   
  2117.   # コンフィグウィンドウのコマンド処理
  2118.   def command_config
  2119.     SceneManager.call(Scene_Config)
  2120.   end
  2121. end

  2122. #==============================================================================
  2123. # ■ Scene_Battle
  2124. #------------------------------------------------------------------------------
  2125. #  バトル画面の処理を行うクラスです。
  2126. #==============================================================================

  2127. class Scene_Battle < Scene_Base
  2128.   #--------------------------------------------------------------------------
  2129.   # ● アニメーションの表示 エイリアス
  2130.   #--------------------------------------------------------------------------
  2131.   alias yy_config_show_animation show_animation
  2132.   def show_animation(targets, animation_id)
  2133.     if $game_system.animation_switch == :off && !$game_switches[Config_Setting::AnimationInvalidSwitch]
  2134.       if $imported_yana_scripts["ExtendIntercept"] && self.respond_to?(:execute_interrupt)
  2135.         execute_interrupt(targets) unless $game_temp.battle_phase
  2136.       end
  2137.       return
  2138.     end
  2139.     yy_config_show_animation(targets, animation_id)
  2140.   end
  2141. end

  2142. module Graphics
  2143.   # ウィンドウをリサイズ
  2144.   def self.resize_window(n)
  2145.     fw = get_window_handle
  2146.     r = Win32API.new("user32","GetSystemMetrics","i","i")
  2147.     init_default_size unless $InitWindowSize
  2148.     iw = $InitWindowSize
  2149.     rr = Array.new.fill(0.chr, 0..16).join
  2150.     ws = Win32API.new("user32", "GetWindowRect", "lp", "i").call(fw, rr)
  2151.     rr = rr.unpack("i*")
  2152.     w,h = iw[0]*n+iw[2],iw[1]*n+iw[3]
  2153.     x = [rr[0]-(w-(rr[2]-rr[0]))/2,0].max
  2154.     y = [rr[1]-(h-(rr[3]-rr[1]))/2,0].max
  2155. #~     Win32API.new("user32","MoveWindow","liiiil","l").call(fw,(sw-w)/2,(sh-h)/2,w,h,1)
  2156.     Win32API.new("user32","MoveWindow","liiiil","l").call(fw,x,y,w,h,1)
  2157.   end
  2158.   
  2159.   # ウィンドウの初期サイズを記録
  2160.   def self.init_default_size
  2161.     fw = get_window_handle
  2162.     r = Array.new.fill(0.chr, 0..16).join
  2163.     r2 = r.clone
  2164.     Win32API.new("user32", "GetWindowRect", "lp", "i").call(fw, r)
  2165.     Win32API.new("user32", "GetClientRect", "lp", "i").call(fw, r2)
  2166.     rect = r.unpack("i*")
  2167.     rect2 = r2.unpack("i*")
  2168.     $InitWindowSize = [rect2[2],rect2[3],(rect[2]-rect[0])-rect2[2],(rect[3]-rect[1])-rect2[3]]
  2169.   end
  2170.   
  2171.   # ウィンドウハンドルの取得
  2172.   def self.get_window_handle
  2173.     Win32API.new("user32","FindWindowEx","llpp","i").call(0,0,"RGSS Player",0)
  2174.   end
  2175. end

  2176. class Window_SaveFile < Window_Base
  2177.   #--------------------------------------------------------------------------
  2178.   # ● リフレッシュ
  2179.   #--------------------------------------------------------------------------
  2180.   alias config_refresh refresh
  2181.   def refresh
  2182.     set_window
  2183.     config_refresh
  2184.   end
  2185.   
  2186.   def set_window
  2187.     header = DataManager.load_header(@file_index)
  2188.     return unless header
  2189.     ws = $game_system.windowskin
  2190.     $game_system.windowskin = 0
  2191.     self.windowskin = Cache.system("Window"+header[:windowskin].to_s) if header[:windowskin] && header[:windowskin] > 0
  2192.     self.windowskin = Cache.system("Window") if header[:windowskin] && header[:windowskin] == 0
  2193.     @tone = header[:window_tone] if header[:window_tone]
  2194.     $game_system.windowskin = ws
  2195.     update_tone
  2196.   end
  2197.   
  2198.   alias config_update_tone update_tone
  2199.   def update_tone
  2200.     self.tone.set(@tone) if @tone
  2201.     config_update_tone unless @tone
  2202.   end
  2203. end

  2204. #
  2205. # GC呼び出し頻度減少
  2206. #
  2207. # マップ画面のGCの呼び出し頻度を減少させることで、ゲーム中のカクつきを抑えます。
  2208. # ただし、GCは不要になったメモリを解放する機能なので、これを導入すると、
  2209. # ゲーム中にPCが消費するメモリが増加します。
  2210. #

  2211. class Scene_Map < Scene_Base
  2212.   if Config_Setting::Alignment.include?(:gc_sec)
  2213.   alias __start start
  2214.   def start
  2215.     __start
  2216.     execute_gc
  2217.   end
  2218.   
  2219.   alias __update update
  2220.   def update
  2221.     @frame_count += 1
  2222.     execute_gc if @frame_count % ($game_system.gc_sec * 60) == 0
  2223.     __update
  2224.   end
  2225.   
  2226.   def execute_gc
  2227.     GC.enable
  2228.     GC.start
  2229.     GC.disable
  2230.     @frame_count = 0
  2231.   end
  2232.   
  2233.   alias __perform_transfer perform_transfer
  2234.   def perform_transfer
  2235.     __perform_transfer
  2236.     execute_gc
  2237.   end
  2238.   end
  2239. end

  2240. class << SceneManager
  2241.   alias config_goto goto
  2242.   def goto(scene_class)
  2243.     GC.enable
  2244.     config_goto(scene_class)
  2245.   end
  2246.   alias config_call call
  2247.   def call(scene_class)
  2248.     GC.enable
  2249.     config_call(scene_class)
  2250.   end
  2251.   def stack
  2252.     @stack
  2253.   end
  2254. end

  2255. class Window_BattleLog < Window_Selectable
  2256.   def set_color_logs(call=nil,arg={})
  2257.     @call = [call,arg]
  2258.   end
  2259.   
  2260.   def change_color_logs(text)
  2261.     return text if text.empty?
  2262.     if @call
  2263.       type = @call[0]
  2264.       arg = @call[1]
  2265.       color = ""
  2266.     else
  2267.       type = :others
  2268.     end
  2269.     case type
  2270.     when :current_state
  2271.       color = $game_system.log_color(type)
  2272.     when :use_item,:chase,:retaliation,:interrupt
  2273.       color = $game_system.log_color(type,arg[:subject].actor?)
  2274.     when :substitute
  2275.       color = $game_system.log_color(type,arg[:substitute].actor?)
  2276.     when :counter,:reflection,:failure,:critical,:miss,:evasion,:added_states,
  2277.          :removed_states,:parry,:guard,:barrier,:barrier_broken,:genei_evasion
  2278.       color = $game_system.log_color(type,arg[:target].actor?)
  2279.     when :hp_damage
  2280.       target = arg[:target]
  2281.       recover = target.result.hp_damage < 0
  2282.       color = $game_system.log_color(type,target.actor?,recover)
  2283.     when :mp_damage
  2284.       target = arg[:target]
  2285.       recover = target.result.mp_damage < 0
  2286.       color = $game_system.log_color(type,target.actor?,recover)
  2287.     when :tp_damage
  2288.       target = arg[:target]
  2289.       recover = target.result.tp_damage < 0
  2290.       color = $game_system.log_color(type,target.actor?,recover)
  2291.     when :buffs
  2292.       target = arg[:target]
  2293.       sup = :removed_buffs
  2294.       sup = :add_buff    if target.result.added_buffs
  2295.       sup = :add_debuff  if target.result.added_debuffs
  2296.       color = $game_system.log_color(type,target.actor?,sup)
  2297.     else
  2298.       color = $game_system.log_color(:others)
  2299.     end
  2300.     return nil if color == -1
  2301.     return "\\C[#{color}]" + text
  2302.   end
  2303.   
  2304.   alias _config_add_text add_text
  2305.   def add_text(text)
  2306.     text = change_color_logs(text)
  2307.     _config_add_text(text)
  2308.   end
  2309.   
  2310.   alias _config_replace_text replace_text
  2311.   def replace_text(text)
  2312.     text = change_color_logs(text)
  2313.     _config_replace_text(text)
  2314.   end
  2315.   
  2316.   alias _config_refresh refresh
  2317.   def refresh
  2318.     @lines.compact!
  2319.     _config_refresh
  2320.   end
  2321.   
  2322.   alias _config_display_current_state display_current_state
  2323.   def display_current_state(subject)
  2324.     set_color_logs(:current_state,{:subject=>subject})
  2325.     _config_display_current_state(subject)
  2326.   end
  2327.   alias _config_display_use_item display_use_item
  2328.   def display_use_item(subject, item)
  2329.     set_color_logs(:use_item,{:subject=>subject,:item=>item})
  2330.     _config_display_use_item(subject,item)
  2331.   end
  2332.   alias _config_display_counter display_counter
  2333.   def display_counter(target, item)
  2334.     set_color_logs(:counter,{:target=>target,:item=>item})
  2335.     _config_display_counter(target,item)
  2336.   end
  2337.   alias _config_display_reflection display_reflection
  2338.   def display_reflection(target, item)
  2339.     set_color_logs(:reflection,{:target=>target,:item=>item})
  2340.     _config_display_reflection(target,item)
  2341.   end
  2342.   alias _config_display_substitute display_substitute
  2343.   def display_substitute(substitute, target)
  2344.     set_color_logs(:substitute,{:substitute=>substitute,:target=>target})
  2345.     _config_display_substitute(substitute, target)
  2346.   end
  2347.   alias _config_display_failure display_failure
  2348.   def display_failure(target, item)
  2349.     set_color_logs(:failure,{:target=>target,:item=>item})
  2350.     _config_display_failure(target,item)
  2351.   end
  2352.   alias _config_display_critical display_critical
  2353.   def display_critical(target, item)
  2354.     set_color_logs(:critical,{:target=>target,:item=>item})
  2355.     _config_display_critical(target,item)
  2356.   end
  2357.   alias _config_display_miss display_miss
  2358.   def display_miss(target, item)
  2359.     set_color_logs(:miss,{:target=>target,:item=>item})
  2360.     _config_display_miss(target, item)
  2361.   end
  2362.   alias _config_display_evasion display_evasion
  2363.   def display_evasion(target, item)
  2364.     set_color_logs(:evasion,{:target=>target,:item=>item})
  2365.     _config_display_evasion(target, item)
  2366.   end
  2367.   alias _config_display_hp_damage display_hp_damage
  2368.   def display_hp_damage(target, item)
  2369.     set_color_logs(:hp_damage,{:target=>target,:item=>item})
  2370.     _config_display_hp_damage(target, item)
  2371.   end
  2372.   alias _config_display_mp_damage display_mp_damage
  2373.   def display_mp_damage(target, item)
  2374.     set_color_logs(:mp_damage,{:target=>target,:item=>item})
  2375.     _config_display_mp_damage(target, item)
  2376.   end
  2377.   alias _config_display_tp_damage display_tp_damage
  2378.   def display_tp_damage(target, item)
  2379.     set_color_logs(:tp_damage,{:target=>target,:item=>item})
  2380.     _config_display_tp_damage(target, item)
  2381.   end
  2382.   alias _config_display_added_states display_added_states
  2383.   def display_added_states(target)
  2384.     set_color_logs(:added_states,{:target=>target})
  2385.     _config_display_added_states(target)
  2386.   end
  2387.   alias _config_display_removed_states display_removed_states
  2388.   def display_removed_states(target)
  2389.     set_color_logs(:removed_states,{:target=>target})
  2390.     _config_display_removed_states(target)
  2391.   end
  2392.   alias _config_display_buffs display_buffs
  2393.   def display_buffs(target, buffs, fmt)
  2394.     set_color_logs(:buffs,{:target=>target,:buffs=>buffs,:fmt=>fmt})
  2395.     _config_display_buffs(target, buffs, fmt)
  2396.   end
  2397.   alias _tt_last_text last_text
  2398.   def last_text
  2399.     _tt_last_text ? _tt_last_text : []
  2400.   end

  2401. if $imported_yana_scripts["ExtendIntercept"]
  2402.   alias _config_display_parry display_parry
  2403.   def display_parry(target, item)
  2404.     set_color_logs(:parry,{:target=>target,:item=>item})
  2405.     _config_display_parry(target,item)
  2406.   end
  2407.   alias _config_display_guard display_guard
  2408.   def display_guard(target,item)
  2409.     set_color_logs(:guard,{:target=>target,:item=>item})
  2410.     _config_display_guard(target,item)
  2411.   end
  2412.   alias _config_display_barrier display_barrier
  2413.   def display_barrier(target,item)
  2414.     set_color_logs(:barrier,{:target=>target,:item=>item})
  2415.     _config_display_barrier(target,item)
  2416.   end
  2417.   alias _config_display_barrier_broken display_barrier_broken
  2418.   def display_barrier_broken(target,item)
  2419.     set_color_logs(:barrier_broken,{:target=>target,:item=>item})
  2420.     _config_display_barrier_broken(target,item)
  2421.   end
  2422.   if self.method_defined?(:display_retaliation)
  2423.     alias _config_display_genei_evasion display_genei_evasion
  2424.     def display_genei_evasion(target,item)
  2425.       set_color_logs(:genei_evasion,{:target=>target,:item=>item})
  2426.       _config_display_genei_evasion(target,item)
  2427.     end
  2428.     alias _config_display_retaliation display_retaliation
  2429.     def display_retaliation(subject,target, item)
  2430.       set_color_logs(:retaliation,{:subject=>subject,:target=>target,:item=>item})
  2431.       _config_display_retaliation(subject,target,item)
  2432.     end
  2433.     alias _config_display_chase display_chase
  2434.     def display_chase(subject, item)
  2435.       set_color_logs(:chase,{:subject=>subject,:item=>item})
  2436.       _config_display_chase(subject,item)
  2437.     end
  2438.     alias _config_display_interrupt display_interrupt
  2439.     def display_interrupt(attacker, subject, ritem, item)
  2440.       set_color_logs(:interrupt,{:attacker=>attacker,:subject=>subject,:ritem=>ritem,:item=>item})
  2441.       _config_display_interrupt(attacker,subject,ritem,item)
  2442.     end
  2443.     alias _config_display_wide_use display_wide_use
  2444.     def display_wide_use(text,sup=nil)
  2445.       case $game_temp.battle_phase
  2446.       when :chase
  2447.         set_color_logs(:chase,{:subject=>sup[0],:item=>sup[3]})
  2448.       when :interrupt
  2449.         set_color_logs(:interrupt,{:attacker=>sup[0],:subject=>sup[1],:ritem=>sup[2],:item=>sup[3]})
  2450.       end
  2451.       if sup[5] == :cover
  2452.         set_color_logs(:substitute,{:substitute=>sup[0],:target=>sup[4]})
  2453.       end
  2454.       _config_display_wide_use(text,sup)
  2455.     end
  2456.   else
  2457.     alias _config_display_genei_evasion display_genei_evasion
  2458.     def display_genei_evasion(target)
  2459.       set_color_logs(:genei_evasion,{:target=>target})
  2460.       _config_display_genei_evasion(target)
  2461.     end
  2462.   end
  2463. end
  2464. end

  2465. class << Input
  2466.   attr_reader :keyinput
  2467.   attr_reader :joyinput
  2468.   attr_accessor :connect_joypad
  2469.   
  2470.   @@repeat_count = {}
  2471.   
  2472.   alias _config_update update
  2473.   def update
  2474.     if $game_system && $game_system.use_key_setting?
  2475.       update_joypad if @connect_joypad == 0 or !@connect_joypad
  2476.       update_keyinput
  2477.     end
  2478.     _config_update
  2479.   end
  2480.   def update_joypad
  2481.     @joypad_api   = Win32API.new("winmm","joyGetPosEx","lp", "l")  unless @joypad_api
  2482.     @prev_joyinput = @joyinput.dup if @joyinput
  2483.     @joyinput = [ 52 , 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].pack("I*")
  2484.     @connect_joypad = @joypad_api.call(0, @joyinput)
  2485.     @joyinput = @joyinput.unpack("I*")
  2486.   end
  2487.   def update_keyinput
  2488.     @keyboard_api = Win32API.new("user32","GetKeyboardState","p","i") unless @keyboard_api
  2489.     @prev_keyinput = @keyinput.dup if @keyinput
  2490.     @keyinput = " " * 256
  2491.     @keyboard_api.call(@keyinput)
  2492.   end
  2493.   def input_key_without_name(keys = nil)
  2494.     keys = @keyinput unless keys
  2495.     i = 0
  2496.     ac = []
  2497.     keys.each_byte{|aa|
  2498.       ac.push(Keycode::Code[i][0]) if aa >= 128 && Keycode::Code[i]
  2499.       i+=1
  2500.     }
  2501.     ac
  2502.   end
  2503.   def input_key(keys = nil)
  2504.     keys = @keyinput unless keys
  2505.     i = 0
  2506.     ac = []
  2507.     keys.each_byte{|aa|
  2508.       ac.push(Keycode::Code[i]) if aa >= 128 && Keycode::Code[i]
  2509.       i+=1
  2510.     }
  2511.     ac
  2512.   end
  2513.   def input_key_without_cursor(keys = nil)
  2514.     ac = input_key(keys)
  2515.     ac.delete(Keycode::Code[37])
  2516.     ac.delete(Keycode::Code[38])
  2517.     ac.delete(Keycode::Code[39])
  2518.     ac.delete(Keycode::Code[40])
  2519.     ac
  2520.   end
  2521.   
  2522.   def input_joykey(keys=nil)
  2523.     keys = @joyinput unless keys
  2524.     i = 0
  2525.     rr = keys.inject({}){|r,value|
  2526.       r[Keycode::JoyInfo[i]] = value
  2527.       i += 1
  2528.       r
  2529.     }
  2530.     rr
  2531.   end
  2532.   
  2533.   alias _config_trigger? trigger?
  2534.   def trigger?(sym)
  2535.     return _config_trigger?(sym) unless ($game_system && $game_system.use_key_setting?)
  2536.     return false if !key_update? && !joy_update?
  2537.     r = _config_trigger?(sym)
  2538.     if $game_system.use_pov?
  2539.       if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
  2540.         return r if r
  2541.         return true if press_joypov == Keycode::POV[sym] && update_key?(sym)
  2542.       end
  2543.     end
  2544.     n1 = $game_system.key_setting[sym]
  2545.     n1 = n1.is_a?(Array) ? n1[0] : nil
  2546.     n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
  2547.     n2 = (!n2 or n2 == :default) ? nil : n2
  2548.     return r unless (n1 or n2)
  2549.     return true if ((n1 && update_key?(n1)) or (n2 && update_key?(n2)))
  2550.     return true if !n1 && r && press_joybutton.empty?
  2551.     return true if !n2 && r && input_key.empty?
  2552.     return false
  2553.   end
  2554.   
  2555.   alias _config_press? press?
  2556.   def press?(sym)
  2557.     return _config_press?(sym) unless ($game_system && $game_system.use_key_setting?)
  2558.     r = _config_press?(sym)
  2559.     if $game_system.use_pov?
  2560.       if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
  2561.         return true if r or (press_joypov == Keycode::POV[sym])
  2562.       end
  2563.     end
  2564.     n1 = $game_system.key_setting[sym]
  2565.     n1 = n1.is_a?(Array) ? n1[0] : nil
  2566.     n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
  2567.     n2 = (!n2 or n2 == :default) ? nil : n2
  2568.     return r unless (n1 or n2)
  2569.     return true if (input_key_without_name.include?(n1) or press_joybutton.include?(n2))
  2570.     return true if !n1 && r && press_joybutton.empty?
  2571.     return true if !n2 && r && input_key.empty?
  2572.     return false
  2573.   end
  2574.   
  2575.   alias _config_repeat? repeat?
  2576.   def repeat?(sym)
  2577.     return _config_repeat?(sym) unless ($game_system && $game_system.use_key_setting?)
  2578.     repeat_count = 7
  2579.     r = _config_repeat?(sym)
  2580.     @@repeat_count[sym] = 25 if (!@@repeat_count[sym] or update_key?(sym))
  2581.     @@repeat_count[sym] = repeat_count if @@repeat_count[sym] <= 0
  2582.     if $game_system.use_pov?
  2583.       if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
  2584.         return r if r
  2585.         @@repeat_count[sym] -= 1 if (press_joypov == Keycode::POV[sym])
  2586.         return (@@repeat_count[sym] % 24 == 0) if (press_joypov == Keycode::POV[sym])
  2587.       end
  2588.     end
  2589.     n1 = $game_system.key_setting[sym]
  2590.     n1 = n1.is_a?(Array) ? n1[0] : nil
  2591.     n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
  2592.     n2 = (!n2 or n2 == :default) ? nil : n2
  2593.     return r unless (n1 or n2)
  2594.     n = (input_key_without_name.include?(n1) or press_joybutton.include?(n2))
  2595.     r = false if n
  2596.     n = true if !n && !n1 && r && press_joybutton.empty?
  2597.     n = true if !n && !n2 && r && input_key.empty?
  2598.     return true if n && r
  2599.     @@repeat_count[sym] -= 1 if n
  2600.     return n && (@@repeat_count[sym] % 24 == 0)
  2601.   end
  2602.   alias _config_dir4 dir4
  2603.   def dir4
  2604.     return _config_dir4 unless ($game_system && $game_system.use_key_setting?)
  2605.     if @connect_joypad == 0 && $game_system.use_pov?
  2606.       return 2 if press_joypov == Keycode::POV[:DOWN]
  2607.       return 8 if press_joypov == Keycode::POV[:UP]
  2608.       return 4 if press_joypov == Keycode::POV[:LEFT]
  2609.       return 6 if press_joypov == Keycode::POV[:RIGHT]
  2610.     end
  2611.     return _config_dir4
  2612.   end
  2613.   alias _config_dir8 dir8
  2614.   def dir8
  2615.     return _config_dir8 unless ($game_system && $game_system.use_key_setting?)
  2616.     if @connect_joypad == 0 && $game_system.use_pov?
  2617.       return 1 if press_joypov == Keycode::POV[:DL]
  2618.       return 2 if press_joypov == Keycode::POV[:DOWN]
  2619.       return 3 if press_joypov == Keycode::POV[:DR]
  2620.       return 4 if press_joypov == Keycode::POV[:LEFT]
  2621.       return 6 if press_joypov == Keycode::POV[:RIGHT]
  2622.       return 7 if press_joypov == Keycode::POV[:UL]
  2623.       return 8 if press_joypov == Keycode::POV[:UP]
  2624.       return 9 if press_joypov == Keycode::POV[:UR]
  2625.     end
  2626.     return _config_dir8
  2627.   end
  2628.   def press_joybutton
  2629.     Keycode.press?(input_joykey[:Button])
  2630.   end
  2631.   def press_joypov
  2632.     input_joykey[:POV]
  2633.   end
  2634.   def joy_button_update?
  2635.     return false unless @connect_joypad == 0
  2636.     @joyinput[8] != @prev_joyinput[8]
  2637.   end
  2638.   def joy_pov_update?
  2639.     return false unless @connect_joypad == 0
  2640.     @joyinput[10] != @prev_joyinput[10]
  2641.   end
  2642.   def joy_axis_update?
  2643.     return false unless @connect_joypad == 0
  2644.     (@joyinput[2]/10000) != (@prev_joyinput[2]/10000) or
  2645.     (@joyinput[3]/10000) != (@prev_joyinput[3]/10000)
  2646.   end
  2647.   def joy_update?
  2648.     return false unless @connect_joypad == 0
  2649.     joy_button_update? or joy_pov_update? or joy_axis_update?
  2650.   end
  2651.   def key_update?
  2652.     @keyinput != @prev_keyinput
  2653.   end
  2654.   def update_key?(sym)
  2655.     if Keycode::POV.keys.include?(sym)
  2656.       return joy_pov_update?
  2657.     end
  2658.     ss = sym
  2659.     ss = $game_system.key_setting[("PAD_"+sym.to_s).to_sym] unless ss.to_s.include?("button")
  2660.     if Keycode.press?(input_joykey[:Button]).include?(ss)
  2661.       return !Keycode.press?(input_joykey(@prev_joyinput)[:Button]).include?(ss)
  2662.     end
  2663.     return input_key_without_name.include?(sym) && !input_key_without_name(@prev_keyinput).include?(sym)
  2664.   end
  2665. end

  2666. class Scene_Title < Scene_Base
  2667.   
  2668.   alias _config_create_command_window create_command_window
  2669.   def create_command_window
  2670.     _config_create_command_window
  2671.     @command_window.set_handler(:config, method(:command_config))
  2672.   end
  2673.   
  2674.   def command_config
  2675.     SceneManager.call(Scene_Config)
  2676.   end
  2677. end

  2678. class Window_TitleCommand < Window_Command
  2679.   alias _config_make_command_list make_command_list
  2680.   def make_command_list
  2681.     _config_make_command_list
  2682.     if Config_Setting::TitleConfigEnable
  2683.       add_command(Vocab::config, :config)
  2684.       r = @list.dup
  2685.       n = @list.size
  2686.       n.times{|i|
  2687.         case r[0][:symbol]
  2688.         when :shutdown;@list[n-1] = r.shift
  2689.         when :config  ;@list[n-2] = r.shift
  2690.         else          ;@list[i] = r.shift
  2691.         end
  2692.       }
  2693.     end
  2694.   end
  2695. end
复制代码

点评

谢谢,里面的脚本非常有用!  发表于 2015-6-27 20:14
脚本合集http://yunpan.cn/cQvyfCwgnJ3P3 访问密码 5180:複制Graphics\System中的文件  发表于 2015-6-27 18:45
Window1至Window7則放在Graphics\System中  发表于 2015-6-27 18:43
非常感谢,话说这个脚本还真是够长的!  发表于 2015-6-27 18:43

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部