设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4858|回复: 19
打印 上一主题 下一主题

[有事请教] 想在插件中加一个变量

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9059
在线时间
1934 小时
注册时间
2016-6-19
帖子
364
跳转到指定楼层
1
发表于 2019-2-1 13:57:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题,不知在正则表达式后边加变量是否会出错

        var notetagsLoaded = false;
        var _DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
        DataManager.isDatabaseLoaded = function() {
            if(!_DataManager_isDatabaseLoaded.call(this)) return false;
            if(!notetagsLoaded) {
                    for(var i = 1; i < $dataActors.length; i++) {
                            if($dataActors.note.match(/<Menu\s*Bust\s*:\s*(.*)\s*>/im)) {
                                    $dataActors.ams_bs_bust = RegExp.$1 + $gameVariables.value(100 + i);
                            }
                            if($dataActors.note.match(/<Menu\s*Bust\s*X\s*:\s*(.*)\s*>/im)) {
                                    $dataActors.ams_bs_x = parseInt(RegExp.$1);
                            }
                            if($dataActors.note.match(/<Menu\s*Bust\s*Y\s*:\s*(.*)\s*>/im)) {
                                    $dataActors.ams_bs_y = parseInt(RegExp.$1);
                            }
                    }
                    notetagsLoaded = true;
            }
            return true;
        };

这样做会爆出Cannot read property 'value' of null,但在插件中其他地方加变量则不会,希望能帮忙解惑。

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21716
在线时间
9423 小时
注册时间
2012-6-19
帖子
7119

开拓者短篇九导演组冠军

2
发表于 2019-2-1 14:38:02 | 只看该作者
猜测是 $gameVariables 还未初始化

  1. if ($gameVariables){
  2.   $dataActors.ams_bs_bust = RegExp.$1 + $gameVariables.value(100 + i);
  3. }else{
  4.   $dataActors.ams_bs_bust = RegExp.$1
  5. }
复制代码

点评

是的,刚刚也想到这点,我这就去试下~  发表于 2019-2-1 14:39
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9059
在线时间
1934 小时
注册时间
2016-6-19
帖子
364
3
 楼主| 发表于 2019-2-1 14:50:48 | 只看该作者
本帖最后由 康姆图帕帕 于 2019-2-1 14:58 编辑
喵呜喵5 发表于 2019-2-1 14:38
猜测是 $gameVariables 还未初始化


汗,这回根本不报错了,似乎是因为 if($dataActors.note.match(/<Menu\s*Bust\s*:\s*(.*)\s*>/im)) 这条不知怎么失效了,导致 $dataActors.ams_bs_bust 没被赋值

------------------------------------------------
等等,我搞错了个地方
------------------------------------------------
不行了 ,这条变量的if用处不大,因为即使后面载入了Game_Variables,也不会回来再判断一次。虽然能够防止报错,但别想把变量的值赋给$dataActors.ams_bs_bust
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21716
在线时间
9423 小时
注册时间
2012-6-19
帖子
7119

开拓者短篇九导演组冠军

4
发表于 2019-2-1 16:19:03 | 只看该作者
那就简单了啊,把这代码删了

进入游戏后直接
  1. $dataActors.ams_bs_bust = $dataActors.ams_bs_bust + $gameVariables.value(100 + i)
复制代码
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9059
在线时间
1934 小时
注册时间
2016-6-19
帖子
364
5
 楼主| 发表于 2019-2-1 17:26:38 | 只看该作者
本帖最后由 康姆图帕帕 于 2019-2-1 18:07 编辑
喵呜喵5 发表于 2019-2-1 16:19
那就简单了啊,把这代码删了

进入游戏后直接


呃,怎样使这条脚本重复使用呢?
因为只有变量 100+i 是需要控制的,前面的 $dataActors.ams_bs_bust 不随变量变化,而重复上面这条脚本会在 $dataActors.ams_bs_bust 后面无限添加变量字符...
然后file01,file02,file03就都变成了file0000...000n
自己想了半天想不到方法,只好再来求助了

-------------------------------------

都解决了,最终达成了想要的效果,谢过大侠了~
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

6
发表于 2019-2-1 21:07:10 | 只看该作者
为什么你要给$dataActors这数据库设变量啊。
修改数据库不是好办法
而且重启游戏就没了
你在游戏里用$gameVariables不行吗
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9059
在线时间
1934 小时
注册时间
2016-6-19
帖子
364
7
 楼主| 发表于 2019-2-1 22:35:56 | 只看该作者
本帖最后由 康姆图帕帕 于 2019-2-1 22:44 编辑
yang1zhi 发表于 2019-2-1 21:07
为什么你要给$dataActors这数据库设变量啊。
修改数据库不是好办法
而且重启游戏就没了


其实是SRD的一个菜单插件,在角色的note区里加参数来显示半身绘。
但是它的参数写得挺死的,每个角色固定用一个绘图,所以我想加入变量来接管图片的调用
p.s.这个插件是依次加载每个$dataActor.note,然后用的loadbitmap(),就很难受

---------------------------
至于重启的话,我试试那个加载游戏后运行公共事件的插件,应该就能解决了~

点评

嗯,大概可以在$gameActors里加个actorBustImage吧,不过本人实力所限实在没信心XD  发表于 2019-2-2 07:29
你可以加到角色身上,不建议直接修改数据库。数据库是用来开发的,不适合做游戏内变化。  发表于 2019-2-1 22:54
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
36499
在线时间
10811 小时
注册时间
2009-3-15
帖子
4816
8
发表于 2019-2-1 23:29:42 | 只看该作者
本帖最后由 soulsaga 于 2019-2-1 23:36 编辑

我觉得脚本发错了..应该不是在这里改..这里根本是开始游戏前的..建议从菜单着手..

点评

你可以发下脚本看看吗..  发表于 2019-2-2 09:30
所以我觉得SRD这个参数写得有些死了,它就是读取的$dataActor.note,后面紧跟着的就是loadBitmap,我也只能望洋兴叹- -  发表于 2019-2-2 07:32
回复 支持 1 反对 0

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9059
在线时间
1934 小时
注册时间
2016-6-19
帖子
364
9
 楼主| 发表于 2019-2-2 10:55:47 | 只看该作者
本帖最后由 康姆图帕帕 于 2019-2-2 10:59 编辑
soulsaga 发表于 2019-2-1 23:29
我觉得脚本发错了..应该不是在这里改..这里根本是开始游戏前的..建议从菜单着手.. ...


JAVASCRIPT 代码复制
  1. /*:
  2.  * @plugindesc Alternative Menu Screen Bust and Icons. Shows busts for the Actor and Icons for the commands! WOWOWOWOWOW!!!
  3.  * @author SumRndmDde
  4.  *
  5.  * @param Item Icon
  6.  * @desc The icon index of the icon used for the "Item" choice.
  7.  * Right-click and press "IconSet Viewer".
  8.  * @default 176
  9.  *
  10.  * @param Skill Icon
  11.  * @desc The icon index of the icon used for the "Skill" choice.
  12.  * Right-click and press "IconSet Viewer".
  13.  * @default 64
  14.  *
  15.  * @param Equip Icon
  16.  * @desc The icon index of the icon used for the "Equip" choice.
  17.  * Right-click and press "IconSet Viewer".
  18.  * @default 96
  19.  *
  20.  * @param Status Icon
  21.  * @desc The icon index of the icon used for the "Status" choice.
  22.  * Right-click and press "IconSet Viewer".
  23.  * @default 87
  24.  *
  25.  * @param Formation Icon
  26.  * @desc The icon index of the icon used for the "Formation" choice.
  27.  * Right-click and press "IconSet Viewer".
  28.  * @default 82
  29.  *
  30.  * @param Options Icon
  31.  * @desc The icon index of the icon used for the "Options" choice.
  32.  * Right-click and press "IconSet Viewer".
  33.  * @default 83
  34.  *
  35.  * @param Save Icon
  36.  * @desc The icon index of the icon used for the "Save" choice.
  37.  * Right-click and press "IconSet Viewer".
  38.  * @default 225
  39.  *
  40.  * @param Game End Icon
  41.  * @desc The icon index of the icon used for the "Game End" choice.
  42.  * Right-click and press "IconSet Viewer".
  43.  * @default 245
  44.  *
  45.  * @param == Bust Position ==
  46.  * @default
  47.  *
  48.  * @param Bust X Pos
  49.  * @desc By default, the busts are positioned at (0, 0). Using this Parameter, all the busts' default X positions can be set.
  50.  * @default 0
  51.  *
  52.  * @param Bust Y Pos
  53.  * @desc By default, the busts are positioned at (0, 0). Using this Parameter, all the busts' default X positions can be set.
  54.  * @default 0
  55.  *
  56.  * @param == Bust Window ==
  57.  * @default
  58.  *
  59.  * @param Status Background
  60.  * @desc The RGBA color for the background of the information for each Actor.
  61.  * @default rgba(0, 0, 0, 0.6)
  62.  *
  63.  * @param Show TP?
  64.  * @desc Set this to 'true', and TP bars will be shown in the menu.
  65.  * @default false
  66.  *
  67.  * @param == Icon Window ==
  68.  * @default
  69.  *
  70.  * @param Icon Window X
  71.  * @desc The X position of the command (icons) window.
  72.  * Can be Number or JavaScript evaluation.
  73.  * @default (Graphics.boxWidth / 2) - (this._commandWindow.width / 2)
  74.  *
  75.  * @param Icon Window Y
  76.  * @desc The Y position of the command (icons) window.
  77.  * Can be Number or JavaScript evaluation.
  78.  * @default this._commandLabel.y + this._commandLabel.height
  79.  *
  80.  * @param Standard Padding
  81.  * @desc The amount of space around the border of the window.
  82.  * Default is 12.
  83.  * @default 12
  84.  *
  85.  * @param Icon Padding
  86.  * @desc The amount of space around the icon, but still highlighed.
  87.  * Default is 12.
  88.  * @default 12
  89.  *
  90.  * @param Icon X Position
  91.  * @desc The X position of each icon in the "button".
  92.  * Default is 0.
  93.  * @default 0
  94.  *
  95.  * @param Icon Y Position
  96.  * @desc The Y position of each icon in the "button".
  97.  * Default is 6.
  98.  * @default 6
  99.  *
  100.  * @param == Label Window ==
  101.  * @default
  102.  *
  103.  * @param Label Window X
  104.  * @desc The X position of the label window.
  105.  * Can be Number or JavaScript evaluation.
  106.  * @default (Graphics.boxWidth / 2) - (this._commandLabel.width / 2)
  107.  *
  108.  * @param Label Window Y
  109.  * @desc The Y position of the label window.
  110.  * Can be Number or JavaScript evaluation.
  111.  * @default 0
  112.  *
  113.  * @param Label Alignment
  114.  * @desc The alignment of the label text.
  115.  * Choices are: Left, Right, or Center
  116.  * @default Center
  117.  *
  118.  * @param == Gold Window ==
  119.  * @default
  120.  *
  121.  * @param Gold Window X
  122.  * @desc This is the x position of the HP Window.
  123.  * Can be a Number or JavaScript eval.
  124.  * @default 0
  125.  *
  126.  * @param Gold Window Y
  127.  * @desc This is the x position of the HP Window.
  128.  * Can be a Number or JavaScript eval.
  129.  * @default Graphics.boxHeight - this._goldWindow.height
  130.  *
  131.  * @param == Custom Commands ==
  132.  * @default
  133.  *
  134.  * @param Command Symbol 1
  135.  * @desc The symbol of the command that will have Command Icon 1.
  136.  * The order it's listed in the Parameters is irrelevant.
  137.  * @default
  138.  *
  139.  * @param Command Icon 1
  140.  * @desc The icon of the command that will have Command Icon 1.
  141.  * The order it's listed in the Parameters is irrelevant.
  142.  * @default
  143.  *
  144.  * @param Command Symbol 2
  145.  * @desc The symbol of the command that will have Command Icon 2.
  146.  * The order it's listed in the Parameters is irrelevant.
  147.  * @default
  148.  *
  149.  * @param Command Icon 2
  150.  * @desc The icon of the command that will have Command Icon 2.
  151.  * The order it's listed in the Parameters is irrelevant.
  152.  * @default
  153.  *
  154.  * @param Command Symbol 3
  155.  * @desc The symbol of the command that will have Command Icon 3.
  156.  * The order it's listed in the Parameters is irrelevant.
  157.  * @default
  158.  *
  159.  * @param Command Icon 3
  160.  * @desc The icon of the command that will have Command Icon 3.
  161.  * The order it's listed in the Parameters is irrelevant.
  162.  * @default
  163.  *
  164.  * @param Command Symbol 4
  165.  * @desc The symbol of the command that will have Command Icon 4.
  166.  * The order it's listed in the Parameters is irrelevant.
  167.  * @default
  168.  *
  169.  * @param Command Icon 4
  170.  * @desc The icon of the command that will have Command Icon 4.
  171.  * The order it's listed in the Parameters is irrelevant.
  172.  * @default
  173.  *
  174.  * @param Command Symbol 5
  175.  * @desc The symbol of the command that will have Command Icon 5.
  176.  * The order it's listed in the Parameters is irrelevant.
  177.  * @default
  178.  *
  179.  * @param Command Icon 5
  180.  * @desc The icon of the command that will have Command Icon 5.
  181.  * The order it's listed in the Parameters is irrelevant.
  182.  * @default
  183.  *
  184.  * @param Command Symbol 6
  185.  * @desc The symbol of the command that will have Command Icon 6.
  186.  * The order it's listed in the Parameters is irrelevant.
  187.  * @default
  188.  *
  189.  * @param Command Icon 6
  190.  * @desc The icon of the command that will have Command Icon 6.
  191.  * The order it's listed in the Parameters is irrelevant.
  192.  * @default
  193.  *
  194.  * @param Command Symbol 7
  195.  * @desc The symbol of the command that will have Command Icon 7.
  196.  * The order it's listed in the Parameters is irrelevant.
  197.  * @default
  198.  *
  199.  * @param Command Icon 7
  200.  * @desc The icon of the command that will have Command Icon 7.
  201.  * The order it's listed in the Parameters is irrelevant.
  202.  * @default
  203.  *
  204.  * @param Command Symbol 8
  205.  * @desc The symbol of the command that will have Command Icon 8.
  206.  * The order it's listed in the Parameters is irrelevant.
  207.  * @default
  208.  *
  209.  * @param Command Icon 8
  210.  * @desc The icon of the command that will have Command Icon 8.
  211.  * The order it's listed in the Parameters is irrelevant.
  212.  * @default
  213.  *
  214.  * @param Command Symbol 9
  215.  * @desc The symbol of the command that will have Command Icon 9.
  216.  * The order it's listed in the Parameters is irrelevant.
  217.  * @default
  218.  *
  219.  * @param Command Icon 9
  220.  * @desc The icon of the command that will have Command Icon 9.
  221.  * The order it's listed in the Parameters is irrelevant.
  222.  * @default
  223.  *
  224.  * @param Command Symbol 10
  225.  * @desc The symbol of the command that will have Command Icon 10.
  226.  * The order it's listed in the Parameters is irrelevant.
  227.  * @default
  228.  *
  229.  * @param Command Icon 10
  230.  * @desc The icon of the command that will have Command Icon 10.
  231.  * The order it's listed in the Parameters is irrelevant.
  232.  * @default
  233.  *
  234.  * @param Command Symbol 11
  235.  * @desc The symbol of the command that will have Command Icon 11.
  236.  * The order it's listed in the Parameters is irrelevant.
  237.  * @default
  238.  *
  239.  * @param Command Icon 11
  240.  * @desc The icon of the command that will have Command Icon 11.
  241.  * The order it's listed in the Parameters is irrelevant.
  242.  * @default
  243.  *
  244.  * @param Command Symbol 12
  245.  * @desc The symbol of the command that will have Command Icon 12.
  246.  * The order it's listed in the Parameters is irrelevant.
  247.  * @default
  248.  *
  249.  * @param Command Icon 12
  250.  * @desc The icon of the command that will have Command Icon 12.
  251.  * The order it's listed in the Parameters is irrelevant.
  252.  * @default
  253.  *
  254.  * @param Command Symbol 13
  255.  * @desc The symbol of the command that will have Command Icon 13.
  256.  * The order it's listed in the Parameters is irrelevant.
  257.  * @default
  258.  *
  259.  * @param Command Icon 13
  260.  * @desc The icon of the command that will have Command Icon 13.
  261.  * The order it's listed in the Parameters is irrelevant.
  262.  * @default
  263.  *
  264.  * @param Command Symbol 14
  265.  * @desc The symbol of the command that will have Command Icon 14.
  266.  * The order it's listed in the Parameters is irrelevant.
  267.  * @default
  268.  *
  269.  * @param Command Icon 14
  270.  * @desc The icon of the command that will have Command Icon 14.
  271.  * The order it's listed in the Parameters is irrelevant.
  272.  * @default
  273.  *
  274.  * @param Command Symbol 15
  275.  * @desc The symbol of the command that will have Command Icon 15.
  276.  * The order it's listed in the Parameters is irrelevant.
  277.  * @default
  278.  *
  279.  * @param Command Icon 15
  280.  * @desc The icon of the command that will have Command Icon 15.
  281.  * The order it's listed in the Parameters is irrelevant.
  282.  * @default
  283.  *
  284.  * @param Command Symbol 16
  285.  * @desc The symbol of the command that will have Command Icon 16.
  286.  * The order it's listed in the Parameters is irrelevant.
  287.  * @default
  288.  *
  289.  * @param Command Icon 16
  290.  * @desc The icon of the command that will have Command Icon 16.
  291.  * The order it's listed in the Parameters is irrelevant.
  292.  * @default
  293.  *
  294.  * @param Command Symbol 17
  295.  * @desc The symbol of the command that will have Command Icon 17.
  296.  * The order it's listed in the Parameters is irrelevant.
  297.  * @default
  298.  *
  299.  * @param Command Icon 17
  300.  * @desc The icon of the command that will have Command Icon 17.
  301.  * The order it's listed in the Parameters is irrelevant.
  302.  * @default
  303.  *
  304.  * @param Command Symbol 18
  305.  * @desc The symbol of the command that will have Command Icon 18.
  306.  * The order it's listed in the Parameters is irrelevant.
  307.  * @default
  308.  *
  309.  * @param Command Icon 18
  310.  * @desc The icon of the command that will have Command Icon 18.
  311.  * The order it's listed in the Parameters is irrelevant.
  312.  * @default
  313.  *
  314.  * @param Command Symbol 19
  315.  * @desc The symbol of the command that will have Command Icon 19.
  316.  * The order it's listed in the Parameters is irrelevant.
  317.  * @default
  318.  *
  319.  * @param Command Icon 19
  320.  * @desc The icon of the command that will have Command Icon 19.
  321.  * The order it's listed in the Parameters is irrelevant.
  322.  * @default
  323.  *
  324.  * @param Command Symbol 20
  325.  * @desc The symbol of the command that will have Command Icon 20.
  326.  * The order it's listed in the Parameters is irrelevant.
  327.  * @default
  328.  *
  329.  * @param Command Icon 20
  330.  * @desc The icon of the command that will have Command Icon 20.
  331.  * The order it's listed in the Parameters is irrelevant.
  332.  * @default
  333.  *
  334.  * @help
  335.  *
  336.  *
  337.  * Alternative Menu Screen: Bust + Icons
  338.  * Version 1.01
  339.  * SumRndmDde
  340.  *
  341.  *
  342.  * This is a combination of the Bust and Icon menus.
  343.  *
  344.  * The command window now uses Icons and the Actor Window uses Busts.
  345.  *
  346.  * Use the Parameters to manipualte the positions and other aspects
  347.  * of the Windows.
  348.  *
  349.  *
  350.  * ==========================================================================
  351.  *  How to Set Up Bust Images
  352.  * ==========================================================================
  353.  *
  354.  * In order to set the Bust Image for each Actor,
  355.  * use the following Notetags in the Notebox of the Actor:
  356.  *
  357.  *  <Menu Bust: filename>
  358.  *
  359.  * Input the filename of the image file you wish to use
  360.  * for this Actor's Bust Image.
  361.  *
  362.  * The image MUST be stored in:
  363.  * img/SumRndmDde/menu
  364.  *
  365.  *
  366.  * ==========================================================================
  367.  *  How to Set Custom Offsets for Bust Images
  368.  * ==========================================================================
  369.  *
  370.  * The following are optional notetags.
  371.  * Use the following to set the X and Y of the Bust (inside Actor Note):
  372.  *
  373.  *  <Menu Bust X: number>
  374.  *  <Menu Bust Y: number>
  375.  *
  376.  * By default, the bust image is set to the coordinates in the Parameters,
  377.  * but these Notetags can set the specific bust image of the Actor to a
  378.  * different position if it looks a little off center.
  379.  *
  380.  *
  381.  * ==========================================================================
  382.  * How to Set Icons
  383.  * ==========================================================================
  384.  *
  385.  * You can manipulate the Icons used by using the Parameters at the top
  386.  * of the list.
  387.  *
  388.  * You should definitely use "Iconset Viewer" to find the Icon you wish
  389.  * to use.
  390.  *
  391.  *
  392.  * ==========================================================================
  393.  *  Setting up Icons for Custom Commands
  394.  * ==========================================================================
  395.  *
  396.  * At the very bottom of the Parameter list, there are places available
  397.  * for inputting Icons for custom commands.
  398.  *
  399.  * You need to first provide the "symbol" of the command.
  400.  * (A symbol is usually a word. For example, the symbol for the Debug
  401.  * Command added by Yanfly's Main Menu Manager is "debug" (without quotes))
  402.  *
  403.  * Then, after you have done so, you can place the Icon Index in the
  404.  * proceeding Parameter.
  405.  *
  406.  * If you're using Yanfly's Main Menu Manager, you can find a command's
  407.  * symbol in the Parameter section it's help in.
  408.  *
  409.  *
  410.  * On the other hand, if you have a Plugin that adds a command without
  411.  * telling you the symbol for it, leave a comment on the YouTube video
  412.  * or Forum post linking me to the Plugin; I'll help ya. ~
  413.  *
  414.  *
  415.  * ==========================================================================
  416.  *  End of Help File
  417.  * ==========================================================================
  418.  *
  419.  * Welcome to the bottom of the Help file.
  420.  *
  421.  *
  422.  * Thanks for reading!
  423.  * If you have questions, or if you enjoyed this Plugin, please check
  424.  * out my YouTube channel!
  425.  *
  426.  * [url]https://www.youtube.com/c/SumRndmDde[/url]
  427.  *
  428.  *
  429.  * Until next time,
  430.  *   ~ SumRndmDde
  431.  */
  432.  
  433. var Imported = Imported || {};
  434.  
  435. (function() {
  436.  
  437.         var icons = {};
  438.         icons['item'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Item Icon']);
  439.         icons['skill'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Skill Icon']);
  440.         icons['equip'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Equip Icon']);
  441.         icons['status'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Status Icon']);
  442.         icons['formation'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Formation Icon']);
  443.         icons['options'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Options Icon']);
  444.         icons['save'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Save Icon']);
  445.         icons['gameEnd'] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Game End Icon']);
  446.  
  447.         for(var i = 1; i <= 20; i++) {
  448.                 var sym = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Command Symbol ' + i]);
  449.                 if(sym.trim().length > 0) {
  450.                         icons[sym] = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Command Icon ' + i]);
  451.                 }
  452.         }
  453.  
  454.         var bustX = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Bust X Pos']);
  455.         var bustY = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Bust Y Pos']);
  456.         var sBack = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Status Background']);
  457.         var tp = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Show TP?']).trim().toLowerCase() === 'true';
  458.         var col = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Max Columns']);
  459.         var row = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Visible Rows']);
  460.         var _x = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Icon Window X']);
  461.         var _y = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Icon Window Y']);
  462.         var _stand = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Standard Padding']);
  463.         var _icon = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Icon Padding']);
  464.         var _iconX = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Icon X Position']);
  465.         var _iconY = Number(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Icon Y Position']);
  466.         var _labelX = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Label Window X']);
  467.         var _labelY = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Label Window Y']);
  468.         var _labelAlign = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Label Alignment']).toLowerCase();
  469.         var goldX = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Gold Window X']);
  470.         var goldY = String(PluginManager.parameters('SRD_AltMenuScreen_BustIcons')['Gold Window Y']);
  471.  
  472.         var notetagsLoaded = false;
  473.         var _DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  474.         DataManager.isDatabaseLoaded = function() {
  475.             if(!_DataManager_isDatabaseLoaded.call(this)) return false;
  476.             if(!notetagsLoaded) {
  477.                     for(var i = 1; i < $dataActors.length; i++) {
  478.                             if($dataActors[i].note.match(/<Menu\s*Bust\s*:\s*(.*)\s*>/im)) {
  479.                                     $dataActors[i].ams_bs_bust = RegExp.$1;
  480.                             }
  481.                             if($dataActors[i].note.match(/<Menu\s*Bust\s*X\s*:\s*(.*)\s*>/im)) {
  482.                                     $dataActors[i].ams_bs_x = parseInt(RegExp.$1);
  483.                             }
  484.                             if($dataActors[i].note.match(/<Menu\s*Bust\s*Y\s*:\s*(.*)\s*>/im)) {
  485.                                     $dataActors[i].ams_bs_y = parseInt(RegExp.$1);
  486.                             }
  487.                     }
  488.                     notetagsLoaded = true;
  489.             }
  490.             return true;
  491.         };
  492.         if(!ImageManager.loadSumRndmDdeMB) {
  493.                 ImageManager.loadSumRndmDdeMB = function(filename, hue) {
  494.                         return this.loadBitmap('img/SumRndmDde/menu/', filename, hue, true);
  495.             };
  496.         }
  497.         var _Scene_Menu_create = Scene_Menu.prototype.create;
  498.         Scene_Menu.prototype.create = function() {
  499.             _Scene_Menu_create.call(this);
  500.             this._windowLayer.removeChild(this._goldWindow);
  501.             this.addWindow(this._goldWindow);
  502.             this._windowLayer.removeChild(this._commandWindow);
  503.             this.addWindow(this._commandWindow);
  504.             this._commandLabel = new Window_CommandLabel(0, 0, this._commandWindow);
  505.             this.addWindow(this._commandLabel);
  506.             this._statusWindow.x = 0;
  507.                 this._statusWindow.y = 0;
  508.                 this._commandLabel.x = eval(_labelX);
  509.             this._commandLabel.y = eval(_labelY);
  510.                 this._commandWindow.x = eval(_x);
  511.                 this._commandWindow.y = eval(_y);
  512.                 this._goldWindow.x = eval(goldX);
  513.             this._goldWindow.y = eval(goldY);
  514.         };
  515.         Scene_Menu.prototype.createStatusWindow = function() {
  516.             this._statusWindow = new Window_MenuStatus(0, 0);
  517.             this.addWindow(this._statusWindow);
  518.         };
  519.         Window_MenuCommand.prototype.windowWidth = function() {
  520.             return ((this.maxItems() * (this.itemWidth() + (this.textPadding() * 2))) +
  521.                     (this.standardPadding() * 2)) - (this.textPadding() * 2);
  522.         };
  523.         Window_MenuCommand.prototype.windowHeight = function() {
  524.             return this.itemHeight() + (this.standardPadding() * 2);
  525.         };
  526.         Window_MenuCommand.prototype.standardPadding = function() {
  527.             return _stand;
  528.         };
  529.         Window_MenuCommand.prototype.iconPadding = function() {
  530.             return _icon;
  531.         };
  532.         Window_MenuCommand.prototype.maxCols = function() {
  533.             return this.maxItems();
  534.         };
  535.         Window_MenuCommand.prototype.numVisibleRows = function() {
  536.             return 1;
  537.         };
  538.         Window_MenuCommand.prototype.itemWidth = function() {
  539.             return Window_Base._iconWidth + this.iconPadding();
  540.         };
  541.         Window_MenuCommand.prototype.itemHeight = function() {
  542.             return Window_Base._iconHeight + this.iconPadding();
  543.         };
  544.         Window_MenuCommand.prototype.drawItem = function(index) {
  545.             var rect = this.itemRectForText(index);
  546.             var align = this.itemTextAlign();
  547.             var symbol = this.commandSymbol(index);
  548.             var enabled = this.isCommandEnabled(index);
  549.             this.resetTextColor();
  550.                 var bitmap = ImageManager.loadSystem('IconSet');
  551.             var pw = Window_Base._iconWidth;
  552.             var ph = Window_Base._iconHeight;
  553.             var sx = icons[symbol] % 16 * pw;
  554.             var sy = Math.floor(icons[symbol] / 16) * ph;
  555.             if(!enabled) this.contents.paintOpacity = 100;
  556.             this.contents.blt(bitmap, sx, sy, pw, ph, rect.x + _iconX, rect.y + _iconY);
  557.             if(!enabled) this.contents.paintOpacity = 255;
  558.         };
  559.         var _Window_MenuStatus_loadImages = Window_MenuStatus.prototype.loadImages;
  560.         Window_MenuStatus.prototype.loadImages = function() {
  561.             _Window_MenuStatus_loadImages.call(this);
  562.             $gameParty.members().forEach(function(actor) {
  563.                     if(actor.actor().ams_bs_bust) {
  564.                         ImageManager.loadSumRndmDdeMB(actor.actor().ams_bs_bust);
  565.                 }
  566.             }, this);
  567.         };
  568.         Window_MenuStatus.prototype.windowWidth = function() {
  569.                 return Graphics.boxWidth;
  570.         };
  571.         Window_MenuStatus.prototype.windowHeight = function() {
  572.             return Graphics.boxHeight;
  573.         };
  574.         Window_MenuStatus.prototype.numVisibleRows = function() {
  575.                 return 1;
  576.         };
  577.         Window_MenuStatus.prototype.maxCols = function() {
  578.             return 4;
  579.         };
  580.         Window_MenuStatus.prototype.drawItem = function(index) {
  581.             this.drawItemBackground(index);
  582.             this.drawItemImage(index);
  583.             this.drawItemStatus(index);
  584.         };
  585.         Window_MenuStatus.prototype.drawItemImage = function(index) {
  586.             var actor = $gameParty.members()[index];
  587.             var rect = this.itemRect(index);
  588.             this.changePaintOpacity(actor.isBattleMember());
  589.             var x = actor.actor().ams_bs_x || bustX;
  590.             var y = actor.actor().ams_bs_y || bustY;
  591.             this.drawBust(actor, rect, x, y);
  592.             this.changePaintOpacity(true);
  593.         };
  594.         Window_MenuStatus.prototype.drawItemStatus = function(index) {
  595.             var actor = $gameParty.members()[index];
  596.             var rect = this.itemRect(index);
  597.             var lineHeight = this.lineHeight();
  598.             var x = rect.x + 12;
  599.             var y = rect.y + rect.height / 2;
  600.             if(tp) y -= lineHeight;
  601.             var boxHeight = (tp) ? lineHeight * 7 : lineHeight * 6;
  602.             this.contents.fillRect(rect.x, y, this.itemWidth(), boxHeight, sBack);
  603.             this.drawActorName(actor, x, y + lineHeight * 5);
  604.             this.drawActorNickname(actor, x, y + lineHeight * 6);
  605.             this.drawActorIcons(actor, x, y + lineHeight * 2);
  606.             this.drawActorClass(actor, x, y + lineHeight * 7);
  607.             if(tp) {
  608.                     this.drawActorTp(actor, x, y + lineHeight * 6, this.itemWidth() - 24);
  609.             }
  610.         };
  611.         Window_MenuStatus.prototype.drawBust = function(actor, rect, xOff, yOff) {
  612.             var bitmap = ImageManager.loadSumRndmDdeMB(actor.actor().ams_bs_bust);
  613.             var sx = bitmap.width / 2 - this.itemWidth() / 2;
  614.             this.contents.blt(bitmap, sx, 0, this.itemWidth(), bitmap.height, rect.x + xOff, (rect.height - bitmap.height) + yOff);
  615.         };
  616.         var _Window_MenuStatus_deselect = Window_MenuStatus.prototype.deselect;
  617.         Window_MenuStatus.prototype.deselect = function() {
  618.             _Window_MenuStatus_deselect.call(this);
  619.             this._index = 0;
  620.         };
  621.         function Window_CommandLabel() {
  622.             this.initialize.apply(this, arguments);
  623.         }
  624.         Window_CommandLabel.prototype = Object.create(Window_Base.prototype);
  625.         Window_CommandLabel.prototype.constructor = Window_CommandLabel;
  626.         Window_CommandLabel.prototype.initialize = function(x, y, win) {
  627.             var width = this.windowWidth();
  628.             var height = this.windowHeight();
  629.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  630.             this._commandWindow = win;
  631.             this._value = "";
  632.             this.refresh();
  633.         };
  634.         Window_CommandLabel.prototype.windowWidth = function() {
  635.             return 240;
  636.         };
  637.         Window_CommandLabel.prototype.windowHeight = function() {
  638.             return this.fittingHeight(1);
  639.         };
  640.         Window_CommandLabel.prototype.refresh = function() {
  641.                 if(this._value != this._commandWindow.currentData().symbol) {
  642.                         this._value = this._commandWindow.currentData().symbol;
  643.                     var width = this.contents.width - this.textPadding() * 2;
  644.                     this.contents.clear();
  645.                     this.drawText(this._commandWindow.currentData().name, this.textPadding(), 0, width, _labelAlign);
  646.                 }
  647.         };
  648.         var _Window_CommandLabel_update = Window_CommandLabel.prototype.update;
  649.         Window_CommandLabel.prototype.update = function() {
  650.             if(this._commandWindow) this.refresh();
  651.             _Window_CommandLabel_update.call(this);
  652.         };
  653.         Window_CommandLabel.prototype.open = function() {
  654.             this.refresh();
  655.             Window_Base.prototype.open.call(this);
  656.         };
  657.         if(Imported.YEP_MainMenuManager) {
  658.                 Scene_Menu.prototype.resizeGoldWindow = function() {};
  659.         }
  660. })();


------------------------------------
目前我已经把对插件的修改都撤销了,每次更换立绘时,先将 $dataActors[id].ams_bs_bust 的末尾变量去除,再重新加上新变量,用着还行。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
36499
在线时间
10811 小时
注册时间
2009-3-15
帖子
4816
10
发表于 2019-2-2 11:28:51 | 只看该作者
本帖最后由 soulsaga 于 2019-2-2 11:32 编辑

611行开始是菜单立绘显示?
这里可以用变量控制么
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-12-5 10:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表