查看: 4721|回复: 3

[原创发布] 【20160223】仿mv插件管理器

[复制链接]
梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-2-23 19:37:11 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 汪汪 于 2016-2-23 22:06 编辑

模仿mv插件管理器功能的插件
通过 config 保存对 插件设置
(结合保存数据脚本可以保存在其他地方....就不提供了)




额,总之大概不可能有 仿mv数据库 了 ,仿mv声音测试大概也不会有......编辑器就更不要说了 ....
[fold=用这个替换main.js]
[pre lang="javascript"]//=============================================================================
// main.js
//=============================================================================


PluginManager.setup1 = function(plugins) {
        var ww_PluginManager = false
    for (var i=0;i<plugins.length;i++){
            var plugin = plugins
            if (plugin.parameters["ww_PluginManager"] == "汪汪" ){
                    this.loadScript(plugin.name + '.js');
                    this._scripts.push(plugin.name);
                    ww_PluginManager = true            
            }
        }
        if( ww_PluginManager == false ) {
                PluginManager.setup($plugins)
        }
};
PluginManager.setup1($plugins);




window.onload = function() {
    SceneManager.run(Scene_Boot);
};
[/pre]

[/fold]

【20160223_1.0】ww_PluginManager.zip (4.67 KB, 下载次数: 115)

[fold=附赠帮助阅读窗口........好像没什么用,当个读书脚本就好]

[pre lang="javascript"]

/* 使用方法
   var w = new Window_HelpList()
   w._nrlist = ["12321,54665,46,54,6,5,4,56,4","sdfdsaaadfadsfdffdfdsfds"]
   w.refresh()
   或:
   var w = new Window_HelpList()
   var text = "aaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaa"
   w._nrlist = text..split("\n")
   w.refresh()
*/

function Window_HelpList() {
    this.initialize.apply(this, arguments);
}

(function() {


//设置原形
Window_HelpList.prototype = Object.create(Window_Selectable.prototype);
//设置创造者
Window_HelpList.prototype.constructor = Window_HelpList;
//初始化
Window_HelpList.prototype.initialize = function(x, y) {
    this._nrlist = []
    this.clearCommandList();
    this.makeCommandList();
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Selectable.prototype.initialize.call(this, x, y, width, height);
    this.refresh();
    this.select(0);
    this.activate();
   
};


//窗口宽
Window_HelpList.prototype.windowWidth = function() {
    return Graphics.boxWidth;
};
//窗口高
Window_HelpList.prototype.windowHeight = function() {
    return  Graphics.boxHeight  
};
//可见行数
Window_HelpList.prototype.numVisibleRows = function() {
    return 10;
};
//最大项目数
Window_HelpList.prototype.maxItems = function() {
    return this._list.length;
};
//清除命令列表
Window_HelpList.prototype.clearCommandList = function() {
    this._list = [];
};
//制作命令列表
Window_HelpList.prototype.makeCommandList = function() {
        var list = this._nrlist
        for (var i =0 ;i < list.length;i++){
                this.addCommand(list)
               
        }
};
//SceneManager.push(Scene_PM)
//添加命令
Window_HelpList.prototype.addCommand = function(text) {
        var width = this.contentsWidth()  
        var text = text.rtrim()
        var text1 = ""
        var text2 = text
        var cs = 0
        do{
                if ( this.textWidth(text)   <= width  ){
                        text1 = text
                        text2 = ""
                }else{
                        if (this.textWidth(text.slice(0,cs)) <= width   ){
                                for (var i= cs ; i<=text.length;i++){
                                        if (this.textWidth(text.slice(0,i)) <= width  ){
                                                text1 = text.slice(0,i)
                                                text2 = text.slice(i)
                                               
                                        }else{
                                                cs = i
                                                text = text2
                                                break
                                        }
                                }                       
                        }else{
                                for (var i= cs ; i>=0;i--){
                                        if (this.textWidth(text.slice(0,i)) <= width  ){
                                                text1 = text.slice(0,i)
                                                text2 = text.slice(i)
                                                cs = i
                                                text = text2
                                                break                                       
                                        }
                                }               
                        }
                       
                }
                this._list.push(text1);
                var text1 = ""
        }while(text2.length>0)
};
//命令名
Window_HelpList.prototype.commandName = function(index) {
    return this._list[index];
};

//绘制项目
Window_HelpList.prototype.drawItem = function(index) {
    var rect = this.itemRectForText(index);
    var align = this.itemTextAlign();
    this.resetTextColor();
    this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
};
//项目文本排列
Window_HelpList.prototype.itemTextAlign = function() {
    return 'left';
};

//呼叫 确定处理
Window_HelpList.prototype.callOkHandler = function() {
    this.activate()
};
//刷新
Window_HelpList.prototype.refresh = function() {
    this.clearCommandList();
    this.makeCommandList();
    this.createContents();
    Window_Selectable.prototype.refresh.call(this);
};

})();
[/pre]



[/fold]
插件列表
BaiduShurufa_2016-2-23_19-28-33.png


插件信息列表
点击作者一栏开关脚本


BaiduShurufa_2016-2-23_19-30-14.png

BaiduShurufa_2016-2-23_19-31-37.png
点击描述一栏 阅读脚本

BaiduShurufa_2016-2-23_19-29-15.png

点击帮助一栏 打开帮助

BaiduShurufa_2016-2-23_19-29-35.png


点击参数会弹出窗口提示输入
BaiduShurufa_2016-2-23_19-30-29.png

笑问情缘

梦石
0
星屑
68
在线时间
238 小时
注册时间
2006-5-3
回帖
544
发表于 2016-2-23 20:38:30 来自手机 | 显示全部楼层
话说这东西有啥作用?

点评

汪汪你好闲!  发表于 2016-2-24 11:46
改改可以做一个图书馆系统嘛... : )  发表于 2016-2-23 21:05
不想打开软件 再开关插件喽....好吧,没什么用....  发表于 2016-2-23 21:04
回复

使用道具 举报

梦石
0
星屑
245
在线时间
219 小时
注册时间
2015-9-24
回帖
138
发表于 2016-2-25 10:51:47 | 显示全部楼层
话说能用指令控制脚本的开启和关闭么···
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
 楼主| 发表于 2016-2-25 11:14:28 | 显示全部楼层
本帖最后由 汪汪 于 2016-2-25 11:16 编辑
chenyilindzh 发表于 2016-2-25 10:51
话说能用指令控制脚本的开启和关闭么···


使用本脚本后 ,修改 $plugins  里的内容 ,



然后 使用 ConfigManager.save() 保存, f5 刷新就可以了.(可以用下面的脚本代替)

  1. (function () {
  2.     ConfigManager.save()
  3.     $gameSystem.onBeforeSave();
  4.     alert("保存到1号存档:" + DataManager.saveGame(1))
  5.     location.reload();       
  6. })()
复制代码
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部