DH3 Combat Shortcut Improvement

Adds some things (like castle) to the new combat shortcut dialogue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         DH3 Combat Shortcut Improvement
// @namespace    com.anwinity.dh3
// @version      1.0.0
// @description  Adds some things (like castle) to the new combat shortcut dialogue.
// @author       Anwinity
// @match        dh3.diamondhunt.co
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function addCastleRow(n) {


        $("#dialogue-combat-shortcut tbody").append(`
          <tr id="dialogue-combat-shortcut-castle-row" style="background-image:url(images/dungeon_background.png);background-size:100% 100%;" class="tr-combat-shortcut"><td style="font-size:20pt;">CASTLE</td>
            <td>
              <img src="images/knight5_monster_idle_0.png" style="height: 90px;" />
            </td>
            <td style="color:white">
              <img src="images/castleChest.png" class="img-30" style="cursor: pointer" onclick="clicksCastleChest()">
              <br/>
              <span>${formatNumber(parseInt(window.var_castlePoints||"0"))}</span>
            </td>
            <td style="color:white">

            </td>
            <td class="td-combat-shortcut-button">
              <span onclick="changeCombatMap(14);closeDialogue(&quot;dialogue-combat-shortcut&quot;);" class="combat-shortcut-button">MAP</span>
            </td>
            <td class="td-combat-shortcut-button">
              <span onclick="sendBytes('FIGHT_SOLDIERS');closeDialogue(&quot;dialogue-combat-shortcut&quot;);" class="combat-shortcut-button">FIGHT</span>
            </td>
          </tr>
          `);
    }

    function init() {
        if(!window.var_username) {
            setTimeout(init, 1000);
            return;
        }

        $("#dialogue-confirm2").css("z-index", "9999");

        const original_openCombatShortcut = window.openCombatShortcut;
        window.openCombatShortcut = function() {
            original_openCombatShortcut.apply(this, arguments);
            addCastleRow();
        }
    }

    $(init);

})();