Page MenuHomeWildfire Games

Show number of builders besides (not in space) build time.
Needs ReviewPublic

Authored by Freagarach on Nov 14 2019, 8:41 PM.

Details

Reviewers
bb
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This patch lets the number of builders show, as well as the build time left, see rP21121.

There are several options how to show this:

  • Next to eachother (either number first or not).
  • Underneath eachother (either number first or not).
Test Plan

Verify that the manner of translation is correct.

Event Timeline

Freagarach created this revision.Nov 14 2019, 8:41 PM
Owners added a subscriber: Restricted Owners Package.Nov 14 2019, 8:41 PM

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

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

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 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 259| 259| 		resourceCarryingIcon.sprite = "stretched:session/icons/repair.png";
| 260| 260| 		resourceCarryingIcon.tooltip = getBuildTimeTooltip(entState);
| 261| 261| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("%(time)s\n(%(number)s)"), {
| 262|    |-				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")),
|    | 262|+			"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")),
| 263| 263| 				"number": entState.foundation.numBuilders
| 264| 264| 			}) : "";
| 265| 265| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 260| 260| 		resourceCarryingIcon.tooltip = getBuildTimeTooltip(entState);
| 261| 261| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("%(time)s\n(%(number)s)"), {
| 262| 262| 				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")),
| 263|    |-				"number": entState.foundation.numBuilders
|    | 263|+			"number": entState.foundation.numBuilders
| 264| 264| 			}) : "";
| 265| 265| 	}
| 266| 266| 	else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 261| 261| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("%(time)s\n(%(number)s)"), {
| 262| 262| 				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss")),
| 263| 263| 				"number": entState.foundation.numBuilders
| 264|    |-			}) : "";
|    | 264|+		}) : "";
| 265| 265| 	}
| 266| 266| 	else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints))
| 267| 267| 	{
Executing section cli...

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

bb added a subscriber: bb.Jan 14 2020, 9:11 PM

Adding the number of builders to the "front page" should imply adding the time left to the tooltip

wrt the ordering, keep it consistent with the tooltip

bb requested changes to this revision.May 19 2020, 10:22 PM

^

This revision now requires changes to proceed.May 19 2020, 10:22 PM
Freagarach updated this revision to Diff 11934.May 20 2020, 6:02 PM

Swap position.

As for the front page/tooltip thing, I thing there was quite a discussion about that and thus both would be not bad? Better yet obviously is user choice, shall I make this a config option?

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 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 263| 263| 		resourceCarryingIcon.sprite = "stretched:session/icons/repair.png";
| 264| 264| 		resourceCarryingIcon.tooltip = getBuildTimeTooltip(entState);
| 265| 265| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("(%(number)s)\n%(time)s"), {
| 266|    |-				"number": entState.foundation.numBuilders,
|    | 266|+			"number": entState.foundation.numBuilders,
| 267| 267| 				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss"))
| 268| 268| 			}) : "";
| 269| 269| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 264| 264| 		resourceCarryingIcon.tooltip = getBuildTimeTooltip(entState);
| 265| 265| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("(%(number)s)\n%(time)s"), {
| 266| 266| 				"number": entState.foundation.numBuilders,
| 267|    |-				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss"))
|    | 267|+			"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss"))
| 268| 268| 			}) : "";
| 269| 269| 	}
| 270| 270| 	else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/selection_details.js
| 265| 265| 		resourceCarryingText.caption = entState.foundation.numBuilders ? sprintf(translate("(%(number)s)\n%(time)s"), {
| 266| 266| 				"number": entState.foundation.numBuilders,
| 267| 267| 				"time": Engine.FormatMillisecondsIntoDateStringGMT(entState.foundation.buildTime.timeRemaining * 1000, translateWithContext("countdown format", "m:ss"))
| 268|    |-			}) : "";
|    | 268|+		}) : "";
| 269| 269| 	}
| 270| 270| 	else if (entState.resourceSupply && (!entState.resourceSupply.killBeforeGather || !entState.hitpoints))
| 271| 271| 	{
Executing section cli...

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

bb added a comment.May 20 2020, 9:27 PM

There was a bunch of discussion how to display it on the front page. Displaying both was proposed there too, and that seems a sane solution to me too. However to me it sounds odd to display 2 values on the front page and only 1 in the tooltip (the time left is not displayed), I rather have both in the tooltip then.

The tooltip also states how much you speed up construction when adding another builder, so it *does* show two things?

bb added a comment.May 21 2020, 2:37 PM

There are 3 types of information: number of builders, time remaining and speedup by extra worker. Currently the time remaining is on the front page, and the other two in the tooltip. IMO if we add the number of buildings to the front page, we should show all 3 in the tooltip (why would 1 piece of information be in 2 places otherwise?)