Commit Graph

4137 Commits

Author SHA1 Message Date
Paul Chote
ea32c758eb Expose default UI labels and tooltips to yaml. 2017-12-12 22:43:11 +01:00
Paul Chote
99908c4d80 Move hardcoded list of lobby options into yaml. 2017-12-12 22:43:11 +01:00
Paul Chote
2e24c14503 Make SpawnMPUnitsInfo fields readonly. 2017-12-12 22:43:11 +01:00
Paul Chote
763630f547 Make DeveloperInfo fields readonly. 2017-12-12 22:43:11 +01:00
Paul Chote
97cdce7448 Add additional metadata to lobby options. 2017-12-12 22:43:11 +01:00
Arular101
b71b2ad523 Upgrade rules for increasing HP and damage by 100x for the TD mod 2017-12-12 22:18:41 +01:00
Arular101
917d6b7627 Upgrade rules for increasing HP and damage by 100x for the RA mod 2017-12-12 20:50:27 +01:00
RoosterDragon
7760c41bd9 Avoid array resizing in OpenAlAsyncLoadSound.
- Where it is accessible, use the length of the stream to presize the MemoryStream to the correct size.
- Instead of copying out the result via ToArray, grab the underlying buffer via GetBuffer and use that to create the sound source.

This avoids extraneous copying of the array containing the audio.
2017-12-12 00:01:04 +01:00
RoosterDragon
0899d02377 Avoid allocations when generating RadarSignatureCells.
The RadarWidget can supply a reusable buffer to each trait to avoid individual traits having to return new enumerables. Additionally, this allows the two traits to avoid LINQ and further allocations as they can manually enumerate and populate the buffer themselves.
2017-12-12 00:00:51 +01:00
Paul Chote
55b6084b60 Add a lint test for conflicting Interactable and Selectable. 2017-12-11 19:45:07 +01:00
Paul Chote
c87409ed1a Remove legacy bounds code. 2017-12-11 19:45:07 +01:00
Paul Chote
bf57eceeec Select highest priority actor when not drag selecting. 2017-12-11 19:45:07 +01:00
Paul Chote
ff5b4b15b3 Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
6f5d035e79 Introduce IMouseBounds and split/rework mouse rectangles.
The render bounds for an actor now include the area covered
by bibs, shadows, and any other widgets. In many cases this
area is much larger than we really want to consider for
tooltips and mouse selection.

An optional Margin is added to Selectable to support cases
like infantry, where we want the mouse area of the actor
to be larger than the drawn selection box.
2017-12-11 19:45:07 +01:00
Paul Chote
8fcc80b05a Use IRender.ScreenBounds in ScreenMap.
Traits are now required to trigger a ScreenMap update whenever they
believe that their ScreenBounds have changed.
2017-12-11 19:45:07 +01:00
Paul Chote
fa65fef4d1 Add IRenderModifier.ModifyScreenBounds to support WithShadow. 2017-12-11 19:45:07 +01:00
Paul Chote
86bfe28ade Add ScreenBounds method to IRender interface.
This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
2017-12-11 19:45:07 +01:00
Paul Chote
46f6263061 Update ScreenMap state in a single pass at the end of the tick. 2017-12-11 19:45:07 +01:00
Paul Chote
373aaee004 Use World.(AddTo|RemoveFrom)Maps in Immobile/Building. 2017-12-11 19:45:07 +01:00
Paul Chote
9e18ec7314 Simplify ScreenMap bounds checking. 2017-12-11 19:45:07 +01:00
Paul Chote
cdc426d162 Add IActorPreview.ScreenBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
506b677527 Add ModelAnimation.IsVisible property. 2017-12-11 19:45:07 +01:00
Paul Chote
041431d966 Add ISpriteSequence.Bounds and Animation(WithOffset).ScreenBounds.
The bounds define the smallest Rectangle that covers all frames within a sequence.
2017-12-11 19:45:07 +01:00
reaperrr
85c5259361 Fix AI crashing when trying to make parachuted harvester search map for resources while mid-air 2017-12-11 01:55:18 +01:00
reaperrr
b5ffe17d60 Make AI skip harvester orders if map has no resources 2017-12-11 01:55:18 +01:00
reaperrr
9ad0d78cdd Make the AI only consider harvesters 'idle' if last resource search failed
Otherwise the AI would consider the harvester 'idle' in too many situations.
This way, the AI now only uses its own resource search algorithm if the next resource patch is too far away for the FindResources activity to find it.
2017-12-11 01:55:18 +01:00
reaperrr
4d553900cf Move up harv.IsEmpty check in HackyAI
This is a fairly cheap check, so we should perform it before the activity checks
2017-12-11 01:55:18 +01:00
RoosterDragon
70ffa99203 Fix some uses of Exts.IsTraitEnabled. 2017-12-11 01:46:41 +01:00
RoosterDragon
ec84b61316 Reduce memory required in MovementClassDomainIndex
The number of distinct domains on a map is often dozens, or at most hundreds. We can use a ushort to represent this easily, and reduce the size of the backing storage required to track domain indicies over the whole map.
2017-12-11 01:41:07 +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
cb670d83b3 Set PredictedStance when changing stance from Lua. 2017-12-08 01:54:55 +01:00
Paul Chote
b4c5346346 Migrate hotkey linter to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
74c390d1d0 Migrate input settings to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
2f79173044 Migrate hotkey consumers to HotkeyManager. 2017-12-08 01:29:15 +01:00
Paul Chote
811427adc4 Add HotkeyReference.IsActivatedBy method. 2017-12-08 01:29:15 +01:00
Paul Chote
c4237d6a1a Rename NamedHotkey to HotkeyReference. 2017-12-08 01:29:15 +01:00
RoosterDragon
62ab6ae6f1 OccupiedCells and TargetableCells must return arrays, not just enumerables.
This allows callers to efficiently enumerate these returned collections without the allocation and overhead imposed by the IEnumerable interface. All implementations were already returning arrays, so this only required a signature change.
2017-12-07 20:39:30 +02:00
Paul Chote
9d2935935c Add a debug visualization for screen map rectangles. 2017-12-04 23:10:23 +01:00
Pavel Penev
450cbeea96 Added an extra bit of installer data to Install.log 2017-12-02 00:08:50 +01:00
Paul Chote
8fea476a0d Fix NRE when ProvidesPrerequisite is defined on the player actor. 2017-11-26 19:51:46 +01:00
Paul Chote
b898b5001a Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear. 2017-11-26 15:58:00 +01:00
Paul Chote
ea05221180 Count AttackStatus.NeedsToTurn as valid for AttackBase.IsAttacking. 2017-11-26 15:58:00 +01:00
Marwan
8a38c6ef23 WithTextDecoration Fix 2017-11-26 15:35:50 +01:00
Paul Chote
855042894c Fix bogus cached PowerState for map placed actors. 2017-11-26 03:37:33 +01:00
reaperrr
5ec3ad0957 Fix turrets following target even if AttackTurreted is disabled or paused 2017-11-25 03:55:56 +02:00
reaperrr
456d32f3eb Make Attack* traits PausableConditional and replace IsDisabled with IsTraitDisabled checks 2017-11-25 03:55:56 +02:00
reaperrr
68487d1197 Replace turret IsDisabled check with AT.IsTraitDisabled check 2017-11-25 03:55:56 +02:00
reaperrr
cea2658f31 Remove IsDisabled from AffectsShroud traits
Makes them only disableable via conditions.
2017-11-25 03:55:56 +02:00
reaperrr
ede6d5a57d Remove Actor.IsDisabled check from Cloak
Makes cloaking only disableable via conditions.
2017-11-25 03:55:56 +02:00