Skip to content

Commit

Permalink
use fixed common.js update
Browse files Browse the repository at this point in the history
  • Loading branch information
edvordo committed Mar 15, 2024
1 parent 2c10e37 commit 57769b2
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions RoA-QoL.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name RoA-QoL
// @namespace Reltorakii_is_awesome
// @version 2.8.6
// @version 2.8.7
// @description try to take over the world!
// @author Reltorakii
// @icon https://cdn.jsdelivr.net/gh/edvordo/[email protected]/resources/img/logo-32.png
Expand All @@ -11,7 +11,7 @@
// @resource QoLHeaderHTML https://cdn.jsdelivr.net/gh/edvordo/[email protected]/resources/templates/header.html
// @resource QoLSettingsHTML https://cdn.jsdelivr.net/gh/edvordo/[email protected]/resources/templates/settings.html
// @resource SpectrumCSS https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css
// @require https://cdn.jsdelivr.net/gh/edvordo/[email protected].4/common.js
// @require https://cdn.jsdelivr.net/gh/edvordo/[email protected].7/common.js
// @require https://cdn.jsdelivr.net/gh/ejci/[email protected]/favico.js
// @require https://cdn.jsdelivr.net/gh/omichelsen/[email protected]/index.js
// @require https://cdn.jsdelivr.net/gh/lodash/[email protected]/dist/lodash.min.js
Expand Down Expand Up @@ -2342,19 +2342,23 @@
if (false === data.results.hasOwnProperty('p')) {
return;
}
const { next_action, autos_max, autos_remaining } = data.results.p

if (!$('#autosRemaining').attr('data-toggle')) {
$('#autosRemaining').attr('data-toggle', 'tooltip').tooltip({placement: 'bottom center', container: 'body', html: true})
const { next_action, autos_max, autos_remaining } = data.results.p;

const autosRemainingElement = $('#autosRemaining');
const autosMaximumElement = $('#autosMaximum');

if (!autosRemainingElement.attr('data-toggle')) {
autosRemainingElement.attr('data-toggle', 'tooltip').tooltip({placement: 'bottom center', container: 'body', html: true});
}
if (!$('#autosMaximum').attr('data-toggle')) {
$('#autosMaximum').attr('data-toggle', 'tooltip').tooltip({placement: 'bottom center', container: 'body', html: true})
if (!autosMaximumElement.attr('data-toggle')) {
autosMaximumElement.attr('data-toggle', 'tooltip').tooltip({placement: 'bottom center', container: 'body', html: true});
}

let tmpl = '<h5>Based upon</h5>{next_action}s action timer <h5>Good for</h5>{estimate}';
const tmpl = '<h5>Based upon</h5>{next_action}s action timer <h5>Good for</h5>{estimate}';

$('#autosRemaining').attr({'data-original-title': tmpl.formatQoL({next_action: (next_action / 1000).toFixed(3), estimate: (autos_remaining * next_action).toTimeRemaining()})})
$('#autosMaximum').attr({'data-original-title': tmpl.formatQoL({next_action: (next_action / 1000).toFixed(3), estimate: (autos_max * next_action).toTimeRemaining()})})
autosRemainingElement.attr({'data-original-title': tmpl.formatQoL({next_action: (next_action / 1000).toFixed(3), estimate: (autos_remaining * next_action).toTimeRemaining()})});
autosMaximumElement.attr({'data-original-title': tmpl.formatQoL({next_action: (next_action / 1000).toFixed(3), estimate: (autos_max * next_action).toTimeRemaining()})});
},
processEventUpdate(message) {
fn.helpers.togglePerHourSection('event-update');
Expand Down

0 comments on commit 57769b2

Please sign in to comment.