mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Fix new and profiler eslint warnings
This fixes 'no-trailing-spaces', 'semi', 'prefer-const' that made it in since and 'no-shadow', 'no-multi-assign', 'no-invalid-this' as well as 'no-undef-init' in profiler. Ref: #7812 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
+3
-3
@@ -112,12 +112,12 @@ PlayerSettingControls.PlayerAssignment = class PlayerAssignment extends GameSett
|
||||
this.setSelectedValue(ai.bot);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const isRemoved = g_GameSettings.playerRemoved.get(this.playerIndex);
|
||||
if (isRemoved)
|
||||
{
|
||||
this.rebuildList();
|
||||
this.setSelectedValue(this.removedItem.Value)
|
||||
this.setSelectedValue(this.removedItem.Value);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,4 +312,4 @@ PlayerSettingControls.PlayerAssignment.prototype.AutocompleteOrder = 100;
|
||||
|
||||
PlayerAssignmentItem.Removed.prototype.Tags =
|
||||
{ "color": "255 140 140" };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ function* GenerateMap(mapSettings)
|
||||
const clNotMountain = g_Map.createTileClass();
|
||||
const plateauPosition = fractionToTiles(0.85);
|
||||
|
||||
let pattern = g_MapSettings.PlayerPlacement;
|
||||
const pattern = g_MapSettings.PlayerPlacement;
|
||||
const teams = getTeamsArray();
|
||||
let startAngle = 0;
|
||||
if ((pattern === "stronghold") || (pattern === "river"))
|
||||
|
||||
@@ -120,7 +120,7 @@ function draw_frequency_graph()
|
||||
nb.textContent = type + " - n=" + time_by_frame.length;
|
||||
legend.appendChild(nb);
|
||||
|
||||
for (var i = 0; i < time_by_frame.length; i++)
|
||||
for (let i = 0; i < time_by_frame.length; i++)
|
||||
{
|
||||
let x0 = i/time_by_frame.length*(canvas.width-padding*2) + padding;
|
||||
if (i == 0)
|
||||
@@ -157,7 +157,7 @@ function draw_frequency_graph()
|
||||
canvas._tooltips.push({
|
||||
'x0': +i, 'x1': +i+1,
|
||||
'y0': 0, 'y1': canvas.height,
|
||||
'text': function(text) { return function() { return text; }; }(text)
|
||||
'text': function() { return text; }
|
||||
});
|
||||
}
|
||||
set_tooltip_handlers(canvas);
|
||||
@@ -233,7 +233,7 @@ function draw_history_graph()
|
||||
|
||||
const time_by_frame = series_data[type];
|
||||
let last_val = 0;
|
||||
for (var i = 0; i < frames_nb; i++)
|
||||
for (let i = 0; i < frames_nb; i++)
|
||||
{
|
||||
const smoothed_time = time_by_frame[i];// smooth_1D(time_by_frame.slice(0), i, 3);
|
||||
|
||||
@@ -275,7 +275,7 @@ function draw_history_graph()
|
||||
canvas._tooltips.push({
|
||||
'x0': +i, 'x1': +i+1,
|
||||
'y0': 0, 'y1': canvas.height,
|
||||
'text': function(text) { return function() { return text; }; }(text)
|
||||
'text': function() { return text; }
|
||||
});
|
||||
}
|
||||
set_tooltip_handlers(canvas);
|
||||
|
||||
@@ -26,7 +26,9 @@ function hslToRgb(h, s, l, a)
|
||||
|
||||
if (s == 0)
|
||||
{
|
||||
r = g = b = l;
|
||||
r = l;
|
||||
g = l;
|
||||
b = l;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -152,10 +154,10 @@ function set_tooltip_handlers(canvas)
|
||||
if (!tooltips)
|
||||
return;
|
||||
|
||||
var relativeX = event.pageX - this.getBoundingClientRect().left - window.scrollX;
|
||||
var relativeY = event.pageY - this.getBoundingClientRect().top - window.scrollY;
|
||||
var relativeX = event.pageX - canvas.getBoundingClientRect().left - window.scrollX;
|
||||
var relativeY = event.pageY - canvas.getBoundingClientRect().top - window.scrollY;
|
||||
|
||||
var text = undefined;
|
||||
var text;
|
||||
for (var i = 0; i < tooltips.length; ++i)
|
||||
{
|
||||
var t = tooltips[i];
|
||||
@@ -183,7 +185,7 @@ function set_tooltip_handlers(canvas)
|
||||
}
|
||||
|
||||
$(canvas).mousemove(function(event) {
|
||||
do_tooltip.call(this, event);
|
||||
do_tooltip(event);
|
||||
});
|
||||
$(canvas).mouseleave(function(event) {
|
||||
$('#tooltip').css('visibility', 'hidden');
|
||||
|
||||
Reference in New Issue
Block a user