Page MenuHomeWildfire Games

Add a countdown timer to the research progress panel
ClosedPublic

Authored by temple on Feb 14 2018, 7:44 PM.

Details

Summary

We can see the countdown timer in the bottom right panel when we click on a structure, but it would be nice to have it in the research panel in the upper right side.


Suggested by @ffffffff.

Test Plan

The countdown covers the icons but it doesn't seem too distracting to me. (I suppose we could make the countdown timers optional, similar to "detailed tooltips".)

Diff Detail

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

Event Timeline

temple created this revision.Feb 14 2018, 7:44 PM
elexis added a subscriber: elexis.Feb 14 2018, 8:07 PM

Code looks ok.
Don't see an option as mandatory.

The problem isn't displaying the time but hiding the icon behind two overlays now.
Moving the time to the bottom of the button doesn't seem to help, still covers the icon.
Decreasing the fontsize?
Making that green or the text more transparent?

binaries/data/mods/public/gui/session/session.js
1336

sprintf ok since its the same as elsewhere

binaries/data/mods/public/simulation/components/GuiInterface.js
608

Ok, it's cheap (< 5 techs researched simultaenously, not part of GetentityState so nothing to keep in sync)

Vulcan added a subscriber: Vulcan.Feb 14 2018, 8:26 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
| 410| 410| 				// Players see colors depending on diplomacy
| 411| 411| 				g_DisplayedPlayerColors[i] =
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
|    | 413|+						g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414| 414| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415| 415| 					g_DiplomacyColorPalette.Enemy;
| 416| 416| 
|    | [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
| 411| 411| 				g_DisplayedPlayerColors[i] =
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413| 413| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
|    | 414|+							g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415| 415| 					g_DiplomacyColorPalette.Enemy;
| 416| 416| 
| 417| 417| 		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
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413| 413| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414| 414| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415|    |-					g_DiplomacyColorPalette.Enemy;
|    | 415|+								g_DiplomacyColorPalette.Enemy;
| 416| 416| 
| 417| 417| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 418| 418| 	}
|    | [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
|1245|1245| 
|1246|1246| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1247|1247| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1248|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1248|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1249|1249| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1250|1250| 	});
|1251|1251| 
|    | [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
|1246|1246| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1247|1247| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1248|1248| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1249|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1249|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1250|1250| 	});
|1251|1251| 
|1252|1252| 	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
|1247|1247| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1248|1248| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1249|1249| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1250|    |-	});
|    |1250|+		});
|1251|1251| 
|1252|1252| 	let resCodes = g_ResourceData.GetCodes();
|1253|1253| 	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
|1736|1736| 	for (let rct of resourcesCounterTypes)
|1737|1737| 		for (let rt of resourcesTypes)
|1738|1738| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1739|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1739|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1740|1740| 
|1741|1741| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1742|1742| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1073| »   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
|1148| »   »   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
|1149| »   »   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
|1150| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'upgrades'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 286| 286| 	var cmpUpgrade = Engine.QueryInterface(ent, IID_Upgrade);
| 287| 287| 	if (cmpUpgrade)
| 288| 288| 		ret.upgrade = {
| 289|    |-			"upgrades" : cmpUpgrade.GetUpgrades(),
|    | 289|+			"upgrades": cmpUpgrade.GetUpgrades(),
| 290| 290| 			"progress": cmpUpgrade.GetProgress(),
| 291| 291| 			"template": cmpUpgrade.GetUpgradingTo()
| 292| 292| 		};
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'isIdle'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 350| 350| 			"isGuarding": cmpUnitAI.IsGuardOf(),
| 351| 351| 			"canPatrol": cmpUnitAI.CanPatrol(),
| 352| 352| 			"possibleStances": cmpUnitAI.GetPossibleStances(),
| 353|    |-			"isIdle":cmpUnitAI.IsIdle(),
|    | 353|+			"isIdle": cmpUnitAI.IsIdle(),
| 354| 354| 		};
| 355| 355| 
| 356| 356| 	let cmpGuard = Engine.QueryInterface(ent, IID_Guard);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 414| 414| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 415| 415| 
| 416| 416| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 417|    |-			{
|    | 417|+			
| 418| 418| 				// For units, take the range in front of it, no spread. So angle = 0
| 419| 419| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 420|    |-			}
|    | 420|+			
| 421| 421| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 422| 422| 			{
| 423| 423| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 419| 419| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 420| 420| 			}
| 421| 421| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 422|    |-			{
|    | 422|+			
| 423| 423| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 424| 424| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 425|    |-			}
|    | 425|+			
| 426| 426| 			else
| 427| 427| 			{
| 428| 428| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 424| 424| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 425| 425| 			}
| 426| 426| 			else
| 427|    |-			{
|    | 427|+			
| 428| 428| 				// not in world, set a default?
| 429| 429| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 430|    |-			}
|    | 430|+			
| 431| 431| 		}
| 432| 432| 	}
| 433| 433| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 800| 800| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 801| 801| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 802| 802| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 803|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 803|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 804| 804| 	}
| 805| 805| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 806| 806| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'r'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 825| 825| 		let color = playerColors[owner];
| 826| 826| 		if (!color)
| 827| 827| 		{
| 828|    |-			color = { "r":1, "g":1, "b":1 };
|    | 828|+			color = { "r": 1, "g":1, "b":1 };
| 829| 829| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 830| 830| 			if (cmpPlayer)
| 831| 831| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'g'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 825| 825| 		let color = playerColors[owner];
| 826| 826| 		if (!color)
| 827| 827| 		{
| 828|    |-			color = { "r":1, "g":1, "b":1 };
|    | 828|+			color = { "r":1, "g": 1, "b":1 };
| 829| 829| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 830| 830| 			if (cmpPlayer)
| 831| 831| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'b'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 825| 825| 		let color = playerColors[owner];
| 826| 826| 		if (!color)
| 827| 827| 		{
| 828|    |-			color = { "r":1, "g":1, "b":1 };
|    | 828|+			color = { "r":1, "g":1, "b": 1 };
| 829| 829| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 830| 830| 			if (cmpPlayer)
| 831| 831| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 4 spaces.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 904| 904| 
| 905| 905| GuiInterface.prototype.GetNonGaiaEntities = function()
| 906| 906| {
| 907|    |-    return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
|    | 907|+	return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
| 908| 908| };
| 909| 909| 
| 910| 910| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1319|1319| 		}
|1320|1320| 	}
|1321|1321| 	else
|1322|    |-	{
|    |1322|+	
|1323|1323| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1324|1324| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1325|1325| 		// wall piece.
|1340|1340| 			"pos": start.pos,
|1341|1341| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1342|1342| 		});
|1343|    |-	}
|    |1343|+	
|1344|1344| 
|1345|1345| 	if (end.pos)
|1346|1346| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1343|1343| 	}
|1344|1344| 
|1345|1345| 	if (end.pos)
|1346|    |-	{
|    |1346|+	
|1347|1347| 		// Analogous to the starting side case above
|1348|1348| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1349|1349| 		{
|1381|1381| 				"pos": end.pos,
|1382|1382| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1383|1383| 			});
|1384|    |-	}
|    |1384|+	
|1385|1385| 
|1386|1386| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1387|1387| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1559|1559| 
|1560|1560| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1561|1561| 		if (cmpVisual)
|1562|    |-		{
|    |1562|+		
|1563|1563| 			if (!allPiecesValid || !canAfford)
|1564|1564| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1565|1565| 			else
|1566|1566| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1567|    |-		}
|    |1567|+		
|1568|1568| 
|1569|1569| 		++entPool.numUsed;
|1570|1570| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1633|1633| 			{
|1634|1634| 				minDist2 = dist2;
|1635|1635| 				minDistEntitySnapData = {
|1636|    |-						"x": pos.x,
|    |1636|+					"x": pos.x,
|1637|1637| 						"z": pos.z,
|1638|1638| 						"angle": cmpPosition.GetRotation().y,
|1639|1639| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1634|1634| 				minDist2 = dist2;
|1635|1635| 				minDistEntitySnapData = {
|1636|1636| 						"x": pos.x,
|1637|    |-						"z": pos.z,
|    |1637|+					"z": pos.z,
|1638|1638| 						"angle": cmpPosition.GetRotation().y,
|1639|1639| 						"ent": ent
|1640|1640| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1635|1635| 				minDistEntitySnapData = {
|1636|1636| 						"x": pos.x,
|1637|1637| 						"z": pos.z,
|1638|    |-						"angle": cmpPosition.GetRotation().y,
|    |1638|+					"angle": cmpPosition.GetRotation().y,
|1639|1639| 						"ent": ent
|1640|1640| 				};
|1641|1641| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1636|1636| 						"x": pos.x,
|1637|1637| 						"z": pos.z,
|1638|1638| 						"angle": cmpPosition.GetRotation().y,
|1639|    |-						"ent": ent
|    |1639|+					"ent": ent
|1640|1640| 				};
|1641|1641| 			}
|1642|1642| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1781|1781| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1782|1782| 	}
|1783|1783| 	else if (data.target === secondMarket)
|1784|    |-	{
|    |1784|+	
|1785|1785| 		result = {
|1786|1786| 			"type": "is second",
|1787|1787| 			"gain": cmpEntityTrader.GetGoods().amount,
|1788|1788| 		};
|1789|    |-	}
|    |1789|+	
|1790|1790| 	else if (!firstMarket)
|1791|1791| 	{
|1792|1792| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1788|1788| 		};
|1789|1789| 	}
|1790|1790| 	else if (!firstMarket)
|1791|    |-	{
|    |1791|+	
|1792|1792| 		result = { "type": "set first" };
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!secondMarket)
|1795|1795| 	{
|1796|1796| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		result = { "type": "set first" };
|1793|1793| 	}
|1794|1794| 	else if (!secondMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = {
|1797|1797| 			"type": "set second",
|1798|1798| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1799|1799| 		};
|1800|    |-	}
|    |1800|+	
|1801|1801| 	else
|1802|1802| 	{
|1803|1803| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1799|1799| 		};
|1800|1800| 	}
|1801|1801| 	else
|1802|    |-	{
|    |1802|+	
|1803|1803| 		// Else both markets are not null and target is different from them
|1804|1804| 		result = { "type": "set first" };
|1805|    |-	}
|    |1805|+	
|1806|1806| 	return result;
|1807|1807| };
|1808|1808|

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

ffffffff accepted this revision.Feb 18 2018, 1:39 AM
ffffffff added a reviewer: ffffffff.
ffffffff removed a subscriber: ffffffff.
This revision is now accepted and ready to land.Feb 18 2018, 1:39 AM
elexis accepted this revision.Feb 18 2018, 3:03 AM

Since you mentioned that you tried different fonts and graphics options, should be ok. Assuming that you and the other reviewer tested.

tested is ok just curious how it look like if the fps counter font is taken and the counter is shown on bottom center of the icon or bottom right .




Computer font isn't necessarily bad, but it doesn't really fit the style imo.





Bold seems too aggressive, smaller size seems too small. (First and fourth are the patch.)

last one ?! :()

How it looks like for 0:01, 30:00 and 300:00?

Also I can suggest to show timer only on mouse hover and hide on mouse leave (or make transparent with alpha ~0.3) to avoid covering of the icon.

Also I can suggest to show timer only on mouse hover and hide on mouse leave (or make transparent with alpha ~0.3) to avoid covering of the icon.

Well, the point is to see the time without clicking (or hovering) on things. Right now you can click the icon and it brings you to the building where you can see the time.

How it looks like for 0:01, 30:00 and 300:00?

Longest research time is 1:30 for unlock champions, so probably not an issue. But maybe at some point we'll want to add units there too.

In D1300#53881, @temple wrote:

Well, the point is to see the time without clicking (or hovering) on things. Right now you can click the icon and it brings you to the building where you can see the time.

Yeah, just a suggestion.

Longest research time is 1:30 for unlock champions, so probably not an issue. But maybe at some point we'll want to add units there too.

What's about 0:01?

P.S. It'd be good to have bounds test, that texts aren't overflowing in gui elements for all languages.

making green more transparent?

i can still see icon :)

making green more transparent?

Not green, but the timer.

What's about 0:01?

In D1300#53888, @temple wrote:

What's about 0:01?

Btw, why we don't use mm:ss format instead of m:ss?

In D1300#53888, @temple wrote:

What's about 0:01?

Btw, why we don't use mm:ss format instead of m:ss?

bc most of the times are under 10min i guess??

Btw, why we don't use mm:ss format instead of m:ss?

bc most of the times are under 10min i guess??

Yes, extra leading zeros seem unnecessary. Something like ":10" instead of "0:10" is also possible but I think having a zero there helps establish it's a time rather than something else.

Lots of choices but I'll keep it simple and stay with the original version. Thanks for the input.