File size: 36,102 Bytes
99b0de1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | //=============================================================================
// RPGツクールMZ - LL_MenuScreenCustom.js v1.4.4
//-----------------------------------------------------------------------------
// ルルの教会 (Lulu's Church)
// https://nine-yusha.com/
//
// URL below for license details.
// https://nine-yusha.com/plugin/
//=============================================================================
/*:
* @target MZ
* @plugindesc メニュー画面レイアウトをカスタマイズします。
* @author ルルの教会
* @url https://nine-yusha.com/plugin-menuscreencustom/
* @base LL_MenuScreenBase
* @orderAfter LL_MenuScreenBase
*
* @help LL_MenuScreenCustom.js
*
* メニュー画面レイアウトをカスタマイズします。
* 顔グラフィックの代わりに立ち絵を表示することもできます。
* ※表示する立ち絵リストは「LL_MenuScreenBase」で設定してください。
*
* 立ち絵が上手く表示されない場合:
* 何も表示されない場合は、X・Y座標始点のマイナス値を大きくしてみるか、
* 拡大率を小さくしてみてください。
* 顔グラフィックが表示されている時は、立ち絵リストが紐づけできていません。
* 立ち絵リストが正しく設定されているか確認してみてください。
*
* ヘルプウィンドウ:
* ヘルプウィンドウの左上と右上、左下と右下に任意の情報を表示できます。
* 表示する内容(値)はスクリプトで記述してください。
*
* プラグインコマンドはありません。
*
* 利用規約:
* ・著作権表記は必要ございません。
* ・利用するにあたり報告の必要は特にございません。
* ・商用・非商用問いません。
* ・R18作品にも使用制限はありません。
* ・ゲームに合わせて自由に改変していただいて問題ございません。
* ・プラグイン素材としての再配布(改変後含む)は禁止させていただきます。
*
* 作者: ルルの教会
* 作成日: 2022/6/7
*
* @param menuSettings
* @text メニュー画面の設定
* @desc ※この項目は使用しません
*
* @param leftInputMode
* @text メニューを左に配置
* @desc メニューを左に配置し、タッチUI配置も左向けに調整します。
* 戻るボタンが左上、ページ切替ボタンが右上に配置されます。
* @default false
* @type boolean
* @parent menuSettings
*
* @param numVisibleRows
* @text アクター行数
* @desc アクター一覧画面の行数です。 (推奨値: 1~2)
* @default 2
* @min 1
* @max 10
* @type number
* @parent menuSettings
*
* @param maxCols
* @text アクター列数
* @desc アクター一覧画面の列数です。 (推奨値: 1~2)
* @default 2
* @min 1
* @max 10
* @type number
* @parent menuSettings
*
* @param currencyWindowPosition
* @text 所持金の表示位置
* @desc ヘルプウィンドウの右下に独自の項目を表示するときは、
* 「メニュー下に別ウィンドウで表示」に設定してください。
* @default helpWindowRightBottom
* @type select
* @option 表示しない
* @value hidden
* @option ヘルプウィンドウの右下
* @value helpWindowRightBottom
* @option メニュー下に別ウィンドウで表示
* @value menuCommandBottom
* @parent menuSettings
*
* @param backgroundImages
* @text 背景画像の設定
* @desc メニュー画面の背景画像を変更します。
* @default []
* @type struct<backgroundImages>[]
* @parent menuSettings
*
* @param layoutSettings
* @text 表示位置の設定
* @desc ※この項目は使用しません
*
* @param actorNameLH
* @text アクター名表示位置
* @desc アクター名を上から何行目に表示するか設定します。
* -1にすると非表示になります。 (初期値: 0)
* @default 0
* @min -1
* @max 100
* @type number
* @parent layoutSettings
*
* @param actorNameX
* @text アクター名表示位置(X)
* @desc アクター名の横位置を調整します。(初期値: 0)
* プラスにすると右へ、マイナスにすると左へ移動します。
* @default 0
* @min -9999
* @max 9999
* @type number
* @parent layoutSettings
*
* @param actorLevelLH
* @text レベル表示位置
* @desc レベルを上から何行目に表示するか設定します。
* -1にすると非表示になります。 (初期値: 1)
* @default 1
* @min -1
* @max 100
* @type number
* @parent layoutSettings
*
* @param actorLevelX
* @text レベル表示位置(X)
* @desc レベルの横位置を調整します。(初期値: 0)
* プラスにすると右へ、マイナスにすると左へ移動します。
* @default 0
* @min -9999
* @max 9999
* @type number
* @parent layoutSettings
*
* @param actorIconLH
* @text ステート表示位置
* @desc ステートアイコンを上から何行目に表示するか設定します。
* -1にすると非表示になります。 (初期値: 2)
* @default 2
* @min -1
* @max 100
* @type number
* @parent layoutSettings
*
* @param actorIconX
* @text ステート表示位置(X)
* @desc ステートアイコンの横位置を調整します。(初期値: 0)
* プラスにすると右へ、マイナスにすると左へ移動します。
* @default 0
* @min -9999
* @max 9999
* @type number
* @parent layoutSettings
*
* @param actorClassLH
* @text 職業名表示位置
* @desc 職業名を上から何行目に表示するか設定します。
* -1にすると非表示になります。 (初期値: 3)
* @default 3
* @min -1
* @max 100
* @type number
* @parent layoutSettings
*
* @param actorClassX
* @text 職業名表示位置(X)
* @desc 職業名の横位置を調整します。(初期値: 0)
* プラスにすると右へ、マイナスにすると左へ移動します。
* @default 0
* @min -9999
* @max 9999
* @type number
* @parent layoutSettings
*
* @param actorGaugeLH
* @text ゲージ表示位置
* @desc HP・MP・TPゲージを上から何行目に表示するか設定します。
* -1にすると非表示になります。 (初期値: 4)
* @default 4
* @min -1
* @max 100
* @type number
* @parent layoutSettings
*
* @param actorGaugeX
* @text ゲージ表示位置(X)
* @desc ゲージの横位置を調整します。(初期値: 0)
* プラスにすると右へ、マイナスにすると左へ移動します。
* @default 0
* @min -9999
* @max 9999
* @type number
* @parent layoutSettings
*
* @param lvPadding
* @text Lvの余白調整値
* @desc Lv表記の余白調整値です。
* 数値を小さくすると余白が狭くなります。 (初期値: 84)
* @default 84
* @min 0
* @max 2000
* @type number
* @parent layoutSettings
*
* @param gaugeWidth
* @text ゲージの幅
* @desc ゲージの幅(長さ)です。 (初期値: 128)
* この設定はメニュー画面トップのみ適用されます。
* @default 128
* @min 0
* @max 2000
* @type number
* @parent layoutSettings
*
* @param pictureSettings
* @text 立ち絵表示の設定
* @desc ※この項目は使用しません
*
* @param showStandingPicture
* @text 立ち絵を表示
* @desc 顔グラフィックの代わりに立ち絵を表示します。
* @default true
* @type boolean
* @parent pictureSettings
*
* @param menuWindowPictureX
* @text X座標始点
* @desc 顔グラフィックの代わりに表示する立ち絵の表示位置(X)です。
* @default 0
* @min -2000
* @max 2000
* @type number
* @parent pictureSettings
*
* @param menuWindowPictureY
* @text Y座標始点
* @desc 顔グラフィックの代わりに表示する立ち絵の表示位置(Y)です。
* @default 0
* @min -2000
* @max 2000
* @type number
* @parent pictureSettings
*
* @param menuWindowPictureScale
* @text 拡大率
* @desc 立ち絵の拡大率です。 (初期値: 100)
* @default 100
* @min -2000
* @max 2000
* @type number
* @parent pictureSettings
*
* @param menuHelpSettings
* @text ヘルプウィンドウの設定
* @desc ※この項目は使用しません
*
* @param menuHelpWindowEnable
* @text ヘルプウィンドウを表示
* @desc メニュー画面上部にヘルプウィンドウを表示します。
* @default true
* @type boolean
* @parent menuHelpSettings
*
* @param menuHelpTexts
* @text メニュー説明文
* @desc メニュー説明文のリストを定義します。
* @default ["{\"symbol\":\"アイテム\",\"helpText\":\"入手したアイテムを使用します。\"}","{\"symbol\":\"スキル\",\"helpText\":\"習得したスキルを使用します。\"}","{\"symbol\":\"装備\",\"helpText\":\"装備を変更します。\"}","{\"symbol\":\"ステータス\",\"helpText\":\"ステータスを確認します。\"}","{\"symbol\":\"並び替え\",\"helpText\":\"パーティの並び順を変更します。\"}","{\"symbol\":\"オプション\",\"helpText\":\"オプション画面を開きます。\"}","{\"symbol\":\"セーブ\",\"helpText\":\"セーブ画面を開きます。\"}","{\"symbol\":\"ゲーム終了\",\"helpText\":\"ゲームを終了します。\"}"]
* @type struct<menuHelpTexts>[]
* @parent menuHelpSettings
*
* @param leftBlockLabel
* @text 左上の項目名
* @desc 左上に表示する項目名です。
* 空白にすると非表示になります。
* @default 現在地:
* @type string
* @parent menuHelpSettings
*
* @param leftBlockValue
* @text 左上の値
* @desc 左上に表示する値をスクリプトで記述します。
* @default $gameMap.displayName()
* @type combo
* @option $gameVariables.value(1) // 変数ID:1の値
* @option $gameSwitches.value(1) ? "有効" : "無効" // スイッチID:1の状態
* @option $gameMap.displayName() // マップ名
* @option $gameParty.size() // パーティー人数
* @option $gameParty.steps() // 現在の歩数
* @option $gameParty.gold() // 所持金
* @option $gameParty.numItems($dataItems[1]) // アイテムID:1の所持数
* @option $gameParty.numItems($dataWeapons[1]) // 武器ID:1の所持数
* @option $gameParty.numItems($dataArmors[1]) // 防具ID:1の所持数
* @option $gameSystem.playtimeText() // プレイ時間
* @option $gameSystem.saveCount() // セーブ回数
* @option $gameSystem.battleCount() // 戦闘回数
* @parent menuHelpSettings
*
* @param leftBlockAlign
* @text 左上の文字揃え
* @desc 左上に表示する値の文字配置を選択します。
* @default left
* @type select
* @option 左揃え
* @value left
* @option 中央揃え
* @value center
* @option 右揃え
* @value right
* @parent menuHelpSettings
*
* @param rightBlockLabel
* @text 右上の項目名
* @desc 右上に表示する項目名です。
* 空白にすると非表示になります。
* @default プレイ時間:
* @type string
* @parent menuHelpSettings
*
* @param rightBlockValue
* @text 右上の値
* @desc 右上に表示する値をスクリプトで記述します。
* @default $gameSystem.playtimeText()
* @type combo
* @option $gameVariables.value(1) // 変数ID:1の値
* @option $gameSwitches.value(1) ? "有効" : "無効" // スイッチID:1の状態
* @option $gameMap.displayName() // マップ名
* @option $gameParty.size() // パーティー人数
* @option $gameParty.steps() // 現在の歩数
* @option $gameParty.gold() // 所持金
* @option $gameParty.numItems($dataItems[1]) // アイテムID:1の所持数
* @option $gameParty.numItems($dataWeapons[1]) // 武器ID:1の所持数
* @option $gameParty.numItems($dataArmors[1]) // 防具ID:1の所持数
* @option $gameSystem.playtimeText() // プレイ時間
* @option $gameSystem.saveCount() // セーブ回数
* @option $gameSystem.battleCount() // 戦闘回数
* @parent menuHelpSettings
*
* @param rightBlockAlign
* @text 右上の文字揃え
* @desc 右上に表示する値の文字配置を選択します。
* @default right
* @type select
* @option 左揃え
* @value left
* @option 中央揃え
* @value center
* @option 右揃え
* @value right
* @parent menuHelpSettings
*
* @param rightBottomBlockLabel
* @text 右下の項目名
* @desc 右下に表示する項目名です。
* ※所持金の表示位置が「ヘルプウィンドウの右下」時は無効
* @default
* @type string
* @parent menuHelpSettings
*
* @param rightBottomBlockValue
* @text 右下の値
* @desc 右下に表示する値をスクリプトで記述します。
* ※所持金の表示位置が「ヘルプウィンドウの右下」時は無効
* @default
* @type combo
* @option $gameVariables.value(1) // 変数ID:1の値
* @option $gameSwitches.value(1) ? "有効" : "無効" // スイッチID:1の状態
* @option $gameMap.displayName() // マップ名
* @option $gameParty.size() // パーティー人数
* @option $gameParty.steps() // 現在の歩数
* @option $gameParty.gold() // 所持金
* @option $gameParty.numItems($dataItems[1]) // アイテムID:1の所持数
* @option $gameParty.numItems($dataWeapons[1]) // 武器ID:1の所持数
* @option $gameParty.numItems($dataArmors[1]) // 防具ID:1の所持数
* @option $gameSystem.playtimeText() // プレイ時間
* @option $gameSystem.saveCount() // セーブ回数
* @option $gameSystem.battleCount() // 戦闘回数
* @parent menuHelpSettings
*
* @param rightBottomBlockAlign
* @text 右下の文字揃え
* @desc 右下に表示する値の文字配置を選択します。
* ※所持金の表示位置が「ヘルプウィンドウの右下」時は無効
* @default left
* @type select
* @option 左揃え
* @value left
* @option 中央揃え
* @value center
* @option 右揃え
* @value right
* @parent menuHelpSettings
*
* @param leftBottomBlockLabel
* @text 左下の項目名
* @desc 左下に表示する項目名です。
* ※設定するとメニュー説明文が表示されなくなります
* @default
* @type string
* @parent menuHelpSettings
*
* @param leftBottomBlockValue
* @text 左下の値
* @desc 左下に表示する値をスクリプトで記述します。
* ※設定するとメニュー説明文が表示されなくなります
* @default
* @type combo
* @option $gameVariables.value(1) // 変数ID:1の値
* @option $gameSwitches.value(1) ? "有効" : "無効" // スイッチID:1の状態
* @option $gameMap.displayName() // マップ名
* @option $gameParty.size() // パーティー人数
* @option $gameParty.steps() // 現在の歩数
* @option $gameParty.gold() // 所持金
* @option $gameParty.numItems($dataItems[1]) // アイテムID:1の所持数
* @option $gameParty.numItems($dataWeapons[1]) // 武器ID:1の所持数
* @option $gameParty.numItems($dataArmors[1]) // 防具ID:1の所持数
* @option $gameSystem.playtimeText() // プレイ時間
* @option $gameSystem.saveCount() // セーブ回数
* @option $gameSystem.battleCount() // 戦闘回数
* @parent menuHelpSettings
*
* @param leftBottomBlockAlign
* @text 左下の文字揃え
* @desc 左下に表示する値の文字配置を選択します。
* @default left
* @type select
* @option 左揃え
* @value left
* @option 中央揃え
* @value center
* @option 右揃え
* @value right
* @parent menuHelpSettings
*/
/*~struct~menuHelpTexts:
*
* @param symbol
* @text メニュー名
* @desc メニュー名を入力します。
* @type string
*
* @param helpText
* @text メニュー説明文
* @desc メニューの説明文を入力します。
* @type string
*/
/*~struct~backgroundImages:
*
* @param sceneName
* @text シーン名
* @desc 背景画像を設定するシーン名です。
* 独自で追加したシーン名を直接入力することもできます。
* @default Scene_Menu
* @type combo
* @option Scene_Menu
* @option Scene_Item
* @option Scene_Skill
* @option Scene_Equip
* @option Scene_Status
* @option Scene_Options
* @option Scene_Save
* @option Scene_Load
* @option Scene_GameEnd
*
* @param imageName
* @text 背景画像
* @desc 背景画像として表示する画像を選択してください。
* @dir img/system
* @type file
* @require 1
*/
(() => {
"use strict";
const pluginName = "LL_MenuScreenCustom";
const parameters = PluginManager.parameters(pluginName);
const leftInputMode = eval(parameters["leftInputMode"] || "true");
const numVisibleRows = Number(parameters["numVisibleRows"] || 2);
const maxCols = Number(parameters["maxCols"] || 2);
const currencyWindowPosition = String(parameters["currencyWindowPosition"] || "helpWindowRightBottom");
// 表示位置の設定
const actorNameLH = Number(parameters["actorNameLH"] || 0);
const actorLevelLH = Number(parameters["actorLevelLH"] || 1);
const actorIconLH = Number(parameters["actorIconLH"] || 2);
const actorClassLH = Number(parameters["actorClassLH"] || 3);
const actorGaugeLH = Number(parameters["actorGaugeLH"] || 4);
const lvPadding = Number(parameters["lvPadding"] || 84);
const gaugeWidth = Number(parameters["gaugeWidth"] || 128);
// 表示位置の設定(X)
const actorNameX = Number(parameters["actorNameX"] || 0);
const actorLevelX = Number(parameters["actorLevelX"] || 0);
const actorIconX = Number(parameters["actorIconX"] || 0);
const actorClassX = Number(parameters["actorClassX"] || 0);
const actorGaugeX = Number(parameters["actorGaugeX"] || 0);
// 立ち絵表示の設定
const showStandingPicture = eval(parameters["showStandingPicture"] || "true");
const menuWindowPictureX = Number(parameters["menuWindowPictureX"] || 0);
const menuWindowPictureY = Number(parameters["menuWindowPictureY"] || 0);
const menuWindowPictureScale = Number(parameters["menuWindowPictureScale"] || 100);
// ヘルプウィンドウの設定
const menuHelpWindowEnable = eval(parameters["menuHelpWindowEnable"] || "true");
const menuHelpTexts = JSON.parse(parameters["menuHelpTexts"] || "null");
const leftBlockLabel = String(parameters["leftBlockLabel"] || "");
const leftBlockValue = String(parameters["leftBlockValue"] || "");
const leftBlockAlign = String(parameters["leftBlockAlign"] || "left");
const rightBlockLabel = String(parameters["rightBlockLabel"] || "");
const rightBlockValue = String(parameters["rightBlockValue"] || "");
const rightBlockAlign = String(parameters["rightBlockAlign"] || "right");
const rightBottomBlockLabel = String(parameters["rightBottomBlockLabel"] || "");
const rightBottomBlockValue = String(parameters["rightBottomBlockValue"] || "");
const rightBottomBlockAlign = String(parameters["rightBottomBlockAlign"] || "left");
const leftBottomBlockLabel = String(parameters["leftBottomBlockLabel"] || "");
const leftBottomBlockValue = String(parameters["leftBottomBlockValue"] || "");
const leftBottomBlockAlign = String(parameters["leftBottomBlockAlign"] || "left");
// 背景画像の設定
const backgroundImages = JSON.parse(parameters["backgroundImages"] || "null");
let menuHelpLists = [];
if (menuHelpTexts) {
menuHelpTexts.forEach((elm) => {
menuHelpLists[String(JSON.parse(elm).symbol)] = String(JSON.parse(elm).helpText);
});
}
let backgroundImageLists = [];
if (backgroundImages) {
backgroundImages.forEach((elm) => {
backgroundImageLists.push(JSON.parse(elm));
});
}
// メニュー画面ヘルプウィンドウの標準高さ (lineHeight)
let menuHelpWindowLH = 1.5;
// ヘルプウィンドウフォントサイズ
const menuHelpWindowFontSize = 22;
const _Scene_MenuBase_createBackground = Scene_MenuBase.prototype.createBackground;
Scene_MenuBase.prototype.createBackground = function() {
let sceneName = SceneManager._scene.constructor.name;
// 背景画像を検索
let originalBackgroundImage = backgroundImageLists.find(function(item) {
if (String(item.sceneName) == sceneName) return true;
});
if (originalBackgroundImage) {
// 独自の背景画像を表示
this._backgroundSprite = new Sprite();
this._backgroundSprite.bitmap = ImageManager.loadSystem(originalBackgroundImage.imageName);
this.addChild(this._backgroundSprite);
return;
}
_Scene_MenuBase_createBackground.apply(this, arguments);
};
// ヘルプウィンドウの高さを定義
Scene_MenuBase.prototype.calcMenuHelpWindowHeight = function() {
let height = this.calcWindowHeight(menuHelpWindowLH, false);
if (!leftBlockLabel && !rightBlockLabel) height = this.calcWindowHeight(1, false);
if (!menuHelpWindowEnable) height = 0;
return height;
};
Scene_Menu.prototype.isRightInputMode = function() {
return !leftInputMode;
};
Scene_MenuBase.prototype.createCancelButton = function() {
this._cancelButton = new Sprite_Button("cancel");
this._cancelButton.x = leftInputMode ? 4 : Graphics.boxWidth - this._cancelButton.width - 4;
this._cancelButton.y = this.buttonY();
this.addWindow(this._cancelButton);
};
Scene_MenuBase.prototype.createPageButtons = function() {
this._pageupButton = new Sprite_Button("pageup");
this._pagedownButton = new Sprite_Button("pagedown");
if (leftInputMode) {
this._pageupButton.x = Graphics.boxWidth - this._pageupButton.width - this._pagedownButton.width - 8;
} else {
this._pageupButton.x = 4;
}
this._pageupButton.y = this.buttonY();
const pageupRight = this._pageupButton.x + this._pageupButton.width;
this._pagedownButton.x = pageupRight + 4;
this._pagedownButton.y = this.buttonY();
this.addWindow(this._pageupButton);
this.addWindow(this._pagedownButton);
this._pageupButton.setClickHandler(this.previousActor.bind(this));
this._pagedownButton.setClickHandler(this.nextActor.bind(this));
};
const _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
_Scene_Menu_create.apply(this, arguments);
this.createMenuHelpWindow();
if (currencyWindowPosition != "menuCommandBottom") {
this._goldWindow.visible = false;
}
};
Scene_Menu.prototype.commandWindowRect = function() {
const ww = this.mainCommandWidth();
let wh = this.mainAreaHeight() - this.menuHelpWindowRect().height - this.goldWindowRect().height;
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
const wy = this.mainAreaTop() + this.menuHelpWindowRect().height;
if (currencyWindowPosition != "menuCommandBottom") {
wh += this.goldWindowRect().height
}
return new Rectangle(wx-10, wy, ww-60, wh-10);
};
Scene_Menu.prototype.goldWindowRect = function() {
const ww = this.mainCommandWidth();
const wh = this.calcWindowHeight(1, true);
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
const wy = this.mainAreaBottom() - wh;
return new Rectangle(wx-70, wy-6, ww, wh);
};
Scene_Menu.prototype.statusWindowRect = function() {
const ww = Graphics.boxWidth - this.mainCommandWidth();
const wh = this.mainAreaHeight() - this.menuHelpWindowRect().height;
const wx = this.isRightInputMode() ? 0 : Graphics.boxWidth - ww;
const wy = this.mainAreaTop() + this.menuHelpWindowRect().height;
return new Rectangle(wx, wy+10, ww-120, wh-20);
};
Scene_Menu.prototype.createMenuHelpWindow = function() {
const rect = this.menuHelpWindowRect();
this._menuHelpWindow = new Window_MenuHelp(rect);
this.addWindow(this._menuHelpWindow);
};
Scene_Menu.prototype.menuHelpWindowRect = function() {
const wx = 0;
const wy = this.mainAreaTop();
const ww = Graphics.boxWidth;
const wh = this.calcMenuHelpWindowHeight();
return new Rectangle(wx+100, wy-10, ww-100, wh);
};
const _Scene_Menu_update = Scene_Menu.prototype.update;
Scene_Menu.prototype.update = function() {
_Scene_Menu_update.apply(this, arguments);
// インフォメーションウィンドウの更新
const helpText = menuHelpLists[this._commandWindow.currentName()] ? menuHelpLists[this._commandWindow.currentName()] : "";
this._menuHelpWindow.setText(helpText);
};
Scene_ItemBase.prototype.actorWindowRect = function() {
const wx = 0;
const wy = Math.min(this.mainAreaTop(), this.helpAreaTop());
const ww = Graphics.boxWidth - this.mainCommandWidth();
const wh = Graphics.boxHeight - this.buttonAreaHeight() - this.calcMenuHelpWindowHeight();
return new Rectangle(wx, wy, ww, wh);
};
// Get Current Name
Window_Command.prototype.currentName = function() {
return this.currentData() ? this.currentData().name : null;
};
// ウィンドウ内に立ち絵を描画
Window_StatusBase.prototype.drawStandingPicture = function(
pictureName, x, y, width, height, sx, sy, scaleX, scaleY
) {
width = width || 200;
height = height || 200;
sx = sx || 0;
sy = sy || 0;
const bitmap = ImageManager.loadPicture(pictureName);
const pw = width;
const ph = height;
let sw = Math.min(width, pw);
let sh = Math.min(height, ph);
let dx = Math.floor(x + Math.max(width - pw, 0) / 2);
let dy = Math.floor(y + Math.max(height - ph, 0) / 2);
let dw = Math.min(width, pw);
let dh = Math.min(height, ph);
// for iOS Safari
if (sx < 0) {
dx += sx * -1 * scaleX;
sw -= sx * -1 * scaleX;
dw -= sx * -1 * scaleX;
sx = 0;
}
if (sy < 0) {
dy += sy * -1 * scaleY;
sh -= sy * -1 * scaleY;
dh -= sy * -1 * scaleY;
sy = 0;
}
bitmap.addLoadListener(function() {
this.contents.blt(bitmap, sx, sy, sw / scaleX, sh / scaleY, dx, dy, dw, dh);
}.bind(this));
};
Window_StatusBase.prototype.exDrawActorSimpleStatus = function(actor, x, y, width) {
const lineHeight = this.lineHeight();
if (actorNameLH > -1) this.drawActorName(actor, x + actorNameX, y + lineHeight * actorNameLH, width - actorNameX);
if (actorLevelLH > -1 && $gameSwitches.value(102)) {
this.drawActorLevel(actor, x + actorLevelX, y + lineHeight * actorLevelLH);
}
if (actorIconLH > -1) this.drawActorIcons(actor, x + actorIconX, y + lineHeight * actorIconLH, width - actorIconX);
if (actorClassLH > -1) this.drawActorClass(actor, x + actorClassX, y + lineHeight * actorClassLH, width - actorClassX);
if (actorGaugeLH > -1) this.placeBasicGauges(actor, x + actorGaugeX, y + lineHeight * actorGaugeLH);
};
Window_MenuStatus.prototype.drawItemImage = function(index) {
const actor = this.actor(index);
const rect = this.itemRect(index);
this.changePaintOpacity(actor.isBattleMember());
// 立ち絵 or 顔グラフィック描画
let mPicture = ExMenuScreenBase.getImageName(actor.actorId());
if (mPicture && showStandingPicture) {
const width = rect.width - 2;
const height = rect.height - 2;
const x = rect.x + 1;
const y = rect.y + 1;
const sx = (Number(mPicture.x) + menuWindowPictureX) * -1;
const sy = (Number(mPicture.y) + menuWindowPictureY) * -1;
let scaleX = Number(mPicture.scaleX) / 100;
let scaleY = Number(mPicture.scaleY) / 100;
// 拡大率を適用
scaleX *= menuWindowPictureScale / 100;
scaleY *= menuWindowPictureScale / 100;
// ピンチ判定
if (ExMenuScreenBase.getHpRate(actor.actorId()) > Number(mPicture.pinchPercentage) || !mPicture.pinchImageName) {
// 通常
this.drawStandingPicture(String(mPicture.imageName), x, y, width, height, sx, sy, scaleX, scaleY);
} else {
// ピンチ
this.drawStandingPicture(String(mPicture.pinchImageName), x, y, width, height, sx, sy, scaleX, scaleY);
}
} else {
let width = ImageManager.faceWidth;
// 横幅が小さい場合、横幅に合わせてトリミング
if (rect.width - 2 < width) {
width = rect.width - 2;
}
const height = rect.height - 2;
const x = rect.x + rect.width - width - 1;
const y = rect.y + 1;
this.drawActorFace(actor, x, y, width, height);
}
this.changePaintOpacity(true);
};
Window_MenuStatus.prototype.drawItemStatus = function(index) {
const actor = this.actor(index);
const rect = this.itemRect(index);
const x = rect.x + 2;
const y = rect.y + 2;
const width = rect.width - 4;
// 画像キャッシュ判定
const mPicture = ExMenuScreenBase.getImageName(actor.actorId());
if (mPicture && showStandingPicture) {
let pictureName = null;
// ピンチ判定 (旧Ver.互換用)
if (ExMenuScreenBase.getHpRate(actor.actorId()) > Number(mPicture.pinchPercentage) || !mPicture.pinchImageName) {
pictureName = String(mPicture.imageName);
} else {
pictureName = String(mPicture.pinchImageName);
}
const bitmap = ImageManager.loadPicture(pictureName);
bitmap.addLoadListener(function() {
this.exDrawActorSimpleStatus(actor, x, y, width);
}.bind(this));
} else {
this.exDrawActorSimpleStatus(actor, x, y, width);
}
};
Window_MenuStatus.prototype.numVisibleRows = function() {
return numVisibleRows;
};
Window_MenuStatus.prototype.maxCols = function() {
return maxCols;
};
Window_MenuStatus.prototype.drawActorLevel = function(actor, x, y) {
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.levelA, x, y, 48);
this.resetTextColor();
this.drawText(actor.level, x + lvPadding, y, 36, "right");
};
Window_MenuStatus.prototype.refreshCursorForAll = function() {
const maxItems = this.maxItems();
if (maxItems > 0) {
const rect = this.itemRect(0);
// 独自に最大数を計算
let maxRectCnt = maxItems;
if (maxRectCnt > maxCols) {
maxRectCnt = Math.ceil(maxRectCnt / maxCols) * maxCols;
}
rect.enlarge(this.itemRect(maxRectCnt - 1));
this.setCursorRect(rect.x, rect.y, rect.width, rect.height);
} else {
this.setCursorRect(0, 0, 0, 0);
}
};
//-----------------------------------------------------------------------------
// Window_MenuHelp
//
function Window_MenuHelp() {
this.initialize(...arguments);
}
Window_MenuHelp.prototype = Object.create(Window_Base.prototype);
Window_MenuHelp.prototype.constructor = Window_MenuHelp;
Window_MenuHelp.prototype.initialize = function(rect) {
Window_Base.prototype.initialize.call(this, rect);
this.refresh();
};
Window_MenuHelp.prototype.setText = function(text) {
this._text = text;
this.refresh();
};
Window_MenuHelp.prototype.clear = function() {
this.setText("");
};
Window_MenuHelp.prototype.refresh = function() {
this.contents.clear();
this.contents.fontSize = this.getFontSize();
// マップ名
this.drawLeftBlock();
// プレイ時間
this.drawRightBlock();
// 所持金
this.drawCurrency();
// メニューヘルプ
this.drawMenuHelp();
this.contents.fontSize = $gameSystem.mainFontSize();
};
Window_MenuHelp.prototype.getFontSize = function() {
return !leftBlockLabel && !rightBlockLabel ? $gameSystem.mainFontSize() : menuHelpWindowFontSize;
};
Window_MenuHelp.prototype.drawLeftBlock = function() {
if (!leftBlockLabel) return;
const y = -6;
const oneThirdWidth = Math.floor(this.innerWidth / 3);
this.changeTextColor(this.systemColor());
this.drawText(leftBlockLabel, 0, y, this.contents.measureTextWidth(leftBlockLabel), leftBlockAlign);
this.resetTextColor();
this.drawText(eval(leftBlockValue), this.contents.measureTextWidth(leftBlockLabel), y, oneThirdWidth * 1.5 - this.contents.measureTextWidth(leftBlockLabel), leftBlockAlign);
};
Window_MenuHelp.prototype.drawRightBlock = function() {
if (!rightBlockLabel) return;
const y = -6;
const oneThirdWidth = Math.floor(this.innerWidth / 3);
this.changeTextColor(this.systemColor());
this.drawText(rightBlockLabel, oneThirdWidth * 1.5, y, this.contents.measureTextWidth(rightBlockLabel), rightBlockAlign);
this.resetTextColor();
this.drawText(eval(rightBlockValue), this.contents.measureTextWidth(rightBlockLabel) + oneThirdWidth * 1.5, y, oneThirdWidth * 1.5 - this.contents.measureTextWidth(rightBlockLabel), rightBlockAlign);
};
Window_MenuHelp.prototype.drawCurrency = function() {
const y = !leftBlockLabel && !rightBlockLabel ? 0 : 24;
const oneThirdWidth = Math.floor(this.innerWidth / 3);
if (currencyWindowPosition == "helpWindowRightBottom") {
// 所持金の表示位置が「ヘルプウィンドウの右下」の場合、所持金を描画
const currencyUnit = TextManager.currencyUnit;
this.drawCurrencyValue($gameParty.gold(), currencyUnit, oneThirdWidth * 1.5, y, oneThirdWidth * 1.5);
} else {
// それ以外の場合、独自の項目を描画
if (!rightBottomBlockLabel) return;
this.changeTextColor(this.systemColor());
this.drawText(rightBottomBlockLabel, oneThirdWidth * 1.5, y, this.contents.measureTextWidth(rightBottomBlockLabel), rightBottomBlockAlign);
this.resetTextColor();
this.drawText(eval(rightBottomBlockValue), this.contents.measureTextWidth(rightBottomBlockLabel) + oneThirdWidth * 1.5, y, oneThirdWidth * 1.5 - this.contents.measureTextWidth(rightBottomBlockLabel), rightBottomBlockAlign);
}
};
Window_MenuHelp.prototype.drawMenuHelp = function() {
const y = !leftBlockLabel && !rightBlockLabel ? 0 : 24;
const oneThirdWidth = Math.floor(this.innerWidth / 3);
if (leftBottomBlockLabel != "") {
// 左下に独自の項目を表示する場合 (v1.4.0)
this.changeTextColor(this.systemColor());
this.drawText(leftBottomBlockLabel, 0, y, this.contents.measureTextWidth(leftBottomBlockLabel), leftBottomBlockAlign);
this.resetTextColor();
this.drawText(eval(leftBottomBlockValue), this.contents.measureTextWidth(leftBottomBlockLabel), y, oneThirdWidth * 1.5 - this.contents.measureTextWidth(leftBottomBlockLabel), leftBottomBlockAlign);
} else {
// メニューヘルプを表示
this.resetTextColor();
this.drawText(this._text ? this._text : "", 0, y, this.innerWidth - oneThirdWidth * 1.5, leftBottomBlockAlign);
}
};
// ゲージ幅調整機能 (v1.3.0)
const _Window_StatusBase_placeGauge = Window_StatusBase.prototype.placeGauge;
Window_StatusBase.prototype.placeGauge = function(actor, type, x, y) {
// メニュー画面トップおよび対象アクター選択画面のみ適用
if (this.constructor.name === "Window_MenuStatus" || this.constructor.name === "Window_MenuActor") {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugeExMenuBase);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
} else {
_Window_StatusBase_placeGauge.apply(this, arguments);
}
};
//-----------------------------------------------------------------------------
// Sprite_GaugeExMenuBase
//
// ゲージ幅調整用のゲージスプライトを新規定義します。
function Sprite_GaugeExMenuBase() {
this.initialize(...arguments);
}
Sprite_GaugeExMenuBase.prototype = Object.create(Sprite_Gauge.prototype);
Sprite_GaugeExMenuBase.prototype.constructor = Sprite_GaugeExMenuBase;
Sprite_GaugeExMenuBase.prototype.bitmapWidth = function() {
return gaugeWidth;
};
})();
|