Greasy Fork is available in English.
Makes a window with speed and zoom seekbars (double click to reset)
当前为
// Changed in 0.3.1: Added zoom seekbar and now using current speed instead of 1
// More changes in^: Speed can no longer be changed to 0, added double-click tip, sync with zoom and speed updates
// Changes in 0.3.2: Values update while you slide the thumb
// Changes in 0.3.3: Some stuff did not get saved...
// Changes in 0.3.4: Fixed 'double click reset' error
// ==UserScript==
// @name OWOP Zpeed
// @namespace http://greasyfork.icu/users/200700
// @version 0.3.4
// @description Makes a window with speed and zoom seekbars (double click to reset)
// @author SuperOP535
// @match *.ourworldofpixels.com/*
// @grant none
// ==/UserScript==
function openSeekbarWindow() {
OWOP.windowSys.addWindow(new OWOP.windowSys.class.window('OWOP Zpeed by SuperOP535', {}, function(win) {
win.container.title = 'Tip: You can double-click a seekbar to reset it to default value';
win.container.style.height = '34px';
win.container.style.overflow = 'hidden';
win.addObj(document.createTextNode('Speed: '));
var speedbar = OWOP.util.mkHTML('input', {
type: 'range', style: '-moz-appearance:none;-webkit-appearance:none;appearance:none;height:6px;outline:none;float:right;',
min: 1, max: 100,
value: OWOP.options.movementSpeed,
oninput: function() {
OWOP.options.movementSpeed = this.value;
}, ondblclick:function() {
this.value = 1;
this.oninput();
}
});
win.addObj(speedbar);
// sync with speed updates
Object.defineProperty(OWOP.options, 'movementSpeed', { get: function() { return speedbar.value; }, set: function(a) { speedbar.value=a; } });
win.addObj(OWOP.util.mkHTML('br'));
win.addObj(document.createTextNode('Zoom: '));
var zoombar = OWOP.util.mkHTML('input', {
type: 'range', style: '-moz-appearance:none;-webkit-appearance:none;appearance:none;height:6px;outline:none;float:right;',
value: OWOP.camera.zoom, min: OWOP.options.zoomLimitMin, max: OWOP.options.zoomLimitMax,
oninput: function() {
OWOP.camera.zoom = this.value;
}, ondblclick: function() {
this.value = OWOP.options.defaultZoom;
this.oninput();
}
});
win.addObj(zoombar);
// sync with zoom updates
var zoomsetOld = Object.getOwnPropertyDescriptor(OWOP.camera, 'zoom').set;
Object.defineProperty(OWOP.camera, 'zoom', { set: function(a) { zoombar.value=a; zoomsetOld.call(OWOP.camera, a); } });
}).move(window.innerWidth - 280, 32));
}
if(typeof OWOP != 'undefined') openSeekbarWindow();
window.addEventListener('load', function() {
setTimeout(openSeekbarWindow, 1234);
});