| 赞 | 168 |
| VIP | |
| 好人卡 | |
| 积分 | 229 |
| 经验 | |
| 最后登录 | 2025-4-1 |
| 在线时间 | 8598 小时 |
- 梦石
- 0
- 星屑
- 22879
- 在线时间
- 8598 小时
- 注册时间
- 2011-12-31
- 回帖
- 3270
|
发表于 2015-6-27 18:39:50
|
显示全部楼层
把整個画面放大也是一個方法
コンフィグ機能追加- =begin
- コンフィグ機能追加スクリプト ver1.111
-
- メニューやタイトルにコンフィグ機能を追加するスクリプトです。
-
- ・画面表示倍率の変更
- ・BGM・MEボリューム
- ・SE・BGSボリューム
- ・戦闘メッセージ速度の変更
- ・ウィンドウトーンの変更
- ・ウィンドウスキンの変更
- ・キー配置の変更、
- ・アニメーション速度の変更
- ・アニメーションの表示の切替
- ・ダッシュ方式の変更
- ・ログカラーの変更
- ・ショートカットの設定
- ・変数の操作
- ・スイッチの操作
- ・GC頻度の設定
-
- が可能です。
-
-
- ------------------------------------------------------------------------------
- ※タイトルでのコンフィグ変更について
- ------------------------------------------------------------------------------
- ver1.10より、タイトルでコンフィグを変更すると、シーンを抜けたときに、
- Config.rvdata2が生成されるようになりました。
- これは、ゲーム起動時とニューゲーム時に読み込まれ、コンフィグの設定を変更します。
- 配布の際はこのデータの削除を忘れないように気を付けてください。
-
- ------------------------------------------------------------------------------
- ※パッドについて
- ------------------------------------------------------------------------------
- キー設定があると、環境によってパッドの動作が不安定になる可能性があるため、
- ゲームの解説文やreadme等に無効化の方法を記述することをお勧めします。
- キー設定が設定項目になければ何もしないため、それらの状態を確実に回避したい場合、
- キー設定は項目から除外することをお勧めします。
-
- ver1.11より、iniからキー設定機能を無効化できるようになりました。
- Game.iniに以下の文を追加することで、キー設定機能を無効化し、操作をデフォルトの
- みに設定することができます。記述する際はスペースは削除してください。
-
- [KeyConfig]
- UseKeySetting=false
-
- また、キー設定はパッドのハットスイッチ(十字キー)を使用可能にするため、JoytoKey
- などの外部ツールでハットスイッチにキーを割り当てていた場合、正常な動作をしなく
- なる可能性が高くなります。
- ハットスイッチの設定のみをiniで無効化する場合、以下の記述をiniに加えてください。
- 記述する際はスペースは削除してください。
-
- [KeyConfig]
- UsePOV=false
-
- ------------------------------------------------------------------------------
- ※GCの頻度設定について
- ------------------------------------------------------------------------------
- GCとは、ガーベージコレクションというRubyの機能です。
- この機能はプログラムを実行する上で発生したデータのゴミを収集し、掃除するための
- 機能ですが、ゲームのデータ領域が拡大しすぎると、この機能の処理に時間がかかり、
- フレームレート低下の原因になるため、頻度を制御することで、フレームレートを安定
- させるのが目的です。
- ただし、この項目の数値を大きく設定するとメモリの消費量が増えるため、基本的には
- 導入せず、デフォルトのままで動作させる方が良いので、この設定項目は基本的には利
- 用しないことをお勧めします。
-
- ※オートバトルより下に配置してください
- ※インタセプト能力拡張より下に配置してください
- ※このスクリプトはできるだけ下の方に配置してください。
- ※特に理由がない限り、GC頻度の設定はオフを推奨します。
-
- ver1.111:インタセプト拡張と併用時バリア消滅時のメッセージが正常でないバグを修正
- ver1.11:キー設定の項目をiniで無効化する機能を追加
- ウィンドウスキンを変更した後で内部にウィンドウを持つ項目を選択した時、
- 正常にスキンが変更されていないバグを修正
- 設定を戻すでキー設定が初期化されないバグを修正
- 解説を追記、内容を調整
- POVを使用するかどうかを設定する項目を追加
- POVの機能をiniで無効化する機能を追加
- 8方向判定用のメソッドの記述が間違っていたのを修正
- ver1.10:キー設定の項目を追加
- ウィンドウサイズ変更時に、変更前のウィンドウの位置を保存するように変更
- タイトル画面にコンフィグの項目を追加
- タイトルへの追加に伴い、タイトルでコンフィグ設定をした場合、設定を出力
- するように変更。ニューゲーム時にこの設定を読み込んで使用します
- メニューなどで表示するコンフィグの名称を設定する項目を追加
- 画面サイズの変更をウィンドウの左上基準からウィンドウの中心基準に変更
- ver1.091:ゲームを終了してタイトルに戻った際、画面サイズが元に戻らないバグを修正
- ver2.00未満のインタセプト拡張と同時に導入した場合、エラーがでるバグを修正
- ver1.09:ログカラーの項目を追加
- 変数の項目を追加
- スイッチの項目を追加
- 導入していない項目が設定初期化で初期化されていたバグを修正
- 設定初期化でGC頻度が初期化されないバグを修正
- ver1.081:画面サイズ変更した時、ロード時に自動で画面サイズが変わらないバグを修正
- ver1.08:GC頻度の項目を追加
- ショートカットが正常に動作しないことのあるバグを修正
- 低いバージョンのインタセプト拡張と同時に導入した場合、エラー落ちする
- バグを修正
- ver1.071:オーグメント合成と同時に導入していない場合エラー落ちするバグを修正
- ver1.07:ウィンドウスキン変更の項目を追加
- ショートカットの項目を追加
- ver1.06:アニメーションを高速化していた場合、マップで表示されるアニメーションも
- 高速化されてしまっていたバグを修正
- アニメーションの高速化を無効化する機能をアニメーションをオフにするスイ
- ッチに追加
- ver1.05:アニメーション高速化の項目を追加
- インタセプト能力拡張のアップデートに合わせて、処理を修正
- ver1.04:アニメーションオフスイッチを戦闘速度通常化スイッチに変更。このスイッチ
- がオンの時、アニメが強制的に表示状態になり、戦闘メッセージ速度が通常に
- 戻ります
- 戦闘メッセージ速度の下限値を設定する項目を追加
- 途中導入時の初期化処理にバグがあったのを修正
- ver1.03:ウィンドウ倍化表示をウィンドウそのものではなくクライアント領域が倍化
- するように変更
- アニメーションOFF機能を無効化するスイッチを追加、これをONにすることで
- アニメーションがOFF設定でもアニメーションを表示することができます
- ver1.02:ヘルプ表示機能を追加
- ver1.01:アニメーション表示のオンオフ機能を追加
- 各項目に説明を追加
- ver1.00:公開
- =end
- $imported_yana_scripts ||= {}
- $imported_yana_scripts["Config"] = true
- module Config_Setting
- # メニューなどに表示するコンフィグの名称
- ConfigName = "コンフィグ"
-
- # タイトルにコンフィグの項目を追加するか
- TitleConfigEnable = true
-
- # アニメーションOFFを無効化するスイッチ番号(オンの時機能が無効化)
- # アニメーションの高速化も同時に無効化します
- AnimationInvalidSwitch = 11
-
- # ヘルプウィンドウを利用するか
- Use_Help = true
- # 選択したログを非表示にする機能を利用するか
- # この機能がオンの時、:Aキーで選択中のログを非表示にできます
- Hide_Log = true
- # キー設定でデフォルトのキーの編集を許可するか
- # ここをtrueにすると、設定次第ではキーが重複する可能性があります
- # 重複してキー設定が起動できなくなった場合、F1でデフォルトのキー設定を調整してください
- DefaultKeyChangable = true
-
- # キー設定導入時、ハットスイッチ(パッドの十字キー)を使用するか?
- Use_POV = true
-
- Volume_Gauge = {
- :color1 => Color.new(128,255,128), #有効なボリューム値の色
- :color2 => Color.new(128,128,128) #無効なボリューム値の色
- }
-
- Dash_Cursor = {
- :color1 => Color.new(255,255,255,128), #ダッシュカーソルの色1
- :color2 => Color.new(128,128,255,128) #ダッシュカーソルの色2
- }
-
- Anime_Cursor = {
- :color1 => Color.new(255,255,255,128), #アニメ表示カーソルの色1
- :color2 => Color.new(255,165,0,128) #アニメ表示カーソルの色2
- }
-
- Skin_Cursor = {
- :color1 => Color.new(255,255,255,128), #スキン変更カーソルの色1
- :color2 => Color.new(168,255,128,128) #スキン変更カーソルの色2
- }
-
- Shortcut_Cursor = {
- :color1 => Color.new(255,255,255,128), #ショートカットカーソルの色1
- :color2 => Color.new(255,128,128,128) #ショートカットカーソルの色2
- }
-
- # 配置 ここからキーを削除すると、コンフィグの項目からも消えます。
- # また、各項目の順番もここで変更することができます。
- Alignment = [
- :screen_size, # 画面倍率の設定
- :bgm, # BGM/MEのボリューム設定
- :se, # SE/BGSのボリューム設定
- :windowskin, # ウィンドウスキンの設定
- :window_tone, # ウィンドウトーンの設定
- :key_setting, # キーの設定
- :animation_switch, # アニメーション表示の設定
- :battle_message, # 戦闘メッセージ速度の設定
- :animation_speed, # アニメーション速度の設定
- :dash_type, # ダッシュタイプの設定
- :log_color, # ログカラーの設定
- :shortcut, # ショートカットの設定
- :variables1, # 変数の設定1
- :variables2, # 変数の設定2
- :switches1, # スイッチの設定1
- #~ :gc_sec, # GC頻度の設定 この項目を消せばGCは通常通り実行されます。
- :reset # 全項目のリセット
- ]
- # ショートカットのリスト コマンド名,クラス,メニューシンボル
- # 2つ目の項目を数字に変えることで、コモンイベントをショートカットで呼び出す
- # こともできます。
- # ※エラー回避のため、クラスチェンジ、スキル設定、合成のショートカットをコメントアウト
- def self.shortcut_list
- [
- [Vocab.item,Scene_Item,:item],
- [Vocab.skill,Scene_Skill,:skill],
- [Vocab.equip,Scene_Equip,:equip],
- [Vocab.status,Scene_Status,:status],
- [Vocab.config,Scene_Config,:config],
- ["ロード",Scene_Load,:load],
- [Vocab.save,Scene_Save,:save],
- [Vocab.game_end,Scene_End,:game_end],
- #~ [Vocab.class_change,Scene_ClassChange,:class_change],
- #~ [Vocab.skill_setting,Scene_SkillSetting,:skill_setting],
- #~ [Vocab.compose,Scene_AugmentCompose,:compose],
- ["コモン1",7,:common1],
- ]
- end
-
- # ショートカットを無効化するスイッチのID オンの時無効化
- DisableShortcutSID = 30
-
- # キー => [項目名,初期設定,説明文,追加設定]
- Contents = {
- # 画面の表示倍率 初期値は等倍
- :screen_size => ["画面表示倍率",1.0,"画面サイズを変更します。",[1.0,3.0]],
- # BGM,MEの音量 初期値は50%
- :bgm => ["BGM・ME",0.5,"BGM,MEのボリュームを変更します。"],
- # SE,BGSの音量 初期値は50%
- :se => ["SE・BGS",0.5,"SE,BGSのボリュームを変更します。"],
- # 背景ウィンドウのスキン 追加設定で項目数を設定します。
- # Graphics/Systemのフォルダ内にWindow○.png(○は数字1~)を項目数-1個分だけ用意してください。
- :windowskin => ["ウィンドウスキン",0,"ウィンドウのスキンを変更します。",8],
- # 背景ウィンドウの色 初期値はデータベースで設定したもの
- :window_tone => ["ウィンドウトーン",nil,"ウィンドウのカラーを変更します。"],
- # キー設定の変更 初期値はツクールデフォルトと同じ
- # 使用しないキーはnilに、使用するキーは:defaultに設定してください
- # ここで順番を変更すると、設定画面でも順番が変更されますが、
- # 変更した場合は、下のヘルプやボタン名称の項目も併せて変更してください。
- :key_setting => ["キー設定",{:C=>:default,:A=>:default,:B=>:default,:X=>:default,
- :Y=>:default,:Z=>nil,:L=>:default,:R=>:default,
- :PAD_C=>:default,:PAD_A=>:default,:PAD_B=>:default,:PAD_X=>:default,
- :PAD_Y=>:default,:PAD_Z=>nil,:PAD_L=>:default,:PAD_R=>:default},
- # コンフィグ画面のヘルプに表示する文章
- "キー設定を変更します。\nデフォルト設定以外では複数のキーは設定できません。",
- # 各項目にカーソルを合わせたときに出るヘルプ。↑の設定と順番を合わせてください
- ["決定や会話などに使用します。","ダッシュなどに使用します。",
- "キャンセルやメニューなどに使用します。","アイテム画面などでアイテムをソートするのに使用します。",
- "アイテム画面やストレージ画面などでアイテムを売ったり\n捨てたりするのに使用します。","使用しません。",
- "ショートカット1やオートの起動に使用します。","ショートカット2に使用します。"],
- # 各ボタンの名称 こちらも↑の設定と順番を合わせてください
- [["C","A","B","X","Y","Z","L","R", # キーボード用
- "PAD_C","PAD_A","PAD_B","PAD_X","PAD_Y","PAD_Z","PAD_L","PAD_R"],# パッド用
- # 各用語
- "キーボード","ゲームパッド","変更して終了","デフォルトに戻す",
- # ヘルプ用のテキスト
- "カーソルを合わせて設定したいキーを押してください", # キー設定の一番上に表示するテキスト
- "変更内容を決定してキー設定を終了します。",# 終了にカーソルを合わせたときにヘルプに表示するテキスト
- "変更内容をデフォルト設定に戻します。"]],# デフォルト設定にカーソルを合わせたときにヘルプに表示するテキスト
- # 戦闘メッセージ速度 初期値は100% 追加設定で下限値が設定できます。
- :battle_message => ["戦闘メッセージ速度",0.4,"戦闘メッセージの速度を変更します。\n早くしすぎると戦況を理解しづらくなるので注意してください。",0.1],
- # アニメーション表示のオンオフ 初期値はオン
- :animation_switch => ["アニメーション表示",:on,"アニメーションの表示非表示を変更します。"],
- # アニメーション表示速度 初期値は4
- :animation_speed => ["アニメーション速度",2,"アニメーションの表示速度を変更します。\nアニメーション非表示の場合は変更できません。",1],
- # ダッシュ方式の設定 :normalでデフォルト、:alwaysで常時ダッシュ 初期値はデフォルト
- :dash_type => ["ダッシュ方式",:normal,"ダッシュの設定を変更できます。\n通常はボタンを押しているときのみダッシュです。"],
- # ログカラーの設定 初期値は詳細設定に準拠
- :log_color => ["ログカラー",nil,"戦闘ログの色を詳細に変更できます。"],
- # 変数の設定 追加設定で[変数ID,[[項目1の名称,設定値],[項目2の名称,設定値],…]]という風に設定します。
- # また、[変数ID,最低値,最大値]という設定も可能で、こちらで設定すると数値変更式になります。
- # 変数は:variables1,:variables2,:variables3…と複数設定することが可能です。
- :variables1 => ["変数1",105,"変数の値を変更します。",[21,[["変数設定のテスト",1],["テスト2",4],["テスト3",16],["テスト4",33],["テスト終わり",105]]]],
- :variables2 => ["変数2", 10,"変数の値を変更します。",[22,0,20]],
- # スイッチの設定1 追加設定の0番目に対応するスイッチID、以降でオンオフそれぞれに対応する項目名を設定します。
- # スイッチは:switches1,:switches2,:switches3…と複数設定することが可能です。
- :switches1 => ["スイッチ1",true,"スイッチのオンオフ変更します。",[35,"オン","オフ"]],
- # ショートカットの設定 初期値はLがセーブ、Rがロード
- :shortcut => ["ショートカット",[[:L,0],[:R,2]],"ショートカットの設定を変更できます。\n↑↓キーで設定を変更、←→キーで項目を選択します。"],
- # ガーベージコレクション頻度の設定、初期値は5秒
- :gc_sec => ["GC頻度",5,"ガーベージコレクションの発生頻度を設定します。\n設定値秒に一度実行されます。",3,30],
- # 設定の初期化
- :reset => ["設定を戻す",nil,"設定を初期化します。"],
- }
-
- GlobalLogColor = []
- LogColor = []
-
- # グローバルログカラーの設定
- # 各設定項目をひとまとめにした設定を行うことができます。
- # [設定色,設定を行うログカラーインデックスの配列,表示するタイトル,ヘルプに表示する説明]
- # の順で設定します。
- # この中に詳細ログカラーのインデックスを入れることで、詳細ログの設定を追加します。
- GlobalLogColor[0] = [10,[19,40,44,48],"被ダメージ","味方へのダメージに関するメッセージの色設定。"]
- GlobalLogColor[1] = [ 2,[18,41,45,49],"与ダメージ","敵へのダメージに関するメッセージの色設定。"]
- GlobalLogColor[2] = [24,[38,42,46],"味方回復","味方への回復に関するメッセージの色設定。"]
- GlobalLogColor[3] = [29,[39,43,47],"敵回復","敵への回復に関するメッセージの色設定。"]
- GlobalLogColor[4] = [ 6,[2,4,6,8,10,12,14,30,32],"味方行動","味方の行動に関するメッセージの色設定。"]
- GlobalLogColor[5] = [ 5,[3,5,7,9,11,13,15,31,33],"敵行動","敵の行動に関するメッセージの色設定。"]
- GlobalLogColor[6] = [21,[16,20,23,29,37],"味方ミス","味方の行動が失敗した時のメッセージの色設定。"]
- GlobalLogColor[7] = [ 4,[17,21,22,28,36],"敵ミス","敵の行動が失敗した時のメッセージの色設定。"]
- GlobalLogColor[8] = [27,[24,26,34,50,52,54],"味方ステート","味方がステートやバフの効果を受けた時のメッセージの色設定。"]
- GlobalLogColor[9] = [31,[25,27,35,51,53,55],"敵ステート","敵がステートやバフの効果を受けた時のメッセージの色設定。"]
- GlobalLogColor[10] = [ 0,[0,1,56],"その他","その他のメッセージの色設定。"]
- GlobalLogColor[11] = [10]
-
- # ログカラーの詳細設定
- # インデックスとの対応は各説明に準拠します。
- # -1を設定するとグローバル設定を使用します。
- # グローバル設定がない場合、0が代入されます。
- # 現在継続中のステートの表示:味方
- LogColor[0] = [-1,"味方:ステート継続","味方側の継続中ステートの継続メッセージの色設定。"]
- # 現在継続中のステートの表示:敵
- LogColor[1] = [-1,"敵:ステート継続","敵側の継続中ステートの継続メッセージの色設定。"]
- # スキルやアイテムの使用:味方
- LogColor[2] = [-1,"味方:使用","味方側のスキルやアイテムの使用メッセージの色設定。"]
- # スキルやアイテムの使用:敵
- LogColor[3] = [-1,"敵:使用","敵側のスキルの使用メッセージの色設定。"]
- # 追撃の発動:味方
- LogColor[4] = [-1,"味方:追撃","味方側の追撃発動時のメッセージの色設定。"]
- # 追撃の発動:敵
- LogColor[5] = [-1,"敵:追撃","敵側の追撃発動時のメッセージの色設定。"]
- # 仕返しの発動:味方
- LogColor[6] = [-1,"味方:仕返し","味方側の仕返し発動時のメッセージの色設定。"]
- # 仕返しの発動:敵
- LogColor[7] = [-1,"敵:仕返し","敵側の仕返し発動時のメッセージの色設定。"]
- # 割込みの発動:味方
- LogColor[8] = [-1,"味方:割込み","味方側の割込み発動時のメッセージの色設定。"]
- # 割込みの発動:敵
- LogColor[9] = [-1,"敵:割込み","敵側の割込み発動時のメッセージの色設定。"]
- # 身代わりの発動:味方
- LogColor[10] = [-1,"味方:身代わり","味方側の身代わり発動時のメッセージの色設定。"]
- # 身代わりの発動:敵
- LogColor[11] = [-1,"敵:身代わり","敵側の身代わり発動時のメッセージの色設定。"]
- # 反撃の発動:味方
- LogColor[12] = [-1,"味方:反撃","味方側の反撃発動時のメッセージの色設定。"]
- # 反撃の発動:敵
- LogColor[13] = [-1,"敵:反撃","敵側の反撃発動時のメッセージの色設定。"]
- # 反射の発動:味方
- LogColor[14] = [-1,"味方:反射","味方側の反射発動時のメッセージの色設定。"]
- # 反射の発動:敵
- LogColor[15] = [-1,"敵:反射","敵側の反射発動時のメッセージの色設定。"]
- # 行動の失敗:味方
- LogColor[16] = [-1,"味方:行動失敗","味方側の行動失敗時のメッセージの色設定。"]
- # 行動の失敗:敵
- LogColor[17] = [-1,"敵:行動失敗","敵側の行動失敗時のメッセージの色設定。"]
- # 会心の発動:味方
- LogColor[18] = [-1,"味方:会心","味方側の会心発生時のメッセージの色設定。"]
- # 会心の発動:敵
- LogColor[19] = [-1,"敵:痛恨","敵側の痛恨発生時のメッセージの色設定。"]
- # ミスの表示:味方
- LogColor[20] = [-1,"味方:ミス","味方側のミス発生時のメッセージの色設定。"]
- # ミスの表示:敵
- LogColor[21] = [-1,"敵:ミス","敵側のミス発生時のメッセージの色設定。"]
- # 回避の表示:味方
- LogColor[22] = [-1,"味方:回避","味方側の回避発生時のメッセージの色設定。"]
- # 回避の表示:敵
- LogColor[23] = [-1,"敵:回避","敵側の回避発生時のメッセージの色設定。"]
- # 付与されたステートの表示:味方
- LogColor[24] = [-1,"味方:ステート付与","味方側にステートが付与された時のメッセージの色設定。"]
- # 付与されたステートの表示:敵
- LogColor[25] = [-1,"敵:ステート付与","敵側にステートが付与された時のメッセージの色設定。"]
- # 解除されたステートの表示:味方
- LogColor[26] = [-1,"味方:ステート解除","味方側のステートが解除された時のメッセージの色設定。"]
- # 解除されたステートの表示:敵
- LogColor[27] = [-1,"敵:ステート解除","敵側のステートが解除された時のメッセージの色設定。"]
- # パリィの表示:味方
- LogColor[28] = [-1,"味方:パリィ","味方側のパリィ発生時のメッセージの色設定。"]
- # パリィの表示:敵
- LogColor[29] = [-1,"敵:パリィ","敵側のパリィ発生時のメッセージの色設定。"]
- # ガードの表示:味方
- LogColor[30] = [-1,"味方:ガード","味方側のガード発生時のメッセージの色設定。"]
- # ガードの表示:敵
- LogColor[31] = [-1,"敵:ガード","敵側のパリィ発生時のメッセージの色設定。"]
- # バリアの表示:味方
- LogColor[32] = [-1,"味方:バリア","味方側のバリア発生時のメッセージの色設定。"]
- # バリアの表示:敵
- LogColor[33] = [-1,"敵:バリア","敵側のバリア発生時のメッセージの色設定。"]
- # バリア破壊の表示:味方
- LogColor[34] = [-1,"味方:バリア破壊","味方側のバリアが壊れた時のメッセージの色設定。"]
- # バリア破壊の表示:敵
- LogColor[35] = [-1,"敵:バリア破壊","敵側のバリアが壊れた時のメッセージの色設定。"]
- # 幻影回避の表示:味方
- LogColor[36] = [-1,"味方:幻影回避","味方側の幻影回避が発生した時のメッセージの色設定。"]
- # 幻影回避の表示:敵
- LogColor[37] = [-1,"敵:幻影回避","敵側の幻影回避が発生した時のメッセージの色設定。"]
- # HP回復の表示:味方
- LogColor[38] = [-1,"味方:HP回復","味方側のHPが回復した時のメッセージの色設定。"]
- # HP回復の表示:敵
- LogColor[39] = [-1,"敵:HP回復","敵側のHPが回復した時のメッセージの色設定。"]
- # HPダメージの表示:味方
- LogColor[40] = [-1,"味方:HPダメ―ジ","味方側がダメージを受けた時のメッセージの色設定。"]
- # HPダメージの表示:敵
- LogColor[41] = [-1,"敵:HPダメージ","敵側にダメージを与えた時のメッセージの色設定。"]
- # MP回復の表示:味方
- LogColor[42] = [-1,"味方:MP回復","味方側のMPが回復した時のメッセージの色設定。"]
- # MP回復の表示:敵
- LogColor[43] = [-1,"敵:MP回復","敵側のMPが回復した時のメッセージの色設定。"]
- # MPダメージの表示:味方
- LogColor[44] = [-1,"味方:MPダメージ","味方側がMPダメージを受けた時のメッセージの色設定。"]
- # MPダメージの表示:敵
- LogColor[45] = [-1,"敵:MPダメージ","敵側にMPダメージを与えた時のメッセージの色設定。"]
- # TP回復の表示:味方
- LogColor[46] = [-1,"味方:TP回復","味方側のTPが回復した時のメッセージの色設定。"]
- # TP回復の表示:敵
- LogColor[47] = [-1,"敵:TP回復","敵側のTPが回復した時のメッセージの色設定。"]
- # TPダメージの表示:味方
- LogColor[48] = [-1,"味方:TPダメ―ジ","味方側がTPダメージを受けた時のメッセージの色設定。"]
- # TPダメージの表示:敵
- LogColor[49] = [-1,"敵:TPダメージ","敵側にTPダメージを与えた時のメッセージの色設定。"]
- # 付与されたバフの表示:味方
- LogColor[50] = [-1,"味方:バフ付与","味方側にバフが付与された時のメッセージの色設定。"]
- # 付与されたバフの表示:敵
- LogColor[51] = [-1,"敵:バフ付与","敵側にバフが付与された時のメッセージの色設定。"]
- # 付与されたデバフの表示:味方
- LogColor[52] = [-1,"味方:デバフ付与","味方側にデバフが付与された時のメッセージの色設定。"]
- # 付与されたデバフの表示:敵
- LogColor[53] = [-1,"敵:デバフ付与","敵側にデバフが付与された時のメッセージの色設定。"]
- # 解除されたバフの表示:味方
- LogColor[54] = [-1,"味方:バフ解除","味方側のバフが解除された時のメッセージの色設定。"]
- # 解除されたバフの表示:敵
- LogColor[55] = [-1,"敵:バフ解除","敵側のバフが解除された時のメッセージの色設定。"]
- # その他、設定されていないログの表示
- LogColor[56] = [-1,"その他","その他のメッセージの色設定。"]
- end
- module Keycode
- JoyInfo = [:size,:flags,:AxisX,:AxisY,:AxisZ,:AngleZ,
- :ext1,:ext2,:Button,:Input,:POV,:ext3,:ext4]
- JoyButton = {:button1 => 1, :button2 => 2, :button3 => 4,:button4 => 8,
- :button5 => 16,:button6 => 32,:button7 =>64,:button8 => 128,
- :button9 =>256,:button10=>512,:button11=>1024,:button12=>2048}
-
- POV = {:UP=>0,:RIGHT=>9000,:DOWN=>18000,:LEFT=>27000,
- :UR=>4500,:DR=>13500,:DL=>22500,:UL=>31500}
- Code = {
- 8=>[:V_BS,"BackSpace"],
- 9=>[:V_TAB,"Tab"],
- 12=>[:V_CLEAR,"Clear"],
- 13=>[:V_RETURN,"Enter"],
- 16=>[:V_SHIFT,"Shift"],
- 17=>[:V_CTRL,"Ctrl"],
- 18=>[:V_ALT,"Alt"],
- 19=>[:V_PAUSE,"Pause"],
- 20=>[:V_CAPSLOCK,"CapsLock"],
- 27=>[:V_ESC,"Esc"],
- 29 => [:V_NC,"無変換"], # 無変換
- 32 => [:V_SPACE,"Space"],# Space
- 33 => [:V_PU,"PageUp"], # PageUp
- 34 => [:V_PD,"PageDown"], # PageDown
- 35 => [:V_END,"End"], # End
- 36 => [:V_HOME,"Home"], # Home
- 37 => [:V_LEFT,"←"], # ←
- 38 => [:V_UP,"↑"], # ↑
- 39 => [:V_RIGHT,"→"],# →
- 40 => [:V_DOWN,"↓"], # ↓
- 44 => [:V_PS,"PrintScreen"], # PrintScreen
- 45 => [:V_INS,"Insert"], # Insert
- 46 => [:VK_DEL,"Delete"], # Delete
- 48 => [:V_0,"0"], # 0
- 49 => [:V_1,"1"], # 1
- 50 => [:V_2,"2"], # 2
- 51 => [:V_3,"3"], # 3
- 52 => [:V_4,"4"], # 4
- 53 => [:V_5,"5"], # 5
- 54 => [:V_6,"6"], # 6
- 55 => [:V_7,"7"], # 7
- 56 => [:V_8,"8"], # 8
- 57 => [:V_9,"9"], # 9
- 65 => [:V_A,"A"], # A
- 66 => [:V_B,"B"], # B
- 67 => [:V_C,"C"], # C
- 68 => [:V_D,"D"], # D
- 69 => [:V_E,"E"], # E
- 70 => [:V_F,"F"], # F
- 71 => [:V_G,"G"], # G
- 72 => [:V_H,"H"], # H
- 73 => [:V_I,"I"], # I
- 74 => [:V_J,"J"], # J
- 75 => [:V_K,"K"], # K
- 76 => [:V_L,"L"], # L
- 77 => [:V_M,"M"], # M
- 78 => [:V_N,"N"], # N
- 79 => [:V_O,"O"], # O
- 80 => [:V_P,"P"], # P
- 81 => [:V_Q,"Q"], # Q
- 82 => [:V_R,"R"], # R
- 83 => [:V_S,"S"], # S
- 84 => [:V_T,"T"], # T
- 85 => [:V_U,"U"], # U
- 86 => [:V_V,"V"], # V
- 87 => [:V_W,"W"], # W
- 88 => [:V_X,"X"], # X
- 89 => [:V_Y,"Y"], # Y
- 90 => [:V_Z,"Z"], # Z
- 91 => [:V_LWIN,"左Windows"], # 左Windows
- 92 => [:V_RWIN,"右Windows"], # 右Windows
- 93 => [:V_APP,"AppMenu"], # ApplicationMenu
- 96 => [:V_N0,"NumPad_0"], # VK_NUMPAD0 0
- 97 => [:V_N1,"NumPad_1"], # VK_NUMPAD1 1
- 98 => [:V_N2,"NumPad_2"], # VK_NUMPAD2 2
- 99 => [:V_N3,"NumPad_3"], # VK_NUMPAD3 3
- 100 => [:V_N4,"NumPad_4"], # VK_NUMPAD4 4
- 101 => [:V_N5,"NumPad_5"], # VK_NUMPAD5 5
- 102 => [:V_N6,"NumPad_6"], # VK_NUMPAD6 6
- 103 => [:V_N7,"NumPad_7"], # VK_NUMPAD7 7
- 104 => [:V_N8,"NumPad_8"], # VK_NUMPAD8 8
- 105 => [:V_N9,"NumPad_9"], # VK_NUMPAD9 9
- 106 => [:V_MULTI,"NumPad_*"],# VK_MULTIPLY *
- 107 => [:V_ADD,"NumPad_+"], # VK_ADD +
- 109 => [:V_SUB,"NumPad_-"], # VK_SUBTRACT -
- 110 => [:V_DEC,"NumPad_."], # VK_DECIMAL .
- 111 => [:V_DIV,"NumPad_/"], # VK_DIVIDE /
- 112 => [:V_F1,"F1"],# VK_F1 F1
- 113 => [:V_F2,"F2"],# VK_F2 F2
- 114 => [:V_F3,"F3"],# VK_F3 F3
- 115 => [:V_F4,"F4"],# VK_F4 F4
- 116 => [:V_F5,"F5"],# VK_F5 F5
- 117 => [:V_F6,"F6"],# VK_F6 F6
- 118 => [:V_F7,"F7"],# VK_F7 F7
- 119 => [:V_F8,"F8"],# VK_F8 F8
- 120 => [:V_F9,"F9"],# VK_F9 F9
- 121 => [:V_F10,"F10"],# VK_F10 F10
- 122 => [:V_F11,"F11"],# VK_F11 F11
- 123 => [:V_F12,"F12"],# VK_F12 F12
- 144 => [:V_NL,"NumLock"],# VK_NUMLOCK NumLock
- 145 => [:V_SCL,"ScrollLock"],# VK_SCROLL ScrollLock
- 186 => [:V_CR, ":"],# :
- 187 => [:V_SCR,";"],# ;
- 188 => [:V_CNM,","],# ,
- 189 => [:V_HI, "-"],# -
- 190 => [:V_PI,"."],# .
- 191 => [:V_SL,"/"],# /
- 192 => [:V_AT,"@"],# @
- 219 => [:V_KS,"["],# [
- 220 => [:V_EN,"\"],# \
- 221 => [:V_KE,"]"],# ]
- 222 => [:V_BEKI,"#"],#^
- 226 => [:V_EN2,"\"],# \
- 229 => [:V_HZ,"半角/全角"],# 半角/全角
- 229 => [:V_MK,"前候補"],# 前候補
- 242 => [:V_KH,"カタカナひらがな"],# カタカナひらがな
- #~ 240 => [:V_CL,"CapsLock"],# CapsLock
- }
-
- def self.press?(joyinfo)
- r = []
- JoyButton.each{|key,value|
- r.push(key) if (value & joyinfo) != 0
- }
- r
- end
- end
- #==============================================================================
- #■ Audio
- #------------------------------------------------------------------------------
- # 音楽再生用のモジュール。エイリアスを行い、ボリュームコントロールを追加します。
- #==============================================================================
- module Audio
- # 特異メソッドのエイリアス
- instance_eval{alias bgm_play_config bgm_play}
- instance_eval{alias bgs_play_config bgs_play}
- instance_eval{alias se_play_config se_play}
- instance_eval{alias me_play_config me_play}
-
- # bgmの再生
- def self.bgm_play(filename, volume=100, pitch=100, pos=0)
- tune_volume = $game_system.nil? ? 1.0 : $game_system.bgm_volume
- bgm_play_config(filename, volume * tune_volume, pitch, pos)
- end
-
- # bgsの再生
- def self.bgs_play(filename, volume=100, pitch=100, pos=0)
- tune_volume = $game_system.nil? ? 1.0 : $game_system.se_volume
- bgs_play_config(filename, volume * tune_volume, pitch, pos)
- end
-
- # seの再生
- def self.se_play(filename, volume=100, pitch=100)
- tune_volume = $game_system.nil? ? 1.0 : $game_system.se_volume
- se_play_config(filename, volume * tune_volume, pitch)
- end
-
- # meの再生
- def self.me_play(filename, volume=100, pitch=100)
- tune_volume = $game_system.nil? ? 1.0 : $game_system.bgm_volume
- me_play_config(filename, volume * tune_volume, pitch)
- end
- end
- class << Cache
- alias config_system system
- def system(filename)
- if filename == "Window" && $game_system && $game_system.windowskin > 0
- filename += $game_system.windowskin.to_s
- end
- config_system(filename)
- end
- end
- #==============================================================================
- # ■ Vocab
- #------------------------------------------------------------------------------
- # 用語とメッセージを定義するモジュールです。定数でメッセージなどを直接定義す
- # るほか、グローバル変数 $data_system から用語データを取得します。
- # コンフィグを追加します。
- #==============================================================================
- module Vocab
- def self.config;Config_Setting::ConfigName; end
- end
- class << DataManager
- #--------------------------------------------------------------------------
- # ● ロードの実行(例外処理なし)
- #--------------------------------------------------------------------------
- alias config_load_game_without_rescue load_game_without_rescue
- def load_game_without_rescue(index)
- f = config_load_game_without_rescue(index)
- return f unless f
- $game_system.resize_screen($game_system.screen_size)
- f
- end
- #--------------------------------------------------------------------------
- # ● セーブヘッダの作成
- #--------------------------------------------------------------------------
- alias config_make_save_header make_save_header
- def make_save_header
- header = config_make_save_header
- header[:windowskin] = $game_system.windowskin
- header[:window_tone] = $game_system.window_tone.dup
- header
- end
-
- alias config_create_game_objects create_game_objects
- def create_game_objects
- config_create_game_objects
- if config_file_exists?
- load_config_data
- $game_system.resize_screen($game_system.screen_size)
- if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] } ||
- Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
- $game_system.set_variables_and_switches
- end
- else
- $game_system.setting_reset
- end
- end
-
- def save_config_parameters_without_rescue
- File.open("Config.rvdata2", "wb") do |file|
- Marshal.dump(make_save_config_contents, file)
- end
- return true
- end
-
- def save_config_parameters
- begin
- save_config_parameters_without_rescue
- rescue
- delete_config_file
- false
- end
- end
-
- def delete_config_file
- File.delete("Config.rvdata2") rescue nil
- end
-
- def make_save_config_contents
- contents = {}
- contents[:bgm_volume] = $game_system.bgm_volume if Config_Setting::Alignment.include?(:bgm)
- contents[:se_volume] = $game_system.se_volume if Config_Setting::Alignment.include?(:se)
- contents[:dash_type] = $game_system.dash_type if Config_Setting::Alignment.include?(:dash_type)
- contents[:battle_message] = $game_system.battle_message if Config_Setting::Alignment.include?(:battle_message)
- contents[:screen_size] = $game_system.screen_size if Config_Setting::Alignment.include?(:screen_size)
- contents[:default_window_tone] = $game_system.default_window_tone if Config_Setting::Alignment.include?(:window_tone)
- contents[:window_tone] = $game_system.window_tone if Config_Setting::Alignment.include?(:window_tone)
- contents[:windowskin] = $game_system.windowskin if Config_Setting::Alignment.include?(:windowskin)
- contents[:animation_switch] = $game_system.animation_switch if Config_Setting::Alignment.include?(:animation_switch)
- contents[:animation_speed] = $game_system.animation_speed if Config_Setting::Alignment.include?(:animation_speed)
- contents[:shortcut] = $game_system.shortcut if Config_Setting::Alignment.include?(:shortcut)
- contents[:gc_sec] = $game_system.gc_sec if Config_Setting::Alignment.include?(:gc_sec)
- contents[:key_setting] = $game_system.key_setting if Config_Setting::Alignment.include?(:key_setting)
- contents[:log_colors] = $game_system.log_colors if Config_Setting::Alignment.include?(:log_colors)
- contents[:variables] = $game_system.variables if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] }
- contents[:switches] = $game_system.switches if Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
- contents
- end
-
- def load_config_data
- contents = load_data("Config.rvdata2")
- $game_system.bgm_volume = contents[:bgm_volume] if Config_Setting::Alignment.include?(:bgm)
- $game_system.se_volume = contents[:se_volume] if Config_Setting::Alignment.include?(:se)
- $game_system.dash_type = contents[:dash_type] if Config_Setting::Alignment.include?(:dash_type)
- $game_system.battle_message = contents[:battle_message] if Config_Setting::Alignment.include?(:battle_message)
- $game_system.screen_size = contents[:screen_size] if Config_Setting::Alignment.include?(:screen_size)
- $game_system.default_window_tone = contents[:default_window_tone] if Config_Setting::Alignment.include?(:window_tone)
- $game_system.window_tone = contents[:window_tone] if Config_Setting::Alignment.include?(:window_tone)
- $game_system.windowskin = contents[:windowskin] if Config_Setting::Alignment.include?(:windowskin)
- $game_system.animation_switch = contents[:animation_switch] if Config_Setting::Alignment.include?(:animation_switch)
- $game_system.animation_speed = contents[:animation_speed] if Config_Setting::Alignment.include?(:animation_speed)
- $game_system.shortcut = contents[:shortcut] if Config_Setting::Alignment.include?(:shortcut)
- $game_system.gc_sec = contents[:gc_sec] if Config_Setting::Alignment.include?(:gc_sec)
- $game_system.key_setting = contents[:key_setting] if Config_Setting::Alignment.include?(:key_setting)
- $game_system.log_colors = contents[:log_colors] if Config_Setting::Alignment.include?(:log_colors)
- $game_system.variables = contents[:variables] if Config_Setting::Alignment.any?{|v| v.to_s[/variables\d+/] }
- $game_system.switches = contents[:switches] if Config_Setting::Alignment.any?{|v| v.to_s[/switches\d+/] }
- end
-
- def config_file_exists?
- !Dir.glob('Config.rvdata2').empty?
- end
- end
- class Game_Temp
- attr_accessor :use_key_setting
- attr_accessor :use_pov
- end
- #==============================================================================
- # ■ Game_System
- #------------------------------------------------------------------------------
- # システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
- # します。このクラスのインスタンスは $game_system で参照されます。
- # BGM・ME、BGS・SEのボリューム、ダッシュタイプを設定するための変数を追加します。
- #==============================================================================
- class Game_System
- attr_accessor :bgm_volume
- attr_accessor :se_volume
- attr_accessor :dash_type
- attr_accessor :battle_message
- attr_accessor :screen_size
- attr_accessor :default_window_tone
- attr_accessor :windowskin
- attr_accessor :animation_switch
- attr_accessor :animation_speed
- attr_accessor :shortcut
- attr_accessor :gc_sec
- attr_accessor :key_setting
- attr_accessor :log_colors
- attr_accessor :variables
- attr_accessor :switches
-
- def setting_reset
- @bgm_volume = default(:bgm) if Config_Setting::Alignment.include?(:bgm)
- @se_volume = default(:se) if Config_Setting::Alignment.include?(:se)
- @dash_type = default(:dash_type) if Config_Setting::Alignment.include?(:dash_type)
- @battle_message = default(:battle_message) if Config_Setting::Alignment.include?(:battle_message)
- @windowskin = default(:windowskin) if Config_Setting::Alignment.include?(:windowskin)
- @window_tone = default_window_tone if Config_Setting::Alignment.include?(:window_tone)
- @animation_switch = default(:animation_switch) if Config_Setting::Alignment.include?(:animation_switch)
- @animation_speed = default(:animation_speed) if Config_Setting::Alignment.include?(:animation_speed)
- @shortcut = default(:shortcut) if Config_Setting::Alignment.include?(:shortcut)
- @log_colors = default(:log_color) if Config_Setting::Alignment.include?(:log_color)
- @gc_sec = default(:gc_sec) if Config_Setting::Alignment.include?(:gc_sec)
- @key_setting = default(:key_setting) if Config_Setting::Alignment.include?(:key_setting)
-
- if Config_Setting::Alignment.include?(:screen_size)
- @screen_size = default(:screen_size)
- resize_screen(@screen_size)
- end
-
- @variables = {}
- @switches = {}
- Config_Setting::Alignment.select{|a|
- if a.to_s[/^variables(\d+)/]
- @variables[extend_setting(a)[0]] = default(a)
- elsif a.to_s[/^switches(\d+)/]
- @switches[extend_setting(a)[0]] = default(a)
- end
- }
- set_variables_and_switches
- end
-
- def set_variables_and_switches
- @variables.each{|key,value| $game_variables[key] = value }
- @switches.each{|key,value| $game_switches[key] = value }
- end
-
- def default(content)
- Marshal.load(Marshal.dump(Config_Setting::Contents[content][1]))
- end
-
- def extend_setting(content)
- Config_Setting::Contents[content][3]
- end
-
- def description(content)
- Config_Setting::Contents[content][2]
- end
-
- # BGM・MEのボリューム nil対策を導入します。
- def bgm_volume
- @bgm_volume = default(:bgm) unless @bgm_volume
- return @bgm_volume
- end
-
- # SE・BGSのボリューム nil対策を導入します。
- def se_volume
- @se_volume = default(:se) unless @se_volume
- return @se_volume
- end
-
- # ダッシュタイプ nil対策を導入します。
- def dash_type
- @dash_type = default(:dash_type) unless @dash_type
- return @dash_type
- end
-
- # アニメーション表示 nil対策を導入します。
- def animation_switch
- @animation_switch = default(:animation_switch) unless @animation_switch
- return @animation_switch
- end
-
- # アニメーション速度 nil対策を導入します。
- def animation_speed
- @animation_speed = default(:animation_speed) unless @animation_speed
- return @animation_speed
- end
- # 戦闘メッセージ速度
- def battle_message
- @battle_message = default(:battle_message) unless @battle_message
- return @battle_message
- end
- # 画面のズーム率
- def screen_size
- @screen_size = default(:screen_size) unless @screen_size
- return @screen_size
- end
- # ウィンドウスキン
- def windowskin
- @windowskin = default(:windowskin) unless @windowskin
- return @windowskin
- end
-
- def windowskin_size
- extend_setting(:windowskin)
- end
- # ショートカット
- def shortcut
- @shortcut = default(:shortcut) unless @shortcut
- @shortcut = default(:shortcut) if @shortcut.empty?
- return @shortcut
- end
-
- def shortcut_size
- default(:shortcut).size
- end
- # GC
- def gc_sec
- @gc_sec = default(:gc_sec) unless @gc_sec
- return @gc_sec
- end
- def gc_sec_min
- Config_Setting::Contents[:gc_sec][3]
- end
- def gc_sec_max
- Config_Setting::Contents[:gc_sec][4]
- end
- # ログカラー
- def log_colors
- unless @log_colors
- @log_colors = Config_Setting::LogColor.inject([]){|r,c| r += [c[0]]}
- @log_colors.each_with_index{|c,i|
- Config_Setting::GlobalLogColor.each{|gc|
- @log_colors[i] = gc[0] if gc[1] && gc[1].include?(i)}
- }
- end
- return @log_colors
- end
- # 画面のリサイズ
- def resize_screen(n)
- Graphics.resize_window(n)
- @screen_size = n
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウカラーの設定
- #--------------------------------------------------------------------------
- alias extend_window_tone window_tone=
- def window_tone=(window_tone)
- @default_window_tone = @window_tone unless @default_window_tone
- extend_window_tone(window_tone)
- end
-
- def set_default_window_tone
- extend_window_tone(@default_window_tone)
- end
-
- def default_window_tone
- return @default_window_tone if @default_window_tone
- return @window_tone
- end
-
- def variables
- return @variables if @variables
- @variables = {} unless @variables
- Config_Setting::Alignment.select{|a|
- @variables[extend_setting(a)[0]] = default(a) if a.to_s[/^variables(\d+)/]
- }
- return @variables
- end
-
- def switches
- return @switches if @switches
- @switches = {} unless @switches
- Config_Setting::Alignment.select{|a|
- @switches[extend_setting(a)[0]] = default(a) if a.to_s[/^switches(\d+)/]
- }
- return @switches
- end
-
- def log_color(type,actor=false,sup=false)
- case type
- when :current_state ;return actor ? log_colors[0] : log_colors[1]
- when :use_item ;return actor ? log_colors[2] : log_colors[3]
- when :chase ;return actor ? log_colors[4] : log_colors[5]
- when :retaliation ;return actor ? log_colors[6] : log_colors[7]
- when :interrupt ;return actor ? log_colors[8] : log_colors[9]
- when :substitute ;return actor ? log_colors[10] : log_colors[11]
- when :counter ;return actor ? log_colors[12] : log_colors[13]
- when :reflection ;return actor ? log_colors[14] : log_colors[15]
- when :failure ;return actor ? log_colors[16] : log_colors[17]
- when :critical ;return actor ? log_colors[18] : log_colors[19]
- when :miss ;return actor ? log_colors[20] : log_colors[21]
- when :evasion ;return actor ? log_colors[22] : log_colors[23]
- when :added_states ;return actor ? log_colors[24] : log_colors[25]
- when :removed_states;return actor ? log_colors[26] : log_colors[27]
- when :parry ;return actor ? log_colors[28] : log_colors[29]
- when :guard ;return actor ? log_colors[30] : log_colors[31]
- when :barrier ;return actor ? log_colors[32] : log_colors[33]
- when :barrier_broken;return actor ? log_colors[34] : log_colors[35]
- when :genei_evasion ;return actor ? log_colors[36] : log_colors[37]
- when :hp_damage
- if sup
- return actor ? log_colors[38] : log_colors[39]
- else
- return actor ? log_colors[40] : log_colors[41]
- end
- when :mp_damage
- if sup
- return actor ? log_colors[42] : log_colors[43]
- else
- return actor ? log_colors[44] : log_colors[45]
- end
- when :tp_damage
- if sup
- return actor ? log_colors[46] : log_colors[47]
- else
- return actor ? log_colors[48] : log_colors[49]
- end
- when :buffs
- if sup == :add_buff
- return actor ? log_colors[50] : log_colors[51]
- elsif sup == :remove_buff
- return actor ? log_colors[52] : log_colors[53]
- else
- return actor ? log_colors[54] : log_colors[55]
- end
- when :others
- return log_colors[56]
- end
- end
-
- def key_setting
- @key_setting = default(:key_setting) unless @key_setting
- @key_setting
- end
-
- def use_key_setting?
- f = Config_Setting::Alignment.include?(:key_setting)
- return $game_temp.use_key_setting && f if $game_temp.use_key_setting != nil
- r = "\0" * 5
- n = Win32API.new('kernel32', 'GetPrivateProfileString', "pppplp", 'i')
- n.call('KeyConfig','UseKeySetting','true', r ,32,'./Game.ini')
- r = "true" if r != "false"
- $game_temp.use_key_setting = eval(r)
- return $game_temp.use_key_setting && f
- end
-
- def key_setting_ext
- Config_Setting::Contents[:key_setting][4]
- end
-
- def use_pov?
- f = Config_Setting::Use_POV
- return $game_temp.use_pov && f if $game_temp.use_pov != nil
- r = "\0" * 5
- n = Win32API.new('kernel32', 'GetPrivateProfileString', "pppplp", 'i')
- n.call('KeyConfig','UsePOV','true', r ,32,'./Game.ini')
- r = "true" if r != "false"
- $game_temp.use_pov = eval(r)
- return $game_temp.use_pov && f
- end
- end
- #==============================================================================
- # ■ Sprite_Base
- #------------------------------------------------------------------------------
- # アニメーションの表示処理を追加したスプライトのクラスです。
- #==============================================================================
- class Sprite_Base < Sprite
- #--------------------------------------------------------------------------
- # ● アニメーションの速度を設定 ※再定義
- #--------------------------------------------------------------------------
- alias yy_config_set_animation_rate set_animation_rate
- def set_animation_rate
- if SceneManager.scene_is?(Scene_Battle) && !$game_switches[Config_Setting::AnimationInvalidSwitch]
- @ani_rate = $game_system.animation_speed
- else
- yy_config_set_animation_rate
- end
- end
- end
- #==============================================================================
- # ■ Window_BattleLog
- #==============================================================================
- class Window_BattleLog < Window_Selectable
-
- #--------------------------------------------------------------------------
- # ● メッセージ速度の取得 エイリアス
- #--------------------------------------------------------------------------
- alias yy_config_message_speed message_speed
- def message_speed
- return yy_config_message_speed if $game_switches[Config_Setting::AnimationInvalidSwitch]
- speed = (20 * $game_system.battle_message).to_i
- if $imported_yana_scripts["AutoBattle"]
- speed2 = yy_config_message_speed
- return [speed,speed2].min if BattleManager.auto_battle
- end
- return speed
- end
- end
- #==============================================================================
- # ■ Game_Player
- #------------------------------------------------------------------------------
- # プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
- # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
- # ダッシュタイプの設定を追加します。
- #==============================================================================
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # ● ダッシュ状態判定 ※再定義
- # ダッシュタイプによる設定を追加します。
- #--------------------------------------------------------------------------
- def dash?
- return false if @move_route_forcing
- return false if $game_map.disable_dash?
- return false if vehicle
- return Input.press?(:A) if $game_system.dash_type == :normal
- return !Input.press?(:A) if $game_system.dash_type == :always
- end
- end
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # ● シーン遷移に関連する更新
- #--------------------------------------------------------------------------
- alias config_update_scene update_scene
- def update_scene
- config_update_scene
- update_shortcut if !scene_changing? && !$game_map.interpreter.running?
- end
-
- def update_shortcut
- return if $game_switches[Config_Setting::DisableShortcutSID]
- list = Config_Setting.shortcut_list
- $game_system.shortcut.each{|s|
- if Input.trigger?(s[0])
- Input.update
- return Sound.play_buzzer if $game_system.menu_disabled
- case list[s[1]][1]
- when Scene_Save;return Sound.play_buzzer if $game_system.save_disabled
- end
- if $imported_yana_scripts["SortMenuCommand"]
- SortMenuCommand::List.each_with_index{|l,i|
- next if $game_switches[SortMenuCommand::EnableSwitch + i]
- return Sound.play_buzzer if list[s[1]][2] == l
- }
- end
- if list[s[1]][1].is_a?(Integer)
- $game_temp.reserve_common_event(list[s[1]][1])
- else
- SceneManager.call(list[s[1]][1])
- SceneManager.scene.prepare_basic if $imported_yana_scripts["AugmentCompose"] && list[s[1]][1] == Scene_AugmentCompose
- end
- end
- }
- end
- end
- #==============================================================================
- # ■ Window_Config
- #------------------------------------------------------------------------------
- # コンフィグの処理を行うウィンドウです。
- #==============================================================================
- class Window_Config < Window_Selectable
- attr_accessor :log_color_window
- attr_accessor :key_setting_window
- attr_reader :list
-
- # 初期化処理
- def initialize
- init_list
- height = line_height*[item_max,13].min+standard_padding*2
- super(64,(Graphics.height-height)/2,416,height)
- @sub_index = -1
- @ws_index = (($game_system.screen_size - 1.0) * 5).round(0)
- refresh
- end
-
- # 項目数
- def item_max
- list.size
- end
-
- def enable?(index)
- if list[index] == :animation_speed && $game_system.animation_switch == :off
- return false
- end
- return true
- end
-
- # 項目の横幅
- def item_width
- 128
- end
-
- def init_list
- @list = Config_Setting::Alignment.dup
- @list.delete(:key_setting) unless $game_system.use_key_setting?
- end
-
- # ボリュームコントロール用の処理
- def update_volume_control
- cnt = nil
- cnt = 1 if Input.repeat?(:RIGHT)
- cnt = -1 if Input.repeat?(:LEFT)
- control_volume(cnt) if cnt
- end
-
- # ダッシュ設定用の処理
- def update_dash_cursor
- if Input.trigger?(:RIGHT)
- Sound.play_cursor unless $game_system.dash_type == :always
- $game_system.dash_type = :always
- refresh
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor unless $game_system.dash_type == :normal
- $game_system.dash_type = :normal
- refresh
- end
- end
-
- # アニメ表示用の処理
- def update_anime_cursor
- if Input.trigger?(:RIGHT)
- Sound.play_cursor unless $game_system.animation_switch == :off
- $game_system.animation_switch = :off
- refresh
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor unless $game_system.animation_switch == :on
- $game_system.animation_switch = :on
- refresh
- end
- end
-
- # 戦闘メッセージ速度用の処理
- def update_battle_message
- if Input.repeat?(:RIGHT)
- Sound.play_cursor unless $game_system.battle_message <= 0
- $game_system.battle_message = [$game_system.battle_message-0.05,$game_system.extend_setting(:battle_message)].max
- refresh
- elsif Input.repeat?(:LEFT)
- Sound.play_cursor unless $game_system.battle_message >= 2.0
- $game_system.battle_message = [$game_system.battle_message+0.05,2.0].min
- refresh
- end
- end
-
- # アニメーション速度用の処理
- def update_animation_speed
- if Input.repeat?(:RIGHT)
- Sound.play_cursor unless $game_system.animation_speed <= 1
- $game_system.animation_speed = [$game_system.animation_speed-1,$game_system.extend_setting(:animation_speed)].max
- refresh
- elsif Input.repeat?(:LEFT)
- Sound.play_cursor unless $game_system.animation_speed >= 8
- $game_system.animation_speed = [$game_system.animation_speed+1,8].min
- refresh
- end
- end
-
- # ウィンドウスキンのアップデート
- def update_windowskin
- if Input.trigger?(:RIGHT)
- Sound.play_cursor unless ($game_system.windowskin + 1) == $game_system.windowskin_size
- $game_system.windowskin = ($game_system.windowskin + 1) % $game_system.windowskin_size
- refresh_skin
- refresh
- @help_window.refresh
- SceneManager.scene.reload_skin
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor unless $game_system.windowskin == 0
- $game_system.windowskin = ($game_system.windowskin + ($game_system.windowskin_size - 1)) % $game_system.windowskin_size
- Sound.play_cursor
- refresh_skin
- refresh
- @help_window.refresh
- SceneManager.scene.reload_skin
- end
- end
-
- # GC頻度のアップデート
- def update_gc_sec
- pgc = $game_system.gc_sec
- if Input.repeat?(:RIGHT)
- $game_system.gc_sec = [($game_system.gc_sec + 1),$game_system.gc_sec_max].min
- refresh
- @help_window.refresh
- elsif Input.repeat?(:LEFT)
- $game_system.gc_sec = [($game_system.gc_sec - 1),$game_system.gc_sec_min].max
- refresh
- @help_window.refresh
- end
- Sound.play_cursor unless pgc == $game_system.gc_sec
- end
-
- def update_log_color
- if self.active && Input.trigger?(:C)
- Sound.play_ok
- @log_color_window.refresh
- @log_color_window.activate.open.select(0)
- self.deactivate
- end
- end
-
- def update_key_setting
- if self.active && Input.trigger?(:C)
- Sound.play_ok
- @key_setting_window.refresh
- @key_setting_window.activate.open.select(@key_setting_window.item_max-2)
- self.deactivate.close
- end
- end
-
- # アップデート
- def update
- super
- unless enable?(index)
- Sound.play_buzzer if Input.trigger?(:C) or Input.trigger?(:RIGHT) or Input.trigger?(:LEFT)
- return
- end
- case list[@index]
- when :bgm,:se;update_volume_control
- when :battle_message;update_battle_message
- when :animation_speed;update_animation_speed
- when :window_tone
- switch_sub_content if Input.trigger?(:C)
- update_window_tone unless active
- when :windowskin;update_windowskin
- when :dash_type;update_dash_cursor
- when :animation_switch;update_anime_cursor
- when :reset;clear_setting if Input.trigger?(:C)
- when :screen_size;update_screen_size
- when :shortcut
- switch_sub_content if Input.trigger?(:C)
- update_shortcut unless active
- when :gc_sec;update_gc_sec
- when :log_color;update_log_color
- when :key_setting;update_key_setting
- else
- a = list[@index]
- if a.to_s[/^variables(\d+)/]
- update_variables($1.to_i)
- elsif a.to_s[/^switches(\d+)/]
- update_switches($1.to_i)
- end
- end
- end
-
- def switch_sub_content
- deactivate
- Sound.play_ok
- @sub_index = 0
- refresh
- end
-
- def update_screen_size
- limit = $game_system.extend_setting(:screen_size)
- limit = [1.0,2.0] unless limit
- n = (limit[1] - limit[0]) / 5.0
- if Input.repeat?(:RIGHT)
- Sound.play_cursor unless @ws_index == 5
- @ws_index = [@ws_index + 1,5].min
- $game_system.resize_screen([$game_system.screen_size+n,limit[1]].min)
- refresh
- elsif Input.repeat?(:LEFT)
- Sound.play_cursor unless @ws_index == 0
- @ws_index = [@ws_index - 1,0].max
- $game_system.resize_screen([$game_system.screen_size-n,limit[0]].max)
- refresh
- end
- end
-
- def update_window_tone
- if Input.trigger?(:B)
- activate
- Sound.play_cancel
- refresh
- elsif Input.trigger?(:RIGHT)
- Sound.play_cursor
- @sub_index = (@sub_index + 1) % 3
- refresh
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor
- @sub_index = (@sub_index + 2) % 3
- refresh
- elsif Input.press?(:UP)
- Sound.play_cursor if change_tone(1)
- refresh
- elsif Input.press?(:DOWN)
- Sound.play_cursor if change_tone(-1)
- refresh
- end
- end
-
- def change_tone(value)
- tone = $game_system.window_tone.dup
- case @sub_index
- when 0;tone.red+=value
- when 1;tone.green+=value
- when 2;tone.blue+=value
- end
- return false if $game_system.window_tone == tone
- $game_system.window_tone = tone.dup
- return true
- end
-
- def change_shortcut(value)
- n = $game_system.shortcut[@sub_index][1]
- $game_system.shortcut[@sub_index][1] = (n + value) % shortcut_content_size
- return true
- end
-
- def update_shortcut
- if Input.trigger?(:B)
- @sub_index = -1
- activate
- Sound.play_cancel
- refresh
- elsif Input.trigger?(:RIGHT)
- Sound.play_cursor
- @sub_index = (@sub_index + 1) % shortcut_size
- refresh
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor
- @sub_index = (@sub_index + (shortcut_size - 1)) % shortcut_size
- refresh
- elsif Input.trigger?(:UP)
- Sound.play_cursor if change_shortcut(1)
- refresh
- elsif Input.trigger?(:DOWN)
- Sound.play_cursor if change_shortcut(shortcut_content_size-1)
- refresh
- end
- end
-
- def shortcut_size
- $game_system.shortcut_size
- end
-
- def shortcut_content_size
- Config_Setting.shortcut_list.size
- end
-
- # 設定の初期化処理
- def clear_setting
- $game_system.setting_reset
- bgm_restart
- bgs_restart
- Sound.play_ok
- refresh_skin
- refresh
- end
-
- def refresh_skin
- self.windowskin = Cache.system("Window")
- @help_window.windowskin = Cache.system("Window")
- end
-
- # ボリュームを設定する処理
- def control_volume(cnt)
- return unless cnt
- volume = cnt * 0.05
- case list[@index]
- when :bgm
- vol = $game_system.bgm_volume + volume
- $game_system.bgm_volume = [[vol,0].max,1.0].min.round(2)
- bgm_restart
- Sound.play_cursor if vol >= 0 && vol <= 1.0
- refresh
- when :se
- vol = $game_system.se_volume + volume
- $game_system.se_volume = [[vol,0].max,1.0].min.round(2)
- bgs_restart
- Sound.play_cursor if vol >= 0 && vol <= 1.0
- refresh
- end
- end
-
- # BGMをリスタート
- def bgm_restart
- bgm = RPG::BGM.last
- Audio.bgm_play('Audio/BGM/'+ bgm.name,bgm.volume,bgm.pitch,bgm.pos) unless bgm.name.empty?
- end
-
- # BGSをリスタート
- def bgs_restart
- bgs = RPG::BGS.last
- Audio.bgs_play('Audio/BGS/'+ bgs.name,bgs.volume,bgs.pitch,bgs.pos) unless bgs.name.empty?
- end
-
- def update_variables(id)
- s = ("variables#{id}").to_sym
- es = $game_system.extend_setting(s)
- n = $game_variables[es[0]]
- min = es[1]
- max = es[2]
- flag = es[1].is_a?(Array)
- i = n
- if flag
- min,max = 0,es[1].size - 1
- text = es[1].find{|ss| ss[1] == n }[0]
- i = es[1].index([text,n])
- end
- if Input.repeat?(:RIGHT)
- i = [(i + 1),max].min
- $game_system.variables[es[0]] = flag ? es[1][i][1] : i
- $game_variables[es[0]] = $game_system.variables[es[0]]
- refresh
- elsif Input.repeat?(:LEFT)
- i = [(i - 1),min].max
- $game_system.variables[es[0]] = flag ? es[1][i][1] : i
- $game_variables[es[0]] = $game_system.variables[es[0]]
- refresh
- end
- i = es[1][i][1] if flag
- Sound.play_cursor unless n == i
- end
-
- def update_switches(id)
- s = ("switches#{id}").to_sym
- es = $game_system.extend_setting(s)
- if Input.trigger?(:RIGHT)
- Sound.play_cursor if $game_switches[es[0]]
- $game_system.switches[es[0]] = false
- $game_switches[es[0]] = $game_system.switches[es[0]]
- refresh
- elsif Input.trigger?(:LEFT)
- Sound.play_cursor unless $game_switches[es[0]]
- $game_system.switches[es[0]] = true
- $game_switches[es[0]] = $game_system.switches[es[0]]
- refresh
- end
- end
-
- # 項目の描画
- def draw_item(index)
- change_color(normal_color, enable?(index))
- draw_text(0,line_height*index,128,line_height,config_name(index),1)
- draw_contents_list(index)
- end
-
- def config_name(index)
- Config_Setting::Contents[list[index]][0]
- end
-
- # 項目の内容の描画
- def draw_contents_list(index)
- case list[index]
- when :bgm;draw_bgm_bar(index)
- when :se;draw_se_bar(index)
- when :windowskin;draw_windowskin(index)
- when :window_tone;draw_window_color(index)
- when :battle_message;draw_battle_speed(index)
- when :dash_type;draw_dash_setting(index)
- when :animation_switch;draw_anime_switch(index)
- when :animation_speed;draw_anime_speed(index)
- when :screen_size;draw_screen_setting(index)
- when :shortcut;draw_shortcut(index)
- when :gc_sec;draw_gc_sec(index)
- when :log_color;draw_log_color(index)
- when :skill_setting;draw_skill_setting(index)
- else
- a = list[index]
- if a.to_s[/^variables(\d+)/]
- draw_variables($1.to_i,index)
- elsif a.to_s[/^switches(\d+)/]
- draw_switches($1.to_i,index)
- end
- end
- end
-
- # BGMボリューム用の項目描画
- def draw_bgm_bar(index)
- draw_volume_score($game_system.bgm_volume,index)
- end
-
- # SEボリューム用の項目描画
- def draw_se_bar(index)
- draw_volume_score($game_system.se_volume,index)
- end
-
- # ボリューム用の項目描画
- def draw_volume_score(vol,index)
- volume = (vol * 10 * 2).to_i
- 20.times{|i|
- color = volume > i ? Config_Setting::Volume_Gauge[:color1] : Config_Setting::Volume_Gauge[:color2]
- contents.fill_rect(144 + i * 12, line_height * index + 2, 10, line_height-4,color)
- }
- end
-
- # ダッシュ設定の項目描画
- def draw_dash_setting(index)
- ofset = $game_system.dash_type == :normal ? 0 : 124
- color1 = Config_Setting::Dash_Cursor[:color1]
- color2 = Config_Setting::Dash_Cursor[:color2]
- contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
- draw_text(144,index*line_height,124,line_height,"通常",1)
- draw_text(144+124,index*line_height,124,line_height,"常時ダッシュ",1)
- end
-
- # アニメーション表示の項目描画
- def draw_anime_switch(index)
- ofset = $game_system.animation_switch == :on ? 0 : 124
- color1 = Config_Setting::Anime_Cursor[:color1]
- color2 = Config_Setting::Anime_Cursor[:color2]
- contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
- draw_text(144,index*line_height,124,line_height,"ON",1)
- draw_text(144+124,index*line_height,124,line_height,"OFF",1)
- end
- # ウィンドウスキンの項目描画
- def draw_windowskin(index)
- color1 = Config_Setting::Skin_Cursor[:color1]
- color2 = Config_Setting::Skin_Cursor[:color2]
- i = $game_system.windowskin
- size = $game_system.windowskin_size
- contents.gradient_fill_rect(144+(268/size)*i,index*line_height+2,24,line_height-4,color1,color2)
- size.times{|i|
- draw_text(144+(268/size)*i,index*line_height,24,line_height,(i+1).to_i,1)
- }
- end
- # ガーベージコレクションの項目描画
- def draw_gc_sec(index)
- draw_left_arrow(180,index*line_height) unless $game_system.gc_sec == $game_system.gc_sec_min
- draw_text(144,index*line_height,268,line_height,$game_system.gc_sec,1)
- draw_right_arrow(180+184,index*line_height) unless $game_system.gc_sec == $game_system.gc_sec_max
- end
- # ウィンドウトーンの項目描画
- def draw_window_color(index)
- text = ["R:","G:","B:"]
- wt = $game_system.window_tone
- color = [Color.new(255,0,0),Color.new(0,255,0),Color.new(0,0,255)]
- cs = [wt.red,wt.green,wt.blue]
- color1 = Config_Setting::Dash_Cursor[:color1]
- 3.times{|i|
- if list[@index] == :window_tone
- unless active
- if @sub_index == i
- contents.gradient_fill_rect(140+i*82,index*line_height,72,line_height,color1,color[i])
- end
- end
- end
- draw_text(144+i*82,index*line_height,64,line_height,text[i])
- draw_text(144+i*82,index*line_height,64,line_height,(cs[i].to_i).to_s,2)
- }
- end
-
- # 戦闘メッセージ速度の項目描画
- def draw_battle_speed(index)
- text = ["遅い","標準","早い"]
- gs1 = 244
- gs2 = (gs1 / (1.0 - $game_system.extend_setting(:battle_message)/2)).to_i
- bm = 1.0 - ($game_system.battle_message / 2)
- contents.fill_rect(144,index*line_height+17,gs1,6,Color.new(64,64,64))
- contents.fill_rect(144,index*line_height+17,(gs2*bm).to_i,6,Color.new(64,128,255))
- text.each_with_index{|t,i|
- draw_text(144+i*82,index*line_height,82,line_height,t,1)
- }
- end
-
- # アニメーション速度の項目描画
- def draw_anime_speed(index)
- text = ["遅い","標準","早い"]
- gs1 = 244
- gs2 = (gs1 / (1.0 - $game_system.extend_setting(:animation_speed)/8.0)).to_i
- bm = 1.0 - ($game_system.animation_speed / 8.0)
- contents.fill_rect(144,index*line_height+17,gs1,6,Color.new(64,64,64))
- contents.fill_rect(144,index*line_height+17,(gs2*bm).to_i,6,Color.new(128,64,255))
- text.each_with_index{|t,i|
- draw_text(144+i*82,index*line_height,82,line_height,t,1)
- }
- end
- # 画面倍率の項目描画
- def draw_screen_setting(index)
- limit = $game_system.extend_setting(:screen_size)
- limit = [1.0,2.0] unless limit
- n = (limit[1] - limit[0]) / 5.0
- text = []
- 6.times{|i| text.push("x#{limit[0] + n*i}") }
- color1 = Config_Setting::Dash_Cursor[:color1]
- color2 = Config_Setting::Dash_Cursor[:color2]
- text.each_with_index{|t,i|
- if @ws_index == i
- contents.gradient_fill_rect(144+@ws_index*40+2,index*line_height+2,40,line_height-4,color1,color2)
- end
- draw_text(144+i*40,index*line_height,40,line_height,t,1)
- }
- end
- # ショートカットの描画
- def draw_shortcut(index)
- color1 = Config_Setting::Shortcut_Cursor[:color1]
- color2 = Config_Setting::Shortcut_Cursor[:color2]
- size = shortcut_size
- width = (248/size)
- c = $game_system.shortcut
- i = @sub_index
- list = Config_Setting.shortcut_list
- if list[@index] == :shortcut && i >= 0
- contents.gradient_fill_rect(144+(248/size)*i,index*line_height+4,width,line_height-4,color1,color2)
- end
- c.each_with_index{|s,i|
- 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]]
- }
- end
- # ログカラーの描画
- def draw_log_color(index)
- width = 248 / Config_Setting::GlobalLogColor.size
- r = (248 - width * Config_Setting::GlobalLogColor.size) / 2
- Config_Setting::GlobalLogColor.each_with_index{|c,i|
- color = c[1] ? $game_system.log_colors[c[1][0]] : $game_system.log_colors[c[0]]
- if color >= 0
- contents.fill_rect(144+r+i*width,index*line_height+4,width-1,line_height-8,text_color(color))
- else
- contents.fill_rect(144+r+i*width,index*line_height+4,width-1,line_height-8,text_color(0))
- contents.clear_rect(144+r+i*width+1,index*line_height+5,width-3,line_height-10)
- end
- }
- end
- def draw_key_setting(index)
-
- end
- # 変数の描画
- def draw_variables(id,index)
- s = ("variables#{id}").to_sym
- es = $game_system.extend_setting(s)
- n = $game_system.variables[es[0]]
- text = n
- min = es[1].is_a?(Array) ? 0 : es[1]
- max = es[1].is_a?(Array) ? es[1].size - 1 : es[2]
- i = n
- if es[1].is_a?(Array)
- text = es[1].find{|ss| ss[1] == n }[0]
- i = es[1].index([text,n])
- end
- draw_left_arrow(180,index*line_height) unless i == min
- draw_text(144,index*line_height,268,line_height,text,1)
- draw_right_arrow(180+184,index*line_height) unless i == max
- end
- # スイッチの描画
- def draw_switches(id,index)
- s = ("switches#{id}").to_sym
- es = $game_system.extend_setting(s)
- n = $game_system.switches[es[0]]
- ofset = n ? 0 : 124
- color1 = Config_Setting::Anime_Cursor[:color1]
- color2 = Config_Setting::Anime_Cursor[:color2]
- contents.gradient_fill_rect(144+ofset+2,index*line_height+2,120,line_height-4,color1,color2)
- draw_text(144,index*line_height,124,line_height,"ON",1)
- draw_text(144+124,index*line_height,124,line_height,"OFF",1)
- end
-
- def update_help
- super
- @help_window.set_text($game_system.description(list[@index]))
- end
-
- def draw_left_arrow(x,y)
- bitmap = self.windowskin
- rect = Rect.new(80,24,8,16)
- contents.blt(x,y+4,bitmap,rect)
- end
- def draw_right_arrow(x,y)
- bitmap = self.windowskin
- rect = Rect.new(104,24,8,16)
- contents.blt(x,y+4,bitmap,rect)
- end
- end
- class Window_LogColor < Window_Selectable
- def initialize(help_window)
- super(32,32+help_window.height,Graphics.width-64,row_max*line_height + standard_padding*2)
- self.openness = 0
- @help_window = help_window
- refresh
- end
-
- def item_max; Config_Setting::GlobalLogColor.size; end
- def col_max ; 2 ; end
- def row_max ; (item_max / col_max.to_f).ceil ;end
-
- def refresh
- contents.clear
- Config_Setting::GlobalLogColor.each_with_index{|gc,i|
- text = gc[1] ? gc[2] : Config_Setting::LogColor[gc[0]][1]
- color = gc[1] ? $game_system.log_colors[gc[1][0]] : $game_system.log_colors[gc[0]]
- rect = Rect.new(contents_width/col_max*(i%col_max),line_height*(i/col_max)+2,width/col_max,line_height)
- draw_text(rect.x,rect.y,rect.width-40,rect.height,text)
- if color >= 0
- contents.fill_rect(rect.x+(contents_width/col_max)-40,rect.y,20,20,text_color(color))
- else
- contents.fill_rect(rect.x+(contents_width/col_max)-40,rect.y,20,20,text_color(0))
- contents.clear_rect(rect.x+(contents_width/col_max)-38,rect.y+2,16,16)
- end
- }
- end
-
- def item_rect(index)
- Rect.new(contents_width/col_max*(index%col_max)+(contents_width/col_max)-42,
- line_height*(index/col_max) ,24,24)
- end
-
- def update_help
- super
- gc = Config_Setting::GlobalLogColor[index]
- text = gc[3] ? gc[3] : Config_Setting::LogColor[gc[0]][2]
- @help_window.set_text(text)
- end
-
-
- def process_unequip_log
- Sound.play_equip
- Input.update
- gc = Config_Setting::GlobalLogColor[index]
- if gc[1]
- gc[1].each{|c| $game_system.log_colors[c] = -1 }
- else
- $game_system.log_colors[gc[0]] = -1
- end
- refresh
- call_handler(:unequip)
- end
- end
- class Window_Palette < Window_Selectable
- def initialize
- super(0,0,8*(11)+standard_padding+4,4*(8+2)+standard_padding*2)
- self.openness = 0
- self.arrows_visible = false
- refresh
- end
- def stadard_padding;6;end
- def col_max;8;end
- def row_max;4;end
- def item_max;col_max*row_max;end
- def update_padding_bottom;standard_padding;end
- def line_height;8;end
-
- def refresh
- contents.clear
- item_max.times{|i|
- contents.fill_rect(10*(i%col_max)+1,10*(i/col_max)+1,8,8,text_color(i))
- }
- end
-
- def item_rect(index)
- Rect.new(10*(index%col_max),10*(index/col_max),10,10)
- end
-
- def adjust_position(window)
- self.x = [window.x + window.item_rect(window.index).x,Graphics.width-self.width].min
- self.y = [window.y + window.item_rect(window.index).y + 38,Graphics.height-self.height].min
- end
- end
- class Window_KeySetting < Window_Selectable
- def initialize(help_window)
- super(32,help_window.height,Graphics.width-64,Graphics.height - help_window.height)
- self.openness = 0
- @help_window = help_window
- self.padding_bottom = 12
- self.arrows_visible = false
- create_contents
- refresh
- end
-
- def standard_padding;8;end
- def contents_height
- self.height - standard_padding * 2
- end
-
- def item_max; $game_system.default(:key_setting).size + 2; end
- def col_max ; 2 ; end
- def row_max ; ((item_max - 2) / col_max) ;end
-
- def item_rect(index)
- return Rect.new(40,line_height*(row_max+1)+60,self.width - 100, 24) if index == (item_max - 2)
- return Rect.new(40,line_height*(row_max+1)+84,self.width - 100, 24) if index == (item_max - 1)
- sup = index >= row_max ? line_height : 0
- Rect.new(((contents_width - 24) / 2) * (index % col_max) + 112,
- line_height*(index/col_max)+line_height*2+sup,((contents_width - 36) / 2) - 96,24)
- end
-
- def current_item_enabled?
- enable?(index)
- end
- def enable?(index)
- return true if index >= item_max - 2
- enable = $game_system.key_setting.values[index]
- return Input.connect_joypad == 0 if index > (row_max - 1) && enable
- return enable
- end
- def ext
- $game_system.key_setting_ext
- end
- def refresh
- contents.clear
- ext = $game_system.key_setting_ext
- draw_text(8,0,self.width,line_height,ext[5])
- draw_horz_line(30)
- change_color(system_color)
- draw_text(8,22,self.width,line_height,ext[1])
- draw_horz_line(line_height*(row_max/2) + 54)
- change_color(system_color)
- draw_text(8,line_height*((row_max/2)+1)+22,contents_width,line_height,ext[2])
- if Input.connect_joypad != 0
- change_color(normal_color)
- contents.font.size = 20
- draw_text(128,line_height*((row_max/2)+1)+24,contents_width,line_height,"(接続されていません)")
- contents.font.size = line_height
- end
- i = 0
- $game_system.key_setting.each{|key,value|
- change_color_button(key,value && enable?(i))
- x = 16+((contents_width - 24) / 2) * (i % col_max)
- y = line_height*(i / col_max)+line_height*(2+(i/row_max))
- draw_text(x,y,96,line_height,ext[0][i])
- change_color(normal_color,value && enable?(i))
- rect = item_rect(i)
- if value
- if value == :default
- change_color(text_color(21),value && enable?(i))
- text = "デフォルト"
- else
- text = value.is_a?(Array) ? value[1] : value.to_s
- end
- else
- text = "使用しない"
- end
- draw_text(rect,text,1)
- i += 1
- }
- change_color(normal_color,true)
- draw_text(item_rect(item_max-2),ext[3],1)
- draw_text(item_rect(item_max-1),ext[4],1)
- end
-
- def change_color_button(key,enable)
- return change_color(system_color,enable)
- #~ case key
- #~ when :A,:PAD_A;change_color(text_color(25),enable)
- #~ when :B,:PAD_B;change_color(text_color(22),enable)
- #~ when :C,:PAD_C;change_color(text_color(2),enable)
- #~ when :X,:PAD_X;change_color(text_color(24),enable)
- #~ when :Y,:PAD_Y;change_color(text_color(17),enable)
- #~ when :Z,:PAD_Z;change_color(text_color(27),enable)
- #~ when :L,:PAD_L;change_color(text_color(6),enable)
- #~ when :R,:PAD_R;change_color(text_color(7),enable)
- #~ end
- end
-
- def update_help
- super
- ks = $game_system.extend_setting(:key_setting)
- text = ks[index % row_max]
- text = ext[6] if index == item_max - 2
- text = ext[7] if index == item_max - 1
- @help_window.set_text(text)
- end
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- def process_handling
- return unless self.active
- return process_ok if index >= (item_max - 2) && Input.trigger?(:C)
- if index < row_max && !Input.input_key_without_cursor.empty? && Input.key_update?
- return Sound.play_buzzer unless current_item_enabled?
- ip = Input.input_key
- return Sound.play_buzzer if include_cursor?(ip)
- key = $game_system.key_setting.keys[index]
- n = $game_system.key_setting[key]
- return Sound.play_buzzer if (!Config_Setting::DefaultKeyChangable && press_exclude_input?(key))
- $game_system.key_setting.each{|ky,value|
- next if value == :default
- $game_system.key_setting[ky] = n if value == ip[0]
- }
- $game_system.key_setting[key] = ip[0]
- refresh
- Sound.play_ok
- elsif (index >= row_max && index < (item_max - 2)) &&
- !Input.press_joybutton.empty? && Input.joy_button_update?
- return Sound.play_buzzer unless current_item_enabled?
- ip = Input.press_joybutton
- key = $game_system.key_setting.keys[index]
- n = $game_system.key_setting[key]
- return Sound.play_buzzer if (!Config_Setting::DefaultKeyChangable && press_exclude_input?(key))
- $game_system.key_setting.each{|ky,value|
- next if value == :default
- $game_system.key_setting[ky] = n if value == ip[0]
- }
- $game_system.key_setting[key] = ip[0]
- refresh
- Sound.play_ok
- end
- end
- def include_cursor?(array)
- return true if array.include?(Keycode::Code[37])
- return true if array.include?(Keycode::Code[38])
- return true if array.include?(Keycode::Code[39])
- return true if array.include?(Keycode::Code[40])
- return false
- end
- def process_ok
- if index == item_max - 2
- Sound.play_ok
- Input.update
- deactivate
- call_ok_handler
- elsif index == item_max - 1
- Sound.play_ok
- Input.update
- $game_system.key_setting.each{|key,value|
- next unless value
- $game_system.key_setting[key] = :default
- }
- refresh
- end
- end
- def cursor_right(wrap = false)
- super(wrap)
- super(wrap) until current_item_enabled?
- end
- def cursor_left(wrap = false)
- super(wrap)
- super(wrap) until current_item_enabled?
- end
- def cursor_up(wrap = false)
- loop do
- if index == (item_max - 2)
- select(item_max - 3)
- elsif index == (item_max - 1)
- select(item_max - 2)
- elsif index >= col_max || (wrap && col_max == 1)
- select((index - col_max + item_max) % item_max)
- end
- break if current_item_enabled?
- end
- end
-
- def cursor_down(wrap = false)
- loop do
- if (index == (item_max - 3)) or (index == (item_max - 4))
- select(item_max - 2)
- elsif index == (item_max - 2)
- select(item_max - 1)
- elsif index < item_max - col_max || (wrap && col_max == 1)
- select((index + col_max) % item_max)
- end
- break if current_item_enabled?
- end
- end
- def press_exclude_input?(key)
- a = [:A,:B,:C,:X,:Y,:Z,:L,:R]
- f = key.to_s.include?("PAD_") ? true : false
- a.any?{|sym|
- nn = f ? ("PAD_" + sym.to_s).to_sym : sym
- next if nn == key
- Input._config_press?(sym) && (!$game_system.key_setting[nn] or $game_system.key_setting[nn] == :default)
- }
- end
- end
- #==============================================================================
- # ■ Scene_Config
- #------------------------------------------------------------------------------
- # コンフィグ画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Config < Scene_MenuBase
- def start
- super
- create_help_window
- create_palette_window if Config_Setting::Alignment.include?(:log_color)
- create_log_color_window if Config_Setting::Alignment.include?(:log_color)
- create_key_setting_window if $game_system.use_key_setting?
- create_config_window
- @help_window.hide unless Config_Setting::Use_Help
- end
-
- # コンフィグウィンドウの作成
- def create_config_window
- @config_window = Window_Config.new
- @config_window.set_handler(:cancel, method(:return_scene))
- @config_window.activate
- @config_window.select(0)
- @config_window.help_window = @help_window
- @config_window.y = [@config_window.y,@help_window.height+@help_window.y].max
- @config_window.log_color_window = @log_color_window if Config_Setting::Alignment.include?(:log_color)
- @config_window.key_setting_window = @key_setting_window if Config_Setting::Alignment.include?(:key_setting)
- end
-
- def create_log_color_window
- @log_color_window = Window_LogColor.new(@help_window)
- @log_color_window.set_handler(:cancel, method(:cancel_log_color))
- @log_color_window.set_handler(:ok, method(:ok_log_color))
- @log_color_window.set_handler(:unequip, method(:unequip_log))
- @log_color_window.z = 200
- @log_color_window.deactivate
- end
-
- def create_palette_window
- @palette_window = Window_Palette.new
- @palette_window.set_handler(:cancel, method(:cancel_palette))
- @palette_window.set_handler(:ok, method(:ok_palette))
- @palette_window.z = 210
- @palette_window.deactivate
- end
-
- def create_key_setting_window
- @key_setting_window = Window_KeySetting.new(@help_window)
- @key_setting_window.set_handler(:ok, method(:ok_key_setting))
- @key_setting_window.z = 200
- @key_setting_window.deactivate
- end
-
- def reload_skin
- instance_variables.each do |varname|
- ivar = instance_variable_get(varname)
- ivar.windowskin = Cache.system("Window") if ivar.is_a?(Window)
- end
- end
-
- def cancel_log_color
- @log_color_window.deactivate.close.unselect
- @config_window.activate
- end
-
- def ok_log_color
- @log_color_window.deactivate
- @palette_window.adjust_position(@log_color_window)
- @palette_window.activate.open.select(0)
- end
-
- def ok_key_setting
- @key_setting_window.deactivate.close.unselect
- @config_window.activate.open
- end
-
- def unequip_log
- @config_window.refresh
- end
-
- def cancel_palette
- @log_color_window.activate
- @palette_window.deactivate.close.unselect
- end
-
- def ok_palette
- set_color
- @log_color_window.activate.refresh
- @config_window.refresh
- @palette_window.deactivate.close.unselect
- end
-
- def set_color
- gc = Config_Setting::GlobalLogColor[@log_color_window.index]
- if gc[1]
- gc[1].each{|c|
- $game_system.log_colors[c] = @palette_window.index
- }
- else
- $game_system.log_colors[gc[0]] = @palette_window.index
- end
- end
-
- def return_scene
- if SceneManager.stack[0].is_a?(Scene_Title)
- DataManager.save_config_parameters
- end
- super
- end
- end
- #==============================================================================
- # ■ Window_MenuCommand
- #==============================================================================
- class Window_MenuCommand < Window_Command
- # メニューにオリジナルコマンドを追加
- # コンフィグを追加します。
- alias add_original_commands_config add_original_commands
- def add_original_commands
- add_original_commands_config
- add_command(Vocab::config, :config, main_commands_enabled)
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● コマンドウィンドウの作成 エイリアス
- #--------------------------------------------------------------------------
- alias create_command_window_config create_command_window
- def create_command_window
- create_command_window_config
- @command_window.set_handler(:config, method(:command_config))
- end
-
- # コンフィグウィンドウのコマンド処理
- def command_config
- SceneManager.call(Scene_Config)
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #------------------------------------------------------------------------------
- # バトル画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● アニメーションの表示 エイリアス
- #--------------------------------------------------------------------------
- alias yy_config_show_animation show_animation
- def show_animation(targets, animation_id)
- if $game_system.animation_switch == :off && !$game_switches[Config_Setting::AnimationInvalidSwitch]
- if $imported_yana_scripts["ExtendIntercept"] && self.respond_to?(:execute_interrupt)
- execute_interrupt(targets) unless $game_temp.battle_phase
- end
- return
- end
- yy_config_show_animation(targets, animation_id)
- end
- end
- module Graphics
- # ウィンドウをリサイズ
- def self.resize_window(n)
- fw = get_window_handle
- r = Win32API.new("user32","GetSystemMetrics","i","i")
- init_default_size unless $InitWindowSize
- iw = $InitWindowSize
- rr = Array.new.fill(0.chr, 0..16).join
- ws = Win32API.new("user32", "GetWindowRect", "lp", "i").call(fw, rr)
- rr = rr.unpack("i*")
- w,h = iw[0]*n+iw[2],iw[1]*n+iw[3]
- x = [rr[0]-(w-(rr[2]-rr[0]))/2,0].max
- y = [rr[1]-(h-(rr[3]-rr[1]))/2,0].max
- #~ Win32API.new("user32","MoveWindow","liiiil","l").call(fw,(sw-w)/2,(sh-h)/2,w,h,1)
- Win32API.new("user32","MoveWindow","liiiil","l").call(fw,x,y,w,h,1)
- end
-
- # ウィンドウの初期サイズを記録
- def self.init_default_size
- fw = get_window_handle
- r = Array.new.fill(0.chr, 0..16).join
- r2 = r.clone
- Win32API.new("user32", "GetWindowRect", "lp", "i").call(fw, r)
- Win32API.new("user32", "GetClientRect", "lp", "i").call(fw, r2)
- rect = r.unpack("i*")
- rect2 = r2.unpack("i*")
- $InitWindowSize = [rect2[2],rect2[3],(rect[2]-rect[0])-rect2[2],(rect[3]-rect[1])-rect2[3]]
- end
-
- # ウィンドウハンドルの取得
- def self.get_window_handle
- Win32API.new("user32","FindWindowEx","llpp","i").call(0,0,"RGSS Player",0)
- end
- end
- class Window_SaveFile < Window_Base
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- alias config_refresh refresh
- def refresh
- set_window
- config_refresh
- end
-
- def set_window
- header = DataManager.load_header(@file_index)
- return unless header
- ws = $game_system.windowskin
- $game_system.windowskin = 0
- self.windowskin = Cache.system("Window"+header[:windowskin].to_s) if header[:windowskin] && header[:windowskin] > 0
- self.windowskin = Cache.system("Window") if header[:windowskin] && header[:windowskin] == 0
- @tone = header[:window_tone] if header[:window_tone]
- $game_system.windowskin = ws
- update_tone
- end
-
- alias config_update_tone update_tone
- def update_tone
- self.tone.set(@tone) if @tone
- config_update_tone unless @tone
- end
- end
- #
- # GC呼び出し頻度減少
- #
- # マップ画面のGCの呼び出し頻度を減少させることで、ゲーム中のカクつきを抑えます。
- # ただし、GCは不要になったメモリを解放する機能なので、これを導入すると、
- # ゲーム中にPCが消費するメモリが増加します。
- #
- class Scene_Map < Scene_Base
- if Config_Setting::Alignment.include?(:gc_sec)
- alias __start start
- def start
- __start
- execute_gc
- end
-
- alias __update update
- def update
- @frame_count += 1
- execute_gc if @frame_count % ($game_system.gc_sec * 60) == 0
- __update
- end
-
- def execute_gc
- GC.enable
- GC.start
- GC.disable
- @frame_count = 0
- end
-
- alias __perform_transfer perform_transfer
- def perform_transfer
- __perform_transfer
- execute_gc
- end
- end
- end
- class << SceneManager
- alias config_goto goto
- def goto(scene_class)
- GC.enable
- config_goto(scene_class)
- end
- alias config_call call
- def call(scene_class)
- GC.enable
- config_call(scene_class)
- end
- def stack
- @stack
- end
- end
- class Window_BattleLog < Window_Selectable
- def set_color_logs(call=nil,arg={})
- @call = [call,arg]
- end
-
- def change_color_logs(text)
- return text if text.empty?
- if @call
- type = @call[0]
- arg = @call[1]
- color = ""
- else
- type = :others
- end
- case type
- when :current_state
- color = $game_system.log_color(type)
- when :use_item,:chase,:retaliation,:interrupt
- color = $game_system.log_color(type,arg[:subject].actor?)
- when :substitute
- color = $game_system.log_color(type,arg[:substitute].actor?)
- when :counter,:reflection,:failure,:critical,:miss,:evasion,:added_states,
- :removed_states,:parry,:guard,:barrier,:barrier_broken,:genei_evasion
- color = $game_system.log_color(type,arg[:target].actor?)
- when :hp_damage
- target = arg[:target]
- recover = target.result.hp_damage < 0
- color = $game_system.log_color(type,target.actor?,recover)
- when :mp_damage
- target = arg[:target]
- recover = target.result.mp_damage < 0
- color = $game_system.log_color(type,target.actor?,recover)
- when :tp_damage
- target = arg[:target]
- recover = target.result.tp_damage < 0
- color = $game_system.log_color(type,target.actor?,recover)
- when :buffs
- target = arg[:target]
- sup = :removed_buffs
- sup = :add_buff if target.result.added_buffs
- sup = :add_debuff if target.result.added_debuffs
- color = $game_system.log_color(type,target.actor?,sup)
- else
- color = $game_system.log_color(:others)
- end
- return nil if color == -1
- return "\\C[#{color}]" + text
- end
-
- alias _config_add_text add_text
- def add_text(text)
- text = change_color_logs(text)
- _config_add_text(text)
- end
-
- alias _config_replace_text replace_text
- def replace_text(text)
- text = change_color_logs(text)
- _config_replace_text(text)
- end
-
- alias _config_refresh refresh
- def refresh
- @lines.compact!
- _config_refresh
- end
-
- alias _config_display_current_state display_current_state
- def display_current_state(subject)
- set_color_logs(:current_state,{:subject=>subject})
- _config_display_current_state(subject)
- end
- alias _config_display_use_item display_use_item
- def display_use_item(subject, item)
- set_color_logs(:use_item,{:subject=>subject,:item=>item})
- _config_display_use_item(subject,item)
- end
- alias _config_display_counter display_counter
- def display_counter(target, item)
- set_color_logs(:counter,{:target=>target,:item=>item})
- _config_display_counter(target,item)
- end
- alias _config_display_reflection display_reflection
- def display_reflection(target, item)
- set_color_logs(:reflection,{:target=>target,:item=>item})
- _config_display_reflection(target,item)
- end
- alias _config_display_substitute display_substitute
- def display_substitute(substitute, target)
- set_color_logs(:substitute,{:substitute=>substitute,:target=>target})
- _config_display_substitute(substitute, target)
- end
- alias _config_display_failure display_failure
- def display_failure(target, item)
- set_color_logs(:failure,{:target=>target,:item=>item})
- _config_display_failure(target,item)
- end
- alias _config_display_critical display_critical
- def display_critical(target, item)
- set_color_logs(:critical,{:target=>target,:item=>item})
- _config_display_critical(target,item)
- end
- alias _config_display_miss display_miss
- def display_miss(target, item)
- set_color_logs(:miss,{:target=>target,:item=>item})
- _config_display_miss(target, item)
- end
- alias _config_display_evasion display_evasion
- def display_evasion(target, item)
- set_color_logs(:evasion,{:target=>target,:item=>item})
- _config_display_evasion(target, item)
- end
- alias _config_display_hp_damage display_hp_damage
- def display_hp_damage(target, item)
- set_color_logs(:hp_damage,{:target=>target,:item=>item})
- _config_display_hp_damage(target, item)
- end
- alias _config_display_mp_damage display_mp_damage
- def display_mp_damage(target, item)
- set_color_logs(:mp_damage,{:target=>target,:item=>item})
- _config_display_mp_damage(target, item)
- end
- alias _config_display_tp_damage display_tp_damage
- def display_tp_damage(target, item)
- set_color_logs(:tp_damage,{:target=>target,:item=>item})
- _config_display_tp_damage(target, item)
- end
- alias _config_display_added_states display_added_states
- def display_added_states(target)
- set_color_logs(:added_states,{:target=>target})
- _config_display_added_states(target)
- end
- alias _config_display_removed_states display_removed_states
- def display_removed_states(target)
- set_color_logs(:removed_states,{:target=>target})
- _config_display_removed_states(target)
- end
- alias _config_display_buffs display_buffs
- def display_buffs(target, buffs, fmt)
- set_color_logs(:buffs,{:target=>target,:buffs=>buffs,:fmt=>fmt})
- _config_display_buffs(target, buffs, fmt)
- end
- alias _tt_last_text last_text
- def last_text
- _tt_last_text ? _tt_last_text : []
- end
- if $imported_yana_scripts["ExtendIntercept"]
- alias _config_display_parry display_parry
- def display_parry(target, item)
- set_color_logs(:parry,{:target=>target,:item=>item})
- _config_display_parry(target,item)
- end
- alias _config_display_guard display_guard
- def display_guard(target,item)
- set_color_logs(:guard,{:target=>target,:item=>item})
- _config_display_guard(target,item)
- end
- alias _config_display_barrier display_barrier
- def display_barrier(target,item)
- set_color_logs(:barrier,{:target=>target,:item=>item})
- _config_display_barrier(target,item)
- end
- alias _config_display_barrier_broken display_barrier_broken
- def display_barrier_broken(target,item)
- set_color_logs(:barrier_broken,{:target=>target,:item=>item})
- _config_display_barrier_broken(target,item)
- end
- if self.method_defined?(:display_retaliation)
- alias _config_display_genei_evasion display_genei_evasion
- def display_genei_evasion(target,item)
- set_color_logs(:genei_evasion,{:target=>target,:item=>item})
- _config_display_genei_evasion(target,item)
- end
- alias _config_display_retaliation display_retaliation
- def display_retaliation(subject,target, item)
- set_color_logs(:retaliation,{:subject=>subject,:target=>target,:item=>item})
- _config_display_retaliation(subject,target,item)
- end
- alias _config_display_chase display_chase
- def display_chase(subject, item)
- set_color_logs(:chase,{:subject=>subject,:item=>item})
- _config_display_chase(subject,item)
- end
- alias _config_display_interrupt display_interrupt
- def display_interrupt(attacker, subject, ritem, item)
- set_color_logs(:interrupt,{:attacker=>attacker,:subject=>subject,:ritem=>ritem,:item=>item})
- _config_display_interrupt(attacker,subject,ritem,item)
- end
- alias _config_display_wide_use display_wide_use
- def display_wide_use(text,sup=nil)
- case $game_temp.battle_phase
- when :chase
- set_color_logs(:chase,{:subject=>sup[0],:item=>sup[3]})
- when :interrupt
- set_color_logs(:interrupt,{:attacker=>sup[0],:subject=>sup[1],:ritem=>sup[2],:item=>sup[3]})
- end
- if sup[5] == :cover
- set_color_logs(:substitute,{:substitute=>sup[0],:target=>sup[4]})
- end
- _config_display_wide_use(text,sup)
- end
- else
- alias _config_display_genei_evasion display_genei_evasion
- def display_genei_evasion(target)
- set_color_logs(:genei_evasion,{:target=>target})
- _config_display_genei_evasion(target)
- end
- end
- end
- end
- class << Input
- attr_reader :keyinput
- attr_reader :joyinput
- attr_accessor :connect_joypad
-
- @@repeat_count = {}
-
- alias _config_update update
- def update
- if $game_system && $game_system.use_key_setting?
- update_joypad if @connect_joypad == 0 or !@connect_joypad
- update_keyinput
- end
- _config_update
- end
- def update_joypad
- @joypad_api = Win32API.new("winmm","joyGetPosEx","lp", "l") unless @joypad_api
- @prev_joyinput = @joyinput.dup if @joyinput
- @joyinput = [ 52 , 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].pack("I*")
- @connect_joypad = @joypad_api.call(0, @joyinput)
- @joyinput = @joyinput.unpack("I*")
- end
- def update_keyinput
- @keyboard_api = Win32API.new("user32","GetKeyboardState","p","i") unless @keyboard_api
- @prev_keyinput = @keyinput.dup if @keyinput
- @keyinput = " " * 256
- @keyboard_api.call(@keyinput)
- end
- def input_key_without_name(keys = nil)
- keys = @keyinput unless keys
- i = 0
- ac = []
- keys.each_byte{|aa|
- ac.push(Keycode::Code[i][0]) if aa >= 128 && Keycode::Code[i]
- i+=1
- }
- ac
- end
- def input_key(keys = nil)
- keys = @keyinput unless keys
- i = 0
- ac = []
- keys.each_byte{|aa|
- ac.push(Keycode::Code[i]) if aa >= 128 && Keycode::Code[i]
- i+=1
- }
- ac
- end
- def input_key_without_cursor(keys = nil)
- ac = input_key(keys)
- ac.delete(Keycode::Code[37])
- ac.delete(Keycode::Code[38])
- ac.delete(Keycode::Code[39])
- ac.delete(Keycode::Code[40])
- ac
- end
-
- def input_joykey(keys=nil)
- keys = @joyinput unless keys
- i = 0
- rr = keys.inject({}){|r,value|
- r[Keycode::JoyInfo[i]] = value
- i += 1
- r
- }
- rr
- end
-
- alias _config_trigger? trigger?
- def trigger?(sym)
- return _config_trigger?(sym) unless ($game_system && $game_system.use_key_setting?)
- return false if !key_update? && !joy_update?
- r = _config_trigger?(sym)
- if $game_system.use_pov?
- if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
- return r if r
- return true if press_joypov == Keycode::POV[sym] && update_key?(sym)
- end
- end
- n1 = $game_system.key_setting[sym]
- n1 = n1.is_a?(Array) ? n1[0] : nil
- n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
- n2 = (!n2 or n2 == :default) ? nil : n2
- return r unless (n1 or n2)
- return true if ((n1 && update_key?(n1)) or (n2 && update_key?(n2)))
- return true if !n1 && r && press_joybutton.empty?
- return true if !n2 && r && input_key.empty?
- return false
- end
-
- alias _config_press? press?
- def press?(sym)
- return _config_press?(sym) unless ($game_system && $game_system.use_key_setting?)
- r = _config_press?(sym)
- if $game_system.use_pov?
- if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
- return true if r or (press_joypov == Keycode::POV[sym])
- end
- end
- n1 = $game_system.key_setting[sym]
- n1 = n1.is_a?(Array) ? n1[0] : nil
- n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
- n2 = (!n2 or n2 == :default) ? nil : n2
- return r unless (n1 or n2)
- return true if (input_key_without_name.include?(n1) or press_joybutton.include?(n2))
- return true if !n1 && r && press_joybutton.empty?
- return true if !n2 && r && input_key.empty?
- return false
- end
-
- alias _config_repeat? repeat?
- def repeat?(sym)
- return _config_repeat?(sym) unless ($game_system && $game_system.use_key_setting?)
- repeat_count = 7
- r = _config_repeat?(sym)
- @@repeat_count[sym] = 25 if (!@@repeat_count[sym] or update_key?(sym))
- @@repeat_count[sym] = repeat_count if @@repeat_count[sym] <= 0
- if $game_system.use_pov?
- if @connect_joypad == 0 && Keycode::POV.keys.include?(sym)
- return r if r
- @@repeat_count[sym] -= 1 if (press_joypov == Keycode::POV[sym])
- return (@@repeat_count[sym] % 24 == 0) if (press_joypov == Keycode::POV[sym])
- end
- end
- n1 = $game_system.key_setting[sym]
- n1 = n1.is_a?(Array) ? n1[0] : nil
- n2 = $game_system.key_setting[("PAD_"+sym.to_s).to_sym]
- n2 = (!n2 or n2 == :default) ? nil : n2
- return r unless (n1 or n2)
- n = (input_key_without_name.include?(n1) or press_joybutton.include?(n2))
- r = false if n
- n = true if !n && !n1 && r && press_joybutton.empty?
- n = true if !n && !n2 && r && input_key.empty?
- return true if n && r
- @@repeat_count[sym] -= 1 if n
- return n && (@@repeat_count[sym] % 24 == 0)
- end
- alias _config_dir4 dir4
- def dir4
- return _config_dir4 unless ($game_system && $game_system.use_key_setting?)
- if @connect_joypad == 0 && $game_system.use_pov?
- return 2 if press_joypov == Keycode::POV[:DOWN]
- return 8 if press_joypov == Keycode::POV[:UP]
- return 4 if press_joypov == Keycode::POV[:LEFT]
- return 6 if press_joypov == Keycode::POV[:RIGHT]
- end
- return _config_dir4
- end
- alias _config_dir8 dir8
- def dir8
- return _config_dir8 unless ($game_system && $game_system.use_key_setting?)
- if @connect_joypad == 0 && $game_system.use_pov?
- return 1 if press_joypov == Keycode::POV[:DL]
- return 2 if press_joypov == Keycode::POV[:DOWN]
- return 3 if press_joypov == Keycode::POV[:DR]
- return 4 if press_joypov == Keycode::POV[:LEFT]
- return 6 if press_joypov == Keycode::POV[:RIGHT]
- return 7 if press_joypov == Keycode::POV[:UL]
- return 8 if press_joypov == Keycode::POV[:UP]
- return 9 if press_joypov == Keycode::POV[:UR]
- end
- return _config_dir8
- end
- def press_joybutton
- Keycode.press?(input_joykey[:Button])
- end
- def press_joypov
- input_joykey[:POV]
- end
- def joy_button_update?
- return false unless @connect_joypad == 0
- @joyinput[8] != @prev_joyinput[8]
- end
- def joy_pov_update?
- return false unless @connect_joypad == 0
- @joyinput[10] != @prev_joyinput[10]
- end
- def joy_axis_update?
- return false unless @connect_joypad == 0
- (@joyinput[2]/10000) != (@prev_joyinput[2]/10000) or
- (@joyinput[3]/10000) != (@prev_joyinput[3]/10000)
- end
- def joy_update?
- return false unless @connect_joypad == 0
- joy_button_update? or joy_pov_update? or joy_axis_update?
- end
- def key_update?
- @keyinput != @prev_keyinput
- end
- def update_key?(sym)
- if Keycode::POV.keys.include?(sym)
- return joy_pov_update?
- end
- ss = sym
- ss = $game_system.key_setting[("PAD_"+sym.to_s).to_sym] unless ss.to_s.include?("button")
- if Keycode.press?(input_joykey[:Button]).include?(ss)
- return !Keycode.press?(input_joykey(@prev_joyinput)[:Button]).include?(ss)
- end
- return input_key_without_name.include?(sym) && !input_key_without_name(@prev_keyinput).include?(sym)
- end
- end
- class Scene_Title < Scene_Base
-
- alias _config_create_command_window create_command_window
- def create_command_window
- _config_create_command_window
- @command_window.set_handler(:config, method(:command_config))
- end
-
- def command_config
- SceneManager.call(Scene_Config)
- end
- end
- class Window_TitleCommand < Window_Command
- alias _config_make_command_list make_command_list
- def make_command_list
- _config_make_command_list
- if Config_Setting::TitleConfigEnable
- add_command(Vocab::config, :config)
- r = @list.dup
- n = @list.size
- n.times{|i|
- case r[0][:symbol]
- when :shutdown;@list[n-1] = r.shift
- when :config ;@list[n-2] = r.shift
- else ;@list[i] = r.shift
- end
- }
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|