Compare commits

..

136 Commits

Author SHA1 Message Date
bgreman
4ad8c01d53 Indiciated gripen support version 2021-08-08 12:52:04 -07:00
RndName
2410771eac Fix AAA Flak generator using wrong index
- Fixes #1519 as the Opel Blitz unit generator was using the index without incrementing it
2021-08-08 12:52:04 -07:00
Dan Albert
58a3c45052 Remove abandoned campaigns.
(cherry picked from commit 07f8a203ea)
2021-08-08 12:52:04 -07:00
RndName
e92a1eed75 tweak the airlift procurement
- only buy airlift capable aircraft if there is one friendly cp without a factory which can only be reached via airlift
- prevent that an airlift procurement gets fulfilled at a different cp than the requesting one. this ensures that the cp also has a factory to produce ground units which can then be transported
- fixes an infinite buy loop if the fulfilling cp has no factory and the requesting cp has no space for airlift
- have always 2 reserve transport planes at the biggest CP
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
02f0738666 Fix patrol_speed save compat for 4.1 (#1507)
* Fix patrol_speed save compat for 4.1

* Fix and simplify 4.1 compat fix
2021-08-08 12:52:04 -07:00
Khopa
ed46b8a467 Campaign Update 8.0 : operation_dynamo.miz, updated mission targets ids
(cherry picked from commit f2608cecd5)
2021-08-08 12:52:04 -07:00
Khopa
50f41c573b Campaign Update 8.0 : golan_heights_lite.miz, updated mission targets ids
(cherry picked from commit c95d5464d8)
2021-08-08 12:52:04 -07:00
Khopa
3e6685811e Campaign Update 8.0 : caen_to_evreux.miz, updated mission targets ids
(cherry picked from commit 0ac7466a81)
2021-08-08 12:52:04 -07:00
Dan Albert
add840c23f Update Syria Full and Humble Helper campaigns.
https://github.com/dcs-liberation/dcs_liberation/issues/1494
https://github.com/dcs-liberation/dcs_liberation/issues/1497
(cherry picked from commit ff571db494)
2021-08-08 12:52:04 -07:00
Kangwook Lee
d08407a8f2 Wrap lines for NotesPage
(cherry picked from commit 8608b73009)
2021-08-08 12:52:04 -07:00
Dan Albert
a41dc15f4e Stop cluttering the kneeboard with empty notes.
(cherry picked from commit d11174da21)
2021-08-08 12:52:04 -07:00
Kangwook Lee
222467d429 Fix text foreground color for dark kneeboard
(cherry picked from commit 77e62d5a54)
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
be5b87be2a Update changelog for 4.x
BAI missions are actually planned at low altitude. The problem remaining is that they have join/hold/split waypoints, which makes the flight times _incredibly_ long for these slow movers.
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
8cb372674a Changelog updates for 4.x.
Regarding patrol speeds and helo fix.
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
57f49a52e2 Use more sensible patrol speeds for CAP, and fix is_helo (#1492)
* Use more sensible patrol speeds for CAP, and fix is_helo
2021-08-08 12:52:04 -07:00
Dan Albert
1760ee39bb Changelog updates for 4.x.
(cherry picked from commit bef015eb57)
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
0b38c3bbda Tweak max-speed-based patrol altitudes
(cherry picked from commit 6621421a6f)
2021-08-08 12:52:04 -07:00
Magnus Wolffelt
b6895e302e Estimate preferred patrol altitude based on max speed
(cherry picked from commit a3e3e9046f)
2021-08-08 12:52:04 -07:00
RndName
0aef7a1c80 fix for wrong patrol speed
(cherry picked from commit 04cdb6fbfc)
2021-08-08 12:52:04 -07:00
bgreman
86f9ab26e0 Update skynet plugin (#1478)
(cherry picked from commit 8c7e56a2bd)
2021-08-08 12:52:04 -07:00
RndName
ad7b9dac38 improved the validation for planned transfers
- instead of only checking if the transfer destination was captured it now checks if there is a valid route between origin and destination. This also ensures that there will be a check if the current position or next_stop was captured and therefore the transfer should be disbanded.
- disband uncompletable transfer before planning or performing (also when user cheated a base capture)

(cherry picked from commit ac088ea692)
2021-08-08 12:52:04 -07:00
Mustang-25
b6a4489bb1 Rebalanced Aircraft Planning Hierarchies
CAP List:
[+] Mig-21 #1372
[+] Su-34
[moved up] F-15C above the F-14 (probably contentious to some but IMO the AI never capitalizes on the AIM-54 range and the Eagle AI seems to do better in general)
[moved up] JF-17
[moved up] Gripen
[moved down] Su-33
[moved down] Su-27
[moved down] MiG-31
[moved down] MiG-25
[moved down] MiG-29G
[moved down] MiG-29A

* Downgraded MiGs and Sukhois that do not have Fox-3s due to this disadvantage. From personal experience, the 31s and 25s also won't use the longer range of their Fox-1s to warrant for a higher spot on the list.

CAS/BAI List:
[+] Su-33 #1367
[-] Su-24MR (dedicated recce platform, no AG munitions)
[moved up] Su-34
[moved down] Mig-19P
[moved down] UH-1

Strike List:
[-] Su-24MR (dedicated recce platform, no AG munitions)
[moved up] JF-17
[moved up] Harrier

Runway Attack List:
[+] Mirage 2000C

(cherry picked from commit 0d6f420f97)
2021-08-08 12:52:04 -07:00
Dan Albert
6ee0feebb4 Update USN 2005 faction.
https://github.com/dcs-liberation/dcs_liberation/issues/1427
(cherry picked from commit bef85963a6)
2021-08-08 12:52:04 -07:00
Mustang-25
c0e674f0e0 Replace TGP with SPJ for JF-17 CAP/SEAD.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1422.

(cherry picked from commit ee77516716)
2021-08-08 12:52:04 -07:00
Dan Albert
4406d8c1af Campaign updates from Starfire.
(cherry picked from commit 3be57efa97)
2021-08-08 12:52:04 -07:00
Dan Albert
0e6b3b6e0f Ack new campaign version for unaffected maps.
(cherry picked from commit 981d8510c2)
2021-08-08 12:52:04 -07:00
Khopa
f9187d6b59 Added Tin Shield EWR support
(cherry picked from commit 32f05dccd9)
2021-08-08 12:52:04 -07:00
Khopa
da143e403c Added NASAMS support
(cherry picked from commit 4aac2d2b7b)
2021-08-08 12:52:04 -07:00
Dan Albert
e6d2c76641 Add ALIC codes for the tin shield and NASAMS.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
(cherry picked from commit 971d7e730a)
2021-08-08 12:52:04 -07:00
Dan Albert
56307df630 Update the F-16 DEAD loadout to use JSOWs.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
(cherry picked from commit 06f8b9b817)
2021-08-08 12:52:04 -07:00
Dan Albert
46240ca712 Work around pydcs bug.
https://github.com/pydcs/dcs/issues/175 causes setting the AI comm
frequency to raise an exception for aircraft without preset channel
support.

(cherry picked from commit 5d8f655243)
2021-08-08 12:52:04 -07:00
Dan Albert
4c93bb143d Update pydcs to latest master.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
(cherry picked from commit 0cb41469ab)
2021-08-08 12:52:04 -07:00
Dan Albert
77fc358d55 Update pydcs to latest master.
(cherry picked from commit 9f23cb35a9)
2021-08-08 12:52:04 -07:00
bgreman
eedaecab2c Vendor ruler (#1476)
* Fixes ruler module integrity issues by bringing module into source

* Changing ruler stylesheet to vaguely match DCS theme in Liberation

* Changelog

(cherry picked from commit 119d4b9514)
2021-08-08 12:52:04 -07:00
bgreman
09b29b50c9 Updates gripen support fixes legacy DEAD loadouts 2021-08-08 12:52:04 -07:00
bgreman
136c0d49b5 Adds more details to frontline movement logging (#1465)
* adds more detailed logging for frontline movement

* Fixing attribute name

* Fixing if, adding else

(cherry picked from commit 58c96e1329)
2021-08-08 12:52:04 -07:00
RndName
b1b8ad3f1a fix generation of empty transfer during cp capture
when a cp capture happens and the next cp has pending unit deliveries then they will be redeployed to the newly captured cp. The redeploy was drecreasing the num of pending unit deliveries for the old cp but was not removing them completly from the dict when all were removed

(cherry picked from commit 67fa4a8910)
2021-08-08 12:52:04 -07:00
Mustang-25
49b1764d89 Increment to Campaign v8.0
(cherry picked from commit 0117ab8aa4)
2021-08-08 12:52:04 -07:00
Mustang-25
675bfdf628 Increment to Campaign v8.0
(cherry picked from commit a5ade0c41a)
2021-08-08 12:52:04 -07:00
Mustang-25
575da95581 Increment to Campaign v8.0
(cherry picked from commit 4df12ae675)
2021-08-08 12:52:04 -07:00
Mustang-25
41a9d1194d Increment to Campaign v8.0
(cherry picked from commit 274a41f052)
2021-08-08 12:52:04 -07:00
Mustang-25
4f7f93ebd8 Increment to Campaign v8.0
(cherry picked from commit 3670c8f879)
2021-08-08 12:52:04 -07:00
Mustang-25
0f36273de1 Increment to Campaign v8.0
(cherry picked from commit e88bb442f3)
2021-08-08 12:52:04 -07:00
Dan Albert
c6a5161a2a Remove the SA-10 from Syria 2011.
They didn't get this until a few years later. This was a stand-in for
the SA-5 that DCS doesn't have, but the SA-10 is so much more capable
that it's not a good replacement.

(cherry picked from commit 80bf3c97b2)
2021-08-08 12:52:04 -07:00
Dan Albert
2295f4edfe Bump campaign version to 8.0 for latest DCS.
Building IDs changed again. Ack the change in my two campaigns which
don't use these target types.

(cherry picked from commit edbd3de4a4)
2021-08-08 12:52:04 -07:00
Dan Albert
1991c4d48f Add decorator for tracking save compat.
Used to decorate functions or methods that have save compat code for a
given major version.

```
@has_save_compat_for(5)
def foo() -> None:
    ...
```

This function will raise an error at startup if it is decorated as
having save compat for a version other than the current major version of
the game. A new major version is the definition of a save compat break,
so keeping around the old compat code serves no purpose other than
hiding initialization bugs. The compat code and the decorator should be
removed in the branch raising the error.

(cherry picked from commit cd558daf5a)
2021-08-08 12:52:04 -07:00
Dan Albert
81c2bd6c76 Correct int/float confusion in Point APIs.
The heading and distance calculations always return floats.

(cherry picked from commit 6ce02282e7)
2021-08-08 12:52:04 -07:00
Dan Albert
fb964648a8 Use Pillow types from typeshed.
(cherry picked from commit a19a0b6789)
2021-08-08 12:52:04 -07:00
Dan Albert
93c6cb34fb Update to latest pydcs.
This includes the basics that we need to get type checking for pydcs
calls.

Type checking has been disabled in a few monkey-patching cases. Patches
ought to be sent upstream (or in the case of dead unit tracking,
replaced with a better model).

(cherry picked from commit 9de08dc83f)
2021-08-08 12:52:04 -07:00
Dan Albert
be13d8c0a6 More adaptation for pydcs updates.
This is as much as we can do until pydcs actually adds the py.typed
file. Once that's added there are a few ugly monkey patching corners
that will just need `# type: ignore` for now, but we can't pre-add those
since we have mypy warning us about superfluous ignore comments.

(cherry picked from commit 96c7b87ac7)
2021-08-08 12:52:04 -07:00
Brock Greman
6a8a9ef7e9 Fixing broken group generation.
(cherry picked from commit 469dd49def)
2021-08-08 12:52:04 -07:00
Dan Albert
c0f6974d07 Fix some typing in preparation for pydcs types.
Not complete, but progress.

(cherry picked from commit 53f6a0b32b)
2021-08-08 12:52:04 -07:00
Dan Albert
4e9d661c0c Flesh out typing information, enforce.
(cherry picked from commit fb9a0fe833)
2021-08-08 12:52:04 -07:00
Dan Albert
7cfd6b7151 Disallow partially specified generics.
(cherry picked from commit 69c3d41a8a)
2021-08-08 12:52:04 -07:00
Dan Albert
65dfa8e209 Type check the contents of untyped functions.
By default mypy doesn't type check the code within an untyped function.
This enables that and fixes typing errors to accomodate it.

This did uncover a very old bug:
https://github.com/dcs-liberation/dcs_liberation/issues/1417

(cherry picked from commit fc32b98341)
2021-08-08 12:52:04 -07:00
Dan Albert
7015b3a40d Fix unreachable code issues, enable checking.
The loadout case actually could (and previously did) hide bugs from the
type checker, since mypy was smart enough to see that we were removing
None from the input it assumed that the member was non-optional, but
later modifications could cause null values, and since those came from
the UI mypy couldn't reason about this. This meant that mypy assumed the
type could not be optional and wouldn't check that case.

(cherry picked from commit 299ed88f09)
2021-08-08 12:52:04 -07:00
Dan Albert
f9c20d729b Add (mostly disabled) mypy configs.
We're missing a lot of checking right now. Most of it requires
additional cleanup. For now I've enabled what I could and will follow up
to clean up and enable more checking.

(cherry picked from commit 29753a6aa9)
2021-08-08 12:52:04 -07:00
Dan Albert
fa5cbac2fc Add documentation for turn processing.
(cherry picked from commit 7983cd8d62)
2021-08-08 12:52:04 -07:00
RndName
638903ddf7 correct display of turn statistics 2021-08-08 12:52:04 -07:00
RndName
40092bf87f replan opfor mission on sell or buy of tgos
(cherry picked from commit 7229b886e0)
2021-08-08 12:52:04 -07:00
Dan Albert
ec15c37332 Note fix for empty convoy groups.
(cherry picked from commit 8b70d2674f)
2021-08-08 12:52:04 -07:00
RndName
4b1d629e9b remove completely destroyed units from the convoy
(cherry picked from commit 8ba27cdaea)
2021-08-08 12:52:04 -07:00
bgreman
4b526e2b90 Adds Marianas Islands support (#1406)
* Implements #1399

* Reverting accidental change in generate_landmap.py

* Changelog update

* Import beacon data for Marianas.

Co-authored-by: Dan Albert <dan@gingerhq.net>
(cherry picked from commit aa328d3ef7)
2021-08-08 12:52:04 -07:00
Dan Albert
8efe66bb45 Fixup None loadouts for aircraft with no loadouts.
Aircraft that have no loadouts at all (such as the IL-78M) will have no
loadouts and thus no values in the dropdown menu. If the player toggles
the custom layout box we reset the flight's loadout to the selected
loadout, and with no loadouts in the combo box that is None, and
`Flight.loadout` isn't supposed to be optional.

Check for that case in the loadout selector and replace with an empty
loadout if that happens.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1402

(cherry picked from commit 727facfb90)
2021-08-08 12:52:04 -07:00
Dan Albert
d9dadfb43c Fix the legacy tanker.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1379

(cherry picked from commit 4add853473)
2021-08-08 12:52:04 -07:00
RndName
f250be97c7 remove prices from sam generators
The prices are only estimations due to randomization. the real price will be only known when the generator was used and the final units are known

(cherry picked from commit b2db27f9aa)
2021-08-08 12:52:04 -07:00
RndName
c8d22925ee correct prices for ewr and sams
prices will now be calculated for the whole group by the generator by
looking up the price using the  GroundUnitType wrapper

fixes #1163

(cherry picked from commit 96be6c0efe)
2021-08-08 12:52:04 -07:00
Dan Albert
7c706be82b Note the silkworm fix in the changelog.
(cherry picked from commit 3f42f1281d)
2021-08-08 12:52:04 -07:00
Mustang-25
55e5aee75a Corrected Silkworm launcher name
(cherry picked from commit bab8384803)
2021-08-08 12:52:04 -07:00
Florian
e550ca29e8 Remove the randomness from SAM group size.
(cherry picked from commit 3f65928e9d)
2021-08-08 12:52:04 -07:00
Dan Albert
229290dc3d Bump version to 4.1.0. 2021-08-08 12:52:04 -07:00
Dan Albert
670bbc0a28 4.0.1 -> 4.1.0
This includes new features now.

(cherry picked from commit 4e6659e7e8)
2021-08-08 12:52:04 -07:00
Chris Seagraves
3550166a42 Note TGO tooltip improvement in the changelog.
(cherry picked from commit 9e22d4b5df)
2021-08-08 12:52:04 -07:00
RndName
72fe24c656 fixed lua data generation
(cherry picked from commit 357361de3d)
2021-08-08 12:52:04 -07:00
RndName
201fe121ff reworked the skynet group name generation
- added information about the role of the aa site
- moved handling of ground name from tgo to the sam generator to make the tgo cleaner
- adjusted the skynet-config lua to the changes

(cherry picked from commit de443fa3f0)
2021-08-08 12:52:04 -07:00
Dan Albert
a8bd3df46f Minor formatting fix for the changelog.
(cherry picked from commit 20839853b7)
2021-08-08 12:52:04 -07:00
Chris Seagraves
1bc16fc82c Fix for crash when clear weather.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1394

(cherry picked from commit bc2539b566)
2021-08-08 12:52:04 -07:00
Dan Albert
c3f99161ca Remove debug cruft.
We don't need to print the description of every unit on startup.

(cherry picked from commit 2ef2eafdd3)
2021-08-08 12:52:04 -07:00
bgreman
fb85fca565 Addresses #478 to clean up the angle summing functionality. (#1386)
(cherry picked from commit 9bd6f9ef47)
2021-08-08 12:52:04 -07:00
bgreman
9a2041b9d2 Increasing time JTAC radio messages stay on the UI. (#1369)
- Target lost or killed: 10s -> 20s
- New target : 10s -> 30s
- Request JTAC Status: 25s -> 60s

(cherry picked from commit c8e5cefd36)
2021-08-08 12:52:04 -07:00
bgreman
104a46de85 Fixes #240 by making statistics windows axis labels integers (#1370)
(cherry picked from commit 7ba4077f9f)
2021-08-08 12:52:04 -07:00
Mustang-25
3171fd0ef7 Update TGP Restriction Dates
TGP dates to more accurately reflect IRL IOC dates.

(cherry picked from commit 151f8bf329)
2021-08-08 12:52:04 -07:00
Chris Seagraves
a58d3febcb Notes to kneeboard (#1375)
Adds global-level kneeboard notes.  Explicit save compatability with 4.0.0

(cherry picked from commit e94d48c265)
2021-08-08 12:52:04 -07:00
Fryderyk Wysocki
51577c2eb4 Update poland_2010.json (#1380)
* Update poland_2010.json

* Adding MiG-29G to PL faction

Poland has bought some MiG-29Gs from unified Germany in the early '90s

(cherry picked from commit 2a5c523afd)
2021-08-08 12:52:04 -07:00
Chris Seagraves
54ac4a387a Add Cloud Base Altitude to Weather Display (#1371)
Adds tooltip with cloud base altitude to weather panel

(cherry picked from commit f80696b724)
2021-08-08 12:52:04 -07:00
Chris Seagraves
32dc3c3170 asset reference links 😎 (#1363)
Adds urls to unit info pages that don't have data.

(cherry picked from commit 5f5b5f69e3)
2021-08-08 12:52:04 -07:00
Chris Seagraves
dc8f17774e Update main.py (#1382)
(cherry picked from commit d99f8fef09)
2021-08-08 12:52:04 -07:00
Dan Albert
320a5a8abf Add changelog section for 4.0.1.
(cherry picked from commit 0b90b53e09)
2021-08-08 12:52:04 -07:00
Simon Clark
3badda600d Fix begin campaign button on reload. 2021-08-08 12:52:04 -07:00
Dan Albert
8e6e1469d7 Merge branch 'develop-4.x' into master. 2021-06-26 12:59:07 -07:00
Dan Albert
00ca7d0b4d Merge pull request #1208 from dcs-liberation/develop-3.x
Release 3.0.0.
2021-06-10 23:58:41 -07:00
Dan Albert
64c426653c Merge branch 'master' into develop-3.x 2021-06-10 23:46:18 -07:00
Mustang-25
a8960c9bbe Add the First Lebanon War Historical Campaign.
(cherry picked from commit 75e3b4cc84)
2021-06-10 17:39:00 -07:00
Florian
72282845e8 added missing units
(cherry picked from commit 78cd17e279)
2021-06-10 17:37:26 -07:00
Khopa
e64aff4e91 Removed helipad from golan heights campaign to avoid capture trigger error 2021-06-10 23:27:19 +02:00
Dan Albert
e192e54c90 Fix CAS commit range display.
CAS commits around the target, not its flight plan.

(cherry picked from commit 40aa7734e1)
2021-06-09 21:52:02 -07:00
Dan Albert
39b0599b7b Fix engagement distance display.
(cherry picked from commit a9dacf4a29)
2021-06-09 21:45:20 -07:00
Dan Albert
45b40e4aa3 Update Operation Mole Cricket.
https://github.com/dcs-liberation/dcs_liberation/issues/1203
(cherry picked from commit 0594e1148e)
2021-06-09 21:27:22 -07:00
Dan Albert
9887a8ff83 Add Northern Russia campaign.
https://github.com/dcs-liberation/dcs_liberation/issues/1202
(cherry picked from commit 9eacd1563f)
2021-06-09 21:27:21 -07:00
Dan Albert
8d3556aa4b Update mission start guidance.
(cherry picked from commit 66f82b6ff9)
2021-06-09 19:21:18 -07:00
Florian
a59c01bcfe added texts for all units
(cherry picked from commit eb6206ea57)
2021-06-09 19:10:02 -07:00
Brock Greman
fb72962f74 Fixing display of "sunny" during clear conditions at night.
(cherry picked from commit 3ad51cafa8)
2021-06-09 19:09:40 -07:00
Dan Albert
ed1dacfe7c Remove incompatible campaigns.
We have quite a few campaigns now, so removing the broken ones.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1178

(cherry picked from commit 0e68884493)
2021-06-09 19:09:12 -07:00
Florian
794de0fcbb added missing units to price table
(cherry picked from commit 366190ee99)
2021-06-09 19:04:32 -07:00
Dan Albert
9d71b2e727 Make campaign names consistent.
(cherry picked from commit 42d56a324f)
2021-06-09 18:59:05 -07:00
docofmur
5b8f626651 Campaigns for 3.0
4 campaigns updated for 3.0 1 small PG 3 for Caucasus 1 full and 2 parts based on the full

(cherry picked from commit 7d1f1ea2f7)
2021-06-09 18:59:04 -07:00
Dan Albert
461f4b82a9 Add Around the Mountain campaign.
https://github.com/dcs-liberation/dcs_liberation/issues/1199
(cherry picked from commit 30cab8e3a7)
2021-06-09 18:54:15 -07:00
Dan Albert
15653d0628 Add Operation Allied Sword campaign and factions.
https://github.com/dcs-liberation/dcs_liberation/issues/1196
(cherry picked from commit e0e2162c6d)
2021-06-09 18:54:14 -07:00
Dan Albert
dffc631b87 Add Humble Helper campaign and factions.
https://github.com/dcs-liberation/dcs_liberation/issues/1197
(cherry picked from commit f1582fcc10)
2021-06-09 18:54:12 -07:00
Dan Albert
17efb48b2e Make enable_and_reset not half lie.
https://github.com/dcs-liberation/dcs_liberation/issues/1185
(cherry picked from commit b8c14d69c3)
2021-06-08 21:20:15 -07:00
Dan Albert
7e85825d2b Fix typo in Incirlik runway data.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1188

(cherry picked from commit 725b5083c7)
2021-06-08 21:15:04 -07:00
Dan Albert
798591b980 Fix repeated JTACs after multiple generations.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1191

(cherry picked from commit 87dd6b19bf)
2021-06-08 20:56:41 -07:00
Schneefl0cke
4a52af298c Add Recon combat role.
(cherry picked from commit e4c9d8799e)
2021-06-08 20:47:41 -07:00
dependabot[bot]
fe886a754e Bump pillow from 8.1.1 to 8.2.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.1.1 to 8.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/8.1.1...8.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit bc938db7f9)
2021-06-08 20:47:31 -07:00
bgreman
0220fa4ff6 Gripen mod support. 2021-06-08 19:47:44 -07:00
Dan Albert
e7336d8608 Fix hangar status display.
(cherry picked from commit d8881e2734)
2021-06-06 17:13:00 -07:00
Dan Albert
d77a174ac1 Label the player checkbox in the roster editor.
(cherry picked from commit 45869c428e)
2021-06-06 13:43:55 -07:00
Khopa
6348317893 Added a small WW2 campaign on Normandy map (Replacing the former Normandy Small campaign). 2021-06-06 18:49:11 +02:00
Khopa
a516cd2f80 Added a small WW2 campaign on Normandy map (Replacing the former Normandy Small campaign). 2021-06-06 18:45:02 +02:00
Dan Albert
e1aa3e9d0e Suppress events fired while rebuilding model.
(cherry picked from commit d316e13fa6)
2021-06-05 15:21:58 -07:00
Dan Albert
d1d1acf6e0 Hide incompatible campaigns by default.
https://github.com/dcs-liberation/dcs_liberation/issues/1178
(cherry picked from commit 1ea98a6ed1)
2021-06-05 15:15:53 -07:00
Dan Albert
a0e5a707fb Merge pull request #1053 from Khopa/develop_2_5_x
Release 2.5.1.
2021-05-02 13:28:45 -07:00
Dan Albert
4555a4968d Update changelog for 2.5.1. 2021-05-02 13:17:35 -07:00
SnappyComebacks
ae34e4749b Move base EWRs into their own category.
Without this we're sometimes spawning base EWRs at points far outside the base perimeter.
2021-04-28 21:07:22 -07:00
Khopa
635eee9590 Fixed ai_flight_planner for maps lacking frontlines (such as battle of britain on The Channel map) 2021-04-24 00:11:53 +02:00
Khopa
f0558c4c1e Fixed ai_flight_planner for maps lacking frontlines (such as battle of britain on The Channel map) 2021-04-23 23:45:14 +02:00
Dan Albert
637ca8fbca Stop projecting threat zones from front lines.
This is an interim improvement since we should probably be pushing the
BARCAPs into TARCAP roles when the front line is so close. This does
regress flight pathing for anything that should route around the front
(to avoid getting shot at by SHORADS and TARCAPs), but for now it's one
or the other and this is the one everyone's complaining about.

(cherry picked from commit e474748f4d)
2021-04-22 18:23:12 -07:00
Dan Albert
e4e65df976 Generalize commit range display for all patrols.
Fixes https://github.com/Khopa/dcs_liberation/issues/890

(cherry picked from commit 132ba905c7)
2021-04-22 17:55:49 -07:00
Dan Albert
29579a2aec Remove missed merge conflict marker. 2021-04-22 17:49:34 -07:00
Dan Albert
e32b43cffb Show BARCAP commit ranges by default.
BARCAP placement confuses a lot of people but this should make it more
clear.

(cherry picked from commit 208d1b82b5)
2021-04-22 17:46:29 -07:00
C. Perreau
de2e5f861b Merge pull request #1007 from Khopa/develop_2_5_x
Release 2.5.0
2021-04-22 00:08:42 +02:00
Khopa
b27a7fc71b Fixed Lint issue 2021-04-21 22:54:48 +02:00
Khopa
5861ce6146 Fixed error with Ramat David frequency (typo) 2021-04-21 22:38:08 +02:00
Khopa
c732ed556f Fixed airfields frequency on Persian Gulf 2021-04-21 22:30:08 +02:00
Khopa
be1a75e520 Fixed airfields frequency on Syria 2021-04-21 22:14:18 +02:00
Khopa
c41d10c581 Pydcs update to latest version 2021-04-21 12:57:19 +02:00
18 changed files with 33 additions and 116 deletions

View File

@@ -1,27 +1,3 @@
# 4.1.2
Saves from 4.1.1 are compatible with 4.1.2.
## Features/Improvements
* **[Mission Generation]** EWRs are now also headed towards the center of the conflict
* **[UI]** Sell Button for aircraft will be disabled if there are no units available to be sold or all are already assigned to a mission
## Fixes
* **[UI]** Selling of Units is now visible again in the UI dialog and shows the correct amount of sold units
* **[Mission Generation]** Mission results and other files will now be opened with enforced utf-8 encoding to prevent an issue where destroyed ground units were untracked because of special characters in their names.
# 4.1.1
Saves from 4.1.0 are compatible with 4.1.1.
## Fixes
* **[Campaign]** Fixed broken support for Mariana Islands map.
* **[Mission Generation]** Fix SAM sites pointing towards the center of the conflict.
* **[Flight Planning]** No longer using Su-34 for CAP missions.
# 4.1.0
Saves from 4.0.0 are compatible with 4.1.0.
@@ -36,7 +12,6 @@ Saves from 4.0.0 are compatible with 4.1.0.
* **[Flight Planning]** CAP patrol speeds are now set per-aircraft to be more suitable/sensible. By default the speed will be set based on the aircraft's maximum speed.
* **[Mission Generation]** Improvements for better support of the Skynet Plugin and long range SAMs are now acting as EWR
* **[Mods]** Support for version v1.5.0-Beta of Gripen mod. In-progress campaigns may need to re-plan Gripen flights to pick up updated loadouts.
* **[Mission Generation]** SAM sites are now headed towards the center of the conflict
* **[Plugins]** Increased time JTAC Autolase messages stay visible on the UI.
* **[Plugins]** Updated SkynetIADS to 2.2.0 (adds NASAMS support).
* **[UI]** Added ability to take notes and have those notes appear as a kneeboard page.

View File

@@ -288,7 +288,7 @@ class AircraftType(UnitType[Type[FlyingType]]):
logging.warning(f"No data for {aircraft.id}; it will not be available")
return
with data_path.open(encoding="utf-8") as data_file:
with data_path.open() as data_file:
data = yaml.safe_load(data_file)
try:

View File

@@ -67,7 +67,7 @@ class GroundUnitType(UnitType[Type[VehicleType]]):
logging.warning(f"No data for {vehicle.id}; it will not be available")
return
with data_path.open(encoding="utf-8") as data_file:
with data_path.open() as data_file:
data = yaml.safe_load(data_file)
try:

View File

@@ -389,7 +389,7 @@ class PollDebriefingFileThread(threading.Thread):
os.path.isfile("state.json")
and os.path.getmtime("state.json") > last_modified
):
with open("state.json", "r", encoding="utf-8") as json_file:
with open("state.json", "r") as json_file:
json_data = json.load(json_file)
debriefing = Debriefing(json_data, self.game, self.unit_map)
self.callback(debriefing)

View File

@@ -63,7 +63,7 @@ class Operation:
@classmethod
def prepare(cls, game: Game) -> None:
with open("resources/default_options.lua", "r", encoding="utf-8") as f:
with open("resources/default_options.lua", "r") as f:
options_dict = loads(f.read())["options"]
cls._set_mission(Mission(game.theater.terrain))
cls.game = game

View File

@@ -704,7 +704,6 @@ class ConflictTheater:
"Normandy": NormandyTheater,
"The Channel": TheChannelTheater,
"Syria": SyriaTheater,
"MarianaIslands": MarianaIslandsTheater,
}
theater = theaters[data["theater"]]
t = theater()

View File

@@ -39,8 +39,9 @@ class PendingUnitDeliveries:
def sell(self, units: dict[UnitType[Any], int]) -> None:
for k, v in units.items():
self.units[k] -= v
if self.units[k] == 0:
if self.units[k] > v:
self.units[k] -= v
else:
del self.units[k]
def refund_all(self, game: Game) -> None:

View File

@@ -3,7 +3,7 @@ from pathlib import Path
MAJOR_VERSION = 4
MINOR_VERSION = 1
MICRO_VERSION = 2
MICRO_VERSION = 0
def _build_version_string() -> str:
@@ -12,7 +12,7 @@ def _build_version_string() -> str:
]
build_number_path = Path("resources/buildnumber")
if build_number_path.exists():
with build_number_path.open("r", encoding="utf-8") as build_number_file:
with build_number_path.open("r") as build_number_file:
components.append(build_number_file.readline())
if not Path("resources/final").exists():

View File

@@ -129,6 +129,7 @@ CAP_CAPABLE = [
F_14B,
F_14A_135_GR,
Su_33,
Su_34,
J_11A,
Su_30,
Su_27,

View File

@@ -48,7 +48,6 @@ class AirDefenseGroupGenerator(VehicleGroupGenerator[SamGroundObject], ABC):
self.vg.name = self.group_name_for_role(self.vg.id, self.primary_group_role())
self.auxiliary_groups: List[VehicleGroup] = []
self.heading = self.heading_to_conflict()
def add_auxiliary_group(self, role: SkynetRole) -> VehicleGroup:
gid = self.game.next_group_id()

View File

@@ -16,11 +16,7 @@ class EwrGenerator(VehicleGroupGenerator[EwrGroundObject]):
def generate(self) -> None:
self.add_unit(
self.unit_type,
"EWR",
self.position.x,
self.position.y,
self.heading_to_conflict(),
self.unit_type, "EWR", self.position.x, self.position.y, self.heading
)

View File

@@ -2,7 +2,6 @@ from __future__ import annotations
import logging
import math
import operator
import random
from collections import Iterable
from typing import TYPE_CHECKING, Type, TypeVar, Generic, Any
@@ -16,7 +15,6 @@ from dcs.unittype import VehicleType, UnitType, ShipType
from game.dcs.groundunittype import GroundUnitType
from game.factions.faction import Faction
from game.theater import MissionTarget
from game.theater.theatergroundobject import TheaterGroundObject, NavalGroundObject
if TYPE_CHECKING:
@@ -71,27 +69,6 @@ class GroupGenerator(Generic[GroupT, UnitT, UnitTypeT, TgoT]):
) -> UnitT:
raise NotImplementedError
def heading_to_conflict(self) -> int:
# Heading for a Group to the enemy.
# Should be the point between the nearest and the most distant conflict
conflicts: dict[MissionTarget, float] = {}
for conflict in self.game.theater.conflicts():
conflicts[conflict] = conflict.distance_to(self.go)
if len(conflicts) == 0:
return self.heading
closest_conflict = min(conflicts.items(), key=operator.itemgetter(1))[0]
most_distant_conflict = max(conflicts.items(), key=operator.itemgetter(1))[0]
conflict_center = Point(
(closest_conflict.position.x + most_distant_conflict.position.x) / 2,
(closest_conflict.position.y + most_distant_conflict.position.y) / 2,
)
return int(self.go.position.heading_between_point(conflict_center))
class VehicleGroupGenerator(
Generic[TgoT], GroupGenerator[VehicleGroup, Vehicle, Type[VehicleType], TgoT]

View File

@@ -68,8 +68,7 @@ def run_ui(game: Optional[Game]) -> None:
# init the theme and load the stylesheet based on the theme index
liberation_theme.init()
with open(
"./resources/stylesheets/" + liberation_theme.get_theme_css_file(),
encoding="utf-8",
"./resources/stylesheets/" + liberation_theme.get_theme_css_file()
) as stylesheet:
logging.info("Loading stylesheet: %s", liberation_theme.get_theme_css_file())
app.setStyleSheet(stylesheet.read())

View File

@@ -68,7 +68,7 @@ def load_icons():
ICONS["Terrain_Normandy"] = QPixmap("./resources/ui/terrain_normandy.gif")
ICONS["Terrain_TheChannel"] = QPixmap("./resources/ui/terrain_channel.gif")
ICONS["Terrain_Syria"] = QPixmap("./resources/ui/terrain_syria.gif")
ICONS["Terrain_MarianaIslands"] = QPixmap("./resources/ui/terrain_marianas.gif")
ICONS["Terrain_Mariana"] = QPixmap("./resources/ui/terrain_mariana.gif")
ICONS["Dawn"] = QPixmap("./resources/ui/conditions/timeofday/dawn.png")
ICONS["Day"] = QPixmap("./resources/ui/conditions/timeofday/day.png")

View File

@@ -228,7 +228,7 @@ class QWaitingForMissionResultWindow(QDialog):
)
print(file)
try:
with open(file[0], "r", encoding="utf-8") as json_file:
with open(file[0], "r") as json_file:
json_data = json.load(json_file)
json_data["mission_ended"] = True
debriefing = Debriefing(json_data, self.game, self.unit_map)

View File

@@ -80,13 +80,7 @@ class PurchaseGroup(QGroupBox):
def update_state(self) -> None:
self.buy_button.setEnabled(self.recruiter.enable_purchase(self.unit_type))
self.buy_button.setToolTip(
self.recruiter.purchase_tooltip(self.buy_button.isEnabled())
)
self.sell_button.setEnabled(self.recruiter.enable_sale(self.unit_type))
self.sell_button.setToolTip(
self.recruiter.sell_tooltip(self.sell_button.isEnabled())
)
self.amount_bought.setText(f"<b>{self.pending_units}</b>")
@@ -229,18 +223,6 @@ class QRecruitBehaviour:
def enable_sale(self, unit_type: UnitType) -> bool:
return True
def purchase_tooltip(self, is_enabled: bool) -> str:
if is_enabled:
return "Buy unit. Use Shift or Ctrl key to buy multiple units at once."
else:
return "Unit can not be bought."
def sell_tooltip(self, is_enabled: bool) -> str:
if is_enabled:
return "Sell unit. Use Shift or Ctrl key to buy multiple units at once."
else:
return "Unit can not be sold."
def info(self, unit_type: UnitType) -> None:
self.info_window = QUnitInfoWindow(self.game_model.game, unit_type)
self.info_window.show()

View File

@@ -85,13 +85,9 @@ class QAircraftRecruitmentMenu(QFrame, QRecruitBehaviour):
return True
def enable_sale(self, unit_type: AircraftType) -> bool:
return self.can_be_sold(unit_type)
def sell_tooltip(self, is_enabled: bool) -> str:
if is_enabled:
return "Sell unit. Use Shift or Ctrl key to sell multiple units at once."
else:
return "Can not be sold because either no aircraft are available or are already assigned to a mission."
if not self.cp.can_operate(unit_type):
return False
return True
def buy(self, unit_type: AircraftType) -> bool:
if self.maximum_units > 0:
@@ -116,32 +112,24 @@ class QAircraftRecruitmentMenu(QFrame, QRecruitBehaviour):
self.hangar_status.update_label()
return True
def can_be_sold(self, unit_type: AircraftType) -> bool:
inventory = self.game_model.game.aircraft_inventory.for_control_point(self.cp)
pending_deliveries = self.pending_deliveries.units.get(unit_type, 0)
return self.cp.can_operate(unit_type) and (
pending_deliveries > 0 or inventory.available(unit_type) > 0
)
def sell(self, unit_type: AircraftType) -> bool:
# Don't need to remove aircraft from the inventory if we're canceling
# orders.
if not self.can_be_sold(unit_type):
QMessageBox.critical(
self,
"Could not sell aircraft",
f"Attempted to sell one {unit_type} at {self.cp.name} "
"but none are available. Are all aircraft currently "
"assigned to a mission?",
QMessageBox.Ok,
)
return False
inventory = self.game_model.game.aircraft_inventory.for_control_point(self.cp)
pending_deliveries = self.pending_deliveries.units.get(unit_type, 0)
if pending_deliveries <= 0 < inventory.available(unit_type):
inventory.remove_aircraft(unit_type, 1)
if self.pending_deliveries.units.get(unit_type, 0) <= 0:
global_inventory = self.game_model.game.aircraft_inventory
inventory = global_inventory.for_control_point(self.cp)
try:
inventory.remove_aircraft(unit_type, 1)
except ValueError:
QMessageBox.critical(
self,
"Could not sell aircraft",
f"Attempted to sell one {unit_type} at {self.cp.name} "
"but none are available. Are all aircraft currently "
"assigned to a mission?",
QMessageBox.Ok,
)
return False
super().sell(unit_type)
self.hangar_status.update_label()

View File

@@ -42,7 +42,7 @@ class Campaign:
@classmethod
def from_json(cls, path: Path) -> Campaign:
with path.open(encoding="utf-8") as campaign_file:
with path.open() as campaign_file:
data = json.load(campaign_file)
sanitized_theater = data["theater"].replace(" ", "")