1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 20:29:57 +00:00
Commit graph

245 commits

Author SHA1 Message Date
Andrei Kortunov
bd59247270 Avoid trailing line breaks 2024-11-20 09:04:22 +04:00
Andrei Kortunov
f0543c5500 Implement a context menu for data directories page (feature 8130) 2024-11-19 14:58:31 +04:00
Evil Eye
7bbb1bf05d Merge branch 'loosey-goosey' into 'master'
Store original representation of paths in content lists. Also compare against existing content lists in a more forgiving way.

See merge request OpenMW/openmw!4424
2024-10-27 12:31:41 +00:00
psi29a
a11e683a40 Merge branch 'content-lists-could-provide-duplicate-fallback-archives' into 'master'
Gracefully handle content lists that specify duplicate BSAs

Closes #8200

See merge request OpenMW/openmw!4421
2024-10-25 11:08:41 +00:00
AnyOldName3
7640b6bcf4 Typo 2024-10-25 00:32:12 +00:00
AnyOldName3
c2b383ea92 Store original representation of paths in content lists
Also compare against existing content lists in a more forgiving way.

The first improvement makes it possible to use relative paths in openmw.cfg without the launcher canonicalising them.
This was really annoying if you used a relative path on purpose.
It also stops the launcher converting all paths to Qt's convention, where forward slashes are used on Windows even though they're not native.
The engine doesn't care, so you could always put either in the config file, but the launcher wouldn't stand for that, and would make them match.

To make this work, we need to store a path's originalRepresentation in the content list, compare paths loaded from openmw.cfg based on their originalRepresentation, and convert paths from originalRepresentation to absolute value when loading them from a content list.

The second improvement means that paths that are equivalent, but expressed differently (e.g. mismatched case on Windows, mismatched separators on Windows, or mild differences like unnecessary `./`es and doubled separators) don't trigger the creation of a new effectively-identical content list.

To make this work, we had to switch the comparison to lexicaly normalise the path first.
It could only be lexical normalisation as originalRepresentation might be absolute, relative, or absolute-but-based-on-a-path-slug, and we didn't want slugs to break things or relative paths to count as equivalent to absolute ones that refer to the same file.
The comparison is case-insensitive on Windows, and case-sensitive elsewhere.
This isn't strictly right, as you can have case-sensitive things mounted on Windows or tell a Linux directory to be case-insensitive, but we can't tell when that might happen based on a lexical path as it depends on real directory properties (and might differ for different parts of the path, which is too much hassle to support).
2024-10-25 00:49:59 +01:00
AnyOldName3
0537b53d21 Gracefully handle content lists that specify duplicate BSAs
Previously, if fed bad data, or a content list predated a BSA being moved to a non-user config file, or possibly in other situations (but not any of the obvious ones as those had other guards), the `selectedArchives` list could be longer than the number of archives available due to duplicate entries.

This ensures they're handled like entries specifying no-longer-present archives, and just skips the duplicates.
The same would happen elsewhere in similar situations, but those code paths aren't always taken.
2024-10-22 22:40:16 +01:00
AnyOldName3
7556ab6f90 Make the launcher ignore case in bsa names 2024-10-21 18:07:13 +01:00
psi29a
f456978cc3 Merge branch 'blueshift' into 'master'
Launcher: Support extended selection for directories

See merge request OpenMW/openmw!4346
2024-08-30 10:23:08 +00:00
Alexei Kotov
073e4639bf Launcher: Support extended selection for directories 2024-08-29 04:18:07 +03:00
Alexei Kotov
f393c40cbd Launcher: Fix Insert Above behavior when the directory is added automatically 2024-08-29 03:54:26 +03:00
Alexei Kotov
8a7035020a Don't check subdirectories of valid content subdirectories (#8085) 2024-07-26 21:49:51 +03:00
Yury Stepovikov
80d2b289e7 Fix archive selection when switching profiles (#7956) 2024-05-24 23:06:55 +00:00
Andrei Kortunov
5e8dc9cc03 Fix stub icon color 2024-04-24 11:14:50 +04:00
AnyOldName3
47ef2d018f Always set userrole for archive list 2024-03-27 22:25:32 +00:00
AnyOldName3
e735bf67e1 Brace-initialise SettingValue
Clang didn't like it otherwise
2024-03-27 14:04:08 +00:00
AnyOldName3
59334f694d Don't forget to add path to UserRole 2024-03-26 23:11:54 +00:00
AnyOldName3
b15f7857c0 currentDir.value is already canonicalised 2024-03-20 14:34:23 +00:00
AnyOldName3
a130ca57a4 Track source of settings
This one's a biggie.

The basic idea's that GameSettings should know:
* what the interpreted value of a setting is, so it can actually be used.
* what the original value the user put in their config was, so it can be put back when the config's saved.
* which path it's processing the openmw.cfg from so relative paths can be resolved correctly.
* whether a setting's a user setting that can be modified, or from one of the other openmw.cfg files that can't necessarily be modified.

This had fairly wide-reaching implications.

The first is that paths are resolved properly in cases where they previously wouldn't have been.
Without this commit, if the launcher saw a relative path in an openmw.cfg, it'd be resolved relative to the process' working directory (which we always set to the binary directory for reasons I won't get into).
That's not what the engine does, so is bad.
It's also not something a user's likely to suspect.
This mess is no longer a problem as paths are resolved correctly when they're loaded instead of on demand when they're used by whatever uses them.

Another problem was that if paths used slugs like ?userconfig? would be written back to openmw.cfg with the slugs replaced, which defeats the object of using the slugs.
This is also fixed.

Tracking which settings are user settings and which are in a non-editable openmw.cfg allows the launcher to grey out rows so they can't be edited (which is sensible as they can't be edited on-disk) while still being aware of content files that are provided by non-user data directories etc.
This is done in a pretty straightforward way for the data directories and fallback-archives, as those bits of UI are basic, but it's more complicated for content files as that uses a nmodel/view approach and has a lot more moving parts.
Thankfully, I'd already implemented that when dealing with builtin.omwscripts, so it just needed wiring up.

One more thing of note is that I made the SettingValue struct storable as a QVariant so it could be attached to the UI widgets as userdata, and then I could just grab the original representation and use it instead of needing any complicated mapping from display value to on-disk value.
2024-03-06 00:36:13 +00:00
AnyOldName3
1af59c3a43 Tooltips for data-local and resources/vfs 2024-02-29 00:48:03 +00:00
AnyOldName3
f476301670 There's no such thing as the global data directory
That's what resources/vfs is for.
2024-02-27 14:11:48 +00:00
elsid
cc9f9b53ba
Convert BsaVersion to enum class 2024-02-18 14:54:51 +01:00
Andrei Kortunov
7e345436f4 Localize Launcher and Wizard 2024-02-01 09:47:25 +04:00
Yury Stepovikov
c90ebcc86b Allow multiselect in the archives tab (#7606) 2024-01-28 21:33:10 +00:00
Evil Eye
672cefd594 Track checked EsmFile pointers instead of full paths 2024-01-09 17:40:14 +01:00
Andrei Kortunov
ca19f7006c Make hardcoded strings in Launcher and Wizard localizable 2023-12-11 12:02:43 +04:00
Andrei Kortunov
5e96825e6b Highlight new items in launcher by text formatting, not by color 2023-11-29 11:14:44 +04:00
elsid
8f27178a0b
Use settings values for navigator in the launcher 2023-11-12 16:33:44 +01:00
Alexei Kotov
f68bd3ba97 Launcher: Improve directory appending UX and heuristics (bug #7502)
- Recognize more asset directories and omwgame files
- Always let the user append the selected directory
- Automatically pick the user-selected directory if it's the only valid directory
- Add a caption to directory selection dialog, properly handle cancellation
2023-10-22 16:20:19 +03:00
Alexei Kotov
5e5a25f901 Show BA2 files in the launcher 2023-08-17 02:12:31 +03:00
Andrei Kortunov
8df7ce545e Migrate from GraphicsWindowQt to QOpenGLWidget 2023-04-05 19:43:42 +04:00
fredzio
37c4587ca4 Display directories that contains omwscripts.
Display newly added omwscripts as new.
2023-03-30 21:32:01 +02:00
elsid
9815f930d9
Setup launcher configuration manager and logging before initializing UI 2023-03-21 21:29:57 +01:00
elsid
de112a2950
Simplify converting file names into absolute file paths 2023-03-21 09:34:27 +01:00
elsid
5a691380ea
Use single set to check presence of archives 2023-03-21 09:34:27 +01:00
elsid
b1765cf05a
Do single lookup for widget item 2023-03-21 09:34:27 +01:00
elsid
62536d5cf7
Use static QFile::exists instead of creating object 2023-03-21 09:34:27 +01:00
elsid
ecb9c35268
Remove unused variable 2023-03-21 09:34:27 +01:00
elsid
9280957581
Save original paths
If directory path is a symlink it should be showed and written to config files
as is. Between launcher runs the resulting canonical path may be different so
the resolved path becomes outdated.
2023-03-21 01:37:26 +01:00
elsid
ff7fcd752a
Use set to track visited directories instead of removing duplicates 2023-03-21 01:22:41 +01:00
Cédric Mocquillon
c1fbe90953 Handle GNRL case of ba2 format 2023-03-02 18:19:58 +01:00
psi29a
aee7716c3a Merge branch 'launcher_typed_settings' into 'master'
Typed launcher settings

See merge request OpenMW/openmw!2650
2023-02-04 23:41:59 +00:00
elsid
8be2fc9fd7
Stop updating navmeshtool progress on first bad message 2023-01-27 19:10:53 +01:00
elsid
cf75363290
Typed launcher settings
QMultiMap is not clear about what settings exist and it's not efficient way to
access them after they are loaded.
2023-01-27 12:42:05 +01:00
AnyOldName3
438b03908d Use dedicated function to convert QString to std::filesystem::path II
Some missed conversions identified in review.
2023-01-20 23:39:30 +00:00
AnyOldName3
f757ac642a Use dedicated function to convert QString to std::filesystem::path
I noticed this while reviewing something else and trying to find the
function to recommend using it.
2023-01-19 22:36:51 +00:00
Andrei Kortunov
902c48d1bb Rework launcher UI 2023-01-15 12:36:08 +04:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
elsid
624d8bc931
Support unsigned settings values 2022-10-04 01:34:53 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00