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

Project1

 找回密码
 注册会员
搜索
查看: 5119|回复: 9

[有事请教] 如何创建一个显示大量文字带有选项的文本框。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
31
在线时间
3 小时
注册时间
2019-12-10
帖子
5
发表于 2019-12-15 16:11:04 | 显示全部楼层 |阅读模式

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

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

x
如何创建一个能够大量显示文字而且可以出现选项,选项还可以触发别的事件,内带的显示内容只能容纳四行,需要一个能容纳50行可以用鼠标滚轮滑动的显示内容,求帮助!{:4_91

Lv5.捕梦者

梦石
0
星屑
21776
在线时间
8547 小时
注册时间
2011-12-31
帖子
3360
发表于 2019-12-15 16:20:50 | 显示全部楼层
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
31
在线时间
3 小时
注册时间
2019-12-10
帖子
5
 楼主| 发表于 2019-12-15 16:32:25 | 显示全部楼层
tseyik 发表于 2019-12-15 16:20
https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/ChoiceWindowInMessage.js

这个是触碰物体触发的吗 还是直接在地图上显示?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
31
在线时间
3 小时
注册时间
2019-12-10
帖子
5
 楼主| 发表于 2019-12-15 16:49:04 | 显示全部楼层
tseyik 发表于 2019-12-15 16:20
https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/ChoiceWindowInMessage.js

还有能不能说一下这个东西怎么用? 谢谢
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
31
在线时间
3 小时
注册时间
2019-12-10
帖子
5
 楼主| 发表于 2019-12-15 16:49:49 | 显示全部楼层
tseyik 发表于 2019-12-15 16:20
https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/ChoiceWindowInMessage.js

还有能不能说一下这个东西怎么用? 谢谢

点评

自己google翻譯看一下不會很難  发表于 2019-12-15 17:52
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3336
在线时间
468 小时
注册时间
2014-2-6
帖子
258
发表于 2019-12-15 18:06:35 | 显示全部楼层
tseyik 发表于 2019-12-15 16:20
https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/ChoiceWindowInMessage.js

大佬大佬,这个网址不能访问呀.....被屏蔽了
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1236
在线时间
221 小时
注册时间
2018-8-27
帖子
84
发表于 2019-12-15 19:22:21 | 显示全部楼层
/*=============================================================================
ChoiceWindowInMessage.js
----------------------------------------------------------------------------
(C)2019 Triacontane
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
----------------------------------------------------------------------------
Version
1.0.2 2019/02/19 選択肢のみ表示するとき、ウィンドウ位置をスクリプトで変えられるよう調整
1.0.1 2019/02/18 顔グラフィックを表示した場合、選択肢のカーソル位置がずれる問題を修正
1.0.0 2019/02/17 初版
----------------------------------------------------------------------------
[Blog]   : https://triacontane.blogspot.jp/
[Twitter]: https://twitter.com/triacontane/
[GitHub] : https://github.com/triacontane/
=============================================================================*/

/*:
* @plugindesc ChoiceWindowInMessagePlugin
* @author triacontane
*
* @help ChoiceWindowInMessage.js
*
* イベントコマンドの「選択肢」および「数値入力」ウィンドウが
* メッセージウィンドウの内部に表示されるようになります。
*
* This plugin is released under the MIT License.
*/
/*:ja
* @plugindesc 選択肢のメッセージ内部表示プラグイン
* @author トリアコンタン
*
* @help ChoiceWindowInMessage.js
*
* イベントコマンドの「選択肢」および「数値入力」ウィンドウが
* メッセージウィンドウの内部に表示されるようになります。
* 
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
*  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
*  についても制限はありません。
*  このプラグインはもうあなたのものです。
*/

(function() {
    'use strict';

    /**
     * Scene_Map
     * 選択肢ウィンドウをWindowLayerから外します。(重なり時のマスクを避けるため)
     */
    var _Scene_Map_createMessageWindow = Scene_Map.prototype.createMessageWindow;
    Scene_Map.prototype.createMessageWindow = function() {
        _Scene_Map_createMessageWindow.apply(this, arguments);
        this.changeParentChoiceWindow()
    };

    var _Scene_Battle_createMessageWindow = Scene_Battle.prototype.createMessageWindow;
    Scene_Battle.prototype.createMessageWindow = function() {
        _Scene_Battle_createMessageWindow.apply(this, arguments);
        this.changeParentChoiceWindow()
    };

    Scene_Base.prototype.changeParentChoiceWindow = function() {
        this._messageWindow.subWindows().forEach(function(win) {
            if (win.isInnerMessage()) {
                this.addChild(this._windowLayer.removeChild(win));
            }
        }, this);
    };

    /**
     * Game_Message
     * メッセージおよび選択肢の行数を返します。
     */
    Game_Message.prototype.messageLines = function() {
        return this._texts.length;
    };

    Game_Message.prototype.choiceLines = function() {
        return this._choices.length;
    };

    Game_Message.prototype.isChoiceOrInput = function() {
        return this.isChoice() || this.isNumberInput();
    };

    Game_Message.prototype.setBaseWindowLine = function(value) {
        this._baseLine = value;
    };

    Game_Message.prototype.getBaseWindowLine = function() {
        return this._baseLine;
    };

    Game_Message.prototype.isOutInnerMessage = function(addLines) {
        var messageLines = this.messageLines();
        return messageLines > 0 && messageLines + addLines > this.getBaseWindowLine();
    };

    /**
     * Game_Interpreter
     * 文章の表示後に選択肢と数値入力が来た場合の挙動を変更します。
     */
    var _Game_Interpreter_setupChoices = Game_Interpreter.prototype.setupChoices;
    Game_Interpreter.prototype.setupChoices = function(params) {
        if ($gameMessage.isOutInnerMessage(params[0].length)) {
            this._index--;
            return;
        }
        _Game_Interpreter_setupChoices.apply(this, arguments);
    };

    var _Game_Interpreter_setupNumInput = Game_Interpreter.prototype.setupNumInput;
    Game_Interpreter.prototype.setupNumInput = function(params) {
        if ($gameMessage.isOutInnerMessage(1)) {
            this._index--;
            return;
        }
        _Game_Interpreter_setupNumInput.apply(this, arguments);
    };

    /**
     * Window_Base
     * メッセージウィンドウに内部に表示するかどうかを返します。
     */
    Window_Base.prototype.isInnerMessage = function() {
        return false;
    };

    /**
     * Window_Message
     * テキストの高さを返します。
     */
    var _Window_Message_initialize = Window_Message.prototype.initialize;
    Window_Message.prototype.initialize = function() {
        _Window_Message_initialize.apply(this, arguments);
        $gameMessage.setBaseWindowLine(this.numVisibleRows());
    };

    var _Window_Message_startMessage = Window_Message.prototype.startMessage;
    Window_Message.prototype.startMessage = function() {
        this.height = this.windowHeight();
        _Window_Message_startMessage.apply(this, arguments);
    };

    var _Window_Message_updatePlacement = Window_Message.prototype.updatePlacement;
    Window_Message.prototype.updatePlacement = function() {
        _Window_Message_updatePlacement.apply(this, arguments);
        $gameMessage.setBaseWindowLine(this.numVisibleRows());
    };

    Window_Message.prototype.getTextHeight = function() {
        return this._textState ? this._textState.y + this._textState.height : 0;
    };

    var _Window_Message_doesContinue = Window_Message.prototype.doesContinue;
    Window_Message.prototype.doesContinue = function() {
        return _Window_Message_doesContinue.apply(this, arguments) || $gameMessage.isChoiceOrInput();
    };

    Window_Message.prototype.openForChoice = function() {
        if (!this._textState) {
            this.contents.clear();
        }
        if ($gameMessage.isChoice()) {
            var lines = $gameMessage.choiceLines();
            if (lines > this.numVisibleRows()) {
                this.height = this.fittingHeight(lines);
            } else {
                this.height = this.windowHeight();
            }
        }
        this.updatePlacement();
        this.open();
    };

    /**
     * Window_ChoiceList
     * 選択肢をメッセージウィンドウに含めます。
     */
    var _Window_ChoiceList_start = Window_ChoiceList.prototype.start;
    Window_ChoiceList.prototype.start = function() {
        this._messageWindow.openForChoice();
        _Window_ChoiceList_start.apply(this, arguments);
    };

    var _Window_ChoiceList_updatePlacement = Window_ChoiceList.prototype.updatePlacement;
    Window_ChoiceList.prototype.updatePlacement = function() {
        _Window_ChoiceList_updatePlacement.apply(this, arguments);
        this.x = this._messageWindow.x;
        this.y = this._messageWindow.y + this._messageWindow.getTextHeight();
    };

    var _Window_ChoiceList_windowWidth = Window_ChoiceList.prototype.windowWidth;
    Window_ChoiceList.prototype.windowWidth = function() {
        _Window_ChoiceList_windowWidth.apply(this, arguments);
        return this._messageWindow.width;
    };

    var _Window_ChoiceList_updateBackground = Window_ChoiceList.prototype.updateBackground;
    Window_ChoiceList.prototype.updateBackground = function() {
        _Window_ChoiceList_updateBackground.apply(this, arguments);
        this.opacity = 0;
    };

    var _Window_ChoiceList_itemRect = Window_ChoiceList.prototype.itemRect;
    Window_ChoiceList.prototype.itemRect = function(index) {
        var rect = _Window_ChoiceList_itemRect.apply(this, arguments);
        var newLineX = this._messageWindow.newLineX();
        rect.x += newLineX;
        rect.width -= newLineX;
        return rect;
    };

    Window_ChoiceList.prototype.isInnerMessage = function() {
        return true;
    };

    /**
     * Window_NumberInput
     * 選択肢をメッセージウィンドウに含めます。
     */
    var _Window_NumberInput_start = Window_NumberInput.prototype.start;
    Window_NumberInput.prototype.start = function() {
        this._messageWindow.openForChoice();
        _Window_NumberInput_start.apply(this, arguments);
    };

    var _Window_NumberInput_updatePlacement = Window_NumberInput.prototype.updatePlacement;
    Window_NumberInput.prototype.updatePlacement = function() {
        _Window_NumberInput_updatePlacement.apply(this, arguments);
        this.opacity = 0;
        this.x = this._messageWindow.x;
        this.y = this._messageWindow.y + this._messageWindow.getTextHeight();
    };

    var _Window_NumberInput_windowWidth = Window_NumberInput.prototype.windowWidth;
    Window_NumberInput.prototype.windowWidth = function() {
        _Window_NumberInput_windowWidth.apply(this, arguments);
        return this._messageWindow.width;
    };

    Window_NumberInput.prototype.isInnerMessage = function() {
        return true;
    };

    var _Window_NumberInput_buttonY = Window_NumberInput.prototype.buttonY;
    Window_NumberInput.prototype.buttonY = function() {
        if (this._messageWindow.y >= Graphics.boxHeight / 2) {
            return _Window_NumberInput_buttonY.apply(this, arguments) - this._messageWindow.getTextHeight();
        } else {
            return this._messageWindow.y + this._messageWindow.height - this.y + 8;
        }
    };

    var _Window_NumberInput_itemRect = Window_NumberInput.prototype.itemRect;
    Window_NumberInput.prototype.itemRect = function(index) {
        var rect = _Window_NumberInput_itemRect.apply(this, arguments);
        rect.x += this._messageWindow.newLineX();
        return rect;
    };
})();
《大理段素义游记》填坑中...
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
21776
在线时间
8547 小时
注册时间
2011-12-31
帖子
3360
发表于 2019-12-15 21:21:11 | 显示全部楼层
本帖最后由 tseyik 于 2019-12-15 21:47 编辑

沒看到要大量
上面那個是選擇項在對話中顯示

選択肢拡張(國内要科學上網)
http://woodpenguin.web.fc2.com/MV_Plugin/MPP_ChoiceEX.html

    通常6つまでしか表示できない選択肢を、無制限に拡張できます。
    スイッチや変数などによる条件で、その選択肢の有無を設定できます。
    選択肢ウィンドウの表示位置を一時的に変更することができます。
    条件を設定することで、その項目を半透明にして選択不可にすることができます。
Capture1.JPG
Capture.JPG
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
599
在线时间
111 小时
注册时间
2007-6-13
帖子
85
发表于 2019-12-21 00:46:07 | 显示全部楼层
二楼的蛮好用的,只是会跳过前面的对话框,不过我在后面加个空白的就可以了
1
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 21:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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