26 Commits

Author SHA1 Message Date
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
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
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
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
d316e13fa6 Suppress events fired while rebuilding model. 2021-06-05 15:21:23 -07:00
Dan Albert
1ea98a6ed1 Hide incompatible campaigns by default.
https://github.com/dcs-liberation/dcs_liberation/issues/1178
2021-06-05 15:15:30 -07:00
Dan Albert
8076206a90 Add major/minor versioning of the campaign schema.
Many of the schema version increases are just to add new features that
don't render old campaigns obsolete. Convert the version number to a
major/minor format so we can detect the difference between changes that
render old campaigns obsolete (major versions) and new features that
will not work on older builds of Liberation (minor versions).
2021-05-18 00:12:55 -07:00
Dan Albert
c92e4e06cc Move campaign format version to a stable location. 2021-04-18 17:37:55 -07:00
Dan Albert
39135f8c80 Add version field to campaign descriptor file.
This is used to provide a UI hint to guide players towards campaigns
that have been updated to work with the current version of the game.
All the campaigns we currently have were made for an unknown version of
the game, so they're all flagged as incompatible.

The version field is not the DCS Liberation version number because the
campaign format may change multiple times during development. Instead
the version number is a monotonically increasing integer that we
increment whenever a game change requires campaign updates.
2021-04-18 17:30:49 -07:00
Dan Albert
a47bef1f13 Blacken. 2021-02-12 20:10:45 -08:00
Khopa
f959dd0519 Campaign have a recommended defaults faction setup to ease campaign setup 2021-01-22 22:09:55 +01:00
Dan Albert
fd454dce74 Load campaign data lazily.
Error checking comes later, but the new game wizard opens much faster by
not spending time creating theaters it doesn't need.

Fixes https://github.com/Khopa/dcs_liberation/issues/469
2020-11-26 22:14:23 -08:00
Dan Albert
ae68a35a1a Remove save compat since it's breaking anyway.
Removal of old paths/names for things that no longer exist.
2020-11-20 17:06:01 -08:00
Dan Albert
1e70e654ed Don't attempt loading miz files as JSON. 2020-11-19 21:32:44 -08:00
Dan Albert
df80ec635f Add a new miz file based campaign generator.
Defining a campaign using a miz file instead of as JSON has a number of
advantages:

* Much easier for players to mod their campaigns.
* Easier to see the big picture of how objective locations will be laid
  out, since every control point can be seen at once.
* No need to associate objective locations to control points explicitly;
  the campaign generator can claim objectives for control points based
  on distance.
* Easier to create an IADS that performs well.
* Non-random campaigns are easier to make.

The downside is duplication across campaigns, and a less structured data
format for complex objects. The former is annoying if we have to fix a
bug that appears in a dozen campaigns. It's less an annoyance for
needing to start from scratch since the easiest way to create a campaign
will be to copy the "full" campaign for the given theater and prune it.

So far I've implemented control points, base defenses, and front lines.
Still need to add support for non-base defense TGOs.

This currently doesn't do anything for the `radials` property of the
`ControlPoint` because I'm not sure what those are.
2020-11-19 16:55:21 -08:00
Khopa
5946fc7404 Improved campaign selection screen in new game wizard. 2020-11-08 23:24:10 +01:00
Khopa
a0c61bf73a Authors informations are loaded in Campaign object (to be displayed in UI later) 2020-10-24 17:23:09 +02:00
Dan Albert
1d7f1082ea Fix logging by deferring campaign data loading.
Logging before we've made it to the logging setup was causing the root
logger to be permanently configured to the default (warning) log
level, so we weren't getting any info or debug logs any more.

Defer the campaign data load until it is needed rather than doing it
at import time. I've also cleaned up a bit so we only load each
campaign once, rather than re-loading the campaign to create the
theater again after the wizard is finished.
2020-10-06 23:26:18 -07:00
Khopa
60ce6658ad Campaigns are sorted by terrain in new game wizard 2020-10-07 01:12:16 +02:00
Khopa
71f77dd8fb Added moddable campaigns through json files. 2020-10-07 00:09:11 +02:00
Khopa
6ea694bc7e Added more Syria campaigns 2020-08-21 00:41:34 +02:00
Khopa
d18a9f376f Added Syria map with GolanHeights setup.
Added a setting to forbid navy units on some control points.
2020-08-20 22:15:54 +02:00
Khopa
602e7fb530 Added syria map icon 2020-08-20 19:12:30 +02:00
Khopa
a60e6aa860 Reworked campaign selection wizard. Added two small scale camapaigns on PG map 2020-08-20 00:17:10 +02:00