Page MenuHomeWildfire Games

List multiselection
Needs ReviewPublic

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

Details

Reviewers
vladislavbelov
wraitii
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

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7489
Build 12199: Vulcan BuildJenkins
Build 12198: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

There are still style errors.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
55

Space after if, braces on new line.

58

else on new line.

76

The same here.

binaries/data/mods/public/gui/lobby/lobby.js
790

A empty line is needed before the comment.

800

Space after if, braces on new line.

source/gui/CGUI.cpp
243 ↗(On Diff #5988)

Space before &&.

source/gui/CIntList.h
18

Too many empty lines, look at other files.

22

Empty lines around #include.

source/gui/CList.cpp
157

Space after if.

175

Use .empty() instead of .size() == 0.

176

Braces around one line can be avoided.

188

It looks like other comments start with a capital letter, so it'd be good to have the same style everywhere.

209

iItemId replace by i or itemId.

453

Space after selected, and sprite_selectarea,.

source/gui/CList.h
23

A empty line before the comment.

33

It's not good to define compile-time functions with the runtime variable. Aslo, it'd be good to have an XML attribute, which allows a multiselection.

vladislavbelov requested changes to this revision.Mar 1 2018, 8:05 PM
This revision now requires changes to proceed.Mar 1 2018, 8:05 PM
elexis added inline comments.Mar 1 2018, 8:21 PM
binaries/data/mods/public/gui/common/functions_utility_loadsave.js
45

Are these unneeded variables and could be inlined?

55

if (!length) woudln't be rejected

59

While at it, for (, ++iSelection, )\n{

60

translatePlural()

Vulcan added a comment.Mar 1 2018, 9:15 PM

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

Linter detected issues:
Executing section Default...
Executing section Source...
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
|  50|  50| 	if(nMultiSelections == 0){
|  51|  51| 		toDelete.push(gameSelection.list_data[iSelected]);
|  52|  52| 		toDeleteNames.push(gameSelection.list[iSelected]);
|  53|    |-	} else {
|    |  53|+	} else 
|  54|  54| 		for(let iSelection = 0; iSelection < nMultiSelections; iSelection++){
|  55|  55| 			iSelected = multiSelected[iSelection];
|  56|  56| 			toDelete.push(gameSelection.list_data[iSelected]);
|  57|  57| 			toDeleteNames.push(gameSelection.list[iSelected]);
|  58|  58| 		}
|  59|    |-	}
|    |  59|+	
|  60|  60| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  61|  61| 		reallyDeleteGame(toDelete);
|  62|  62| 	else
|    | [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
|  73|  73| 
|  74|  74| function reallyDeleteGame(gameIDs)
|  75|  75| {
|  76|    |-	for( let gameID of gameIDs){
|    |  76|+	for( let gameID of gameIDs)
|  77|  77| 		if (!Engine.DeleteSavedGame(gameID))
|  78|  78| 			error("Could not delete saved game: " + gameID);
|  79|    |-	}
|    |  79|+	
|  80|  80| 	// Run init again to refresh saved game list
|  81|  81| 	init();
|  82|  82| }
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /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
|  73|  73| 
|  74|  74| function reallyDeleteGame(gameIDs)
|  75|  75| {
|  76|    |-	for( let gameID of gameIDs){
|    |  76|+	for(let gameID of gameIDs){
|  77|  77| 		if (!Engine.DeleteSavedGame(gameID))
|  78|  78| 			error("Could not delete saved game: " + gameID);
|  79|  79| 	}

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  50| »   if(nMultiSelections·==·0){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  50| »   if(nMultiSelections·==·0){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  53| »   }·else·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Closing curly brace appears on the same line as the subsequent block.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  54| »   »   for(let·iSelection·=·0;·iSelection·<·nMultiSelections;·iSelection++){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  76| »   for(·let·gameID·of·gameIDs){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [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 (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /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
| 785| 785| 	let multiSelected = playerList.multiSelected;
| 786| 786| 	let nMultiSelections = multiSelected.length;
| 787| 787| 
| 788|    |-	if(nMultiSelections == 0) {
|    | 788|+	if(nMultiSelections == 0) 
| 789| 789| 		processBuddy(playerList.list[playerList.selected]);
| 790|    |-	}
|    | 790|+	
| 791| 791| 	else {
| 792| 792| 		for(let iSelection = 0; iSelection < nMultiSelections; iSelection++)
| 793| 793| 			processBuddy(playerList.list[multiSelected[iSelection]]);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /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
| 788| 788| 	if(nMultiSelections == 0) {
| 789| 789| 		processBuddy(playerList.list[playerList.selected]);
| 790| 790| 	}
| 791|    |-	else {
|    | 791|+	else 
| 792| 792| 		for(let iSelection = 0; iSelection < nMultiSelections; iSelection++)
| 793| 793| 			processBuddy(playerList.list[multiSelected[iSelection]]);
| 794|    |-	}
|    | 794|+	
| 795| 795| 
| 796| 796| 	updateToggleBuddy();
| 797| 797| 

binaries/data/mods/public/gui/lobby/lobby.js
| 788| »   if(nMultiSelections·==·0)·{
|    | [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
| 788| »   if(nMultiSelections·==·0)·{
|    | [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
|1037| »   »   switch·(sortBy)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/lobby/lobby.js
|1289| »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.

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

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

Angen updated this revision to Diff 5993.EditedMar 1 2018, 11:04 PM
Angen edited the summary of this revision. (Show Details)

I know about this:
multiSelection_enabled as param in xml - need to fix varning from validator
also I get some strange undefined strings from names in confirm boxes

Changed:
lobby multi selection removed from patch - it started to be tricky
prevent double click while multi selection
avoid one item in multiselection
disable load, save buttons if selected more than one item
do not block next action on shift, ctrl - there have been strange behaviour if they were blocked

Also I update years in next update

Vulcan added a comment.Mar 2 2018, 1:33 AM

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 i = 0; i < gameSelection.multiSelected.length; ++i)
|  56|  56| 		{
|  57|  57| 			selected = gameSelection.multiSelected[i];
|  58|  58| 			toDelete.push(gameSelection.list_data[selected]);
|  59|  59| 			toDeleteNames.push(gameSelection.list[selected]);
|  60|  60| 		}
|  61|    |-	}
|    |  61|+	
|  62|  62| 
|  63|  63| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  64|  64| 		reallyDeleteGame(toDelete);
|    | [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
|  76|  76| 
|  77|  77| function reallyDeleteGame(gameIDs)
|  78|  78| {
|  79|    |-	for (let gameID of gameIDs){
|    |  79|+	for (let gameID of gameIDs)
|  80|  80| 		if (!Engine.DeleteSavedGame(gameID))
|  81|  81| 			error("Could not delete saved game: " + gameID);
|  82|    |-	}
|    |  82|+	
|  83|  83| 	// Run init again to refresh saved game list
|  84|  84| 	init();
|  85|  85| }

binaries/data/mods/public/gui/common/functions_utility_loadsave.js
|  79| »   for·(let·gameID·of·gameIDs){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

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

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

Angen updated this revision to Diff 6007.Mar 2 2018, 10:26 PM
Angen edited the summary of this revision. (Show Details)

added replay menu multi selection
fixed some bugs

almost finished but

I have problem with I need help:
if you use shift for non confirm delete, after it, multi selection is enabled because CList didnt get shift release

Angen marked 26 inline comments as done.Mar 2 2018, 10:32 PM
Vulcan added a comment.Mar 3 2018, 1:31 AM

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 i = 0; i < gameSelection.multiSelected.length; ++i)
|  56|  56| 		{
|  57|  57| 			selected = gameSelection.multiSelected[i];
|  58|  58| 			toDelete.push(gameSelection.list_data[selected]);
|  59|  59| 			toDeleteNames.push(gameSelection.list[selected]);
|  60|  60| 		}
|  61|    |-	}
|    |  61|+	
|  62|  62| 
|  63|  63| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  64|  64| 		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
|  68|  68| 			sprintf(translate("\"%(label)s\""), {
|  69|  69| 				"label": toDeleteNames.join("\n")
|  70|  70| 			}) + "\n" + translatePlural(
|  71|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  71|+				"Saved game will be permanently deleted, are you sure?",
|  72|  72| 			"Saved games will be permanently deleted, are you sure?",
|  73|  73| 			toDeleteNames.length
|  74|  74| 			),
|    | [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| 				"label": toDeleteNames.join("\n")
|  70|  70| 			}) + "\n" + translatePlural(
|  71|  71| 			"Saved game will be permanently deleted, are you sure?",
|  72|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  72|+				"Saved games will be permanently deleted, are you sure?",
|  73|  73| 			toDeleteNames.length
|  74|  74| 			),
|  75|  75| 			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
|  70|  70| 			}) + "\n" + translatePlural(
|  71|  71| 			"Saved game will be permanently deleted, are you sure?",
|  72|  72| 			"Saved games will be permanently deleted, are you sure?",
|  73|    |-			toDeleteNames.length
|    |  73|+				toDeleteNames.length
|  74|  74| 			),
|  75|  75| 			translate("DELETE"),
|  76|  76| 			[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
|  81|  81| function reallyDeleteGame(gameIDs)
|  82|  82| {
|  83|  83| 	for (let gameID of gameIDs)
|  84|    |-	{
|    |  84|+	
|  85|  85| 		if (!Engine.DeleteSavedGame(gameID))
|  86|  86| 			error("Could not delete saved game: " + gameID);
|  87|    |-	}
|    |  87|+	
|  88|  88| 	// Run init again to refresh saved game list
|  89|  89| 	init();
|  90|  90| }

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
| 169| 169| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 170| 170| 	}
| 171| 171| 	else
| 172|    |-	{
|    | 172|+	
| 173| 173| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
| 174| 174| 		{
| 175| 175| 			selected = replaySelection.multiSelected[i];
| 176| 176| 			directories.push(g_ReplaysFiltered[selected].directory);
| 177| 177| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 178| 178| 		}
| 179|    |-	}
|    | 179|+	
| 180| 180| 	messageBox(
| 181| 181| 		500, 200,
| 182| 182| 		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
| 180| 180| 	messageBox(
| 181| 181| 		500, 200,
| 182| 182| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 183|    |-		"Are you sure you want to delete these replays permanently?",
|    | 183|+			"Are you sure you want to delete these replays permanently?",
| 184| 184| 		directories.length
| 185| 185| 		) + "\n" +
| 186| 186| 			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
| 181| 181| 		500, 200,
| 182| 182| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 183| 183| 		"Are you sure you want to delete these replays permanently?",
| 184|    |-		directories.length
|    | 184|+			directories.length
| 185| 185| 		) + "\n" +
| 186| 186| 			escapeText(directoryNames.join("\n")),
| 187| 187| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /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
| 201| 201| 		return;
| 202| 202| 	let directories = [];
| 203| 203| 	if (!replaySelection.multiSelected.length)
| 204|    |-	{
|    | 204|+	
| 205| 205| 		directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	else
| 208| 208| 	{
| 209| 209| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
|    | [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
| 205| 205| 		directories.push(g_ReplaysFiltered[selected].directory);
| 206| 206| 	}
| 207| 207| 	else
| 208|    |-	{
|    | 208|+	
| 209| 209| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
| 210| 210| 		{
| 211| 211| 			selected = replaySelection.multiSelected[i];
| 212| 212| 			directories.push(g_ReplaysFiltered[selected].directory);
| 213| 213| 		}
| 214|    |-	}
|    | 214|+	
| 215| 215| 	reallyDeleteReplay(directories);
| 216| 216| }
| 217| 217| 
|    | [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
| 226| 226| 	var selectedIndex = replaySelection.selected;
| 227| 227| 
| 228| 228| 	for (let replayDirectory of replayDirectories)
| 229|    |-	{
|    | 229|+	
| 230| 230| 		if (!Engine.DeleteReplay(replayDirectory))
| 231| 231| 			error("Could not delete replay!");
| 232|    |-	}
|    | 232|+	
| 233| 233| 
| 234| 234| 	// Refresh replay list
| 235| 235| 	init();

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

Angen planned changes to this revision.Mar 9 2018, 9:59 PM
Angen updated this revision to Diff 6168.Mar 14 2018, 9:22 PM
Angen edited the test plan for this revision. (Show Details)

Shift selection update
Not getting shift, ctrl release solved

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 i = 0; i < gameSelection.multiSelected.length; ++i)
|  56|  56| 		{
|  57|  57| 			selected = gameSelection.multiSelected[i];
|  58|  58| 			toDelete.push(gameSelection.list_data[selected]);
|  59|  59| 			toDeleteNames.push(gameSelection.list[selected]);
|  60|  60| 		}
|  61|    |-	}
|    |  61|+	
|  62|  62| 
|  63|  63| 	if (Engine.HotkeyIsPressed("session.savedgames.noconfirmation"))
|  64|  64| 		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
|  68|  68| 			sprintf(translate("\"%(label)s\""), {
|  69|  69| 				"label": toDeleteNames.join("\n")
|  70|  70| 			}) + "\n" + translatePlural(
|  71|    |-			"Saved game will be permanently deleted, are you sure?",
|    |  71|+				"Saved game will be permanently deleted, are you sure?",
|  72|  72| 			"Saved games will be permanently deleted, are you sure?",
|  73|  73| 			toDeleteNames.length
|  74|  74| 			),
|    | [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| 				"label": toDeleteNames.join("\n")
|  70|  70| 			}) + "\n" + translatePlural(
|  71|  71| 			"Saved game will be permanently deleted, are you sure?",
|  72|    |-			"Saved games will be permanently deleted, are you sure?",
|    |  72|+				"Saved games will be permanently deleted, are you sure?",
|  73|  73| 			toDeleteNames.length
|  74|  74| 			),
|  75|  75| 			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
|  70|  70| 			}) + "\n" + translatePlural(
|  71|  71| 			"Saved game will be permanently deleted, are you sure?",
|  72|  72| 			"Saved games will be permanently deleted, are you sure?",
|  73|    |-			toDeleteNames.length
|    |  73|+				toDeleteNames.length
|  74|  74| 			),
|  75|  75| 			translate("DELETE"),
|  76|  76| 			[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
|  81|  81| function reallyDeleteGame(gameIDs)
|  82|  82| {
|  83|  83| 	for (let gameID of gameIDs)
|  84|    |-	{
|    |  84|+	
|  85|  85| 		if (!Engine.DeleteSavedGame(gameID))
|  86|  86| 			error("Could not delete saved game: " + gameID);
|  87|    |-	}
|    |  87|+	
|  88|  88| 	// Run init again to refresh saved game list
|  89|  89| 	init();
|  90|  90| }
|    | [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
| 169| 169| 		directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 170| 170| 	}
| 171| 171| 	else
| 172|    |-	{
|    | 172|+	
| 173| 173| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
| 174| 174| 		{
| 175| 175| 			selected = replaySelection.multiSelected[i];
| 176| 176| 			directories.push(g_ReplaysFiltered[selected].directory);
| 177| 177| 			directoryNames.push(Engine.GetReplayDirectoryName(g_ReplaysFiltered[selected].directory));
| 178| 178| 		}
| 179|    |-	}
|    | 179|+	
| 180| 180| 	messageBox(
| 181| 181| 		500, 200,
| 182| 182| 		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
| 180| 180| 	messageBox(
| 181| 181| 		500, 200,
| 182| 182| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 183|    |-		"Are you sure you want to delete these replays permanently?",
|    | 183|+			"Are you sure you want to delete these replays permanently?",
| 184| 184| 		directories.length
| 185| 185| 		) + "\n" +
| 186| 186| 			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
| 181| 181| 		500, 200,
| 182| 182| 		translatePlural("Are you sure you want to delete this replay permanently?",
| 183| 183| 		"Are you sure you want to delete these replays permanently?",
| 184|    |-		directories.length
|    | 184|+			directories.length
| 185| 185| 		) + "\n" +
| 186| 186| 			escapeText(directoryNames.join("\n")),
| 187| 187| 		translatePlural("Delete replay", "Delete replays", directories.length),
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /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
| 201| 201| 		return;
| 202| 202| 	let directories = [];
| 203| 203| 	if (!replaySelection.multiSelected.length)
| 204|    |-	{
|    | 204|+	
| 205| 205| 		directories.push(g_ReplaysFiltered[selected].directory);
| 206|    |-	}
|    | 206|+	
| 207| 207| 	else
| 208| 208| 	{
| 209| 209| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
|    | [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
| 205| 205| 		directories.push(g_ReplaysFiltered[selected].directory);
| 206| 206| 	}
| 207| 207| 	else
| 208|    |-	{
|    | 208|+	
| 209| 209| 		for (let i = 0; i < replaySelection.multiSelected.length; ++i)
| 210| 210| 		{
| 211| 211| 			selected = replaySelection.multiSelected[i];
| 212| 212| 			directories.push(g_ReplaysFiltered[selected].directory);
| 213| 213| 		}
| 214|    |-	}
|    | 214|+	
| 215| 215| 	reallyDeleteReplay(directories);
| 216| 216| }
| 217| 217| 
|    | [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
| 226| 226| 	var selectedIndex = replaySelection.selected;
| 227| 227| 
| 228| 228| 	for (let replayDirectory of replayDirectories)
| 229|    |-	{
|    | 229|+	
| 230| 230| 		if (!Engine.DeleteReplay(replayDirectory))
| 231| 231| 			error("Could not delete replay!");
| 232|    |-	}
|    | 232|+	
| 233| 233| 
| 234| 234| 	// Refresh replay list
| 235| 235| 	init();

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

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

Stan added a subscriber: Stan.Mar 15 2018, 7:54 PM
Stan added inline comments.
binaries/data/mods/public/gui/common/functions_utility_loadsave.js
54

For ( let x off) since you do not seem to delete anything.

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

Let

170

For of

187

Let

binaries/data/mods/public/gui/replaymenu/replay_menu.js
257–258

Single replay selected maybe ?

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

Readd newline

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

Same here

source/gui/CList.cpp
166

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

source/gui/CList.h
88

Doxygen ?

source/gui/COList.cpp
350

Range loop selecteditem for the name felse invert iterator

Angen 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

Angen 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
Angen 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)

Angen 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

Angen 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
67

does whatever uses that checks for null or undefined ?

77

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

Angen 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

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

modio list

Angen 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