WoD Skill Config Insertion

Make it easier to insert actions in skill config.

  1. // ==UserScript==
  2. // @name WoD Skill Config Insertion
  3. // @namespace https://www.wannaexpresso.com
  4. // @version 0.3
  5. // @description Make it easier to insert actions in skill config.
  6. // @author DotIN13
  7. // @include https://*.wannaexpresso.com/wod/spiel/hero/skillconf*
  8. // @include http*://*.world-of-dungeons.*/wod/spiel/hero/skillconf*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. WodUiActionList.prototype.insertAction = function(action, index) {
  13. this.list.insertItem(new WodUiActionListItem(action), index);
  14. };
  15.  
  16. (function () {
  17. 'use strict';
  18.  
  19. // Frontend button
  20. var insertButton = document.createElement("div");
  21. insertButton.innerHTML = "插入";
  22.  
  23. // Add insertion button to both preroundAction and roundAction lists
  24. ["preroundActionList", "roundActionList"].forEach(el => {
  25. var _this = THE_ORDERS.dungeon.level[el];
  26.  
  27. // Add a text button using native JavaScript to distinguish from the existing copy button
  28. var insertButton = document.createElement("button");
  29. insertButton.innerHTML = "插";
  30. insertButton.setAttribute("style", "color: white; background-color: #191919; width: 24px; height: 24px; padding: 0; text-align: center; font-weight: bold;");
  31. insertButton.addEventListener("click", function(e) {
  32. e.preventDefault();
  33. var src = _this.getSelectedAction();
  34.  
  35. if (typeof src != undefined) {
  36. var dst = new WodAction();
  37.  
  38. dst.copyFrom(src);
  39. _this.insertAction(dst, _this.list.getSelectedIndex());
  40. _this.rebuildModel();
  41. _this.list.setSelectedIndex( _this.list.getSelectedIndex()+1 );
  42. }
  43. });
  44.  
  45. _this.list.buttonTd.element.appendChild(insertButton);
  46.  
  47. /*_this.list.addButton(new WodUiImage('button-copy.png', 24, 24, "插入"), function() {
  48. var src = _this.getSelectedAction();
  49.  
  50. if (typeof src != undefined) {
  51. var dst = new WodAction();
  52.  
  53. dst.copyFrom(src);
  54. _this.insertAction(dst, _this.list.getSelectedIndex());
  55. _this.rebuildModel();
  56. _this.list.setSelectedIndex( _this.list.getSelectedIndex()+1 );
  57. }
  58. })*/
  59.  
  60. // Make buttons sticky
  61. var buttons = _this.list.buttonTd.element;
  62. var stickyButtons = document.createElement("div");
  63. while (buttons.childNodes.length) {
  64. stickyButtons.appendChild(buttons.firstChild);
  65. }
  66. buttons.appendChild(stickyButtons);
  67. stickyButtons.setAttribute("style", "position: sticky; top: 0;");
  68. _this.list.buttonTd = stickyButtons;
  69.  
  70. // Make modBox sticky
  71. _this.modBox.element.setAttribute("style", "width: 300px; padding-bottom: 10px; float: right; position: sticky; top: 0;");
  72. })
  73. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址