Greasy Fork

来自缓存

Greasy Fork is available in English.

MH: Living Garden HUD Enhancer

Quick travel buttons for the Living Garden area location. More features comning soon.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         MH: Living Garden HUD Enhancer
// @author       Warden Slayer - Warden Slayer#2302
// @namespace    http://greasyfork.icu/en/users/227259-wardenslayer
// @version      1.0
// @description  Quick travel buttons for the Living Garden area location. More features comning soon.
// @include      https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @include      http://www.mousehuntgame.com/*
// @include      https://www.mousehuntgame.com/*
// ==/UserScript==
$(document).ready(function() {
    const debug = localStorage.getItem('ws.debug');
    const location = user.environment_name;
    if (location == 'Twisted Garden') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else if (location == 'Cursed City') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else if (location == 'Sand Crypts') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else if (location == 'Living Garden') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else if (location == 'Lost City') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else if (location == 'Sand Dunes') {
        if (debug == true) {
            console.log('LG Script Started');
        }
        buildTravelHUD();
    } else {if (debug == true) {
        console.log('Not in the LG region');
    }
           }
})

function buildTravelHUD() {
    const itemContainer = $('.itemContainer');
    if ($('.travelHudLg').length == 0) {
        const travelHudLg = document.createElement('div');
        travelHudLg.classList.add('travelHudLg');
        $(travelHudLg).css({
            'width': '100%',
        });
        //Garden Button
        const gardenButton = document.createElement('div');
        gardenButton.classList.add('gardenButton');
        $(gardenButton).text('Garden');
        $(gardenButton).css({
            'width': '40px',
            'height': '15px',
            'float': 'left',
            'text-align': 'center',
            'margin-right': '3px',
            'margin-top': '2px',
            'border': '1px solid',
            'background-color': 'rgb(49, 129, 34)',
            'cursor': 'pointer',
        });
        travelHudLg.append(gardenButton);
        //City Button
        const cityButton = document.createElement('div');
        cityButton.classList.add('cityButton');
        $(cityButton).text('City');
        $(cityButton).css({
            'width': '40px',
            'height': '15px',
            'float': 'left',
            'text-align': 'center',
            'margin-right': '3px',
            'margin-top': '2px',
            'border': '1px solid',
            'background-color': '#6dd0e5',
            'cursor': 'pointer',
        });
        travelHudLg.append(cityButton);
        //Sand Button
        const sandButton = document.createElement('div');
        sandButton.classList.add('sandButton');
        $(sandButton).text('Sand');
        $(sandButton).css({
            'width': '40px',
            'height': '15px',
            'float': 'left',
            'text-align': 'center',
            'margin-top': '2px',
            'border': '1px solid',
            'background-color': '#c7ae8f',
            'cursor': 'pointer',
        });
        travelHudLg.append(sandButton);
        //Last
        itemContainer.append(travelHudLg);
    }

}
$(document).on('click', '.gardenButton', function() {
    app.pages.TravelPage.travel('desert_oasis');
    setTimeout(buildTravelHUD, 500);
})
$(document).on('click', '.cityButton', function() {
    app.pages.TravelPage.travel('lost_city');
    setTimeout(buildTravelHUD, 500);
})
$(document).on('click', '.sandButton', function() {
    app.pages.TravelPage.travel('sand_dunes');
    setTimeout(buildTravelHUD, 500);
})