Page MenuHomeWildfire Games

Add a diplomacy colors button to the diplomacy window
ClosedPublic

Authored by temple on Feb 22 2018, 5:54 PM.

Details

Summary

Add a diplomacy colors button to the diplomacy window, since players might not notice the button in the minimap panel. Suggested by @elexis.

Test Plan

Could do in the same style as the close button, but it'd be a very wide button.
Using the green/red icon might help players connect it with the green/red minimap icon.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

temple created this revision.Feb 22 2018, 5:54 PM
elexis accepted this revision.Feb 22 2018, 6:00 PM

Since the screenshot is in 1024x768, since I doubt any language will have a that long translation that we run into problems, since the ceasefire label still has it's own line, since the code reads well and since I assume you tested your patch, accepting and thanking.

This revision is now accepted and ready to land.Feb 22 2018, 6:00 PM
Vulcan added a subscriber: Vulcan.Feb 22 2018, 6:30 PM

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 (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 413| 413| 				// Players see colors depending on diplomacy
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
|    | 416|+						g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
|    | 417|+							g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418|    |-					g_DiplomacyColorPalette.Enemy;
|    | 418|+								g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 421| 421| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1252|1252| 
|1253|1253| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1254|1254| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1255|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1255|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1256|1256| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1257|1257| 	});
|1258|1258| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1253|1253| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1254|1254| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1255|1255| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1256|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1256|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1257|1257| 	});
|1258|1258| 
|1259|1259| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1254|1254| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1255|1255| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1256|1256| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1257|    |-	});
|    |1257|+		});
|1258|1258| 
|1259|1259| 	let resCodes = g_ResourceData.GetCodes();
|1260|1260| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1743|1743| 	for (let rct of resourcesCounterTypes)
|1744|1744| 		for (let rt of resourcesTypes)
|1745|1745| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1746|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1746|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1747|1747| 
|1748|1748| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1749|1749| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1080| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1155| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1156| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1157| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

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

This revision was automatically updated to reflect the committed changes.
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Feb 22 2018, 6:30 PM