WoD Skill Config Insertion

Make it easier to insert actions in skill config.

当前为 2020-07-19 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         WoD Skill Config Insertion
// @namespace    https://www.wannaexpresso.com
// @version      0.1
// @description  Make it easier to insert actions in skill config.
// @author       DotIN13
// @include        https://*.wannaexpresso.com/wod/spiel/hero/skillconf*
// @include        http*://*.world-of-dungeons.*/wod/spiel/hero/skillconf*
// @grant        none
// ==/UserScript==


var insertButton = document.createElement("div");
insertButton.innerHTML = "插入";


WodUiActionList.prototype.insertAction = function(action, index) {
    this.list.insertItem(new WodUiActionListItem(action), index);
};

["preroundActionList", "roundActionList"].forEach(el => {
    var _this = THE_ORDERS.dungeon.level[el];
    _this.list.addButton(new WodUiImage('button-copy.png', 24, 24, "插入"), function() {
        var src = _this.getSelectedAction();

        if (typeof src != undefined) {
            var dst = new WodAction();

            dst.copyFrom(src);
            _this.insertAction(dst, _this.list.getSelectedIndex());
            _this.rebuildModel();
            _this.list.setSelectedIndex( _this.list.getSelectedIndex()+1 );
        }
    })
})