Commit Graph

28816 Commits

Author SHA1 Message Date
penev92
a73d710bec Added Util.InternalTypeName() 2022-09-02 20:56:55 +02:00
penev92
9ed2e699c6 Fix tiny error in output string 2022-09-02 20:56:55 +02:00
penev92
2f0f5f4cda Fixed ScrollPanelWidget not resetting on Clear 2022-09-02 16:16:45 +02:00
Gustas
8402d7d476 Improved Widget.RemoveChildren performance
Modifying the list potentially several thousand times is really slow, so notify the child elements that they are being removed and then clear the list in one go.
2022-09-02 16:16:45 +02:00
penev92
378c447ded Misc fixes in AssetBrowserLogic and MapOverlaysLogic 2022-09-02 16:16:45 +02:00
penev92
df836620dc Added missing spacing to map editor dropdowns 2022-09-02 16:16:45 +02:00
Ivaylo Draganov
c1e1765c2f Move game speed lobby dropdown before time limit dropdown
Game speed is the more frequently changed option and with the current
layout it was buried below the fold.
2022-09-02 16:09:05 +02:00
Matthias Mailänder
0b67b5bfae Extract translation strings. 2022-09-02 14:41:24 +03:00
Gustas
dfd5a960ed Fix RepairableBuilding never stopping repair 2022-09-01 18:30:47 +03:00
RoosterDragon
2d45e67bca Teach HierarchicalPathFinder about Immovable actors.
By tracking updates on the ActorMap the HierarchicalPathFinder can be aware of actors moving around the map. We track a subset of immovable actors that always block. These actors can be treated as impassable obstacles just like terrain. When a path needs to be found the abstract path will guide the search around this subset of immovable actors just like it can guide the search around impassable terrain. For path searches that were previously imperformant because some immovable actors created a bottleneck that needed to be routed around, these will now be performant instead. Path searches with bottlenecks created by items such as trees, walls and buildings should see a performance improvement. Bottlenecks created by other units will not benefit.

We now maintain two sets of HPFs. One is aware of immovable actors and will be used for path searches that request BlockedByActor.Immovable, BlockedByActor.Stationary and BlockedByActor.All to guide that around the immovable obstacles. The other is aware of terrain only and will be used for searches that request BlockedByActor.None, or if an ignoreActor is provided. A new UI dropdown when using the `/hpf` command will allow switching between the visuals of the two sets.
2022-08-31 23:12:42 +02:00
RoosterDragon
7e7d94ca89 Fix Locomotor CellCache to not consider transit only cells as crushable.
When the UpdateCellBlocking encountered a transit-only cell (the bibs around a building) it would bail from the loop. This would leave the cellCrushablePlayers set to all players. It would update the cell cache and mark that cell as a crushable location.

When CanMoveFreelyInto would later evaluate a cell, it would consider it passable because the crushable check would pass (cellCache.Crushable.Overlaps(actor.Owner.PlayerMask)) rather than because the transit check (otherActor.OccupiesSpace is Building building && building.TransitOnlyCells().Contains(cell)) would pass.

Although this meant the cell was treated as passable in either scenario, it means the cache contained incorrect data. The cell does not contain any crushable actors but the cache would indicate it did. Correcting this means we can rely on the crushability information stored in the cache to be accurate.
2022-08-31 23:12:42 +02:00
RoosterDragon
77779023d5 Notify of shroud state changes when using DevVisibility cheat.
When this cheat is used by notifying of shroud changes we invoke the usual logic that would occur if the visibility had been granted by units. Without this change any cached information about the visibility is not refreshed. Without this refresh actors with different visibility may not act correctly.

One aspect this improves is frozen actors. Using the visibility cheat will show up all actors on the map. If the cheat is then disabled than frozen actors will appear in their place. Prior to this change a frozen actor would fail to appear if the cheat had caused it to be revealed. Healthbars and selection boxes are also made consistent for similar reasons.
2022-08-31 23:31:48 +03:00
RoosterDragon
1fc1bdc849 Fix frozen actors lacking tooltips if they have the cloak ability.
Since bbf5970bc1 we update frozen actors only when required.

In 8339c6843e a regression was fixed where actors created in line of sight would be invisible.

Here, we fix a related regression where cloaked units that are revealed, and then frozen when you move out of line of sight would lack tooltips.

The fix centers around the setting of the Hidden flag. In the old code this used CanBeViewedByPlayer which checks for visibility modifiers and then uses the default visibility. The bug with this code is that when a visibility modifier was not hiding the actor, then we would report the default visibility state instead. However the frozen visibility state applies here which means if the frozen actor is visible, then we consider the actor to be hidden and therefore tooltips will not appear. In the fixed version we only consider the modifiers. This means a visibility modifier such as Cloak can hide the frozen actor tooltips. But otherwise we do not consider the frozen actor to be hidden. This prevents a frozen actor from hiding its own tooltips in some unintended circular logic. Hidden now becomes just a flag to indicate if the visibility modifiers are overriding things, as intended.
2022-08-31 23:31:48 +03:00
Mustafa Alperen Seki
16babc1975 Fix Fog color on Radar. 2022-08-31 16:04:40 +03:00
Vapre
215898c7ec ScriptActorInterfaces, unbind on actor destroy. 2022-08-30 21:44:39 +02:00
Gustas
fc1d8d2355 Update RA maps to format 12 2022-08-30 20:03:40 +02:00
Gustas
f98a74f70d Update TD maps to format 12 2022-08-30 20:03:40 +02:00
Gustas
89bb800dbf Update D2K maps to format 12 2022-08-30 20:03:40 +02:00
Gustas
09cb38bc6e Update TS maps to format 12 2022-08-30 20:03:40 +02:00
Gustas
c40675cfba Include map.png into uid generation 2022-08-30 20:03:40 +02:00
RoosterDragon
bcf4ff3b7c Prevent radar crash when dealing with map height. 2022-08-30 19:58:48 +02:00
Gustas
539bb09d50 Fix shroud selector dropdown 2022-08-29 21:13:27 +03:00
Gustas
51c09ddae9 Fix Mission Group having all headers selected 2022-08-29 13:45:38 +03:00
Gustas
08dbfe0cbd Refactor ScrollItemWidget to use stateful image names 2022-08-29 13:45:38 +03:00
Gustas
11a2e6e19b Add more confirmation dialogue to the map editor
When saving on top of another map, or when saving on a map that has been edited outside the map editor
2022-08-29 12:31:01 +03:00
Gustas
d3589c051d Add descriptions to all projectiles and warheads 2022-08-29 12:26:33 +03:00
Vapre
6e547469d6 Shroud, combine IsVisible and IsExplored into a single function. 2022-08-28 18:50:51 +02:00
Ivaylo Draganov
cc1f10dd35 Truncate faction name in lobby dropdown button 2022-08-25 10:44:17 +03:00
dnqbob
29fc2b80d9 WithMuzzleOverlay is decoration 2022-08-21 23:59:15 +02:00
Gustas
ce254f8b46 Add per player mutes 2022-08-20 14:52:49 +02:00
Gustas
81da717f19 Add chat on/off icon to glyphs 2022-08-20 14:52:49 +02:00
Gustas
16198c121c Increase the size of ingame-info panel
And add an Actions section for Kick
2022-08-20 14:52:49 +02:00
Gustas
dde10249d5 Fixup faction and score info UI
And increase spectator name length to match regular players
2022-08-20 14:52:49 +02:00
Gustas
58fcffa429 Add anti-flood protection 2022-08-20 10:24:25 +02:00
tomas
ac623d784a Remove Do() and replace with foreach() 2022-08-19 22:38:38 +02:00
tomas
92478a219e Fix crash when selecting the same map 2022-08-18 00:03:50 +02:00
Gustas
3ab6d3f00a Remove map editor debug message 2022-08-17 23:29:11 +02:00
RoosterDragon
32aaac1dc2 HierarchicalPathFinder.PathExists checks the locations are in map bounds.
Without this, passing locations outside the map could cause a crash instead of reporting no path.
2022-08-17 10:13:27 +03:00
Gustas
ae3a1c2561 Add truncation to FactionLabel 2022-08-16 18:58:45 +03:00
Mustafa Alperen Seki
1b1868fca6 Render every available ProductionIconOverlay. 2022-08-16 15:08:51 +03:00
Mustafa Alperen Seki
54340591e3 Unhardcode VeteranProductionIconOverlay. 2022-08-16 15:08:51 +03:00
Gustas
d438508994 Added try/catch for TypeDictionary errors in Lint code
TypeDictionary errors are very hard for modders to debug as they don't mention which actor is causing the error
2022-08-15 23:19:18 +02:00
Matthias Mailänder
cc58fe1a0f Extract translation strings. 2022-08-14 16:11:51 +02:00
Matthias Mailänder
8201a57b10 Don't complain about re-usable terms not getting referenced. 2022-08-14 16:11:51 +02:00
Matthias Mailänder
2c8c6e50da Code cleanup 2022-08-14 16:11:51 +02:00
Gustas
10ac07bf9f Fix ChooseInitialMap 2022-08-13 17:14:21 +02:00
RoosterDragon
8339c6843e Fix actors not being visible when created within sight range of an enemy.
Since bbf5970bc1 we only update frozen actor state on demand rather than every tick. However when the actor was initially created we were failing to set the initial visibility state if the frozen actor was invisible.

With this fix, we now set the visibility states on creation correctly. This fixes an issue where enemy actors created within line of sight would not appear.
2022-08-13 12:05:03 +03:00
RoosterDragon
2599cb26d8 Allow custom cost to exclude source locations in path searches.
During the refactoring to introduce HierarchicalPathFinder, custom costs were no longer applied to source locations. The logic being that if we are already in the source location, then there should be no cost added to it to get there - we are already there!

Path searches support the ability to go from multiple sources to a single target, but the reverse is not supported. Some callers that require a search from a single source to one of multiple targets perform their search in reverse, swapping the source and targets so they can run the search, then reversing the path they are given so things are the correct way around again. For callers that also use a custom cost like the harvester code that do this in order to find free refineries, they might want the custom cost to be applied to the source location. The harvester code uses this to filter out overloaded refineries. It wants to search from a harvester to multiple refineries, and thus reverses this in order to perform the path search. Without the custom cost being applied to the "source" locations, this filtering logic never gets applied.

To fix this, we now apply the custom cost to source locations. If the custom cost provides an invalid path, then the source location is excluded entirely. Although this seems unintuitive on its own, this allows searches done "in reverse" to work again.
2022-08-13 11:58:45 +03:00
RoosterDragon
df858e06d6 Fix HierarchicalPathFinder failing to consider multiple source locations.
When asked to find a path from multiple source locations, the abstract search is used to determine which source locations are viable. Source locations that cannot be reached on the abstract graph are excluded from the local path search. As we know the locations are unreachable, this prevents the local path search from expanding over the entire search space in an attempt to find these unreachable locations, preventing wasted effort.

In order to determine these reachable locations, the abstract search is expanded successively trying to reach each source location each time. However, this failed to account for a property of the ExpandToTarget for which a comment is now added. If the location was found previously, then expanding to try and find it again will fail. If the source locations were close together, it was likely that the initial expansions of the search space would have included them, and thus they would not be found on a later expansion. This would mean these locations would incorrectly be thought unreachable.

To fix this, we check if the location has already been explored (has CellStatus.Closed in the graph). If so we can check the cost to determine if it is reachable.
2022-08-13 11:58:45 +03:00
abcdefg30
f49536ea12 Use Attribute.IsDefined over GetCustomAttributes 2022-08-12 20:14:54 +02:00