4349 Commits

Author SHA1 Message Date
Dan Albert
c02351fde3
Don't fail PRs that regress coverage.
Most of our code is barely testable and our coverage isn't anything to
brag about.
2023-05-14 17:27:39 +02:00
Dan Albert
968a360fde
Gather and upload coverage of python tests. 2023-05-14 17:27:38 +02:00
Dan Albert
03c48376c4
Disallow squadrons from disabling mission types.
After this change, players will always have the final say in what
missions a squadron can be assigned to. Squadrons are not able to
influence the default auto-assignable missions either because that
property is always overridden by the campaign's air wing configuration
(the primary and secondary task properties). The `mission-types` field
of the squadron definition has been removed since it is no longer
capable of influencing anything. I haven't bothered cleaning up the now
useless data in all the existing squadrons though.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2785.
2023-05-14 17:18:55 +02:00
Raffson
5e2625ad21
Propagate changes from Liberation 2023-05-14 17:09:41 +02:00
Raffson
711d102425
Only use bold font on kneeboard
Should fix an issue where letters seem transparent in VR
2023-05-14 16:54:48 +02:00
Raffson
55f1f5c548
Init files for pydcs_extensions 2023-05-14 16:54:48 +02:00
Raffson
b8e2ae9bb7
Fix copy-paste error 2023-05-14 16:07:11 +02:00
Raffson
6ed5283454
Tweaking tasks in aircraft yamls 2023-05-14 16:06:57 +02:00
Raffson
231a857813
Fix mypy errors 2023-05-14 15:16:21 +02:00
Raffson
40f4b1c926
Update dependecies 2023-05-14 15:16:00 +02:00
Raffson
3ce0473c86
Cleanup 2023-05-14 15:13:44 +02:00
Dan Albert
0b6575ca97
Use task priorities from aircraft yamls.
Preferred aircraft per task are now determined by a ranking of weights
stored in the aircraft yaml files. To aid in visualizing the priorities
across aircraft, Liberation can be run with the argument
dump-task-priorities to dump a yaml file in Saved
Games/DCS/Liberation/Debug/priorities.yaml, which will show each task
along with priority sorted aircraft and their weights.

The current weights in the data were exported from the existing lists,
where each position from the bottom of the list was worth 10 (to allow
some games for less shuffling later).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2809.
2023-05-14 14:50:30 +02:00
Dan Albert
9ebbe11d83
Add debug command to dump aircraft priorities.
https://github.com/dcs-liberation/dcs_liberation/issues/2809
2023-05-14 14:30:19 +02:00
Dan Albert
016a9b5762
Load task priorities from YAML.
Not used yet.

https://github.com/dcs-liberation/dcs_liberation/issues/2809
2023-05-14 14:19:47 +02:00
Dan Albert
ddd6063f25
Export current task priorities to aircraft yamls.
Nothing fancy. Rank in reversed (so earliest items in the original list
have the highest index) list * 10 (to leave gaps for balancing).

https://github.com/dcs-liberation/dcs_liberation/issues/2809
2023-05-14 14:14:59 +02:00
Dan Albert
81554c510e
Fix merged classvars in UnitType descendants.
```
>>> class Foo:
...     bar = 0
...     @classmethod
...     def set_bar(cls, v):
...             cls.bar = v
...
>>> class Bar(Foo):
...     ...
...
>>> Bar.set_bar(1)
>>> Bar.bar
1
>>> Foo.bar
0
>>> class Foo:
...     bar = {}
...     @classmethod
...     def add(cls, k, v):
...             cls.bar[k] = v
...
>>> class Bar(Foo):
...     pass
...
>>> Bar.add(0, 1)
>>> Bar.bar
{0: 1}
>>> Foo.bar
{0: 1}
```

The collections are copied by reference into the descendants, whereas
_loaded is copied by value, so that one can stay. Before this patch,
every subtype was loading because _loaded was set per subclass, but they
were all registering with a common collection defined by UnitType rather
than their own class.
2023-05-14 14:08:37 +02:00
Pande4360
1d1df15d5d SW2.6 Fixed Faction 2023-05-12 07:58:57 +02:00
Pande4360
8e12f4e790 SW2.6 Fixed loadouts x/y wing 2023-05-12 07:58:57 +02:00
Pande4360
179850cdb6
Support for SW v2.6 mod (#120)
* Removed AI varients

* Removed AI varients Logo/Banners

* Removed AI varients Logo/Banners

* Removed AI varients ai flgith planner

* Removed AI varients SWPack Fix

* Removed AI varients SWPack - SWWeapon fix
2023-05-11 21:48:19 +02:00
holyorangejuice
bf14c8e32d
WRL Campaign Update Kutaisi2Vaziani (#118) 2023-05-08 00:21:40 +02:00
zhexu14
f965c9ffa7
Handle edge case where aircraft have built in TPGs 2023-05-07 21:43:41 +02:00
zhexu14
0ff60283c2
Add GBU-27 yaml 2023-05-07 21:41:18 +02:00
Dan Albert
06094c54b3
Format aircraft yamls. 2023-05-07 21:33:46 +02:00
zhexu14
065f90ea98
Reset flight's flight plan builder when changing task type.
The mechanism for how this bug arises is that the *WaypointGenerator*
uses the *FlightWaypoint.waypoint_type* to decide whether to generate
the waypoint in the .miz file using a *DeadIngressBuilder* or a
*SeadIngressBuilder*. This *waypoint_type* is set by
*ato.flightplans.<sead|dead>.Builder*, which is set when *ato.flight* is
initialised in the *Flight._flight_plan_builder* member variable based
on *Flight.flight_type*. When *Flight.flight_type* is updated when the
flight is changed from SEAD->DEAD, *Flight._flight_plan_builder* is not
updated in the development build, resulting in it continuing to generate
SEAD waypoints.

This PR adds *set_flight_type()* which sets the *flight_type* property
and updates *Flight._flight_plan_builder* and uses this function when
converting flight types. Ideally, *flight_type* should be made private
and only accessed through getter/setter functions that encapsulate this
behavior, but that would mess up any existing liberation save files.

This PR was tested by:
1. Opening the save file from Issue 2779 in the development build
2. Clicking "Take Off" and confirming that the Weapon Release Type is
"Guided" at the Ingress Waypoint as described in the issue.
3. Opening the save file from Issue 2779 in this PR
4. Converting the SEAD2DEAD flight from DEAD back to SEAD, and then from
SEAD to DEAD
5. Clicking "Take Off" and confirming in the mission editor that the
SEAD2DEAD flight has Weapon Release Type set to "Auto" at the Ingress
Waypoint.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2779.
2023-05-07 21:19:53 +02:00
zhexu14
c44fe4c89e
Track S_EVENT_KILL and S_EVENT_UNIT_LOST as well.
Catch a few more death signals. Still not perfect but a bit better.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2765.
2023-05-07 21:19:53 +02:00
Nosajthedevil
1964f30bfc
Added many premade squadrons.
Added a number of squadrons - US Vietnam War era squadrons for the
OV-10A and F-4B/C, US squadrons for the A-10A, iran squadrons for the
F-4E, and russian, iranian, vietnamese, syrian, and north korean
squadrons for the Mig-21.
2023-05-07 21:19:52 +02:00
Dan Albert
07bd76cd61
Fix typo in Germany 1944.
Oops.
2023-05-07 21:04:15 +02:00
Dan Albert
32b0a3bb12
Replace a bunch of escape sequences.
Unify on using the real letter instead of an escape sequence for better
searchability/readability. There should be no functional change here (if
any, they should be bug fixes).

https://github.com/dcs-liberation/dcs_liberation/issues/2786
2023-05-07 21:04:14 +02:00
Dan Albert
4b8bfae7c9
Fix bad character escape in Caen to Evreux.
The escape sequence looks to be valid according to the spec (although it
would need to be double quoted, but that doesn't fix it), but Python's
parser doesn't appear to handle that. Just use ü.

https://github.com/dcs-liberation/dcs_liberation/issues/2786
2023-05-07 19:31:20 +02:00
Dan Albert
0697a0dd5b
Fix file encoding for some loads.
We've actually been pretty good at getting this right in most of the
code base, but we've missed it in a few places. Python defaults to the
encoding of the current locale unless otherwise specified, and for a US
English Windows install that's cp1252, not UTF-8. I'm not brave enough
to change the locale at startup because I don't know how that might
affect CJK encoding users (or for that matter, non-Latin derived
alphabet UTF-8 variants).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2786.
2023-05-07 19:31:20 +02:00
Dan Albert
4cf7864916
Improve logging in defaultsquadronassigner.py.
https://github.com/dcs-liberation/dcs_liberation/issues/2786
2023-05-07 19:30:44 +02:00
Starfire13
52fb153790
Fixes F-14B squadrons that don't have SEAD as available mission type (#2777)
Fixes the YAMLs for 3 F-14B squadrons that didn't have SEAD as an
available mission type. F-14s use SEAD for TALD deployment. The other
F-14B squadrons and all the F-14A squadrons are fine. I also removed
"Bases:" from one of the squadrons as the other squadron yamls don't
have it and it's unecessary (F-14Bs can already be based at airfields
and carriers.
2023-05-07 19:30:41 +02:00
Raffson
49d965ae7b
Revisit/Update custom payloads 2023-05-07 18:51:51 +02:00
Raffson
55b76de3f4
Formatting -_- 2023-05-06 18:13:36 +02:00
Raffson
29f3de3587
Fixing some issues with mod weapons 2023-05-06 17:19:56 +02:00
Raffson
df4a071a0f
Adjust Strike formation before and after bombing task 2023-05-06 17:08:48 +02:00
Raffson
cb4cf4c3ac
Bumb pydcs 2023-05-06 17:03:12 +02:00
Raffson
cd579528b5
Update changelog.md 2023-05-06 16:58:04 +02:00
Pande4360
b36e7ea750
Support for SW mod v2.55 (#116) 2023-05-04 21:45:26 +02:00
Raffson
2ce63abf04
Use Courier font for kneeboard 2023-05-01 18:15:58 +02:00
Raffson
199467f31b
Export txt version of kneeboard pages 2023-05-01 18:12:17 +02:00
Raffson
b4b19d3ad5
Avoid claiming unused aircraft
Probably the final Fix #97
Unused aircraft (assigned upon takeoff) would get claimed but since it's not possible to delete those flights after aborting, these flights wouldn't get released anymore. This should fix that issue, including a migrator change to correct the number of claimed aircraft per squadron.
2023-05-01 18:12:17 +02:00
Raffson
31cfc333c7
Fine-tuning kneeboard
Partial fix #106
2023-05-01 18:12:16 +02:00
Raffson
d18b89484a
Update changelog.md 2023-04-23 21:27:21 +02:00
Raffson
6be517ad3e
Add A-7E Corsair II mod
Banner, icon, payloads & export by Adecarcer

Create A-7E.lua

Co-Authored-By: Antonio <54774215+Adecarcer@users.noreply.github.com>
2023-04-23 18:50:04 +02:00
Antonio
81e6e682bb New Squadrons for Vietnam Era
Adding several different squadrons (A-4, A-6, F-4B/C, Broncos, etc...) for "Yankee Station" campaign.  All Vietnam era related.
All of them with corresponding liveries that can be easily found on DCS User Files download pages
2023-04-23 18:19:06 +02:00
Raffson
907acefbc8
Update F-4E payloads (#112) 2023-04-23 17:39:57 +02:00
Raffson
449a5bf0fc
Update SplashDamage2 script 2023-04-22 17:53:03 +02:00
Raffson
350caefbf8
Tweak F-14A-135-GR & F/A-18C payloads 2023-04-15 20:55:12 +02:00
Raffson
fad48ebaed
Improve AI SEAD capabilities 2023-04-15 20:44:57 +02:00