Page MenuHomeWildfire Games

List multiselection
AbandonedPublic

Authored by Silier on Feb 28 2018, 9:58 PM.

Details

Reviewers
vladislavbelov
wraitii
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Trac Tickets
#4683
Summary

Implemented C++:

multi selection with SHIFT
adding and removing from selection using CTRL

Implemented JS:

load game
save game
replay menu

Test Plan

Apply patch,
open load, save and replay menu.
Check multi selecting with shift and single adding/removing to/from selection holding ctrl

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Stan added inline comments.Mar 15 2018, 7:54 PM
source/gui/CList.cpp
145

Range loop maybe. Else ++it if you can't find a better name.

source/gui/COList.cpp
313

Range loop selecteditem for the name felse invert iterator

Silier updated this revision to Diff 6592.May 20 2018, 9:42 AM

small update

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  51|  51| 		toDeleteNames.push(gameSelection.list[selected]);
|  52|  52| 	}
|  53|  53| 	else
|  54|    |-	{
|    |  54|+	
|  55|  55| 		for (let selected of gameSelection.multiSelected)
|  56|  56| 		{
|  57|  57| 			toDelete.push(gameSelection.list_data[selected]);
|  58|  58| 			toDeleteNames.push(gameSelection.list[selected]);
|  59|  59| 		}
|  60|    |-	}
|    |  60|+	
|  61|  61| 
|  62|  62| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  63|  63| 		reallyDeleteGame(toDelete);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  67|  67| 			sprintf(translate("\"%(label)s\""), {
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  70|+				"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  71|+				"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|    |-			toDeleteNames.length
|    |  72|+				toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|  75|  75| 			[translate("No"), translate("Yes")],
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  80|  80| function reallyDeleteGame(gameIDs)
|  81|  81| {
|  82|  82| 	for (let gameID of gameIDs)
|  83|    |-	{
|    |  83|+	
|  84|  84| 		if (!Engine.DeleteSavedGame(gameID))
|  85|  85| 			error("Could not delete saved game: " + gameID);
|  86|    |-	}
|    |  86|+	
|  87|  87| 	// Run init again to refresh saved game list
|  88|  88| 	init();
|  89|  89| }

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 167| 167| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 168| 168| 	}
| 169| 169| 	else
| 170|    |-	{
|    | 170|+	
| 171| 171| 		for (selected of replaySelection.multiSelected)
| 172| 172| 		{
| 173| 173| 			directories.push(g_ReplaysFiltered[selected].directory);
| 174| 174| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 175| 175| 		}
| 176|    |-	}
|    | 176|+	
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180|    |-		"Are you sure you want to delete these replays permanently?",
|    | 180|+			"Are you sure you want to delete these replays permanently?",
| 181| 181| 		directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180| 180| 		"Are you sure you want to delete these replays permanently?",
| 181|    |-		directories.length
|    | 181|+			directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
| 184| 184| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 200| 200| 	if (!replaySelection.multiSelected.length)
| 201| 201| 		directories.push(g_ReplaysFiltered[selected].directory);
| 202| 202| 	else
| 203|    |-	{
|    | 203|+	
| 204| 204| 		for (selected of replaySelection.multiSelected)
| 205| 205| 			directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	reallyDeleteReplay(directories);
| 208| 208| }
| 209| 209| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 218| 218| 	var selectedIndex = replaySelection.selected;
| 219| 219| 
| 220| 220| 	for (let replayDirectory of replayDirectories)
| 221|    |-	{
|    | 221|+	
| 222| 222| 		if (!Engine.DeleteReplay(replayDirectory))
| 223| 223| 			error("Could not delete replay!");
| 224|    |-	}
|    | 224|+	
| 225| 225| 
| 226| 226| 	// Refresh replay list
| 227| 227| 	init();

Link to build: https://jenkins.wildfiregames.com/job/differential/526/display/redirect

Silier updated this revision to Diff 7534.Mar 10 2019, 12:38 PM

rebase
@vladislavbelov chance to look into this? I would like to finish it :)

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/GUItypes.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CGUISeries.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/gui/GUI.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CList.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CGUIList.h
|   1| /*·Copyright·(C)·2009·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2009"

source/gui/GUIutil.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CList.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 167| 167| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 168| 168| 	}
| 169| 169| 	else
| 170|    |-	{
|    | 170|+	
| 171| 171| 		for (selected of replaySelection.multiSelected)
| 172| 172| 		{
| 173| 173| 			directories.push(g_ReplaysFiltered[selected].directory);
| 174| 174| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 175| 175| 		}
| 176|    |-	}
|    | 176|+	
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180|    |-		"Are you sure you want to delete these replays permanently?",
|    | 180|+			"Are you sure you want to delete these replays permanently?",
| 181| 181| 		directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180| 180| 		"Are you sure you want to delete these replays permanently?",
| 181|    |-		directories.length
|    | 181|+			directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
| 184| 184| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 200| 200| 	if (!replaySelection.multiSelected.length)
| 201| 201| 		directories.push(g_ReplaysFiltered[selected].directory);
| 202| 202| 	else
| 203|    |-	{
|    | 203|+	
| 204| 204| 		for (selected of replaySelection.multiSelected)
| 205| 205| 			directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	reallyDeleteReplay(directories);
| 208| 208| }
| 209| 209| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 218| 218| 	var selectedIndex = replaySelection.selected;
| 219| 219| 
| 220| 220| 	for (let replayDirectory of replayDirectories)
| 221|    |-	{
|    | 221|+	
| 222| 222| 		if (!Engine.DeleteReplay(replayDirectory))
| 223| 223| 			error("Could not delete replay!");
| 224|    |-	}
|    | 224|+	
| 225| 225| 
| 226| 226| 	// Refresh replay list
| 227| 227| 	init();

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  51|  51| 		toDeleteNames.push(gameSelection.list[selected]);
|  52|  52| 	}
|  53|  53| 	else
|  54|    |-	{
|    |  54|+	
|  55|  55| 		for (let selected of gameSelection.multiSelected)
|  56|  56| 		{
|  57|  57| 			toDelete.push(gameSelection.list_data[selected]);
|  58|  58| 			toDeleteNames.push(gameSelection.list[selected]);
|  59|  59| 		}
|  60|    |-	}
|    |  60|+	
|  61|  61| 
|  62|  62| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  63|  63| 		reallyDeleteGame(toDelete);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  67|  67| 			sprintf(translate("\"%(label)s\""), {
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  70|+				"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  71|+				"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|    |-			toDeleteNames.length
|    |  72|+				toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|  75|  75| 			[translate("No"), translate("Yes")],
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  80|  80| function reallyDeleteGame(gameIDs)
|  81|  81| {
|  82|  82| 	for (let gameID of gameIDs)
|  83|    |-	{
|    |  83|+	
|  84|  84| 		if (!Engine.DeleteSavedGame(gameID))
|  85|  85| 			error("Could not delete saved game: " + gameID);
|  86|    |-	}
|    |  86|+	
|  87|  87| 	// Run init again to refresh saved game list
|  88|  88| 	init();
|  89|  89| }

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1087/display/redirect

wraitii added reviewers: Restricted Owners Package, wraitii.Apr 22 2019, 9:37 AM
wraitii added a subscriber: wraitii.

Might also take a look at this.

wraitii requested changes to this revision.Apr 22 2019, 1:32 PM

I would suggest that C++ GUI lists are always "multi select", but we can enable/disable the actual multi-selection part. So change 'selected' to be a CIntList, which would return a one-sized array. Then JS code wouldn't have to awkwardly handle two cases.
That would imply modifying a lot of existing JS GUI code though. But it sounds greppable. So I'd say give it a shot, if it's too difficult I'll change my mind.

I'm also wondering whether we really need CIntList, but I guess it makes code more convenient. I would rename CList to CStringList then though, as that makes it obvious that both are specialised.

This revision now requires changes to proceed.Apr 22 2019, 1:32 PM
Silier updated this revision to Diff 7992.May 13 2019, 5:05 PM

Expand behaviour to control with keys (nextItem, previtem, firstItem, lastItem)

I like the idea with always using array, I ll try something later (just thinking about that it can make next/prev item selection not nice, but maybe rather that like what is now in js)

CIntList is wrapper around int vector something similar to CGUIList, maybe better name should be found that CIntList (it is needed to wrap int vector in class, else does not compile)

Silier planned changes to this revision.May 13 2019, 5:08 PM

Comments capitalisation and years.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/CGUISeries.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/gui/GUI.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CList.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/CGUIList.h
|   1| /*·Copyright·(C)·2009·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2009"

source/gui/GUItypes.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/gui/GUIutil.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  51|  51| 		toDeleteNames.push(gameSelection.list[selected]);
|  52|  52| 	}
|  53|  53| 	else
|  54|    |-	{
|    |  54|+	
|  55|  55| 		for (let selected of gameSelection.multiSelected)
|  56|  56| 		{
|  57|  57| 			toDelete.push(gameSelection.list_data[selected]);
|  58|  58| 			toDeleteNames.push(gameSelection.list[selected]);
|  59|  59| 		}
|  60|    |-	}
|    |  60|+	
|  61|  61| 
|  62|  62| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  63|  63| 		reallyDeleteGame(toDelete);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  67|  67| 			sprintf(translate("\"%(label)s\""), {
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  70|+				"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  71|+				"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|    |-			toDeleteNames.length
|    |  72|+				toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|  75|  75| 			[translate("No"), translate("Yes")],
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  80|  80| function reallyDeleteGame(gameIDs)
|  81|  81| {
|  82|  82| 	for (let gameID of gameIDs)
|  83|    |-	{
|    |  83|+	
|  84|  84| 		if (!Engine.DeleteSavedGame(gameID))
|  85|  85| 			error("Could not delete saved game: " + gameID);
|  86|    |-	}
|    |  86|+	
|  87|  87| 	// Run init again to refresh saved game list
|  88|  88| 	init();
|  89|  89| }

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 167| 167| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 168| 168| 	}
| 169| 169| 	else
| 170|    |-	{
|    | 170|+	
| 171| 171| 		for (selected of replaySelection.multiSelected)
| 172| 172| 		{
| 173| 173| 			directories.push(g_ReplaysFiltered[selected].directory);
| 174| 174| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 175| 175| 		}
| 176|    |-	}
|    | 176|+	
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180|    |-		"Are you sure you want to delete these replays permanently?",
|    | 180|+			"Are you sure you want to delete these replays permanently?",
| 181| 181| 		directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180| 180| 		"Are you sure you want to delete these replays permanently?",
| 181|    |-		directories.length
|    | 181|+			directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
| 184| 184| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 200| 200| 	if (!replaySelection.multiSelected.length)
| 201| 201| 		directories.push(g_ReplaysFiltered[selected].directory);
| 202| 202| 	else
| 203|    |-	{
|    | 203|+	
| 204| 204| 		for (selected of replaySelection.multiSelected)
| 205| 205| 			directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	reallyDeleteReplay(directories);
| 208| 208| }
| 209| 209| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 218| 218| 	var selectedIndex = replaySelection.selected;
| 219| 219| 
| 220| 220| 	for (let replayDirectory of replayDirectories)
| 221|    |-	{
|    | 221|+	
| 222| 222| 		if (!Engine.DeleteReplay(replayDirectory))
| 223| 223| 			error("Could not delete replay!");
| 224|    |-	}
|    | 224|+	
| 225| 225| 
| 226| 226| 	// Refresh replay list
| 227| 227| 	init();
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1383/display/redirect

Silier updated this revision to Diff 7996.May 13 2019, 6:04 PM

acutally backup comments and years before trying to experiment

Stan added a comment.May 13 2019, 6:04 PM

Just saw you planned changes XD

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
76 ↗(On Diff #7992)

does whatever uses that checks for null or undefined ?

83 ↗(On Diff #7992)

remove braces.

binaries/data/mods/public/gui/replaymenu/replay_actions.js
194

remove braces

205

remove braces.

source/gui/CGUIList.h
18 ↗(On Diff #6168)

You don't change that file at all so you might want to move it out of the diff.

1 ↗(On Diff #7992)

Year.

source/gui/CGUISeries.h
1 ↗(On Diff #7992)

Year.

17 ↗(On Diff #7992)

You don't change that file at all so you might want to move it out of the diff.

source/gui/CIntList.h
2

Year

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/CGUIList.h
|   1| /*·Copyright·(C)·2009·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2009"

source/gui/CGUISeries.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"
Executing section JS...

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 167| 167| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 168| 168| 	}
| 169| 169| 	else
| 170|    |-	{
|    | 170|+	
| 171| 171| 		for (selected of replaySelection.multiSelected)
| 172| 172| 		{
| 173| 173| 			directories.push(g_ReplaysFiltered[selected].directory);
| 174| 174| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 175| 175| 		}
| 176|    |-	}
|    | 176|+	
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 177| 177| 	messageBox(
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180|    |-		"Are you sure you want to delete these replays permanently?",
|    | 180|+			"Are you sure you want to delete these replays permanently?",
| 181| 181| 		directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 178| 178| 		500, 200,
| 179| 179| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 180| 180| 		"Are you sure you want to delete these replays permanently?",
| 181|    |-		directories.length
|    | 181|+			directories.length
| 182| 182| 		) + "\n" +
| 183| 183| 			escapeText(directoryNames.join("\n")),
| 184| 184| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 200| 200| 	if (!replaySelection.multiSelected.length)
| 201| 201| 		directories.push(g_ReplaysFiltered[selected].directory);
| 202| 202| 	else
| 203|    |-	{
|    | 203|+	
| 204| 204| 		for (selected of replaySelection.multiSelected)
| 205| 205| 			directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	reallyDeleteReplay(directories);
| 208| 208| }
| 209| 209| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 218| 218| 	var selectedIndex = replaySelection.selected;
| 219| 219| 
| 220| 220| 	for (let replayDirectory of replayDirectories)
| 221|    |-	{
|    | 221|+	
| 222| 222| 		if (!Engine.DeleteReplay(replayDirectory))
| 223| 223| 			error("Could not delete replay!");
| 224|    |-	}
|    | 224|+	
| 225| 225| 
| 226| 226| 	// Refresh replay list
| 227| 227| 	init();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  51|  51| 		toDeleteNames.push(gameSelection.list[selected]);
|  52|  52| 	}
|  53|  53| 	else
|  54|    |-	{
|    |  54|+	
|  55|  55| 		for (let selected of gameSelection.multiSelected)
|  56|  56| 		{
|  57|  57| 			toDelete.push(gameSelection.list_data[selected]);
|  58|  58| 			toDeleteNames.push(gameSelection.list[selected]);
|  59|  59| 		}
|  60|    |-	}
|    |  60|+	
|  61|  61| 
|  62|  62| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  63|  63| 		reallyDeleteGame(toDelete);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  67|  67| 			sprintf(translate("\"%(label)s\""), {
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  70|+				"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  68|  68| 				"label": toDeleteNames.join("\n")
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  71|+				"Saved games will be permanently deleted, are you sure?",
|  72|  72| 			toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  69|  69| 			}) + "\n" + translatePlural(
|  70|  70| 			"Saved game will be permanently deleted, are you sure?",
|  71|  71| 			"Saved games will be permanently deleted, are you sure?",
|  72|    |-			toDeleteNames.length
|    |  72|+				toDeleteNames.length
|  73|  73| 			),
|  74|  74| 			translate("DELETE"),
|  75|  75| 			[translate("No"), translate("Yes")],
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  80|  80| function reallyDeleteGame(gameIDs)
|  81|  81| {
|  82|  82| 	for (let gameID of gameIDs)
|  83|    |-	{
|    |  83|+	
|  84|  84| 		if (!Engine.DeleteSavedGame(gameID))
|  85|  85| 			error("Could not delete saved game: " + gameID);
|  86|    |-	}
|    |  86|+	
|  87|  87| 	// Run init again to refresh saved game list
|  88|  88| 	init();
|  89|  89| }

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  55| »   »   for·(let·selected·of·gameSelection.multiSelected)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'selected' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1385/display/redirect

Silier updated this revision to Diff 8027.May 14 2019, 2:30 PM

allways use multiselection array for list and olist

(dropdown inherit from list - I need to keep selected variable approach implemented - do not want to dropdown refactor too)

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  58|  58| 			sprintf(translate("\"%(label)s\""), {
|  59|  59| 				"label": toDeleteNames.join("\n")
|  60|  60| 			}) + "\n" + translatePlural(
|  61|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  61|+				"Saved game will be permanently deleted, are you sure?",
|  62|  62| 			"Saved games will be permanently deleted, are you sure?",
|  63|  63| 			toDeleteNames.length
|  64|  64| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  59|  59| 				"label": toDeleteNames.join("\n")
|  60|  60| 			}) + "\n" + translatePlural(
|  61|  61| 			"Saved game will be permanently deleted, are you sure?",
|  62|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  62|+				"Saved games will be permanently deleted, are you sure?",
|  63|  63| 			toDeleteNames.length
|  64|  64| 			),
|  65|  65| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  60|  60| 			}) + "\n" + translatePlural(
|  61|  61| 			"Saved game will be permanently deleted, are you sure?",
|  62|  62| 			"Saved games will be permanently deleted, are you sure?",
|  63|    |-			toDeleteNames.length
|    |  63|+				toDeleteNames.length
|  64|  64| 			),
|  65|  65| 			translate("DELETE"),
|  66|  66| 			[translate("No"), translate("Yes")],

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  47|  47|  * The playerlist will be assembled using these values.
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|    |-	"available": { "color": "0 219 0",     "status": translate("Online") },
|    |  50|+	"available": { "color": "0 219 0", "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'away'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away": { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away":      { "color": "229 76 13", "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'playing'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing": { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing":   { "color": "200 0 0", "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'offline'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline": { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline":   { "color": "0 0 0", "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'unknown'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|    |-	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    |  54|+	"unknown": { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|  57|  57| var g_RoleNames = {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 219| 219| 					me ?
| 220| 220| 						translate("You have been muted.") :
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222|    |-				newrole == "moderator" ?
|    | 222|+					newrole == "moderator" ?
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 220| 220| 						translate("You have been muted.") :
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222| 222| 				newrole == "moderator" ?
| 223|    |-					me ?
|    | 223|+						me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222| 222| 				newrole == "moderator" ?
| 223| 223| 					me ?
| 224|    |-						translate("You are now a moderator.") :
|    | 224|+							translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 222| 222| 				newrole == "moderator" ?
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225|    |-						translate("%(nick)s is now a moderator.") :
|    | 225|+							translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226|    |-				msg.oldrole == "visitor" ?
|    | 226|+						msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227|    |-					me ?
|    | 227|+							me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228|    |-						translate("You have been unmuted.") :
|    | 228|+								translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229|    |-						translate("%(nick)s has been unmuted.") :
|    | 229|+								translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230|    |-					me ?
|    | 230|+							me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231|    |-						translate("You are not a moderator anymore.") :
|    | 231|+								translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
| 234| 234| 			addChatMessage({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232|    |-						translate("%(nick)s is not a moderator anymore.");
|    | 232|+								translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
| 234| 234| 			addChatMessage({
| 235| 235| 				"text": "/special " + sprintf(txt, { "nick": msg.nick }),
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 777| 777| function toggleBuddy()
| 778| 778| {
| 779| 779| 	let playerList = Engine.GetGUIObjectByName("playersBox");
| 780|    |-	
|    | 780|+
| 781| 781| 	let selected  = playerList.multiSelected[0];
| 782| 782| 	let name = playerList.list[selected];
| 783| 783| 	if (!name || name == g_Username || name.indexOf(g_BuddyListDelimiter) != -1)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 778| 778| {
| 779| 779| 	let playerList = Engine.GetGUIObjectByName("playersBox");
| 780| 780| 	
| 781|    |-	let selected  = playerList.multiSelected[0];
|    | 781|+	let selected = playerList.multiSelected[0];
| 782| 782| 	let name = playerList.list[selected];
| 783| 783| 	if (!name || name == g_Username || name.indexOf(g_BuddyListDelimiter) != -1)
| 784| 784| 		return;
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 998| 998| 	let sortBy = gamesBox.selected_column;
| 999| 999| 	let sortOrder = gamesBox.selected_column_order;
|1000|1000| 	let selected = gamesBox.multiSelected.length ? gamesBox.multiSelected[0] : -1;
|1001|    |-	
|    |1001|+
|1002|1002| 	if (selected > -1)
|1003|1003| 	{
|1004|1004| 		g_SelectedGameIP = g_GameList[gamesBox.selected].ip;

binaries/data/mods/public/gui/lobby/lobby.js
| 829| »   »   »   else·if·(!foundAsObserver)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/lobby/lobby.js
|1047| »   »   switch·(sortBy)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/lobby/lobby.js
| 730| »   »   case·'name':
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'default'.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 168| 168| 	messageBox(
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171|    |-		"Are you sure you want to delete these replays permanently?",
|    | 171|+			"Are you sure you want to delete these replays permanently?",
| 172| 172| 		directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171| 171| 		"Are you sure you want to delete these replays permanently?",
| 172|    |-		directories.length
|    | 172|+			directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
| 175| 175| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 203| 203| 	let selectedIndex = replaySelection.selected;
| 204| 204| 
| 205| 205| 	for (let replayDirectory of replayDirectories)
| 206|    |-	{
|    | 206|+	
| 207| 207| 		if (!Engine.DeleteReplay(replayDirectory))
| 208| 208| 			error("Could not delete replay!");
| 209|    |-	}
|    | 209|+	
| 210| 210| 
| 211| 211| 	// Refresh replay list
| 212| 212| 	init();

binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 190| »   for·(selected·of·replaySelection.multiSelected)
|    | [NORMAL] JSHintBear:
|    | Creating global 'for' variable. Should be 'for (var selected ...'.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1406/display/redirect

Silier planned changes to this revision.May 14 2019, 3:47 PM

modio list

Silier updated this revision to Diff 8028.May 14 2019, 5:19 PM

modio list

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  58|  58| 			sprintf(translate("\"%(label)s\""), {
|  59|  59| 				"label": toDeleteNames.join("\n")
|  60|  60| 			}) + "\n" + translatePlural(
|  61|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  61|+				"Saved game will be permanently deleted, are you sure?",
|  62|  62| 			"Saved games will be permanently deleted, are you sure?",
|  63|  63| 			toDeleteNames.length
|  64|  64| 			),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  59|  59| 				"label": toDeleteNames.join("\n")
|  60|  60| 			}) + "\n" + translatePlural(
|  61|  61| 			"Saved game will be permanently deleted, are you sure?",
|  62|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  62|+				"Saved games will be permanently deleted, are you sure?",
|  63|  63| 			toDeleteNames.length
|  64|  64| 			),
|  65|  65| 			translate("DELETE"),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  60|  60| 			}) + "\n" + translatePlural(
|  61|  61| 			"Saved game will be permanently deleted, are you sure?",
|  62|  62| 			"Saved games will be permanently deleted, are you sure?",
|  63|    |-			toDeleteNames.length
|    |  63|+				toDeleteNames.length
|  64|  64| 			),
|  65|  65| 			translate("DELETE"),
|  66|  66| 			[translate("No"), translate("Yes")],
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 168| 168| 	messageBox(
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171|    |-		"Are you sure you want to delete these replays permanently?",
|    | 171|+			"Are you sure you want to delete these replays permanently?",
| 172| 172| 		directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171| 171| 		"Are you sure you want to delete these replays permanently?",
| 172|    |-		directories.length
|    | 172|+			directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
| 175| 175| 		translatePlural("Delete replay", "Delete replays", directories.length),

binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 190| »   for·(selected·of·replaySelection.multiSelected)
|    | [NORMAL] JSHintBear:
|    | Creating global 'for' variable. Should be 'for (var selected ...'.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
| 236| 236| 	else
| 237| 237| 		modsEnabledList.multiSelected = [enPos];
| 238| 238| 	modsEnabledList.selected = enPos;
| 239|    |-	
|    | 239|+
| 240| 240| 	if (disPos == -1)
| 241| 241| 		modsDisabledList.multiSelected = [];
| 242| 242| 	else
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
| 243| 243| 		modsDisabledList.multiSelected = [disPos];
| 244| 244| 
| 245| 245| 	modsDisabledList.selected = disPos;
| 246|    |-	
|    | 246|+
| 247| 247| 	Engine.GetGUIObjectByName("globalModDescription").caption = "";
| 248| 248| }
| 249| 249| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
| 377| 377| 
| 378| 378| 	g_ModsEnabled.sort((folder1, folder2) =>
| 379| 379| 		dependencies[folder1].indexOf(g_Mods[folder2].name) != -1 ? 1 :
| 380|    |-		dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
|    | 380|+			dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
| 381| 381| 
| 382| 382| 	displayModList("modsEnabledList", g_ModsEnabled);
| 383| 383| }
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  47|  47|  * The playerlist will be assembled using these values.
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|    |-	"available": { "color": "0 219 0",     "status": translate("Online") },
|    |  50|+	"available": { "color": "0 219 0", "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'away'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away": { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away":      { "color": "229 76 13", "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'playing'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing": { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing":   { "color": "200 0 0", "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'offline'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline": { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline":   { "color": "0 0 0", "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'unknown'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|    |-	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    |  54|+	"unknown": { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|  57|  57| var g_RoleNames = {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 219| 219| 					me ?
| 220| 220| 						translate("You have been muted.") :
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222|    |-				newrole == "moderator" ?
|    | 222|+					newrole == "moderator" ?
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 220| 220| 						translate("You have been muted.") :
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222| 222| 				newrole == "moderator" ?
| 223|    |-					me ?
|    | 223|+						me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 221| 221| 						translate("%(nick)s has been muted.") :
| 222| 222| 				newrole == "moderator" ?
| 223| 223| 					me ?
| 224|    |-						translate("You are now a moderator.") :
|    | 224|+							translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 222| 222| 				newrole == "moderator" ?
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225|    |-						translate("%(nick)s is now a moderator.") :
|    | 225|+							translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 223| 223| 					me ?
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226|    |-				msg.oldrole == "visitor" ?
|    | 226|+						msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 224| 224| 						translate("You are now a moderator.") :
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227|    |-					me ?
|    | 227|+							me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 225| 225| 						translate("%(nick)s is now a moderator.") :
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228|    |-						translate("You have been unmuted.") :
|    | 228|+								translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 226| 226| 				msg.oldrole == "visitor" ?
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229|    |-						translate("%(nick)s has been unmuted.") :
|    | 229|+								translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 227| 227| 					me ?
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230|    |-					me ?
|    | 230|+							me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 228| 228| 						translate("You have been unmuted.") :
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231|    |-						translate("You are not a moderator anymore.") :
|    | 231|+								translate("You are not a moderator anymore.") :
| 232| 232| 						translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
| 234| 234| 			addChatMessage({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 229| 229| 						translate("%(nick)s has been unmuted.") :
| 230| 230| 					me ?
| 231| 231| 						translate("You are not a moderator anymore.") :
| 232|    |-						translate("%(nick)s is not a moderator anymore.");
|    | 232|+								translate("%(nick)s is not a moderator anymore.");
| 233| 233| 
| 234| 234| 			addChatMessage({
| 235| 235| 				"text": "/special " + sprintf(txt, { "nick": msg.nick }),
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 777| 777| function toggleBuddy()
| 778| 778| {
| 779| 779| 	let playerList = Engine.GetGUIObjectByName("playersBox");
| 780|    |-	
|    | 780|+
| 781| 781| 	let selected  = playerList.multiSelected[0];
| 782| 782| 	let name = playerList.list[selected];
| 783| 783| 	if (!name || name == g_Username || name.indexOf(g_BuddyListDelimiter) != -1)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 778| 778| {
| 779| 779| 	let playerList = Engine.GetGUIObjectByName("playersBox");
| 780| 780| 	
| 781|    |-	let selected  = playerList.multiSelected[0];
|    | 781|+	let selected = playerList.multiSelected[0];
| 782| 782| 	let name = playerList.list[selected];
| 783| 783| 	if (!name || name == g_Username || name.indexOf(g_BuddyListDelimiter) != -1)
| 784| 784| 		return;
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/lobby/lobby.js
| 998| 998| 	let sortBy = gamesBox.selected_column;
| 999| 999| 	let sortOrder = gamesBox.selected_column_order;
|1000|1000| 	let selected = gamesBox.multiSelected.length ? gamesBox.multiSelected[0] : -1;
|1001|    |-	
|    |1001|+
|1002|1002| 	if (selected > -1)
|1003|1003| 	{
|1004|1004| 		g_SelectedGameIP = g_GameList[gamesBox.selected].ip;

binaries/data/mods/public/gui/lobby/lobby.js
| 829| »   »   »   else·if·(!foundAsObserver)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/lobby/lobby.js
|1047| »   »   switch·(sortBy)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/lobby/lobby.js
| 730| »   »   case·'name':
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'default'.

binaries/data/mods/public/gui/loadgame/load.js
|  34| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1407/display/redirect

elexis edited the summary of this revision. (Show Details)Sep 19 2019, 1:09 AM
elexis updated this revision to Diff 9848.Sep 19 2019, 1:13 AM

Rebase for september 2019.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/239/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/CIntList.h
|  23| class·CIntList
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCIntList{' is invalid C code. Use --std or --language to configure the language.

source/gui/CList.h
|  33| class·CList·:·public·IGUIScrollBarOwner,·public·IGUITextOwner
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCList:' is invalid C code. Use --std or --language to configure the language.

source/gui/GUI.h
|  23| #include·<string>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.

source/gui/COList.h
|  23| /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|  16|  16| 	let confirmButton = Engine.GetGUIObjectByName("confirmButton");
|  17|  17| 	confirmButton.caption = save ? translate("Save") : translate("Load");
|  18|  18| 	confirmButton.onPress = save ? () => { g_SavegameWriter.saveGame(); } : loadGame;
|  19|    |-	Engine.GetGUIObjectByName("title").caption = save ? translate("Save Game") : translate("Load Game")
|    |  19|+	Engine.GetGUIObjectByName("title").caption = save ? translate("Save Game") : translate("Load Game");
|  20|  20| 	Engine.GetGUIObjectByName("saveGameDesc").hidden = !save;
|  21|  21| 
|  22|  22| 	updateSavegameList();
|    | [NORMAL] ESLintBear (semi-spacing):
|    | Missing whitespace after semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
| 132| 132| 
| 133| 133| 	Engine.GetGUIObjectByName("confirmButton").enabled =
| 134| 134| 		(!!metadata || Engine.IsGameStarted()) &&
| 135|    |-		gameSelection.multiSelected.length == 1;;
|    | 135|+		gameSelection.multiSelected.length == 1; ;
| 136| 136| 
| 137| 137| 	Engine.GetGUIObjectByName("deleteGameButton").enabled = !!metadata;
| 138| 138| 
|    | [NORMAL] ESLintBear (no-extra-semi):
|    | Unnecessary semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
| 132| 132| 
| 133| 133| 	Engine.GetGUIObjectByName("confirmButton").enabled =
| 134| 134| 		(!!metadata || Engine.IsGameStarted()) &&
| 135|    |-		gameSelection.multiSelected.length == 1;;
|    | 135|+		gameSelection.multiSelected.length == 1;
| 136| 136| 
| 137| 137| 	Engine.GetGUIObjectByName("deleteGameButton").enabled = !!metadata;
| 138| 138| 

binaries/data/mods/public/gui/loadgame/load.js
|  64| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/loadgame/load.js
|  19| »   Engine.GetGUIObjectByName("title").caption·=·save·?·translate("Save·Game")·:·translate("Load·Game")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/loadgame/load.js
| 135| »   »   gameSelection.multiSelected.length·==·1;;
|    | [NORMAL] JSHintBear:
|    | Unnecessary semicolon.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 168| 168| 	messageBox(
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171|    |-		"Are you sure you want to delete these replays permanently?",
|    | 171|+			"Are you sure you want to delete these replays permanently?",
| 172| 172| 		directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171| 171| 		"Are you sure you want to delete these replays permanently?",
| 172|    |-		directories.length
|    | 172|+			directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
| 175| 175| 		translatePlural("Delete replay", "Delete replays", directories.length),

binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 190| »   for·(selected·of·replaySelection.multiSelected)
|    | [NORMAL] JSHintBear:
|    | Creating global 'for' variable. Should be 'for (var selected ...'.

binaries/data/mods/public/gui/loadgame/functions_utility_loadsave.js
|  72| »   for·(let·gameID·of·gameIDs)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'gameID' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/gui/modmod/modmod.js
| 377| 377| 
| 378| 378| 	g_ModsEnabled.sort((folder1, folder2) =>
| 379| 379| 		dependencies[folder1].indexOf(g_Mods[folder2].name) != -1 ? 1 :
| 380|    |-		dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
|    | 380|+			dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
| 381| 381| 
| 382| 382| 	displayModList("modsEnabledList", g_ModsEnabled);
| 383| 383| }
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  47|  47|  * The playerlist will be assembled using these values.
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|    |-	"available": { "color": "0 219 0",     "status": translate("Online") },
|    |  50|+	"available": { "color": "0 219 0", "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'away'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away": { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  48|  48|  */
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|    |-	"away":      { "color": "229 76 13",   "status": translate("Away") },
|    |  51|+	"away":      { "color": "229 76 13", "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'playing'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing": { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  49|  49| var g_PlayerStatuses = {
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|    |-	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|    |  52|+	"playing":   { "color": "200 0 0", "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'offline'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline": { "color": "0 0 0",       "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"status"'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  50|  50| 	"available": { "color": "0 219 0",     "status": translate("Online") },
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|    |-	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|    |  53|+	"offline":   { "color": "0 0 0", "status": translate("Offline") },
|  54|  54| 	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'unknown'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|  51|  51| 	"away":      { "color": "229 76 13",   "status": translate("Away") },
|  52|  52| 	"playing":   { "color": "200 0 0",     "status": translate("Busy") },
|  53|  53| 	"offline":   { "color": "0 0 0",       "status": translate("Offline") },
|  54|    |-	"unknown":   { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|    |  54|+	"unknown": { "color": "178 178 178", "status": translateWithContext("lobby presence", "Unknown") }
|  55|  55| };
|  56|  56| 
|  57|  57| var g_RoleNames = {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 210| 210| 					me ?
| 211| 211| 						translate("You have been muted.") :
| 212| 212| 						translate("%(nick)s has been muted.") :
| 213|    |-				msg.newrole == "moderator" ?
|    | 213|+					msg.newrole == "moderator" ?
| 214| 214| 					me ?
| 215| 215| 						translate("You are now a moderator.") :
| 216| 216| 						translate("%(nick)s is now a moderator.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 211| 211| 						translate("You have been muted.") :
| 212| 212| 						translate("%(nick)s has been muted.") :
| 213| 213| 				msg.newrole == "moderator" ?
| 214|    |-					me ?
|    | 214|+						me ?
| 215| 215| 						translate("You are now a moderator.") :
| 216| 216| 						translate("%(nick)s is now a moderator.") :
| 217| 217| 				msg.oldrole == "visitor" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 212| 212| 						translate("%(nick)s has been muted.") :
| 213| 213| 				msg.newrole == "moderator" ?
| 214| 214| 					me ?
| 215|    |-						translate("You are now a moderator.") :
|    | 215|+							translate("You are now a moderator.") :
| 216| 216| 						translate("%(nick)s is now a moderator.") :
| 217| 217| 				msg.oldrole == "visitor" ?
| 218| 218| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 213| 213| 				msg.newrole == "moderator" ?
| 214| 214| 					me ?
| 215| 215| 						translate("You are now a moderator.") :
| 216|    |-						translate("%(nick)s is now a moderator.") :
|    | 216|+							translate("%(nick)s is now a moderator.") :
| 217| 217| 				msg.oldrole == "visitor" ?
| 218| 218| 					me ?
| 219| 219| 						translate("You have been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 214| 214| 					me ?
| 215| 215| 						translate("You are now a moderator.") :
| 216| 216| 						translate("%(nick)s is now a moderator.") :
| 217|    |-				msg.oldrole == "visitor" ?
|    | 217|+						msg.oldrole == "visitor" ?
| 218| 218| 					me ?
| 219| 219| 						translate("You have been unmuted.") :
| 220| 220| 						translate("%(nick)s has been unmuted.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 215| 215| 						translate("You are now a moderator.") :
| 216| 216| 						translate("%(nick)s is now a moderator.") :
| 217| 217| 				msg.oldrole == "visitor" ?
| 218|    |-					me ?
|    | 218|+							me ?
| 219| 219| 						translate("You have been unmuted.") :
| 220| 220| 						translate("%(nick)s has been unmuted.") :
| 221| 221| 					me ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 216| 216| 						translate("%(nick)s is now a moderator.") :
| 217| 217| 				msg.oldrole == "visitor" ?
| 218| 218| 					me ?
| 219|    |-						translate("You have been unmuted.") :
|    | 219|+								translate("You have been unmuted.") :
| 220| 220| 						translate("%(nick)s has been unmuted.") :
| 221| 221| 					me ?
| 222| 222| 						translate("You are not a moderator anymore.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 217| 217| 				msg.oldrole == "visitor" ?
| 218| 218| 					me ?
| 219| 219| 						translate("You have been unmuted.") :
| 220|    |-						translate("%(nick)s has been unmuted.") :
|    | 220|+								translate("%(nick)s has been unmuted.") :
| 221| 221| 					me ?
| 222| 222| 						translate("You are not a moderator anymore.") :
| 223| 223| 						translate("%(nick)s is not a moderator anymore.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 218| 218| 					me ?
| 219| 219| 						translate("You have been unmuted.") :
| 220| 220| 						translate("%(nick)s has been unmuted.") :
| 221|    |-					me ?
|    | 221|+							me ?
| 222| 222| 						translate("You are not a moderator anymore.") :
| 223| 223| 						translate("%(nick)s is not a moderator anymore.");
| 224| 224| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 219| 219| 						translate("You have been unmuted.") :
| 220| 220| 						translate("%(nick)s has been unmuted.") :
| 221| 221| 					me ?
| 222|    |-						translate("You are not a moderator anymore.") :
|    | 222|+								translate("You are not a moderator anymore.") :
| 223| 223| 						translate("%(nick)s is not a moderator anymore.");
| 224| 224| 
| 225| 225| 			addChatMessage({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 220| 220| 						translate("%(nick)s has been unmuted.") :
| 221| 221| 					me ?
| 222| 222| 						translate("You are not a moderator anymore.") :
| 223|    |-						translate("%(nick)s is not a moderator anymore.");
|    | 223|+								translate("%(nick)s is not a moderator anymore.");
| 224| 224| 
| 225| 225| 			addChatMessage({
| 226| 226| 				"text": "/special " + sprintf(txt, { "nick": msg.nick }),
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/lobby/lobby.js
| 755| 755| {
| 756| 756| 	let playerList = Engine.GetGUIObjectByName("playersBox");
| 757| 757| 
| 758|    |-	let selected  = playerList.multiSelected[0];
|    | 758|+	let selected = playerList.multiSelected[0];
| 759| 759| 	let name = playerList.list[selected];
| 760| 760| 	if (!name || name == g_Username || name.indexOf(g_BuddyListDelimiter) != -1)
| 761| 761| 		return;

binaries/data/mods/public/gui/lobby/lobby.js
| 806| »   »   »   else·if·(!foundAsObserver)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/lobby/lobby.js
|1024| »   »   switch·(sortBy)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/751/display/redirect

elexis requested changes to this revision.Sep 19 2019, 2:08 AM

Relax grammar:

In D1346#55260, @Angen wrote:

I know about this:
multiSelection_enabled as param in xml - need to fix varning from validator

As of D1574 the invalid XML will be refused.
To be fixed in binaries/data/mods/mod/gui/gui.rng, rnc.

Setting naming:
Naming: multiSelected, multiSelection_enabled, notice that none of the other settings use capital letters, or camel case, or a mix thereof, so multiselect_enabled and multiselected, or similar.

Feature design:
On the feature design, there are multiple ways this could be implemented.
You implemented it as a GUI Object setting, i.e. it can be changed dynamically whether it should be single or multi selection.
But there are also some contradictions arising.
If it is multiselection, then the selected property makes no sense and can't do what its defined to do.
If it is single selection, then the multiselection property has that problem.
If im not mistaken, CDropdown inherits the multiselection features, but does it make sense to enable that for a dropdown?
The alternative is to implement to make CList an abstract class, implemented by a multi and a singleselection class.
CDropdown would inherit the singleselection one (and ordered list the multiselection one and maybe also provide a singleselection one).

Alternatively CList is always a multiselection one, but has a max_selection setting (with n=1 to mimic singleselection).
This however would complicate JS access for the single selection, which for dropdowns in particular would be ugly to adapt in JS.

I suppose we find strong use cases for singleselection olist? I see you added it to the lobby gamelist, but what's the benefit? One can join only one game, view only one game.
Actually its disabled for the lobby, but the multiselection properties are still set. That sounds wrong (https://en.wikipedia.org/wiki/Single_source_of_truth), since both store the current user selection, they shouldn't have to be kept in sync.

Data type design:
The CIntList datatype is a vector of integers. Thats irreducible, so should be fine.
However I see it is copy assigned via GetSetting, modified, then copy-assigned via SetSetting again.
Instead one could modify the reference directly and call SettingChanged to broadcast the setting-changed message, and make the class NONCOPYABLE (i.e. to delete the copy assignment operator and copy constructor of the class).

Graphics design:
When selecting many items in a row, it looks a big ugly. There should be a different sprite used that is tuned a bit better for this mutliselection.

So requested changes are:

  • Make sure the code actually works everywhere
  • Consider whether the abstract CList + CListSingle/CListMulti approach would be actually better or actually worse than the current appraoch. Consider how other popular UIs might implement that.

Other than that: do want!

binaries/data/mods/public/gui/replaymenu/replay_actions.js
211

Refers to selectedIndex, but that was deleted.

This revision now requires changes to proceed.Sep 19 2019, 2:08 AM
Silier updated this revision to Diff 9863.Sep 19 2019, 7:10 PM

Single, Multiple class design
Not synchronised with js
OList is Single for now

Silier planned changes to this revision.Sep 19 2019, 7:11 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/249/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/761/display/redirect

Silier updated this revision to Diff 9872.Sep 19 2019, 10:22 PM

something is wrong with olistsingle, olistmultiple

WARNING: Attempt to draw scrollbar without a style.

modio was not rebased because of ^

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/769/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/257/display/redirect

Silier planned changes to this revision.Sep 20 2019, 7:41 AM
Silier added a comment.EditedSep 20 2019, 9:29 AM

There are at least two m_ItemsYPositions and maybe more variables for COListSingle
one from COList
second from CListSingle

size CList = 1
size COList = 21
size CListSingle = 1

Edit: solved by virtual public Clist

Silier updated this revision to Diff 9876.Sep 20 2019, 10:21 AM

working version

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/CIntList.h
|  23| class·CIntList
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCIntList{' is invalid C code. Use --std or --language to configure the language.

source/gui/CDropDown.h
|  23| »   Works·just·like·a·list-box,·but·it·hides
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.

source/gui/CListMultiple.h
|  24| class·CListMultiple:·virtual·public·CList
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCListMultiple:' is invalid C code. Use --std or --language to configure the language.

source/gui/COListSingle.h
|  23| class·COListSingle·:·public·CListSingle,·public·COList
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.

source/gui/CList.h
|  32| class·CList·:·public·IGUIScrollBarOwner,·public·IGUITextOwner
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCList:' is invalid C code. Use --std or --language to configure the language.

source/gui/GUI.h
|  23| #include·<string>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.

source/gui/CListSingle.h
|  23| class·CListSingle:·virtual·public·CList
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCListSingle:' is invalid C code. Use --std or --language to configure the language.

source/gui/COList.h
|  23| /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.

source/gui/COListMultiple.h
|  23| class·COListMultiple·:·public·COList,·public·CListMultiple
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCGUIList{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...

binaries/data/mods/public/gui/loadgame/functions_utility_loadsave.js
|  72| »   for·(let·gameID·of·gameIDs)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'gameID' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 168| 168| 	messageBox(
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171|    |-		"Are you sure you want to delete these replays permanently?",
|    | 171|+			"Are you sure you want to delete these replays permanently?",
| 172| 172| 		directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 169| 169| 		500, 200,
| 170| 170| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 171| 171| 		"Are you sure you want to delete these replays permanently?",
| 172|    |-		directories.length
|    | 172|+			directories.length
| 173| 173| 		) + "\n" +
| 174| 174| 			escapeText(directoryNames.join("\n")),
| 175| 175| 		translatePlural("Delete replay", "Delete replays", directories.length),

binaries/data/mods/public/gui/replaymenu/replay_actions.js
| 190| »   for·(selected·of·replaySelection.selected)
|    | [NORMAL] JSHintBear:
|    | Creating global 'for' variable. Should be 'for (var selected ...'.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|  16|  16| 	let confirmButton = Engine.GetGUIObjectByName("confirmButton");
|  17|  17| 	confirmButton.caption = save ? translate("Save") : translate("Load");
|  18|  18| 	confirmButton.onPress = save ? () => { g_SavegameWriter.saveGame(); } : loadGame;
|  19|    |-	Engine.GetGUIObjectByName("title").caption = save ? translate("Save Game") : translate("Load Game")
|    |  19|+	Engine.GetGUIObjectByName("title").caption = save ? translate("Save Game") : translate("Load Game");
|  20|  20| 	Engine.GetGUIObjectByName("saveGameDesc").hidden = !save;
|  21|  21| 
|  22|  22| 	updateSavegameList();
|    | [NORMAL] ESLintBear (semi-spacing):
|    | Missing whitespace after semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
| 131| 131| 
| 132| 132| 	Engine.GetGUIObjectByName("confirmButton").enabled =
| 133| 133| 		(!!metadata || Engine.IsGameStarted()) &&
| 134|    |-		gameSelection.selected.length == 1;;
|    | 134|+		gameSelection.selected.length == 1; ;
| 135| 135| 
| 136| 136| 	Engine.GetGUIObjectByName("deleteGameButton").enabled = !!metadata;
| 137| 137| 
|    | [NORMAL] ESLintBear (no-extra-semi):
|    | Unnecessary semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/loadgame/load.js
| 131| 131| 
| 132| 132| 	Engine.GetGUIObjectByName("confirmButton").enabled =
| 133| 133| 		(!!metadata || Engine.IsGameStarted()) &&
| 134|    |-		gameSelection.selected.length == 1;;
|    | 134|+		gameSelection.selected.length == 1;
| 135| 135| 
| 136| 136| 	Engine.GetGUIObjectByName("deleteGameButton").enabled = !!metadata;
| 137| 137| 

binaries/data/mods/public/gui/loadgame/load.js
|  64| »   »   switch·(sortKey)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/loadgame/load.js
|  19| »   Engine.GetGUIObjectByName("title").caption·=·save·?·translate("Save·Game")·:·translate("Load·Game")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/loadgame/load.js
| 134| »   »   gameSelection.selected.length·==·1;;
|    | [NORMAL] JSHintBear:
|    | Unnecessary semicolon.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/771/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/259/display/redirect

Got some whitespace complaints by my local linter, marked in inline comments. If Jenkins doesnt have it it should learn that.

I get many compiler warnings with clang (I got those recently too and removed the warnings in rP22602, just dont use the override keyword unless its used everywhere, i.e. nowhere for now):

CDropDown.cpp
CGUI.cpp
In file included from ../../../source/gui/CGUI.cpp:34:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:64:15: warning: 'IsEnabledDoubleClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
../../../source/gui/CList.h:86:15: note: overridden virtual function is here
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
In file included from ../../../source/gui/CGUI.cpp:34:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:66:14: warning: 'GetLastSelected' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual int GetLastSelected() = 0;
                    ^
../../../source/gui/CList.h:88:14: note: overridden virtual function is here
        virtual int GetLastSelected() = 0;
                    ^
In file included from ../../../source/gui/CGUI.cpp:34:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:68:15: warning: 'DrawSelectedItems' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
../../../source/gui/CList.h:95:15: note: overridden virtual function is here
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
In file included from ../../../source/gui/CGUI.cpp:34:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:70:15: warning: 'SelectionControl' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void SelectionControl(int& select) = 0;
                     ^
../../../source/gui/CList.h:121:15: note: overridden virtual function is here
        virtual void SelectionControl(int& select) = 0;
                     ^
CGUIScrollBarVertical.cpp
make: *** [Makefile:121: atlas] Error 2
CGUISetting.cpp
CGUIString.cpp
CImage.cpp
CInput.cpp
CList.cpp
4 warnings generated.
CListMultiple.cpp
../../../source/gui/CList.cpp:468:29: warning: unsequenced modification and access to 'selected' [-Wunsequenced]
                UpdateSelection(selected, ++selected);
                                ~~~~~~~~  ^
../../../source/gui/CList.cpp:476:29: warning: unsequenced modification and access to 'selected' [-Wunsequenced]
                UpdateSelection(selected, --selected);
                                ~~~~~~~~  ^
../../../source/gui/CListMultiple.cpp:86:58: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                        for (size_t itemId = m_MultiSelectionFromItem; itemId < select + 1; ++itemId)
                                                                       ~~~~~~ ^ ~~~~~~~~~~
../../../source/gui/CListMultiple.cpp:116:49: warning: unused parameter 'selected' [-Wunused-parameter]
void CListMultiple::DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect)
                                                ^
2 warnings generated.
CListSingle.cpp
2 warnings generated.
COList.cpp
COListMultiple.cpp
In file included from ../../../source/gui/COList.cpp:20:
../../../source/gui/COList.h:64:15: warning: 'IsEnabledDoubleClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
../../../source/gui/CList.h:86:15: note: overridden virtual function is here
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
In file included from ../../../source/gui/COList.cpp:20:
../../../source/gui/COList.h:66:14: warning: 'GetLastSelected' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual int GetLastSelected() = 0;
                    ^
../../../source/gui/CList.h:88:14: note: overridden virtual function is here
        virtual int GetLastSelected() = 0;
                    ^
In file included from ../../../source/gui/COList.cpp:20:
../../../source/gui/COList.h:68:15: warning: 'DrawSelectedItems' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
../../../source/gui/CList.h:95:15: note: overridden virtual function is here
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
In file included from ../../../source/gui/COList.cpp:20:
../../../source/gui/COList.h:70:15: warning: 'SelectionControl' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void SelectionControl(int& select) = 0;
                     ^
../../../source/gui/CList.h:121:15: note: overridden virtual function is here
        virtual void SelectionControl(int& select) = 0;
                     ^
In file included from ../../../source/gui/COListMultiple.cpp:20:
In file included from ../../../source/gui/COListMultiple.h:20:
../../../source/gui/COList.h:64:15: warning: 'IsEnabledDoubleClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
../../../source/gui/CList.h:86:15: note: overridden virtual function is here
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
In file included from ../../../source/gui/COListMultiple.cpp:20:
In file included from ../../../source/gui/COListMultiple.h:20:
../../../source/gui/COList.h:66:14: warning: 'GetLastSelected' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual int GetLastSelected() = 0;
                    ^
../../../source/gui/CList.h:88:14: note: overridden virtual function is here
        virtual int GetLastSelected() = 0;
                    ^
In file included from ../../../source/gui/COListMultiple.cpp:20:
In file included from ../../../source/gui/COListMultiple.h:20:
../../../source/gui/COList.h:68:15: warning: 'DrawSelectedItems' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
../../../source/gui/CList.h:95:15: note: overridden virtual function is here
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
In file included from ../../../source/gui/COListMultiple.cpp:20:
In file included from ../../../source/gui/COListMultiple.h:20:
../../../source/gui/COList.h:70:15: warning: 'SelectionControl' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void SelectionControl(int& select) = 0;
                     ^
../../../source/gui/CList.h:121:15: note: overridden virtual function is here
        virtual void SelectionControl(int& select) = 0;
                     ^
4 warnings generated.
COListSingle.cpp
CProgressBar.cpp
4 warnings generated.
CRadioButton.cpp
In file included from ../../../source/gui/COListSingle.cpp:20:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:64:15: warning: 'IsEnabledDoubleClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
../../../source/gui/CList.h:86:15: note: overridden virtual function is here
        virtual bool IsEnabledDoubleClick() = 0;
                     ^
In file included from ../../../source/gui/COListSingle.cpp:20:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:66:14: warning: 'GetLastSelected' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual int GetLastSelected() = 0;
                    ^
../../../source/gui/CList.h:88:14: note: overridden virtual function is here
        virtual int GetLastSelected() = 0;
                    ^
In file included from ../../../source/gui/COListSingle.cpp:20:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:68:15: warning: 'DrawSelectedItems' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
../../../source/gui/CList.h:95:15: note: overridden virtual function is here
        virtual void DrawSelectedItems(const int selected, const bool scrollbar, const float scroll, CGUISpriteInstance& sprite_selectarea, const int cell_id, const float bz, CRect& rect) = 0;
                     ^
In file included from ../../../source/gui/COListSingle.cpp:20:
In file included from ../../../source/gui/COListSingle.h:20:
../../../source/gui/COList.h:70:15: warning: 'SelectionControl' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void SelectionControl(int& select) = 0;
                     ^
../../../source/gui/CList.h:121:15: note: overridden virtual function is here
        virtual void SelectionControl(int& select) = 0;
                     ^
4 warnings generated.

See discussion about the use of virtual inheritance or not in IRC yesterday http://irclogs.wildfiregames.com/2019-09/2019-09-19-QuakeNet-%230ad-dev.log
Also the naming.

Vladislav noted that CList sounds a lot like something that could be used. But if it is an abstract class, it should become IList for consistency with IGUIObject, IGUISetting, IGUITextOwner, IGUIScrollbarOwner, ...

So the problem with virtual inheritance is mostly that it was considered a wrong pattern,
because it means one can't derive the derived class pointer from a given baseclass pointer by reinterpreting the pointer,
but that one has to use a dynamic_cast, which uses RTTI (Runtime Type Information), which is a C++ internal lookup table.
That was 80 times slower than the reinterpretation way when I tested for rP22596.
So we ended up adding a hack to that (storing a pointer to the derived IGUITextOwner class in the base class IGUIObject. That is conceptually bad because the base class should be agnostic of any child class, but it returns the right pointer 80 times faster...

The only way out was to remove the virtual inheritance.
I will look into it, perhaps it can be done within a day.
One alternative to virtual inheritance considered was to move the parent IList and IOList class to a separate class and adding a member variable to the single/multi derived classes. We will see.
If virtual inheritance removal fails, I suppose it can be used here as well. It shouldnt make it much much more difficult to remove later while keeping the code consistent until then.

binaries/data/mods/public/gui/replaymenu/replay_menu.js
82

if ( (whitespace)

source/gui/CList.cpp
184–186

remove trailing whitespace

456

no whitespace in empty linesa

481

no whitespace in empty lines

491

no whietspace in empty lines

TBH this sounds like a relatively good candidate for CRTP.

Silier updated this revision to Diff 9921.Sep 22 2019, 8:41 PM

try to use members as implementation classes

problem:
settings created do not exists

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/804/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/289/display/redirect

D2325 removes the existing virtual inheritance, so the patch can take that as an example, or the patch over there should change if there is a better idea.

@Angen the codebase is now cleaned of virtual inheritance and the big Setting rewrite (D2313). Are you still available to update the patch or got consumed by work?

Silier planned changes to this revision.Nov 17 2019, 6:18 PM

I ll update this but no idea when

Silier abandoned this revision.Apr 20 2023, 4:53 PM