查看: 4802|回复: 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声音测试大概也不会有......编辑器就更不要说了 ....
用这个替换main.js
  1. //=============================================================================
  2. // main.js
  3. //=============================================================================


  4. PluginManager.setup1 = function(plugins) {
  5.         var ww_PluginManager = false
  6.     for (var i=0;i<plugins.length;i++){
  7.             var plugin = plugins[i]
  8.             if (plugin.parameters["ww_PluginManager"] == "汪汪" ){
  9.                     this.loadScript(plugin.name + '.js');
  10.                     this._scripts.push(plugin.name);
  11.                     ww_PluginManager = true            
  12.             }
  13.         }
  14.         if( ww_PluginManager == false ) {
  15.                 PluginManager.setup($plugins)
  16.         }
  17. };
  18. PluginManager.setup1($plugins);




  19. window.onload = function() {
  20.     SceneManager.run(Scene_Boot);
  21. };
复制代码




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

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



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

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

  14. (function() {


  15. //设置原形
  16. Window_HelpList.prototype = Object.create(Window_Selectable.prototype);
  17. //设置创造者
  18. Window_HelpList.prototype.constructor = Window_HelpList;
  19. //初始化
  20. Window_HelpList.prototype.initialize = function(x, y) {
  21.     this._nrlist = []
  22.     this.clearCommandList();
  23.     this.makeCommandList();
  24.     var width = this.windowWidth();
  25.     var height = this.windowHeight();
  26.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  27.     this.refresh();
  28.     this.select(0);
  29.     this.activate();
  30.    
  31. };


  32. //窗口宽
  33. Window_HelpList.prototype.windowWidth = function() {
  34.     return Graphics.boxWidth;
  35. };
  36. //窗口高
  37. Window_HelpList.prototype.windowHeight = function() {
  38.     return  Graphics.boxHeight  
  39. };
  40. //可见行数
  41. Window_HelpList.prototype.numVisibleRows = function() {
  42.     return 10;
  43. };
  44. //最大项目数
  45. Window_HelpList.prototype.maxItems = function() {
  46.     return this._list.length;
  47. };
  48. //清除命令列表
  49. Window_HelpList.prototype.clearCommandList = function() {
  50.     this._list = [];
  51. };
  52. //制作命令列表
  53. Window_HelpList.prototype.makeCommandList = function() {
  54.         var list = this._nrlist
  55.         for (var i =0 ;i < list.length;i++){
  56.                 this.addCommand(list[i])
  57.                
  58.         }
  59. };
  60. //SceneManager.push(Scene_PM)
  61. //添加命令
  62. Window_HelpList.prototype.addCommand = function(text) {
  63.         var width = this.contentsWidth()  
  64.         var text = text.rtrim()
  65.         var text1 = ""
  66.         var text2 = text
  67.         var cs = 0
  68.         do{
  69.                 if ( this.textWidth(text)   <= width  ){
  70.                         text1 = text
  71.                         text2 = ""
  72.                 }else{
  73.                         if (this.textWidth(text.slice(0,cs)) <= width   ){
  74.                                 for (var i= cs ; i<=text.length;i++){
  75.                                         if (this.textWidth(text.slice(0,i)) <= width  ){
  76.                                                 text1 = text.slice(0,i)
  77.                                                 text2 = text.slice(i)
  78.                                                
  79.                                         }else{
  80.                                                 cs = i
  81.                                                 text = text2
  82.                                                 break
  83.                                         }
  84.                                 }                       
  85.                         }else{
  86.                                 for (var i= cs ; i>=0;i--){
  87.                                         if (this.textWidth(text.slice(0,i)) <= width  ){
  88.                                                 text1 = text.slice(0,i)
  89.                                                 text2 = text.slice(i)
  90.                                                 cs = i
  91.                                                 text = text2
  92.                                                 break                                       
  93.                                         }
  94.                                 }               
  95.                         }
  96.                        
  97.                 }
  98.                 this._list.push(text1);
  99.                 var text1 = ""
  100.         }while(text2.length>0)
  101. };
  102. //命令名
  103. Window_HelpList.prototype.commandName = function(index) {
  104.     return this._list[index];
  105. };

  106. //绘制项目
  107. Window_HelpList.prototype.drawItem = function(index) {
  108.     var rect = this.itemRectForText(index);
  109.     var align = this.itemTextAlign();
  110.     this.resetTextColor();
  111.     this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
  112. };
  113. //项目文本排列
  114. Window_HelpList.prototype.itemTextAlign = function() {
  115.     return 'left';
  116. };

  117. //呼叫 确定处理
  118. Window_HelpList.prototype.callOkHandler = function() {
  119.     this.activate()
  120. };
  121. //刷新
  122. Window_HelpList.prototype.refresh = function() {
  123.     this.clearCommandList();
  124.     this.makeCommandList();
  125.     this.createContents();
  126.     Window_Selectable.prototype.refresh.call(this);
  127. };

  128. })();
复制代码





插件列表
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.

在本版发帖返回顶部