Compare commits

..

1493 Commits

Author SHA1 Message Date
Dan Albert
9bd99f9cde Configure squadron sizes for Abu Dhabi.
(cherry picked from commit ec49a10135)
2023-06-03 22:07:59 +00:00
Dan Albert
d2cee713d8 Fix Black Sea LHA parking limits.
Everything else was within the limits, but I had forgotten to check the
LHAs.

(cherry picked from commit 23e3630169)
2023-06-03 22:07:59 +00:00
Dan Albert
1e0ef288be Ack campaign versions for new squadron limits.
I haven't tested all of them, but I know these are compatible, so
advertise them as such.

(cherry picked from commit e20ab5fbc0)
2023-06-03 22:07:59 +00:00
Dan Albert
12a0186246 Warn for new squadron rules with old campaigns.
It's not feasible to actually check the parking limits because we can't
identify parking limits for carriers until the theater is populated.
Doing so is expensive (and depends on other NGW inputs). Instead,
compare against the version of the campaign and guess.

A new (minor) campaign version has been introduced which makes this
required to improve the UI hint. Campaigns that are compatible with the
new rules should update their version to advertise support.

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

(cherry picked from commit 4fd2bb131b)
2023-06-03 22:07:59 +00:00
Dan Albert
2f1a9d3dfd Disallow air wing generation with overfull bases.
This also changes the window close button of the air wing configuration
dialog to cancel rather than revert and continue, because otherwise
there's no way for the user to back out of the dialog without fixing all
the overfull bases first.

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

(cherry picked from commit 42a7102948)
2023-06-03 22:07:59 +00:00
Dan Albert
7c690227d6 Show overfull airbase details in air wing config.
https://github.com/dcs-liberation/dcs_liberation/issues/2910
(cherry picked from commit d271ff17c2)
2023-06-03 22:07:59 +00:00
Dan Albert
8172461db4 Show parking capacities in air wing config.
This does show the theoretical parking use of full squadrons even when
the new rules are not enabled. Since limits can be enabled manually
later in the game, it's still useful information, even if it's a bit
misleading.

https://github.com/dcs-liberation/dcs_liberation/issues/2910
(cherry picked from commit cb61dfccc4)
2023-06-03 22:07:59 +00:00
Dan Albert
87ed02deb0 Add new-game option to show air wing config.
Working on this UI was a huge pain because it required manually creating
a game before the UI could be used.

(cherry picked from commit 56f93c76eb)
2023-06-03 22:07:59 +00:00
Dan Albert
59676fb0fe Move CLI game generation after UI init.
(cherry picked from commit 36cb3a386c)
2023-06-03 22:07:59 +00:00
Dan Albert
7cfd6381fb Factor out game creation parameters in main.
Want to move this deeper into the launch process so that it can use the
UI, but don't want to pass the loosely typed argparse namespace any
more than we have to.

(cherry picked from commit c25e830e6c)
2023-06-03 22:07:59 +00:00
Dan Albert
9f7aa7b75b Fix line endings.
(cherry picked from commit 5d08990cd0)
2023-06-01 23:00:48 -07:00
Starfire13
5f5422b579 Add Final Countdown II campaign.
Designed for Normandy 2.0

(cherry picked from commit 2a45cd8899)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
16ad43f260 Updates china_2010.yaml
Replaces T-55 with Type 59 MBT, adds Type 093 attack sub from China Assets pack

(cherry picked from commit 90b880ec3c)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
9cd1a06651 Update russia_2010.yaml
Adds Ropucha landing ship, Improved Kilo sub

(cherry picked from commit 5f0c570d65)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
2bf1ba6d12 Update allies_1944.yaml
Adds 105mm field howitzer to allies

(cherry picked from commit ce102fcc50)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
e705a2ddbf Enforces Topgun: Maverick Rogue Nation livery for Iranian Tomcat
(cherry picked from commit 30c792c15a)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
60dd8f3245 Adds support for Chinese sub Type_093.yaml
(cherry picked from commit 2f45b856d6)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
0ecc53ef27 Create TYPE-59.yaml
(cherry picked from commit 31d2b756ab)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
2f715a1427 Create Horch_901_typ_40_kfz_21.yaml
(cherry picked from commit b5cf889c09)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
e28ffe97ac Create Pak40.yaml
(cherry picked from commit 19958f91ca)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
54bd4189bd Create Wespe124.yaml
(cherry picked from commit c775a898a4)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
a762970469 Create LeFH_18-40-105.yaml
(cherry picked from commit 535244f6f3)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
c5ebde3cd3 Create Higgins_boat.yaml
(cherry picked from commit 9d1d3bdcfa)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
38ce82f3f9 Create M2A1-105.yaml
(cherry picked from commit 36eef2b1b9)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
16ef182a8d Create IMPROVED_KILO.yaml
(cherry picked from commit 7788425c5c)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
8ac582b9a8 Create BDK-775.yaml
(cherry picked from commit ee0c21b3e5)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
11d77c0fe6 Create santafe.yaml
(cherry picked from commit 54cd619f75)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
c1eab6715b Create leander-gun-condell.yaml
(cherry picked from commit 051940e23c)
2023-06-01 23:00:48 -07:00
ColonelAkirNakesh
4be77472e7 Create leander-gun-lynch.yaml
(cherry picked from commit 4fbd7defa3)
2023-06-01 23:00:48 -07:00
Dan Albert
af65254db5 Add missing note about 7.0.0 -> 7.1.0 save compat.
(cherry picked from commit 90bda9383d)
2023-06-01 23:00:48 -07:00
Dan Albert
b523b03e3c Minor campaign version bump for Normandy 2.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2804.

(cherry picked from commit 7798e2970c)
2023-05-30 23:59:35 -07:00
Dan Albert
aae53ffc63 Update beacon data.
Did this for Normandy 2... but unsurprisingly there aren't a whole lot
of beacons in a WW2 map.

(cherry picked from commit 410c25b331)
2023-05-30 23:59:35 -07:00
Dan Albert
c6916d8da2 Update pydcs.
Normandy 2 support.

https://github.com/dcs-liberation/dcs_liberation/issues/2804
(cherry picked from commit cff74525d6)
2023-05-30 23:59:35 -07:00
Dan Albert
8ae64f57b5 Update Normandy landmap for Normandy 2.
https://github.com/dcs-liberation/dcs_liberation/issues/2804
(cherry picked from commit 8b7f107044)
2023-05-30 23:59:35 -07:00
Dan Albert
b132543b7e Add Normandy 2 landmap inputs.
https://github.com/dcs-liberation/dcs_liberation/issues/2804
(cherry picked from commit c365a0d739)
2023-05-30 23:59:35 -07:00
Dan Albert
1836b0bd98 Force polygons into validity during GIS import.
Not sure why, but some polygons become invalid (which usually means a
self-intersecting "polygon", such as two triangles that meet at a point)
during this transformation. Shapely includes a tool to reshape polygons
into validity, so use that.

(cherry picked from commit 1f4fd0fd04)
2023-05-30 23:59:35 -07:00
Dan Albert
29a05fa0e7 Tolerate empty settings files.
(cherry picked from commit 4bb60cb500)
2023-05-30 23:59:35 -07:00
Dan Albert
da1f84a8f5 Add settings for battlefield commander slots.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2235.

(cherry picked from commit fe96a415be)
2023-05-30 23:59:35 -07:00
Dan Albert
5d22d4f43c Add performance option to prevent missile tasks.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2508.

(cherry picked from commit 6699289bf7)
2023-05-30 23:59:35 -07:00
Dan Albert
6adde1cb3e Add changelog note for BAI fix.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2922.

(cherry picked from commit a85d3243fb)
2023-05-30 21:22:27 -07:00
zhexu14
81a00981eb issue 2922: make BAI plannable against missile and costal sites
(cherry picked from commit e024013093)
2023-05-30 21:22:27 -07:00
Dan Albert
ed17fc97d9 Replace more Patriot STRs with real EWRs.
Not all of these nations actually field this radar (according to
Wikipedia), but at least it's a real EWR, and it's the only blue one
we've got.

(cherry picked from commit 7f2607cf08)
2023-05-30 21:22:27 -07:00
ColonelAkirNakesh
75ee0de23f Replaces Patriot STR with AN/FPS-117 EWR, adds USS Harry Truman
(cherry picked from commit 29ffb526f2)
2023-05-30 21:22:27 -07:00
Dan Albert
a4d7c66621 Fix formatting of takeoff time.
(cherry picked from commit 257dabe4fa)
2023-05-25 22:44:35 -07:00
Dan Albert
998864797d Add UI for TOT offset adjustment.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2912.

(cherry picked from commit 406fb61fa4)
2023-05-25 22:44:35 -07:00
Dan Albert
5cca4eb051 Save the TOT offset in the flight plan.
Prep work for exposing this to the UI.

(cherry picked from commit 49dfa95c61)
2023-05-25 22:44:35 -07:00
Dan Albert
d5c335c698 Allow save compat to exist for two versions.
We want to clean up eventually, but allowing it to exist in both develop
and the release branch makes cherry picks easier.

(cherry picked from commit c80e5b259f)
2023-05-25 22:44:35 -07:00
Dan Albert
7fea15ee07 Make the flight details menu modal.
Prevents players from accidentally deleting flights they're currently
viewing, which would cause an error.

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

(cherry picked from commit 64e2213f28)
2023-05-25 22:19:40 -07:00
Dan Albert
a31296cbc0 Add changelog section for 7.1.0.
(cherry picked from commit ced93afd49)
2023-05-25 22:19:40 -07:00
Dan Albert
fe60757891 Branch 7.1.0. 2023-05-25 21:16:02 -07:00
Dan Albert
7614017828 Bump version to 7.0.1. 2023-05-23 01:41:13 -07:00
Dan Albert
61879aeafa Fix line endings.
These get broken whenever someone uses the GitHub file upload editor,
since that doesn't understand .gitattributes.

(cherry picked from commit 6f4ac1dc39)
2023-05-23 00:50:38 -07:00
Starfire13
f5b9052257 Update Golan Heights and Caen to Evreux campaigns.
I had asked Khopa for permission to edit two of his campaigns to fix
some issues. Only the YAMLs have been edited, .miz files did not need
changes. I have tested both YAMLs to make sure campaigns will generate.
Also tested generating turn 1 .miz and ran it in DCS.

Golan Heights:
1. Removed the 2 problematic squadrons from Marj Ruhayyil that were
causing aircraft losses due to larger aircraft sizes not fitting at that
airfield (which is intended for helicopters).
2. Implemented squadron limits.

Caen to Evreux:
1. Re-arranged squadrons for better force distribution and revised
primary and secondary mission types for better default play experience.
2. Implemented squadron limits.

(cherry picked from commit f831c8efdd)
2023-05-23 00:50:38 -07:00
Starfire13
b27d2be0d1 Update Apache loadouts.
BAI loadout updated to use the new radar guided hellfires. Aux tanks
removed in favour of extra cannon ammo.

(cherry picked from commit e3c6b03603)
2023-05-20 02:34:02 -07:00
Dan Albert
e1a1eca5da Fix syntax error in bluefor_modern.yaml.
(cherry picked from commit 7a2e8279cd)
2023-05-19 18:00:32 -07:00
Dan Albert
c695db0f98 Checkpoint game before sim, auto-revert on abort.
An alternative to
https://github.com/dcs-liberation/dcs_liberation/pull/2891 that I ended
up liking much better (I had assumed some part of the UI would fail or
at least look terrible with this approach, but it seems to work quite
well).

On by default now since it's far less frightening than the previous
thing.

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

(cherry picked from commit 24e72475b4)
2023-05-19 17:53:34 -07:00
Starfire13
ff20f16109 Update scenic_inland.yaml
A formatting fix for scenic route 2 that was preventing new campaign start. Fixing at Fuzzle's request as he doesn't have the time for it right now.

(cherry picked from commit f10350dac4)
2023-05-19 17:43:59 -07:00
Dan Albert
8af3dc6965 Fuzzle campaign updates.
https://github.com/dcs-liberation/dcs_liberation/issues/2889
(cherry picked from commit f068976749)
2023-05-19 01:28:08 -07:00
Dan Albert
e6cf253e45 Attempt to reset the simulation on abort.
This is optional because I really don't know if I trust it. I don't see
much wrong with it (aside from the warning about not using it with auto-
resolve, because it won't restore lost aircraft), but it's really not
something I'd built for since it's not going to be possible as the RTS
features grow.

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

(cherry picked from commit 4b4c45e90f)
2023-05-19 01:19:49 -07:00
Dan Albert
8dc3fca290 Update contributors list.
<3
2023-05-18 22:24:00 -07:00
dependabot[bot]
0d18b57074 Bump starlette from 0.26.1 to 0.27.0
Includes dependent update to fastapi.

Bumps [starlette](https://github.com/encode/starlette) from 0.26.1 to 0.27.0.
- [Release notes](https://github.com/encode/starlette/releases)
- [Changelog](https://github.com/encode/starlette/blob/master/docs/release-notes.md)
- [Commits](https://github.com/encode/starlette/compare/0.26.1...0.27.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-18 22:23:08 -07:00
Dan Albert
b745e7c8ec Rehiding speed controls for 7.
7 is shipping sooner than expected, so re-hide these since it's not
ready yet.

https://github.com/dcs-liberation/dcs_liberation/issues/2746
2023-05-18 22:02:37 -07:00
Dan Albert
800ca598ef Add missing changlog note for C-47.
https://github.com/dcs-liberation/dcs_liberation/pull/2812
2023-05-18 21:38:08 -07:00
Dan Albert
212813e31d Update pydcs.
Support for DCS 2.8.5.40170, including laser hellfire, pylon 5 for the
apache, and a more tolerant livery scanner (not all liveries will be
discovered, but Liberation at least won't crash).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2880.
2023-05-18 21:30:18 -07:00
Dan Albert
571fe21d57 Fix campaign line endings. 2023-05-18 21:16:29 -07:00
Starfire13
cd952312b7 Update Starfire's campaign updates for 10.7. 2023-05-17 19:03:48 -07:00
Dan Albert
23982fdac6 Add changelog note for pydcs livery scanner crash fix.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2747.
2023-05-16 21:28:29 -07:00
Dan Albert
8724b458a8 Add changelog note for TALD overfly fix.
https://github.com/dcs-liberation/dcs_liberation/issues/2781
2023-05-16 20:56:33 -07:00
Dan Albert
ef64899701 Add changelog note for "recreate as" fix.
https://github.com/dcs-liberation/dcs_liberation/issues/2779
2023-05-16 20:56:33 -07:00
Dan Albert
51e4dc5c22 Add changelog note for fixed recovery tanker tasks.
https://github.com/dcs-liberation/dcs_liberation/issues/2771
2023-05-16 20:56:33 -07:00
Dan Albert
ac5edeb936 Add changelog note for improved dead event handling.
https://github.com/dcs-liberation/dcs_liberation/issues/2765
2023-05-16 20:56:33 -07:00
Dan Albert
f7364d04ed Add changelog note for air wing reset fix.
https://github.com/dcs-liberation/dcs_liberation/issues/2751
2023-05-16 20:56:33 -07:00
Dan Albert
483bf73213 Add changelog note for BAI planning fix.
https://github.com/dcs-liberation/dcs_liberation/issues/2618
2023-05-16 20:56:33 -07:00
Dan Albert
0b87f90d4f Add changelog note for built-in TGP fix. 2023-05-16 20:56:33 -07:00
Dan Albert
202fe1109b Add changelog note for AEW&C planning fix.
https://github.com/dcs-liberation/dcs_liberation/issues/2048
2023-05-16 20:56:33 -07:00
Dan Albert
5a8863b07e Add changelog note for TALD fix.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2780.
2023-05-16 20:56:33 -07:00
Dan Albert
889e1f5da2 Finish wiring up SAM orientation control.
The UI works beautifully, but that's not worth much if it doesn't
actually change the data...

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2479.
2023-05-16 18:28:18 -07:00
ColonelAkirNakesh
418d78f99b Adds J-11 flyable, Jeff and BS3 liveries
Adds J-11 to CJTF Blue. Enforces fictional USAF Aggressor livery for J-11, fictional US livery for Jeff, non-Russian 'neutral black' livery for BS3.
2023-05-16 18:10:53 -07:00
ColonelAkirNakesh
a4b5bc198c Restores Flak 18 to free German faction 2023-05-16 18:09:37 -07:00
zhexu14
fcb2f21d36 add unit tests for mission_types function in controlpoint objects (#2870)
This PR adds unit tests that can be planned against control points.
2023-05-16 18:09:03 -07:00
zhexu14
15abf3d6fe Update ADM141 data to include clsids for hornet 2023-05-16 18:06:50 -07:00
Dan Albert
a8b7aca4fb Make wind speed moddable.
These should probably be overridable per theater and per season, but
even with that we'll want some defaults.

https://github.com/dcs-liberation/dcs_liberation/issues/2862
2023-05-16 00:52:51 -07:00
Dan Albert
799dbfa99c Move and split up weather.py.
This is getting out of hand, and I'm about to make it worse.
2023-05-16 00:52:51 -07:00
Dan Albert
eb31a0f038 Rework wind speed Weibull inputs, tune.
The previous method of using a uniform scalar of the MSL wind speed for
higher altitudes didn't offer enough control. In particular, the shape
needs to be quite different to skew low, mid, high.

This patch reworks that system so the parameters of each distribution
are configured per-altitude level. To keep some continuity between
altitudes (on a windy day, all levels should have higher wind speeds on
average), the wind speed of the lower altitude will be added to the
scale value of the higher altitude.

Since it wasn't practical to approximate the previous behavior with the
new system, this also handles the tuning of each. The low altitude
speeds remain mostly unchanged (typically around 5 knots expect for
thunderstorms), but the average speeds for other altitudes went up to
more closely match the previous intent but without the massive
overshoot. At 2000m wind speeds are typically in the 20-25 knot range
now, and 8000m 30-50 knots.

https://www.quora.com/What-is-the-average-wind-speed-at-different-altitudes
has some of the source data, and Quora is the most authoritative source
there is. It claims that cruise altitude winds can get "as high as 150
knots", but doesn't claim anything about the average. I had a
surprisingly difficult time finding good data for cruise altitude air
speeds for non-jet stream paths (though many of our maps are in jet
streams), so I just eyeballed it from
https://turbli.com/wind-during-flights/.

https://github.com/dcs-liberation/dcs_liberation/issues/2861

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2863.
2023-05-15 22:44:17 -07:00
Dan Albert
78e2da9196 Use weibull distribution for wind generation.
Wind speeds should not be uniformly distributed. This switches to a
Weibull distribution which allegedly (see the bug) is good enough.
Experimentally that seems true as well, though I know nothing about how
wind works irl. This at least looks like it'll generate reasonable
variation in missions while keeping the 1st through 3rd quartile
behaviors from getting out of hand.

I'm very uncertain about the scaling factor aspect of this. Naively the
wind speeds at different altitudes ought to be somewhat correlated, but
I'm not sure how much, and whether this kind of scaling is at all the
right way to do it. As before, meh, close enough?

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2861.
2023-05-15 21:37:43 -07:00
Dan Albert
ca96a232f0 Revert "Use the actual Country type instead of the name."
This reverts commit bd2ec12e0f.

Country is both the data (name, ID, etc) and the container for groups
added to the miz, so it can't be used across multiple mission
generations. See https://github.com/pydcs/dcs/issues/314 for potential
follow up work that would let us do this.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2864.
2023-05-15 18:23:48 -07:00
Dan Albert
03671bbfb0 Allow manual SAM orientation.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2479.
2023-05-13 17:20:03 -07:00
Dan Albert
97c4168d13 Wrap settings titles. 2023-05-13 16:59:49 -07:00
Dan Albert
e0edfa68b1 Make settings scrollable. 2023-05-13 16:59:49 -07:00
Dan Albert
97c238a4bb Warn players that take off disallows new flights. 2023-05-13 16:47:56 -07:00
Dan Albert
a6c5b03212 Do not create refueling tasks without tankers.
If the package does not have a tanker, the refueling task will cause AI
flights to go to an arbitrary tanker, which may cause them to fly
through enemy territory or even go farther than their arrival airbase.

It's also not remotely possible for every AI flight in the game to
refuel in most missions. There's typically one tanker and dozens of
aircraft that would previously attempt to refuel.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2716.
2023-05-13 16:23:31 -07:00
zhexu14
5b148a74aa add tests for mission_types for various theather ground objects 2023-05-13 12:56:38 -07:00
ColonelAkirNakesh
33242048e7 Makes guard tower (house2arm) a AAA unit 2023-05-13 12:50:49 -07:00
Dan Albert
4f7932ad8a Remove old aircraft selection mode.
New mode seems to be working well.
2023-05-13 12:47:51 -07:00
Dan Albert
8158cc7112 Add livery selection dropdown to air wing config.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1861.
2023-05-13 12:33:02 -07:00
Dan Albert
50d7a3e46f Update pydcs.
More livery APIs...
2023-05-13 12:24:24 -07:00
Starfire13
b6b9a22668 Update B-52H.yaml
Added antiship mission type to B52
2023-05-12 22:21:36 -07:00
Dan Albert
bd2ec12e0f Use the actual Country type instead of the name.
We want other pieces of country information (in particular the short
names). This cleans up a lot of code anyway.

As an added bonus, this now catches squadrons that used invalid names
which would previously be passed through to pydcs and... then I don't
know what would happen.
2023-05-12 22:18:40 -07:00
Dan Albert
752a90cddb Fix broken squadron.
It's "The Netherlands", not "Netherlands".
2023-05-12 22:18:40 -07:00
Dan Albert
004594639e Update pydcs.
Includes the rewritten livery scanning code. It might need some more
tweaks to be fast enough, but it at least now doesn't spam the log for
machines that don't have DCS (or Liberation) installed, and it's not
slow until something tries to use it, so until we add the UI we won't
have to pay for it during startup.
2023-05-12 18:10:11 -07:00
ColonelAkirNakesh
6943adf6df Germany 1944 free unit list fixes.
1. Removes Flak18 as these currently require Kdo.G.40. (part of the WW2
Asset Pack) to fire at player. ED-supplied single missions are having
Flak18s w/out WW2 Asset Pack firing at a point in the air.

2. Adds Opel Blitz to frontline for more variety, balance, and some
little bit of historical accuracy. My understanding is late war was more
truck strafing than HVARing Panzers.

3. Adds guard tower to AAA units to have a functioning AAA since Flak18s
don't work.
2023-05-12 18:05:12 -07:00
Dan Albert
5ad57d2878 Move code docs to a readthedocs project.
Ported the existing docs, but the real goal is getting the docs for
campaign version moved here, as well as the manual. RTD will have an
"edit on github" button that'll keep this accessible to players, but
it'll be much easier to keep docs up to date while developing features
if it's part of the code base.
2023-05-10 23:14:04 -07:00
Dan Albert
acb2d01d92 Update pydcs.
No new data (I think), but includes a bunch of fixes for the lua parser
and rewrites some suspicious looking (but probably safe) code in the
livery scanner.

Also changes this dependency to non-editable by default. Pip chose this
automatically for me at some point, but the rules for whether or not a
py.typed file will actually be detected for an editable install are
complicated and sometimes this won't work, leading too a lot of mypy
errors. There's no need for this to be editable anyway.
2023-05-10 23:03:14 -07:00
Dan Albert
15fa73a514 Add option to limit squadron sizes and begin full.
Adding temporarily as an option to make sure it's not a terrible idea,
but the old mode will probably go away.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1583.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2808.
2023-05-05 18:16:42 -07:00
Dan Albert
7f94b34277 Add an option to prefer primary tasked aircraft.
We're still using mostly the same aircraft selection as we have before
we added squadrons: the closest aircraft is the best choice.

This adds an option to obey the primary task set by the campaign
designer (can be overridden by players), even if the squadron is farther
away than one that is capable of it as a secondary task.

I don't expect this option to live very long. I'm making it optional for
now to give people a chance to test it, but it'll either replace the old
selection strategy or will be removed.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1892.
2023-05-04 23:08:11 -07:00
Dan Albert
4d2ed64a70 Fix the command line campaign generator. 2023-05-04 23:05:21 -07:00
Dan Albert
e444761059 Support replacing squadrons in-place. 2023-05-04 20:44:27 -07:00
zhexu14
c9e4b5eba4 enable AEWC missions on FOBs 2023-05-04 20:35:51 -07:00
Dan Albert
c14c7cc73d Make patch check informational as well. 2023-05-04 18:41:27 -07:00
Dan Albert
5e459c2390 Expand python coverage, use coveragerc. 2023-05-04 10:07:34 -07:00
Dan Albert
4ee6de2c84 Make coverage checks informational.
PRs shouldn't be failing because coverage dropped. Not until our tests
aren't terrible, anyway.
2023-05-04 10:07:34 -07:00
Dan Albert
a7d2eca209 Add a test for the Aircraft component.
Leaflet (or maybe react-leaflet?) isn't very testable, so we can really
only test that mocks were called with the right props for the leaflet
components we expect, but that's still better than nothing.
2023-05-04 01:18:45 -07:00
Dan Albert
57a4a7c282 Test typescript and collect coverage.
We don't actually have any tests yet :(
2023-05-03 23:18:15 -07:00
Dan Albert
b4c5236d8b 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-03 23:18:15 -07:00
Dan Albert
de2a779715 Gather and upload coverage of python tests. 2023-05-03 21:54:52 -07:00
zhexu14
352c2ddc56 make BAI plannable against vehicles only 2023-05-03 10:12:15 -07:00
Dan Albert
76e6aff9d7 Ignore parse errors of preferences file.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2613.
2023-05-02 00:39:18 -07:00
Dan Albert
b4c02767ac Update pydcs.
Includes the fix to prevent the livery scanner from crashing on import
when the Liberation preferences file cannot be parsed.

https://github.com/dcs-liberation/dcs_liberation/issues/2613
2023-05-02 00:39:18 -07:00
zhexu14
aa2a888ed0 Handle edge case where aircraft have built in TPGs 2023-05-02 00:34:18 -07:00
zhexu14
b50d82feff Add GBU-27 yaml 2023-05-02 00:34:18 -07:00
Dan Albert
cce9592ac8 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-04-26 23:26:23 -07:00
Dan Albert
b69def652e Add debug command to dump aircraft priorities.
https://github.com/dcs-liberation/dcs_liberation/issues/2809
2023-04-26 23:26:23 -07:00
Dan Albert
6df83485e1 Load task priorities from YAML.
Not used yet.

https://github.com/dcs-liberation/dcs_liberation/issues/2809
2023-04-26 23:26:23 -07:00
Dan Albert
e297fcbff8 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-04-26 23:26:23 -07:00
Dan Albert
2f2ebff674 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-04-26 23:09:57 -07:00
Dan Albert
06b74c4ca6 Update mypy, fastapi, pydantic.
mypy update is needed for typing.Self support. It caught an existing bug
(missing @property on override), and fixed a bug so we can drop an
ignore.

Upgrading mypy requires upgrading pydantic to get the newest pydantic
mypy plugin, and since that's what's driving fastapi it's probably smart
to upgrade those together.
2023-04-26 23:00:23 -07:00
Dan Albert
7ddfc5e5ad Fix pydcs extension packages.
pydcs_extensions.__init__ wasn't actually doing anything because without
an __init__.py each of these "packages" was empty. This has been working
by accident because of ai_flight_planner_db.py.
2023-04-26 22:08:56 -07:00
zhexu14
f86709ebd0 Prevent decoy flights from overflying the target.
Force decoy flights to the next waypoints 120 seconds after the IP.
The duration is just an approximation, but it seems to work.

See discussion in https://github.com/dcs-liberation/dcs_liberation/pull/2810
for more details.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2781.
2023-04-26 19:30:34 -07:00
Dan Albert
7266de42f5 Format aircraft yamls. 2023-04-26 19:12:13 -07:00
Dan Albert
47831d43b5 Remember mod choices in the NGW. 2023-04-26 00:36:34 -07:00
Dan Albert
cf47dd82d7 Remember player preferences for plugins. 2023-04-26 00:24:46 -07:00
Dan Albert
081c97583b Add a plugins page to the NGW. 2023-04-26 00:07:36 -07:00
Dan Albert
77f1706cbb Extract plugins from settings.
There isn't really any need for these two types to interact. The lua
plugin manager effectively fully owned its properties, it just delegated
all reads and writes to the settings object.

Instead, break the plugin settings out into the plugin manager and
preserve the manager in the Game. This will make it possible to expose
plugin options in the NGW without breaking the game on cancel.
2023-04-25 23:28:01 -07:00
Dan Albert
664efa3ace Document Lua plugin APIs.
Trying to fix the singleton-ness in the plugin manager because it
prevents injecting settings until the game is fully committed (new game
wizard completed). Added the docs describing what I think I've been able
to discover.
2023-04-25 21:32:36 -07:00
Pekka Kiviniemi
b6059f692e Create unit tests for pilot class.
DCS Liberation does not have much unit tests. Pilot class is not very
exiting but it was a good place to start.
2023-04-26 03:03:25 +00:00
zhexu14
4bf8f25d31 Add decoy weapon type and configure AI tasks.
See https://github.com/dcs-liberation/dcs_liberation/pull/2810
for more discussion.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2780.
2023-04-25 20:02:30 -07:00
Dan Albert
e2c6d6788c Persist some campaign creation options.
We should also persist mod options, but those will go in a separate file
because they aren't a part of Settings.

Plugins need some work before that can be saved here. They're not
configurable in the NGW currently, so that needs to be fixed first. It
also appears that it may not be safe to inject the settings object with
plugin options until the game is created, but that needs more
investigation (see the comment in Settings.save_player_settings).

Another obvious candidate would be the desired player mission duration,
but we need to implement custom serialization for that first.
2023-04-24 22:49:30 -07:00
Nosajthedevil
1c20bc3966 Add DCS AI C-47 support 2023-04-24 22:49:09 -07:00
zhexu14
c31d76ec83 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-04-22 10:54:42 -07:00
zhexu14
ada8f9f8ee Fix error when resetting air wing configuration.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2751.
2023-04-22 10:51:26 -07:00
zhexu14
1b72598803 Add missing argument when fixing TOTs.
Part of https://github.com/dcs-liberation/dcs_liberation/issues/2746.
2023-04-22 10:50:20 -07:00
zhexu14
4bc8bf52e7 Also use Tanker task for recovery tankers.
DCS apparently needs both to function.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2771.
2023-04-20 17:59:14 -07:00
zhexu14
0d257a2c3b 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-04-19 06:16:41 +00:00
Nosajthedevil
0ba602d3aa 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-04-18 23:07:29 -07:00
dependabot[bot]
38d18ba767 Bump webpack from 5.69.1 to 5.76.1 in /client
Bumps [webpack](https://github.com/webpack/webpack) from 5.69.1 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.69.1...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 11:36:12 -07:00
Dan Albert
94b8aa7213 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-04-18 11:35:41 -07:00
Dan Albert
1ac36d03da Allow in-line definitions of campaign factions.
A lot of campaigns want to define custom factions. This allows them to
do so without us having to fill the built-in factions list with a bunch
of campaign-specific factions. It also makes custom campaigns more
portable as they don't need to also distribute the custom faction files.
2023-04-17 23:52:25 -07:00
Dan Albert
dca256364a Convert existing factions to YAML. 2023-04-17 22:40:02 -07:00
Dan Albert
652e7d8d7b Allow factions to use YAML.
Comments! No more failures because you accidentally used a trailing
comma!

JSON still supported since it's basically free, but we should probably
remove that in 8 just so the docs can be less confusing for users who
will be confused if only one format is documented (and we definitely
won't maintain duplicate docs).
2023-04-17 22:40:02 -07:00
Dan Albert
42e9a6294b Remove eager loading of factions.
Eager loading meant that users would need to restart Liberation to pick
up changes to faction files. That's annoying for modders, slows down
start up, and uselessly sits in RAM when it's not needed after game
creation.

Also removes the __getitem__ and __iter__ methods in favor of named
methods, since the dunder methods are more or less impenetrable for IDEs
and grep.
2023-04-17 22:40:02 -07:00
Dan Albert
f3d2952579 Fix typo in Germany 1944.
Oops.
2023-04-17 19:31:03 -07:00
Dan Albert
ee1d4cd3e4 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-04-17 18:10:25 -07:00
Dan Albert
4e067eaaa8 Remove GroundPlanners from the save state.
These are only used during mission generation. Remove them from the save
state to reduce compatibility requirements. We also have at least one
report of this data being corrupted... somehow. I don't know how that
could have happened, but if there's no data to corrupt in the first
place that's not a problem. If the corruption _does_ recur, it'll be
much easier to repro if it corrupts during mission generation rather
than during turn initialization.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2729.
2023-04-15 14:27:20 -07:00
dependabot[bot]
4a0975b21b Update Starlette and FastAPI. 2023-04-15 13:50:34 -07:00
Dan Albert
dd9ad2f0be Update pydcs for the plane helipad spawning fix.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2782.
2023-04-15 13:47:24 -07:00
Dan Albert
d1fe267072 Fix unit details screen for Qt6.
The `setMargin` shorthand was apparently to simple, so Qt6 removed it in
favor of `setContentMargins`, which does the same thing?

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2784.
2023-04-15 13:41:09 -07:00
Dan Albert
28ba100864 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-04-15 13:27:08 -07:00
Dan Albert
99ea06c0d5 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-04-15 13:27:08 -07:00
Dan Albert
fa070b2126 Improve logging in defaultsquadronassigner.py.
https://github.com/dcs-liberation/dcs_liberation/issues/2786
2023-04-15 13:27:08 -07:00
Dan Albert
5405632434 Improve comments in defaultsquadronassigner.py. 2023-04-15 12:33:52 -07:00
Dan Albert
ca2cec5d7d Organize imports in defaultsquadronassigner.py. 2023-04-15 12:33:52 -07:00
Starfire13
8150176fc6 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-04-09 19:18:06 -07:00
Dan Albert
5c72e0754a Fix iteration error when splitting transfers.
If one type of unit is zeroed but there are still other units to check
in the dict, the dict will have changed size during iteration. Iterate
on a copy of the dict instead.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2773.
2023-03-31 16:09:33 -07:00
Dan Albert
af2e195f90 Update pydcs to fix Falklands airport data.
The Falklands data in pydcs was missing an (unfinished, unusable)
airport, and that was breaking miz loading of campaigns that were edited
or created with a version of DCS to include these airports which have
incomplete data.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2732.
2023-03-30 17:26:05 -07:00
Nosajthedevil
8523c11357 Support for the updated F-4B/C mod (#2769)
Updated the F4.py pydcs extension to match the updated F-4B/C mod and
reworked the standard payloads to add "clean" to new F-4B pylons 11 and
12.

This includes a workaround to allow Liberation to use the new VSN F-4B
weapons with combined 2x Aim-9js on pylons 3 and 9 underslung with bombs
on ters on new pylons 11 and 12. In mission editor the combined weapons
are selected in pylons 3 and 9 and their under-slung counterparts are
forced onto 11 and 12 using "required" arguments in the mod's lua. All
other pylon 3 and 9 weapons use "required clean" arguments. Liberation
doesn't have a way to force these linkages onto pylons 11 and 12 and
without them, even without clean, no weapons will load on 3 and 9 or 11
and 12.

The workaround for normal weapons on the F-4B is to set the standard
load-outs to "clean" on pylons 11 and 12. This allows all normal weapons
to work on pylons 3 and 9 so long as pylons 11 and 12 are left as Clean.
It also allows Clean into the Liberation dropdown so it can be selected
later if necessary.

The workaround for the 4 new weapons that combines pylons 3 with 11 and
9 with 12 is that the user has to use the matching pair on each set of
pylons. For example - if F4B_LAU105_AIM9J_2_BRU42A_MK82_3 is selected
for pylon 3, BRU 42A MK823 LAU105 AIM9J2 must be selected for pylon 11.
Failure to do this correctly doesn't crash liberation or DCS, the result
will just be either no weapons at all on either pylon or the underslung
weapons on 11 and 12 floating without a pylon attaching it to the plane.

When updating f4.py in the future, note that running the pydcs database
export doesn't pull any data for Pylons 11 and 12. Those matching
weapons / classes have to be manually defined in those pylons for the
F-4B. This is noted in f4.py.
2023-03-24 18:41:03 -07:00
Dan Albert
b860d72c2d Prevent transfer splitting from leaving empty units.
If the transport were able to move exactly the quantity of units of the
given type remaining in the transfer without moving the whole order, the
transfer order would be left with instructions to transfer zero of that
unit. That's an invariant violation, and was resulting in _later_
transfers attempting to create a convoy with zero units, which pydcs
rightly rejects.

For example: if 2 Abrams and 2 Paladins are ordered to transfer from a
disconnected FOB to a distant location that is connected by road, and
only two cargo slots are available, that transfer could be split into:

```
{
    Abrams: 2
}
```

and

```
{
    Abrams: 0,
    Paladin: 2
}
```

Depending on the route, those airlifted units might end up still needing
road transit (we prefer short airlifts rather than direct routes because
it gives the player more opportunities to intercept enemy convoys). The
current turn would airlift the Abrams-only group and the Paladin group
would wait. On the next turn the Abrams would travel by road and the
Paladins would be airlifted. On the _third_ turn, the Paladins (and zero
Abrams) would generate an invalid convoy.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2761.
2023-03-18 14:03:41 -07:00
Dan Albert
bcb7d059c0 Tolerate saving when temp is on another FS.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2748.
2023-03-14 16:21:24 -07:00
Dan Albert
bc0dacf974 Fix saving of saves from other machines.
Need to reset the persisted save paths on load, since the file that was
loaded may have been moved since it was saved and the original location
may no longer be accessible.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2756.
2023-03-13 19:41:28 -07:00
Dan Albert
2d9b0177ec Add channel naming for the warthogs.
The manual for the legacy warthog usually calls these VHF 1/2 and UHF,
or VHF AM/FM and UHF. The AM/FM nomenclature is what I usually hear
people call them and it's clearer, so go with that.

For the A-10C II, that manual hasn't been updated for the AN/ARC-210
yet, so I'm not really sure what that ought to be called. The UFC calls
it COM 1 though, so I went with that. The alternative would be something
like VHF/UHF for the 210 and UHF for the 164, but I don't know if that's
actually better. Could be completely explicit and call them by their
full names, but that's probably less clear to people that aren't
fiddling with the radio implementation constantly (and even I confuse
the 164 and the 186 all the damn time).
2023-03-13 18:48:20 -07:00
Dan Albert
2fed84c676 Fix radio data for the A-10Cs.
My earlier tests were not accurate enough. It turns out that yes, DCS
does still do some channel clobbering with these, so fix the radio
selection to account for that.

I also fumbled some copy paste between the A-10Cs so the A-10C II
channel assignment ended up in the wrong section doing nothing...
2023-03-13 18:48:20 -07:00
Dan Albert
a73c06223d Update radio configuration for the A-10s.
The latest DCS update both added support for preset radios (two both
A-10C modules!), and re-ordered the legacy A-10C's radios so we can use
the VHF radio for intra-flight.

After this patch, the legacy A-10C will use VHF for intra-flight, the
new module will use one AN/ARC-210 for intra-flight and the other for
inter-flight comms, and both modules will have preset channels assigned.
2023-03-11 15:30:36 -08:00
Dan Albert
e129c02109 Update pydcs.
Includes the new A-10C radios. Will follow up to make Liberation
actually use them.

This manually removes some weapons from mod files that were removed from
DCS. Those mods may need re-exporting, and may also need updating by
their authors, but for now this should keep them functioning.
2023-03-11 15:30:36 -08:00
Dan Albert
67dae80b76 Rework the speed controls for 1080p friendliness.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2396.
2023-02-19 12:35:21 -08:00
Nosajthedevil
088b69a6ef Russian Weapon Fixes
R-24R weapons file correction to R-3R fallback name - now matches name used in R-3R file.

Remove KH-28 weapons file due to removal from DCS.

Update KH-25MP weapons file to  fallback to KH-29L instead of Kh-28. Kh-28 previously fell back to Kh-29L.
2023-02-11 16:43:12 -08:00
Nosajthedevil
db64f37a95 Update AIM-9Juli.yaml 2023-02-11 16:42:55 -08:00
Nosajthedevil
af6c42f49b Update AIM-9Juli-2X.yaml 2023-02-11 16:42:55 -08:00
Nosajthedevil
4503170075 Added US Weapons Files
Adds US Weapons files with fallbacks in order of capability.

Aim-7P added by ED for several US fighters. Falls back to 7MH, and Aim-120B fallback adjusted from MH to P.

Aim-9J and Aim-9Juli added by ED for the Mirage F-1, also used by F-4 mod and will likely be added to the F-4E whenever it ships. Aim-9J placed between  9P and 9B, Aim-9 Juli placed between 9L and 9P5.

2x9j and 2x9Juli added by VSN for F-4 mod. Placed between 2x versions of same missiles as above.

Aim-7E now falls back to 2xAim9x instead of single Aim9x so that it runs through the entire loop of Aim-9s.
2023-02-11 16:42:55 -08:00
dependabot[bot]
c07f343d0e Bump @sideway/formula from 3.0.0 to 3.0.1 in /client
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-08 20:06:27 -08:00
Dan Albert
725f6c55a5 Enable sim speed controls by default.
https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:51:47 -08:00
Dan Albert
364742a98b Do not allow adding flights after package start.
https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:47:53 -08:00
Dan Albert
7b35a749e2 Prevent past startup when adding new flights.
When a new flight is added to a package, if the TOT is early enough the
new flight might have a startup time in the past. Clamp the TOT when
adding new flights to the package to avoid this.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:47:53 -08:00
Dan Albert
23ac510d26 Don't allow changing TOT for started packages.
https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:33:08 -08:00
Dan Albert
ba10298dbc Allow adjusting TOTs after sim start.
This makes the start time in WaitingForStart dynamic, which is more
expensive but probably still cheap enough.

It also checks that the new TOT will not result in a start time in the
past when the player changes the TOT.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-02-06 00:33:08 -08:00
Dan Albert
c6a8aeac1d Update bug templates for 6.1.1. 2023-02-05 15:18:09 -08:00
Raffson
b41ef0ab13 Fix heli spawn/landing at FOB/FARP
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2719.

(cherry picked from commit 34de855b8f889b72406c101d0cea385988e24bf9)
2023-02-05 14:09:01 -08:00
Dan Albert
c33a0d5deb Don't generate runway data for heliports.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2710.
2023-02-05 13:19:18 -08:00
Nosajthedevil
70b9d4c174 Add VSN F-4 Mod Support
Added VSN F-4 Mod support
2023-02-02 17:15:21 -08:00
dependabot[bot]
1462bedd97 Bump http-cache-semantics from 4.1.0 to 4.1.1 in /client
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 17:08:17 -08:00
Dan Albert
937bacacb7 Pin version of black used in GHA.
Black rolls out style changes every year, and using "stable" means that
the check run on PRs might start formatting differently than we do
locally, or require a reformat of the codebase to make a PR submittable.

Pin to the version that we've been using. We should update to 23 at some
point, but we want to do that deliberately.
2023-02-02 16:35:51 -08:00
Dan Albert
e8824e5d03 Fix line endings. 2023-01-31 18:44:33 -08:00
Dan Albert
e030cfebb8 Update pydcs.
Export from DCS 2.8.2.35632.
2023-01-28 14:03:38 -08:00
Dan Albert
eea98b01f6 Fix invalid tanker planning.
All three refueling missions share a common task type and differentiate
their behavior based on the type and allegiance of the package target.
This means that if the theater commander identifies a carrier as the
best location for a theater refueling task, a recovery tanker will be
planned by mistake.

If this happens on a sunken carrier, mission generation will fail
because a recovery tanker cannot be generated for a sunken carrier.

Fix the crash and the misplanned theater tanker by preventing the
commander from choosing fleet control points as refueling targets.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2693.
2023-01-28 12:57:03 -08:00
Dan Albert
f8c1d291ed Update the versions listed in the bug template. 2023-01-28 11:46:37 -08:00
Dan Albert
0df268f331 Fix unit ID of the KS-19.
It seems like this unit has never worked because of the unit ID
mismatch.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2701.
2023-01-28 11:44:31 -08:00
Dan Albert
be2ad226f4 Export game.persistence.mission_path_for.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2699.
2023-01-27 16:52:45 -08:00
dependabot[bot]
a4df23361e Bump future from 0.18.2 to 0.18.3
Bumps [future](https://github.com/PythonCharmers/python-future) from 0.18.2 to 0.18.3.
- [Release notes](https://github.com/PythonCharmers/python-future/releases)
- [Changelog](https://github.com/PythonCharmers/python-future/blob/master/docs/changelog.rst)
- [Commits](https://github.com/PythonCharmers/python-future/compare/v0.18.2...v0.18.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 17:26:34 -08:00
Dan Albert
0f34946127 Restructure save games into a zipped bundle.
This is the first step toward bundling all assets related to a save game
into a single item. That makes it easier to avoid clobbering "temporary"
assets from other games like the state.json, but also makes it easier
for players to file bug reports, since there's only a single asset to
upload.

This is only the first step because so far it only includes the various
save files: start of turn, end of last turn before results processing,
and "latest" (the game saved explicitly by the player).
2023-01-16 13:59:16 -08:00
MetalStormGhost
575470ae1b Updated Community A-4E-C mod version support to 2.1.0 release. 2023-01-09 23:28:22 -08:00
dependabot[bot]
31c59e7380 Bump json5 from 1.0.1 to 1.0.2 in /client
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-07 21:25:21 -08:00
Dan Albert
4b542b70ae Fix post-results "last turn" save. 2023-01-04 15:15:56 -08:00
Dan Albert
9cb641bddf Allow flights to self-initialize.
This makes it possible to add new packages to a running sim.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-01-04 12:58:36 -08:00
Dan Albert
7a8b3591cd Add locking to some UI actions.
This is by no means complete. The bugs that this solves were already in
6.x, but we'd hidden the speed controls for the sim in that release, and
have always said that anything done after pressing "go" the first time
is undefined behavior. This is the first step on making those mid-sim
actions behave correctly.

UI actions such as creating a new package need to be executed between
ticks of the sim. We can either do this synchronously by blocking the UI
until the tick is done executing, acquiring a lock on the sim, executing
the action, then releasing the lock; or asynchronously by queueing
events and letting the sim execute them when it completes the current
tick (or instantly if the sim is paused).

Anything that comes from the new UI (currently just the map) must be
asynchronous because it goes through the REST API, but for the old UI
it's simpler (and because the lock will only be acquired as quickly as
the user can act, shouldn't slow anything down) to do this
synchronously, since it's difficult to use coroutines in Qt.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-01-04 12:58:36 -08:00
Dan Albert
fd2ba6b2b2 Convert TOTs to datetime.
https://github.com/dcs-liberation/dcs_liberation/issues/1680
2023-01-04 12:58:36 -08:00
Dan Albert
ac6cc39616 Fix AdjustToContents use for Qt6.
This is no longer a property exposed directly on QComboBox.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2684.
2023-01-04 12:30:43 -08:00
Dan Albert
0be9e1985a Upgrade to Python 3.11.
Supposedly much faster. Probably other cool stuff.
2022-12-29 17:47:49 -08:00
Dan Albert
a1af4e563a Python 3.11 compatibility.
https://docs.python.org/3/library/asyncio-task.html#asyncio.wait says:

> Changed in version 3.11: Passing coroutine objects to wait() directly
> is forbidden.
2022-12-29 17:47:49 -08:00
Dan Albert
7167e84a8f Add back asgiref.
uvicorn now needs this for type information. Not sure why this works
with Python 3.10.
2022-12-29 17:47:49 -08:00
Dan Albert
7eeb84de47 Upgrade lots of dependencies.
Cleared the requirements.txt and rebuilt from scratch. The only thing
left un-upgraded is mypy, which I'll deal with separately because it
catches new issues.
2022-12-29 17:09:42 -08:00
Dan Albert
45aabf369b Upgrade Shapely. 2022-12-29 16:48:42 -08:00
Dan Albert
e396a21791 Update pyproj. 2022-12-29 16:47:29 -08:00
Dan Albert
c6635a4885 Update FastAPI and friends. 2022-12-29 16:43:43 -08:00
Dan Albert
306971230b Update to PySide6.
It sounds like PySide2 will not be moving to Python 3.11, so we're stuck
on 3.10 without this. Upgrading to a newer Qt also fixes some high DPI
bugs (the file browser dialog for save/load is no longer tiny on 4k).

https://github.com/pyinstaller/pyinstaller/issues/5414 previously
blocked this, but the bug appears to be fixed now.
2022-12-29 16:26:50 -08:00
Dan Albert
e0c13846a7 Upgrade pyinstaller.
Should include https://github.com/pyinstaller/pyinstaller/issues/5414.
2022-12-29 15:39:50 -08:00
Dan Albert
4aa42e6573 Remove isinstance use in flight support data.
mypy struggles to prove this cast correct when there are two or'd
isinstance checks where both types coincidentally have properties of the
same name (but no defined protocol making that explicit). I'm not really
sure why mypy is happy with this in its current state, but it isn't
after a change I'm making.

All our isinstance use is a bit of an anti-pattern anyway, so extract a
method that exposes the data we care about.

The start/end times for tankers aren't actually used, so this could be
simplified even more, but that data _should_ be used.
2022-12-28 14:02:31 -08:00
Dan Albert
24a04fb8c6 Workaround pycharm debugger issue when used.
Works around
https://youtrack.jetbrains.com/issue/PY-53232/Debugger-doesnt-work-when-pyproj-is-imported
whenever the pycharm debugger is detected.
2022-12-28 14:00:45 -08:00
SnappyComebacks
321de8d4ec Set units on the frontline to Hidden On MFD. (#2669)
All groups (friendly and enemy) that are part of the front line are set
to `Hidden On MFD`. This is a group level filter, and can not be applied
on a per unit basis.
2022-12-28 14:19:33 -07:00
Dan Albert
5db82f733f Revert "Fix for orbit's broken stop condition"
ED fixed the bug.

This reverts commit 73ee2ba4c0.
2022-12-28 12:28:39 -08:00
Dan Albert
d65fbf299c Note that we don't support stable DCS. 2022-12-21 18:06:52 -08:00
Dan Albert
7c2bb3bd85 Remove note about DCS bug.
This was fixed in
https://www.digitalcombatsimulator.com/en/news/changelog/openbeta/2.8.1.34437/

> Fixed: Stop Condition "Time More" is broken.
2022-12-21 13:29:23 -08:00
RndName
f9903f1e19 Only check for ground units in capture trigger zone
requires pydcs update: https://github.com/pydcs/dcs/pull/279
2022-12-21 13:04:09 -08:00
RndName
4a4935f165 Change iads command unit type 2022-12-21 13:04:09 -08:00
RndName
09f92cc5e4 Only add skynet iads command unit when advanced iads is in use 2022-12-21 13:04:09 -08:00
Dan Albert
887e5997c2 Update pydcs.
Includes UnitType parameter of AllOfCoalition in/out zone condition.
2022-12-21 12:56:17 -08:00
Dan Albert
f88a50dd07 Update changelog for Blackshark 3.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2657.
2022-12-21 12:29:45 -08:00
Dan Albert
3f12a5ae3d Add icons and banners for BS3.
https://github.com/dcs-liberation/dcs_liberation/issues/2657
2022-12-21 12:29:45 -08:00
Dan Albert
f2946817bf Add BS3 loadouts.
https://github.com/dcs-liberation/dcs_liberation/issues/2657
2022-12-21 12:29:45 -08:00
Dan Albert
935a9b0631 Add BS3 to factions that have BS2.
https://github.com/dcs-liberation/dcs_liberation/issues/2657
2022-12-21 12:29:45 -08:00
Dan Albert
c0dc411102 Add blackshark 3 yaml.
There are no significant notable changes from Blackshark 2, so this is
the same YAML.

https://github.com/dcs-liberation/dcs_liberation/issues/2657
2022-12-21 12:29:45 -08:00
Dan Albert
55037626a4 Add Blackshark 3 to the mission planning DB.
https://github.com/dcs-liberation/dcs_liberation/issues/2657
2022-12-21 12:29:45 -08:00
Dan Albert
fc3e72bacf Fix type-only import that needs to be real.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2660.
2022-12-21 12:26:41 -08:00
SnappyComebacks
0fd0f0e7c0 Recovery tanker follow up (#2659)
Fix timing issues for RecoveryTankerFlightPlan.

AEWC and Refueling can be planned on LHA.
2022-12-20 21:47:50 -07:00
Dan Albert
22503d4e95 Save the last turn for bug reports.
We often get save games uploaded with bug reports that are already in a
broken state with nothing we can do about it. This saves that turn to
`last_turn.liberation` so users are less likely to have clobbered the
useful data before filing the report.
2022-12-20 13:46:21 -08:00
Dan Albert
de9236e93a Fix the channel's landmap.
Caused by a bad rename when I did the migration. The landmap in 6.0.0
was actually a GIF...

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2612.
2022-12-20 12:59:38 -08:00
Dan Albert
66523301aa Update changelog for pydcs update. 2022-12-20 12:31:22 -08:00
SnappyComebacks
9a81121ac1 Recovery Tanker for carriers. (#2649)
Implement recovery tankers for carriers.

UnitMap gets a little more data to store.  Recovery tankers depend on the unit map.
2022-12-19 21:08:19 -07:00
SnappyComebacks
a245ba80c3 Update F-15E loadouts. 2022-12-14 21:45:49 -07:00
Dan Albert
9a1860fc5e Add new British navy units to the UK faction.
I haven't removed the old US navy stuff from this faction, since all the
new UK ships are frigates, and removing the US stuff would deprive the
faction of cruisers and destroyers, which might break generation (I'm
not familiar enough with the new system to say for sure).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2571.
2022-12-13 00:05:44 -08:00
Dan Albert
f3f5ab70ea Add HMS Invincible as a valid runway. 2022-12-13 00:05:44 -08:00
Dan Albert
6ce7638fdc Fix changelog formatting. 2022-12-12 23:35:37 -08:00
ColonelAkirNakesh
7f916d55e7 Add HMS Invincible. 2022-12-12 23:19:29 -08:00
Dan Albert
43ea019091 Add missing changelog note. 2022-12-12 19:32:29 -08:00
Dan Albert
6025cad716 Fix livery for VF-33 F-14A squadron.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2610.
2022-12-12 19:11:46 -08:00
Dan Albert
9365aea724 Fix encoding issues with the Peru faction.
Not really sure what's going on here, but presumably it's UTF-16 and
UTF-8 fighting.
2022-12-12 18:53:18 -08:00
Dan Albert
28859a8a9c Add changelog notes that were missed in PRs. 2022-12-12 18:52:28 -08:00
DillieKoe
304fd7ea80 Add Peru faction.
A new Peru faction with a mirage squadon
2022-12-12 18:39:21 -08:00
ColonelAkirNakesh
5e345263a7 Override liveries for Russian aircraft in bluefor faction. 2022-12-12 18:21:12 -08:00
dependabot[bot]
445ee25bbf Bump certifi from 2022.6.15 to 2022.12.7
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.6.15 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.06.15...2022.12.07)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 23:21:18 -08:00
Dan Albert
20937815f8 Fix CAS not having landing waypoints.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2611.
2022-12-03 16:30:51 -08:00
RndName
3863b8ef40 Fix manual debrief submit not ending mission 2022-11-30 13:20:31 +01:00
Dan Albert
d91ccaa70f Changelog section for 6.1. 2022-11-27 21:15:22 -08:00
ColonelAkirNakesh
7673ca5481 Add support for Leander class HMS Andromeda.
https://github.com/dcs-liberation/dcs_liberation/issues/2571
2022-11-27 14:22:41 -08:00
ColonelAkirNakesh
774a37a7d2 Add support for Leander class HMS Ariadne.
https://github.com/dcs-liberation/dcs_liberation/issues/2571
2022-11-27 14:11:19 -08:00
ColonelAkirNakesh
905094f63f Add support for Castle Class.
https://github.com/dcs-liberation/dcs_liberation/issues/2571
2022-11-27 14:10:52 -08:00
ColonelAkirNakesh
fd5b7ba49d Add support for Leander class HMS Achilles.
https://github.com/dcs-liberation/dcs_liberation/issues/2571
2022-11-27 14:00:36 -08:00
SnappyComebacks
1b828b95b3 Add F-15E to DEAD_CAPABLE in AI flight planner. 2022-11-26 09:47:08 -07:00
Dan Albert
54546aaefb Expand gitattributes to cover common files.
Specifically adding this so that yaml changes stop being uploaded as
CRLF, but the rest is likely useful too.
2022-11-25 15:36:04 -08:00
Dan Albert
ded5fc8b1d Update bug templates to 6.0.0.
We're not fixing 5.x bugs any more.
2022-11-25 15:26:20 -08:00
Dan Albert
68fc4f6950 Remove incompatible campaigns.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2558.
2022-11-25 15:17:30 -08:00
Starfire13
5d07238ab8 Updates Khopa's Normandy and Channel campaign to 10.0
Note that Operation Dynamo only requires a yaml file update. The .miz file is fine and is not included here.
2022-11-25 15:08:25 -08:00
Dan Albert
5e7e5e2636 Unfilter the custom waypoint targets.
There doesn't appear to be any reason for us to be poking at
implementation details here aside from changing the name from "unit" to
"building" for that case. Just iterate over the known strike targets.

Making this change uncovered some latent type errors.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2564.
2022-11-25 14:14:38 -08:00
Dan Albert
ca5c0055d1 Remove dead code. 2022-11-25 14:14:38 -08:00
Dan Albert
e208df16b2 Add radios for the MB-339A.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2511.
2022-11-25 14:07:56 -08:00
Dan Albert
11632b0ef1 Update RoleplayingPleb's campaigns.
https://github.com/dcs-liberation/dcs_liberation/issues/2558
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2561.
2022-11-25 13:05:20 -08:00
Dan Albert
b0bc46f539 Make the casualty report scrollable.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2567.
2022-11-25 13:00:04 -08:00
SnappyComebacks
627ed45065 Add banner for MB-339A. 2022-11-25 11:58:56 -07:00
RndName
fc9ad5b519 Remove dcs capture event from state json
With the latest change we added capture zones and corresponding trigger rules for all Airfields as well so we do not need to rely on the dcs capture event S_EVENT_BASE_CAPTURED anymore.
2022-11-24 11:14:50 +01:00
RndName
40ddad1d9a Add Airfield to list of capture zone types
This will create capture zones and the trigger rules to check for a base capture. Will fix an issue where the dcs capture event is not fired and therefore the capture not recognized by liberation
2022-11-24 11:14:50 +01:00
RndName
eb997db703 Fix carrier group generation 2022-11-23 12:57:43 +01:00
MetalStormGhost
e53dc5b80b Attempt at fixing Carrier killed in state.json but not being removed from game, issue #2405. GenericCarrierGenerator.generate() will now generate the ship group with an array that only contains alive ship units, just like GroundObjectGenerator.generate() has previously done.
Carrier groups will now also show up as destroyed/damaged on the map when the carrier is sunk.
2022-11-23 12:57:43 +01:00
RndName
ab64655f05 Validate primary and secondary nodes for iads network 2022-11-21 12:13:49 +01:00
RndName
e1b530e4fc Fix IADS network error caused by dead groups
Fixed an error which would occur when dead units which are non static would be added as secondary node during the skynet lua data generation. This should in general not be possible as connection nodes and power sources are currently most of the time static.
2022-11-21 12:13:49 +01:00
SnappyComebacks
4414853e45 Update pydcs.
Added ice halo generation.
2022-11-20 17:27:35 -07:00
Dan Albert
35adcd2c7f Move develop forward to 7.0. 2022-11-20 12:57:42 -08:00
Dan Albert
5ec487a832 Attribution compliance for OSM data.
https://github.com/dcs-liberation/dcs_liberation/issues/2434
2022-11-20 12:44:25 -08:00
Dan Albert
0cc56edc95 Fuzzle's campaign updates.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2425.
2022-11-20 12:09:58 -08:00
Dan Albert
3de8b7e022 Add Gran Polvorin campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2424.
2022-11-20 12:09:58 -08:00
Dan Albert
e5946e59a8 Add Up the Coast campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2223.
2022-11-20 12:09:58 -08:00
Dan Albert
0f48a48a4e MB-339A loadouts.
Courtesy of Starfire.

https://github.com/dcs-liberation/dcs_liberation/issues/2511
2022-11-20 11:44:57 -08:00
Dan Albert
1a255969a7 Fix drop zone display for air assault.
Troops must be dropped inside this zone or they won't attack the target.
The zone needs to be drawn in the map so players don't break the flight
plan by accidentally moving the drop waypoint outside the DZ.

I've move the API for doing this out of `PatrollingFlightPlan` in favor
of a mixin so this is no longer presented as `engagement_distance` by
the flight plan. I don't love that it's still the `commit-boundary`
endpoint, but it's fine for now.

I don't know why mypy wasn't able to catch this. pycharm is also
struggling to understand this class.
2022-11-20 11:39:56 -08:00
Dan Albert
bf4728fded MB-339A icon.
https://github.com/dcs-liberation/dcs_liberation/issues/2511
2022-11-19 21:14:26 -08:00
Dan Albert
d5e91c7168 Add MB-339A to CAS and runway attack roles.
https://github.com/dcs-liberation/dcs_liberation/issues/2511
2022-11-19 19:24:50 -08:00
Dan Albert
2ded922b5d Add MB-339A to factions that used it.
https://github.com/dcs-liberation/dcs_liberation/issues/2511
2022-11-19 19:24:50 -08:00
Dan Albert
193ab0ff63 Add MB-339A unit yaml.
Not adding the MB-339APAN because that's an aerobatic model, which isn't
particularly useful in Liberation, but is potentially confusing to
people that don't know that.

https://github.com/dcs-liberation/dcs_liberation/issues/2511
2022-11-19 19:24:50 -08:00
Dan Albert
9356449f45 Classify technicals as APCs so they get used more.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2482.
2022-11-19 18:49:06 -08:00
Dan Albert
670683b47f Fix typo. 2022-11-19 18:47:46 -08:00
Dan Albert
517212225e Note the start time feature in the changelog.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2400.
2022-11-19 18:42:12 -08:00
Dan Albert
6315beb7cd Changelog 6 cleanup.
Typo fixes, sort, recategorize.
2022-11-19 18:42:12 -08:00
Dan Albert
c1653b7ee1 Update pydcs.
Includes all the new airfields in the South Atlantic.
2022-11-19 16:24:43 -08:00
Dan Albert
8ed0efe241 Hide sim speed controls behind a flag.
Flag is only controlled from the command-line because redoing Qt layout
usually breaks things. Off by default in 6 since this feature is nowhere
near done enough to even be used experimentally (most changes to the ATO
made after the sim begins will break the game).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2535.
2022-11-19 15:55:03 -08:00
Dan Albert
7b50894ca6 Fix adding and removing waypoints in the UI.
This moves more of the logic out of the UI so mypy can actually spot
these mistakes more often.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2495.
2022-11-19 15:39:41 -08:00
Dan Albert
7dfd99a0b0 Add bug link for refuelzonegeometry. 2022-11-19 15:20:08 -08:00
Dan Albert
c78e6dc231 Remove refueling from sweep flights.
The timing for these doesn't work. Sweep RTBs at the same time the
package reaches its TOT. The tanker won't be on station until 1m30s
before the package reaches the refueling point.
2022-11-19 13:23:36 -08:00
Dan Albert
93f3e81cfc Fix layout for TARCAP, Escort, and strike-like.
If there's a refuel point, nav from that, not from the patrol end/split.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1749.
2022-11-19 13:23:36 -08:00
Dan Albert
38f4b27d10 Clarify AirAssault flight plan method name.
`engagement_distance` is used elsewhere to mean commit distance, so this
looked like a bug when I stumbled across it. Rename it to be more
explicit.
2022-11-19 12:44:46 -08:00
SnappyComebacks
541ac6f8dd Tune turbulence values. 2022-11-19 13:17:18 -07:00
SnappyComebacks
774eb48828 Spell turbulence correctly. 2022-11-19 13:17:18 -07:00
SnappyComebacks
1eccedb74d Calculate turbulance.
Turbulance is based off time of day, and day of year.
Each theatre may adjust their turbulance parameters.
2022-11-19 13:17:18 -07:00
SnappyComebacks
bc6f953f76 Limit wind speed to 97 knots.
Made minor adjustments to wind speed calculation.
2022-11-18 11:48:13 -07:00
SnappyComebacks
261f939896 Note increased wind speeds in the changelog. 2022-11-18 11:48:13 -07:00
SnappyComebacks
c5f0f1ef9f Modify the range of values used to choose a wind speed.
Wind speed at high elevation IRL can range from 20 to 160 knots around the globe.
You may see wind speed generated here up to 100+ knots, but generally around 40 or so.
IRL wind speed appears to depend on the latitude of the sun, not in this implementation.
2022-11-18 11:48:13 -07:00
dependabot[bot]
dc843a811e Bump pillow from 9.2.0 to 9.3.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.2.0 to 9.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.2.0...9.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 18:08:22 -08:00
dependabot[bot]
c8ada1ac46 Bump loader-utils from 1.4.1 to 1.4.2 in /client
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 17:48:50 -08:00
RndName
d82ac8f355 Fix IADS Network update for basic mode
the iads update_network method would recreate a basic iads network as advanced network by range. This small change now checks for advanced mode before calculating connetions.
2022-11-14 17:53:24 +01:00
RndName
7ab8683d72 Add docs and better logging to iads network 2022-11-14 16:58:44 +01:00
RndName
d0d56aceb6 Rewrite IADS tgo update method for correct updating
These Events are covered
- Mission Debriefing
- Capture Event
- GroundObject Buy Menu
2022-11-14 16:58:44 +01:00
RndName
c33ba2c5af Fix IADS by range calculation 2022-11-14 16:58:44 +01:00
RndName
72e67d7b71 Implement iads_network update 2022-11-14 16:58:44 +01:00
Dan Albert
8dabac916b Update pydcs. 2022-11-12 14:44:42 -08:00
MetalStormGhost
56da2dfd4c Fix Bronco loadout name.
Changed the "name" of the OV-10A Bronco loadout file from "A-4E-C" to "Bronco-OV-10A".
2022-11-12 13:45:18 -08:00
RndName
624ca3c308 Clarify cargo waypoints for AirLift and AirAssault 2022-11-11 14:46:08 +01:00
RndName
123db516ad Remove unneeded LandRefuel from Airlift 2022-11-11 14:46:08 +01:00
RndName
4531fc7f37 Remove AirAssault completly from AutoPlanner
see #2506 for mor details
2022-11-11 14:46:08 +01:00
RndName
ea6662c38b Add simulation halt at AirAssault ingress
implements #2452
2022-11-11 14:46:08 +01:00
RndName
9139f84c33 Add Ingress Point to AirAssault FlightPlan 2022-11-11 14:46:08 +01:00
RndName
9e625b0e5e Remove CTLD logic from Airlift flightplan for AI 2022-11-11 14:46:08 +01:00
Dan Albert
336df10da2 Remove unnecessary refuel waypoint in airlifts. 2022-11-11 14:46:08 +01:00
Dan Albert
79e241730b Document some airlift waypoint behavior. 2022-11-11 14:46:08 +01:00
Dan Albert
251d329a71 Add error handling for cargo drop waypoints. 2022-11-11 14:46:08 +01:00
Dan Albert
8b384f184c Add docs explaining what the assault area is. 2022-11-11 14:46:08 +01:00
Dan Albert
d81ba04ba5 Make air assault drop-off non-optional.
There is always a drop-off location for troops.
2022-11-11 14:46:08 +01:00
Dan Albert
8f9270e9fe Forbid planes from air assault.
This doesn't work.
2022-11-11 14:46:08 +01:00
RndName
b4b9bbf476 Cleanup and refine airlift and airassault waypoints
- Drop Off and Pickup now correctly worded
- Helo waypoints now represent LandingZones for pickup and dropoff
2022-11-11 14:46:08 +01:00
RndName
a47cb865fb Cleanup and reword refuel waypoints
- rename Stopover back to CargoStop
- precise some waypoint naming
2022-11-11 14:46:08 +01:00
Nosajthedevil
4f9719abc4 Add OV-10A Bronco Mod
Adding the OV-10A Bronco Mod to develop.
2022-11-10 23:04:03 -08:00
dependabot[bot]
9785cf9fe6 Bump minimatch and recursive-readdir in /client
Bumps [minimatch](https://github.com/isaacs/minimatch) and [recursive-readdir](https://github.com/jergason/recursive-readdir). These dependencies needed to be updated together.

Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `recursive-readdir` from 2.2.2 to 2.2.3
- [Release notes](https://github.com/jergason/recursive-readdir/releases)
- [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 23:01:50 -08:00
RndName
91100a75db Update Skynet plugin to 3.0.1 2022-11-10 22:49:42 -08:00
dependabot[bot]
fdac9e99e1 Bump loader-utils from 1.4.0 to 1.4.1 in /client
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 22:43:17 -08:00
Nosajthedevil
3204466295 Reworked JSOW fallbacks
JSOW fallbacks now work their way through large warhead IR Mavs
2022-11-04 21:04:32 -07:00
Nosajthedevil
aac68436d9 Weapons data corrections
Remove weapon Type "ARM" to fix error in 5.2.1 and add AIM-54C-MK60
2022-11-04 21:04:32 -07:00
Nosajthedevil
085bf65d45 Corrected new line errors 2022-11-04 21:04:32 -07:00
Nosajthedevil
3e1312b53a Update AIM-9B-2X.yaml 2022-11-04 21:04:32 -07:00
Nosajthedevil
60ab332235 Updated US and russian standoff weapon data
Adds a number of standoff weapons data files and fall backs, including for the B-52 and B-1. Generally used the logic long range guided weapons>big warhead mavs > smallwarheadmavs > walleye > fallback to LGB then dumb bombs. followed similarish logic with Russian weapons. Used selerate paths for laser mavs. Also corrected error with S-24B in rockets. There is probably a lot of room for improvement here.
2022-11-04 21:04:32 -07:00
Nosajthedevil
16c1fd83bc Updated US and russian rocket weapons data
Added russian fallback rockets. Changed the AGR-20s to fallback to the AGM-65E2/L.
2022-11-04 21:04:32 -07:00
Nosajthedevil
455854f91d Added US and russia Bomb Weapon Data
Added US and Russian guided and dumb bomb weapons fallback data. Dumb bombs expanded to include fallbacks for B-1 and B-52.
2022-11-04 21:04:32 -07:00
Nosajthedevil
62f7a9f112 Updated US Aim-9 Weapons Info
Add Aim-9B's as fallbacks for F-4s and A-4s. Rework path by capability and not year (i.e. Aim-9X>M>L>P5>P>B), leave note in P that the year can be pushed back to represent earlier models the P is based on that are missing from game.
2022-11-04 21:04:32 -07:00
MetalStormGhost
a1f2685629 Correct Polish faction Leopard 2 variants.
The old "Leopard 2" maps to the Leopard 2A6 variant whereas The Polish
Land Forces operate Leopard 2A4s and Leopard 2A5s.
2022-11-04 17:07:32 -07:00
Starfire13
3f2ec65c2c Starfire's campaign updates for 10.5. 2022-11-04 17:06:31 -07:00
Dan Albert
73b7be0606 Note hold point fix in the changelog.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2494.
2022-10-31 11:28:06 -07:00
Raffson
73ee2ba4c0 Fix for orbit's broken stop condition
(cherry picked from commit 7e7c920816d384001ac1dbf1bcbcf8ccaad4a093)
2022-10-31 11:28:06 -07:00
Dan Albert
3d4d9af3f4 Add broken loiter bug to major DCS bug list. 2022-10-30 15:07:55 -07:00
Dan Albert
41fb28ae80 Update campaigns known to use quad zones.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2377.
2022-10-29 03:30:45 -07:00
Dan Albert
5c18af4638 Support quad zones for scenery objectives.
This works by recreating the trigger zone in the generated mission to
exactly (aside from the ID, and a possibly escaped name) match the one
from the campaign definition.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2473.
2022-10-29 03:30:45 -07:00
Dan Albert
66a5878fc6 Refactor scenery group creation.
Breaking up some large methods and shifting error handling to places
where it can catch more mistakes.
2022-10-29 03:30:45 -07:00
Dan Albert
5b93149c7b Obsolete and remove SceneryGroup.position.
Rework the preset location finder so this property isn't required. We
still need _some_ location, but it's fine for that location to be
approximate so the centroid works; the new name is just much more clear
about what we can assume about it.
2022-10-29 03:30:45 -07:00
Dan Albert
83c084e476 Rename some scenery group variables for clarity.
These were perfectly obvious to me when I reviewed them, but not so much
months later when I need to make changes :)
2022-10-29 03:30:45 -07:00
Raffson
60b92a5577 Update mods after pydcs update
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2376.

(cherry picked from commit 9fbc2d2c58bdf1707e19815cfda4af2970b224f7)
2022-10-20 17:58:40 -07:00
Paul Dockar
202dbb6259 Fix barely visible text in the Intel box 2022-10-16 22:46:10 -07:00
Paul Dockar
75b19a5f06 update changelog 2022-10-16 22:46:10 -07:00
Paul Dockar
ab6eebab43 Adding conditions vanilla theme icons
Update uiconstants.py to include theme icon path for all weather conditions.
Moving DCS theme icons.
Created Vanilla theme icons
Fixes #1062
2022-10-16 22:46:10 -07:00
Dan Albert
b482dbb031 Stop using shapely's almost_equals.
The docs say it was deprecated in favor of equals_exact with an explicit
tolerance.
2022-10-15 17:26:27 -07:00
Dan Albert
59af080bfb Update pydcs.
Includes a new data export with a fix for the Apache property bug.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2470.
2022-10-15 15:46:22 -07:00
Dan Albert
db7cd17c10 Send the new turn event from turn initialization.
We'll have to get smarter about this some day (since turn initialization
won't always exist), but for now we can avoid stale UI data by doing
what we've always done and refreshing the world on turn init.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2397.
2022-10-15 14:47:55 -07:00
Dan Albert
2f0a7e4f12 Add a toolbar button for filing a bug. 2022-10-15 14:17:33 -07:00
Dan Albert
b63ecc59fb Add a dialog with bug report information. 2022-10-15 13:15:40 -07:00
Dan Albert
575cbf659c Add the git SHA to the build ID.
The build number is actually a pain to use. The git SHA is much more
useful.
2022-10-15 13:15:40 -07:00
Dan Albert
b50219ba0b Faction update for insurgents (hard).
https://github.com/dcs-liberation/dcs_liberation/issues/2482
2022-10-15 01:53:43 -07:00
Dan Albert
e4d76b3b13 Updated insurgent faction.
https://github.com/dcs-liberation/dcs_liberation/issues/2482
2022-10-13 22:27:54 -07:00
Dan Albert
99d9a2e4b9 Campaign update: The Valley of Rotary.
https://github.com/dcs-liberation/dcs_liberation/issues/2481
2022-10-13 22:27:54 -07:00
Dan Albert
04a6782b48 Campaign update: Tblisi Gap.
https://github.com/dcs-liberation/dcs_liberation/issues/2481
2022-10-13 22:27:54 -07:00
Dan Albert
cb3257e704 New campaign: The Falcon Went Over the Mountain.
https://github.com/dcs-liberation/dcs_liberation/issues/2481
2022-10-13 22:27:54 -07:00
Dan Albert
daf11c01c9 Add a comment explaining a wtf in alt estimation. 2022-10-09 23:07:39 -07:00
Dan Albert
207d56c2e9 Fix offshore targets for WW2 factions.
This makes the oil platform a required building so that all factions can
use it. Alternatively, we could pick a different offshore target for WW2
factions, or gracefully degrade to not generating these targets for WW2
factions. This approach seems to best match the designer's intent.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2322.
2022-10-09 19:06:29 -07:00
Dan Albert
3629fa1b36 Make Mozdok to Maykop editable without WW2 assets.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2391.
2022-10-09 18:47:15 -07:00
Dan Albert
21f8550fc7 Changelog updates. 2022-10-09 18:43:13 -07:00
Dan Albert
9bd0be20a6 Don't allow helicopters at non-FARP FOBs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2378.
2022-10-09 17:46:11 -07:00
Dan Albert
d6b1c1409d Add additional weapon data.
Partial submission of the data in
https://github.com/dcs-liberation/dcs_liberation/issues/2348. I haven't
changed anything that conflicted with
https://github.com/dcs-liberation/dcs_liberation/pull/1858.
2022-10-09 17:31:48 -07:00
Dan Albert
eee0039add Key the PrimaryMarker with destination presence.
This is how React recommend dealing with derived state that needs to be
reset:
https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html

The problem is that the new turn will give the component new props, but
new props will not cause the state to be reset. We can either do that
manually (which React recommends only for the cases where it is
absolutely necessary:
https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops),
or by forcing the component to be replaced by using a key.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2388.
2022-10-09 16:25:35 -07:00
Dan Albert
c9d49f6f40 Split up the ControlPoint.tsx monolith.
This is in need of some serious refactoring so that
https://github.com/dcs-liberation/dcs_liberation/issues/2388 can be
fixed.
2022-10-09 16:25:35 -07:00
Dan Albert
0f5e35a2eb Factor out control point location event behavior. 2022-10-09 16:25:35 -07:00
Dan Albert
979851aac9 Document primary/secondary CP marker behavior. 2022-10-09 16:25:35 -07:00
Dan Albert
3a2eb182f9 Fix the react app initialization.
ReactDOM.render is deprecated and using it forces react 17 behavior.
2022-10-09 16:25:35 -07:00
Dan Albert
2338c26392 Fix errors in log with 204 response endpoints.
FastAPI uses JsonResponse by default, which will convert the empty
response None to null. We need to forcibly use Response instead to
prevent that for No Content responses.

This didn't cause any observable issues but was polluting the log.
2022-10-07 14:42:03 -07:00
Dan Albert
c835cda5b6 Update NPM dependencies.
New versions of react and leaflet, along with a lot of other packages.
I'm hoping that the newest react-leaflet might let use solve the carrier
drag and drop issues in a less hacky way, since that's the cause of
https://github.com/dcs-liberation/dcs_liberation/issues/2388.
2022-10-07 13:33:53 -07:00
Dan Albert
6295f3fd71 Fix the react test.
It's still a useless test, but now it passes.
2022-10-07 13:33:53 -07:00
Dan Albert
84d0a40547 Ignore vscode tasks file in client. 2022-10-07 13:33:53 -07:00
Dan Albert
36ef1479a6 Update caniuse-lite.
Complains when tests are run.
2022-10-07 13:33:53 -07:00
Dan Albert
67dcc6e7f5 Double the front line thickness.
Make it easier to click on.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2437.
2022-09-28 11:03:50 -07:00
Dan Albert
edd162c3d2 Add missing type annotation.
Caught by newer versions of typescript.
2022-09-27 22:07:58 -07:00
Dan Albert
982656bd5a Update pydcs.
Includes the AIM-54C Mk 60.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2436.
2022-09-27 20:54:02 -07:00
Dan Albert
469d8b7b12 Ignore loadouts with invalid weapons.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2320.
2022-09-27 20:23:32 -07:00
Dan Albert
f1562a7b94 Add a hint about how to transfer squadrons.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1911.
2022-09-27 19:54:07 -07:00
Dan Albert
1e12f1cc80 Revert "Add support for the AI-only F-14A."
AI behavior with the Heatblur F-14 has been fixed, so not needed any
more.

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

This reverts commit 7387c2ed8f.
2022-09-27 19:43:02 -07:00
Dan Albert
123d8fcaa6 Add Falklands weather data.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2242.
2022-09-27 19:32:15 -07:00
Dan Albert
4b4738c58f Load map icons directly from DCS.
If the user's DCS directory is not configured correctly this will
degrade by not showing an icon. Otherwise (and typically) we get nicer
looking icons for each theater, and we don't have to make these for each
new map.
2022-09-27 19:26:05 -07:00
Dan Albert
037ff85396 Remove unused data.
We get TACAN, ILS, and ATC data from pydcs now. The rest of this
manually curated data is unused.
2022-09-27 18:34:23 -07:00
Dan Albert
e0160ac876 Get TACAN and ILS data from pydcs. 2022-09-27 18:34:23 -07:00
Dan Albert
08abe36443 Fix TACAN beacon type import.
The dataclass contructor will not automatically convert the int in the
JSON file to the enum type, so our enum equivalence check was not
actually working, and could result in us re-allocating a TACAN channel
that was used by the map.

Fixing this problem surfaces a latent bug, where we can't actually treat
duplicate map TACAN channels as a bug because some channels are used by
multiple airports in PG.
2022-09-27 18:24:49 -07:00
Dan Albert
2461a66ad8 Number beacon types explicitly.
auto() starts at 1 for IntEnum, so this has always been wrong.
2022-09-27 18:24:49 -07:00
Dan Albert
9ab3430cc4 Move beacons module.
This isn't related to the missiongenerator, and importing this file from
some places (such as runway data) will cause a circular reference when
importing the rest of the missiongenerator package.
2022-09-27 18:24:49 -07:00
Dan Albert
a9348154af Alter the beacon format to be keyed by ID.
ID based lookup will be used for finding ILS and TACAN beacons from the
pydcs data.
2022-09-27 18:24:49 -07:00
Dan Albert
5621b4cbd4 Fix broken error message in beacon importer. 2022-09-27 18:24:49 -07:00
Dan Albert
028576f208 Update pydcs.
This update includes expanded runway data that lets us clean up some
code. It also include beacon IDs for runways and airfields that will let
us get ILS and TACAN info from pydcs, but that's a bigger change that
I'll land separately.
2022-09-27 17:57:31 -07:00
MetalStormGhost
746bada0d4 Add fidelity for SIDC status of TGOs.
The new behavior is as follows for SAMs:

No damaged units: fully capable (green)
Damaged but still operational: present (no bar)
Not fully destroyed but inoperable: damaged (yellow)
Fully destroyed: destroyed (red)

And for all other TGOs:

Fully destroyed: destroyed (red)
Any missing units: damaged (yellow)
No missing units: present (no bar)

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2438.
2022-09-20 22:34:48 -07:00
Dan Albert
c89327586d Speed up computation of front line positions.
Needs to be properly measured, but this has made a multi-second speedup
in turn times.
2022-09-18 02:31:57 -07:00
Dan Albert
bbfe1657d6 Remove error handling for impossible case. 2022-09-18 02:31:57 -07:00
Dan Albert
c39a094d88 Remove unused behavior from frontline positioning. 2022-09-18 02:31:57 -07:00
Dan Albert
13f0dd8b01 Make FrontLineBounds actually a bounds container. 2022-09-18 02:31:57 -07:00
Dan Albert
ba7b3aa473 Clean up one frontline bounds user. 2022-09-18 02:31:57 -07:00
Dan Albert
08d4fe92d1 Remove junk from FrontLineConflictDescription. 2022-09-11 14:45:12 -07:00
Dan Albert
09786c6d29 Split air and ground conflict descriptions. 2022-09-11 14:37:28 -07:00
Dan Albert
1150750c09 Re-disable sending landmap data for Falklands.
Still too slow.
2022-09-11 14:24:01 -07:00
Dan Albert
b9b1f51957 Rename frontline vector to bounds, add a class.
This isn't actually the data that callers usually want. Most of the
callers just want the bounds. The heading and length are trivially
computed from that. Add a class to contain the result so it's easier to
refactor.
2022-09-11 14:23:31 -07:00
Dan Albert
e53a487948 Rename confusing front line methods/members. 2022-09-11 14:23:31 -07:00
Dan Albert
cd19f2ab21 Use simplified Falklands exclusion zones.
This is significantly faster on my machine. Checking it in (and
re-enabling the UI layer) to see how it affects slower machines.
2022-09-11 11:59:30 -07:00
Dan Albert
124e2d5e10 Avoid sending landmap data for Falklands.
This is too damn slow. A possible solution is explained in the comment,
but we shouldn't tackle that until we're sure the rest of the game runs
okay.
2022-09-10 16:31:47 -07:00
Dan Albert
bb2ceb9968 Log planning times per-task. 2022-09-10 16:31:47 -07:00
Dan Albert
ddd203a79f Add additional information to multi-event tracing.
Show the number of times the event was logged as well as an average run-
time.
2022-09-10 16:31:47 -07:00
Dan Albert
017a673211 Bump the campaign version for the Falklands.
Support isn't done yet, but the things that would affect campaign design
are done.

https://github.com/dcs-liberation/dcs_liberation/issues/2242
2022-09-09 15:41:20 -07:00
Dan Albert
b011870c03 Set the Falklands timezone.
https://github.com/dcs-liberation/dcs_liberation/issues/2242
2022-09-09 15:30:49 -07:00
Dan Albert
db4672f4af Fix mistake in join point placement.
This looks like it was just a typo. We want to join as late as possible
to allow flights coming from other airfields to take the best route to
the target that is safe, rather than joining as early as possible, which
isn't useful since pre-join and post-split are supposed to be safe areas
anyway.
2022-09-09 15:12:19 -07:00
Dan Albert
cc5c625a99 Fix rendering of join permissible zones.
The zones themselves are supposed to be unstroked because we only want
to stroke the boundaries of the zone that are preferred.
2022-09-09 15:12:19 -07:00
Dan Albert
8480dadba8 Add a Falklands landmap, imported from GIS.
https://github.com/dcs-liberation/dcs_liberation/issues/2242
2022-09-09 15:05:50 -07:00
Dan Albert
fd88a6a22f Add Falklands terrain shapefiles. 2022-09-09 15:05:50 -07:00
Dan Albert
7a230c90f0 Add a GIS shapefile to landmap importer. 2022-09-09 15:05:50 -07:00
Dan Albert
f15c2ada1b Fix DaytimeMap error with disabled night missions.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2429
2022-09-09 13:01:10 -07:00
Dan Albert
fa7dbc587a Use ATC radio info from pydcs. 2022-09-08 20:26:25 -07:00
Dan Albert
5e40042ace Update pydcs.
This update adds ATC information to the exported data.
2022-09-08 20:26:25 -07:00
Dan Albert
df85d2627d Add a data linter with Markdown output.
Wildly incomplete, but it's a start.
2022-09-08 15:47:56 -07:00
Dan Albert
229008577b Load airfield data when called for airport.
The for_theater method is always called before for_airport is during
normal gameplay, but I'm writing a linter to show missing airfield data
that calls for_airport first.
2022-09-08 15:47:56 -07:00
Dan Albert
a679c19af1 Be tolerant of theaters with no airfield data.
This shouldn't be the case for anything shipped, but is typical when new
theaters are still being developed.

We could potentially add an `in_progress` flag to the theater definition
to make this only optionally tolerant, but since that code path would
rarely be exercised it's just likely to bitrot. This data isn't critical
to mission generation anyway, so this is fine. What we should do is add
some linters that document all the data that is missing though (and
ideally publish that to our docs).
2022-09-08 13:21:26 -07:00
Dan Albert
8b1cd5965a Update beacon data. 2022-09-07 17:17:03 -07:00
Dan Albert
1881fecc83 Clean up ConflictTheater constructor.
Now that all theaters are defined in YAML, we can lose some of the mess
in this class.
2022-09-07 16:52:48 -07:00
Dan Albert
d133809bc0 Note theater moddability in the changelog. 2022-09-07 16:52:48 -07:00
Dan Albert
49001bb558 Migrate Falklands to YAML.
All theaters are now moddable.
2022-09-07 16:52:48 -07:00
Dan Albert
18f1048dc4 Migrate The Channel to YAML. 2022-09-07 16:52:48 -07:00
Dan Albert
0afc4d2af6 Migrate Normandy to YAML. 2022-09-07 16:52:48 -07:00
Dan Albert
0e62e50b1c Migrate Nevada to YAML. 2022-09-07 16:52:48 -07:00
Dan Albert
07960bd65a Migrate Marianas to YAML. 2022-09-07 16:52:48 -07:00
Dan Albert
647529f35f Migrate Syria to yaml. 2022-09-07 16:52:48 -07:00
Dan Albert
90e9e3ecd6 Port Persian Gulf to yaml. 2022-09-07 16:52:48 -07:00
Dan Albert
87f88f4c50 Make theater properties moddable.
Only the Caucasus has been migrated so far. Will follow up with the
others, and also will be adding beacon/airport data to this.
2022-09-07 16:06:20 -07:00
Dan Albert
49fd9c0c36 Add Grabthar's Hammer Falklands campaign. 2022-09-07 14:39:47 -07:00
Dan Albert
7e4f81d541 Add a Falklands theater.
Not at all done yet, but loads.

https://github.com/dcs-liberation/dcs_liberation/issues/2242
2022-09-07 14:39:47 -07:00
Dan Albert
eb3d2ef049 Ignore user vscode settings in the client. 2022-09-07 14:24:13 -07:00
Dan Albert
080782e011 Support polygons with holes in the API.
We don't have any of these yet because our landmaps suck, but we'll need
holes in the sea zones to mask islands correctly.
2022-09-07 14:22:26 -07:00
Dan Albert
10d0dd861c Update pydcs.
Newest Falklands updates.
2022-09-07 10:34:29 -07:00
Adam Clemons
693afb7949 Use the Missions directory for state fall back.
Useful for servers that do not allow access to other paths.
2022-09-04 16:42:54 -07:00
Nosajthedevil
d16f6692b8 Additional weapons fallback data.
Added weapons fallback data for the laser guided rockets, AIM-54's,
AGM-65 E/F, 4X Hellfire and TOW carried by US helis, rockets for them
to fall back to, all of the USSR IR missiles, R-3R, Mk-83 & Mk-84 and
adjusted the dates for the R-27ER &ET to 1990.
2022-09-03 21:26:40 +00:00
Dan Albert
a74add96b7 Make generate_landmap importable.
This file may not be needed long term, but for now I want to import
to_multipoly for some other work.
2022-09-03 14:13:53 -07:00
Dan Albert
643d1be6d7 Fix inclusion/exclusion zone reversal in UI. 2022-09-03 14:13:07 -07:00
Dan Albert
1717bc98cb Move logging_config to game.
This isn't unique to the UI, the UI is just the current caller.
2022-09-03 14:12:21 -07:00
Dan Albert
0c5e548892 Move FlightPlan ownership from Flight to IBuilder.
The next step in splitting up the layout and scheduling phases. This
facilitates splitting flights into two classes where one has a full
flight plan, but one used in the earlier phases of planning has only a
layout. Layout-only flights won't need TOTs, which will make them much
easier to work with once we've migrated TOTs from timedeltas to
datetimes.

Layout-only flights of course aren't actually usable, but it lets us
avoid dealing with the current sim time until we're certain the Flight
will even survive planning.

I'm not actually sure if we'll be able to split the two phases any more,
but this ends up being a nice cleanup anyway.
2022-09-03 02:39:38 -07:00
Dan Albert
f4ecfe6da9 Un-dataclass Package.
This hasn't been very dataclass-like for a long time.
2022-09-02 23:13:58 -07:00
Dan Albert
71f68b3103 Simplify flight startup time calls.
We can always estimate a startup time now. Remove the nullability from
the result, cleanup the callsites, and eliminate
TotEstimator.mission_start_time since it no longer does anything useful.
2022-09-02 23:09:05 -07:00
Dan Albert
d8486568b7 Remove unused property from Flight. 2022-09-02 21:13:23 -07:00
Dan Albert
24a6c5995b Fix crash when deleting waypoints.
self.coalition is used but was never set.
2022-09-02 21:13:23 -07:00
Dan Albert
452848fd2a Make TOT waypoints non-optional for flight plans.
Flights without a meaningful TOT make the code around startup time (and
other scheduling behaviors) unnecessarily complicated because they have
to handle unpredictable flight plans. We can simplify this by requiring
that all flight plans have a waypoint associated with their TOT. For
custom flight plans, we can just fall back to the takeoff waypoint. For
RTB flight plans (which are only synthetic flight plans injected for
aborted flights), we can use the abort point.

This also means that all flight plans now have, at the very least, a
departure waypoint. Deleting this waypoint is invalid even for custom
flights, so that's no a problem.
2022-09-02 21:13:23 -07:00
Dan Albert
4f1e3da70a Remove splash screen delay.
This has been in for a long time, so people will have seen the message
by now (and it's on our GitHub page).
2022-09-02 19:56:29 -07:00
Dan Albert
c630226e2d Add campaign property for campaign start time.
This field is optional. Omitting the field (or using only a date instead
of a full timestamp) will use the old behavior of picking a random
daylight hour to start the campaign.

This doesn't include any UI in the new game wizard yet. This is only a
campaign yaml option.

https://github.com/dcs-liberation/dcs_liberation/issues/2400
2022-09-01 01:13:01 -07:00
Dan Albert
82939a446b Turn the daytime map in theater into a real type.
No (intended) user visible effects, but this is the groundwork that will
support https://github.com/dcs-liberation/dcs_liberation/issues/2400.
2022-09-01 01:13:01 -07:00
Dan Albert
f49833646d Don't advance the clock between turn 0 and turn 1.
Turn 0 isn't a real thing, it's just a game play affordance that allows
players to set up their initial conditions.
2022-09-01 00:52:51 -07:00
root0fall
422e335328 Sort vehicles in new game wizard.
Fixes #2402.
2022-08-31 09:47:17 -07:00
Dan Albert
c803a49134 Remove unused Package field. 2022-08-21 22:19:37 -07:00
Dan Albert
236812cc81 Remove superfluous constructors. 2022-08-21 22:19:37 -07:00
Dan Albert
a101527906 Move FlightPlan creation into Flight.
For now this is just a callsite cleanup. Later, this will make it easier
to separate unscheduled and scheduled flights into different classes
without complicating the layout/scheduling.
2022-08-21 19:37:20 -07:00
Dan Albert
7a45391c22 Simplify IBuilder constructor.
We have access to the theater via the flight's departure airbase now.
2022-08-21 19:37:20 -07:00
Dan Albert
4521053804 Move FlightPlan instantiation into the builder.
I'm working on moving the builder to be owned by the Flight, which will
simplify callers that need to create (or recreate) flight plans for a
flight.
2022-08-21 19:37:20 -07:00
Dan Albert
3dd0e4a66f Clean up silly some exception handling. 2022-08-21 19:37:20 -07:00
Dan Albert
9cd511da3d Clean some cruft out of FlightPlanBuilder. 2022-08-21 19:37:20 -07:00
Dan Albert
6bbe583e82 Track theater in ControlPoint.
Simplifies finding the owning theater of a control point. Not used yet.
2022-08-21 19:37:20 -07:00
MetalStormGhost
6519f48149 Correct the name of Ural-375 ZU-23s.
Previously, only the insurgent variant was used because the names were
identical. Also added descriptions to all ZU-23 variants and specified that the
insurgent variants are used with both Insurgent factions.
2022-08-21 19:36:05 -07:00
Dan Albert
d02afdf22e Update pydcs.
Includes the suppression and logging for encoding errors in livery
files.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2368.
2022-08-14 19:15:35 -07:00
Dan Albert
be38969c40 Update contributors list. 2022-08-14 18:36:45 -07:00
Raffson
7c2690ca54 Disable player options for non-flyable aircraft
3 items handled:

- Enable/Disable player checkbox if (not) flyable
- Disable player list in air wing config dialog for non-flyable aircraft
- Update changelog

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

(cherry picked from commit 18057af9ad9212e750b2338add1bc01bf50b868e)
2022-08-14 18:21:03 -07:00
Raffson
36bd628378 Refactor 'grey-out' CSS
The CSS used to grey out the checkbox and label for
advanced IADS should be refactored so it can be reused for
disabling player checkboxes in the flight edit/create dialogs.

The solution is applied to all checkboxes/labels, so that
there's a consistent way of showing users when a
checkbox/label is disabled.

(cherry picked from commit d9c6be0a9d232f73269da720bf7c0f4dfa1b9329)
2022-08-14 18:11:12 -07:00
Raffson
38ff691eac Fix squadron reuse.
This was never marking the original squadron as claimed. Just update the
object rather than cloning it.

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

(cherry picked from commit 6e555167e068a727ed0e104be81615965437de45)
2022-08-14 18:07:56 -07:00
Dan Albert
582fcf8b19 Update pydcs.
Includes terrain export for the Falklands.

https://github.com/dcs-liberation/dcs_liberation/issues/2242
2022-08-10 20:21:35 -07:00
Dan Albert
60f772081c Update pydcs. 2022-08-10 19:17:06 -07:00
root0fall
267da47f6e Fix grammatical typo in main.py 2022-08-07 09:34:09 -07:00
Dan Albert
151cf17e35 Move tests into main workflows.
The workflow UI works best if there's only a single main workflow in a
PR. We can keep things organized similarly by turning the test workflow
into a reusable workflow. Same code (mostly), better UI.
2022-07-27 20:50:49 -07:00
Dan Albert
6437700a61 Fix warning in black job. 2022-07-27 20:50:49 -07:00
Dan Albert
07ac8957c8 Split Python linting into separate jobs.
This is just the first step to prove the concept. Most of the work done
in our workflows can be split into separate jobs to parallelize the
workflow. This will also make the checks page more readable.

This change alone probably won't speed up CI much.
2022-07-27 20:50:49 -07:00
SnappyComebacks
2bd39bd9f5 Changed garrison terminology to battle position. (#2352) 2022-07-26 22:41:45 -06:00
RndName
2ecb3506b5 Update skynet to V3.0.0 release 2022-07-26 18:47:41 +02:00
Tom Wabinski
35fc43cda0 Refactor unclear conditional. 2022-07-25 23:51:26 -07:00
Tom Wabinski
71311eb157 Fix inverted pilot leveling flag. 2022-07-25 22:54:20 -07:00
Raffson
02c52f0801 Support for Mirage F1.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2335.

Co-authored-by: Starfire13 <72491792+Starfire13@users.noreply.github.com>
Co-authored-by: Jake Lewis <jake@logdyn.com>
Co-authored-by: Dan Albert <dan@gingerhq.net>
2022-07-25 16:11:36 +00:00
Raffson
ee7a0ade9e Update pydcs
Last version of pydcs was missing flyable aircraft, specifically the following:
- Mi-24P
- I-16
- Christen Eagle II
- Mirage-F1CE

It also removed the flyable option for the F/A-18C, i.e. the AI variant.
Note that the flyable F-18's ID is "FA-18C_hornet".
2022-07-24 09:57:46 -07:00
Raffson
1bee29de83 Fix incomplete reset (#2330)
* Fixing 'Reset' in squadron boxes

* Always use confirmation pop-up when closing with [X]
2022-07-23 12:10:26 +02:00
C. Perreau
d1c1977a9c pydcs updated for 2.7.16 (#2337)
Co-authored-by: Raffson <raffson@users.noreply.github.com>
2022-07-23 10:09:14 +02:00
dependabot[bot]
16b03ec90e Bump terser from 5.11.0 to 5.14.2 in /client (#2333)
Bumps [terser](https://github.com/terser/terser) from 5.11.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-21 23:33:51 +02:00
C. Perreau
7162bf4d24 #2203 : Added RNLAF Redskins 301 Squadron by KillgOreNL (#2332) 2022-07-20 16:25:47 +00:00
C. Perreau
3fb31c9d78 #2324 : Fixed buildings.miz not being usable without WW2 asset pack (#2331)
#2324 : Fixed buildings.miz not being usable without WW2 asset pack installed
2022-07-20 16:02:10 +00:00
Raffson
52c0be63ea Fix 'Accept' button in AirWingConfigurationDialog (#2318)
* Fix 'Accept' button in AirWingConfigurationDialog

- Fixes 'Accept' not saving changes
- Adds 'Reset' button (non-confirming)
- Adds confirmation pop-up when pressing [X]
2022-07-18 16:14:17 -06:00
Raffson
a54c217f88 Guard against null squadron in flight creator.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2323
2022-07-17 18:21:35 -07:00
Dan Albert
622e5d65aa Ack campaign version 10 for my campaigns.
No changes are required, as anyone oriented toward zero will be
automatically rotated to face the center of the conflict (the legacy)
behavior, and all my units do already.
2022-07-11 13:31:27 -07:00
Dan Albert
21199d9a24 Fix the command-line campaign generator for IADS. 2022-07-11 13:25:16 -07:00
MetalStormGhost
51b9d80488 Update contributors list. 2022-07-11 02:16:42 -07:00
Dan Albert
ccfd82e1c9 Get shapely from pypi again.
There's a wheel for this now.
2022-07-11 02:13:33 -07:00
SnappyComebacks
cbb81bbba7 Update most python dependencies (#2308)
* Change routes to return HTTP.OK instead of HTTP.NO_CONTENT.
2022-07-10 16:54:58 -06:00
SnappyComebacks
e60cde892a Added accept button to Air Wing Configuration window. (#2307)
* Add accept button to Air Wing Configuration window.
* Update black to 22.6.0.  Change pre-commit to use updated black.
* Update click to 8.1.3.
2022-07-10 07:25:48 -06:00
Raffson
7355162d80 Fix combat updates in the front-end.
`setCombat` was never called, so old combats were never cleared on turn
end, game load, or unload.

https://github.com/dcs-liberation/dcs_liberation/issues/2253
2022-07-06 13:36:15 -07:00
Raffson
9823f7b96f Push full navmesh/threatzone info in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2253
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-07-06 13:27:06 -07:00
Raffson
a20b95bb26 Push full TGO information in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-07-06 12:41:58 -07:00
MetalStormGhost
0fc2e8872d Added Leopard 2A6M as a variant in Leopard-2.yaml (#2298)
DCS names this unit "MBT Leopard-2A6M". The other Leopard 2 variants have
more specific names, but the generic 2 is the 2A6M.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2295
2022-07-06 12:28:00 -07:00
Raffson
746eda70ee In-Flight spawn: Minimum AGL altitude (#2302)
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2212
2022-07-06 18:56:39 +00:00
Raffson
ec425501cd Replace exceptions with 'if' statement 2022-07-06 11:32:22 -07:00
Raffson
64e68706ad Grey out advanced IADS if it's not supported 2022-07-06 11:30:49 -07:00
Raffson
2f97d948b8 Hotfix IADS (#2296)
fix for #2292
2022-07-04 16:02:22 +02:00
Raffson
cc4237d076 Fix incorrect start types for off-map squadrons. 2022-06-30 04:21:18 +00:00
Raffson
13546d77e7 Return self from end_combat.
No behavioral change, just consistency with the other APIs.
2022-06-29 21:05:53 -07:00
Raffson
27dff95df5 Handle IADS updates properly.
This adds the missing events in the backend, and handles them properly in the front end.
2022-06-29 18:58:49 -07:00
Raffson
5f071a6138 Add missing mission types for IADS targets. 2022-06-29 18:54:34 -07:00
Raffson
def611ef89 Focus on the exception window (#2282) 2022-06-28 20:31:07 -07:00
Raffson
8c2c353071 Clean up IADS exception handling. 2022-06-28 20:30:17 -07:00
Raffson
d45bba19c8 Initialize restore_start_type 2022-06-28 20:28:27 -07:00
Dan Albert
9ab1dbab78 Dedup pyinstaller actions. 2022-06-26 16:37:08 -07:00
Dan Albert
83af032bee Enable dependency caching in workflows. 2022-06-26 14:34:07 -07:00
Dan Albert
2a5e12dfc5 Refactor some repeated actions out of workflows. 2022-06-26 14:11:15 -07:00
Dan Albert
e751b53241 Mark advanced IADS WIP.
The advanced IADS currently only works during the initial game
generation. Any changes to the TGO (purchases/sales, captures, etc) will
disconnect the node from the network and return it to basic IADS
functionality.
2022-06-26 12:31:42 -07:00
Raffson
61488627a4 Push full control point information in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-06-25 14:17:08 -07:00
Raffson
da90a40bc4 Push full front line information in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-06-25 14:13:10 -07:00
Raffson
d578e763c0 Push full flight information in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-06-25 14:09:51 -07:00
Raffson
289545e777 Push full unculled zone information in the event stream.
https://github.com/dcs-liberation/dcs_liberation/issues/2263
2022-06-25 21:09:07 +00:00
Dan Albert
3eafd0cb62 Add a few more notes to the pull request template. 2022-06-25 13:47:21 -07:00
Raffson
75cc8bfd50 Skip UI update for canceled packages.
This is theoretically impossible, but for some reason the dialog that
owns this object QEditFlightDialog does not dispose properly on close,
so this handler may be called for a flight whose package has been
canceled, which is an invalid state for calling anything in
TotEstimator.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2250
2022-06-25 13:31:40 -07:00
Raffson
76bc0fde33 Fix filter definitions for TGO layers.
https://github.com/dcs-liberation/dcs_liberation/issues/2253
2022-06-22 01:57:36 -07:00
Raffson
7f05f6bc7d Don't send updates for CP TGOs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2139
2022-06-16 18:08:13 -07:00
dependabot[bot]
8f0d071afb Bump electron from 17.1.0 to 17.2.0 in /client
Bumps [electron](https://github.com/electron/electron) from 17.1.0 to 17.2.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v17.1.0...v17.2.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 16:28:14 -07:00
Raffson
30bdcfac29 Fix eslint warning in CI 2022-06-16 09:38:29 -07:00
Raffson
8a1c0c041c Add missing unculled zone update event. 2022-06-16 01:50:40 +00:00
Raffson
ad7032064d Add culling exclusion zones display to the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2158
2022-06-14 18:57:04 -07:00
Raffson
c5ff8777be Fix Exception: 'DeadFlightPlan' object has no attribute 'targets'
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2247
2022-06-12 13:34:43 -07:00
Raffson
70e5c578ae Add the ruler to the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2158
2022-06-12 13:15:26 -07:00
Raffson
6557864697 Import QApplication 2022-06-11 20:17:39 -07:00
Raffson
04cb53a9c8 Replace 'Arrival combo box' with a label.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2243
2022-06-10 15:04:26 -07:00
Raffson
5f1ae30f19 Close all windows on exit 2022-06-10 14:53:11 -07:00
RndName
aa77cfe4b9 Add AirAssault and Airlift mission types with CTLD support
- Add the new airassault mission type and special flightplans for it
- Add the mission type to airbase and FOB
- Add Layout for the UH-1H
- Add mission type to capable squadrons
- Allow the auto planner to task air assault missions when preconditions are met
- Improve Airlift mission type and improve the flightplan (Stopover and Helo landing)
- Allow Slingload and spawnable crates for airlift
- Rework airsupport to a general missiondata class
- Added Carrier Information to mission data
- Allow to define CTLD specific capabilities in the unit yaml
- Allow inflight preload and fixed wing support for air assault
2022-06-09 22:45:29 +02:00
RndName
de148dbb61 Add CTLD script and update JTACAutoLase config
- Added the CTLD script
- Removed the previous jtacautolase script
- Updated the configuration to allow the JTACAutoLase function to work
- Added the JTac name, freq and mod to the lua
2022-06-09 22:45:29 +02:00
Dan Albert
0a7ded4052 Update pydcs.
Includes the latest data export and the missing torpedo weapon data.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1901
2022-05-29 17:08:26 -07:00
Dan Albert
c401ac7560 Give the CAS F-16 some gas.
This loadout is significantly heavier than the previous loadout, but the
previous loadout had very limited range because it lacked bags.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2130
2022-05-29 15:34:11 -07:00
Dan Albert
22c3d4ebc5 Add a CLI tool for viewing default loadouts. 2022-05-29 15:23:21 -07:00
Dan Albert
c5efc908de Ensure a unique ID for supply routes.
List indexes are not a reliable list key unless the list is static.
Indexes will be reused when games are loaded, which prevents the state
from updating reliably.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2167
2022-05-29 14:07:40 -07:00
dependabot[bot]
046c863768 Bump async from 2.6.3 to 2.6.4 in /client
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-28 20:35:11 -07:00
dependabot[bot]
3335cafa94 Bump ejs from 3.1.6 to 3.1.7 in /client
Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/mde/ejs/releases)
- [Changelog](https://github.com/mde/ejs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mde/ejs/compare/v3.1.6...v3.1.7)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-28 20:25:16 -07:00
Dan Albert
ee3fb6df09 Fix generation of convoys along non-front routes.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2083
2022-05-27 17:02:45 -07:00
RndName
d59653eed9 Add 2nd STR to patriot layout
closes #1531
2022-05-14 16:13:55 +02:00
RndName
50b82f6383 Improve Layout loading and ForceGroup generation
- fix layout not preserving the correct group index
- fix ForceGroup generation merging preset_groups with generics
2022-05-14 16:13:09 +02:00
RndName
72682e4db3 Remove special heading to conflict calculation for radars
The special handling is not required anymore as we now rotate the whole TGO to head towards the conflict if the campaign designer has not defined any specific heading
2022-05-13 21:47:16 +02:00
RndName
10e7ce6363 Update and generalize Anti Air Layouts 2022-05-13 21:47:09 +02:00
RndName
e874f47920 Set default value for reversed_heading property
Prevent breaking the save compat.
2022-05-12 16:36:07 +02:00
RndName
92992fc068 Fix missing return in steam_into_wind 2022-05-12 16:26:48 +02:00
RndName
48075ace90 Fx typo in tt_ZU-23 unit yaml 2022-05-12 16:21:13 +02:00
RndName
88a8caa023 Add reversed_heading property to ground units
This allows to define if a unit should be placed backwards in the generated mission. This is required for example for the SA-11/SA-17 or Silkworm Launchers.
2022-05-12 16:21:12 +02:00
RndName
f20d0effe9 Update Anti Air and Naval Layouts
- Break down the remaining Anti Air Layouts. Now each layout.miz only contains 1 layout
- Added a python script which can fix the orientation of a layout
- Fix layout orientation. Now all aa layouts are oriented to the north.
- Add small change so that whole carrier group will be rotated correctly with the BRC

closes #2215
2022-05-12 16:21:12 +02:00
RndName
7acc418489 Update the High Digit SAMs implementation
- Add more HighDigitSAMs units
- Add hds SA-2, SA-3 and HQ-2 to capable factions
- Update radar db with hds as these entries were missing
2022-05-12 16:20:44 +02:00
RndName
47b6c2608c Fix destroyed buildings generate income 2022-05-07 18:24:29 +02:00
RndName
00dc8df0de Fix income not correctly calculated
- Fix the Income class to correctly count the income with the recent ground object refactoring
- Adjust the Factory income from 10 to 2.5 as we now have 4 units instead of 1 as with v5.2

closes #2207
2022-05-07 18:08:26 +02:00
RndName
244425381d Fix incorrect forcegroup loading
Forcegroups were not loaded correctly from preset groups during faction initialization. When a user created a new game and directly after that created another game with different factions the Forcegroups for the preset groups were still reused and therefore units which were not accessible by the faction were accidently available to the new faction.
closes #2186
2022-05-06 19:31:40 +02:00
RndName
a10e55cfd7 Calculate orientation of specific TGOs automatically
This will allow to automatically calculate the orientation of TGOs which are required to head to the conflict if the campaign designer has not defined a specific heading in the campaign miz. This is for example required for silkworm, scuds or some SAM systems like the SA-11.
Added the should_head_to_conflict property to the TGO
2022-05-06 17:34:16 +02:00
RndName
2d39fb496c Update heading and iads state of TGO after capture 2022-05-06 16:17:01 +02:00
RndName
9e3edd7208 Set correct unit name for carriers 2022-05-06 16:17:01 +02:00
RndName
015103f613 Fix incorrect handling of disabled groups in buy menu
Disabled groups would still be bought free of charge. this is now fixed
2022-05-06 16:17:01 +02:00
RndName
321bd4e874 Fix Skynet scripting errors
added a better exception handling

closes #2205
2022-05-06 16:16:35 +02:00
RndName
799e01c7b3 Support for DCS 2.7.12.23362 (#2196)
- Add link4 and acls
- Allocate Link4 frequency
-  new unit yamls
2022-05-02 19:08:44 +02:00
RndName
e4f91fd3ba Fix AAA not placed as frontline unit
- Spawn AAA like SHORAD
- change SA-19 unit class from AAA to SHORAD

fixes #2194
2022-05-02 18:58:57 +02:00
RndName
41d1ae099f Consider priority order in Aircraft selector 2022-04-25 19:24:48 +02:00
RndName
2836a89f91 Update DEAD task priority list
Set SEAD capable planes with higher priority instead of adding them at the end
2022-04-25 19:24:48 +02:00
RndName
f04030858b Allow custom mission types
Instead of giving an error when a mission type which was added to the squadron is not defined in the Ai autoplanner db for the aircraft the user should be able to task the aircraft accordingly.
2022-04-25 19:24:48 +02:00
RndName
5be92cd75e Cleanup threat and detection range calculation
- Moved logic from TGO to TheaterGroup and Unit, cleanup
- Fixed an issue with wrong radar threat zone calculation
- Correctly handle dead and alive units in threat calculation (dead units are no more threats...)
- Fixed wrong air_defenses threat zone used for planning (now uses aa-capable tgos instead of all tgos for the CP)
- Remove the might_have_aa property from TGOs and actually check if there is any aa-capable unit present (this is needed as with the recent tgo refactor all type of TGOs can also have anti air units if they have some defined in the layout)
2022-04-21 21:20:02 +02:00
MetalStormGhost
36d9dda500 Update UH-60L mod support to version 1.3.1
Updated the UH-60L loadout for version 1.3.1 and added the UH-60 to the following factions as per #2176
    Israel-USN 2005 (Allied Sword)
    Israel 2000
    Israel 2012'ish
2022-04-21 21:16:10 +02:00
RndName
3008d9a512 Fix QFlightWaypointTab preventing save game
closes #2180
2022-04-21 13:25:01 +02:00
RndName
c437fa329c Improve SEAD ingress tasking and target waypoint
* Fix suicide SEAD flights (diving to the SAM)

additional fix for #2152. This sets the Target Waypoint ALT to the Ingress ALT for non player flights. Player flights will have the target waypoint set to 0 AGL so that they can slave weapons or TGP to it.

* Add GroupAttack to SEAD so that they suppress more
2022-04-20 00:19:03 +02:00
RndName
004bcce58e Allow skynet properties override and improve dead unit handling
Now the user can override special skynet properties from the unit.yaml of the main Radar of the sam site. Which unit needs these overrides can be looked up over here: https://github.com/walder/Skynet-IADS/blob/develop/skynet-iads-source/skynet-iads-supported-types.lua

- fixed wrong exclusion of groups with the first unit dead but still able to participate
- added some exception handling in the lua script for groups which skynet is not able to control. preventing scripting errors
2022-04-19 10:41:16 +02:00
RndName
4664a7bbd4 Update Mist and Skynet scripts (V3.0.0)
- adopt skynet config to v3
2022-04-19 10:41:16 +02:00
RndName
fd7bd28381 Fix incorrect faction loading 2022-04-19 10:41:16 +02:00
RndName
5b090c20ec Update Golan Heights to support advanced skynet
- Updated to 10.1 (headings + advanced iads)
- Demonstrates how the advanced system will work
2022-04-19 10:41:16 +02:00
RndName
5569f49456 Bump campaign version to 10.2 2022-04-19 10:41:16 +02:00
RndName
5cdfe62e2d Implement advanced skynet functions
- factor out own class for the iadsnetwork within the conflicttheater
- This class will handle all Skynet related things - no specific group_name handling necessary in future
- make iadsbuilding own TGO class because SAM & EWRs are Vehicle Groups. IADS Elements dont have any groups attached.
- added command center, connection node and power source as Ground objects which can be added by the campaign designer
- adjust lua generator to support new iads units
- parse the campaign yaml to get the iads network information
- use the range as fallback if no yaml information was found
- complete rewrite of the skynet lua script
- allow destruction of iads network to be persistent over all rounds
- modified the presetlocation handling: the wrapper PresetLocation for PointWithHeading now stores the original name from the campaign miz to have the ability to process campaign yaml configurations based on the ground unit
- Implementation of the UI representation for the IADS Network
- Give user the option to enable or disable advanced iads
- Extended the layout system: Implement Sub task handling to support PD
2022-04-19 10:41:16 +02:00
RndName
138e48dc2d Refactor luagenerator
- cleaned up the generation
- created special class to handle the serialization
- improved string escaping: Replace OS Path separator with normal slash and allow the usage of a single quote in unit names by changing the delimiter to double quote instead (1797)
- adjusted unit_name generation to prevent scripting errors with unescaped characters
2022-04-19 10:41:16 +02:00
RndName
8f16f242b1 Update Changelog 2022-04-19 10:32:53 +02:00
RndName
679dfc3441 Improve Ingress Waypoint Attack tasking
* Improve Ingress WP attack tasking and update pydcs

- Updated the Attack Tasking of SEAD, DEAD, Strike and BAI to match the pydcs changes
- Changed DEAD, BAI and SEAD AttackGroup task to expend=auto. This solves an issue where the AI uses all Ammo on one single target as we defined the expend param to All instead of Auto which is used by default.

* Set Expend=All for SEAD Ingress

This ensures that the AI will only do one Attack Pass and also really suppress the Target what they are expected to do.
2022-04-19 10:21:15 +02:00
RndName
4115ca6040 Add option to set Auto-Assignable mission types in AirWing Config Dialog 2022-04-19 10:19:52 +02:00
RndName
88ea647c3a Fix empty bases in squadron configuration
- Filter the list of available aircraft by bases and only add aircrafts which can be operated
- Only enable the accept button when a base is selected

fixes #2127
2022-04-19 10:19:52 +02:00
RndName
69a5b4f227 Add modulation to RadioFrequency
- This adds the information about the modulation of the RadioFrequency.
- Updated all Radios with the capabale modulation
- Show Modulation on Kneeboard
- Defaulting to AM Modulation as this is also the default used by pydcs.
- Force AM Modulation for JTAC tasking

We currently do not force the modulation in the code anywhere other than JTAC. Pydcs defaults to AM (modulation=0). So this change is more a preparation for upcoming features which allow to use more frequencies like VHF FM or similar.
2022-04-19 10:19:44 +02:00
RndName
aae314ae1d Fix debriefing wait thread not closing correctly
- now stops the thread when manually submitting results
- added check for mission_end state on debrief update to prevent creating another waiting thread when the mission is already over
- also fixed an issue when manually submitting but canceling the file open dialog.

closes #2165
2022-04-14 13:48:23 +02:00
MetalStormGhost
4b89220a7b Added separate base images for carriers
Forrestal, Supercarrier (CVN-75), Kuznetsov, Kuznetsov (2017/Supercarrier) and Type 071 Yuzhao.

Resolves #1292
2022-04-14 11:17:09 +02:00
RndName
759b934184 Update campaigns by Fuzzle with recommended economy settings
solves #2157
2022-04-13 00:25:33 +02:00
RndName
25d0dcd08e Allow campaign designer to set default economy values
default starting money and income multiplier can be set in campaign.yaml

bumps campaign Version to 10.1
2022-04-10 10:24:25 +02:00
RndName
1d20e6277e Fix silkworm launcher falsely added to scud groups
Added AntiShipMissile unit class and updated the hy_launcher unit as well as the silkworm layout to differentiate clearly between missile (scud, v1) and antiship (silkworm)

fixes #2159
2022-04-08 21:30:44 +02:00
walterroach
9c9dc1c976 Add Starfire's loadouts for AH-64D_BLK_II
cherry-pick from 4d2289ece9 as it was only commited to 5.2
2022-04-02 13:55:17 +02:00
RndName
c6d1f31108 Mention the SEAD fix in the changelog 2022-04-02 10:16:11 +02:00
RndName
8362797381 Add ARM weapon data
Added all ARM weapons i was able to identify. May have missed some
2022-04-02 10:16:11 +02:00
RndName
1bb7e1bf47 Change SEAD task to Search and Engage for ARM weapon
SEAD flights will have the Search and Engage Group Task instead of the current AttackGroup task when the flight has ARM weapons in the Loadout. This resolves an issue with AI not able to attack a SAM when skynet is used. This is due to the RADAR not emitting and the AI therefore just diving into the SAM.
Non-ARM Loadouts will still use the AttackGroup task. This ensures that for example the ADM-141 TALD used by the F-14s will work correctly
2022-04-02 10:16:11 +02:00
RndName
23ba3215d4 Add SEAD Escort to tasks_by_priority 2022-04-02 10:16:11 +02:00
RndName
ad8fef2fda Fix detection range calculation if TGO is empty
implement fix like in #1980
solves #2128
2022-04-01 11:54:47 +02:00
RndName
2274cef68c Fix missile layout orientation
- changed the heading to 0
2022-03-30 20:01:58 +02:00
RndName
bc76efaea6 Move the tgo value calculation from UI to the tgo 2022-03-30 12:48:58 +02:00
RndName
de76276a4d Fix incorrect value calculation of ground objects
A user would be able to sell a complete damaged TGO for the price of a new one as the value calculation function was not taking care if the unit was dead or alive. This fix now only takes alive units into account for the actual value of the tgo
2022-03-30 12:05:46 +02:00
Starfire13
4738a722a6 Campaign Update to Version 10.0 2022-03-29 18:21:19 +02:00
RndName
6de50d1515 Fix JTAC names
- Add additional naming method to naming.py
- JTACs now use the ALPHA_MILITARY. So first JTAC is called JTAC Alpha, 2nd JTAC is called JTAC Bravo and so on

fixes #2120
2022-03-28 20:32:19 +02:00
Dan Albert
088073b257 Update bug templates now that 5.2.0 is out. 2022-03-27 12:47:38 -07:00
RndName
c9df8cc803 Fix GroundObject Menu
- fixed incorrect Buy button enable / disable
- update the game after repair
2022-03-27 20:37:42 +02:00
RndName
5f010bb94d Update Changelog with the 5.2.0 release 2022-03-27 01:40:26 +01:00
RndName
f7f565477c Set unrestricted_satnav for NATO factions 2022-03-26 17:06:11 +01:00
RndName
6a6df8936e Capaign update: Task Force Thunder
Submission by sith1144 #2121
2022-03-26 13:12:41 +01:00
RndName
d30701c1bb Campaign update for Tripoint Hostility 2022-03-26 12:01:09 +01:00
dependabot[bot]
5492a45b67 Bump minimist from 1.2.5 to 1.2.6 in /client
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 22:12:26 -07:00
dependabot[bot]
d2d62c350c Bump node-forge from 1.2.1 to 1.3.0 in /client
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 21:53:32 -07:00
RndName
9050e705ff Campaign updates by Fuzzle 2022-03-25 21:39:40 +01:00
RndName
7b0676025b Campaign submission: Tripoint Hostility
Submission by sgtfuzzle17
2022-03-25 21:31:30 +01:00
Benjamin Fischer
8eb97136b0 Make Apache LHA capable.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2113.
2022-03-24 17:15:34 -07:00
Benjamin Fischer
e9c5cac20c Fix can_operate for airfields without runways.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2110.
2022-03-24 17:15:06 -07:00
RndName
1e19afe0e5 Use Heading from Campaign miz for Buildings
Like with most other GroundObjects now the Buildings also will use the Heading defined in the campaign miz and will place and rotate the generated TGO accordingly there.
2022-03-23 18:02:34 +01:00
RndName
bbb08aa1db Add orientation info and allow user to rotate TGO
- Give user information about the heading of a TGO
- Add a button to change the heading to head to conflic
- Change the orientation of a TGO during Buy
- Run the heading to conflict calculation to change the orientation of the newly bought group. It will then head to the center of the conflict
2022-03-23 17:26:47 +01:00
RndName
274f689f70 Fix Heading to conflict calculation 2022-03-23 17:26:47 +01:00
RndName
892bd9f069 Fix ForceGroup merging and PresetGroup handling 2022-03-23 17:26:47 +01:00
RndName
d0fe058a24 Change ZU-23 from SHORAD to AAA 2022-03-23 17:26:47 +01:00
RndName
14218f4d09 Fix SA-3 TR not beeing added 2022-03-23 17:26:47 +01:00
RndName
c7270e8654 Fix error during faction loading
ForceGroup loading failed due to wrong unit parsing and prevented factions without naval units to load before the first faction with naval units got loaded (this affected the Allies 1940 and 44 factions)
2022-03-23 17:26:47 +01:00
RndName
d67d32610d Fix fallback_classes for EWR layout 2022-03-23 17:26:47 +01:00
RndName
e93639e1ab Fix GroundObjectBuy Menu after buy or sell
- Close the Buy Menu after complete buy
- Update the Ground Object Dialog with the changes
- Update the Game & map correctly
2022-03-23 17:26:47 +01:00
RndName
f0a3fd1e3a Merge forcegroups with the same task 2022-03-23 17:26:47 +01:00
RndName
9a2fa50b0f Bump Campaign version to 10.0
The new introduced layout system extends the mission generation so that a campaign designer can now define the heading of the ground objects which will be also used later in mission generation to orient the group accordingly. This removes the randomization of the orientation from the generation.

Most campaigns will not need any updates and will work out of the box.
2022-03-23 17:26:47 +01:00
RndName
4ace13c857 Improve the optional unit handling in layouts
added the fill property to the layout groups which allows to specify if a optional layout group should be filled with a faction accessible unit if it was not defined by the preset groups. This is usefull to allow more generalized templates which for example may or may not have a Search Radar without adding one to all layouts (example: Rapier and Roland Sites which use the generic SHORAD layout)

this fixes an issue which prevented optional units like logistics to be added to the forcegroup if they were not defined in the preset group yaml
2022-03-23 17:26:47 +01:00
RndName
923549ef69 Generalize and update more AA layouts
- Generalize Hawk, Rapier, Roland, SA-2, SA-3, SA-11, HQ-7, NASAMS
- One layout miz with 6 Launchers
- Two general layout yamls for 6 and 4 Launchers using the same miz
- Split up the SHORAD layout (one with TELAR units and one with Track Units)
2022-03-23 17:26:47 +01:00
RndName
437fdd6d12 Support for the AH-64D radios
- Support for the AH-64D radios
- Mention missing Radio preset support for AH-64D
2022-03-23 17:16:24 +01:00
RndName
4014a4e250 Update bug template for 5.2.0 2022-03-22 10:14:23 +01:00
Starfire13
46e220cecc Peace Spring, Vectron's Claw, Vegas Nerve updates. 2022-03-21 11:25:36 -07:00
RndName
78e901cbf7 Fix vscode dev launch config
removed the --new-map arg
2022-03-21 15:57:44 +01:00
Dan Albert
123a44fefc Scenic Route II update.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2099.
2022-03-20 16:19:26 -07:00
Dan Albert
b683246647 Add Apache squadrons.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2097.
2022-03-20 16:18:41 -07:00
Dan Albert
f72b2a21f7 Remove the old map.
The new map has no open bugs.
2022-03-20 16:13:07 -07:00
Dan Albert
3af3bd606c Migrate off deprecated shapely APIs. 2022-03-20 16:00:29 -07:00
Dan Albert
6c1e1e1e95 Remove save compat.
There was a necessary break in the previous commit. Clean up any
existing save compat to go with it.
2022-03-20 16:00:29 -07:00
Dan Albert
039ac9ec74 Replace CP integer ID with a UUID.
This allows unique identification across saves. The front-end needs to
be able to differentiate the first carrier in game A and the first
carrier in game B, but because carriers (and other non-airfield CPs) are
assigned IDs sequentially, collisions were to be expected. The front-end
can't tell the difference between a reloaded game and a new turn, so we
need to ensure different IDs across games.

This is a handy cleanup anyway, since callers constructing CPs no longer
need to manually track the CP ID counter.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2078.
2022-03-20 16:00:29 -07:00
Dan Albert
941a7d441c Fix order of package deletion actions.
We need to register the deleted flights before we clear the package, or
we'll just delete an empty package.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2062.
2022-03-20 14:05:04 -07:00
Dan Albert
ad37dcce44 Fix broken iteration when clearing ATO.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2046.
2022-03-20 13:40:57 -07:00
Dan Albert
2c041081c9 Start sim if needed.
This used to be accidentally performed by the pause function. That's no
longer done, so start if needed.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2098.
2022-03-20 00:02:51 -07:00
Dan Albert
8dddffb8b5 Revert "Use shapely from PyPI now that there's a wheel."
Works locally, not in GitHub action.

This reverts commit 47d54fd295.
2022-03-19 16:21:44 -07:00
Dan Albert
78c3da99f7 Don't initialize the simulation on game update.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1844.
2022-03-19 13:51:26 -07:00
Dan Albert
47d54fd295 Use shapely from PyPI now that there's a wheel. 2022-03-19 13:15:06 -07:00
Dan Albert
bc39d5eaa8 Update pydcs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2096.
2022-03-19 12:40:57 -07:00
DillieKoe
29cfff70ee Fix unit role of Type 04A (ZBD-04A).
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2072.
2022-03-18 00:20:24 -07:00
Dan Albert
8c0be1099c Add Sith1144's new campaigns.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1833.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1834.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1835.
2022-03-18 00:19:30 -07:00
Benjamin Fischer
e6a3bf9885 Round waypoint altitudes in tooltips.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2089.
2022-03-18 00:10:06 -07:00
Benjamin Fischer
31bc5eb2aa Fix SAM repair.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2091.
2022-03-18 00:07:41 -07:00
Benjamin Fischer
be67d6dbc6 Fix custom waypoint addition/removal.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2063.
2022-03-18 00:06:41 -07:00
RndName
01f872c960 Add support for the flyable Apache. 2022-03-18 00:00:02 -07:00
Dan Albert
995ccadc5b Update pydcs. 2022-03-17 23:53:22 -07:00
RndName
c5918d5531 Add VSCode launch config for node server
Used for node debugging within VSCode
2022-03-17 13:18:13 +01:00
Benjamin Fischer
4a666705c4 Log information about the generated campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1735
2022-03-16 18:03:21 -07:00
Benjamin Fischer
f7ced1aea6 Make the flight dialog modal to prevent inventory loss.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1971.
2022-03-16 17:29:27 -07:00
RndName
46694e458d Fix for incorrect unit_count in layout
- Raise LayoutException if the unit_count in the layout is greater than the available units
- Fix Flak Layout to solve #2043
2022-03-16 22:10:19 +01:00
RndName
c238e50e41 Fix silkworm layout
Changed the orientation of the layout and flip the launchers by 180 to fix #2084
2022-03-16 21:54:34 +01:00
RndName
5aa358c27b Add VSCode launch config for dev server
Added args and env according to the readme file. Developer still needs to run npm run start from the client dir
2022-03-16 21:50:56 +01:00
Benjamin Fischer
1207b082dc another high dpi fix which fixes some resizing issues. 2022-03-12 18:40:07 -08:00
Benjamin Fischer
da4bd8120b Round balance and income in the finance window.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1983
2022-03-12 13:55:44 -08:00
Benjamin Fischer
2c10d3f5b2 fixes #1987 by adding highdpi qt attributes. 2022-03-12 11:44:32 -08:00
Benjamin Fischer
827c68bf75 Fixes #1774 by adding a logmessage for non ascii install path. 2022-03-11 18:48:43 -08:00
Dan Albert
769fe12159 Split flight plan layout into a separate class.
During package planning we don't care about the details of the flight
plan, just the layout (to check if the layout is threatened and we need
escorts). Splitting these will allow us to reduce the amount of work
that must be done in each loop of the planning phase, potentially
caching attempted flight plans between loops.
2022-03-11 16:00:48 -08:00
Dan Albert
fa8c0d9660 Clean up flight plan code.
Split the oversized file into one per plan type. This also moves the
layout responsibility out of the oversized FlightPlanBuilder and into
each flight plan type file.
2022-03-09 02:15:07 -08:00
Dan Albert
c5fd3df235 Fix caching behavior of flight plan data.
This is far from complete but it at least covers anything related to
flight plans.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2060
2022-03-08 18:49:41 -08:00
Dan Albert
4993353184 RTB canceled in-progress flights.
The UI won't stop you from aborting a flight that is already home, but
that should also result in it re-completing again on the next tick.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2022-03-08 01:04:19 -08:00
Dan Albert
7fe73ad2eb Fix description of dead flights.
Completed is technically correct but not very helpful.
2022-03-07 23:39:43 -08:00
Dan Albert
f63a107c11 Account for time elapsed when leaving combat. 2022-03-07 23:23:52 -08:00
Dan Albert
e36c62b30e Identify aircraft types based on their mission.
It would probably be more accurate to have the icon based on the
aircraft type and use the modifier to indicate the mission, but this
will do for now (I also might have that backwards, I can't find the
guidance because it's in STANAG 1241 which isn't free).

I also increased the icon size a bit in the UI because the longest icon
text ("SEAD") was hard to read.
2022-03-07 21:45:33 -08:00
Dan Albert
73a8ec02b2 Speed up game tick by caching TGO threat regions.
Still more could be done here by caching the merged poly at the theater
level, but this goes a long way.

Aircraft commit regions are already cached (in the FlightState), so
those are already fairly fast. The combined A2A commit boundary could
also potentially be cached at the theater level.
2022-03-07 21:19:04 -08:00
Dan Albert
453f6ac74a Include positions of dead aircraft for the UI. 2022-03-07 19:43:06 -08:00
Dan Albert
895a4eb0dc Make flight death chance not impossible.
The odds of random.random() returning exactly 1.0 are basically nil, and
that was the only way a non-solo flight could lose this.
2022-03-07 19:35:19 -08:00
Dan Albert
005090fbcd Support display of dead flights. 2022-03-07 19:34:51 -08:00
Dan Albert
053a1287c9 Fix missing key in combat display. 2022-03-07 19:33:11 -08:00
Dan Albert
f5955dafaf Roll over time in excess of the current waypoint. 2022-03-07 18:35:16 -08:00
Dan Albert
e95a9e0685 Stop ticking elapsed waypoints.
If the parent tick caused the flight to move to the next waypoint, we
shouldn't send events for the elapsed waypoint.
2022-03-07 18:19:09 -08:00
Dan Albert
a6a44ef433 Fix marking of non-marked waypoints. 2022-03-07 18:10:04 -08:00
Dan Albert
cf7c7d853f Add back the "selected only" flight plans layer.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2058
2022-03-07 18:06:30 -08:00
Dan Albert
ca640ebabe Move the default port to 16880.
1688 is used by MS KMS.
2022-03-07 17:56:10 -08:00
Dan Albert
baae65919f Enable configuration of the server bind address.
A serverconfig.env (or just environment variables) can be set to
override the default bind address/port for the backend. This is passed
to the front end as a query parameter.
2022-03-07 17:53:55 -08:00
Dan Albert
a70ab8cc1d Add waypoint debug layers to the new map.
This is now feature complete with the exception of the ruler, none of
which seem to work with react. Someone that understands JS packaging
better than I do (which is a very low bar) will need to have a look.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-07 17:28:43 -08:00
Dan Albert
f7f0cf942c Update pydcs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2042
2022-03-07 16:54:22 -08:00
Dan Albert
54b9392d4b Add missing front line click handlers.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2056
2022-03-07 03:29:56 -08:00
Dan Albert
cf3ef5b403 Support terrain zones on the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-07 00:26:13 -08:00
Dan Albert
8c63274f57 Move the server off the default uvicorn port. 2022-03-07 00:05:45 -08:00
Dan Albert
d7e62d0b0b Remove another hand written API model.
There are still two more of these that don't show up in openapi.json
because they don't show up in HTTP routes (only in the websocket):

* GameUpdateEvents
* FrozenCombat

I'm not sure if there's a way to forcibly include those in the
openapi.json, if I should add a no-op API to force it to happen, or if I
should just ignore it. For now I'm going with option 3.
2022-03-06 23:44:15 -08:00
Dan Albert
4b4336391a Remove hand written API objects. 2022-03-06 23:42:23 -08:00
Dan Albert
6ee235545f Clean up leaflet polygon API surface. 2022-03-06 23:25:25 -08:00
Dan Albert
15176223fa Add navmesh support to the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 23:07:24 -08:00
Dan Albert
b08b91ca2e Fix flight plan updates when waypoints are moved.
The store serializes everything; we can't store references.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2055
2022-03-06 22:18:36 -08:00
Dan Albert
0afe1f69d4 Don't dispatch flight position updates when empty. 2022-03-06 22:03:38 -08:00
Dan Albert
6f21067ddb Fix lint error, add lint script. 2022-03-06 21:59:44 -08:00
Dan Albert
ccce801dc4 Add missing TGO click handlers.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2056
2022-03-06 21:57:40 -08:00
Dan Albert
dc4762a03b Add threat zone support to the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 19:32:30 -08:00
Dan Albert
30aebf2546 Replace api.ts with auto-generated API.
All the slices will come later.
2022-03-06 18:23:52 -08:00
Dan Albert
2310ef0f80 Auto-generate API hooks for the backend. 2022-03-06 18:18:53 -08:00
Dan Albert
de284c2bf6 Add tooling/docs for auto-generating API hooks. 2022-03-06 18:18:35 -08:00
Dan Albert
b7439cbd17 Add metadata to FastAPI endpoints for OpenAPI.
operation_ids give us better function names when generating the
typescript API from the openapi.json. BaseModel.Config.title does the
same for type names. Response models (or 204 status codes) need to be
explicit or the API will be declared as returning any.
2022-03-06 17:12:00 -08:00
Dan Albert
4053356e13 Default to the React map the default.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 02:02:25 -08:00
Dan Albert
904602510d Remove API key auth; CORS is sufficient.
The React UI running in a browser can't connect to the backend without
punching a hole for CORS, which isn't done by default. We don't need the
API key to protect from browsers, and anything else running on the
user's machine that can access the backend (that's hosted on only
localhost) already has enough control to do damage without using
Liberation as an attack vector.

https://github.com/dcs-liberation/dcs_liberation
2022-03-06 01:57:12 -08:00
Dan Albert
8165d3bd8c Add support for running the build react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:53:22 -08:00
Dan Albert
3c9acea31c Fix CORS configuration.
We need to configure this always, but limit the allowed origins for non-
dev modes.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:52:06 -08:00
Dan Albert
17f2f007d2 Copy open source licenses into the distribution.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:34:53 -08:00
Dan Albert
7e213dbfbe Add license checking to npm ci.
These are all the licenses we currently depend on.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:33:33 -08:00
Dan Albert
fcb897a0e8 Uninstall @types/axios.
Axios ships types by default now so we don't need this.
2022-03-06 01:02:09 -08:00
Dan Albert
5230591dc2 Add npm ci to GitHub actions.
Formatting currently being forced to preserve line endings because for
whatever reason that's only causing problems in CI.
2022-03-06 00:59:58 -08:00
Dan Albert
605d8f057f Fix save loading.
https://stackoverflow.com/a/44888113/632035

Pickle can't deal with loading sets (and probably dicts) of objects with
custom __hash__ functions that depend on their state because __hash__
can be called before __setstate__. Make the hash function stupider (but
still correct) by just relying on the object ID.
2022-03-06 00:14:20 -08:00
Dan Albert
738cf1f381 Reset game state on new turn.
This may not be the way to do this long term, but it is how the old map
works so it's at least not a regression. It might be better to generate
events for the between-turn changes in state instead.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 00:02:25 -08:00
Dan Albert
73fcfcec7b Handle map reset when the game is loaded/unloaded.
https://github.com/dcs-liberation/dcs_liberation/issues/2039

Partial fix for
https://github.com/dcs-liberation/dcs_liberation/issues/2045 (now works
in the new map, old one not fixed yet).
2022-03-05 18:02:46 -08:00
Dan Albert
995e28cb32 Support mobile CPs in the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-05 15:41:58 -08:00
Dan Albert
2c6e8c414c Add --dev flag to put the game in developer mode.
Right now the only thing this does is remove sleeps meant to give people
time to read things that developers have already seen hundreds of times.
2022-03-05 11:24:37 -08:00
Dan Albert
b4edd5d841 Draw commit boundaries in the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-05 02:23:14 -08:00
Dan Albert
35df036eb8 Fix flight position update performance.
dispatch is expensive when called in a loop because each call
re-renders. Doing more work per dispatch causes fewer renders.

https://redux.js.org/style-guide/style-guide#avoid-dispatching-many-actions-sequentially
2022-03-05 00:42:22 -08:00
Dan Albert
05fbdae54c Remove redux-logger middleware.
https://github.com/reduxjs/redux-devtools does the same thing better
without spamming the log.
2022-03-05 00:39:26 -08:00
Dan Albert
b6457ae434 Un-split the flight data by coalition.
This made one callsite cleaner at the expense of the others and the
state management.
2022-03-04 19:54:41 -08:00
Dan Albert
59f734dd07 Draw frozen combat in the new UI.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-04 19:41:33 -08:00
Dan Albert
88cd9e19c5 Draw aircraft locations in the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-04 18:34:01 -08:00
Dan Albert
980d8f3092 Fix mistake introduced in previous commit.
Debugging code incorrectly reverted.
2022-03-04 02:23:42 -08:00
Dan Albert
811f46c289 Draggable waypoints with timing info.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-04 02:21:22 -08:00
Dan Albert
6933470ce0 Respond to ATO changes in the new UI. 2022-03-04 00:46:44 -08:00
Dan Albert
cba39df5da Handle to front line events in the new UI. 2022-03-04 00:37:31 -08:00
Dan Albert
34111cfc67 Update all TGOs on capture.
We need to update all TGOs, not just the cleared ones, because the
captured buildings need to update their icon to show the new color.
2022-03-04 00:29:31 -08:00
Dan Albert
fef123c2d4 Add redux-logger.
This automatically logs state changes (in a readable form) to the js
console. We'll probably want to turn this off in production to cut down
on log noise.
2022-03-04 00:24:31 -08:00
Dan Albert
a710ce5e1b Run prettier across the react source. 2022-03-03 23:34:18 -08:00
Dan Albert
13ca5352c7 Add import sorting to prettier. 2022-03-03 23:32:57 -08:00
Dan Albert
92236a5bc3 Update the react map for some new events. 2022-03-03 23:31:07 -08:00
Dan Albert
4539e91fa9 Add missing keys to list components. 2022-03-03 21:51:47 -08:00
Dan Albert
c5c596dc2f Move TGOs out of MapModel. 2022-03-03 17:11:01 -08:00
C. Perreau
d0ad554e14 Merge pull request #2040 from dcs-liberation/ukraine
🇺🇦 Support for Ukraine
2022-03-03 23:48:11 +01:00
C. Perreau
3037b540d4 Update README.md 2022-03-03 23:35:43 +01:00
Khopa
0b1365a04b Properly credit CC artwork author. 2022-03-03 23:34:22 +01:00
Dan Albert
ccb510fe47 Move front lines out of MapModel. 2022-03-03 02:17:13 -08:00
Dan Albert
89b987fc87 Stop fetching timing info for unselected flights.
The flight will be redrawn when it's selected. Don't bother fetching
this info for flights that aren't selected.
2022-03-03 01:24:32 -08:00
Dan Albert
8d806def5b Use FastAPI interface for the front lines.
Can't submit yet because there's no way to uniquely identify front-
lines, so no way to update these as they change.
2022-03-03 00:43:13 -08:00
Dan Albert
e5f4974e9a Stop ad-hoc constructing FrontLines.
The UI needs to be able to identify these to the server and vice versa,
so they'll need IDs that don't change. Rather than constructing an ID
based on the control points names, make them an owned part of the
control point. The constructed ID would be fine, but a UUID will make
them more suitable for the database, and this was always fairly gross
anyway.

Some follow up work if anyone is interested: a bunch of the data that's
computed in the various properties can now probably be computed *once*
and persisted to the FrontLine type.
2022-03-03 00:38:52 -08:00
Dan Albert
4dfc42528d Eliminate unnecessary waypoint API call in map.
I added the with_waypoints option for the react map. Use it in the old
one.
2022-03-03 00:10:45 -08:00
Dan Albert
79b471b41c Remove CSS that was messing with text alignment.
This was added by create-react-app. We're not using it any more.
2022-03-02 23:57:05 -08:00
Dan Albert
f9f18dd38b Fix drawing of non-path waypoints. 2022-03-02 23:53:16 -08:00
Dan Albert
d53fc46ffc All multiple event steam connections.
We don't support multi-client yet, but this is useful when debugging the
react UI in a browser instead of in the Liberation UI.
2022-03-02 23:51:12 -08:00
Dan Albert
781f8fb0e8 Fix a few display discrepancies in the new map. 2022-03-02 23:44:46 -08:00
Dan Albert
b39a44ae37 Draw front lines on the react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-02 23:33:15 -08:00
Dan Albert
9a2c10a98f Draw supply routes on the react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-02 23:14:05 -08:00
Dan Albert
0bdb4ac894 Draw air defense threat/detection ranges.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-02 21:51:16 -08:00
Khopa
510dcd762f 🇺🇦 Support for Ukraine 2022-03-02 17:52:47 +01:00
Dan Albert
64b01c471b Partial implementation of TGO display.
No threat/detection circles yet.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-02 01:01:33 -08:00
Dan Albert
1cd77a4a77 Fix display of control points.
Apparently redux state objects *must* be objects.
2022-03-01 23:39:49 -08:00
Dan Albert
dba2699b7e Add missing controls for flight plan layers. 2022-03-01 23:31:46 -08:00
Dan Albert
78b080063e Add layer control.
This isn't the grouped layer control that we have in the non-react map.
The react variant of that hasn't been updated in years and won't work
with our base maps (and may not work at all). We'll need to fix that or
write our own if we want to use that. This will do for now though.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-01 23:25:02 -08:00
Dan Albert
98c36c8b03 Remove default zoom control, add map scale.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-01 23:09:55 -08:00
Dan Albert
aac333e132 Draw waypoint markers for the selected flight.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-01 23:06:03 -08:00
Dan Albert
030675812e Cite the websocket tutorial I used for reference.
This was tricky to work out and most of the tutorials were bad. This one
was good, so keep a link around in case we need the reference again.
2022-03-01 21:25:32 -08:00
Dan Albert
8e8bbe84f3 Add websocket handling for selected flights. 2022-03-01 21:08:08 -08:00
Dan Albert
6d29bfdf65 Fix game state on refresh.
There was accidentally a second layer of callback here. I'm not sure why
it worked. I think the lambda being returned was being used as the
cleanup function?
2022-03-01 20:46:32 -08:00
Dan Albert
625f36c780 More cleanup. 2022-03-01 01:14:21 -08:00
Dan Albert
6ff9208d46 Reorganize React project structure.
Whatever I was doing was getting out of control :)
2022-03-01 01:14:21 -08:00
Dan Albert
406a64ae3f Draw flight plan paths in the react UI.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-01 01:14:21 -08:00
Dan Albert
bd8aa0296b Add map debugging launch configuration for vscode. 2022-02-28 22:37:06 -08:00
Dan Albert
21ba1bea36 Remove debug logging from react map. 2022-02-28 22:32:19 -08:00
Dan Albert
e51662526b Add an electron app for the React front-end. 2022-02-28 22:24:46 -08:00
Dan Albert
c628695a4e Persist window geometry on close.
Re-opens the window in the configuration it was in (size, maximized,
correct display, etc) when it was closed.
2022-02-28 18:08:40 -08:00
Dan Albert
155f9d4052 Make react-scripts devdependency to shut up audit.
The vulnerabilities are false positives and React doesn't think those
are worth fixing to make `npm audit` be quiet. We can at least make them
go away for `npm audit --production`, which is the official advice:
https://github.com/facebook/create-react-app/issues/11174.
2022-02-28 00:44:13 -08:00
Dan Albert
abadfef5a7 Remove unused workflow.
I'd added this early on with the intent of implementing is but forgot to
come back to it. We should do that at some point.
2022-02-28 00:35:22 -08:00
Dan Albert
59e98b31df Add a basic React implementation of the map.
See client/README.md for instructions.
2022-02-28 00:31:56 -08:00
Dan Albert
4e348dd99a Add a server setting for disabling the API key.
Useful for development if you want to disable API key authentication for
debugging the server without having to pull the generated key out of the
log every time.
2022-02-28 00:31:56 -08:00
Dan Albert
0056747aee Add an endpoint for listing all control points. 2022-02-28 00:20:01 -08:00
Dan Albert
e3adcada52 Migrate air icons to milsymbol.
All NATO icons are now generated by the milsymbol library based on their
SIDC.
2022-02-27 22:25:45 -08:00
Dan Albert
02383763ec Update TGOs to use milsymbol for icons. 2022-02-27 22:13:06 -08:00
Dan Albert
e7398af877 Update ControlPoint UI to use milsymbol library.
This gets us out of the business of maintaining our own icons. The
milsymbol library generates the SVG data needed to display anything
covered by APP-6.
2022-02-27 19:10:22 -08:00
Dan Albert
e1cdbed2e1 Update pre-commit to a newer version of Black.
Adds compatibility with match.
2022-02-27 19:05:32 -08:00
Dan Albert
41158543cf Add basic implementation for APP-6 SIDCs.
These will be used in conjunction with
https://github.com/spatialillusions/milsymbol to simplify the
specification of unit type to the front-end.
2022-02-27 18:38:59 -08:00
walterroach
05f3f3636b Add possible options to aircraft yamls
for convenience
2022-02-26 22:52:33 -06:00
RndName
0e324115be Update changelog 2022-02-27 01:19:33 +01:00
Dan Albert
a3a5c59327 Stream turn initialization events from the UI. 2022-02-26 13:41:11 -08:00
RndName
762bc328e1 Fix SA-8 LD used incorrectly as SA-13 and cleanup
- The SA-8 LD unit hat the SA-13 unit name as variant. The Layout tried to create a SA-13 SHORAD Site but actually used an SA-8 LD unit instead with zero threat range. This resulted in a yellow marked GroundObject on the map
- Cleaned up the treat and radar range functions a bit
2022-02-26 22:32:25 +01:00
Dan Albert
2585dcc130 Add (very!) rough simulation of frozen combat.
There are some TODOs here but th behavior is flagged off by default. The
biggest TODO here is that the time spent frozen is not simulated, so
flights that are engaged by SAMs will unfreeze, move slightly, then re-
freeze.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2022-02-26 13:01:46 -08:00
RndName
bc41261009 Fix missing parameter for initialize_turn
The recent changes missed to add the required parameter also for the ui callers.
2022-02-26 21:56:49 +01:00
RndName
a53812c0fb Fix helipad creation
Only create a Farp StaticGroup when there are actual helipads. This prevents accidental creation of a helipad at the position of a carrier.
2022-02-26 21:56:42 +01:00
Dan Albert
af4a718fc7 Fix server shut down on exit.
If there's a websocket being waited on the shut down won't actually
happen. Add a new event for shut down and send it to break the websocket
out of its loop.
2022-02-25 17:12:00 -08:00
Dan Albert
2efe4f6c80 Add missing super() call. 2022-02-25 16:52:28 -08:00
Dan Albert
332959128a Move back to upstream pydcs. 2022-02-25 16:49:26 -08:00
Dan Albert
d6e82d44fc Fix FastAPI doc pages.
We can't directly use frozen dataclasses from pydcs in our interface
because pydantic can't process them. Pydantic is able to automatically
convert to our modelview type from the pydcs type though.
2022-02-25 16:47:41 -08:00
Dan Albert
45e76e12b6 Move FlightJs out of MapModel. 2022-02-25 01:31:07 -08:00
RndName
ad0d3412fb Cleanup helipad creation and heli spawn 2022-02-24 23:21:17 +01:00
RndName
6f8c30ec81 Fix helicopter spawning inside each other
Also use NoParkingSlotError for better error handling if no helipads are available
2022-02-24 21:47:37 +01:00
RndName
c88fa6d2af Fix error in mission caused by wrong farp creation 2022-02-24 21:46:05 +01:00
Dan Albert
e4aedc9e83 Stop connecting to dead signal.
This was causing all further signals (which was just the flight
selection) to not register.
2022-02-22 20:42:15 -08:00
Dan Albert
b1356551c6 Move threat zones out of MapModel. 2022-02-22 19:59:29 -08:00
Dan Albert
1c543666b5 Move unculled zones out of MapModel. 2022-02-22 19:37:43 -08:00
Dan Albert
95836a217c Remove dead code. 2022-02-22 19:17:55 -08:00
Dan Albert
2ae820fb20 Move MapZones out of MapModel. 2022-02-22 19:16:55 -08:00
Dan Albert
0e6a303c17 Move NavMesh out of MapModel. 2022-02-22 18:49:12 -08:00
Dan Albert
1a9930b93a Remove our old lat/lon support code.
pydcs provides this now.
2022-02-22 17:40:35 -08:00
Walter Ray Haynie
bb72acd3ac Fix #1988 broken stored heading in Payload editor (#2020)
* Fix #1988

* Allow overwriting default aircraft properties

* Add logging to setting invalid props
2022-02-22 19:06:20 -06:00
Dan Albert
9e2e4ffa74 Update pydcs, adapt to new Point APIs.
This is briefly moving us over to my fork of pydcs while we wait for
https://github.com/pydcs/dcs/pull/206 to be merged. The adaptation is
invasive enough that I don't want it lingering for long.
2022-02-23 01:02:48 +00:00
RndName
ff12b37431 Load TgoLayoutGroups in correct order
Add handling to insert the layout group at the correct index according to the order used in the layout yaml
2022-02-23 00:07:37 +01:00
Dan Albert
ac80c4adc1 Finish moving gen into game. 2022-02-22 00:10:31 -08:00
Dan Albert
3e08e0e8b6 Un-pydantic FlightWaypoint.
Apparently it's a bad idea to try to make the core data pydantic models,
and those should really be treated more as a view-model. Doing otherwise
causes odd patterns (like the UI info I had leaked into the core type),
and makes it harder to interop with third-party types.
2022-02-21 23:10:28 -08:00
Dan Albert
c5ab0431a9 Re-enable uvicorn error logging.
This doesn't get enabled on the root logger by default.
2022-02-21 23:09:26 -08:00
Dan Albert
df7be8603b Clean up some uses of Point to prep for update. 2022-02-21 18:12:59 -08:00
RndName
bafc9dc65e Mention incompatible skynet plugin 2022-02-21 20:55:07 +01:00
RndName
0a13839155 Fix missing logistic units in layout causing error 2022-02-21 20:45:41 +01:00
RndName
54e24dff39 Improve Layout System and adopt to review
- adopted to review comments
- removed the role from layouts
- reworked the Groups within the layouts
- added more documentation
- rebased to latest changes
2022-02-21 20:45:41 +01:00
RndName
2c17a9a52e Refactor Templates to Layouts, Review and Cleanup
- Fix tgogenerator
- Fix UI for ForceGroup and Layouts
- Fix ammo depot handling
- Split bigger files in smaller meaningful files (TGO, layouts, forces)
- Renamed Template to Layout
- Renamed GroundGroup to TheaterGroup and GroundUnit to TheaterUnit
- Reorganize Layouts and UnitGroups to a ArmedForces class and ForceGroup similar to the AirWing and Squadron
- Reworded the UnitClass, GroupRole, GroupTask (adopted to PEP8) and reworked the connection from Role and Task
- added comments
- added missing unit classes
- added temp workaround for missing classes
- add repariable property to TheaterUnit
- Review and Cleanup

Added serialization for loaded templates

Loading the templates from the .miz files takes a lot of computation time and in the future there will be more templates added to the system. Therefore a local pickle serialization for the loaded templates was re-added:
- The pickle will be created the first time the TemplateLoader will be accessed
- Pickle is stored in Liberation SaveDir
- Added UI option to (re-)import templates
2022-02-21 20:45:41 +01:00
RndName
1ae6503ceb Rework S-300 and Naval Templates, Groups and Classes
- Unified SA-10, SA-10B, SA-12, SA-20, SA-20B, SA-23 to only one template: SA-300 Site
- Updated the unit groups for S-300
- unified russian and chinese navy templates
- added frigate class
2022-02-21 20:45:41 +01:00
RndName
f72f669d00 Update Units, add Ships and Groups 2022-02-21 20:45:41 +01:00
RndName
f10f792c4b Update Factions 2022-02-21 20:45:41 +01:00
RndName
344d4e31b7 Migrate generators to templats
- added all new templates
- deleted the generators
- added documentation
2022-02-21 20:45:41 +01:00
RndName
60c8c80480 Decoupling and generalization of templates
Improvement for factions and templates which will allow decoupling of the templates from the actual units
- Implement UnitGroup class which matches unit_types and possible templates as the needed abstraction layer for decoupling.
- Refactor UnitType, Add ShipUnitType and all ships we currently use
- Remove serialized template.json and migrated to multiple yaml templates (one for each template) and multiple .miz
- Reorganized a lot of templates and started with generalization of many types (AAA, Flak, SHORAD, Navy)
- Fixed a lot of bugs from the previous reworks (group name generation, strike targets...)
- Reorganized the faction file completly. removed redundant lists, added presets for complex groups / families of units like sams
- Reworked the building template handling. Some templates are unused like "village"
- Reworked how groups from templates can be merged again for the dcs group creation (e.g. the skynet plugin requires them to be in the same group)
- Allow to define alternative tasks
2022-02-21 20:45:41 +01:00
RndName
daf4704fe7 Rotate ground-units as in the campaign miz
This implements a logic to rotate groups which are generated from templates like the origin (ground unit) which was placed by the campaign designer
2022-02-21 20:45:41 +01:00
RndName
5febcdd4e4 Implement Template System for ground objects
- Factored out the current generators to use a better approach with Templates build from the dcs mission editor.
- This information is extended with a template-mapping in a json file which allows to logically group together multiple dcs groups and even statics to one template
- The combination of mapping and miz will be serialized to a template.json which is only used for loading.
- Factions now load templates during initialization and hold all the templates they can really use. This is based around the faction file.
- Implemented a template randomizer which allows to add some randomization to templates
- Each Template Group can have 1 randomizer which randomizes unit_type and size based on the mapping definition. Larger groups need to be devided in more fine detailed groups as we can now handle them better due to the change from dcs group types to our own classes.
- Rewritten the ArmorGroup, Naval and EWR template handling

Rework GroundObjectBuyMenu to support templates
2022-02-21 20:45:41 +01:00
RndName
d154069877 Refactor ground objects and prepare template system
- completly refactored the way TGO handles groups and replaced the usage of the pydcs ground groups (vehicle, ship, static) with an own Group and Unit class.
- this allows us to only take care of dcs group generation during miz generation, where it should have always been.
- We can now have any type of unit (even statics) in the same logic ground group we handle in liberation. this is independent from the dcs group handling. the dcs group will only be genarted when takeoff is pressed.
- Refactored the unitmap and the scenery object handling to adopt to changes that now TGOs can hold all Units we want.
- Cleaned up many many many lines of uneeded hacks to build stuff around dcs groups.
- Removed IDs for TGOs as the names we generate are unique and for liberation to work we need no ids. Unique IDs for dcs will be generated for the units and groups only.
2022-02-21 20:45:41 +01:00
RndName
6baf36c587 Prepare the generators for template migration
adopt armor and ship generators for randomization
2022-02-21 20:45:41 +01:00
Dan Albert
9e6b1cf716 Move logging config to a file.
By default logging configuration is defined by
resources/default_logging.yaml. Very noisy loggers (like the
uvicorn.access logger) are kept out of the console and UI logs by
default. Developers (or weird users) can customize their default logging
config by copying the file to resources/logging.yaml and editing as
needed. It would be preferable to load this file form the Liberation
user directory, but because first-time initialization requires the UI,
we want to configure logging before we necessarily know where to find
that.
2022-02-20 14:17:44 -08:00
Dan Albert
c16ca40894 Move waypoints and commit boundaries to FastAPI. 2022-02-20 13:30:36 -08:00
RndName
b533633494 Improve the replenish rate function in squadron.py
reword and reuse
2022-02-20 00:51:05 +01:00
MetalStormGhost
2af274dc77 Autoplanner will take number of pilots into account when planning purchases
- Added expected_pilots_next_turn() to Squadron. The procurement AI now correctly compares to it when evaluating if planes should be bought, instead of the maximum possible number of pilots.
- Added replenish_rate method to squadron.py to prevent expected_pilots_next_turn from returning an incorrect (too large) number when replenish rate > pilots required.
#1837
2022-02-20 00:48:05 +01:00
Dan Albert
5cd9af32fa Move UI-only waypoint number out of the model.
This isn't needed by the backend, so just handle it in the front end.
2022-02-19 15:09:58 -08:00
Dan Albert
4c3509a455 Remove unused signals. 2022-02-19 14:49:04 -08:00
Dan Albert
77d29e314c Add API key authentication.
We don't have any sensitive data, but we do access the file system. On
the off chance that some phishing website decides to try to use
Liberation as an attack vector, prevent access to the API by
unauthorized applications. An API key is generated at each program start
and passed to the front end via the QWebChannel.
2022-02-19 14:41:39 -08:00
Dan Albert
09457d8aab Move frozen combat handling out of MapModel. 2022-02-19 13:51:18 -08:00
RndName
2168143fea fix loading for vehicle pydcs_extensions 2022-02-19 22:27:17 +01:00
Dan Albert
cba68549d8 Add a UUID -> Flight database to Game.
This will be expanded with other types as needed.
2022-02-19 12:57:41 -08:00
Dan Albert
ab6f44cb6f Move remnants of db.py to config.py.
This is now just a few prices and income configurations. Both should
probably be defined in YAML but for now this makes the name "db" usable
again.
2022-02-18 18:22:02 -08:00
Dan Albert
9b20a6d053 Move UI defaults out of db. 2022-02-18 18:18:46 -08:00
Dan Albert
5cd2b91e28 Move another helper function out of db. 2022-02-18 18:15:29 -08:00
Dan Albert
9bdb81019b Remove unused class. 2022-02-18 18:13:43 -08:00
Dan Albert
ddfe4c00b1 Move missiongenerator helper to missiongenerator. 2022-02-18 18:12:53 -08:00
Dan Albert
4f64329f25 Move pydcs helper function out of db. 2022-02-18 18:11:32 -08:00
Dan Albert
b4742ad54c Move faction cache out of db.py. 2022-02-18 17:58:34 -08:00
Dan Albert
36f74ae0a9 Remove useless wrappers from db.py. 2022-02-18 17:50:51 -08:00
Dan Albert
758feab413 Remove unused piece of db.py.
There aren't any references to this field in the project.
2022-02-18 17:48:28 -08:00
Dan Albert
52ed6f3f94 Move livery overrides to unit yaml. 2022-02-18 17:22:43 -08:00
Dan Albert
c1cb32de21 Move a type out of game.db. 2022-02-18 13:00:42 -08:00
Dan Albert
e3ee988225 Move mod vehicle registration to a decorator.
This cruft doesn't need to be in game.db, it can be kept with the mod
support code.
2022-02-18 12:54:41 -08:00
Dan Albert
4e030c4a3a Add explicit types where they aren't needed.
I have no idea why mypy is whining about this.
2022-02-16 17:04:25 -08:00
Dan Albert
4f73c47dcb Use explicit reference to app object for server.
I have no idea why the docs think strings are better. pyinstaller wasn't
able to detect the import through the string so the code ended up being
stripped from the package. Use an explicit import to prevent that.
2022-02-16 16:50:35 -08:00
Dan Albert
21f7912458 Add websocket event stream for sim updates.
As a proof of concept this only covers the flight positions.
2022-02-16 01:34:56 -08:00
Dan Albert
350f08be2f Add FastAPI interface between the game and map.
A possible explanation for the infrequent CTDs we've been seeing since
adding fast forward is that QWebChannel doesn't keep a reference to the
python objects that it passes to js, so if the object is GC'd before the
front end is done with it, it crashes.

We don't really like QWebChannel anyway, so this begins replacing that
with FastAPI.
2022-02-15 18:14:34 -08:00
C. Perreau
1df31b2496 Merge pull request #2013 from Starfire13/patch-1
Fixed 492nd FS using 335th FS's nickname
2022-02-15 11:47:00 +01:00
Starfire13
05ae78a671 Update 492nd FS.yaml
Fixed incorrect nickname. Looks like the nickname wasn't updated when the contents were copy-pasted over from the other squadron.
2022-02-15 20:58:07 +11:00
Dan Albert
6ebda41922 Replace debug QObject models with Pydantic.
This requires less duplication and paves the way for us replacing
QWebChannel with FastAPI, which in turn gets us closer to not needing
Qt.
2022-02-13 14:52:41 -08:00
Dan Albert
1adafac35f Make lines_to_leaflet tolerant of single lines. 2022-02-13 14:35:31 -08:00
Dan Albert
d488bcffbd Fix debug zones not updating on flight switch. 2022-02-13 14:35:30 -08:00
Dan Albert
f153e75f03 Fix default layer in debug mode. 2022-02-13 14:35:30 -08:00
Dan Albert
51961294dd Fix incorrect HoldZonesJs initialization. 2022-02-13 14:35:30 -08:00
MetalStormGhost
9f7f391609 Loaadouts for the Tornado GR4 2022-02-13 15:58:29 +01:00
MetalStormGhost
33ed127cba UH-60L mod support
Resolves #1964 but adding CTLD will require the use of Liberation plugins and thus are not included in this pull request.

- Implemented support for the UH-60L mod by =X51= Kinkkujuustovoileipa, Cubeboy, Jonas, JinxxDCS, Dorian, =X51= Parzival & =X51= Lawson.
- Because the standard DCS tankers will not fly below 160ish knots, the UH-60L mod team have included a modified version of the KC-130 tanker designed for refueling at speeds of 120-130kts.
2022-02-13 15:56:51 +01:00
Hornet2041
8a66bf2e09 Remove Fw A-8 and D-9 from Germany 1940/1942 faction 2022-02-13 12:33:37 +01:00
Dan Albert
2e901f3586 Replace some isinstance calls with TypeGuard.
These aren't as ergonomic as I'd hoped because of
https://www.python.org/dev/peps/pep-0647/#narrowing-of-implicit-self-and-cls-parameters.

I added a decorator `@self_type_guard` so we can avoid needing to import
the descendent types in the typeguard implementation (which wouldn't fix
any circular imports, just move them).
2022-02-12 14:59:44 -08:00
Dan Albert
85e7b1762d Upgrade to Python 3.10.
Shapely doesn't have a Windows wheel on pypi yet, but we can get them
from https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely. This unblocks
(and because wheels are matched to python versions, *requires*)
upgrading to Python 3.10.
2022-02-12 22:09:49 +00:00
Dan Albert
7c4d1e2f60 Speed up artifact upload with explicit zip.
GitHub has limits on the number of files that can be used with
upload-artifact, and it sounds like it will also be faster to compress
locally before uploading.
2022-02-12 21:52:07 +00:00
Dan Albert
5d0fa0fbb3 Update Python dependencies. 2022-02-12 21:40:33 +00:00
Dan Albert
011d8a4e12 Export airfield data to yaml, switch to ID keys.
This exports all the old AIRFIELD_DATA to yaml files. It's easier for
users to send fixes if it's defined this way, and they can also fix it
in their install without having to wait for a new release.

This also switches the indexes from the unstable DCS airfield names to
airfield IDs, so this fixes another case of DCS updates occasionally
breaking Liberation.

I also ended up finding quite a few typos in airfield names, and
incorrect theater names in the process. Those have been fixed.
2022-02-11 01:39:57 -08:00
C. Perreau
079f19a66e Merge pull request #1985 from bbirchnz/farp-stuck-helis
Add all helipads to single group per FARP allowing take off from parking behavour
2022-02-08 21:58:42 +01:00
Khopa
7a19a7d696 Removed version information from F10 map drawings layer 2022-02-08 20:36:52 +01:00
C. Perreau
c0890b2347 Merge pull request #2002 from dcs-liberation/fix_issue_1966
Fix issue 1966
2022-02-07 21:25:57 +01:00
Khopa
61c1d12a86 Fix #1966 : Refactored squadron default overrides in dedicated function 2022-02-07 18:14:35 +01:00
Khopa
dc0562b3be Fix #1966 : Naming; replaced female_pilot_ratio by female_pilot_percentage 2022-02-07 18:01:43 +01:00
Khopa
05d69ba003 Mypy fix 2022-02-06 23:11:29 +01:00
Khopa
ffedd2e1ad #1966 : Updated campaign file version & updated golan heights campaign with an example usage 2022-02-06 22:44:53 +01:00
Khopa
3932e28417 #1966 : Updated squadrons files with the new female_pilot_ratio parameters 2022-02-06 22:41:28 +01:00
Khopa
33a75b5450 #1966 : Added female_pilot_ratio param in squadrons. Also possible to force name or nickname for squadrons in campaign yaml files. 2022-02-06 22:41:27 +01:00
MetalStormGhost
a024be6b1d Don't reject exact fits when transferring squadrons.
Resolves #1952
2022-02-06 12:39:41 -08:00
SnappyComebacks
3987f26689 Add performance option to not cull threatening IADS (#1953)
- Don't cull EWRs in detection range.
- Don't cull SAMs within threat range + small buffer.
2022-02-05 18:38:25 -07:00
Tom Wabinski
ac5d20ff82 Add OCA/Runway loadouts for F-15E and F-16C.
Unguided bombs for the AI.
2022-02-04 12:57:37 -08:00
Dan Albert
9d14333cc0 Update pydcs. 2022-02-04 12:43:17 -08:00
Ben Birch
a70a951192 Add all helipads to single group per FARP allowing take off from parking behavour and fixes #1910 2022-01-30 15:04:53 +11:00
RndName
3afc6ba24b Add NASAM Radar and Launcher to radar_db
This will allow correct calculation of the threat range and prevent creating a threat zone when the SR is dead. #1978
2022-01-28 09:41:17 +01:00
MetalStormGhost
3231d008cc Tolerate empty TGOs in max_threat_range. 2022-01-27 00:43:31 -08:00
Dan Albert
205929bfc9 Log time spent running to first contact. 2022-01-24 18:24:28 -08:00
Dan Albert
8128b2ed17 Log mission generation time. 2022-01-24 18:20:34 -08:00
Dan Albert
32dd0f543a Log the time it takes to save the game. 2022-01-24 17:58:35 -08:00
Dan Albert
e80851b0a1 Impose minimum altitude for mid-mission spawns.
We had this for the old style in-flight spawns, but not for mid-mission
spawns. Aircraft that were spawning soon after takeoff could potentially
be close to (or under) the ground, causing them to "crash" at game
start. The altitude is different here than for the old style in-flight
spawns to try to get closer to the intended spawn location.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1941
2022-01-24 17:43:41 -08:00
Dan Albert
2499276b2a Fix helicopters at airfields breaking generation.
Helipads at airfields don't work well right now because they are not
counted as additional parking, but we should still allow them to take
off from the airfield parking.

Follow up work would be to fix the parking problem and allow adding
helipads to airfields, or maybe to just "ground" start helicopters at
airfields so they take off from parking rather than the runway.

May fix https://github.com/dcs-liberation/dcs_liberation/issues/1890
2022-01-24 17:17:00 -08:00
Dan Albert
f95795d547 Revert "Remove front line minimum distance."
This bug still isn't well understood and this made things worse.
Reverting until we understand the cause.

This reverts commit c844c364fa.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1912
2022-01-24 17:00:00 -08:00
SnappyComebacks
b3a3eb414a Typhoon GR4 and Typhoon IDS images (#1970)
* Add icons for Tornado GR4 and Tornado IDS.
2022-01-22 12:20:23 -07:00
Starfire13
0300b77ff5 Update bluefor_modern.json 2022-01-22 11:09:56 -08:00
RndName
93a0db3112 Add otion to ignore the empty install dir warning message
Adds a do not show again checkbox to the empty install dir warning popup on lib start. This only appears when the install dir is empty to prevent mission scripting replacement.

Also adds a warning message to the log when the dir is empty. Will help to identify this in bug reports.
2022-01-22 13:13:18 +01:00
Dan Albert
b312242cb8 Remind PR authors about the changelog.
I suspect we'll still be writing most of these ourselves, but might as
well point it out for the people that want to.
2022-01-16 14:02:05 -08:00
leemarov
5d291846d5 Fix unculled zones not updating when needed.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1034.
2022-01-16 13:54:09 -08:00
MetalStormGhost
7387c2ed8f Add support for the AI-only F-14A.
The AI for the flyable one is having issues firing AIM-54s. This allows
working around that.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1927.
2022-01-16 13:53:05 -08:00
SnappyComebacks
bf034e18eb Add preset formations to different flights and waypoints. (#1948)
* Update pydcs version.
* Add formation presets for various flight types.
2022-01-16 14:49:17 -07:00
dependabot[bot]
a97a4b2c15 Bump pillow from 8.3.2 to 9.0.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.3.2 to 9.0.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/8.3.2...9.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-12 19:56:36 -08:00
bbirchnz
4b99ae957e Improve unit system support in kneeboards.
* Factor out unit systems.
* Add support for more unit systems (nautical and imperial).
* Fuel units support.
* Data for many more aircraft.
2022-01-12 17:21:06 -08:00
MetalStormGhost
cd97565cce Commit JAS-39-C support update for v1.8.0-beta again 2022-01-12 20:22:26 +01:00
RndName
0106e1c64a Revert accidental wrong commit 2022-01-12 20:22:26 +01:00
RndName
420779fb4e Updated JAS-39-C mod support version v1.8.0-Beta
#1887
2022-01-12 19:59:02 +01:00
MetalStormGhost
11328ea241 Updated the Community A-4E-C mod support to version 2.0.0
Resolves #1897
2022-01-12 19:44:20 +01:00
MetalStormGhost
ecd2f2b6e5 Add missing HTTPS to pydcs URL. 2022-01-11 14:50:50 -08:00
Dan Albert
0036dca773 Update bug templates for 5.1.0. 2022-01-09 12:49:20 -08:00
bbirchnz
cefc36a6a9 Add aircraft property for Zulu time preference. 2022-01-08 21:37:57 -08:00
RndName
194b4dfd6b Update Iran factions / Revert previous changes
readded ZSU-57 and SA-17 as they can be used from the country even if dcs mission editor leaves the type empty / does not have them for the country.
2022-01-09 01:26:23 +01:00
RndName
d9b4342293 Fix the P-47D and P-51D radio definition
set the correct ChannelAllocator
from common to SCR-522)

#1925
2022-01-08 14:08:24 +01:00
bbirchnz
39152eab3c Add windsocks to FARPs, kneeboard improvements.
Kneeboard improvements:

* Optional (aircraft specific) metric speeds/distances/altitudes.
* Heading to waypoint.

Fuel still needs to be converted to metric, but good enough for now.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/915
2022-01-07 16:58:53 -08:00
Starfire13
eb6c187180 Update Vegas Nerve campaign 2022-01-07 17:46:54 +01:00
RndName
808db05d23 Fix threat range calculation
tThreat range calculation had a hidden bug which could possibly lead to wrong threat range calculation
2022-01-07 15:36:59 +01:00
RndName
795df1a93f Update Distance comparison operators
remove order=True and implement the comparison operators manually to fix typing error
2022-01-07 15:34:49 +01:00
RndName
54745e786e Fix incorrect threat range of SA-5
The SA-5 was not part of the radar_db.py and therefore the threat_range calculation was wrong / ever LN counted as threat even when the TR was dead. Also fixed a wrong unit for the SA-11 TELAR.
#1816
2022-01-07 14:41:01 +01:00
RndName
82dfeb8afa Update pydcs
Latest version with the new terrain from 2.7.9.18080
2022-01-06 21:20:21 +01:00
RndName
8df9f6989a Update for the nevada map update
Conflicttheater and Airfields needed an update as nearly all Nevada Airports were renamed with the last map update
2022-01-06 19:50:45 +01:00
Starfire13
19713e6159 Update campaign Exercise Vegas Nerve by Starfire 2022-01-06 18:00:37 +01:00
RndName
f526681f3d Update SA-5 Generator for factions without the TinShield
- added an EarlySA5Generator with the P-19 FlatFace SR which is supported by all factions
- allows factions without access to the TinShield to have a working SA-5
2022-01-05 01:08:09 +01:00
RndName
77edeac990 Add Igla manpad INS ground unit
Fix for Iran faction #1900
2022-01-04 23:51:33 +01:00
RndName
2c0d7c8e55 Campaign submission from Fuzzle
- new campaign Scenic Route 2 - Dust To Dust including NATO_OIF faction and 3 squadrons
- update for pacific repartee

#1898, #1902
2022-01-04 23:38:39 +01:00
RndName
5c0227b86f Update faction Iran 1988 & 2015
support for the latest pydcs export as some units were not usable by the country
2022-01-04 21:30:07 +01:00
RndName
8e5d7d9f20 Update changelog 2022-01-02 23:57:20 +01:00
MetalStormGhost
c844c364fa Remove front line minimum distance.
This isn't what it says. It doesn't enforce a minimum distance between
points, but a minimum path length, which isn't useful and isn't a
documented requirement.
2022-01-02 13:34:01 -08:00
RndName
4139258508 Cleanup the killed map objects recognition
removed the extra array to track killed_map_objects and reuse the existing killed_ground_units routine to remove duplicate code and possible confusion
2022-01-02 12:55:10 +01:00
Benjamin Fischer
2d07ef717c changed AWACS orbit to a racetrack (#1826)
* AWACS now orbits in a racetrack.

* Update AWACS racetrack length

* Increase AWACS threat spacing.
2022-01-01 19:05:28 -07:00
MetalStormGhost
383d1b2c9c Update multi-part Caucasus campaigns. 2022-01-01 16:22:11 -08:00
RndName
c31ace409f Update pydcs 2022-01-02 01:19:24 +01:00
RndName
8dbd2e2561 Revert "Bump Campaign version to 10.0"
This reverts commit 209afd3adf.
2022-01-02 01:19:24 +01:00
RndName
abe76ea003 Rework killed map_objects recognition
- removed the map_object_id from the TGO
- add a new TriggerRule with the MapObjectIsDead Condition which adds the map object to the killed_map_objects array in the state.json
- Use the trigger_zone_name as the unique identifier used for the unit_map to recognize the kill
2022-01-02 01:19:23 +01:00
SnappyComebacks
a013d27d17 Add ECM behavior to not Air to Air flights (#1879)
* If a plane has a jammer, and it is not an air to air flight it will jam between join and split.
2022-01-01 16:49:04 -07:00
MetalStormGhost
641c21627e Improved the F-104G CAP loadout.
Replace hydra pods with more AIM-9s.
2022-01-01 14:20:28 -08:00
Starfire13
1bad0f045e Added missing squadron nickname 2021-12-31 16:46:55 +01:00
RndName
209afd3adf Bump Campaign version to 10.0
with the latest dcs update the Object IDs were changed.
updated the campaign version for these campaigns i was able to check.

#1868
2021-12-31 16:30:52 +01:00
RndName
deb7227ce9 Fix Viggen FR22 group channel id and mention in changelog 2021-12-30 18:47:50 +01:00
RndName
abeebe9c8b Update Viggen radio presets for 2.7.9
the radio presets of the Viggen were changed with the recent dcs update, they will no longer be automatically generated so we have to add them manually
fixes #1883
2021-12-30 18:16:38 +01:00
RndName
81cbf807cb Update Fuzzle Campaigns
fixes #1855, fixes #1821
2021-12-30 11:05:56 +01:00
Dan Albert
4528233830 Add UI for setting flight properties like HMD.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/706
2021-12-25 15:04:49 -08:00
MetalStormGhost
5684570880 Updates for WW2 loadouts.
Major changes:
 - FW190A8 ground attack loadout WGr21 rockets (primarily an air-to-air weapon) replaced with SC500J or AB500 bombs.
 - FW190D9 WGr21 rockets replaced with R4M rocket packs and SC500 bombs for CAS.
 - Added droptanks for I-16.
 - Ju-88A4 CAS loadout changed for AB500 cluster bombs.
 - Mosquito now has rockets which were introduced in DCS World 2.7.9.17830 open beta
 - Added more/heavier bombs to P-47
 - P-51 now has a separate OCA/Runway loadout with bombs. Other ground attack loadouts switched to rockets.

Also includes an SA342Minigun loadout which we didn't previously have.
2021-12-25 12:16:34 -08:00
Dan Albert
c0dfa77d76 Add ECM pod to Viper A2G loadouts.
Didn't add to the A2A loadouts since the ECM interferes with radar
operation and is otherwise weight and drag. It does have a radar
priority mode though, so maybe it should be added there too?

https://github.com/dcs-liberation/dcs_liberation/issues/1868
2021-12-24 09:52:44 +00:00
Dan Albert
d81c6a0426 Update pydcs.
https://github.com/dcs-liberation/dcs_liberation/issues/1868
2021-12-24 01:34:11 -08:00
Dan Albert
656a98675e Rework sim status update to not need a thread.
Rather than polling at 60Hz (which may be faster than the tick rate,
wasting cycles; and also makes synchronization annoying), collect events
during the tick and emit them after (rate limited, pooling events until
it is time for another event to send).

This can be improved by paying attention to the aircraft update list,
which would allow us to avoid updating aircraft that don't have a status
change. To do that we need to be able to quickly lookup a FlightJs
matching a Flight through, and Flight isn't hashable.

We should also be removing dead events and de-duplicating. Currently
each flight has an update for every tick, but only the latest one
matters. Combat update events also don't matter if the same combat is
new in the update.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-23 17:46:24 -08:00
Dan Albert
43d5dc0528 Fix bad import. 2021-12-23 12:57:14 -08:00
Dan Albert
0c7d549e59 Add weapon data for the AN/ALQ-184.
https://github.com/dcs-liberation/dcs_liberation/issues/1868
2021-12-23 12:57:14 -08:00
Dan Albert
fc4022a76d Fix misclassification of the HTS as a TGP. 2021-12-23 12:57:13 -08:00
RndName
de87b4be92 Mention squadron config and f-104 mod in changelog 2021-12-23 13:25:54 +01:00
RndName
d2f7785f9f Finish implementation of add/remove squadrons from AirWingConfigurationDialog
Users can now add and remove squadrons with specific buttons. this also allows new aircraft types to be added as well.

- rebased existing PR to develop
- reverted observable and changed to signals
- changed the general concept so that changes only affect the ui data model and not the game directly. Game will only be updated on apply
- removed unused code
- adopt to review comments
- allow user to choose a predefined squadron preset (also alow none value to use the random generator)
- Reuse the squadron defs from the default assigner in the AirWing class
- allow user to re-roll the squadron nickname (also added new ui icons for the button)
2021-12-23 13:20:59 +01:00
Richard Pump
e4ba9a8b72 Added squadron configuration gui
- added add/remove buttons to Air Wing Menu, implemented remove
2021-12-23 13:20:41 +01:00
Starfire13
4803ae5f78 Fixed typo in squadrondefgenerator.py 2021-12-23 11:20:31 +00:00
Starfire13
d739d830ab Fixed typo in naming.py 2021-12-23 11:19:56 +00:00
MetalStormGhost
3626fa79b4 Re-add From Caen to Evreux campaign. 2021-12-22 14:16:11 -08:00
Dan Albert
dea2c883a7 Renormalize line endings. 2021-12-22 13:22:13 -08:00
Dan Albert
2193af1a95 Add .gitattributes file to enforce line endings. 2021-12-22 13:22:12 -08:00
MetalStormGhost
88bc4fd852 F-104 mod support. 2021-12-22 13:01:51 -08:00
Dan Albert
515efd0598 Draw frozen combat on the map.
Very basic display. Draws the engagement footprint for air-to-air
combat, a line from the flight to the target for IP, and lines from SAMs
to their target for air defense.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:56:25 -08:00
Dan Albert
fb10a8d28e Add frozen combat modelling.
This doesn't do anything yet, but sets up the data model handling for
frozen combat. The next step is to show combat in the map view, since
that will be helpful when debugging the step after that one: resolving
frozen combat.

This would benefit from caching the Shapely data for SAM threat zones.
Right now it's generating them once per tick and the stuttering is
visible at max speed.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:52:28 -08:00
Dan Albert
ce4628b64f Separate combat as a distinct flight state.
Will be used later to simulate combat.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
2021-12-21 14:52:27 -08:00
Dan Albert
d9108a7ca6 Update mypy and dependencies.
The newer version includes a partial fix for
https://github.com/python/mypy/issues/5485 (it doesn't fix the problem
for frozen dataclasses, but fixes other cases).
2021-12-21 14:51:45 -08:00
Dan Albert
8867aaeb6d Break up mapmodel.py monolith. 2021-12-21 13:01:24 -08:00
RndName
490a4e8097 Revert "Temporary Fix for broken upload action"
This reverts commit 697e2c2b11.
2021-12-21 09:34:56 +01:00
RndName
f9ed61d199 Enable / Disable game specific functions if no game is loaded
- Disable Save, Settings, Stats and Notes if game is none

fixes #1854
2021-12-20 13:55:05 +01:00
Dan Albert
61015b127e Add pull request template explaining branching. 2021-12-18 14:58:08 -08:00
Dan Albert
e99c36a21f Add links to the FAQ, manual, etc to the bug form. 2021-12-18 14:52:37 -08:00
Dan Albert
0608147cd9 Remove duplicate text in bug report template. 2021-12-18 14:42:42 -08:00
Dan Albert
c40f538782 Migrate bug report template to a form. 2021-12-18 14:41:18 -08:00
Dan Albert
3afaa90183 Fix syntax error in new game bug template. 2021-12-18 14:22:48 -08:00
Dan Albert
bdf2976a89 Add a new bug template for New Game bugs.
First attempt at using a bug form so we can use required fields.
2021-12-18 14:20:28 -08:00
RndName
697e2c2b11 Temporary Fix for broken upload action
The upload-artifact version 2.3 has problems with 0byte files and prevent the build action from beeing completed.
This temporary fix should be reverted when they fixed the bug.
2021-12-13 20:47:28 +01:00
RndName
c643adf57b Fix empty convoy when transfer is not completable
fixes #1553
2021-12-13 20:45:15 +01:00
RndName
2c21644a2c Add Easy Communication Setting
allow to enforce the mission setting for easy communication
implements #1425
2021-12-12 01:20:17 +01:00
MetalStormGhost
d11d3b58f7 Add option to limit convoy travel distances.
CPU load seems to scale with route length, so add an option to limit
the length of the convoy route. The tradeoff is that the performance
sensitive route won't necessarily be a correct route.
2021-11-27 01:40:06 -08:00
RndName
690705ff8f fix PySide Error
fix #1801 which was introduced with f3bf9c0
2021-11-26 09:20:34 +01:00
RndName
34100d1c76 Update UI when buy or sell raises exception
fixes #1562
2021-11-22 16:48:52 +01:00
RndName
676a25631b Generate unit_id for helipads
fixes mission scripting error (1748)
2021-11-22 15:05:12 +01:00
Dan Albert
9e92c87351 Revert "Update dependencies."
Seems to have broken the executable produced by pyinstaller. It doesn't
repro for me locally so figuring out which dep is the problem would take
ages. Reverting the whole thing to get to a clean state and will
revisit.

This reverts commit 66c8b96c9a.
2021-11-21 18:04:03 -08:00
Dan Albert
2a75d14e0e Revert upgrade to pyside6.
This appears to be incompatible with pyinstaller. I get the following
when trying to run the executable generated with pyside6:

```
Traceback (most recent call last):
  File "qt_ui\main.py", line 29, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "qt_ui\windows\QLiberationWindow.py", line 28, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "qt_ui\widgets\map\QLiberationMap.py", line 11, in <module>
ImportError: could not import module 'PySide6.QtPrintSupport'
```
2021-11-21 17:39:43 -08:00
Dan Albert
f3bf9c0c3c Silence some useless generation warnings. 2021-11-21 13:55:41 -08:00
Dan Albert
acd63fdeac Fix more not-cleared flight plan elements.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1745
2021-11-21 13:37:45 -08:00
Dan Albert
bc819d59f4 Prevent drawing flights that are being deleted.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1720
2021-11-21 13:21:25 -08:00
Dan Albert
8c2e25339f More Python 3.10 compat. 2021-11-21 11:30:39 -08:00
Dan Albert
ef73f712ec More Python 3.10 compat. 2021-11-21 11:28:51 -08:00
Dan Albert
08d670a882 Really fix the build. 2021-11-20 22:27:48 -08:00
Dan Albert
477d3fb197 Fix CI builds for PySide6. 2021-11-20 19:30:30 -08:00
Dan Albert
4a7dae9cc2 Upgrade to PySide6.
PySide2 renamed to PySide6 for Qt 6 support. It doesn't seem like
PySide2 is getting a 3.10 wheel, so upgrade to Qt 6 to prep for that.
2021-11-20 19:26:18 -08:00
Dan Albert
69649d7496 Vendor more map js/css. 2021-11-20 19:26:00 -08:00
Dan Albert
12f420f50e Pre-emptive Python 3.10 compat.
Iterator is no longer exposed directly in collections, but is in
collections.abc.
2021-11-20 18:49:14 -08:00
Dan Albert
66c8b96c9a Update dependencies. 2021-11-20 18:45:27 -08:00
Dan Albert
a51b3b4621 Note HTS support in the changelog. 2021-11-19 16:06:08 -08:00
Dan Albert
d69ebc728b Add weapon data and loadouts for the HTS.
Used in the default Viper DEAD and SEAD loadouts.
2021-11-19 16:05:03 -08:00
Dan Albert
f13795b743 Update pydcs.
HTS support.
2021-11-19 16:04:39 -08:00
Dan Albert
1dfc625f79 Clarify display of start times. 2021-11-18 23:25:59 -08:00
Dan Albert
0c731e4856 Fix start time used for the kneeboard.
The times we're given are an offset from the turn start, not the mission
start.
2021-11-18 23:13:48 -08:00
Dan Albert
9c0f72921f Randomly offset mid-mission spawns.
This is what we do for the old in-air starts too. It's not perfect but
it's not a regression either.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1754
2021-11-18 17:07:24 -08:00
MetalStormGhost
a94db0ec43 Add a new base banner for FARPs. 2021-11-18 16:58:46 -08:00
Dan Albert
0ff00acf9d Clarify the role of the faction aircraft list. 2021-11-14 18:56:36 -08:00
Dan Albert
45b7b4b2cb Fix incorrect radio range for AN/ARC-222.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1740
2021-11-14 13:34:32 -08:00
Khopa
59d178f99e Fixed mypy errors 2021-11-14 22:05:23 +01:00
Khopa
c59c87c3e8 Now displaying Liberation control points, paths, and frontlines in the mission editor / F10 map. (WIP) 2021-11-14 21:58:56 +01:00
Khopa
c21476b262 Fix #1718 : Remove Merkava IV from faction "Israel 1982" 2021-11-14 21:26:25 +01:00
Khopa
5b4d65db23 Fix #1717 : Removed SA5Generator from Iran 1988 faction 2021-11-14 21:20:12 +01:00
Khopa
b351551568 pydcs : Updated to latest pydcs master commit 2021-11-14 21:15:03 +01:00
Khopa
ea868b7079 SA5Generator : Added an ural truck to reload SA-5 sites 2021-11-14 21:14:35 +01:00
Dan Albert
613008b56e Fix typo. 2021-11-13 14:34:17 -08:00
Dan Albert
2ea2ecec94 Remove incompatible campaigns. 2021-11-13 11:20:06 -08:00
Dan Albert
a3038e75cf Add A-4E squadrons.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1716
2021-11-13 11:16:17 -08:00
Dan Albert
5dcd4580c3 Add IRIAF F-4E squadron.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1721
2021-11-13 11:12:09 -08:00
MetalStormGhost
68b48ad610 Update Marianas campaigns.
More FARPs to both Orote Point and Andersen Northwest Field.
2021-11-13 11:07:00 -08:00
SnappyComebacks
532ac261ff Ability to plan tanker recovery for strike like flights (#1729)
* Initial refueling definitions.

* Adding refuel definitions.

* Initial functionality changes

* Regenerate package when adding refueling flight.

* Recursively change package waypoint.

* Fix mypy errors.

* Regenerate flight plans when tanker is added to package.

* Give tanker better starting position on package recovery.

* Add TOT calculation for refueling waypoint.

* Timing changes to Strike split point and Refueling start time.

* Add correct waypoint builder for refuel in tarcap and sweep.  Remove restrict afterburner on refuel point.

* Always generate a refuel point for a package.

* Less arbitrary altitude in Refuel track start time calculation.

* Refueling waypoint no longer optional.

* Fix mypy gen error.

* Better discrimination of which tanker flight plan to make.

* Remove refuel tot calculations.

* Remove package regeneration on tanker flight addition.
2021-11-12 21:37:34 -07:00
Dan Albert
94f65d8f70 Drop a few unsupported campaigns.
Probably more coming but these are the ones that are confirmed not
happening before release.
2021-11-12 14:02:16 -08:00
Dan Albert
46e5299c60 Update Syria full campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1728
2021-11-12 13:42:36 -08:00
Starfire13
56e1eb33af Add files via upload 2021-11-12 12:33:55 -08:00
Dan Albert
753b301e88 Fix crash when creating packages.
I'm not sure if this is a symptom of the bug or if this is actually a
separate bug, but pushing this for now to make the bug less severe.

https://github.com/dcs-liberation/dcs_liberation/issues/1720
2021-11-07 19:25:38 -08:00
Dan Albert
2c14a140fe Highlight icons for selected flights.
https://spatialillusions.com/unitgenerator/ doesn't support generating
white icons AFAICT, so this was just the blue icon manually edited to
white.

https://github.com/dcs-liberation/dcs_liberation/issues/1704
2021-11-07 11:44:04 -08:00
Dan Albert
d31f0e22e3 Show the status of each flight in the UI.
https://github.com/dcs-liberation/dcs_liberation/issues/1704
2021-11-07 11:27:50 -08:00
Dan Albert
30cfd8a769 Don't rebuild the ATO model on selection change.
Much faster and avoids nasty concurrency issues between the JS and
Python side.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1719
2021-11-07 01:38:55 -07:00
Dan Albert
d645b4fe73 Update Pacific Repartee.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1707
2021-11-06 19:13:16 -07:00
Dan Albert
68c794f608 Update Caucasus multi-part Georgia.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1706
2021-11-06 19:12:35 -07:00
Dan Albert
475d18b701 5.0 changelog fixes. 2021-11-06 19:07:06 -07:00
Dan Albert
e9634b7066 Prevent assigning fixed wing squadrons to FARPs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1671
2021-11-06 18:34:23 -07:00
Dan Albert
c60bba1166 Fix crash when planning ferry flights.
At some point this needed to be type-only to resolve a circular import,
but that's fixed now.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1698
2021-11-06 17:36:43 -07:00
Dan Albert
35900c2350 Fix fixed wing squadrons retreating to FARPs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1615
2021-11-06 16:53:55 -07:00
Dan Albert
e6fc817f49 Use uncontrolled for late shore starts.
These should be uncontrolled rather than late activation so that they
are present in the parking area as OCA targets. This bug was introduced
as a mistranslation when I was moving from strings to StartType.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1695
2021-11-06 16:40:09 -07:00
Dan Albert
7a18d160c8 Add missing NavalControlPoint case for BAI.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1702
2021-11-06 16:35:04 -07:00
Dan Albert
a33104d7c4 Split runway attack list from strike list.
Not all strike aircraft are capable of runway attack, so copy the strike
list into the runway attack list and remove the incompatible aircraft.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1703
2021-11-06 16:25:14 -07:00
Dan Albert
7f57180da4 Update Skynet to 2.4.0.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1713
2021-11-06 16:21:52 -07:00
Dan Albert
a23e7fe83d Restore missing income multiplier labels.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1712
2021-11-06 16:19:27 -07:00
Dan Albert
c854508381 Updates for Syria full.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1675
2021-11-06 16:15:58 -07:00
Dan Albert
d1cf8915e3 Updates for Northern Russia.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1676
2021-11-06 16:13:42 -07:00
Dan Albert
d9b5b87f2b Check in Pacific Repartee campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1701
2021-11-06 16:13:18 -07:00
Dan Albert
5923ba21de Tell Qt that we actually want text to fit.
Why isn't this the default?

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1670
2021-11-03 19:23:54 -07:00
Dan Albert
8fe805bc68 Revert use of ABC in FlightPlan.
Mypy can't handle ABC dataclasses:
https://github.com/python/mypy/issues/5374
2021-11-03 17:32:05 -07:00
Dan Albert
1944a172a3 Fix NotImplementedError for some flight plans.
Implement custom behavior for some of the flight plans but also add a
base implementation that just returns the empty set.

Use ABC for FlightPlan so that we can fail-fast on these kinds of
problems.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1711
2021-11-03 17:28:13 -07:00
Dan Albert
de0b267568 Shut down the sim update thread on quit.
Otherwise the update thread just sits there waiting forever...
2021-11-02 23:59:08 -07:00
Dan Albert
03430a4df5 Update the UI to show sim state.
https://github.com/dcs-liberation/dcs_liberation/issues/1704
2021-11-02 23:34:51 -07:00
Dan Albert
87bf3110c8 Add play/pause features to the sim.
There's no UI feedback for this yet other than the log messages.

https://github.com/dcs-liberation/dcs_liberation/issues/1704
2021-11-02 23:34:51 -07:00
Dan Albert
748d80ff3b Re-flip fast-forward option.
This was set to default on by mistake (turned on for debugging and
forgot to turn off before check in). The option itself may be going away
soon in favor of explicit buttons, but keep the experimental feature off
by default for now.
2021-11-02 23:22:35 -07:00
Dan Albert
33f00fb811 Add E-2D variant of the E-2C.
In game this is an E-2D, but the ID of the aircraft in the game data is
E-2C. Presumably it was repainted at some point in a DCS update.

This adds a variant but doesn't delete the old one to avoid breaking
campaigns and factions. I moved blufor modern to the E-2D but the rest
of the factions are too old so we'll let them pretend.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1696
2021-10-30 15:25:36 -07:00
Dan Albert
ae99558f40 Document Su-33 carrier takeoff fix.
https://github.com/dcs-liberation/dcs_liberation/issues/1352
2021-10-30 15:16:46 -07:00
Dan Albert
85cbffb845 Update develop to 6.0. 2021-10-30 15:11:29 -07:00
Dan Albert
70dbe7c9ca Fix (presumable) accidental edit of A-4 pylons.
I'm not sure if this was a mistaken edit that the author made on check-
in or if we have a broken script that's generating these. For now I've
manually fixed it.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1574
2021-10-30 13:26:24 -07:00
ghost
2d0b5023c9 Update Marianas campaigns to use the Tu-142. 2021-10-30 13:25:04 -07:00
ghost
92fdd0b80d Enable anti-ship missions for the Tu-142.
This is the only mission type that the Tu-142 is capable of.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1683
2021-10-30 13:25:04 -07:00
Dan Albert
dac3533654 Tone down the out-of-parking message.
There's nothing the user can do about this and it's somewhat expected,
so downgrade to a warning so users don't think it's a bug.

If we ever get around to doing more cautious parking allocation this
should become a generation-halting error, but until then we expect it to
happen somewhat often.
2021-10-30 13:12:11 -07:00
Starfire13
2d93ac58fc Campaigns updated to 9.1
Peace Spring, Vectron's Claw, and Vegas Nerve have been updated to 9.1. Squadrons have also been completely overhauled to work much better, so there should no longer be a whole bunch of squadrons on OPFOR that are never used.
2021-10-30 13:05:29 -07:00
Starfire13
79924a59bc H-6J Loadout Update
Added loadouts for DEAD and OCA/Aircraft as those are default mission types for the H-6J.
2021-10-30 13:04:42 -07:00
MetalStormGhost
545f974552 Forcibly allow GPS for more non-US factions.
Enable unrestricted_satnav with non-US factions operating either the
F-16CM or the F/A-18C to allow the use of GPS in missions.
2021-10-30 13:03:47 -07:00
Dan Albert
2699a38f7b Use stored alignment for the F-14A.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1689
2021-10-30 13:01:53 -07:00
MetalStormGhost
13d52803d6 Use Chinese navy group generators for China.
Replaced Chinese factions' Type54GroupGenerator naval group generators with
ChineseNavyGroupGenerator to make Type 52B and Type 52C destroyers also
spawn besides frigates.
2021-10-30 12:58:59 -07:00
Dan Albert
1a3b8d1dd6 Reduce fuel for fast-forwarded player flights.
This only has an effect for aircraft for which we have fuel consumption
data, but that's fine.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 11:37:06 -07:00
Dan Albert
b2cbf4b6f4 Halt sim on A2A contact.
https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 10:18:49 -07:00
Dan Albert
9839787b6d Interrupt fast-forward on air defense contact.
https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-26 23:06:58 -07:00
Dan Albert
cd0c0f1b01 Fix missing waypoint generation for most flights.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1693
2021-10-26 19:29:50 -07:00
Dan Albert
5db1b94ac4 Add option to fast forward to first contact.
This is the first step in a larger project to add play/pause buttons to
the Liberation UI so the mission can be generated at any point.
docs/design/turnless.md describes the plan.

This adds an option to fast forward the turn to first contact before
generating the mission. None of that is reflected in the UI (for now),
but the miz will be generated with many flights in the air.

For now "first contact" means as soon as any flight reaches its IP. I'll
follow up to add threat checking so that air-to-air combat also triggers
this, as will entering a SAM's threat zone.

This also includes an option to halt fast-forward whenever a player
flight reaches a certain mission-prep phase. This can be used to avoid
fast forwarding past the player's startup time, taxi time, or takeoff
time. By default this option is disabled so player aircraft may start in
the air (possibly even at their IP if they're the first mission to reach
IP).

Fuel states do not currently account for distance traveled during fast
forward. That will come later.

https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-24 17:40:45 -07:00
Dan Albert
c8f30b3289 Split aircraft spawning into its own class. 2021-10-23 20:51:39 -07:00
Dan Albert
88b4039e47 Clean up AircraftGenerator.
This class does far too many things and the file is huge. Split it up
into a few more classes.
2021-10-23 20:18:40 -07:00
MetalStormGhost
49033f67f3 Added H-6J support for China 2010 and Iraq 1991.
Includes H-6J loadouts by @Starfire13

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1661
2021-10-23 16:58:27 -07:00
MetalStormGhost
410077467b Marianas campaigns 2.7.7.14727
Updated Marianas Mount Barrigada and Landing at Agat campaigns to DCS World 2.7.7.14727 open beta.
2021-10-23 12:20:55 -07:00
Dan Albert
14769c0350 Fix type errors with Flight.start_type in the UI.
Also reorders the enum so that iteration shows the order we want in the
UI by default.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1672
2021-10-23 12:19:20 -07:00
Dan Albert
b728fcc2d6 Clean up mission result handling. 2021-10-22 14:36:51 -07:00
Dan Albert
74291271e3 Move mission generation code into game.
Operation has been renamed MissionGenerator and is no longer a static
class.
2021-10-22 13:48:43 -07:00
Dan Albert
b0787d9a3f Build a proper type for StartType. 2021-10-22 11:42:13 -07:00
Dan Albert
be69d17345 Move Flight and its related components out of gen. 2021-10-22 11:30:28 -07:00
Dan Albert
52b9656a1a Remove no-op code.
We won't have set late activation until after this function is called,
and that part does it correctly by checking the player preferences.
2021-10-22 11:30:27 -07:00
Dan Albert
46bf952562 Add Forrestal support, use in US 1975.
https://github.com/dcs-liberation/dcs_liberation/issues/1657
2021-10-22 10:11:15 -07:00
Dan Albert
822d737f65 Adapt to pydcs update.
https://github.com/dcs-liberation/dcs_liberation/issues/1657
2021-10-22 00:13:33 -07:00
Dan Albert
d656ec3220 Update pydcs.
https://github.com/dcs-liberation/dcs_liberation/issues/1657
2021-10-22 00:10:20 -07:00
Dan Albert
a2140b915f Flip main/detail text boldness.
Emphasize the main item text and leave the fine print as fine print.
2021-10-21 22:27:35 -07:00
Dan Albert
6dae5b98d5 Fix carrier option not taking effect this turn.
This really shouldn't need to happen but I don't feel like rewriting the
culling code right now. There's no reason for these to be persisted to
the Game at all, we should be generating these once they're needed.
2021-10-21 20:05:07 -07:00
Dan Albert
626740366b Port the mission generator settings to auto.
Done now. Not porting the cheat menu because it contains non-settings
elements as well.
2021-10-21 19:54:58 -07:00
Dan Albert
a618f00662 Port the campaign management page to auto.
Also fixes the oversight in the previous commit where float options were
not saved when changed.
2021-10-21 19:16:47 -07:00
Dan Albert
7bec4c62f7 Generate settings pages automatically.
This adds metadata to settings fields that can be used to automatically
generate the settings window. For now I have replaced the Difficulty
page. Will follow up to replace the others.
2021-10-21 18:30:56 -07:00
Dan Albert
39fae9effc Update MissionScripting.original.lua.
We don't really even need this. Some cleanup of the replacer could just
keep the original contents in memory, but this will do for now.
2021-10-21 15:50:52 -07:00
Dan Albert
3c145cf2ff Updates for Fuzzle's campaigns and squadrons.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1664
2021-10-21 15:23:49 -07:00
Dan Albert
ad6f3ef8cc Update for Northern Russia campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1663
2021-10-21 15:22:18 -07:00
MetalStormGhost
79839f83a0 Change AI Su-33 carrier flights to "Takeoff from runway".
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1352
2021-10-20 19:11:22 +00:00
Johan Aberg
17011820de Fix crash if log window is open when entering mission.
Use signal to append text to LogWindow to avoid crash from crossing thread boundaries.
Change modal flag to enable interacting with LogWindow while the mission is running

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1493
2021-10-19 17:04:16 -07:00
Dan Albert
551ea728fc Update Skynet to 2.3.0.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1658
2021-10-18 17:02:14 -07:00
Dan Albert
d4f77f6588 Fix changelog sorting. 2021-10-18 17:01:32 -07:00
Dan Albert
8fe7551176 Update pydcs with radio preset fix.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1596
2021-10-18 16:57:43 -07:00
Dan Albert
e47276ce2e Fix config file name. 2021-10-17 19:50:15 -07:00
Dan Albert
fd1463eb4c Disable the blank issue template.
Why do we even have that lever?
2021-10-17 19:38:45 -07:00
Dan Albert
d5eaa4d091 Add a preferred_start_date for campaigns.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1079
2021-10-17 17:37:23 -07:00
Dan Albert
b174e668f4 Fix day being off-by-one on turn zero.
Doesn't have any real effect since no mission can be generated for that
turn, but shows up wrong in the top bar.
2021-10-17 17:33:29 -07:00
Dan Albert
fd49d213c2 Load custom campaigns from the user directory.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1311
2021-10-17 16:48:19 -07:00
Dan Albert
bbeb80fc48 Give aircraft purchase the majority of the window.
This makes long squadron names more likely to fit. I also added a
horizontal scroll bar for the cases when this still isn't enough space
and made the vertical scroll bar only appear when necessary. Typically
aircraft purchase menus are neither wide enough for long enough to need
either scroll bar.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1592
2021-10-17 13:28:02 -07:00
Dan Albert
702e29b54b Fix case of unused aircraft not spawning.
This function was exiting too early causing unused aircraft to stop
being spawned at *any* airfield as soon as the first full airfield was
found.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1566
2021-10-17 13:03:15 -07:00
Dan Albert
0fd911feb1 Fix some CAS planning quirks.
CAS would never be planned for turn 0 because there were no enemy ground
units, so a breakthrough attack was planned and CAS was considered
unnecessary. Fix that by rejecting all frontline stance tasks when there
are no *friendly* ground units to command.

Another issue is that CAS missions were being planned even when there
were no enemy front line forces. Skip planning in that case except on
turn 0 since we expect there to be enemy ground units on turn 1.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1629
2021-10-17 12:31:12 -07:00
Dan Albert
39234adff7 Update Allied Sword campaign miz.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1655.
2021-10-17 11:27:07 -07:00
Dan Albert
e45505b406 Note PR #1600 in the changelog. 2021-10-17 11:23:24 -07:00
Dan Albert
b1eb876572 Note PR #1646 in the changelog. 2021-10-17 11:21:45 -07:00
Dan Albert
7e66aa16f7 Fix submerged ammo depot in Black Sea.
Not sure if this was originally an accidental extra ammo depot or if it
was intended to belong to Sochi, but I've moved it to Sochi to increase
the difficulty at the first front.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1644
2021-10-17 11:16:40 -07:00
Dan Albert
35b30a01ed Fix flight resizing when switching aircraft.
No idea why we were only resetting this if the max was >= 2. Instead,
always reset the flight to the default size when switching aircraft. The
default for anything capable of a two-ship is two, but limit based on
the airframe's group size limit and the number of aircraft available.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1593
2021-10-14 21:03:55 -07:00
Dan Albert
76b3ff5f6e Override squadron base preferences when named.
This allows campaign designers to forcibly place specific squadrons at
bases that they would not normally be assigned to, such as assigning
CV-only squadrons to the shore. The airframe itself must be compatible
with the location type, so A-10s still may not be assigned to carriers.

This change only applies to squadrons that are named explicitly. There's
no need for squadrons defined by type because a squadron will always be
generated to fit the need if no pre-defined squadron is found.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1621
2021-10-14 20:49:18 -07:00
Starfire13
5e5f249bd2 Starfire's Campaigns 9.0 Update (#1654) 2021-10-13 22:51:13 -07:00
Dan Albert
ce57acb9d6 Update Fuzzle's campaigns and supporting content.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1651
2021-10-13 17:45:49 -07:00
MetalStormGhost
2a79e4a4e5 Force carrier planes to start at +1s (#1600)
Forces carrier planes with original start_time of zero seconds to have a start time of 1 second. This will prevent them from spawning on the 'sixpack' and functions as a workaround for a DCS problem (deadlock / traffic jam).

Fixes #1309.
2021-10-13 17:10:17 -07:00
ghost
7f948465a4 Added a missing call to commit_cargo_ship_losses when committing mission results, fixing a problem which caused lost ground units on sinked cargo ships to not register. 2021-10-13 17:04:49 -07:00
ghost
a24ab63fc7 Changed "range" to "max_range" on several aircraft .yaml files since that is the key which is actually evaluated in the code. 2021-10-13 17:03:59 -07:00
MetalStormGhost
643718be23 Two Marianas Guam campaigns (#1652)
This PR contains two new campaigns for the Marianas terrain, depicting capture of the island of Guam. The first has BLUFOR start after landing at Agat and requires a carrier/LHA capable BLUFOR faction, because there are no land based airbases captured initially. The second has about half of the island already in control, enabling BLUFOR land based aircraft to operate from Antonio B Won Pat (and can also be used by WWII factions). Both campaigns support inversion.

Credit to Dank Williams, the campaigns were heavily inspired by his Marianas insurgency campaign and contain some ground units placed by him, used with permission of course.

They are by no means historical and contain a relatively large number of FOBs compared to only having two airfields. The routes zig-zag a bit since space is limited on the island and I had to place the FOBs far enough from each other to clear the capture zone radius.

The two other airfields on Guam, Orote and Andersen Northwest Field, have FARPs, enabling helicopter operations as well as rearming and refueling for player fixed wing flights (but no mission starts or AI takeoffs).

Included are also two WWII factions which don't require the WWII asset pack. The "Japanese" faction consists of German/Russian equipment with stock Japanese liveries.
2021-10-13 17:01:54 -07:00
C. Perreau
d4d6ee3d26 Merge pull request #1645 from MetalStormGhost/mi24_hind_campaign_squadrons
Changed the Mi-24 squadrons of 2 campaigns
2021-10-12 22:29:57 +02:00
Khopa
4399e10cef SA-5 support 🚀 2021-10-12 22:26:59 +02:00
ghost
519f0542dd Changed the Mi-24 squadrons of 2 campaigns from:
- Mi-24P Hind-F
        - Mi-24P Hind-E
to:
        - Mi-24P Hind-F
        - Mi-24V Hind-E
fixing a problem which caused Mi-24V no not show up in the campaign.
2021-10-08 20:42:28 +03:00
Khopa
9456fd77d1 Updated Mozdok to Maykop campaign to v9 2021-09-21 22:27:50 +02:00
Khopa
37874d82f2 Pydcs : Switched to the pydcs version from the official repo 2021-09-21 21:24:44 +02:00
Khopa
9f2a9bf458 pydcs version : Use temporary version with mosquito flyable fix 2021-09-19 23:30:57 +02:00
Khopa
43a8897c28 Added MosquitoFBMkVI support (use campaign operation dynamo) 2021-09-19 02:05:08 +02:00
Khopa
6980f96697 JAS-39 mod : removed reference to a weapon class that was removed in last update 2021-09-18 18:51:54 +02:00
Khopa
4ffb294d65 Update pydcs version 2021-09-18 18:01:17 +02:00
C. Perreau
ae46631b2b Merge pull request #1622 from teamMOYA/banners_icons
Banners and icons
2021-09-18 17:49:07 +02:00
teamMOYA
c42bdd256f fix wrong extension 2021-09-18 15:32:42 +02:00
teamMOYA
8990e0c1ff leopard-2A4 banner fix 2021-09-18 15:27:09 +02:00
teamMOYA
f26452c07d vehicle banners 2021-09-18 15:10:44 +02:00
teamMOYA
89789f16d2 f-86 icon fix 2021-09-18 15:09:05 +02:00
teamMOYA
3bb4c9c29a aircrafts banners 2021-09-16 22:26:17 +02:00
teamMOYA
3b8e392395 aircrafts icons 2021-09-16 22:24:47 +02:00
Magnus Wolffelt
3e6d63e8f7 Fix random heading function, randomize wind better (#1619)
* Fix random heading function, randomize wind better

* Use 359 as max default for random heading, for uniform distribution
2021-09-16 12:29:00 +02:00
Khopa
90ca619839 Load red static group to define helipads for farp 2021-09-14 22:22:46 +02:00
Starfire13
8c2aa78b9f Add missing data to Frenchpack technicals. 2021-09-10 15:34:57 -07:00
Starfire13
e544b2d1ba Mirage Squadron Mission Types Fix (#1607)
* Update ADA_EscadronDeChasse_1-30_Alsace.yaml

* Update ADA_EscadronDeChasse_2-5_IleDeFrance.yaml

* Update ADA_EscadronDeChasse_1-12_Cambresis.yaml
2021-09-09 09:52:26 -04:00
C. Perreau
82f5287282 Merge pull request #1183 from dcs-liberation/helipads
[WIP] Add possibility to add helipads to FOB control points
2021-09-08 22:54:05 +02:00
C. Perreau
589a353f02 Merge pull request #1603 from teamMOYA/bugfix/helicopter_carrier-Type_071
fix for Type_071 helicopter carrier
2021-09-08 22:47:37 +02:00
Khopa
e84e36fd22 Merge remote-tracking branch 'khopa/develop' into helipads
# Conflicts:
#	changelog.md
2021-09-08 21:56:45 +02:00
dependabot[bot]
a4b03c5cfe Bump pillow from 8.2.0 to 8.3.2
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.2.0 to 8.3.2.
- [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.2.0...8.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-07 20:00:45 -07:00
teamMOYA
6aee4c2ec4 fix for Type_071 helicopter carrier
fixed bad name for Type_071 helicopter carrier
2021-09-07 11:59:36 +02:00
Starfire13
65abef7979 Update squadrondefgenerator.py 2021-09-07 02:37:25 -07:00
Dan Albert
45b52f4dea Remove auto-loss on front line for skipped turns. 2021-09-05 21:19:36 -07:00
Dan Albert
18336f58d3 Minor cleanup of notification system. 2021-09-05 21:15:32 -07:00
Dan Albert
12ad4fbf63 Note the FC3 laser codes in the changelog. 2021-09-05 02:13:13 -07:00
MetalStormGhost
b1fee9fe56 Add an option to use FC3-compatible laser codes.
FC3 aircraft don't have laser codes like all the other aircraft do, they just use 1113.
2021-09-05 02:10:24 -07:00
Dan Albert
2a6f250706 Fix transcription error in Abu Dhabi. 2021-09-04 14:20:29 -07:00
Dan Albert
ab2bb6814e Clean up aircraft allocation and procurement.
This also does improve the over-purchase problems, though I can't spot
the behavior change that's causing that. Presumably the old
implementation had a bug I can't spot and in rewriting it I solved the
problem...

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1582
2021-09-03 17:08:32 -07:00
Dan Albert
94fb0d8c66 Don't create squadrons for removed bases. 2021-09-03 15:25:34 -07:00
Dan Albert
a192e4c872 Allow showing the enemy aircraft inventory. 2021-09-03 13:56:03 -07:00
Dan Albert
99acd52e89 Increase some range estimates.
These are still fairly pessimistic because the AI loves afterburner, but
less so.
2021-09-03 13:33:15 -07:00
Dan Albert
a1ee9d7476 Add more aircraft range estimates. 2021-09-03 13:23:23 -07:00
Dan Albert
757363e372 Fix JSON -> YAML translation error in Black Sea. 2021-09-03 13:14:38 -07:00
Dan Albert
7d0b3a096d Update Abu Dhabi. 2021-09-03 13:14:16 -07:00
Starfire13
24a0211d8c Update naming.py 2021-09-02 04:06:44 -07:00
Dan Albert
2c8f960696 Prevent creating empty ferry packages.
An empty squadron or a fully-assigned squadron won't have anything to
assign to the ferry mission.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1588
2021-09-01 19:22:37 -07:00
Dan Albert
16d397db1c Fix unit info menus for aircraft.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1586
2021-09-01 19:22:37 -07:00
Dan Albert
9c3171f1ce Sort the animal names list.
Make it easier to figure out what's already there.
2021-09-01 18:01:53 -07:00
Dan Albert
8a60fa5c83 Fix errors when changing task or aircraft type.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1587
2021-09-01 17:14:51 -07:00
Magnus Wolffelt
15ce48e712 Arm the ferry viper :) (#1584) 2021-09-01 21:56:11 +02:00
Dan Albert
c252fd6a77 Add a ferry loadout for the viper. 2021-08-31 23:13:02 -07:00
Dan Albert
90a8bb63dc Fix AI landing behavior.
The landing waypoints need the airdrome_id field set to actually
associate with the airfield. Without this ferry flights will take off
and immediately land at their departure airfield.
2021-08-31 23:06:20 -07:00
Dan Albert
1a4be911c0 Implement ferry flights for squadron transfers.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-31 23:03:27 -07:00
Dan Albert
f9f0b429b6 Set the flight airfields based on the Squadron. 2021-08-31 22:14:00 -07:00
Dan Albert
a404792bd2 Reset the max flight size when changing squadrons. 2021-08-31 22:10:23 -07:00
Dan Albert
e0047b1bbc Move the start type requirement into ControlPoint. 2021-08-31 22:09:39 -07:00
Dan Albert
18eb661e84 Merge branch 'squadron-relocation' into develop 2021-08-29 16:22:02 -07:00
Dan Albert
c2e5cba061 Implement manual squadron transfers.
Lightly tested but seems to work fine.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-29 16:21:54 -07:00
Dan Albert
cd15de6d42 Add an uncaught exception handler. 2021-08-29 16:21:54 -07:00
Mustang-25
60a5ee42fe Adds Most Default USN F-14A & B Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
46e2d8c1f9 Adds All Default USAF F-15E Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
824745c11d Adds All Default A-10C I & II Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
33709b0558 Adds All Default USAF F-15C Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
aac91c15d9 Adds AEW&C Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
67405e4af5 Adds Tanker Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
41aa743947 Adds all default USAF Viper Squadrons 2021-08-29 15:26:44 -07:00
Mustang-25
7aca108ef5 Adds Russian VVS Mig-29S Squadrons 2021-08-29 15:26:44 -07:00
Dan Albert
380d6bf47a Fix weird wrong default campaign field bug.
I tried fixing this using setField after registering it, but it does
nothing. I suspect this is because the page hasn't been registered with
the wizard yet so it's setting the field for the wrong wizard.
2021-08-29 02:17:10 -07:00
Dan Albert
8fea8e7b47 Move squadron end-turn behavior into the squadron. 2021-08-28 18:03:33 -07:00
Dan Albert
469b1e5efe Reimplement aircraft retreats for captured bases. 2021-08-28 18:02:11 -07:00
Dan Albert
5fae178081 Reduce squadron location bookkeeping. 2021-08-28 17:59:56 -07:00
Dan Albert
4715773bba Store the owning coalition in ControlPoint.
This is needed fairly often, and we have a lot of Game being passed
around to ControlPoint methods specifically to support this. Just store
the owning Coalition directly in the ControlPoint to clean up. I haven't
cleaned up *every* API here, but did that aircraft allocations as an
example.
2021-08-28 16:40:55 -07:00
Dan Albert
74577752e0 Update pydcs for the Viper CBU-105. 2021-08-26 23:59:29 -07:00
Magnus Wolffelt
056e6b28da Simplify and rename TACAN registry reserve function (#1559)
* Simplify and rename TACAN registry reserve function

* Remove unused tacan error
2021-08-18 14:46:55 +02:00
Nils Heiden
0cb10e4224 Make the Mi-24 LHA capable. 2021-08-17 17:00:16 -07:00
Magnus Wolffelt
34ff5fbc6a Allow operation.py to ignore TACAN rules 2021-08-18 00:06:34 +02:00
Magnus Wolffelt
f63a35b1fa Use TACAN channels more selectively, use pytest (#1554)
* Use TACAN channels more selectively

* Increase tacan range to 126

* Use pytest and add workflow

* Skip faction tests due to outdated test data

* Run mypy on tests directory also

* Use iterators for bands AND usages, add tests
2021-08-17 23:14:54 +02:00
Khopa
57e78d5c55 Added squadrons for Syria & Israel 2021-08-16 19:47:40 +02:00
Khopa
2ee604d2a4 Fixed : Missing icons for E-2C Hawkeye 2021-08-16 19:47:38 +02:00
Khopa
a7c3a0f7fd Added squadrons for Syria & Israel 2021-08-16 19:47:00 +02:00
Khopa
5445c41f81 Fixed : Missing icons for E-2C Hawkeye 2021-08-16 19:45:43 +02:00
Khopa
e1e1e471a1 Added comment on total_aircraft_parking 2021-08-16 19:37:21 +02:00
Khopa
2e3b43b28b Allow both FARP SINGLE_HELIPAD, and Invisible FARP in campaigns files. 2021-08-16 13:27:41 +02:00
Khopa
fe118d81db Fixed error introduced during last merge. (Missing import) 2021-08-16 13:04:58 +02:00
Khopa
d3b2a751e2 Golan heights campaign migrated to v 9.0 2021-08-16 12:58:26 +02:00
Khopa
b856a84adc Ran black to fix lint issue. 2021-08-16 12:23:51 +02:00
C. Perreau
707d13a65c Merge branch 'develop' into helipads 2021-08-16 12:20:43 +02:00
Magnus Wolffelt
7417429fdb Merge pull request #1552 from dcs-liberation/better-tarcap-racetracks-2
Better TARCAP racetracks
2021-08-16 11:52:50 +02:00
Magnus Wolffelt
8f5b6f58d1 Add rmul to distance and speeds, so that reversed operands work 2021-08-16 10:38:26 +02:00
Magnus Wolffelt
08365bcbda Simplify and enhance tarcap flight planning 2021-08-16 10:37:44 +02:00
Dan Albert
4423288a53 Assign aircraft to squadrons rather than bases.
This is needed to support the upcoming squadron transfers, since
squadrons need to bring their aircraft with them.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-15 17:42:56 -07:00
Dan Albert
99274133ff Add range estimates for the F-15s. 2021-08-14 21:51:25 -07:00
Dan Albert
55c6728c42 Update Black Sea to campaign version 9.0. 2021-08-14 21:51:01 -07:00
Dan Albert
357487b767 Remove random purchase pessimization.
Aircraft variety is now handled by explicit squadron selection, so no
longer needed.
2021-08-14 21:46:27 -07:00
Dan Albert
9768fb3493 Add base selection UI to startup.
https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-14 21:46:27 -07:00
Dan Albert
90ad1f4a61 Change squadrons to operate out of a single base.
https://github.com/dcs-liberation/dcs_liberation/issues/1145

Currently this is fixed at the start of the campaign. The squadron
locations are defined by the campaign file.

Follow up work:

* Track aircraft ownership per-squadron rather than per-airbase.
* UI for relocating squadrons.
* Ferry missions for squadrons that are relocating.
* Auto-relocation (probably only for retreat handling).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1138
2021-08-14 21:46:27 -07:00
Dan Albert
51e056a765 Convert Black Sea to yaml. 2021-08-14 20:15:05 -07:00
Dan Albert
8e1b33bc51 Add range info for some Russian aircraft. 2021-08-14 20:12:33 -07:00
Dan Albert
d2e22ef8bf More campaign loader cleanup. 2021-08-14 13:39:27 -07:00
Magnus Wolffelt
103675e5bb Make some paths cross-platform compatible (#1543)
* Make some paths cross-platform compatible

* Fix lint error for Path
2021-08-14 21:45:23 +02:00
RndName
b5b0d82a1a Open all files with utf-8 encoding
- will not be used for binary read/writes (rb,wb)!
- prevents a bug where units with special characters in the unit name can not be tracked anymore as there will be a name mismatch due to wrong encoding
2021-08-14 13:10:43 +02:00
Magnus Wolffelt
c80d0e5378 Raise helo AGL to 60 m for ingress, egress, cap, escort (#1542) 2021-08-14 00:54:48 +02:00
RndName
adeebbc422 Enable sell button according to available aircraft
also added a tooltip which gives the user the hint that maybe the aircraft is assigned to mission and therefore the button is disabled
2021-08-12 22:06:48 +02:00
RndName
ee8e8d4a9a Fix selling of units not visible
allow pending_deliveries to become negative again but still delete the delivery when the amount of a specific unit_type comes to exactly 0 to prevent emtpy group sizes
2021-08-12 19:42:40 +02:00
RndName
bc5ffdec8e EWR heading towards conflict
implements #1530
2021-08-11 20:58:54 +02:00
Dan Albert
88d52003b3 Allow using yaml for campaign definitions.
JSON continues to be supported as well. No additional work needed here,
just needed to allow both.
2021-08-10 18:21:52 -07:00
Dan Albert
6c7b62b8b1 Move MizCampaignLoader out of conflicttheater.py.
Also removes the useless `size` and `importance` fields from
`ControlPoint`.
2021-08-10 18:21:26 -07:00
Magnus Wolffelt
37491ceffb Stop using Su-34 for CAP missions, update changelog 2021-08-10 13:38:35 +02:00
Magnus Wolffelt
b3dedbdf75 Update changelog with sam site heading fix 2021-08-10 13:32:58 +02:00
Magnus Wolffelt
42d09292b7 Update changelog with Marianas fix for 4.1.1 2021-08-10 13:32:12 +02:00
Dan Albert
c80293d9e0 Add a bug template for mod support requests. 2021-08-08 12:58:04 -07:00
RndName
b31c09c4ff 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 13:16:39 +02:00
Dan Albert
91daabc9d2 Fixup auto-assignable tasks when limits change.
The air wing config was fixing the main `mission_types` field, but the
`auto_assignable_mission_types` property had already been set. Update
that field whenever the `mission_types` are changed.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1515
2021-08-07 14:04:32 -07:00
Kangwook Lee
def5454e5f Add battle damage assessment option 2021-08-07 13:11:10 -07:00
Kangwook Lee
74e6226d13 Fix typo 2021-08-07 13:03:13 -07:00
Kangwook Lee
72d83e2fe4 Reorganize setting fields to match UI 2021-08-07 13:00:22 -07:00
Dan Albert
85ccbf34c7 Add fuel esimtations for the Viper. 2021-08-06 19:24:07 -07:00
Khopa
5e715daded Changed helipad generation structure as to not impact "Game" object, as suggested by Dan. 2021-08-07 01:05:57 +02:00
Khopa
5412487178 Handle another error case in generate_at_cp_helipad + align helos heading with their slot 2021-08-07 00:38:12 +02:00
Khopa
c4937e95e9 Refactored the helipad generation code in a dedicated method "_generate_at_cp_helipad" + better error handling + removed useless temp variables 2021-08-07 00:16:07 +02:00
Khopa
4f53e2beea Fixed another minor issue with the PR 2021-08-07 00:12:55 +02:00
Khopa
9ea1edf9db Applied minor requested changes 2021-08-06 23:55:58 +02:00
Khopa
ce1c416b20 Revert version bump for campaign that do not use helipads 2021-08-06 23:28:36 +02:00
Magnus Wolffelt
fdbc3c55c7 Add weather changes to changelog (#1513)
Co-authored-by: Magnus Wolffelt <magnus.wolffelt@avanza.se>
2021-08-06 18:17:46 +02:00
Magnus Wolffelt
71559154a8 Cherry-pick cap/helo changelog from 4.x (#1512)
* Changelog updates for 4.x.

Regarding patrol speeds and helo fix.

* 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-06 18:01:24 +02:00
Dan Albert
07f8a203ea Remove abandoned campaigns. 2021-08-05 19:32:52 -07:00
RndName
b67fd16081 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-05 22:09:53 +02:00
Magnus Wolffelt
9792c17c69 Make arid theaters more likely to have clouds, and tweak others sliiightly (#1501) 2021-08-05 13:54:42 +02:00
Magnus Wolffelt
8488a5ec1a Use AGL altitude for helo hold (#1499) 2021-08-05 13:52:33 +02:00
Dan Albert
ff571db494 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
2021-08-04 23:33:22 -07:00
Kangwook Lee
aaa932f725 Update freq list for ARC-210 2021-08-04 20:40:47 -07:00
Kangwook Lee
c58ecd96f0 Make Radio dataclass store list of ranges 2021-08-04 20:40:47 -07:00
Kangwook Lee
8608b73009 Wrap lines for NotesPage 2021-08-03 17:53:01 -07:00
Magnus Wolffelt
30801dff9f 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-03 12:22:55 +02:00
Khopa
912311ad55 changelog update 2021-08-03 01:32:10 +02:00
Khopa
14615f9976 Bump campaign miz file version for helipad support 2021-08-03 01:10:00 +02:00
Khopa
9121cf7ecb Fixed icons not appearing in UI for Mi-24V, Tu-95 and Tu-142 2021-08-03 01:05:27 +02:00
Khopa
a831800a05 Fixed mypy errors 😒 2021-08-03 01:00:56 +02:00
Khopa
399c739fd7 Fixed mypy errors 2021-08-03 00:51:47 +02:00
Khopa
63f687a20e Fixed mypy errors in gen 2021-08-03 00:42:49 +02:00
Khopa
fbd0198771 Fixed mypy errors 2021-08-03 00:37:26 +02:00
Khopa
00e85280fd Golan heights campaign updated with helipads. 2021-08-03 00:29:06 +02:00
Khopa
5b37698d36 Fixed mypy errors 2021-08-03 00:28:22 +02:00
Khopa
483640b0c6 Fixed errors after merge on helipad feature. 2021-08-03 00:15:14 +02:00
Khopa
1e96aad484 Fixed icons not appearing in UI for Mi-24V, Tu-95 and Tu-142 2021-08-02 23:51:56 +02:00
Khopa
b88e0e8a52 Merge branch 'develop' into helipads
# Conflicts:
#	resources/squadrons/A20/no_107_squadron_raf.yaml
#	resources/squadrons/SpitfireLFMkIX/no_145_squadron_raf.yaml
#	resources/squadrons/SpitfireLFMkIX/no_16_squadron_raf.yaml
2021-08-02 22:05:36 +02:00
Khopa
6028009aac Added RAF clipped wing spitfire squadron 2021-08-02 22:00:17 +02:00
Khopa
9aa9b72557 Fixed issue with previously added squadrons 2021-08-02 21:57:50 +02:00
Khopa
8c023c5727 Added Ju-88A4 squadron 2021-08-02 21:57:27 +02:00
Khopa
d9edaede89 Added FW-190D9 squadron 2021-08-02 21:57:10 +02:00
Khopa
0220b37c2d Added FW-190A8 squadron 2021-08-02 21:57:00 +02:00
Khopa
f2d2d1cc8d Added Bf-109K4 squadron 2021-08-02 21:56:47 +02:00
Khopa
437eeef9a0 Fixed icon not showing for Ju 88 A-4 2021-08-02 21:15:22 +02:00
Khopa
8e4f291389 Added Spitfire LF Mk IX's squadrons for RAF 2021-08-02 21:08:07 +02:00
Khopa
8f27222b07 Added A-20G squadron for RAF 2021-08-02 21:08:05 +02:00
Khopa
9e05991908 Fixed issue with livery in custom M2000-C squadron 2021-08-02 21:08:05 +02:00
Khopa
1c76bf93a2 Added Spitfire LF Mk IX's squadrons for RAF 2021-08-02 20:00:14 +02:00
Khopa
d5cedee6c5 Added A-20G squadron for RAF 2021-08-02 19:59:13 +02:00
Khopa
eb1b7176a6 Fixed issue with livery in custom M2000-C squadron 2021-08-02 19:46:07 +02:00
Khopa
71143536bf Merge branch 'develop' into helipads
# Conflicts:
#	game/game.py
#	game/operation/operation.py
#	game/theater/conflicttheater.py
#	game/theater/controlpoint.py
#	gen/groundobjectsgen.py
#	resources/campaigns/golan_heights_lite.miz
2021-08-02 19:34:05 +02:00
Khopa
f2608cecd5 Campaign Update 8.0 : operation_dynamo.miz, updated mission targets ids 2021-08-02 19:24:34 +02:00
Khopa
c95d5464d8 Campaign Update 8.0 : golan_heights_lite.miz, updated mission targets ids 2021-08-02 19:21:09 +02:00
Khopa
0ac7466a81 Campaign Update 8.0 : caen_to_evreux.miz, updated mission targets ids 2021-08-02 19:15:31 +02:00
Kangwook Lee
77e62d5a54 Fix text foreground color for dark kneeboard 2021-08-01 23:37:10 -07:00
Dan Albert
bef015eb57 Changelog updates for 4.x. 2021-08-01 17:27:01 -07:00
Kangwook Lee
d99d95217f Remove console window 2021-08-01 15:42:14 -07:00
Kangwook Lee
5cbf8db272 Add QLogsWindow 2021-08-01 15:42:14 -07:00
Kangwook Lee
6ee0c7600b Add HookableInMemoryHandler logging handler 2021-08-01 15:42:14 -07:00
Magnus Wolffelt
6621421a6f Tweak max-speed-based patrol altitudes 2021-08-01 15:21:32 -07:00
Dan Albert
edf95ea9fb Dedup purchase requests.
Since the theater commander runs once per campaign action, missions that
do not have aircraft available may be checked more than once a turn.
Without deduping requests this can lead to cases where the AI buys
dozens of tankers on turn 0.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1470
2021-08-01 15:17:43 -07:00
Magnus Wolffelt
a3e3e9046f Estimate preferred patrol altitude based on max speed 2021-08-01 12:15:15 -07:00
RndName
04cdb6fbfc fix for wrong patrol speed 2021-08-01 12:05:28 -07:00
bgreman
8c7e56a2bd Update skynet plugin (#1478) 2021-08-01 11:36:37 -04:00
Dan Albert
3e08574fbe Reduce the size of kneeboard non-table text.
The bullseye and weather data were looking a bit more like headers than
content.
2021-07-31 16:54:00 -07:00
Dan Albert
73ba7933da Assign laser codes to players with TGPs.
This doesn't configure the bombs in the mission or anything yet; it only
pre-assigns a laser code for the player to use if they choose to.
2021-07-31 16:49:58 -07:00
bgreman
fc45c3b98c Fixes an unlikely bug with JTAC laser code allocation (#1477)
* Fixes an unlikely bug with JTAC laser code allocation, allows for future allocation of codes to a/c with TGPs

* Fixing typing issues

* Changelog
2021-07-31 18:44:16 -04:00
Mustang-25
0d6f420f97 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
2021-07-31 14:57:49 -07:00
Dan Albert
bef85963a6 Update USN 2005 faction.
https://github.com/dcs-liberation/dcs_liberation/issues/1427
2021-07-31 14:47:13 -07:00
Dan Albert
3be57efa97 Campaign updates from Starfire. 2021-07-31 14:40:38 -07:00
Dan Albert
981d8510c2 Ack new campaign version for unaffected maps. 2021-07-31 14:37:49 -07:00
Dan Albert
5d8f655243 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.
2021-07-31 14:23:46 -07:00
Dan Albert
0cb41469ab Update pydcs to latest master.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
2021-07-31 13:54:17 -07:00
Dan Albert
971d7e730a Add ALIC codes for the tin shield and NASAMS.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
2021-07-31 13:53:04 -07:00
Dan Albert
06f8b9b817 Update the F-16 DEAD loadout to use JSOWs.
https://github.com/dcs-liberation/dcs_liberation/issues/1448
2021-07-31 13:48:02 -07:00
Dan Albert
db51384b63 Add auto-generation warning to files. 2021-07-31 13:40:04 -07:00
RndName
ac088ea692 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)
2021-07-31 13:27:48 -07:00
Dan Albert
2a5793e8ce Fix display of AEW&C channel on the kneeboard. 2021-07-31 13:04:42 -07:00
Dan Albert
6c60ff88a3 Fix intra_flight_channel filter syntax. 2021-07-31 13:00:14 -07:00
Dan Albert
8d68c10905 Set up JTAC channel assignments. 2021-07-31 13:00:14 -07:00
bgreman
119d4b9514 Vendor ruler (#1476)
* Fixes ruler module integrity issues by bringing module into source

* Changing ruler stylesheet to vaguely match DCS theme in Liberation

* Changelog
2021-07-31 15:43:48 -04:00
Kangwook Lee (이강욱)
0370aa8df5 Add AFAC task to JTAC unit.
This causes the JTAC unit that's used for autolase to also work as
a FAC over the radio.
2021-07-31 12:37:18 -07:00
Kangwook Lee (이강욱)
6034c899d3 Add flight intra radio channel to mission briefing (#1475) 2021-07-31 12:34:49 -07:00
bgreman
d2fe11ba6f Updates Gripen support, fixes missing DEAD legacy loadouts. (#1469) 2021-07-31 12:07:57 -04:00
bgreman
58c96e1329 Adds more details to frontline movement logging (#1465)
* adds more detailed logging for frontline movement

* Fixing attribute name

* Fixing if, adding else
2021-07-31 12:05:22 -04:00
Magnus Wolffelt
4c51b4b822 Seasonal weather types per theater.
Adjusts the weather conditions per theater and  per season.
2021-07-31 03:57:23 -07:00
C. Perreau
f5dea4935c Merge pull request #1467 from Mustang-25/develop
Increment Campaigns to v8.0
2021-07-31 00:13:45 +02:00
Mustang-25
0117ab8aa4 Increment to Campaign v8.0 2021-07-28 10:37:14 -07:00
Mustang-25
a5ade0c41a Increment to Campaign v8.0 2021-07-28 10:36:43 -07:00
Mustang-25
4df12ae675 Increment to Campaign v8.0 2021-07-28 10:36:17 -07:00
Mustang-25
274a41f052 Increment to Campaign v8.0 2021-07-28 10:35:12 -07:00
Mustang-25
3670c8f879 Increment to Campaign v8.0 2021-07-28 10:34:28 -07:00
Mustang-25
e88bb442f3 Increment to Campaign v8.0 2021-07-28 10:32:47 -07:00
Mustang-25
a0d1bf4b5c Merge branch 'dcs-liberation:develop' into develop 2021-07-28 10:31:31 -07:00
Khopa
32f05dccd9 Added Tin Shield EWR support 2021-07-28 00:15:00 +02:00
Khopa
4aac2d2b7b Added NASAMS support 2021-07-27 23:43:00 +02:00
Mustang-25
e5a40bfb69 Merge branch 'dcs-liberation:develop' into develop 2021-07-27 14:07:41 -07:00
C. Perreau
741ae36d4c Merge pull request #1459 from RndName/fix-empty-transfer
fix generation of empty transfer during cp capture
2021-07-27 22:54:51 +02:00
RndName
67fa4a8910 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
2021-07-25 15:24:16 +02:00
Dan Albert
80bf3c97b2 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.
2021-07-24 15:10:22 -07:00
Dan Albert
9f23cb35a9 Update pydcs to latest master. 2021-07-24 15:09:35 -07:00
RndName
458de17b8f adopt sam heading to new heading class 2021-07-23 15:57:03 -07:00
RndName
dd50ee92a9 calculate heading to center of conflict for sams 2021-07-23 15:57:03 -07:00
bgreman
1094085872 Fixes #1449 and updates another area where the Heading class can apply (#1451) 2021-07-22 15:30:46 -04:00
Dan Albert
edbd3de4a4 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.
2021-07-21 17:10:29 -07:00
bgreman
91d430085e Addresses #478, adding a heading class to represent headings and angles (#1387)
* Addresses #478, adding a heading class to represent headings and angles
Removed some unused code

* Fixing bad merge

* Formatting

* Fixing type issues and other merge resolution misses
2021-07-21 10:29:37 -04:00
Dan Albert
fab550157a Add a per-aircraft weapon linter.
Run with `main.py lint-weapons $AIRCRAFT` to show all the weapons the
aircraft can carry that do not have data.
2021-07-19 20:07:58 -07:00
Dan Albert
5e2ed04d72 Add weapon data for the CBU-87 and CBU-97. 2021-07-19 16:53:49 -07:00
Dan Albert
e87aa83666 Add CLI generator options for date restrictions. 2021-07-19 16:27:20 -07:00
Dan Albert
c9b6b5d4a8 Correct changelog. 2021-07-18 19:38:55 -07:00
Dan Albert
ce01ad2083 Default to aircraft at only appropriate bases. 2021-07-18 17:12:34 -07:00
Dan Albert
0eb8ec70d9 Make opfor airwing configurable. 2021-07-18 16:09:20 -07:00
Dan Albert
270f87f193 Add per-aircraft tabs to air wing configuration. 2021-07-18 15:49:58 -07:00
Dan Albert
c2951e5e41 Increase minimum hold distance.
The previous values were far too optimistic for a non-AB climb to hold
altitude, especially for the AI.
2021-07-18 14:52:12 -07:00
Dan Albert
e22e8669e1 Add fallback locations for join zones.
It's rare with the current 5NM buffer around the origin, but if we use
the hold distance as the buffer like we maybe should it's possible for
the preferred join locations to fall entirely within the home zone. In
that case, fall back to a location within the max-turn-zone that's
outside the home zone and is nearest the IP.
2021-07-18 14:52:12 -07:00
Dan Albert
2580fe6b79 Update the changelog. 2021-07-17 19:53:16 -07:00
Dan Albert
c11c6f40d5 Add minimum fuel per waypoint on the kneeboard. 2021-07-17 19:51:55 -07:00
Dan Albert
3c90a92641 Add fuel consumption data for the Hornet.
Will be used to calculate bingo and min remaining fuel for the
kneeboard.
2021-07-17 18:23:20 -07:00
Dan Albert
4c0a97e62f Log a warning for unknown max ranges. 2021-07-17 17:27:40 -07:00
Dan Albert
0a57bb5029 Increase airfield distance in Battle of Abu Dhabi.
Removes some of the low capacity airfields from the campaign now that
missions can plan longer ranges if needed.

This removes Khasab, Bandar Lengeh, and Qeshm from the blue side, so
blue no longer has any airfields on the peninsula.

The CVN has moved quite a ways west to make it a good platform for
attacking the area around Dubai, and to prevent it from being the
primary mission source (with a 90 aircraft limit, a *lot* of missions
can get planned there before other airbases will be used).

The LHA moves to near where the CVN was, making it a good platform for
early game missions. Once the LHA's 20 aircraft limit is exhausted, Kish
and Bandar Abbas will be the primary airfields early game. Bandar Abbas
is still close enough to source Hornet and Viper missions to most of the
area around Dubai. It's unable to reach Lar with those aircraft, but
Kish and the CVN can (as can captured airfields).
2021-07-17 16:34:13 -07:00
Dan Albert
c65ac5a7cf Move mission range data into the aircraft type.
The doctrine/task limits were capturing a reasonable average for the
era, but it did a bad job for cases like the Harrier vs the Hornet,
which perform similar missions but have drastically different max
ranges. It also forced us into limiting CAS missions (even those flown
by long range aircraft like the A-10) to 50nm since helicopters could
commonly be fragged to them.

This should allow us to design campaigns without needing airfields to be
a max of ~50-100nm apart.
2021-07-17 16:34:13 -07:00
Dan Albert
04a8040292 Prevent carriers from claiming most TGOs.
The naval CP generators will only spawn ships, so if any of the other
TGO types were closest to the CV or LHA they just would not be
generated.
2021-07-17 16:34:13 -07:00
Dan Albert
adab00bc0e Update changelog. 2021-07-17 14:31:14 -07:00
Dan Albert
9bb8e00c3d Allow configuration of the air wing at game start.
After completing the new game wizard but before initializing turn 0,
open a dialog to allow the player to customize their air wing. With this
they can remove squadrons from the game, rename them, add players, or
change allowed mission types. *Adding* squadrons is not currently
supported, nor is changing the squadron's livery (the data in pydcs is
an arbitrary class hierarchy that can't be safely indexed by country).

This only applies to the blue air wing for now.

Future improvements:

* Add squadron button.
* Collapse disable squadrons to declutter?
* Tabs on the side like the settings dialog to group by aircraft type.
* Top tab bar to switch between red and blue air wings.
2021-07-17 14:29:04 -07:00
Dan Albert
f2dc95b86d Fix typo. 2021-07-16 22:43:59 -07:00
Dan Albert
28f98aed88 Migrate pressure to a typed unit. 2021-07-16 22:38:41 -07:00
Dan Albert
d11174da21 Stop cluttering the kneeboard with empty notes. 2021-07-16 22:25:40 -07:00
Dan Albert
8e977f994f Remove LGBs from degraded loadouts without TGPs.
This only takes effect for default loadouts. Custom loadouts set from
the UI will allow LGBs. In the default case there will not be buddy-lase
coordination so we should take iron bombs instead.

Also adds single/double Mk 83 and Mk 82 weapon data to accomodate this.
2021-07-16 18:34:41 -07:00
Dan Albert
11c2d4ab25 Add JDAMs and their fallbacks.
Hornet should be compatible with 1990 campaigns now. Air-to-ground
weapon restrictions are less interesting for AI aircraft so I haven't
covered *all* the variants here (the >2 variants of each carried by the
B1 and such).
2021-07-16 16:23:22 -07:00
Dan Albert
b733e6855b Add SLAM/SLAM-ER weapon data. 2021-07-16 15:48:12 -07:00
Dan Albert
aa3d644f97 Prevent empty cheek stations for the Hornet.
This is a bit of a hack that makes the TGPs fall back to AIM-120s. It
works okay because this only applies to a few cases:

The A-10 gets an empty pylon. That's fine. Maybe later we can add
multiple fallback paths and depth-first-search through them so that that
pylon could carry bombs instead.

The Viper has no replacemnt for that station. The jammer goes on the
other fuselage station, the HTS isn't a replacement, and we don't have
LANTIRN for the Viper. No weapons can be fit to those stations.

What this helps is the Hornet, where any Gulf War scenario ends up with
an empty cheek station because we don't have the NITE HAWK to fall back
to. In this case we can instead fall back through the air-to-air
missiles to fill the station.
2021-07-16 15:27:32 -07:00
Dan Albert
bb46d00f22 Add weapon data for R-77, R-27, and R-24. 2021-07-16 15:22:11 -07:00
Dan Albert
771c74ee75 Fill out weapon data for AIM-9s. 2021-07-16 15:12:49 -07:00
Magnus Wolffelt
04a346678c Add situational temperature and pressure variation.
Now varies by:

* Season
* Theater
* Weather
* Time of day
2021-07-16 14:08:14 -07:00
Dan Albert
e5c0fc92ec Don't reload weapon data if already loaded. 2021-07-16 01:06:31 -07:00
Dan Albert
1b640f40dc Fix map issues when debugging tools are disabled. 2021-07-16 00:27:11 -07:00
Mustang-25
ee77516716 Replace TGP with SPJ for JF-17 CAP/SEAD.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1422.
2021-07-16 00:17:20 -07:00
Dan Albert
82cca0a602 [3/3] Rework hold points. 2021-07-15 23:21:56 -07:00
Dan Albert
d444d716f5 [2/3] Improve join point placement. 2021-07-15 23:18:10 -07:00
Dan Albert
e03d710d53 [1/3] Rework IP placement.
Test cases:

1. Target is not threatened.

   The IP should be placed on a direct heading from the origin to the
   target at the max ingress distance, or very near the origin airfield
   if the airfield is closer to the target than the IP distance.

2. Unthreatened home zone, max IP between origin and target, safe
   locations available for IP.

   The IP should be placed in LAR at the closest point to home.

3. Unthreatened home zone, origin within LAR, safe locations available
   for IP.

   The IP should be placed near the origin airfield to prevent
   backtracking more than needed.

4. Unthreatened home zone, origin entirely nearer the target than LAR,
   safe locations available for IP.

   The IP should be placed in LAR as close as possible to the origin.

5. Threatened home zone, safe locations available for IP.

   The IP should be placed in LAR as close as possible to the origin.

6. No safe IP.

   The IP should be placed in LAR at the point nearest the threat
   boundary.
2021-07-15 23:18:10 -07:00
Mustang-25
b46d44c3a5 Change CAP and SEAD Loadouts
Replaced the TGP with SPJ pod for these roles.
2021-07-15 16:58:14 -07:00
Mustang-25
7a459fd5b8 Merge branch 'dcs-liberation:develop' into develop 2021-07-15 16:55:03 -07:00
Magnus Wolffelt
2b696144e3 Add QNH and temperature to the kneeboard. 2021-07-15 15:34:58 -07:00
RndName
62036a273e allow user to set empty dcs install dir
This will allow expert users to disable the automatic MissionScripting.lua replacement. There are many warnings and errors which have to be ignored to achieve this because DCS Liberation will not work with unmodified MissionScripting.lua
2021-07-15 13:46:59 -07:00
Magnus Wolffelt
d25befabdd Randomize mission temperature and pressure. 2021-07-15 13:34:09 -07:00
Dan Albert
56b17dfbcf Correct behavior for multi-task HTN methods.
Add tasks to the left of the deque, not the right.

Not symptomatic yet since we don't actually have any multi-task methods
currently.
2021-07-14 18:34:33 -07:00
Dan Albert
72c181a399 Fix budget mismatch in the UI.
Much of the UI was using the old budget which wasn't removed from Game
like it should have been when Coaltion was introduced. The UI displayed
(and in some cases pulled from) the starting budget rather than the real
budget.
2021-07-14 17:33:01 -07:00
Dan Albert
b1b60f4286 Add JSOW A and C weapon data and fallbacks.
Both types use JSOW -> Walleye -> Mk 84. The JSOW A should maybe fall
back to some CBU instead, but I think the standoff capability is more
important to preserve than the warhead type.
2021-07-14 01:27:00 -07:00
Dan Albert
7648716199 Make weapon groups explicit and moddable.
The only parts of the old weapon data that worked well (didn't commonly
result in empty pylons) did this implicitly, so make the grouping
explicit.

This also moves the data out of Python and into the resources, which
both makes the data moddable and isolates us from a huge amount of
effort and a save compat break whenever ED changes weapon names.

I didn't auto migrate the old data since the old groups were not
explict and there's no way to infer the grouping. Besides, since most of
the weapons were *not* grouped, the old data did more harm than good in
my experience. I've handled the AIM-120 and AIM-7 for now, but will get
at least all the fox 3 missiles before we ship.
2021-07-14 01:04:03 -07:00
Dan Albert
9177588220 Don't target ammo depots at inactive front lines. 2021-07-13 20:49:31 -07:00
Dan Albert
9bbcee645e Cleanup and document some of Doctrine. 2021-07-13 20:18:30 -07:00
Dan Albert
a7d49b986d Exclude both path endpoints for joins/splits.
Without this the points would often be placed exactly on top of the
origin airfield, when in that case we actually should use the fallback
behavior.
2021-07-13 20:11:09 -07:00
Dan Albert
7c3e08050f Perturb fallback join/split points.
Otherwise they're placed exactly on top of each other, which makes the
map harder to read.
2021-07-13 20:10:29 -07:00
Dan Albert
076df7cf66 Fix placement of fallback split points.
Using the target placed the split in the threatened area.
2021-07-13 20:07:42 -07:00
Dan Albert
415b8c6317 Allow the split point to differ from the join.
This places the split point based on the best path from the IP to home,
rather than the best path from home to the target. The outcome is that
the planner might choose an alternate route out of a threatened area
based on the safest escape from the IP, which is where the aircraft
should be when it releases its weapons, rather than at the target.
That's of course not always perfect since the IP distance is not based
on the carried weapon, but it's a better choice when it matters more
(when carrying standoff weapons attacking a more dangerous target).
2021-07-13 19:59:22 -07:00
Dan Albert
c1d3c93dbb Speed up turn processing.
Run the expensive precondition check (package fulfillment) last.
2021-07-13 18:56:06 -07:00
Dan Albert
8e59c99666 Improve hold point placement for nearby joins. 2021-07-13 18:43:02 -07:00
Dan Albert
dfcd372d2d Remove egress points from most flight plans.
These don't have any function. Remove them and remove the angled attack
heading from the IP.
2021-07-13 18:36:38 -07:00
Dan Albert
f7bbe0fa94 Improve flight plan layout for untheatened IPs.
Try all the nav points between the origin and the target rather than
just the first non-threatened point. This prevents us from using the
fallback behavior for any target that's sufficiently far from the
package airfield.
2021-07-13 18:22:42 -07:00
Dan Albert
a1910f49a8 Color navmesh zones based on threat. 2021-07-13 17:49:10 -07:00
Dan Albert
5f8be5fa91 Fix type checker issue. 2021-07-13 17:08:37 -07:00
Dan Albert
587034ad03 Prioritize ammo depots when appropriate.
The AI will now prioritize targeting ammo depots if the current
deployable enemy forces outnumber the friendly cap by 50% or more.
2021-07-13 17:06:25 -07:00
Dan Albert
9568bc7ea6 Fix inversion of AI management for opfor. 2021-07-13 17:04:49 -07:00
Dan Albert
ccf6b6ef5f Check for available aircraft as task precondition.
This makes it so that the mission planning effects are applied only if
the package can be fulfilled. For example, breakthrough will be used
only if all the BAI missions were fulfilled, not if they will *attempt*
to be fulfilled.
2021-07-13 16:26:15 -07:00
Dan Albert
24f6aff8c8 Reduce mission planning dependence on Game. 2021-07-13 15:20:42 -07:00
Dan Albert
17c19d453b Factor out Coalition from Game. 2021-07-13 14:29:40 -07:00
Dan Albert
4534758c21 Account for planned missions for breakthrough.
Consider BAI missions planned this turn when determining if a control
point is still garrisioned for preventing breakthrough.

This isn't very accurate yet since the HTN isn't checking for aircraft
fulfillment yet, so it might *plan* a mission to kill the garrison, but
there's no way to know if it will be fulfilled.
2021-07-13 13:50:50 -07:00
Dan Albert
c180eb466d Use aggressive stance for similar troop counts.
Bumps the breakthrough requirement to 2x, elimination to 1.5x, and uses
agressive for 0.8-1.5x.
2021-07-12 21:28:00 -07:00
Dan Albert
0a416ab758 Let the TheaterCommander manage front line stance.
This improves the AI behavior by choosing the stances non-randomly:

* Breakthrough will be used if the base is expected to be capturable and
  the coalition outnumbers the enemy by 20%.
* Elimination will be used if the coalition has at least as many units
  as the enemy.
* Defensive will be used if the coalition has at least half as many
  units as the enemy.
* Retreat will be used if the coalition is significantly outnumbers.

This also exposes the option to the player.
2021-07-12 21:12:02 -07:00
Dan Albert
575aca5886 Fix targeting dead BAI targets. 2021-07-12 20:44:19 -07:00
Dan Albert
c0cc5657a7 Attack detecting radars with low priority.
IADS that are in detection range (but not attack range) of missions will
be targeted at very low priority. These will typically only be planned
when no other targets are in range.
2021-07-12 17:33:45 -07:00
Dan Albert
78514b6c2e Only auto-target strike against buildings.
The players can still manually assign strike missions on other target
types since that's sometimes better for player waypoint generation (one
waypoint per unit is nice for SAMs), but it's bad for the AI so by
default we should exclude non-buildings.

This also prevents double targeting of groups, since they might have
been identified by other missions as well.

We already did some of this, but since we were excluding specific TGO
types rather than only allowing building TGOs we were often missing
things (missile sites, coastal defenses, and EWRs, it seems).
2021-07-12 17:04:17 -07:00
Dan Albert
7e4390d743 Improve prioritization of garrison targeting.
Garrison groups should be preferred with the following priority:

1. Groups blocking base capture
2. Groups at bases connected to an active front line
3. Rear guard units

Previously they were being prioritized based on the distance to the
closest friendy control point, which is similar to this but an
aggressively placed carrier could throw it off.
2021-07-12 16:59:49 -07:00
Dan Albert
cd558daf5a 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.
2021-07-12 13:44:49 -07:00
Dan Albert
dda5955121 Improve DEAD mission prioritization.
This alters the DEAD task planning to be the *least* preferred task, but
prevents other tasks from being planned unless they are excepted to be
clear of air defenses first. Even so, missions are a guaranteed success
so those other missions will still get SEAD escorts if there's potential
for a SAM in the area.

This means that air defenses that are not protecting a more useful
target (like a convoy, armor column, building, etc) will no longer be
considered by the mission planner. This isn't *quite* right since we
currently only check the target area for air defenses rather than the
entire flight plan, so there's a chance that we ignore IADS that have
threatened ingress points (though that's mostly solved by the flight
plan layout).

This also is still slightly limited because it's not checking for
aircraft availability at this stage yet, so we may aggressively plan
missions that we should be skipping unless we can guarantee that the
DEAD mission was planned. However, that's not new behavior.
2021-07-12 13:02:23 -07:00
Dan Albert
783ac18222 Replace existing campaign planner with an HTN.
An HTN (https://en.wikipedia.org/wiki/Hierarchical_task_network) is
similar to a decision tree, but it is able to reset to an earlier stage
if a subtask fails and tasks are able to account for the changes in
world state caused by earlier tasks.

Currently this just uses exactly the same strategy as before so we can
prove the system, but it should make it simpler to improve on task
planning.
2021-07-12 13:02:23 -07:00
Dan Albert
81c8052449 Note tracking bug for shapely type annotations. 2021-07-11 14:41:40 -07:00
Dan Albert
6ce02282e7 Correct int/float confusion in Point APIs.
The heading and distance calculations always return floats.
2021-07-11 14:33:46 -07:00
Dan Albert
a19a0b6789 Use Pillow types from typeshed. 2021-07-11 13:53:58 -07:00
Dan Albert
9de08dc83f 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).
2021-07-11 13:37:17 -07:00
Dan Albert
96c7b87ac7 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.
2021-07-09 16:35:03 -07:00
Brock Greman
469dd49def Fixing broken group generation. 2021-07-09 12:35:32 -07:00
Dan Albert
53f6a0b32b Fix some typing in preparation for pydcs types.
Not complete, but progress.
2021-07-08 23:23:05 -07:00
Dan Albert
fb9a0fe833 Flesh out typing information, enforce. 2021-07-07 17:41:29 -07:00
Dan Albert
69c3d41a8a Disallow partially specified generics. 2021-07-07 16:01:20 -07:00
Dan Albert
fc32b98341 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
2021-07-07 15:47:19 -07:00
Dan Albert
299ed88f09 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.
2021-07-07 15:17:05 -07:00
Dan Albert
29753a6aa9 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.
2021-07-07 15:17:05 -07:00
Dan Albert
7983cd8d62 Add documentation for turn processing. 2021-07-07 14:44:38 -07:00
RndName
05fab1f79d correct display of turn statistics 2021-07-07 14:12:20 -07:00
RndName
7229b886e0 replan opfor mission on sell or buy of tgos 2021-07-07 14:12:20 -07:00
Dan Albert
8b70d2674f Note fix for empty convoy groups. 2021-07-05 15:54:23 -07:00
RndName
8ba27cdaea remove completely destroyed units from the convoy 2021-07-05 15:51:34 -07:00
Khopa
1c2411a0fc Added a basic campaign on Mariana Islands theater to try it out. 2021-07-04 19:35:36 +02:00
Khopa
ec88d07ef1 Corrected some bugs preventing marianas campaigns from running 2021-07-04 19:34:58 +02:00
bgreman
aa328d3ef7 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>
2021-07-03 14:51:26 -04:00
Dan Albert
727facfb90 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
2021-07-02 17:33:24 -07:00
Dan Albert
4add853473 Fix the legacy tanker.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1379
2021-07-02 17:18:21 -07:00
RndName
b2db27f9aa 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
2021-07-02 16:46:16 -07:00
RndName
96be6c0efe 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
2021-07-02 16:46:16 -07:00
Dan Albert
3f42f1281d Note the silkworm fix in the changelog. 2021-07-02 16:28:06 -07:00
Mustang-25
bab8384803 Corrected Silkworm launcher name 2021-07-02 16:26:47 -07:00
Mustang-25
ceb77c990b Corrected Silkworm launcher name 2021-07-02 11:45:01 -07:00
Florian
3f65928e9d Remove the randomness from SAM group size. 2021-07-02 01:38:27 -07:00
Dan Albert
4e6659e7e8 4.0.1 -> 4.1.0
This includes new features now.
2021-07-02 01:27:51 -07:00
Chris Seagraves
9e22d4b5df Note TGO tooltip improvement in the changelog. 2021-07-02 01:26:55 -07:00
RndName
357361de3d fixed lua data generation 2021-07-02 01:25:03 -07:00
RndName
de443fa3f0 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
2021-07-02 01:25:03 -07:00
Dan Albert
20839853b7 Minor formatting fix for the changelog. 2021-07-01 20:07:28 -07:00
Chris Seagraves
bc2539b566 Fix for crash when clear weather.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1394
2021-07-01 20:07:01 -07:00
Dan Albert
c89416702d Revert "Revert "Add Cloud Base Altitude to Weather Display (#1371)""
This reverts commit b2dd8c68e1.
2021-07-01 20:07:01 -07:00
Dan Albert
b2dd8c68e1 Revert "Add Cloud Base Altitude to Weather Display (#1371)"
Reverting until
https://github.com/dcs-liberation/dcs_liberation/issues/1394 is
resovled.

This reverts commit f80696b724.
2021-07-01 20:00:08 -07:00
Dan Albert
2ef2eafdd3 Remove debug cruft.
We don't need to print the description of every unit on startup.
2021-07-01 19:37:08 -07:00
Schneefl0cke
568655d503 Add incomes for WW2 villages and camps. 2021-07-01 17:04:03 -07:00
bgreman
9bd6f9ef47 Addresses #478 to clean up the angle summing functionality. (#1386) 2021-06-30 23:58:20 -04:00
bgreman
c8e5cefd36 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
2021-06-30 23:55:37 -04:00
bgreman
7ba4077f9f Fixes #240 by making statistics windows axis labels integers (#1370) 2021-06-30 23:50:02 -04:00
Mustang-25
151f8bf329 Update TGP Restriction Dates
TGP dates to more accurately reflect IRL IOC dates.
2021-06-30 19:17:14 -07:00
Chris Seagraves
e94d48c265 Notes to kneeboard (#1375)
Adds global-level kneeboard notes.  Explicit save compatability with 4.0.0
2021-06-30 18:07:53 -04:00
Fryderyk Wysocki
2a5c523afd 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
2021-06-30 15:30:38 -04:00
Chris Seagraves
f80696b724 Add Cloud Base Altitude to Weather Display (#1371)
Adds tooltip with cloud base altitude to weather panel
2021-06-30 15:22:14 -04:00
Chris Seagraves
5f5b5f69e3 asset reference links 😎 (#1363)
Adds urls to unit info pages that don't have data.
2021-06-30 15:04:06 -04:00
Chris Seagraves
d99f8fef09 Update main.py (#1382) 2021-06-29 18:19:37 -04:00
Khopa
97e59db5e6 Helipads : Support for warm takeoff, use InvisibleFarp rather than Single Helipad. 2021-06-27 19:57:04 +02:00
Khopa
1c813c0e0e Merge remote-tracking branch 'khopa/develop' into helipads 2021-06-27 18:35:24 +02:00
Simon Clark
e39f17b3de Fix begin campaign button on reload. 2021-06-26 22:43:22 +01:00
Dan Albert
0b90b53e09 Add changelog section for 4.0.1. 2021-06-26 14:40:00 -07:00
Dan Albert
847d729ba4 Release 4.0.0. (#1365) 2021-06-26 12:46:26 -07:00
Dan Albert
aa86a6e53b Add the most important feature to the changelog. 2021-06-26 12:33:56 -07:00
Brock Greman
34470336e4 Clarify the impact of non-cold flight starts. 2021-06-26 12:29:17 -07:00
Mustang-25
5a2a89f19e Update Op Mole Cricket 2010 Campaign.
Moved SAM generator at Rosh Pina so it does not spawn units on the runway.
2021-06-26 12:17:27 -07:00
Dan Albert
7eb4df770e Revert accidental change to default pilot limit. 2021-06-26 12:06:18 -07:00
Simon Clark
550bb5fd33 Bump campaign versions. 2021-06-26 19:30:03 +01:00
Chris Seagraves
ffcae66f59 Include control point name in ground object info.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/498
2021-06-26 11:24:12 -07:00
Dan Albert
d2df795ba7 Ack campaign version update.
No scenery targets in this campaign so no work needed.

https://github.com/dcs-liberation/dcs_liberation/issues/1359
2021-06-26 11:19:02 -07:00
Dan Albert
b930e13964 Remove dead campaign.
https://github.com/dcs-liberation/dcs_liberation/issues/1359
2021-06-26 11:18:46 -07:00
Khopa
1b9da9cdd8 Fixed mypy error after merge 2021-06-26 20:00:10 +02:00
Dan Albert
e6bf318cdf Fix save path for new games. 2021-06-26 10:59:58 -07:00
Dan Albert
4cfed08247 Disband unfilled incompletable transfers.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1317
2021-06-26 10:54:09 -07:00
Khopa
4460b526cb Golan heights : re-add helipads for testing in helipad branch after merge of develop feature. 2021-06-26 19:27:33 +02:00
Khopa
01e6a87968 Mod support : Updated frenchpach to version 4.6 (Added new units VBCI and AMX-13 support) + some frenchpack units yaml tweaks 2021-06-26 19:22:13 +02:00
Khopa
7667a4f8c0 Merge branch 'develop' into helipads
# Conflicts:
#	game/game.py
#	resources/campaigns/golan_heights_lite.miz
2021-06-26 18:00:36 +02:00
Khopa
6fbfb83e6c Fixed duplicates in france 2005 faction 2021-06-26 15:26:33 +02:00
Khopa
123d3e182a Fixed yaml issue causing an issue with Leclerc MBT 2021-06-26 15:16:46 +02:00
Khopa
fd8d16035c Updated campaign : Operation Dynamo for The Channel map 2021-06-26 14:44:16 +02:00
Khopa
1ff45b55d6 Updated campaign : Russia Small, renamed it to "From Mozdok to Maykop" 2021-06-26 13:48:31 +02:00
Khopa
0ce02d7766 Updated campaign : Battle for Golan Heights 2021-06-26 13:27:01 +02:00
Dan Albert
959a13a514 Fix save path cleanup. 2021-06-25 23:21:31 -07:00
Chris Seagraves
b601d713d2 Use directory of current save for open/save-as. 2021-06-25 23:01:49 -07:00
Dan Albert
dc96d8699a Add "Nevada Limited Air" campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1358
2021-06-25 21:34:28 -07:00
Dan Albert
f38cdd8432 Add "Scenic Route" campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1334
2021-06-25 21:28:27 -07:00
Dan Albert
91655a3d5a Fix lint. 2021-06-25 19:33:55 -07:00
Dan Albert
7774a9b2ab Move the default save game directory.
The top level DCS directory gets messy fast if we fill it with save
games.
2021-06-25 17:48:09 -07:00
Dan Albert
80cf8f484d Fix targeting of carrier groups with TGOs.
The assumption that the first group is the carrier group is wrong.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1346
2021-06-25 16:46:49 -07:00
Dan Albert
cb7c075a61 State carrier requirement for Blackball.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1355
2021-06-25 16:35:15 -07:00
Dan Albert
4d0fb67c53 Fix crash when buying or selling TGO units.
Updating the game destroys this window so we cannot continue with the
calls. It worked in my initial testing, so presumably it's partly
dependent on when the finalizers run.

Since the windows will be destroyed there's nothing for us to actually
update, so just remove that signal and the explicit close calls.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1344
2021-06-25 16:30:18 -07:00
Dan Albert
380d1d4f18 Ack campaign version bump.
Campaigns don't use scenery targets.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1341
2021-06-24 18:17:25 -07:00
Dan Albert
71832859a5 Update pydcs to use latest master.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/993
2021-06-24 18:14:11 -07:00
docofmur
a31432ad9e Fixes #1337 by making ground location search look in both directions (#1338) 2021-06-24 13:24:13 -04:00
bgreman
26743154d8 Implements #1331 by changing the Pass Turn button text on Turn 0. (#1333) 2021-06-24 10:59:12 -04:00
bgreman
a50a6fa917 Adds a ruler to the map (#1332)
* Adds a ruler to the map

* Updating changelog

* Updating changelog
2021-06-24 02:58:39 -04:00
bgreman
b43e5bac0b Fix #1329 player loses frontline progress when skipping turn 0 (#1330) 2021-06-24 02:04:27 -04:00
Dan Albert
ddaef1fb64 Retry reading state.json on failure.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1313
2021-06-23 20:18:06 -07:00
Dan Albert
6f264ff5de Signal game update when buying/selling TGO units.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1312
2021-06-23 20:08:05 -07:00
Dan Albert
a06fc6d80f Fix another unit type mismatch. 2021-06-23 20:01:38 -07:00
Dan Albert
3ddfc47d3a Add a feature flag for pilot limits.
This doesn't currently interact very well with the auto purchase since
the procurer might by aircraft that don't have pilots available. That
should be fixed, but for the short term we should just default to not
enabling this new feature.
2021-06-23 18:47:34 -07:00
docofmur
905bd05ba8 Campaign version update (#1326)
Caucasus Multi part campaign version update. No map strike objects so just the version change
2021-06-23 20:00:39 -04:00
Dan Albert
aa19787654 Document high level concepts of unit transfers. 2021-06-23 16:50:54 -07:00
bgreman
3274f3ec35 Fix empty convoys (#1327)
* Hopefully getting rid of empty convoys for good

* changing Dict to dict for type checks
2021-06-23 19:48:16 -04:00
bgreman
c3b8c48ca2 Fixes #1310 (#1325)
* Fixes #1310 by only refunding GUs if no faction CP has an attached factory.  Previously it would refund all units at the CP, including aircraft.

Also changes the CP CAPTURE cheat to work at any CP regardless of adjacency to frontline or BLUEFOR/OPFOR state.

* Fixing typing issues, changint all Dict[] types to dict[]

* Updating changelog
2021-06-23 17:09:17 -04:00
Dan Albert
d365094616 Update From Caen to Evreux.
Add support for inversion and ack the version change (Normandy is
unaffected by ID updates).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1232
2021-06-23 13:57:16 -07:00
Dan Albert
7c76684076 Ack version update for PG campaigns.
PG is unaffected by building ID changes.
2021-06-23 13:49:27 -07:00
Dan Albert
0ef27b038a Update Vectron's Claw and Peace Spring.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1323
2021-06-23 12:58:56 -07:00
Dan Albert
610a27c0e4 Copy initialization fix to AircraftType. 2021-06-23 12:50:07 -07:00
RndName
752c91a721 set window title empty on new game
also fixed small exception when aborting the open file dialog which lead to " as filename

fixes #1305
2021-06-23 12:24:36 -07:00
Dan Albert
d3d655da07 Fixed missed initialization of unit data on load.
We'd only load unit data if a name lookup was done and missed it on a
type lookup. Ideally we wouldn't need to do a type lookup here until the
ground unit templates are reworked we still do.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1299
2021-06-22 23:41:05 -07:00
Dan Albert
db36cf248e Return pilots when canceling flight creation. 2021-06-22 23:36:39 -07:00
Dan Albert
153d8e106e Add the Around the Mountain campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1280
2021-06-22 23:28:54 -07:00
Dan Albert
df8829b477 Add Operation Blackball campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1320
2021-06-22 23:22:42 -07:00
Dan Albert
569bc297a8 Update Syria Full campaign.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1319
2021-06-22 23:20:03 -07:00
Dan Albert
099cbbdb64 Update Northern Russia campaign.
I bumped the submitted 6.1 to 7.0 (which didn't exist when the files
were uploaded) because this campaign uses no scenery targets.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1318
2021-06-22 23:16:12 -07:00
Dan Albert
ca7469b92e Update Allied Sword.
Only change from the uploaded files is that I increased the campaign
version to 7.0 since this doesn't use any scenery targets so has no work
to do for that.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1249
2021-06-22 23:13:16 -07:00
Dan Albert
6db4145927 Correct mistakenly updated campaign. 2021-06-22 23:08:12 -07:00
Dan Albert
ca93f2baff Bump campaign version to account for DCS changes.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1308
2021-06-22 23:04:16 -07:00
Dan Albert
84a0a3caeb Fix unit type mismatch.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1314
2021-06-22 22:54:40 -07:00
Dan Albert
7b327693e2 Update Operation Peace Spring.
https://github.com/dcs-liberation/dcs_liberation/issues/1303
2021-06-22 15:17:39 -07:00
docofmur
dba70dc6d5 Faction Audit.
Transports and mod aircraft added where needed cleaned up various
duplicates in factions.
2021-06-22 15:01:50 -07:00
Mike Jones
bd1618e41d Use pydcs has_tacan attribute to check if tankers support TACAN. 2021-06-22 14:35:28 -07:00
Mike Jones
08b7aff0d8 Add gunfighter flag to aircraft data files. 2021-06-22 14:35:28 -07:00
Mike Jones
a75688f89c Add patrol configuration to unit data files.
This allows altitude/speed of AEW&C and tankers to be configured.
2021-06-22 14:35:28 -07:00
Mike Jones
30763b5401 Fix unit type comparisons.
When comparing UnitType against a pydcs type, use .dcs_unit_type.
2021-06-22 14:35:28 -07:00
Chris Seagraves
814519248c Fix bug with file name in title with invalid save games. 2021-06-22 14:19:53 -07:00
Simon Clark
8c71be5257 Campaign clarity. 2021-06-22 17:21:21 +01:00
Simon Clark
91763b233e Add clarity for mod selection page. 2021-06-21 20:04:58 +01:00
Simon Clark
ab51f5e69a Merge branch 'develop' of https://github.com/dcs-liberation/dcs_liberation into develop 2021-06-21 19:46:10 +01:00
Simon Clark
d278d58f6c Add Operation Atilla campaign.
It's a Cyprus invasion campaign - what's not to like!
2021-06-21 19:46:05 +01:00
Dan Albert
47e038c9fa Fix command line campaign generator. 2021-06-20 23:46:06 -07:00
Dan Albert
e96210f48c Don't order transports for incapable factions.
If these orders can't be fulfilled for the faction it will prevent the
faction from ordering any non-reserve aircraft since transports are
given priority after reserve missions, and they'll never be fulfillable.
As such, no non-reserve aircraft will ever be purchased for factions
without transport aircraft.

Factions without transport aircraft are screwed in other ways, but this
will fix their air planning for campaigns that aren't dependent on
airlift.
2021-06-20 23:44:00 -07:00
Simon Clark
aa3811ad02 Updated factions to reflect mod select changes. 2021-06-21 01:32:43 +01:00
Simon Clark
963ab38b2e Refactor the mod select changes, re-add accidentally deleted factions. 2021-06-21 01:16:48 +01:00
Simon Clark
11069cc219 Make mod selection nicer and deprecate MB-339.
Mod selection is now done via checkbox in the new game wizard.

The MB-339 is being turned into a paid module, and the free mod no longer works, so it's been removed.
2021-06-21 01:16:41 +01:00
Dan Albert
d074500109 Revert "Don't propose missions the air wing can't plan."
This is redundant because plan_mission already checks this.

This reverts commit 3338df9836.
2021-06-20 15:57:54 -07:00
Dan Albert
63af28b016 Develop is now 5.x. 2021-06-20 15:48:54 -07:00
Khopa
82bb2fcf6a Helipad : fixed typing errors after merge 2021-06-20 18:25:19 +02:00
Khopa
e56e765450 Helipad : fixed errors after merge of develop features. 2021-06-20 18:20:40 +02:00
Khopa
c70169b4a0 Merge branch 'develop' into helipads
# Conflicts:
#	game/game.py
#	game/operation/operation.py
#	game/theater/controlpoint.py
#	gen/aircraft.py
#	resources/campaigns/golan_heights_lite.miz
2021-06-20 18:07:50 +02:00
Khopa
adad88681e Generate helipads as neutral objects, so they do not interfer with base capture trigger 2021-06-10 23:18:41 +02:00
Khopa
1b9ac088e4 Refactor & fix code after comments 2021-06-10 13:19:22 +02:00
Khopa
e00951e5b9 Merge remote-tracking branch 'khopa/develop' into helipads 2021-06-10 13:01:24 +02:00
Khopa
b7a0feba5b Added more helipads on Golan Heights 2021-06-08 13:45:21 +02:00
Khopa
51fa0a0891 Added function to get cp number of fuel depots 2021-06-08 13:18:27 +02:00
Khopa
f4c54bb9e6 Autogenerate ammo & fuel for helipads so player controlled helicopter can use ground crew menu to refuel and rearm at FARPs. 2021-06-08 13:17:34 +02:00
Khopa
e00ca5d096 Merge branch 'develop' into helipads 2021-06-08 13:09:11 +02:00
Khopa
07b93167f0 Improved implementation. 2021-06-06 17:49:56 +02:00
Khopa
29c0a8d054 Fixed ground start for helos in FOB 2021-06-06 17:28:23 +02:00
Khopa
73b1be36a2 Merge branch 'develop' into helipads
# Conflicts:
#	game/theater/conflicttheater.py
#	gen/flights/flightplan.py
2021-06-06 15:46:30 +02:00
Khopa
4eb78810c6 Merge branch 'develop' into helipads
# Conflicts:
#	resources/campaigns/golan_heights_lite.miz
2021-05-30 17:29:55 +02:00
Khopa
f31861441b Merge branch 'develop' into helipads
# Conflicts:
#	game/data/weapons.py
#	game/db.py
#	game/theater/conflicttheater.py
#	resources/factions/france_1995.json
#	resources/factions/insurgents.json
#	resources/factions/iraq_1991.json
#	resources/factions/syria_1967_with_ww2_weapons.json
#	resources/factions/syria_2011.json
2021-05-21 13:58:22 +02:00
Khopa
cc93c686d9 pydcs update for DCS 2.7.1 2021-05-21 01:17:56 +02:00
Khopa
d5990e60c9 Helicopter flights can be planned from FOBs 2021-05-21 00:34:51 +02:00
2346 changed files with 117254 additions and 41445 deletions

8
.coveragerc Normal file
View File

@@ -0,0 +1,8 @@
[report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
[run]
branch = True
source = game,pydcs_extensions,qt_ui,resources/tools

92
.gitattributes vendored Normal file
View File

@@ -0,0 +1,92 @@
* text=auto
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
*.pyi text diff=python
*.db binary
*.p binary
*.pkl binary
*.pickle binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary
unshipped_data/arcgis_maps/ filter=lfs diff=lfs merge=lfs -text
# https://github.com/alexkaratarakis/gitattributes/blob/master/Common.gitattributes
# Documents
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text diff=markdown
*.mdx text diff=markdown
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text
*.tab text
*.tsv text
*.txt text
*.sql text
*.epub diff=astextplain
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as text by default.
*.svg text
# If you want to treat it as binary,
# use the following line instead.
# *.svg binary
*.eps binary
# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text
# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary
# Text files where line endings should be preserved
*.patch -text
#
# Exclude files from exporting
#
.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore

86
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
---
name: Bug report
description: >
Use for any bug that happens after campaign generation. If the New Game wizard
failed, use the "New Game wizard failed" template instead.
labels: bug
body:
- type: markdown
attributes:
value: >
Before filing, please search the issue tracker to see if the issue has
already been reported.
- type: dropdown
validations:
required: true
attributes:
label: Affected versions
multiple: true
description: >
Select all DCS Liberation versions in which you have observed this bug.
You do not need to test all of them, but the information is useful if
you have it.
If you do not see your version listed here you are on an old release
that is not supported, and the bug may already be fixed in a newer
release. Check that the bug still exists in a newer release before
filing.
If the bug was found in a development build, select "Development build"
and provide a link to the build in the field below.
options:
- 6.1.1
- Development build
- type: textarea
attributes:
label: Build information
description:
The build information from the Help -> Report an issue window.
- type: textarea
attributes:
label: Description
description: >
Describe the bug. What went wrong? What did you expect to happen
instead? What steps should we take to reproduce the error? If an error
dialog was shown, include the full text.
validations:
required: true
- type: textarea
attributes:
label: Save game and other files
description: >
Attach any files needed to reproduce the bug here. **A save game is
required.** We typically cannot help without a save game (the
`.liberation` (or `.liberation.zip`, for 7.x) file found in
`%USERPROFILE%/Saved Games/DCS/Liberation/Saves`), so most bugs filed
without saved games will be closed without investigation.
Other useful files to include are:
The Liberation log file. The log file is located at `<Liberation install
directory>/logs/liberation.log`. The log often includes data about
non-fatal errors that could be the root cause of the problem.
The `liberation_nextturn.miz` or a track file. This should always be
included for bugs where the mission was generated incorrectly or where
the in-game AI is misbehaving.
The `state.json` file for the most recently completed turn, located at
`<Liberation install directory>/state.json`. This file is essential for
investigating any issues with end-of-turn results processing. **If you
include this file, also include `last_turn.liberation`** (unless the
save is from 7.x or newer, which includes that information in the save
automatically).
You can attach files to the bug by dragging and dropping the file into
this text box. GitHub will not allow uploads of all file types, so
attach a zip of the files if needed.
validations:
required: true

View File

@@ -1,40 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
Before filing, please search the issue tracker to see if the issue has already been reported.
If reporting a DCS AI bug, check https://github.com/dcs-liberation/dcs_liberation#dcs-bugs.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional information**
We will usually need more information for debugging. Include as much of the following as you are able:
- DCS Liberation save file (the `.liberation` file you save from the DCS Liberation window). By default these are located in your DCS saved games directory (`%USERPROFILE%/Saved Games/DCS`).
- The generated mission file (the `.miz` file that you load in DCS to play the turn). By default these are located in your missions directory (`%USERPROFILE%/Saved Games/DCS/Missions`).
- A tacview track file, especially when demonstrating an issue with AI behavior. By default these are located in your Tacview tracks directory (`%USERPROFILE%/Documents/Tacview`).
- The state.json file from the finished mission when the problem is related to results processing. By default these are located in your Liberation install directory.
**Version information (please complete the following information):**
- DCS Liberation [e.g. 2.3.1]:
**Additional context**
Add any other context about the problem here.

19
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
blank_issues_enabled: false
contact_links:
- name: FAQ
url: https://discord.gg/PXHA6AXw
about: Check to see if your issue is in the FAQ.
- name: Manual
url: https://github.com/dcs-liberation/dcs_liberation/wiki/
- name: Feature blocking DCS AI bugs
url: https://github.com/dcs-liberation/dcs_liberation#dcs-bugs
about: >
A list of known DCS bugs that prevent us from improving AI behavior. Check
the list before filing AI bugs here to see if it's something we know about
but cannot fix.
- name: DCS bugs
url: https://forums.eagle.ru/forum/119-dcs-world-27/
about: >
DCS bugs should be reported against DCS, not here. Occasionally we can add
workarounds for DCS bugs. Use the "Bug report" template if you can suggest
a workaround.

12
.github/ISSUE_TEMPLATE/mod_support.md vendored Normal file
View File

@@ -0,0 +1,12 @@
---
name: Mod support request
about: Request Liberation support for new mods, or updates to existing mods
title: Add/update <mod name>
labels: mod support
assignees: ''
---
* Mod name:
* Mod URL:
* Update or new mod?

113
.github/ISSUE_TEMPLATE/new-game-bug.yml vendored Normal file
View File

@@ -0,0 +1,113 @@
---
name: New Game wizard failed
description: >
Use for bugs that prevent the "New Game" wizard from completing successfully.
If the wizard completes without issue, use the normal bug report template.
labels: bug
body:
- type: markdown
attributes:
value: >
Before filing, please search the issue tracker to see if the issue has
already been reported.
If the bug is not related to campaign generation (the campaign was
created successfully and as expected), use the normal bug report
template instead, as this template will not include the information we
need. We are unable to investigate incomplete bug reports, so they will
be closed and you will be asked to refile. If you're unsure, use your
best guess. Needing to refile is not the end of the world :)
- type: dropdown
validations:
required: true
attributes:
label: Affected versions
multiple: true
description: >
Select all DCS Liberation versions in which you have observed this bug.
You do not need to test all of them, but the information is useful if
you have it.
If you do not see your version listed here you are on an old release
that is not supported, and the bug may already be fixed in a newer
release. Check that the bug still exists in a newer release before
filing.
If the bug was found in a development build, select "Development build"
and provide a link to the build in the field below.
options:
- 6.1.1
- Development build
- type: textarea
attributes:
label: Build information
description:
The build information from the Help -> Report an issue window.
- type: input
attributes:
label: Campaign name
description: >
The name of the campaign you selected. If the bug only occurs with a
custom campaign (or modifications to a stock campaign), upload the
campaign file as an attachment to the bug description field.
validations:
required: true
- type: input
attributes:
label: Blue faction
description: >
The name of the blue faction you selected. If the bug only occurs with a
custom faction (or modifications to a stock faction), upload the faction
file as an attachment to the bug description field.
validations:
required: true
- type: input
attributes:
label: Red faction
description: >
The name of the red faction you selected. If the bug only occurs with a
custom faction (or modifications to a stock faction), upload the faction
file as an attachment to the bug description field.
validations:
required: true
- type: textarea
attributes:
label: Modifications to default settings
description: >
Describe any modifications you made to the default campaign generation
settings.
- type: textarea
attributes:
label: Description
description: >
Describe the bug. What went wrong? If an error dialog was shown, include
the full text.
Attach any relevant files such as custom campaign files or factions
here. You can attach files to the bug by dragging and dropping the file
into this text box. GitHub will not allow uploads of all file types, so
attach a zip of the files if needed.
If possible, also include the save game. If the bug prevented the game
from being generated at all this will not be possible, but if the bug is
that the wizard generated something incorrectly, the save game will help
us see what went wrong.
validations:
required: true
- type: textarea
attributes:
label: Log file
description: >
Attach the Liberation log file. The log file is located at `<Liberation
install directory>/logs/liberation.log`.
You can attach files to the bug by dragging and dropping the file into
this text box.
validations:
required: true

22
.github/actions/build-app/action.yaml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Build Liberation package
description: Assembles the full Liberation application.
runs:
using: composite
steps:
- name: Build client
shell: powershell
run: |
cd client
npm run build
- name: Build binaries
shell: powershell
run: |
./venv/scripts/activate
$env:PYTHONPATH=".;./pydcs"
pyinstaller pyinstaller.spec
- name: Install changelog
shell: powershell
run: |
Copy-Item .\changelog.md .\dist

16
.github/actions/mypy/action.yaml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: mypy
description: Type checks Python code.
runs:
using: composite
steps:
- name: mypy game
shell: powershell
run: |
./venv/scripts/activate
mypy game
- name: mypy tests
shell: powershell
run: |
./venv/scripts/activate
mypy tests

View File

@@ -0,0 +1,17 @@
name: Liberation JS set-up
description: Sets up the Liberation Javascript environment.
runs:
using: composite
steps:
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "16"
cache: npm
cache-dependency-path: client/package-lock.json
- name: npm ci
shell: powershell
run: |
cd client
npm ci

View File

@@ -0,0 +1,21 @@
name: Liberation Python set-up
description: Sets up the Liberation Python environment.
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
cache: pip
- name: Install environment
shell: powershell
run: |
python -m venv ./venv
- name: Install dependencies
shell: powershell
run: |
./venv/scripts/activate
python -m pip install -r requirements.txt

24
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,24 @@
Pull requests should be made against the `develop` branch. Any backports
necessary will be handled by the development team.
Pull requests should be focused on one task. Multiple bug fixes should be
multiple PRs. We cannot merge half a PR, and combined PRs are much more
difficult to review. PRs that do not adhere to this will have their review
delayed.
Prefer rebase to merge, and squash commits as needed to preserve a readable
commit history. This project maintains linear history in the develop branch, so
we will either rebase or squash your PR when merging. It is much easier for us
if your branch already has a readable commit history (ensure that your commit
subject lines are clear enough to identify the patch in the git log). An
exception to this is made for large PRs that are likely to require multiple
rounds of review; in that case it's easier if you **don't** do this (GitHub
does not preserve the history of old commits, so we cannot filter a PR for only
new changes if a branch is force pushed) and we will squash it when merging.
New features and bug fixes are usually worth mentioning in the changelog.
Exceptions are fixes for bugs that never shipped (were only present in a canary
build), and changes with no intended user observable behavior, such as a
refactor. If you're comfortable writing the note yourself, add it to
`changelog.md` in the root of the project in the section for the upcoming
release.

View File

@@ -1,13 +0,0 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check"

View File

@@ -3,51 +3,39 @@ name: Build
on: [push, pull_request]
jobs:
lint:
uses: ./.github/workflows/lint.yml
test:
uses: ./.github/workflows/test.yml
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up Python environment
uses: ./.github/actions/setup-liberation-python
- name: Install environment
run: |
python -m venv ./venv
- name: Set up JS environment
uses: ./.github/actions/setup-liberation-js
- name: Install dependencies
run: |
./venv/scripts/activate
python -m pip install -r requirements.txt
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
- name: Set build number
run: |
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)
[IO.File]::WriteAllLines($pwd.path + "\resources\gitsha", $env:GITHUB_SHA)
- name: mypy game
run: |
./venv/scripts/activate
mypy game
- name: Build app
uses: ./.github/actions/build-app
- name: mypy gen
run: |
./venv/scripts/activate
mypy gen
- name: update build number
run: |
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)
- name: Create archive
run:
Compress-Archive -Path .\dist\dcs_liberation\ -DestinationPath
dist\dcs_liberation.zip
- name: Build binaries
run: |
./venv/scripts/activate
$env:PYTHONPATH=".;./pydcs"
pyinstaller pyinstaller.spec
- uses: actions/upload-artifact@v2
with:
name: dcs_liberation
path: dist/
- uses: actions/upload-artifact@v2
with:
name: dcs_liberation
path: dist/dcs_liberation.zip

30
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Python lint
on: workflow_call
jobs:
black:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
version: ~=22.12
src: "."
options: "--check"
mypy:
name: Type checking
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python environment
uses: ./.github/actions/setup-liberation-python
- name: mypy
uses: ./.github/actions/mypy

View File

@@ -2,107 +2,83 @@ name: Release Pipeline
on:
push:
tags: [ '*' ]
tags: ["*"]
jobs:
lint:
uses: ./.github/workflows/lint.yml
test:
uses: ./.github/workflows/test.yml
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up Python environment
uses: ./.github/actions/setup-liberation-python
- name: Install environment
run: |
python -m venv ./venv
- name: Set up JS environment
uses: ./.github/actions/setup-liberation-js
- name: Install dependencies
run: |
./venv/scripts/activate
python -m pip install -r requirements.txt
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
- name: Finalize build
run: |
New-Item -ItemType file resources\final
- name: Finalize version
run: |
New-Item -ItemType file resources\final
- name: Build app
uses: ./.github/actions/build-app
with:
release: true
- name: mypy game
run: |
./venv/scripts/activate
mypy game
- name: mypy gen
run: |
./venv/scripts/activate
mypy gen
- name: Build binaries
run: |
./venv/scripts/activate
$env:PYTHONPATH=".;./pydcs"
pyinstaller pyinstaller.spec
- name: Create Installer
env:
TAG_NAME: ${{ github.ref }}
run: |
Copy-Item .\changelog.md .\dist
- uses: actions/upload-artifact@v2
with:
name: dcs_liberation
path: dist/
- uses: actions/upload-artifact@v2
with:
name: dcs_liberation
path: dist/
release:
needs: [ build ]
needs: [build]
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v2
with:
name: dcs_liberation
- uses: actions/download-artifact@v2
with:
name: dcs_liberation
- name: "Get Version"
id: version
env:
TAG_NAME: ${{ github.ref }}
run: |
Get-ChildItem -Recurse -Depth 1
$version = ($env:TAG_NAME -split "/") | Select-Object -Last 1
$prerelease = ("2.1.1-alpha3" -match '[^\.\d]').ToString().ToLower()
Write-Host $version
Write-Host $prerelease
Write-Output "::set-output name=number::$version"
Write-Output "::set-output name=prerelease::$prerelease"
$changelog = Get-Content .\changelog.md
$last_change = ($changelog | Select-String -Pattern "^#\s" | Select-Object -Skip 1 -First 1).LineNumber - 2
($changelog | Select-Object -First $last_change) -join "`n" | Out-File .\releasenotes.md
Compress-Archive -Path .\dcs_liberation -DestinationPath "dcs_liberation.$version.zip" -Compression Optimal
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: releasenotes.md
draft: false
prerelease: ${{ steps.version.outputs.prerelease }}
- name: "Get Version"
id: version
env:
TAG_NAME: ${{ github.ref }}
run: |
Get-ChildItem -Recurse -Depth 1
$version = ($env:TAG_NAME -split "/") | Select-Object -Last 1
$prerelease = ("2.1.1-alpha3" -match '[^\.\d]').ToString().ToLower()
Write-Host $version
Write-Host $prerelease
Write-Output "::set-output name=number::$version"
Write-Output "::set-output name=prerelease::$prerelease"
$changelog = Get-Content .\changelog.md
$last_change = ($changelog | Select-String -Pattern "^#\s" | Select-Object -Skip 1 -First 1).LineNumber - 2
($changelog | Select-Object -First $last_change) -join "`n" | Out-File .\releasenotes.md
Compress-Archive -Path .\dcs_liberation -DestinationPath "dcs_liberation.$version.zip" -Compression Optimal
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: releasenotes.md
draft: false
prerelease: ${{ steps.version.outputs.prerelease }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dcs_liberation.${{ steps.version.outputs.number }}.zip
asset_name: dcs_liberation.${{ steps.version.outputs.number }}.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dcs_liberation.${{ steps.version.outputs.number }}.zip
asset_name: dcs_liberation.${{ steps.version.outputs.number }}.zip
asset_content_type: application/zip

38
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Tests
on: workflow_call
jobs:
python-tests:
name: Python tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python environment
uses: ./.github/actions/setup-liberation-python
- name: run tests
run: |
./venv/scripts/activate
pytest --cov-report=xml tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
ts-tests:
name: Typescript tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JS environment
uses: ./.github/actions/setup-liberation-js
- name: run tests
run: |
cd client
npm test -- --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

12
.gitignore vendored
View File

@@ -1,14 +1,14 @@
*.pyc
__pycache__
build/**
# Sphinx
docs/_build
resources/payloads/*.lua
venv
logs.txt
.DS_Store
.vscode/settings.json
dist/**
a.py
resources/tools/a.miz
/.coverage
# User-specific stuff
.idea/
.env
@@ -17,9 +17,9 @@ env/
/kneeboards
/liberation_preferences.json
/state.json
/serverconfig.env
logs/
qt_ui/logs/liberation.log
/logs/
/resources/logging.yaml
*.psd

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.12.0
hooks:
- id: black
language_version: python3

13
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,13 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt

39
.vscode/launch.json vendored
View File

@@ -15,6 +15,32 @@
},
"preLaunchTask": "Prepare Environment"
},
{
"name": "Python: Debug",
"type": "python",
"request": "launch",
"program": "qt_ui\\main.py",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": ".;./pydcs",
"CORS_ALLOW_DEBUG_SERVER": "true"
},
"args": ["--dev"],
"preLaunchTask": "Prepare Environment"
},
{
"name": "Node: Development Server",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}\\client",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run", "start"
],
"env": {
"BROWSER": "none"
},
},
{
"name": "Python: Make Release",
"type": "python",
@@ -25,6 +51,17 @@
"PYTHONPATH": ".;./pydcs"
},
"preLaunchTask": "Prepare Environment"
}
},
{
"name": "Fix Layout orientation",
"type": "python",
"request": "launch",
"program": "resources\\tools\\fix_layout_orientation.py",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": ".;./pydcs"
},
"args": ["resources/layouts/anti_air/S-300_Site.miz"]
},
]
}

View File

@@ -1,4 +1,6 @@
![Logo](https://i.imgur.com/c2k18E1.png)
[![Logo](https://i.imgur.com/HJBT4BL.png)](https://shdwp.github.io/ukraine/)
(Github Readme Banner and Splash screen Artwork by Andriy Dankovych, CC BY-SA 4.0)
[![Patreon](https://img.shields.io/badge/patreon-become%20a%20patron-orange?logo=patreon)](https://patreon.com/khopa)
@@ -12,7 +14,12 @@
## About DCS Liberation
DCS Liberation is a [DCS World](https://www.digitalcombatsimulator.com/en/products/world/) turn based single-player or co-op dynamic campaign.
It is an external program that generates full and complex DCS missions and manage a persistent combat environment.
It is an external program that generates full and complex DCS missions and manage a persistent combat environment.
**Note that DCS Liberation does not support the stable release of DCS. We can
only guarantee compatibility with either the open beta or the stable release,
and more people play the open beta. DCS stable _might_ work sometimes, but it's
untested, and we will be unable to fix any bugs unique to stable DCS.**
![Screenshot](https://user-images.githubusercontent.com/315852/120939254-0b4a9f80-c6cc-11eb-82f5-ce3f8d714bfe.png)

View File

@@ -1,16 +1,265 @@
# 4.1.2
# 7.1.0
Saves from 4.1.1 are compatible with 4.1.2.
Saves from 7.0.0 are compatible with 7.1.0
## 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
* **[Engine]** Support for Normandy 2 airfields.
* **[Factions]** Replaced Patriot STRs "EWRs" with AN/FPS-117 for blue factions 1980 or newer.
* **[Mission Generation]** Added option to prevent scud and V2 sites from firing at the start of the mission.
* **[Mission Generation]** Added settings for controlling number of tactical commander, observer, JTAC, and game master slots.
* **[Mission Planning]** Per-flight TOT offsets can now be set in the flight details UI. This allows individual flights to be scheduled ahead of or behind the rest of the package.
* **[New Game Wizard]** The air wing configuration dialog will check for and reject overfull airbases before continuing when the new squadron rules are used.
* **[New Game Wizard]** Closing the air wing configuration dialog will now cancel and return to the new game wizard rather than reverting changes and continuing.
* **[New Game Wizard]** A warning will be displayed next to the new squadron rules button if the campaign predates the new rules and will likely require user intervention before continuing.
* **[UI]** Parking capacity of each squadron's base is now shown during air wing configuration to avoid overcrowding bases when beginning the game with full squadrons.
## Fixes
* **[UI]** Selling of Units is now visible again in the UI dialog and shows the correct amount of sold units
* **[Mission Planning]** BAI is once again plannable against missile sites and coastal defense batteries.
* **[UI]** Fixed formatting of departure time in flight details dialog.
# 7.0.0
Saves from 6.x are not compatible with 7.0.
## Features/Improvements
* **[Engine]** Support for DCS 2.8.5.40170.
* **[Engine]** Saved games are now a zip file of save assets for easier bug reporting. The new extension is .liberation.zip. Drag and drop that file into bug reports.
* **[Campaign]** Added options to limit squadron sizes and to begin all squadrons at maximum strength. Maximum squadron size is defined during air wing configuration with default values provided by the campaign.
* **[Campaign]** Added handling for more DCS death events. This probably does not catch any deaths that weren't previously tracked, but it should record them sooner, which will improve results for game crashes or other early exits.
* **[Campaign AI]** The campaign AI now prefers fulfilling missions with squadrons which have a matching primary task. Previously distance from target held a stronger influence than task preference. Primary tasks for squadrons are set by campaign designers but are user-configurable.
* **[Flight Planning]** Package TOT and composition can be modified after advancing time in Liberation.
* **[Mission Generation]** Units on the front line are now hidden on MFDs.
* **[Mission Generation]** Preset radio channels will now be configured for both A-10C modules.
* **[Mission Generation]** The A-10C II now uses separate radios for inter- and intra-flight comms (similar to other modern aircraft).
* **[Mission Generation]** Wind speeds no longer follow a uniform distribution. Median wind speeds are now much lower and the standard deviation has been reduced considerably at altitude but increased somewhat at MSL.
* **[Mission Generation]** Improved task generation for SEAD flights carrying TALDs.
* **[Mission Generation]** Added task timeout for SEAD flights with TALDs to prevent AI from overflying the target.
* **[Mission Generation]** Game state will automatically be checkpointed before fast-forwarding the mission, and restored on mission abort. This means that it's now possible to abort a mission and make changes without needing to manually re-load your game.
* **[Modding]** Updated Community A-4E-C mod version support to 2.1.0 release.
* **[Modding]** Add support for VSN F-4B and F-4C mod.
* **[Modding]** Added support for AI C-47 mod.
* **[Modding]** Custom factions can now be defined in YAML as well as JSON. JSON support may be removed in the future if having both formats causes confusion.
* **[Modding]** Campaigns which require custom factions can now define those factions directly in the campaign YAML. See Operation Aliied Sword for an example.
* **[Modding]** The `mission_types` field in squadron files has been removed. Squadron task capability is now determined by airframe, and the auto-assignable list has always been overridden by the campaign settings.
* **[Modding]** Aircraft task capabilities and preferred aircraft for each task are now moddable in the aircraft unit yaml files. Each aircraft has a weight per task. Higher weights are given higher preference.
* **[Modding]** Wind speed generation inputs are now moddable. See https://dcs-liberation.rtfd.io/en/latest/modding/weather.html.
* **[New Game Wizard]** Choices for some options will be remembered for the next new game. Not all settings will be preserved, as many are campaign dependent.
* **[New Game Wizard]** Lua plugins can now be set while creating a new game.
* **[New Game Wizard]** Squadrons can be directly replaced with a preset during air wing configuration rather than needing to remove and create a new squadron.
* **[New Game Wizard]** Squadron liveries can now be selected during air wing configuration.
* **[Squadrons]** Squadron-specific mission capability lists no longer restrict players from assigning missions outside the squadron's preferences.
* **[UI]** The orientation of objects like SAMs, EWRs, garrisons, and ships can now be manually adjusted.
## Fixes
* **[Campaign]** Fixed a longstanding bug where oversized airlifts could corrupt a save with empty convoys.
* **[Campaign]** Aircraft with built-in TGPs but without an external pod will no longer degrade automatic loadouts to iron bombs.
* **[Engine]** Fixed crash in startup caused by a corrupted Liberation preferences file.
* **[Flight Planning]** AEW&C missions are now plannable over FOBs and LHAs.
* **[Flight Planning]** BAI is no longer plannable against buildings.
* **[Modding]** Fixed an issue where Falklands campaigns created or edited with new versions of DCS could not be loaded.
* **[Modding]** Fixed decoding of campaign yaml files to use UTF-8 rather than the system locale's default. It's now possible to use "Bf 109 K-4 Kurfürst" as a preferred aircraft type.
* **[Mission Generation]** Planes will no longer spawn in helipads that are not also designated for fixed wing parking.
* **[Mission Generation]** Potentially an issue where ground war planning game state could become corrupted, preventing mission generation.
* **[Mission Generation]** Refueling tasks will now only be created for flights that have a tanker in their package.
* **[Mission Generation]** Fixed missing Tanker task on recovery tanker missions.
* **[UI]** Fixed error when resetting air wing configuration during game setup.
* **[UI]** Fixed flight plan recreation when changing mission type with "Recreate as" flight options.
* **[UI]** Fixed failure to launch UI when Liberation persistent preferences file was corrupt.
# 6.1.1
## Fixes
* **[Data]** Fixed unit ID for the KS-19 AAA. KS-19 would not previously generate correctly in missions. A new game is required for this fix to take effect.
* **[Flight Planning]** Automatic flight planning will no longer accidentally plan a recovery tanker instead of a theater refueling package. This fixes a potential crash during mission generation when opfor plans a refueling task at a sunk carrier. You'll need to skip the current turn to force opfor to replan their flights to get the fix.
* **[Mission Generation]** Using heliports (airports without any runways) will no longer cause mission generation to fail.
* **[Mission Generation]** Prevent helicopters from spawning into collisions at FARPs when more than one flight uses the same FARP.
# 6.1.0
Saves from 6.0.0 are compatible with 6.1.0
## Features/Improvements
* **[Engine]** Support for DCS 2.8.1.34437, including Blackshark 3.
* **[Factions]** Defaulted bluefor modern to use Georgian and Ukrainian liveries for Russian aircraft.
* **[Factions]** Added Peru.
* **[Flight Planning]** AEW&C and Refueling flights are now plannable on LHA carriers.
* **[Flight Planning]** Refueling flights planned on aircraft carriers will act as a recovery tanker for the carrier.
* **[Loadouts]** Adjusted F-15E loadouts.
* **[Mission Generation]** The previous turn will now be saved as last_turn.liberation when submitting mission results. This is often essential for debugging bug reports. **Include this file in the bug report whenever it is available.**
* **[Modding]** Added support for the HMS Ariadne, Achilles, and Castle class.
* **[Modding]** Added HMS Invincible to the game data as a helicopter carrier.
## Fixes
* **[Flight Planning]** Fixes CAS flights not having landing waypoints.
* **[Mission Generation]** Airbase and FOB capture is no longer blocked by grounded aircraft / helicopters.
* **[Squadrons]** Fixed the livery for the VF-33 F-14A squadron.
* **[Theaters]** Fixed Channel campaigns not having data for land/sea/obstacle boundaries, causing front lines to extend into forests and water. Requires a new campaign to get the fix.
* **[UI]** Fixed an issue where manual submit of mission results did not end the mission correctly.
# 6.0.0
Saves from 5.x are not compatible with 6.0.
## Features/Improvements
* **[Engine]** Support for DCS 2.8.0.33006.
* **[Factions]** Updated the Faction file structure. Older custom faction files will not work correctly and have to be updated to the new structure.
* **[Flight Planning]** Added preset formations for different flight types at hold, join, ingress, and split waypoints. Air to Air flights will tend toward line-abreast and spread-four formations. Air to ground flights will tend towards trail formation.
* **[Flight Planning]** Added the ability to plan tankers for recovery on package flights. This mission type will not be planned automatically.
* **[Flight Planning]** Air to Ground flights now have ECM enabled on lock at the join point, and SEAD/DEAD also have ECM enabled on detection and lock at ingress.
* **[Flight Planning]** AWACS flightplan changed from orbit to a racetrack to reduce data link disconnects which were caused by blind spots as a result of the bank angle.
* **[Flight Planning]** Added a new helo mission type: AirAssault which can be used to load and transport infantry troops from a pickup zone or a carrier to an enemy CP to capture it.
* **[Flight Planning]** Improved the Airlift mission type so that it now can be enforced within the unit transfer dialog and implemented CTLD support. This allows user to spawn sling loadable crates at the pickup location and fly transport flights.
* **[Mission Generation]** Added an option to fast-forward mission generation until the point of first contact (WIP).
* **[Mission Generation]** Added performance option to not cull IADS when culling would affect how mission is played at target area.
* **[Mission Generation]** Reworked the ground object generation which now uses a new layout system
* **[Mission Generation]** Added information about the modulation (AM/FM) of the assigned frequencies to the kneeboard and assign AM modulation instead of FM for JTAC.
* **[Mission Generation]** Added ice halos.
* **[Mission Generation]** Adjusted wind speeds. Wind speeds at high altitude are generally higher now.
* **[Mission Generation]** Added turbulence. Higher in Summer and Winter, also higher at day time than at nighttime.
* **[Modding]** Updated UH-60L mod version support to 1.3.1
* **[Modding]** Updated the High Digit SAMs implementation and added the HQ-2 as well as the upgraded SA-2 and SA-3 Launchers from the mod. Threat range circles will now also be displayed correctly.
* **[Modding]** Theater information such as climate properties is now moddable.
* **[Modding]** Allow campaign designers to define default values for the economy settings (starting budget and multiplier).
* **[Modding]** Campaigns can now optionally define their start time by including a time in the `recommended_start_date` field. There is not currently a way to override the start time in the UI.
* **[Plugins]** Allow full support of the SkynetIADS plugin with all advanced features (connection nodes, power sources, command centers) if campaign supports it.
* **[Plugins]** Added support for the CTLD script by ciribob with many possible customization options and updated the JTAC Autolase to the CTLD included script.
* **[UI]** Added options to the loadout editor for setting properties such as HMD choice.
* **[UI]** Added separate images for the different carrier types.
* **[UI]** Add Accept/Reset buttons to Air Wing Configurator screen.
## Fixes
* **[Engine]** Fixed issue that prevented some weapon types like torpedoes from being recognized.
* **[Flight Planning]** Fixed a miscalculation of waypoint TOTs that would require time travel.
* **[Loadouts]** Improved the range of the F-16 CAS loadout by adding bags.
* **[Mission Generation]** AAA ground units now spawn correctly at the frontline
* **[Mission Generation]** Fixed SA-13 incorrectly created as SA-8 Loading Unit which will not be spawned in the generated mission.
* **[Mission Generation]** Fixed adding additional mission types for a squadron causing error messages when the mission type is not supported by the aircraft type by default
* **[Mission Generation]** Fixed an issue where SEAD/DEAD/BAI flights fired all missiles / bombs against a single unit in a group instead of targeting the whole group.
* **[Mission Generation]** Fixed an issue which generated the helipads at FARPs incorrectly and placed the helicopters within each other.
* **[Mission Generation]** Fixed an issue with SEAD missions flown by the AI when using the Skynet Plugin and anti-radiation missiles (ARM). The AI now correctly engages the SAM when it comes alive instead of diving into it.
* **[Mission Generation]** Fixed generation issue that would cause AI helicopters to get stuck after taking off from a FARP.
* **[Mission Generation]** Fixed mission scripting error caused by control points with apostrophes in their names, such as Tha'lah.
* **[Modding]** Campaigns that used quad zones for scenery targets will no longer load. Only circular zones were ever supported, but an implementation quirk allowed them to load in a way that would misbehave. A "No white triggerzones found" message during campaign generation is the sign of a broken campaign.
* **[Modding]** Loadouts with invalid weapons (typically new DCS weapons not yet available in Liberation) will be ignored rather than causing an error.
* **[Squadrons]** Fixed issue in air wing configuration that would allow squadrons to be created with no home base if no base was available.
* **[Squadrons]** Helicopter squadrons can no longer be assigned to FOBs that are not FARPs.
* **[UI]** Add vanilla theme weather and time of day icons
* **[UI]** Disable player slots for non-flyable aircraft.
* **[UI]** Fixed and issue where the liberation main exe was still running after application close.
# 5.2.1
## Fixes
* **[Mission Generation]** Work around DCS 2.8 bug preventing the AI from leaving their hold point.
# 5.2.0
Saves from 5.1.0 are compatible with 5.2.0
## Features/Improvements
* **[Engine]** Support for DCS 2.7.11.21408, including the new Apache AH-64D and the Syria map extension
* **[Mission Generation]** Improved FARP Helipad handling and creation (now includes windsocks)
* **[Modding]** Add UH-60L mod support
* **[Modding]** Updated Community A-4E-C mod version support to 2.0.0 release. Version 1.4.2 is no longer compatible, unless the mod default loadouts are deleted/modified.
* **[Modding]** Updated JAS-39-C mod support for v1.8.0-beta
* **[Campaign]** Peace Spring, Vectron's Claw, Vegas Nerve, Scenic Route 2 campaign update
* **[Campaign]** Added Tripoint Hostility campaign by Fuzzle
* **[Campaign]** Add 3 new campaigns from Sith1144
## Fixes
* **[Mission Generation]** Fixed incorrect SA-5 and NASAMS threat range when TR destroyed. It will not count as threat anymore when the TR is dead.
* **[Mission Generation]** Fixed "Max Threat Range" error
* **[Mission Generation]** Fix unculled zones not updating when needed
* **[Mission Planner]** Now allows squadron transfers to control points where the number of free slots matches exactly the expected size of the transferring squadron next turn.
* **[Data]** Removed Fw 190 A-8 and D-9 from Germany 1940 and 1942 faction list for historical accuracy.
* **[Data]** Updated Loadouts for Tornado GR4, F-15E and F-16C
* **[Data]** Corrected some unit data
* **[UI]** Fixed various UI issues (for example Scaling and HighDPI)
* **[UI]** Typhoon GR4 and IDS images
# 5.1.0
Saves from 5.0.0 are compatible with 5.1.0
## Features/Improvements
* **[Engine]** Support for DCS 2.7.9.17830 and newer, including the HTS and ECM pod.
* **[Campaign]** Add option to manually add and remove squadrons and different aircraft type in the new game wizard / air wing configuration dialog.
* **[Mission Generation]** Add Option to enforce the Easy Communication setting for the mission
* **[Mission Generation]** Add Option to select between only night missions, day missions or any time (default).
* **[Modding]** Add F-104 mod support
## Fixes
* **[Campaign]** Fixed some minor issues in campaigns which generated error messages in the log.
* **[Campaign]** Changed the way how map object / scenery kills where tracked. This fixes issues with kill recognition after map updates from ED which change the object ids and therefore prevent correct kill recognition.
* **[Mission Generation]** Fixed incorrect radio specification for the AN/ARC-222.
* **[Mission Generation]** Fixed mission scripting error when using a dedicated server.
* **[Mission Generation]** Fixed an issue where empty convoys lead to an index error when a point capture made a pending transfer of units not completable anymore.
* **[Mission Generation]** Corrected Viggen FR22 & FR24 preset channels for the DCS 2.7.9 update
* **[Mission Generation]** Fixed the SA-5 Generator to use the P-19 FlatFace SR as a Fallback radar if the faction does not have access to the TinShield SR.
* **[UI]** Enable / Disable the settings, save and stats actions if no game is loaded to prevent an error as these functions can only be used on a valid game.
* **[UI]** Added missing icons for Tornado GR4, and Tornado IDS.
# 5.0.0
Saves from 4.x are not compatible with 5.0.
## Features/Improvements
* **[Campaign]** Weather! Theaters now experience weather that is more realistic for the region and its current season. For example, Persian Gulf will have very hot, sunny summers and Marianas will experience lots of rain during fall. These changes affect pressure, temperature, clouds and precipitation. Additionally, temperature will drop during the night, by an amount that is somewhat realistic for the region.
* **[Campaign]** Weapon data such as fallbacks and introduction years is now moddable. Due to the new architecture to support this, the old data was not automatically migrated.
* **[Campaign]** Era-restricted loadouts will now skip LGBs when no TGP is available in the loadout. This only applies to default loadouts; buddy-lasing can be coordinated with custom loadouts.
* **[Campaign]** FOBs control point can have FARP/helipad slot and host helicopters. To enable this feature on a FOB, add "Invisible FARP" statics objects near the FOB location in the campaign definition file.
* **[Campaign]** Squadrons now have a home base and will not operate out of other bases. See https://github.com/dcs-liberation/dcs_liberation/issues/1145 for status.
* **[Campaign]** Aircraft now belong to squadrons rather than bases to support squadron location transfers.
* **[Campaign]** Skipped turns are no longer counted as defeats on front lines.
* **[Campaign AI]** Overhauled campaign AI target prioritization.
* **[Campaign AI]** Player front line stances can now be automated. Improved stance selection for AI.
* **[Campaign AI]** Reworked layout of hold, join, split, and ingress points. Should result in much shorter flight plans in general while still maintaining safe join/split/hold points.
* **[Campaign AI]** Auto-planning mission range limits are now specified per-aircraft. On average this means that longer range missions will now be plannable. The limit only accounts for the direct distance to the target, not the path taken.
* **[Campaign AI]** Transport aircraft will now be bought only if necessary at control points which can produce ground units and are capable to operate transport aircraft.
* **[Campaign AI]** Aircraft will now only be automatically purchased or assigned at appropriate bases. Naval aircraft will default to only operating from carriers, Harriers will default to LHAs and shore bases, helicopters will operate from anywhere. This can be customized per-squadron.
* **[Engine]** Support for DCS 2.7.7.14727 and newer, including support for F-16 CBU-105s, SA-5s, and the Forrestal.
* **[Kneeboard]** Minimum required fuel estimates have been added to the kneeboard for aircraft with supporting data (currently only the Hornet and Viper).
* **[Kneeboard]** QNH (pressure MSL) and temperature have been added to the kneeboard.
* **[Mission Generation]** EWRs are now also headed towards the center of the conflict
* **[Mission Generation]** FACs can now use FC3 compatible laser codes. Note that this setting is global, not per FAC.
* **[Modding]** Can now install custom campaigns to <DCS saved games>/Liberation/Campaigns instead of the Liberation install directory.
* **[Modding]** Campaigns can now define a default start date.
* **[Modding]** Campaigns now specify the squadrons that are present in the campaign, their roles, and their starting bases. Players can customize this at game start but the campaign will choose the defaults.
* **[New Game Wizard]** Can now customize the player's air wing before campaign start to disable, relocate, or rename squadrons.
* **[Plugins]** Updated SkynetIADS to 2.4.0 (adds SA-5 support).
* **[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
* **[UI]** Enemy aircraft inventory now viewable in the air wing menu.
## Fixes
* **[Campaign]** Naval control points will no longer claim ground objectives during campaign generation and prevent them from spawning.
* **[Campaign]** Units aboard sunk cargo ships will now have their losses tracked properly.
* **[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.
* **[Mission Generation]** Fixed generation of landing waypoints so that the AI obeys them.
* **[Mission Generation]** AI carrier aircraft with a start time of T+0 will now start at T+1s to avoid traffic jams.
* **[Mission Generation]** Fixed cases of unused aircraft not being spawned at airfields as soon as any airport filled up.
* **[Mission Generation]** Fixed cases with multiple client flights of the same airframe all received the same preset channels.
* **[Mission Generation]** F-14A is now generated with stored alignment.
* **[Mission Generation]** Su-33s set to cold or warm start on the Kuznetsov will always be generated as runway starts to avoid the AI getting stuck.
* **[Mission Generation]** Fixed AI not receiving anti-ship tasks against carriers and LHAs.
* **[Mods]** Fixed broken A-4 support causing no weapons to be available.
* **[UI]** Selling of Units is now visible again in the UI dialog and shows the correct amount of sold units
* **[UI]** Fixed bug where an incompatible campaign could be generated if no action is taken on the campaign selection screen.
# 4.1.1
@@ -35,8 +284,8 @@ Saves from 4.0.0 are compatible with 4.1.0.
* **[Flight Planning]** CAP patrol altitudes are now set per-aircraft. By default the altitude will be set based on the aircraft's maximum speed.
* **[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
* **[Mods]** Support for latest version of Gripen mod. In-progress campaigns may need to re-plan Gripen flights to pick up updated loadouts.
* **[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.
@@ -62,7 +311,7 @@ Saves from 4.0.0 are compatible with 4.1.0.
* **[Mission Generation]** Planned transfers which will be impossible after a base capture will no longer prevent the mission result submit.
* **[Mission Generation]** Fix occasional KeyError preventing mission generation when all units of the same type in a convoy were killed.
* **[Mission Generation]** Fix for AAA Flak generator using Opel Blitz preventing the mission from being generated because duplicate unit names were used.
* **[Campaign AI]** Transport aircraft will now be bought only if necessary at control points which can produce ground units and are capable to operate transport aircraft.
* **[Mission Generation]** Fixed a potential bug with laser code generation where it would generate invalid codes.
* **[UI]** Statistics window tick marks are now always integers.
* **[UI]** Statistics window now shows the correct info for the turn
* **[UI]** Toggling custom loadout for an aircraft with no preset loadouts no longer breaks the flight.

26
client/.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode/settings.json
.vscode/tasks.json

10
client/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"configurations": [
{
"type": "pwa-chrome",
"name": "http://localhost:3000",
"request": "launch",
"url": "http://localhost:3000"
}
]
}

76
client/README.md Normal file
View File

@@ -0,0 +1,76 @@
# DCS Liberation Client
This is a React app for the front-end of DCS Liberation. It is a work in
progress that just barely implements the map. This is not useful for players
yet.
For development, set the following environment variables when launching DCS
Liberation (the Qt UI):
- `CORS_ALLOW_DEBUG_SERVER=true`
This will allow the front-end to make requests to the server, as long as the
front-end is running on http://localhost:3000.
Then, run `npm start` to start the development server. Launch the Qt UI with
`--new-map --dev` to connect the webview to the development server, or navigate
to http://localhost:3000 in your browser.
## Regenerating the API stubs
The backend uses FastAPI which exposes `/openapi.json`. This is consumed by
`@rtk-query/codegen-openapi` to automatically generate the API stubs in
`src/api/liberationApi.ts`.
If you make a change to the API surface the typescript API will need to be
regenerated. To do this, first launch Liberation (to start the backend) and run
```powershell
npm run regenerate-api
```
See https://redux-toolkit.js.org/rtk-query/usage/code-generation for more
information.
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

57
client/main.js Normal file
View File

@@ -0,0 +1,57 @@
const path = require("path");
const { app, BrowserWindow } = require("electron");
const isDev = require("electron-is-dev");
const windowStateKeeper = require("electron-window-state");
function createWindow() {
let mainWindowState = windowStateKeeper({
defaultWidth: 1000,
defaultHeight: 800,
});
// Create the browser window.
const win = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
show: false,
webPreferences: {
nodeIntegration: true,
},
});
mainWindowState.manage(win);
// and load the index.html of the app.
// win.loadFile("index.html");
win.loadURL(
isDev
? "http://localhost:3000"
: `file://${path.join(__dirname, "../build/index.html")}`
);
// Open the DevTools.
if (isDev) {
win.webContents.openDevTools({ mode: "detach" });
}
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow);
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});

12
client/openapi-config.ts Normal file
View File

@@ -0,0 +1,12 @@
import { ConfigFile } from "@rtk-query/codegen-openapi";
const config: ConfigFile = {
schemaFile: "http://[::1]:16880/openapi.json",
apiFile: "./src/api/baseApi.ts",
apiImport: "baseApi",
outputFile: "./src/api/_liberationApi.ts",
exportName: "_liberationApi",
hooks: true,
};
export default config;

36432
client/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

86
client/package.json Normal file
View File

@@ -0,0 +1,86 @@
{
"name": "liberation-client",
"version": "0.1.0",
"private": true,
"main": "main.js",
"license": "LGPL-3.0-or-later",
"homepage": ".",
"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.1.2",
"@types/node": "^18.8.3",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/react-redux": "^7.1.24",
"axios": "^1.1.2",
"electron-window-state": "^5.0.3",
"esri-leaflet": "^3.0.8",
"leaflet": "^1.9.2",
"leaflet-ruler": "^1.0.0",
"milsymbol": "^2.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-esri-leaflet": "^2.0.1",
"react-leaflet": "^4.1.0",
"react-redux": "^8.0.4",
"redux-logger": "^3.0.6",
"typescript": "~4.8.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && generate-license-file --input package.json --output build/NOTICE",
"regenerate-api": "rtk-query-codegen-openapi ./openapi-config.ts",
"lint": "eslint src",
"prepare": "eslint src && license-checker --onlyAllow \"MIT;Apache-2.0;CC0-1.0;BSD-3-Clause;ISC;Custom: https://github.com/tmcw/jsonlint;BSD-2-Clause;Hippocratic-2.1;BSD*;WTFPL\" --excludePrivatePackages --production",
"test": "react-scripts test",
"eject": "react-scripts eject",
"electron": "wait-on tcp:3000 && electron ."
},
"eslintConfig": {
"extends": "react-app"
},
"eslintIgnore": [
"leaflet-ruler.d.ts"
],
"prettier": {
"endOfLine": "auto"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@rtk-query/codegen-openapi": "^1.0.0",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"@types/leaflet": "^1.8.0",
"@types/redux-logger": "^3.0.9",
"@types/websocket": "^1.0.5",
"electron": "^21.1.0",
"electron-is-dev": "^2.0.0",
"generate-license-file": "^2.0.0",
"identity-obj-proxy": "^3.0.0",
"license-checker": "^25.0.1",
"react-scripts": "5.0.1",
"ts-node": "^10.9.1",
"wait-on": "^6.0.1"
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(@?react-leaflet|axios)/)"
],
"moduleNameMapper": {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
}
}
}

BIN
client/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

43
client/public/index.html Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React Redux App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

BIN
client/public/logo192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
client/public/logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

3
client/public/robots.txt Normal file
View File

@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

12
client/src/App.test.tsx Normal file
View File

@@ -0,0 +1,12 @@
import App from "./App";
import { store } from "./app/store";
import { render } from "@testing-library/react";
import { Provider } from "react-redux";
test("app renders", () => {
render(
<Provider store={store}>
<App />
</Provider>
);
});

16
client/src/App.tsx Normal file
View File

@@ -0,0 +1,16 @@
import LiberationMap from "./components/liberationmap";
import useEventStream from "./hooks/useEventSteam";
import useInitialGameState from "./hooks/useInitialGameState";
function App() {
useInitialGameState();
useEventStream();
return (
<div className="App">
<LiberationMap />
</div>
);
}
export default App;

View File

@@ -0,0 +1,524 @@
import { baseApi as api } from "./baseApi";
const injectedRtkApi = api.injectEndpoints({
endpoints: (build) => ({
listControlPoints: build.query<
ListControlPointsApiResponse,
ListControlPointsApiArg
>({
query: () => ({ url: `/control-points/` }),
}),
getControlPointById: build.query<
GetControlPointByIdApiResponse,
GetControlPointByIdApiArg
>({
query: (queryArg) => ({ url: `/control-points/${queryArg.cpId}` }),
}),
controlPointDestinationInRange: build.query<
ControlPointDestinationInRangeApiResponse,
ControlPointDestinationInRangeApiArg
>({
query: (queryArg) => ({
url: `/control-points/${queryArg.cpId}/destination-in-range`,
params: { lat: queryArg.lat, lng: queryArg.lng },
}),
}),
setControlPointDestination: build.mutation<
SetControlPointDestinationApiResponse,
SetControlPointDestinationApiArg
>({
query: (queryArg) => ({
url: `/control-points/${queryArg.cpId}/destination`,
method: "PUT",
body: queryArg.body,
}),
}),
clearControlPointDestination: build.mutation<
ClearControlPointDestinationApiResponse,
ClearControlPointDestinationApiArg
>({
query: (queryArg) => ({
url: `/control-points/${queryArg.cpId}/cancel-travel`,
method: "PUT",
}),
}),
getDebugHoldZones: build.query<
GetDebugHoldZonesApiResponse,
GetDebugHoldZonesApiArg
>({
query: (queryArg) => ({
url: `/debug/waypoint-geometries/hold/${queryArg.flightId}`,
}),
}),
getDebugIpZones: build.query<
GetDebugIpZonesApiResponse,
GetDebugIpZonesApiArg
>({
query: (queryArg) => ({
url: `/debug/waypoint-geometries/ip/${queryArg.flightId}`,
}),
}),
getDebugJoinZones: build.query<
GetDebugJoinZonesApiResponse,
GetDebugJoinZonesApiArg
>({
query: (queryArg) => ({
url: `/debug/waypoint-geometries/join/${queryArg.flightId}`,
}),
}),
listFlights: build.query<ListFlightsApiResponse, ListFlightsApiArg>({
query: (queryArg) => ({
url: `/flights/`,
params: { with_waypoints: queryArg.withWaypoints },
}),
}),
getFlightById: build.query<GetFlightByIdApiResponse, GetFlightByIdApiArg>({
query: (queryArg) => ({
url: `/flights/${queryArg.flightId}`,
params: { with_waypoints: queryArg.withWaypoints },
}),
}),
getCommitBoundaryForFlight: build.query<
GetCommitBoundaryForFlightApiResponse,
GetCommitBoundaryForFlightApiArg
>({
query: (queryArg) => ({
url: `/flights/${queryArg.flightId}/commit-boundary`,
}),
}),
listFrontLines: build.query<
ListFrontLinesApiResponse,
ListFrontLinesApiArg
>({
query: () => ({ url: `/front-lines/` }),
}),
getFrontLineById: build.query<
GetFrontLineByIdApiResponse,
GetFrontLineByIdApiArg
>({
query: (queryArg) => ({ url: `/front-lines/${queryArg.frontLineId}` }),
}),
getGameState: build.query<GetGameStateApiResponse, GetGameStateApiArg>({
query: () => ({ url: `/game/` }),
}),
getTerrainZones: build.query<
GetTerrainZonesApiResponse,
GetTerrainZonesApiArg
>({
query: () => ({ url: `/map-zones/terrain` }),
}),
listUnculledZones: build.query<
ListUnculledZonesApiResponse,
ListUnculledZonesApiArg
>({
query: () => ({ url: `/map-zones/unculled` }),
}),
getThreatZones: build.query<
GetThreatZonesApiResponse,
GetThreatZonesApiArg
>({
query: () => ({ url: `/map-zones/threats` }),
}),
getNavmesh: build.query<GetNavmeshApiResponse, GetNavmeshApiArg>({
query: (queryArg) => ({
url: `/navmesh/`,
params: { for_player: queryArg.forPlayer },
}),
}),
openNewFrontLinePackageDialog: build.mutation<
OpenNewFrontLinePackageDialogApiResponse,
OpenNewFrontLinePackageDialogApiArg
>({
query: (queryArg) => ({
url: `/qt/create-package/front-line/${queryArg.frontLineId}`,
method: "POST",
}),
}),
openNewTgoPackageDialog: build.mutation<
OpenNewTgoPackageDialogApiResponse,
OpenNewTgoPackageDialogApiArg
>({
query: (queryArg) => ({
url: `/qt/create-package/tgo/${queryArg.tgoId}`,
method: "POST",
}),
}),
openTgoInfoDialog: build.mutation<
OpenTgoInfoDialogApiResponse,
OpenTgoInfoDialogApiArg
>({
query: (queryArg) => ({
url: `/qt/info/tgo/${queryArg.tgoId}`,
method: "POST",
}),
}),
openNewControlPointPackageDialog: build.mutation<
OpenNewControlPointPackageDialogApiResponse,
OpenNewControlPointPackageDialogApiArg
>({
query: (queryArg) => ({
url: `/qt/create-package/control-point/${queryArg.cpId}`,
method: "POST",
}),
}),
openControlPointInfoDialog: build.mutation<
OpenControlPointInfoDialogApiResponse,
OpenControlPointInfoDialogApiArg
>({
query: (queryArg) => ({
url: `/qt/info/control-point/${queryArg.cpId}`,
method: "POST",
}),
}),
listSupplyRoutes: build.query<
ListSupplyRoutesApiResponse,
ListSupplyRoutesApiArg
>({
query: () => ({ url: `/supply-routes/` }),
}),
listTgos: build.query<ListTgosApiResponse, ListTgosApiArg>({
query: () => ({ url: `/tgos/` }),
}),
getTgoById: build.query<GetTgoByIdApiResponse, GetTgoByIdApiArg>({
query: (queryArg) => ({ url: `/tgos/${queryArg.tgoId}` }),
}),
listAllWaypointsForFlight: build.query<
ListAllWaypointsForFlightApiResponse,
ListAllWaypointsForFlightApiArg
>({
query: (queryArg) => ({ url: `/waypoints/${queryArg.flightId}` }),
}),
setWaypointPosition: build.mutation<
SetWaypointPositionApiResponse,
SetWaypointPositionApiArg
>({
query: (queryArg) => ({
url: `/waypoints/${queryArg.flightId}/${queryArg.waypointIdx}/position`,
method: "POST",
body: queryArg.leafletPoint,
}),
}),
getIadsNetwork: build.query<
GetIadsNetworkApiResponse,
GetIadsNetworkApiArg
>({
query: () => ({ url: `/iads-network/` }),
}),
getIadsConnectionsForTgo: build.query<
GetIadsConnectionsForTgoApiResponse,
GetIadsConnectionsForTgoApiArg
>({
query: (queryArg) => ({ url: `/iads-network/for-tgo/${queryArg.tgoId}` }),
}),
}),
overrideExisting: false,
});
export { injectedRtkApi as _liberationApi };
export type ListControlPointsApiResponse =
/** status 200 Successful Response */ ControlPoint[];
export type ListControlPointsApiArg = void;
export type GetControlPointByIdApiResponse =
/** status 200 Successful Response */ ControlPoint;
export type GetControlPointByIdApiArg = {
cpId: string;
};
export type ControlPointDestinationInRangeApiResponse =
/** status 200 Successful Response */ boolean;
export type ControlPointDestinationInRangeApiArg = {
cpId: string;
lat: number;
lng: number;
};
export type SetControlPointDestinationApiResponse =
/** status 204 Successful Response */ undefined;
export type SetControlPointDestinationApiArg = {
cpId: string;
body: LatLng;
};
export type ClearControlPointDestinationApiResponse =
/** status 204 Successful Response */ undefined;
export type ClearControlPointDestinationApiArg = {
cpId: string;
};
export type GetDebugHoldZonesApiResponse =
/** status 200 Successful Response */ HoldZones;
export type GetDebugHoldZonesApiArg = {
flightId: string;
};
export type GetDebugIpZonesApiResponse =
/** status 200 Successful Response */ IpZones;
export type GetDebugIpZonesApiArg = {
flightId: string;
};
export type GetDebugJoinZonesApiResponse =
/** status 200 Successful Response */ JoinZones;
export type GetDebugJoinZonesApiArg = {
flightId: string;
};
export type ListFlightsApiResponse =
/** status 200 Successful Response */ Flight[];
export type ListFlightsApiArg = {
withWaypoints?: boolean;
};
export type GetFlightByIdApiResponse =
/** status 200 Successful Response */ Flight;
export type GetFlightByIdApiArg = {
flightId: string;
withWaypoints?: boolean;
};
export type GetCommitBoundaryForFlightApiResponse =
/** status 200 Successful Response */ LatLng[][];
export type GetCommitBoundaryForFlightApiArg = {
flightId: string;
};
export type ListFrontLinesApiResponse =
/** status 200 Successful Response */ FrontLine[];
export type ListFrontLinesApiArg = void;
export type GetFrontLineByIdApiResponse =
/** status 200 Successful Response */ FrontLine;
export type GetFrontLineByIdApiArg = {
frontLineId: string;
};
export type GetGameStateApiResponse =
/** status 200 Successful Response */ Game;
export type GetGameStateApiArg = void;
export type GetTerrainZonesApiResponse =
/** status 200 Successful Response */ MapZones;
export type GetTerrainZonesApiArg = void;
export type ListUnculledZonesApiResponse =
/** status 200 Successful Response */ UnculledZone[];
export type ListUnculledZonesApiArg = void;
export type GetThreatZonesApiResponse =
/** status 200 Successful Response */ ThreatZoneContainer;
export type GetThreatZonesApiArg = void;
export type GetNavmeshApiResponse =
/** status 200 Successful Response */ NavMesh;
export type GetNavmeshApiArg = {
forPlayer: boolean;
};
export type OpenNewFrontLinePackageDialogApiResponse =
/** status 200 Successful Response */ any;
export type OpenNewFrontLinePackageDialogApiArg = {
frontLineId: string;
};
export type OpenNewTgoPackageDialogApiResponse =
/** status 200 Successful Response */ any;
export type OpenNewTgoPackageDialogApiArg = {
tgoId: string;
};
export type OpenTgoInfoDialogApiResponse =
/** status 200 Successful Response */ any;
export type OpenTgoInfoDialogApiArg = {
tgoId: string;
};
export type OpenNewControlPointPackageDialogApiResponse =
/** status 200 Successful Response */ any;
export type OpenNewControlPointPackageDialogApiArg = {
cpId: string;
};
export type OpenControlPointInfoDialogApiResponse =
/** status 200 Successful Response */ any;
export type OpenControlPointInfoDialogApiArg = {
cpId: string;
};
export type ListSupplyRoutesApiResponse =
/** status 200 Successful Response */ SupplyRoute[];
export type ListSupplyRoutesApiArg = void;
export type ListTgosApiResponse = /** status 200 Successful Response */ Tgo[];
export type ListTgosApiArg = void;
export type GetTgoByIdApiResponse = /** status 200 Successful Response */ Tgo;
export type GetTgoByIdApiArg = {
tgoId: string;
};
export type ListAllWaypointsForFlightApiResponse =
/** status 200 Successful Response */ Waypoint[];
export type ListAllWaypointsForFlightApiArg = {
flightId: string;
};
export type SetWaypointPositionApiResponse =
/** status 204 Successful Response */ undefined;
export type SetWaypointPositionApiArg = {
flightId: string;
waypointIdx: number;
leafletPoint: LatLng;
};
export type GetIadsNetworkApiResponse =
/** status 200 Successful Response */ IadsNetwork;
export type GetIadsNetworkApiArg = void;
export type GetIadsConnectionsForTgoApiResponse =
/** status 200 Successful Response */ IadsConnection[];
export type GetIadsConnectionsForTgoApiArg = {
tgoId: string;
};
export type LatLng = {
lat: number;
lng: number;
};
export type ControlPoint = {
id: string;
name: string;
blue: boolean;
position: LatLng;
mobile: boolean;
destination?: LatLng;
sidc: string;
};
export type ValidationError = {
loc: (string | number)[];
msg: string;
type: string;
};
export type HttpValidationError = {
detail?: ValidationError[];
};
export type HoldZones = {
homeBubble: LatLng[][];
targetBubble: LatLng[][];
joinBubble: LatLng[][];
excludedZones: LatLng[][][];
permissibleZones: LatLng[][][];
preferredLines: LatLng[][];
};
export type IpZones = {
homeBubble: LatLng[][];
ipBubble: LatLng[][];
permissibleZone: LatLng[][];
safeZones: LatLng[][][];
};
export type JoinZones = {
homeBubble: LatLng[][];
targetBubble: LatLng[][];
ipBubble: LatLng[][];
excludedZones: LatLng[][][];
permissibleZones: LatLng[][][];
preferredLines: LatLng[][];
};
export type Waypoint = {
name: string;
position: LatLng;
altitude_ft: number;
altitude_reference: string;
is_movable: boolean;
should_mark: boolean;
include_in_path: boolean;
timing: string;
};
export type Flight = {
id: string;
blue: boolean;
position?: LatLng;
sidc: string;
waypoints?: Waypoint[];
};
export type FrontLine = {
id: string;
extents: LatLng[];
};
export type Tgo = {
id: string;
name: string;
control_point_name: string;
category: string;
blue: boolean;
position: LatLng;
units: string[];
threat_ranges: number[];
detection_ranges: number[];
dead: boolean;
sidc: string;
};
export type SupplyRoute = {
id: string;
points: LatLng[];
front_active: boolean;
is_sea: boolean;
blue: boolean;
active_transports: string[];
};
export type IadsConnection = {
id: string;
points: LatLng[];
node: string;
connected: string;
active: boolean;
blue: boolean;
is_power: boolean;
};
export type IadsNetwork = {
advanced: boolean;
connections: IadsConnection[];
};
export type ThreatZones = {
full: LatLng[][][];
aircraft: LatLng[][][];
air_defenses: LatLng[][][];
radar_sams: LatLng[][][];
};
export type ThreatZoneContainer = {
blue: ThreatZones;
red: ThreatZones;
};
export type NavMeshPoly = {
poly: LatLng[][];
threatened: boolean;
};
export type NavMesh = {
polys: NavMeshPoly[];
};
export type NavMeshes = {
blue: NavMesh;
red: NavMesh;
};
export type UnculledZone = {
position: LatLng;
radius: number;
};
export type Game = {
control_points: ControlPoint[];
tgos: Tgo[];
supply_routes: SupplyRoute[];
front_lines: FrontLine[];
flights: Flight[];
iads_network: IadsNetwork;
threat_zones: ThreatZoneContainer;
navmeshes: NavMeshes;
map_center?: LatLng;
unculled_zones: UnculledZone[];
};
export type MapZones = {
inclusion: LatLng[][][];
exclusion: LatLng[][][];
sea: LatLng[][][];
};
export const {
useListControlPointsQuery,
useGetControlPointByIdQuery,
useControlPointDestinationInRangeQuery,
useSetControlPointDestinationMutation,
useClearControlPointDestinationMutation,
useGetDebugHoldZonesQuery,
useGetDebugIpZonesQuery,
useGetDebugJoinZonesQuery,
useListFlightsQuery,
useGetFlightByIdQuery,
useGetCommitBoundaryForFlightQuery,
useListFrontLinesQuery,
useGetFrontLineByIdQuery,
useGetGameStateQuery,
useGetTerrainZonesQuery,
useListUnculledZonesQuery,
useGetThreatZonesQuery,
useGetNavmeshQuery,
useOpenNewFrontLinePackageDialogMutation,
useOpenNewTgoPackageDialogMutation,
useOpenTgoInfoDialogMutation,
useOpenNewControlPointPackageDialogMutation,
useOpenControlPointInfoDialogMutation,
useListSupplyRoutesQuery,
useListTgosQuery,
useGetTgoByIdQuery,
useListAllWaypointsForFlightQuery,
useSetWaypointPositionMutation,
useGetIadsNetworkQuery,
useGetIadsConnectionsForTgoQuery,
} = injectedRtkApi;

View File

@@ -0,0 +1,5 @@
import { Game } from "./liberationApi";
import { createAction } from "@reduxjs/toolkit";
export const gameLoaded = createAction<Game>("game/loaded");
export const gameUnloaded = createAction("game/unloaded");

15
client/src/api/backend.ts Normal file
View File

@@ -0,0 +1,15 @@
import axios from "axios";
const backendAddr =
new URL(window.location.toString()).searchParams.get("server") ??
"[::1]:16880";
export const HTTP_URL = `http://${backendAddr}/`;
export const backend = axios.create({
baseURL: HTTP_URL,
});
export const WEBSOCKET_URL = `ws://${backendAddr}/eventstream`;
export default backend;

View File

@@ -0,0 +1,7 @@
import { HTTP_URL } from "./backend";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
export const baseApi = createApi({
baseQuery: fetchBaseQuery({ baseUrl: HTTP_URL }),
endpoints: () => ({}),
});

8
client/src/api/combat.ts Normal file
View File

@@ -0,0 +1,8 @@
import { LatLng } from "leaflet";
export default interface Combat {
id: string;
flight_position: LatLng | null;
target_positions: LatLng[] | null;
footprint: LatLng[][] | null;
}

View File

@@ -0,0 +1,49 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import Combat from "./combat";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface CombatState {
combat: { [key: string]: Combat };
}
const initialState: CombatState = {
combat: {},
};
export const combatSlice = createSlice({
name: "combat",
initialState,
reducers: {
newCombats: (state, action: PayloadAction<Combat[]>) => {
for (const combat of action.payload) {
state.combat[combat.id] = combat;
}
},
updateCombats: (state, action: PayloadAction<Combat[]>) => {
for (const combat of action.payload) {
state.combat[combat.id] = combat;
}
},
endCombats: (state, action: PayloadAction<string[]>) => {
for (const cID of action.payload) {
delete state.combat[cID];
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.combat = {};
});
builder.addCase(gameUnloaded, (state) => {
state.combat = {};
});
},
});
export const { newCombats, updateCombats, endCombats } =
combatSlice.actions;
export const selectCombat = (state: RootState) => state.combat;
export default combatSlice.reducer;

View File

@@ -0,0 +1,44 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { ControlPoint } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface ControlPointsState {
controlPoints: { [key: string]: ControlPoint };
}
const initialState: ControlPointsState = {
controlPoints: {},
};
export const controlPointsSlice = createSlice({
name: "controlPoints",
initialState,
reducers: {
updateControlPoint: (state, action: PayloadAction<ControlPoint[]>) => {
for (const cp of action.payload) {
state.controlPoints[cp.id] = cp;
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.controlPoints = action.payload.control_points.reduce(
(acc: { [key: string]: ControlPoint }, curr) => {
acc[curr.id] = curr;
return acc;
},
{}
);
});
builder.addCase(gameUnloaded, (state) => {
state.controlPoints = {};
});
},
});
export const { updateControlPoint } = controlPointsSlice.actions;
export const selectControlPoints = (state: RootState) => state.controlPoints;
export default controlPointsSlice.reducer;

View File

@@ -0,0 +1,149 @@
import { AppDispatch } from "../app/store";
import { gameUnloaded } from "./actions";
import Combat from "./combat";
import { endCombats, newCombats, updateCombats } from "./combatSlice";
import { updateControlPoint } from "./controlPointsSlice";
import {
deselectFlight,
registerFlights,
selectFlight,
unregisterFlights,
updateFlights,
updateFlightPositions,
} from "./flightsSlice";
import {
deleteFrontLine,
updateFrontLine,
} from "./frontLinesSlice";
import reloadGameState from "./gamestate";
import {
ControlPoint,
Flight,
FrontLine,
IadsConnection,
NavMesh,
Tgo,
ThreatZones,
UnculledZone,
} from "./liberationApi";
import { navMeshUpdated } from "./navMeshSlice";
import { updateTgo } from "./tgosSlice";
import { threatZonesUpdated } from "./threatZonesSlice";
import { unculledZonesUpdated } from "./unculledZonesSlice";
import { LatLng } from "leaflet";
import { updateIadsConnection, removeIadsConnection } from "./iadsNetworkSlice";
interface GameUpdateEvents {
updated_flight_positions: { [id: string]: LatLng };
new_combats: Combat[];
updated_combats: Combat[];
ended_combats: string[];
navmesh_updates: {blue: boolean, mesh: NavMesh}[];
updated_unculled_zones: UnculledZone[];
threat_zones_updated: {blue: boolean, zones: ThreatZones}[];
new_flights: Flight[];
updated_flights: Flight[];
deleted_flights: string[];
selected_flight: string | null;
deselected_flight: boolean;
updated_front_lines: FrontLine[];
deleted_front_lines: string[];
updated_tgos: Tgo[];
updated_control_points: ControlPoint[];
updated_iads: IadsConnection[];
deleted_iads: string[];
reset_on_map_center: LatLng | null;
game_unloaded: boolean;
new_turn: boolean;
}
export const handleStreamedEvents = (
dispatch: AppDispatch,
events: GameUpdateEvents
) => {
if (Object.keys(events.updated_flight_positions).length) {
dispatch(
updateFlightPositions(Object.entries(events.updated_flight_positions))
);
}
if (events.new_combats.length > 0) {
dispatch(newCombats(events.new_combats));
}
if (events.updated_combats.length > 0) {
dispatch(updateCombats(events.updated_combats));
}
if (events.ended_combats.length > 0) {
dispatch(endCombats(events.ended_combats));
}
if (Object.keys(events.navmesh_updates).length > 0) {
dispatch(navMeshUpdated(events.navmesh_updates));
}
if (events.updated_unculled_zones.length > 0) {
dispatch(unculledZonesUpdated(events.updated_unculled_zones));
}
if (Object.keys(events.threat_zones_updated).length > 0) {
dispatch(threatZonesUpdated(events.threat_zones_updated));
}
if (events.new_flights.length > 0) {
dispatch(registerFlights(events.new_flights));
}
if (events.updated_flights.length > 0) {
dispatch(updateFlights(events.updated_flights));
}
if (events.deleted_flights.length > 0) {
dispatch(unregisterFlights(events.deleted_flights));
}
if (events.deselected_flight) {
dispatch(deselectFlight());
}
if (events.selected_flight != null) {
dispatch(selectFlight(events.selected_flight));
}
if (events.updated_front_lines.length > 0) {
dispatch(updateFrontLine(events.updated_front_lines));
}
if (events.deleted_front_lines.length > 0) {
dispatch(deleteFrontLine(events.deleted_front_lines));
}
if (events.updated_tgos.length > 0) {
dispatch(updateTgo(events.updated_tgos));
}
if (events.updated_control_points.length > 0) {
dispatch(updateControlPoint(events.updated_control_points));
}
if (events.deleted_iads.length > 0) {
dispatch(removeIadsConnection(events.deleted_iads));
}
if (events.updated_iads.length > 0) {
dispatch(updateIadsConnection(events.updated_iads));
}
if (events.reset_on_map_center != null) {
reloadGameState(dispatch);
}
if (events.game_unloaded) {
dispatch(gameUnloaded());
}
if (events.new_turn) {
reloadGameState(dispatch, true);
}
};

View File

@@ -0,0 +1,89 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { Flight } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
import { LatLng } from "leaflet";
interface FlightsState {
flights: { [id: string]: Flight };
selected: string | null;
}
const initialState: FlightsState = {
flights: {},
selected: null,
};
export const flightsSlice = createSlice({
name: "flights",
initialState,
reducers: {
registerFlights: (state, action: PayloadAction<Flight[]>) => {
for (const flight of action.payload) {
if (flight.id in state.flights) {
console.log(`Overriding flight with ID: ${flight.id}`);
}
state.flights[flight.id] = flight;
}
},
unregisterFlights: (state, action: PayloadAction<string[]>) => {
for (const id of action.payload) {
delete state.flights[id];
}
},
updateFlights: (state, action: PayloadAction<Flight[]>) => {
for (const flight of action.payload) {
state.flights[flight.id] = flight;
}
},
deselectFlight: (state) => {
state.selected = null;
},
selectFlight: (state, action: PayloadAction<string>) => {
state.selected = action.payload;
},
updateFlightPositions: (
state,
action: PayloadAction<[string, LatLng][]>
) => {
for (const [id, position] of action.payload) {
state.flights[id].position = position;
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.selected = null;
state.flights = action.payload.flights.reduce(
(acc: { [key: string]: Flight }, curr) => {
acc[curr.id] = curr;
return acc;
},
{}
);
});
builder.addCase(gameUnloaded, (state) => {
state.selected = null;
state.flights = {};
});
},
});
export const {
registerFlights,
unregisterFlights,
updateFlights,
deselectFlight,
selectFlight,
updateFlightPositions,
} = flightsSlice.actions;
export const selectFlights = (state: RootState) => state.flights;
export const selectSelectedFlightId = (state: RootState) =>
state.flights.selected;
export const selectSelectedFlight = (state: RootState) => {
const id = state.flights.selected;
return id ? state.flights.flights[id] : null;
};
export default flightsSlice.reducer;

View File

@@ -0,0 +1,50 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { FrontLine } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface FrontLinesState {
fronts: { [key: string]: FrontLine };
}
const initialState: FrontLinesState = {
fronts: {},
};
export const frontLinesSlice = createSlice({
name: "frontLines",
initialState,
reducers: {
updateFrontLine: (state, action: PayloadAction<FrontLine[]>) => {
for (const front of action.payload) {
state.fronts[front.id] = front;
}
},
deleteFrontLine: (state, action: PayloadAction<string[]>) => {
for (const uid of action.payload) {
delete state.fronts[uid];
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.fronts = action.payload.front_lines.reduce(
(acc: { [key: string]: FrontLine }, curr) => {
acc[curr.id] = curr;
return acc;
},
{}
);
});
builder.addCase(gameUnloaded, (state) => {
state.fronts = {};
});
},
});
export const { updateFrontLine, deleteFrontLine } =
frontLinesSlice.actions;
export const selectFrontLines = (state: RootState) => state.frontLines;
export default frontLinesSlice.reducer;

View File

@@ -0,0 +1,24 @@
import { AppDispatch } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import backend from "./backend";
import { Game } from "./liberationApi";
export default function reloadGameState(
dispatch: AppDispatch,
ignoreRecenter: boolean = false
) {
backend
.get("/game")
.catch((error) => console.log(`Error fetching game state: ${error}`))
.then((response) => {
if (response == null || response.data == null) {
dispatch(gameUnloaded());
return;
}
const game = response.data as Game;
if (ignoreRecenter) {
game.map_center = undefined;
}
dispatch(gameLoaded(game));
});
}

View File

@@ -0,0 +1,49 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { IadsConnection} from "./_liberationApi";
interface IadsNetworkState {
connections: {[key: string]: IadsConnection}
}
const initialState: IadsNetworkState = {
connections: {},
};
export const IadsNetworkSlice = createSlice({
name: "iadsNetwork",
initialState,
reducers: {
updateIadsConnection: (state, action: PayloadAction<IadsConnection[]>) => {
for (const connection of action.payload) {
state.connections[connection.id] = connection
}
},
removeIadsConnection: (state, action: PayloadAction<string[]>) => {
for (const cID of action.payload) {
delete state.connections[cID];
}
}
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.connections = action.payload.iads_network.connections.reduce(
(acc: { [key: string]: IadsConnection }, curr) => {
acc[curr.id] = curr;
return acc;
},
{}
);
});
builder.addCase(gameUnloaded, (state) => {
state.connections = {};
});
},
});
export const { updateIadsConnection, removeIadsConnection } = IadsNetworkSlice.actions;
export const selectIadsNetwork = (state: RootState) => state.iadsNetwork;
export default IadsNetworkSlice.reducer;

View File

@@ -0,0 +1,71 @@
import { _liberationApi } from "./_liberationApi";
// See https://redux-toolkit.js.org/rtk-query/usage/automated-refetching for an
// explanation of tag behavior.
export enum Tags {
FLIGHT_PLAN = "FlightPlan",
}
const LIST_ID = "LIST";
function providesList<R extends { id: string | number }[], T extends string>(
resultsWithIds: R | undefined,
tagType: T
) {
return resultsWithIds
? [
{ type: tagType, id: LIST_ID },
...resultsWithIds.map(({ id }) => ({ type: tagType, id })),
]
: [{ type: tagType, id: LIST_ID }];
}
export const liberationApi = _liberationApi.enhanceEndpoints({
addTagTypes: Object.values(Tags),
endpoints: {
// /debug/waypoint-geometries
getDebugHoldZones: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
getDebugIpZones: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
getDebugJoinZones: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
// /flights/
getCommitBoundaryForFlight: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
getFlightById: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
listFlights: {
providesTags: (result) => providesList(result, Tags.FLIGHT_PLAN),
},
// /waypoints/
listAllWaypointsForFlight: {
providesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
setWaypointPosition: {
invalidatesTags: (result, error, arg) => [
{ type: Tags.FLIGHT_PLAN, id: arg.flightId },
],
},
},
});
export * from "./_liberationApi";

View File

@@ -0,0 +1,32 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { createSlice } from "@reduxjs/toolkit";
import { LatLngLiteral } from "leaflet";
interface MapState {
center: LatLngLiteral;
}
const initialState: MapState = {
center: { lat: 0, lng: 0 },
};
const mapSlice = createSlice({
name: "map",
initialState: initialState,
reducers: {},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
if (action.payload.map_center != null) {
state.center = action.payload.map_center;
}
});
builder.addCase(gameUnloaded, (state) => {
state.center = { lat: 0, lng: 0 };
});
},
});
export const selectMapCenter = (state: RootState) => state.map.center;
export default mapSlice.reducer;

View File

@@ -0,0 +1,53 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { NavMesh, NavMeshPoly } from "./liberationApi";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
interface NavMeshState {
blue: NavMeshPoly[];
red: NavMeshPoly[];
}
const initialState: NavMeshState = {
blue: [],
red: [],
};
export interface INavMeshUpdate {
blue: boolean;
mesh: NavMesh;
}
const navMeshSlice = createSlice({
name: "navmesh",
initialState: initialState,
reducers: {
updated: (state, action: PayloadAction<INavMeshUpdate[]>) => {
for (const [blue, navmesh] of Object.entries(action.payload)) {
const data = {blue: (blue === "true"), mesh: navmesh} as unknown as INavMeshUpdate
const polys = data.mesh.polys;
if (data.blue) {
state.blue = polys;
} else {
state.red = polys;
}
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.blue = action.payload.navmeshes.blue.polys;
state.red = action.payload.navmeshes.red.polys;
});
builder.addCase(gameUnloaded, (state) => {
state.blue = [];
state.red = [];
});
},
});
export const { updated: navMeshUpdated } = navMeshSlice.actions;
export const selectNavMeshes = (state: RootState) => state.navmeshes;
export default navMeshSlice.reducer;

View File

@@ -0,0 +1,30 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { SupplyRoute } from "./liberationApi";
import { createSlice } from "@reduxjs/toolkit";
interface SupplyRoutesState {
routes: SupplyRoute[];
}
const initialState: SupplyRoutesState = {
routes: [],
};
export const supplyRoutesSlice = createSlice({
name: "supplyRoutes",
initialState,
reducers: {},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.routes = action.payload.supply_routes;
});
builder.addCase(gameUnloaded, (state) => {
state.routes = [];
});
},
});
export const selectSupplyRoutes = (state: RootState) => state.supplyRoutes;
export default supplyRoutesSlice.reducer;

View File

@@ -0,0 +1,44 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { Tgo } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface TgosState {
tgos: { [key: string]: Tgo };
}
const initialState: TgosState = {
tgos: {},
};
export const tgosSlice = createSlice({
name: "tgos",
initialState,
reducers: {
updateTgo: (state, action: PayloadAction<Tgo[]>) => {
for (const tgo of action.payload) {
state.tgos[tgo.id] = tgo;
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.tgos = action.payload.tgos.reduce(
(acc: { [key: string]: Tgo }, curr) => {
acc[curr.id] = curr;
return acc;
},
{}
);
});
builder.addCase(gameUnloaded, (state) => {
state.tgos = {};
});
},
});
export const { updateTgo } = tgosSlice.actions;
export const selectTgos = (state: RootState) => state.tgos;
export default tgosSlice.reducer;

View File

@@ -0,0 +1,61 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { ThreatZoneContainer, ThreatZones } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface ThreatZonesState {
zones: ThreatZoneContainer;
}
const initialState: ThreatZonesState = {
zones: {
blue: {
full: [],
aircraft: [],
air_defenses: [],
radar_sams: [],
},
red: {
full: [],
aircraft: [],
air_defenses: [],
radar_sams: [],
},
},
};
export interface IThreatZoneUpdate {
blue: boolean;
zones: ThreatZones;
}
export const threatZonesSlice = createSlice({
name: "threatZonesState",
initialState,
reducers: {
updated: (state, action: PayloadAction<IThreatZoneUpdate[]>) => {
for (const [blue, zones] of Object.entries(action.payload)) {
const data = {blue: (blue === "true"), zones: zones} as unknown as IThreatZoneUpdate
if (data.blue) {
state.zones.blue = data.zones;
} else {
state.zones.red = data.zones;
}
}
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.zones = action.payload.threat_zones;
});
builder.addCase(gameUnloaded, (state) => {
state.zones = initialState.zones;
});
},
});
export const { updated: threatZonesUpdated } = threatZonesSlice.actions;
export const selectThreatZones = (state: RootState) => state.threatZones;
export default threatZonesSlice.reducer;

View File

@@ -0,0 +1,36 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { UnculledZone } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface UnculledZonesState {
zones: UnculledZone[];
}
const initialState: UnculledZonesState = {
zones: [],
};
export const unculledZonesSlice = createSlice({
name: "unculledZonesState",
initialState,
reducers: {
updated: (state, action: PayloadAction<UnculledZone[]>) => {
state.zones = action.payload;
},
},
extraReducers: (builder) => {
builder.addCase(gameLoaded, (state, action) => {
state.zones = action.payload.unculled_zones;
});
builder.addCase(gameUnloaded, (state) => {
state.zones = initialState.zones;
});
},
});
export const { updated: unculledZonesUpdated } = unculledZonesSlice.actions;
export const selectUnculledZones = (state: RootState) => state.unculledZones;
export default unculledZonesSlice.reducer;

6
client/src/app/hooks.ts Normal file
View File

@@ -0,0 +1,6 @@
import type { RootState, AppDispatch } from "./store";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

41
client/src/app/store.ts Normal file
View File

@@ -0,0 +1,41 @@
import { baseApi } from "../api/baseApi";
import combatReducer from "../api/combatSlice";
import controlPointsReducer from "../api/controlPointsSlice";
import flightsReducer from "../api/flightsSlice";
import frontLinesReducer from "../api/frontLinesSlice";
import mapReducer from "../api/mapSlice";
import navMeshReducer from "../api/navMeshSlice";
import supplyRoutesReducer from "../api/supplyRoutesSlice";
import tgosReducer from "../api/tgosSlice";
import iadsNetworkReducer from "../api/iadsNetworkSlice";
import threatZonesReducer from "../api/threatZonesSlice";
import unculledZonesReducer from "../api/unculledZonesSlice";
import { Action, ThunkAction, configureStore } from "@reduxjs/toolkit";
export const store = configureStore({
reducer: {
combat: combatReducer,
controlPoints: controlPointsReducer,
flights: flightsReducer,
frontLines: frontLinesReducer,
map: mapReducer,
navmeshes: navMeshReducer,
supplyRoutes: supplyRoutesReducer,
iadsNetwork: iadsNetworkReducer,
tgos: tgosReducer,
threatZones: threatZonesReducer,
[baseApi.reducerPath]: baseApi.reducer,
unculledZones: unculledZonesReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(baseApi.middleware),
});
export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
ReturnType,
RootState,
unknown,
Action<string>
>;

View File

@@ -0,0 +1,53 @@
import Aircraft from "./Aircraft";
import { render } from "@testing-library/react";
import { Icon } from "leaflet";
const mockMarker = jest.fn();
jest.mock("react-leaflet", () => ({
Marker: (props: any) => {
mockMarker(props);
},
}));
test("grounded aircraft do not render", async () => {
const { container } = render(
<Aircraft
flight={{
id: "",
blue: true,
position: undefined,
sidc: "",
waypoints: [],
}}
/>
);
expect(container).toBeEmptyDOMElement();
});
test("in-flight aircraft render", async () => {
render(
<Aircraft
flight={{
id: "",
blue: true,
position: {
lat: 10,
lng: 20,
},
sidc: "foobar",
waypoints: [],
}}
/>
);
expect(mockMarker).toHaveBeenCalledWith(
expect.objectContaining({
position: {
lat: 10,
lng: 20,
},
icon: expect.any(Icon),
})
);
});

View File

@@ -0,0 +1,32 @@
import { Flight } from "../../api/liberationApi";
import { Icon, Point } from "leaflet";
import { Symbol } from "milsymbol";
import { Marker } from "react-leaflet";
function iconForFlight(flight: Flight) {
const symbol = new Symbol(flight.sidc, {
size: 20,
});
return new Icon({
iconUrl: symbol.toDataURL(),
iconAnchor: new Point(symbol.getAnchor().x, symbol.getAnchor().y),
});
}
interface AircraftProps {
flight: Flight;
}
export default function Aircraft(props: AircraftProps) {
if (!props.flight.position) {
return <></>;
}
return (
<Marker
position={props.flight.position}
icon={iconForFlight(props.flight)}
/>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./Aircraft";

View File

@@ -0,0 +1,15 @@
import { selectFlights } from "../../api/flightsSlice";
import { useAppSelector } from "../../app/hooks";
import Aircraft from "../aircraft";
import { LayerGroup } from "react-leaflet";
export default function AircraftLayer() {
const flights = useAppSelector(selectFlights).flights;
return (
<LayerGroup>
{Object.values(flights).map((flight) => {
return <Aircraft key={flight.id} flight={flight} />;
})}
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./AircraftLayer";

View File

@@ -0,0 +1,65 @@
import { Tgo } from "../../api/liberationApi";
import { selectTgos } from "../../api/tgosSlice";
import { useAppSelector } from "../../app/hooks";
import { Circle, LayerGroup } from "react-leaflet";
interface TgoRangeCirclesProps {
tgo: Tgo;
blue: boolean;
detection?: boolean;
}
function colorFor(blue: boolean, detection: boolean) {
if (blue) {
return detection ? "#bb89ff" : "#0084ff";
}
return detection ? "#eee17b" : "#c85050";
}
const TgoRangeCircles = (props: TgoRangeCirclesProps) => {
const radii = props.detection
? props.tgo.detection_ranges
: props.tgo.threat_ranges;
const color = colorFor(props.blue, props.detection === true);
const weight = props.detection ? 1 : 2;
return (
<>
{radii.map((radius, idx) => {
return (
<Circle
key={idx}
center={props.tgo.position}
radius={radius}
color={color}
fill={false}
weight={weight}
interactive={false}
/>
);
})}
</>
);
};
interface AirDefenseRangeLayerProps {
blue: boolean;
detection?: boolean;
}
export const AirDefenseRangeLayer = (props: AirDefenseRangeLayerProps) => {
const tgos = Object.values(useAppSelector(selectTgos).tgos);
var tgosForSide = tgos.filter((tgo) => tgo.blue === props.blue);
return (
<LayerGroup>
{tgosForSide.map((tgo) => {
return (
<TgoRangeCircles key={tgo.id} tgo={tgo} {...props}></TgoRangeCircles>
);
})}
</LayerGroup>
);
};
export default AirDefenseRangeLayer;

View File

@@ -0,0 +1 @@
export { default } from "./AirDefenseRangeLayer";

View File

@@ -0,0 +1,53 @@
import CombatModel from "../../api/combat";
import { LatLng } from "leaflet";
import { Polygon, Polyline } from "react-leaflet";
interface CombatProps {
combat: CombatModel;
}
function CombatFootprint(props: CombatProps) {
if (!props.combat.footprint) {
return <></>;
}
return (
<Polygon
positions={props.combat.footprint}
color="#c85050"
interactive={false}
fillOpacity={0.2}
/>
);
}
function CombatLines(props: CombatProps) {
if (!props.combat.flight_position || !props.combat.target_positions) {
return <></>;
}
const flightPosition: LatLng = props.combat.flight_position;
return (
<>
{props.combat.target_positions.map((position, idx) => {
return (
<Polyline
key={idx}
positions={[flightPosition, position]}
color="#c85050"
interactive={false}
/>
);
})}
</>
);
}
export default function Combat(props: CombatProps) {
return (
<>
<CombatFootprint {...props} />
<CombatLines {...props} />
</>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./Combat";

View File

@@ -0,0 +1,16 @@
import { selectCombat } from "../../api/combatSlice";
import { useAppSelector } from "../../app/hooks";
import Combat from "../combat/Combat";
import { LayerGroup } from "react-leaflet";
export default function CombatLayer() {
const combats = useAppSelector(selectCombat);
return (
<LayerGroup>
{Object.values(combats.combat).map((combat) => {
return <Combat key={combat.id} combat={combat} />;
})}
(
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./CombatLayer";

View File

@@ -0,0 +1,15 @@
import { ControlPoint as ControlPointModel } from "../../api/liberationApi";
import { MobileControlPoint } from "./MobileControlPoint";
import { StaticControlPoint } from "./StaticControlPoint";
interface ControlPointProps {
controlPoint: ControlPointModel;
}
export default function ControlPoint(props: ControlPointProps) {
if (props.controlPoint.mobile) {
return <MobileControlPoint {...props} />;
} else {
return <StaticControlPoint {...props} />;
}
}

View File

@@ -0,0 +1,22 @@
import { ControlPoint } from "../../api/_liberationApi";
import backend from "../../api/backend";
function openInfoDialog(controlPoint: ControlPoint) {
backend.post(`/qt/info/control-point/${controlPoint.id}`);
}
function openNewPackageDialog(controlPoint: ControlPoint) {
backend.post(`/qt/create-package/control-point/${controlPoint.id}`);
}
export const makeLocationMarkerEventHandlers = (controlPoint: ControlPoint) => {
return {
click: () => {
openInfoDialog(controlPoint);
},
contextmenu: () => {
openNewPackageDialog(controlPoint);
},
};
};

View File

@@ -0,0 +1,15 @@
import { ControlPoint } from "../../api/_liberationApi";
import { Icon, Point } from "leaflet";
import { Symbol } from "milsymbol";
export const iconForControlPoint = (cp: ControlPoint) => {
const symbol = new Symbol(cp.sidc, {
size: 24,
colorMode: "Dark",
});
return new Icon({
iconUrl: symbol.toDataURL(),
iconAnchor: new Point(symbol.getAnchor().x, symbol.getAnchor().y),
});
};

View File

@@ -0,0 +1,9 @@
interface LocationTooltipTextProps {
name: string;
}
export const LocationTooltipText = (props: LocationTooltipTextProps) => {
return <h3 style={{ margin: 0 }}>{props.name}</h3>;
};
export default LocationTooltipText;

View File

@@ -0,0 +1,228 @@
import { ControlPoint } from "../../api/_liberationApi";
import backend from "../../api/backend";
import {
useClearControlPointDestinationMutation,
useSetControlPointDestinationMutation,
} from "../../api/liberationApi";
import { makeLocationMarkerEventHandlers } from "./EventHandlers";
import { iconForControlPoint } from "./Icons";
import LocationTooltipText from "./LocationTooltipText";
import { MovementPath, MovementPathHandle } from "./MovementPath";
import { StaticControlPoint } from "./StaticControlPoint";
import { LatLng, Marker as LMarker, LatLngLiteral } from "leaflet";
import { useCallback, useEffect, useRef, useState } from "react";
import ReactDOMServer from "react-dom/server";
import { Marker, Tooltip } from "react-leaflet";
function metersToNauticalMiles(meters: number) {
return meters * 0.000539957;
}
function formatLatLng(latLng: LatLng) {
const lat = latLng.lat.toFixed(2);
const lng = latLng.lng.toFixed(2);
const ns = latLng.lat >= 0 ? "N" : "S";
const ew = latLng.lng >= 0 ? "E" : "W";
return `${lat}&deg;${ns} ${lng}&deg;${ew}`;
}
function destinationTooltipText(
cp: ControlPoint,
destinationish: LatLngLiteral,
inRange: boolean
) {
const destination = new LatLng(destinationish.lat, destinationish.lng);
const distance = metersToNauticalMiles(
destination.distanceTo(cp.position)
).toFixed(1);
if (!inRange) {
return `Out of range (${distance}nm away)`;
}
const dest = formatLatLng(destination);
return `${cp.name} moving ${distance}nm to ${dest} next turn`;
}
interface PrimaryMarkerProps {
controlPoint: ControlPoint;
}
/**
* The primary control point marker. For non-mobile control points, this has
* fairly simple behavior: it's a marker in a fixed location that can manage
* units and can have missions planned against it.
*
* For mobile control points, this is a draggable marker. If the control point
* has a destination (either because it was dragged after render, or because it
* had a destination in the game that was loaded), the unit management and
* mission planning behaviors are delegated to SecondaryMarker, and the primary
* marker becomes only a destination marker. It can be dragged to change the
* destination, and can be right clicked to cancel movement.
*/
function PrimaryMarker(props: PrimaryMarkerProps) {
// We can't use normal state to update the marker tooltip or the line points
// because if we set any state in the drag event it will re-render this
// component and all children, interrupting dragging. Instead, keep refs to
// the objects and mutate them directly.
//
// For the same reason, the path is owned by this component, because updating
// sibling state would be messy. Lifting the state into the parent would still
// cause this component to redraw.
const markerRef = useRef<LMarker | null>(null);
const pathRef = useRef<MovementPathHandle | null>(null);
const [hasDestination, setHasDestination] = useState<boolean>(
props.controlPoint.destination != null
);
const [position, setPosition] = useState<LatLngLiteral>(
props.controlPoint.destination
? props.controlPoint.destination
: props.controlPoint.position
);
const setDestination = useCallback((destination: LatLng) => {
setPosition(destination);
setHasDestination(true);
}, []);
const resetDestination = useCallback(() => {
setPosition(props.controlPoint.position);
setHasDestination(false);
}, [props]);
const [putDestination, { isLoading }] =
useSetControlPointDestinationMutation();
const [cancelTravel] = useClearControlPointDestinationMutation();
useEffect(() => {
markerRef.current?.setTooltipContent(
props.controlPoint.destination
? destinationTooltipText(
props.controlPoint,
props.controlPoint.destination,
true
)
: ReactDOMServer.renderToString(
<LocationTooltipText name={props.controlPoint.name} />
)
);
});
const locationClickHandlers = makeLocationMarkerEventHandlers(
props.controlPoint
);
return (
<>
<Marker
position={position}
icon={iconForControlPoint(props.controlPoint)}
draggable={!isLoading}
autoPan
// We might draw other markers on top of the CP. The tooltips from the
// other markers are helpful so we want to keep them, but make sure the CP
// is always the clickable thing.
zIndexOffset={1000}
opacity={props.controlPoint.destination ? 0.5 : 1}
ref={(ref) => {
if (ref != null) {
markerRef.current = ref;
}
}}
eventHandlers={{
click: () => {
if (!hasDestination) {
locationClickHandlers.click();
}
},
contextmenu: () => {
if (props.controlPoint.destination) {
cancelTravel({ cpId: props.controlPoint.id }).then(() => {
resetDestination();
});
} else {
locationClickHandlers.contextmenu();
}
},
drag: (event) => {
const destination = event.target.getLatLng();
backend
.get(
`/control-points/${props.controlPoint.id}/destination-in-range?lat=${destination.lat}&lng=${destination.lng}`
)
.then((inRange) => {
markerRef.current?.setTooltipContent(
destinationTooltipText(
props.controlPoint,
destination,
inRange.data
)
);
});
pathRef.current?.setDestination(destination);
},
dragend: async (event) => {
const currentPosition = new LatLng(position.lat, position.lng);
const destination = event.target.getLatLng();
setDestination(destination);
try {
await putDestination({
cpId: props.controlPoint.id,
body: { lat: destination.lat, lng: destination.lng },
}).unwrap();
} catch (error) {
console.error("setDestination failed", error);
setDestination(currentPosition);
}
},
}}
>
<Tooltip />
</Marker>
<MovementPath
source={props.controlPoint.position}
destination={position}
ref={pathRef}
/>
</>
);
}
interface SecondaryMarkerProps {
controlPoint: ControlPoint;
destination: LatLngLiteral | undefined;
}
/**
* The secondary marker for a control point. The secondary marker will only be
* shown when the control point has a destination set. For mobile control
* points, the primary marker is draggable, and the secondary marker will be
* shown at the current location iff the control point has been dragged. The
* secondary marker is also the marker that has the normal control point
* interaction options (mission planning and unit management).
*/
function SecondaryMarker(props: SecondaryMarkerProps) {
if (!props.destination) {
return <></>;
}
return <StaticControlPoint controlPoint={props.controlPoint} />;
}
interface MobileControlPointProps {
controlPoint: ControlPoint;
}
export const MobileControlPoint = (props: MobileControlPointProps) => {
return (
<>
<PrimaryMarker
controlPoint={props.controlPoint}
key={props.controlPoint.destination ? 0 : 1}
/>
<SecondaryMarker
controlPoint={props.controlPoint}
destination={props.controlPoint.destination}
/>
</>
);
};

View File

@@ -0,0 +1,35 @@
import { LatLngLiteral, Polyline as LPolyline } from "leaflet";
import { forwardRef, useImperativeHandle, useRef } from "react";
import { Polyline } from "react-leaflet";
interface MovementPathProps {
source: LatLngLiteral;
destination: LatLngLiteral;
}
export interface MovementPathHandle {
setDestination: (destination: LatLngLiteral) => void;
}
export const MovementPath = forwardRef<MovementPathHandle, MovementPathProps>(
(props: MovementPathProps, ref) => {
const lineRef = useRef<LPolyline | null>(null);
useImperativeHandle(
ref,
() => ({
setDestination: (destination: LatLngLiteral) => {
lineRef.current?.setLatLngs([props.source, destination]);
},
}),
[props]
);
return (
<Polyline
positions={[props.source, props.destination]}
weight={1}
color="#80BA80"
ref={lineRef}
/>
);
}
);

View File

@@ -0,0 +1,27 @@
import { ControlPoint } from "../../api/_liberationApi";
import { makeLocationMarkerEventHandlers } from "./EventHandlers";
import { iconForControlPoint } from "./Icons";
import LocationTooltipText from "./LocationTooltipText";
import { Marker, Tooltip } from "react-leaflet";
interface StaticControlPointProps {
controlPoint: ControlPoint;
}
export const StaticControlPoint = (props: StaticControlPointProps) => {
return (
<Marker
position={props.controlPoint.position}
icon={iconForControlPoint(props.controlPoint)}
// We might draw other markers on top of the CP. The tooltips from the
// other markers are helpful so we want to keep them, but make sure the CP
// is always the clickable thing.
zIndexOffset={1000}
eventHandlers={makeLocationMarkerEventHandlers(props.controlPoint)}
>
<Tooltip>
<LocationTooltipText name={props.controlPoint.name} />
</Tooltip>
</Marker>
);
};

View File

@@ -0,0 +1 @@
export { default } from "./ControlPoint";

View File

@@ -0,0 +1,17 @@
import { selectControlPoints } from "../../api/controlPointsSlice";
import { useAppSelector } from "../../app/hooks";
import ControlPoint from "../controlpoints";
import { LayerGroup } from "react-leaflet";
export default function ControlPointsLayer() {
const controlPoints = useAppSelector(selectControlPoints);
return (
<LayerGroup>
{Object.values(controlPoints.controlPoints).map((controlPoint) => {
return (
<ControlPoint key={controlPoint.id} controlPoint={controlPoint} />
);
})}
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./ControlPointsLayer";

View File

@@ -0,0 +1,47 @@
import { UnculledZone } from "../../api/liberationApi";
import { selectUnculledZones } from "../../api/unculledZonesSlice";
import { useAppSelector } from "../../app/hooks";
import { LayerGroup, LayersControl, Circle } from "react-leaflet";
interface CullingExclusionCirclesProps {
zones: UnculledZone[];
}
const CullingExclusionCircles = (props: CullingExclusionCirclesProps) => {
return (
<>
<LayerGroup>
{props.zones.map((zone, idx) => {
return (
<Circle
key={idx}
center={zone.position}
radius={zone.radius}
color="#b4ff8c"
fill={false}
interactive={false}
/>
);
})}
</LayerGroup>
</>
);
};
export default function CullingExclusionZones() {
const data = useAppSelector(selectUnculledZones).zones;
var cez = <></>;
if (!data) {
console.log("Empty response when loading culling exclusion zones");
} else {
cez = (
<CullingExclusionCircles zones={data}></CullingExclusionCircles>
);
}
return (
<LayersControl.Overlay name="Culling exclusion zones">
{cez}
</LayersControl.Overlay>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./CullingExclusionZones";

View File

@@ -0,0 +1,120 @@
import { Flight } from "../../api/liberationApi";
import { useGetCommitBoundaryForFlightQuery } from "../../api/liberationApi";
import WaypointMarker from "../waypointmarker";
import { ReactElement } from "react";
import { Polyline } from "react-leaflet";
const BLUE_PATH = "#0084ff";
const RED_PATH = "#c85050";
const SELECTED_PATH = "#ffff00";
interface FlightPlanProps {
flight: Flight;
selected: boolean;
highlight?: boolean;
}
const pathColor = (props: FlightPlanProps) => {
if (props.selected && props.highlight) {
return SELECTED_PATH;
} else if (props.flight.blue) {
return BLUE_PATH;
} else {
return RED_PATH;
}
};
function FlightPlanPath(props: FlightPlanProps) {
const color = pathColor(props);
const waypoints = props.flight.waypoints;
if (waypoints == null) {
return <></>;
}
const points = waypoints
.filter((waypoint) => waypoint.include_in_path)
.map((waypoint) => waypoint.position);
return (
<Polyline
positions={points}
pathOptions={{ color: color, interactive: false }}
/>
);
}
const WaypointMarkers = (props: FlightPlanProps) => {
if (!props.selected || props.flight.waypoints == null) {
return <></>;
}
var markers: ReactElement[] = [];
props.flight.waypoints?.forEach((p, idx) => {
if (p.should_mark) {
markers.push(
<WaypointMarker
key={idx}
number={idx}
waypoint={p}
flight={props.flight}
/>
);
}
});
return <>{markers}</>;
};
interface CommitBoundaryProps {
flightId: string;
selected: boolean;
}
function CommitBoundary(props: CommitBoundaryProps) {
const { data, error, isLoading } = useGetCommitBoundaryForFlightQuery(
{
flightId: props.flightId,
},
// RTK Query doesn't seem to allow us to invalidate the cache from anything
// but a mutation, but this data can be invalidated by events from the
// websocket. Just disable the cache for this.
//
// This isn't perfect. It won't redraw until the component remounts. There
// doesn't appear to be a better way.
{ refetchOnMountOrArgChange: true }
);
if (isLoading) {
return <></>;
}
if (error) {
console.error(`Error loading commit boundary for ${props.flightId}`, error);
return <></>;
}
if (!data) {
console.log(
`Null response data when loading commit boundary for ${props.flightId}`
);
return <></>;
}
return (
<Polyline positions={data} color="#ffff00" weight={1} interactive={false} />
);
}
function CommitBoundaryIfSelected(props: CommitBoundaryProps) {
if (!props.selected) {
return <></>;
}
return <CommitBoundary {...props} />;
}
export default function FlightPlan(props: FlightPlanProps) {
return (
<>
<FlightPlanPath {...props} />
<WaypointMarkers {...props} />
<CommitBoundaryIfSelected
flightId={props.flight.id}
selected={props.selected}
/>
</>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./FlightPlan";

View File

@@ -0,0 +1,67 @@
import { selectFlights, selectSelectedFlight } from "../../api/flightsSlice";
import { Flight } from "../../api/liberationApi";
import { useAppSelector } from "../../app/hooks";
import FlightPlan from "../flightplan";
import { LayerGroup } from "react-leaflet";
interface FlightPlansLayerProps {
blue: boolean;
selectedOnly?: true;
}
function SelectedFlightPlan(props: FlightPlansLayerProps) {
const flight = useAppSelector(selectSelectedFlight);
if (!flight) {
return <></>;
}
if (!props.blue) {
// We don't currently support playing as red, so nothing to draw.
return <></>;
}
return (
<FlightPlan
key={flight.id}
flight={flight}
selected={true}
highlight={!props.selectedOnly}
/>
);
}
function UnselectedFlightPlans(props: FlightPlansLayerProps) {
const flightData = useAppSelector(selectFlights);
const isNotSelected = (flight: Flight) => {
if (flightData.selected == null) {
return true;
}
return flightData.selected !== flight.id;
};
if (props.selectedOnly) {
return <></>;
}
return (
<>
{Object.values(flightData.flights)
.filter(isNotSelected)
.filter((flight) => props.blue === flight.blue)
.map((flight) => {
return (
<FlightPlan key={flight.id} flight={flight} selected={false} />
);
})}
</>
);
}
export default function FlightPlansLayer(props: FlightPlansLayerProps) {
return (
<LayerGroup>
<UnselectedFlightPlans {...props} />
<SelectedFlightPlan {...props} />
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./FlightPlansLayer";

View File

@@ -0,0 +1,27 @@
import {
FrontLine as FrontLineModel,
useOpenNewFrontLinePackageDialogMutation,
} from "../../api/liberationApi";
import { Polyline } from "react-leaflet";
interface FrontLineProps {
front: FrontLineModel;
}
function FrontLine(props: FrontLineProps) {
const [openNewPackageDialog] = useOpenNewFrontLinePackageDialogMutation();
return (
<Polyline
positions={props.front.extents}
weight={16}
color={"#fe7d0a"}
eventHandlers={{
contextmenu: () => {
openNewPackageDialog({ frontLineId: props.front.id });
},
}}
/>
);
}
export default FrontLine;

View File

@@ -0,0 +1 @@
export { default } from "./FrontLine";

View File

@@ -0,0 +1,15 @@
import { selectFrontLines } from "../../api/frontLinesSlice";
import { useAppSelector } from "../../app/hooks";
import FrontLine from "../frontline";
import { LayerGroup } from "react-leaflet";
export default function SupplyRoutesLayer() {
const fronts = useAppSelector(selectFrontLines).fronts;
return (
<LayerGroup>
{Object.values(fronts).map((front, idx) => {
return <FrontLine key={idx} front={front} />;
})}
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./FrontLinesLayer";

View File

@@ -0,0 +1,39 @@
import { IadsConnection as IadsConnectionModel } from "../../api/liberationApi";
import { Polyline as LPolyline } from "leaflet";
import { useRef } from "react";
import { Polyline, Tooltip } from "react-leaflet";
interface IadsConnectionProps {
iads_connection: IadsConnectionModel;
}
function IadsConnectionTooltip(props: IadsConnectionProps) {
var status = props.iads_connection.active ? "Active" : "Inactive";
if (props.iads_connection.is_power) {
return <Tooltip>Power Connection ({status})</Tooltip>;
} else {
return <Tooltip>Communication Connection ({status})</Tooltip>;
}
}
export default function IadsConnection(props: IadsConnectionProps) {
const color = props.iads_connection.is_power ? "#FFD580" : "#87CEEB";
const path = useRef<LPolyline | null>();
const weight = 1
var opacity = props.iads_connection.active ? 1.0 : 0.5
var dashArray = props.iads_connection.active ? "" : "20"
return (
<Polyline
positions={props.iads_connection.points}
color={color}
weight={weight}
opacity={opacity}
dashArray={dashArray}
ref={(ref) => (path.current = ref)}
>
<IadsConnectionTooltip {...props} />
</Polyline>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./IadsNetwork";

View File

@@ -0,0 +1,26 @@
import { useAppSelector } from "../../app/hooks";
import { LayerGroup } from "react-leaflet";
import IadsConnection from "../iadsnetwork/IadsNetwork";
import { selectIadsNetwork } from "../../api/iadsNetworkSlice";
interface IadsNetworkLayerProps {
blue: boolean;
}
export const IadsNetworkLayer = (props: IadsNetworkLayerProps) => {
const connections = Object.values(useAppSelector(selectIadsNetwork).connections);
var iadsConnectionsForSide = connections.filter((connection) => connection.blue === props.blue);
return (
<LayerGroup>
{iadsConnectionsForSide.map((connection) => {
return (
<IadsConnection key={connection.id} iads_connection={connection} />
);
})}
</LayerGroup>
);
};
export default IadsNetworkLayer;

View File

@@ -0,0 +1 @@
export { default } from "./IadsNetworkLayer";

View File

@@ -0,0 +1,7 @@
@import "~leaflet/dist/leaflet.css";
.leaflet-container {
width: 100%;
height: 100%;
min-height: 100vh;
}

View File

@@ -0,0 +1,114 @@
import { selectMapCenter } from "../../api/mapSlice";
import { useAppSelector } from "../../app/hooks";
import AircraftLayer from "../aircraftlayer";
import AirDefenseRangeLayer from "../airdefenserangelayer";
import CombatLayer from "../combatlayer";
import ControlPointsLayer from "../controlpointslayer";
import CullingExclusionZones from "../cullingexclusionzones/CullingExclusionZones";
import FlightPlansLayer from "../flightplanslayer";
import FrontLinesLayer from "../frontlineslayer";
import Iadsnetworklayer from "../iadsnetworklayer";
import NavMeshLayer from "../navmesh/NavMeshLayer";
import LeafletRuler from "../ruler/Ruler";
import SupplyRoutesLayer from "../supplyrouteslayer";
import TerrainZonesLayers from "../terrainzones/TerrainZonesLayers";
import TgosLayer from "../tgoslayer/TgosLayer";
import { CoalitionThreatZones } from "../threatzones";
import { WaypointDebugZonesControls } from "../waypointdebugzones/WaypointDebugZonesControls";
import "./LiberationMap.css";
import { Map } from "leaflet";
import { useEffect, useRef } from "react";
import { BasemapLayer } from "react-esri-leaflet";
import { LayersControl, MapContainer, ScaleControl } from "react-leaflet";
export default function LiberationMap() {
const map = useRef<Map>(null);
const mapCenter = useAppSelector(selectMapCenter);
useEffect(() => {
map.current?.setView(mapCenter, 8, { animate: true, duration: 1 });
});
return (
<MapContainer zoom={8} zoomControl={false} ref={map}>
<ScaleControl />
<LeafletRuler />
<LayersControl collapsed={false}>
<LayersControl.BaseLayer name="Imagery Clarity" checked>
<BasemapLayer name="ImageryClarity" />
</LayersControl.BaseLayer>
<LayersControl.BaseLayer name="Imagery Firefly">
<BasemapLayer name="ImageryFirefly" />
</LayersControl.BaseLayer>
<LayersControl.BaseLayer name="Topographic">
<BasemapLayer name="Topographic" />
</LayersControl.BaseLayer>
<LayersControl.Overlay name="Control points" checked>
<ControlPointsLayer />
</LayersControl.Overlay>
<LayersControl.Overlay name="Aircraft" checked>
<AircraftLayer />
</LayersControl.Overlay>
<LayersControl.Overlay name="Active combat" checked>
<CombatLayer />
</LayersControl.Overlay>
<LayersControl.Overlay name="Air defenses" checked>
<TgosLayer categories={["aa"]} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Factories" checked>
<TgosLayer categories={["factory"]} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Ships" checked>
<TgosLayer categories={["ship"]} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Other ground objects" checked>
<TgosLayer categories={["aa", "factory", "ship"]} exclude />
</LayersControl.Overlay>
<LayersControl.Overlay name="Supply routes" checked>
<SupplyRoutesLayer />
</LayersControl.Overlay>
<LayersControl.Overlay name="Front lines" checked>
<FrontLinesLayer />
</LayersControl.Overlay>
<LayersControl.Overlay name="Enemy SAM threat range" checked>
<AirDefenseRangeLayer blue={false} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Enemy SAM detection range">
<AirDefenseRangeLayer blue={false} detection />
</LayersControl.Overlay>
<LayersControl.Overlay name="Enemy IADS Network">
<Iadsnetworklayer blue={false} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Allied SAM threat range">
<AirDefenseRangeLayer blue={true} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Allied SAM detection range">
<AirDefenseRangeLayer blue={true} detection />
</LayersControl.Overlay>
<LayersControl.Overlay name="Allied IADS Network">
<Iadsnetworklayer blue={true} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Selected blue flight plan">
<FlightPlansLayer blue={true} selectedOnly />
</LayersControl.Overlay>
<LayersControl.Overlay name="All blue flight plans" checked>
<FlightPlansLayer blue={true} />
</LayersControl.Overlay>
<LayersControl.Overlay name="All red flight plans">
<FlightPlansLayer blue={false} />
</LayersControl.Overlay>
</LayersControl>
<LayersControl position="topleft">
<CoalitionThreatZones blue={true} />
<CoalitionThreatZones blue={false} />
<LayersControl.Overlay name="Blue navmesh">
<NavMeshLayer blue={true} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Red navmesh">
<NavMeshLayer blue={false} />
</LayersControl.Overlay>
<TerrainZonesLayers />
<CullingExclusionZones />
<WaypointDebugZonesControls />
</LayersControl>
</MapContainer>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./LiberationMap";

View File

@@ -0,0 +1,31 @@
import { selectNavMeshes } from "../../api/navMeshSlice";
import { useAppSelector } from "../../app/hooks";
import { LayerGroup, Polygon } from "react-leaflet";
interface NavMeshLayerProps {
blue: boolean;
}
export default function NavMeshLayer(props: NavMeshLayerProps) {
const meshes = useAppSelector(selectNavMeshes);
const mesh = props.blue ? meshes.blue : meshes.red;
return (
<LayerGroup>
{mesh.map((zone, idx) => {
return (
<Polygon
key={idx}
positions={zone.poly}
color="#000000"
weight={1}
fill
fillColor={zone.threatened ? "#ff0000" : "#00ff00"}
fillOpacity={0.1}
noClip
interactive={false}
/>
);
})}
</LayerGroup>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./NavMeshLayer";

View File

@@ -0,0 +1,9 @@
@import "~leaflet-ruler/src/leaflet-ruler.css";
.result-tooltip{
border-color: #435466;
}
.moving-tooltip{
border-color: #435466;
}

Some files were not shown because too many files have changed in this diff Show More