Project1

标题: 【MV发布】通用型包管理器:skyscrap [打印本页]

作者: LBQ    时间: 2015-10-3 01:32
标题: 【MV发布】通用型包管理器:skyscrap
本帖最后由 LBQ 于 2015-10-3 01:36 编辑

比如说我们写了个插件(这个插件本身没有任何意义)
JAVASCRIPT 代码复制
  1. var Scene_Crafting, Window_CanCraftItems,
  2.   extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  3.   hasProp = {}.hasOwnProperty;
  4.  
  5. Window_CanCraftItems = (function(superClass) {
  6.   extend(Window_CanCraftItems, superClass);
  7.  
  8.   function Window_CanCraftItems() {
  9.     return Window_CanCraftItems.__super__.constructor.apply(this, arguments);
  10.   }
  11.  
  12.   Window_CanCraftItems.prototype.initialize = function() {
  13.     return Window_CanCraftItems.__super__.initialize.call(this);
  14.   };
  15.  
  16.   return Window_CanCraftItems;
  17.  
  18. })(Window_ItemList);
  19.  
  20. Scene_Crafting = (function(superClass) {
  21.   extend(Scene_Crafting, superClass);
  22.  
  23.   function Scene_Crafting() {
  24.     return Scene_Crafting.__super__.constructor.apply(this, arguments);
  25.   }
  26.  
  27.   Scene_Crafting.prototype.initialize = function() {
  28.     return Scene_Crafting.__super__.initialize.call(this);
  29.   };
  30.  
  31.   Scene_Crafting.prototype.create = function() {
  32.     Scene_Crafting.__super__.create.call(this);
  33.     this.createBackground();
  34.     this.createWindowLayer();
  35.     this.createGoldWindow();
  36.     this.createLeftWindow();
  37.     return this.createRightWindow();
  38.   };
  39.  
  40.   Scene_Crafting.prototype.start = function() {
  41.     return Scene_Crafting.__super__.start.call(this);
  42.   };
  43.  
  44.   Scene_Crafting.prototype.createGoldWindow = function() {
  45.     this.goldWindow = new Window_Gold(0, 0);
  46.     return this.addWindow(this.goldWindow);
  47.   };
  48.  
  49.   Scene_Crafting.prototype.createLeftWindow = function() {
  50.     this.leftWindow = new Window_ItemList(0, this.goldWindow.height, Graphics.width / 2, Graphics.height - this.goldWindow.height);
  51.     return this.addWindow(this.leftWindow);
  52.   };
  53.  
  54.   Scene_Crafting.prototype.createRightWindow = function() {
  55.     return this.rightWindow = new Window_ItemList(Graphics.width / 2, this.goldWindow.height, Graphics.width / 2, Graphics.height - this.goldWindow.height);
  56.   };
  57.  
  58.   return Scene_Crafting;
  59.  
  60. })(Scene_MenuBase);
  61.  
  62. window.Scene_Crafting = Scene_Crafting;


我们把它挂在refheap上:https://www.refheap.com/110212/raw

然后安装这个包管理器:
SHELL 代码复制
  1. $ npm install -g skyscrap


然后在MV工程的文件夹



其实这个管理器很通用(很懒),假如能普及就好了
作者: 英顺的马甲    时间: 2015-10-4 22:20
我被通用发布骗进来...
作者: chd114    时间: 2015-10-5 11:59
交出MV或者删前留名···
作者: taroxd    时间: 2015-10-5 12:14
直接用 npm + package.json 不可以吗?
作者: LBQ    时间: 2015-10-5 12:31
taroxd 发表于 2015-10-5 12:14
直接用 npm + package.json 不可以吗?

为什么选择自己造了一个Package Manager
其实我有一个更完整的介绍:http://ninesyllables.org/skyscrapde-jian-jie/
也许这个更完整的版本能更加突出这个的优势

1:NPM的问题
Npm的目的是为代码而生,并没有考虑到其他的因素比如说素材啊啥的。

为什么没有用Npm的dependency解决思路是因为:
1:那样需要browsify才能在浏览器上运行
2:门槛上升

没有用Npm的原因是:
1:我们需要素材打包,很多脚本也需要素材。Npm只支持js。
2:RM结构需要被大改,本来RM就不太符合npm的架构思路

也许插件作者可以用npm解决自己脚本问题并且最后browsify,但是最终用户安装不能npm install。

2:Bower的问题
很简单:他给你安装到其他的文件夹去了。

改这个目标文件夹
1:很烦
2:不能把素材放到该放的文件夹去,我们需要复制粘贴

于是就自己写了
作者: 1697665228    时间: 2015-10-7 17:46
MV你真的買了嗎?好膩骸,我手裏只有六十,到了發售日應該能攢到150,購買升值後的MV了,MV能發佈多平臺的遊戲很方便呢,話說這到底是什麼?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1