Commit Graph

27 Commits

Author SHA1 Message Date
Andre Mohren
a86f41cd5c Made Valued optional for traits who do not require it. 2018-09-28 22:06:56 +01:00
Andre Mohren
81e1b39bb9 Made PowerManager optional for traits who do not require it. 2018-07-26 14:02:42 +01:00
Mustafa Alperen Seki
ec61527ebc Don't show negative prerequisites on tooltip 2018-04-26 17:10:26 +02:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Alexis Hunt
157a783df5 Correct UI for unslowed queues in low power.
Because of the way the tick logic works, 0 (or any negative number) for
LowPowerSlowdown is functionally equivalent to 1. But LowPowerSlowdown
is multipled by a time in several cases, so while 1 will produce the
correct result (no slowdown), 0 will say that the time remaining is
00:00. Forbid nonpositive values, and correct the d2k mod which was
using 0.

Additionally, in the production tooltip, the colour should display as
white even in low power if there is no slowdown.
2018-01-13 16:13:59 +01:00
RoosterDragon
5338784e45 Fix bad uses of FirstEnabledTraitOrDefault on TraitInfos.
These are not traits so this method does not work. We can use EnabledByDefault on the ConditionalTraitInfo instead.
2017-12-10 13:39:24 +00:00
RoosterDragon
7a7eed4fb7 Add FirstEnabledTraitOrDefault helper method.
This avoids the allocations caused by LINQ when using traits.FirstOrDefault(Exts.IsTraitEnabled). This is important in FrozenActorLayer.RefreshState which is called very often. We apply the new helper method to all areas using the old pattern. An overload that takes an array allows arrays to be enumerated without causing allocations.
2017-12-10 13:39:24 +00:00
Paul Chote
458c913264 Clean up ProductionTooltipLogic:
- Avoid creating unnecessary bindings
- Fix time display not updating on low power
- Fix power usage color not updating on power changes
- Avoid duplicated text size calculations
2017-09-10 21:30:55 +02:00
Paul Chote
4f00d62237 Move hardcoded production keys into yaml. 2017-09-10 21:30:55 +02:00
rob-v
199e9847d1 Add tooltips to production statistics #12820 2017-04-17 21:51:23 +02:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
23f4ae5027 Replace UpgradeMinEnabledLevel checks with an EnabledByDefault shim. 2016-11-19 17:19:25 +00:00
reaperrr
efa6ad64f7 Remove now-redundant TooltipInfo check 2016-10-23 18:42:36 +02:00
reaperrr
00c0161513 Show internal name instead of crashing when buildable actor has no tooltip
But throw a lint error instead.
2016-10-23 14:59:22 +02:00
reaperrr
074bb78cbd Made Tooltip trait upgradable 2016-10-23 14:59:18 +02:00
Tyson Liddell
aeb1e07823 Moved production description from Tooltip to Buildable 2016-10-16 12:03:42 +11:00
Alexis Hunt
becbee8388 Move resource tick logic into chrome classes. 2016-08-27 17:17:24 -04:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
abcdefg30
ed3f3706f9 Reduce trait lookups further by adding a BuildableInfo parameter to GetBuildTime 2016-01-21 22:29:01 +01:00
abcdefg30
17daac11a1 Avoid unnecessary lookups in the production logic
by improving the GetBuildTime method and moving lookups around.
2016-01-21 22:24:49 +01:00
Paul Chote
b6f463729b Add a ChromeLogic base class for chrome logic. 2015-10-21 19:35:35 +01:00
atlimit8
9acf121eb1 Replace ActorInfo.Traits.WithInterface with ActorInfo.TraitInfos<T>() 2015-09-21 15:50:57 -05:00
atlimit8
09984683a7 Add ActorInfo.TraitInfo[OrDefault]<T>() requiring ITraitIfo types 2015-09-19 09:56:14 -05:00
atlimit8
8162fa27ab Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types 2015-09-19 09:49:24 -05:00
Paul Chote
1109ec53d1 Update UI timers for variable game speed. 2015-09-06 17:48:42 +01:00
Matthias Mailänder
ff6dbde8d7 move widget code to commons 2015-02-28 20:32:19 +01:00