mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Fix eslint rule 'no-trailing-spaces'
eslint --no-config-lookup --fix --rule '"no-trailing-spaces": 1' Ref: #7812 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
1da93a6d2f
commit
2b67499e05
19 changed files with 28 additions and 28 deletions
|
|
@ -1,14 +1,14 @@
|
|||
var state_before;
|
||||
var state_after;
|
||||
|
||||
function handleInputBeforeGui(ev)
|
||||
function handleInputBeforeGui(ev)
|
||||
{
|
||||
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
|
||||
state_before = Engine.HotkeyIsPressed("test");
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleInputAfterGui(ev)
|
||||
function handleInputAfterGui(ev)
|
||||
{
|
||||
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
|
||||
state_after = Engine.HotkeyIsPressed("test");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ TestScript1A.prototype.GetX = function() {
|
|||
this.entity = -1;
|
||||
Engine.TS_FAIL("Missed exception");
|
||||
} catch (e) { }
|
||||
|
||||
|
||||
// and return the value
|
||||
return this.entity;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function AdditionHelper(a, b)
|
||||
function AdditionHelper(a, b)
|
||||
{
|
||||
return a+b;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ function parseCmdLineArgs(settings, cmdLineArgs)
|
|||
settings.playerPlacement.setValue(cmdLineArgs['autostart-placement'] ?? "random");
|
||||
if ('autostart-visibility' in cmdLineArgs)
|
||||
{
|
||||
switch (cmdLineArgs['autostart-visibility'])
|
||||
switch (cmdLineArgs['autostart-visibility'])
|
||||
{
|
||||
case 'revealed':
|
||||
settings.mapExploration.setAllied(true);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ GameSettings.prototype.Attributes.VictoryConditions = class VictoryConditions ex
|
|||
_add(currentActive, currentDisabled, names)
|
||||
{
|
||||
let active = clone(currentActive);
|
||||
for (const name of names)
|
||||
for (const name of names)
|
||||
{
|
||||
if (currentDisabled.has(name))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function init(initData)
|
|||
this.settings.fromInitAttributes(initData.attribs);
|
||||
|
||||
this.settings.launchGame(initData.playerAssignments, initData.storeReplay);
|
||||
|
||||
|
||||
Engine.SwitchGuiPage("page_loading.xml", {
|
||||
"attribs": this.settings.finalizedAttributes,
|
||||
"playerAssignments": initData.playerAssignments
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class SavedGameLabel
|
|||
const savedGameLabel = Engine.GetGUIObjectByName("savedGameLabel");
|
||||
let labelWidth = Math.min(Engine.GetTextWidth(savedGameLabel.font, savedGameLabel.caption) + 10, maxWidth);
|
||||
|
||||
if (isSavedGame)
|
||||
if (isSavedGame)
|
||||
{
|
||||
savedGameLabel.parent.size = new GUISize(
|
||||
bottomRightPanel.size.left - labelWidth - marginRight,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class TipDisplay
|
|||
const random = Math.random() * totalProbability;
|
||||
|
||||
let cumulative = 0;
|
||||
for (const category of tipFiles)
|
||||
for (const category of tipFiles)
|
||||
{
|
||||
cumulative += (isMultiplayer ? category.loadingScreenOccurrence_MP : category.loadingScreenOccurrence_SP);
|
||||
if (random <= cumulative)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class TimeNotificationOverlay
|
|||
constructor(playerViewControl)
|
||||
{
|
||||
this.notificationText = Engine.GetGUIObjectByName("notificationText");
|
||||
|
||||
|
||||
registerSimulationUpdateHandler(this.rebuild.bind(this));
|
||||
playerViewControl.registerViewedPlayerChangeHandler(this.rebuild.bind(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1093,7 +1093,7 @@ var g_UnitActions =
|
|||
return false;
|
||||
|
||||
let actionInfo = getActionInfo("focus-fire", target, selection);
|
||||
|
||||
|
||||
return actionInfo.possible && {
|
||||
"type": "focus-fire",
|
||||
"cursor": actionInfo.cursor,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen");
|
|||
Engine.LoadLibrary("rmgen-common");
|
||||
Engine.LoadLibrary("rmbiome");
|
||||
|
||||
function* GenerateMap(mapSettings)
|
||||
function* GenerateMap(mapSettings)
|
||||
{
|
||||
|
||||
setBiome(mapSettings.Biome);
|
||||
|
|
@ -73,7 +73,7 @@ function* GenerateMap(mapSettings)
|
|||
let startAngle = 0;
|
||||
if ((pattern === "stronghold") || (pattern === "river"))
|
||||
{
|
||||
if (teams.length != 2)
|
||||
if (teams.length != 2)
|
||||
{
|
||||
throw new Error("Too many teams for " + pattern + ", use circle or make two teams.");
|
||||
pattern = "circle";
|
||||
|
|
@ -180,7 +180,7 @@ function* GenerateMap(mapSettings)
|
|||
]);
|
||||
|
||||
g_Map.log("Creating Plateau");
|
||||
for (let m = 0; m < randIntInclusive(120, 240); ++m)
|
||||
for (let m = 0; m < randIntInclusive(120, 240); ++m)
|
||||
{
|
||||
let elevRand = randIntInclusive(18, 22);
|
||||
createArea(
|
||||
|
|
@ -199,7 +199,7 @@ function* GenerateMap(mapSettings)
|
|||
],
|
||||
[avoidClasses(clNotMountain, 2, clMountain, 3)]);
|
||||
}
|
||||
for (let m = 0; m < randIntInclusive(100, 180); ++m)
|
||||
for (let m = 0; m < randIntInclusive(100, 180); ++m)
|
||||
{
|
||||
const elevRand = randIntInclusive(24, 38);
|
||||
createArea(
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function* GenerateMap(mapSettings)
|
|||
yield 20;
|
||||
|
||||
|
||||
for (let m = 0; m < randIntInclusive(40, 90); ++m)
|
||||
for (let m = 0; m < randIntInclusive(40, 90); ++m)
|
||||
{
|
||||
let elevRand = randIntInclusive(6, 12);
|
||||
createArea(
|
||||
|
|
@ -127,7 +127,7 @@ function* GenerateMap(mapSettings)
|
|||
],
|
||||
[avoidClasses(clPlayer, 34, clHill, 8)]);
|
||||
}
|
||||
for (let m = 0; m < randIntInclusive(60, 100); ++m)
|
||||
for (let m = 0; m < randIntInclusive(60, 100); ++m)
|
||||
{
|
||||
const elevRand = randIntInclusive(14, 36);
|
||||
createArea(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen");
|
|||
Engine.LoadLibrary("rmgen-common");
|
||||
Engine.LoadLibrary("rmbiome");
|
||||
|
||||
function* GenerateMap(mapSettings)
|
||||
function* GenerateMap(mapSettings)
|
||||
{
|
||||
setBiome(mapSettings.Biome);
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ function* GenerateMap(mapSettings)
|
|||
undefined);
|
||||
|
||||
g_Map.log("Creating player islands");
|
||||
for (let i = 0; i < numPlayers; ++i)
|
||||
for (let i = 0; i < numPlayers; ++i)
|
||||
{
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius() * 1.75), 0.8, 0.1, Infinity, playerPosition[i]),
|
||||
|
|
@ -319,7 +319,7 @@ function* GenerateMap(mapSettings)
|
|||
3 * numPlayers, 50
|
||||
);
|
||||
|
||||
if (currentBiome() == "generic/savanna")
|
||||
if (currentBiome() == "generic/savanna")
|
||||
{
|
||||
g_Map.log("Creating Island Fauna");
|
||||
group = new SimpleGroup(
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ function createAreas(centeredPlacer, painter, constraints, amount, retryFactor =
|
|||
function createAreasInAreas(centeredPlacer, painter, constraints, amount, retryFactor, areas)
|
||||
{
|
||||
areas = areas.filter(area => area.getPoints().length);
|
||||
if (!areas.length)
|
||||
if (!areas.length)
|
||||
{
|
||||
log("createAreasInAreas: 'areas' was either empty or only contained empty areas thus returning an empty array.\n" + new Error().stack);
|
||||
return [];
|
||||
|
|
@ -196,7 +196,7 @@ function createObjectGroups(group, player, constraints, amount, retryFactor = 10
|
|||
function createObjectGroupsByAreas(group, player, constraints, amount, retryFactor, areas, behaveDeprecated = false)
|
||||
{
|
||||
areas = areas.filter(area => area.getPoints().length);
|
||||
if (!areas.length)
|
||||
if (!areas.length)
|
||||
{
|
||||
log("createObjectGroupsByAreas: 'areas' was either empty or only contained empty areas.\n" + new Error().stack);
|
||||
return [];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Trigger.prototype.CounterMessage = function(data)
|
|||
{
|
||||
var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface);
|
||||
cmpGUIInterface.PushNotification({
|
||||
"players": [1, 2],
|
||||
"players": [1, 2],
|
||||
"message": markForTranslation("Cutscene starts after 5 seconds"),
|
||||
"translateMessage": true
|
||||
});
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater)
|
|||
y = 0;
|
||||
let loop = false;
|
||||
// vertical iteration
|
||||
do
|
||||
do
|
||||
{
|
||||
--y;
|
||||
loop = false;
|
||||
|
|
@ -323,7 +323,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater)
|
|||
let reachLeft = false;
|
||||
let reachRight = false;
|
||||
let index;
|
||||
do
|
||||
do
|
||||
{
|
||||
index = newIndex + w*y;
|
||||
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ PETRA.DefenseManager.prototype.checkEvents = function(gameState, events)
|
|||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// TODO integrate other ships later, need to be sure it is accessible.
|
||||
if (target.hasClass("Ship"))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ BuildingAI.prototype.FireArrows = function()
|
|||
const yOrigin = cmpAttack.GetAttackYOrigin(attackType);
|
||||
|
||||
let firedArrows = 0;
|
||||
let targetIndex = 0;
|
||||
let targetIndex = 0;
|
||||
while (firedArrows < arrowsToFire && targetIndex < targets.length)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -3980,7 +3980,7 @@ UnitAI.prototype.PushOrder = function(type, data)
|
|||
"data": this.order.data
|
||||
});
|
||||
// Check if the order appears to have been rejected
|
||||
if (wasIdle && !this.order)
|
||||
if (wasIdle && !this.order)
|
||||
{
|
||||
this.UnitFsm.ProcessMessage(this, {
|
||||
"type": "ReenterIdle",
|
||||
|
|
|
|||
Loading…
Reference in a new issue