1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00
Commit graph

146 commits

Author SHA1 Message Date
lennard 9733e119c9
Show install path for origin games in game info
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:21 +02:00
loathingKernel 5748d0e6ee
RareCore: Manage initialization in RareCore instead of LaunchDialog
This is the last change of the `backend_refactor` branch. This makes
`RareCore` the centerpiece of Rare by moving initialization before the UI
is brought up. RareCore is now in control of creating and querying `RareGame`
objects, re-introducing the ability (incomplete) to refresh the games library.
As a result, ApiResults has been removed.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:21 +02:00
loathingKernel dea01ae24b
RareGame: Origin games should be able to launch despite not being installed 2023-03-07 17:11:20 +02:00
loathingKernel a3d09ae288 Code cleanup: Use pass instead of ellipsis (...) for abstractmethods
Fix a few other issues pointed out by MultisampledNight

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-20 15:31:04 +02:00
loathingKernel 9b856e5f8e InstallDialog: Allow downloading 0 size DLCs
There are DLCs (for example KingletAztec) which are essentially
entitlements, a single file the allows access to already downloaded
content. Updates for such DLCs only change the metadata version number
without any actual new data. These DLCs are handled correctly by the
DLM, but our dialog would refuse to allow installing them due to 0 download
size. This change allows them to pass through the InstallDialog.

The other issue, which I don't know if it was only a result of our faulty
validation at startup or could occur in legendary too, is that a DLC might
be marked with needing verification. Currently we don't have a way of
verifying DLCs, so when verifying the game, we will also set the same
state for any installed DLCs. In effect verifying the game successfully
will also mark any DLCs as correct.
2023-02-17 10:37:44 +02:00
loathingKernel 6c0663771c GameInfo: Make widgets react to changes from RareGame's widget.update signal
Note: the `__update_widget()` method, while it doesn't have any visible delay
has the potential for improvement. I didn't do it because it felt like
premature optimization.

MoveGamePopUp: update it to use RareGame and it's signals

RareGame: Add `install_path` attribute and change `needs_verification` setter
Now both setters will update the local `igame` attribute and save it too.

MoveWorker: Update it to use RareGame.
Other changes include moving "same-drive" moving into the worker and using
`os.path` methods instead of `PathLib`

SteamGrades: Remove worker, it is implemented in RareGame now.
2023-02-15 16:59:33 +02:00
loathingKernel 9f408772e3 RareGame: Resolve and cache steam grade 2023-02-14 10:20:59 +02:00
loathingKernel abba86e10b RareGame: Create intermediate class RareGameSlim between RareGameBase and RareGame
The `RareGameSlim` class is useful mostly in the Launcher as it doesn't
depend on `ImageManager`. I should hold anything required by the Launcher.
2023-02-09 01:37:53 +02:00
loathingKernel f2490f065b RareGame: Create common base class for RareGame and RareEosOverlay.
It contains some common methods as well as the `State` enumeration
and the `Signals` class.
2023-02-08 15:13:02 +02:00
loathingKernel 359157fac3 RareGame: Add property to get the unprocessed save path 2023-02-07 16:02:04 +02:00
loathingKernel 1721677e33 GameWidget: Implement reactive and interactive labels
The `status_label` displays what is currently going on with the game.
It reflects the current operation running on it or if it requires special
attention (update, needs verification etc)

The `tooltip_label` displays hover information such as what happens
if a part of the widget is clicked or in the case of the launch button if
the game can run (without version check, offline etc)

The context menu on the widgets will be updated and populated according
to the installation state of the game. Since the context menu was revised
the shortcut creation code was revised too to make it more compact.

the `create_desktop_link` and `get_rare_executable` functions are moved
from `rare.utils.misc` to `rare.utils.paths` to avoid cyclical imports and
better grouping. Two functions are added, `desktop_link_path` to uniformly
calculate the path of the shortcut and `desktop_links_supported` which
checks if Rare supports creating shortcuts on the current platform.
`desktop_links_supported` should be used as safeguard before `desktop_link_path`.

Desktop links are currently untested on Windows but if `shortcut.Description`
works as expected, it should be good to go.
2023-02-07 13:41:59 +02:00
loathingKernel 34a13ea3b2 ApiResults: Mirror the way RareCore from refactor_backend handles non asset items
`LegendaryCore.get_non_asset_library_items()` returns the same tuple
for `game_list, dlc_dict` as for regular games with assets, so
keep the result for API completeness, since `RareGame` can handle those
games properly.
2023-02-07 13:04:33 +02:00
loathingKernel c83ee69914 GamesTab: Populate RareGame.saves at creation based on ApiResults
Remove unused attributes and clean layout code.
2023-02-06 09:45:30 +02:00
loathingKernel ac4060d804 RareGame: Set state before emitting the widget.update signal 2023-02-05 19:13:38 +02:00
loathingKernel f2745a9551 RareGame: Disable erroneous pylint errors 2023-02-04 17:38:07 +02:00
loathingKernel 6b3a841378 Refine QueueWorker and implement worker_info for VerifyWorker and MoveWorker 2023-02-04 17:38:07 +02:00
loathingKernel 6800b7e9ab Workers: Implement wrapper QueueWorker class prototype for queueable workers
RareCore: Impelement base worker queue
2023-02-04 17:38:07 +02:00
loathingKernel 28e68cad97 MoveWorker: Move worker into rare/shared/workers 2023-02-04 17:38:07 +02:00
loathingKernel f0b81c7038 RareGame: Add state property and emit the widget.update signal on change 2023-02-04 17:38:07 +02:00
loathingKernel 2ef70b8eb4 InstallQueueItemModel: Refactor to add an expiration date to the download
While not sure if it is required, add an expiration date to the prepared
download 30 minutes after it was prepared. If a download has been in the
queue for more than 30 minutes, the download will be prepared again silently
before starting.

Return only the `InstallOptionsModel` in the result of the download thread
to avoid the potential mistake of re-using it. This required for the tray
notification signal to operate on the `app_name` instead of the `app_title`.
As a result, the notification slot was moved into the TrayIcon class for
better encapsulation.
2023-02-04 17:38:07 +02:00
loathingKernel 90021e34f2 RareGame: Add enqueue and dequeue signals
They are used to insert and remove updates from downloads when
the installation of a game changes through `RareGame.set_installed`.
They piggy-back the signals with the same names in `GlobalSignals`

When importing a game from EGL, also check
2023-02-04 17:38:07 +02:00
loathingKernel 020d225f97 InstallDialog: Make as modal when not silent to block input 2023-02-04 17:38:07 +02:00
loathingKernel fc7e45a43a UninstallDialog: Implement it to work similarly to InstallDialog
Similarly to the installation procedure, when an uninstall is
requested, an `UninstallOptionsModel` is emitted by the `RareGame`.
`DownloadsTab` handles the signal and spawns the `UninstallDialog`.
After the `UninstallDialog` is closed, a worker thread handles
uninstalling the application to avoid UI lock-ups when a large
number of files is deleted.

Allows for uninstall actions to be spawned from anything having
access to the `RareGame` instance.

LaunchDialog: Don't check health on DLCs, they always will require
verification if they don't specify an executable.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00
loathingKernel 95df85419b GameLaunchHelper: Enumerate valid actions and states from 1 instead of 0
Fixes potential boolean checks on the relevant attributes
2023-02-04 17:38:07 +02:00
loathingKernel 4063195b4d DownloadsTab: Refactor downloads tab
When updates are queued, they are removed from the update's list. An exceptions is made
when the queued item comes from repairing (without updating), in which case the update is
disabled for the runtime.

A queued item can be either removed (if it is an update it will be added back to the
updates groups) or forced to be updated now. If a queued item is forced, the currently
running item will be added to the front of the queue. Downloads will be queued if
there is no active download but there is a queue already.

The download thread is now responsible for emitting the progress to `RareGame`

InstallDialog: Pass `RareGame` and `InstallOptionsModel` only as arguments.
The `update`, `repair` and `silent` arguments are already part of `InstallOptionsModel`
`RareGame` is used to query information about the game.

InstallInfoWorker: Pass only `InstallOptionsModel` as argument
Emit `InstallQueueItemModel` as result, to re-use the worker when queuing stopped games

RareGame: Query and store metadata property about entitlement grant date
RareGame: Add `RareEosOverlay` class that imitates `RareGame` to handle the overlay

LibraryWidgetController: Remove dead signal routing code, these signals are handled by `RareGame`
Directly parent library widgets instead of reparenting them

GameWidgets: Remove unused signals

EOSGroup: Set install location based on preferences and use EOSOverlayApp from legendary

GamesTab: Connect the `progress` signals of dlcs to the base game's signals
GamesTab: Remove dead code

GlobalSignals: Remove `ProgresSignals`

RareCore: Mangle internal signleton's names

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00
loathingKernel 0d4b75d399 GameProcess: Make it a persistent member of RareGame
The `GameProcess` class now acts as a persistent member of `RareGame`
that can be re-used for launching games. Its signals are handled and
repeated by `RareGame`.

Implements launching directly into `RareGame`

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 599db2629f TrayIcon: Update the list of recent games after a game has exited
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 7fbd941c98 GameProcess: Move GameProcess out of GameUtils and into its own file under rare/shared
In the same vain, move `rare/game_launch_helper/message_models` into `rare/modes` since it is used in both the server and the client side.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 36e650dfe0 RareGame: Cache metadata json. Small speed-up at startup
Consistency is achieved by always updating the shared metadata dictionary
before writing it to the disk.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 79bae4374d GameInfo: Transition to RareGame
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel db0724fba0 GameInfo: Use RareGame to keep the VerifyWorker running on a game and connect progress to the widget.
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel ab596139af RareCore: Add RareGames to a data structure in RareCore
This merges a few of the internal features of RareCore such us
RareGame filtering and thus game grouping based on attributes.

This is required to properly connect a single signal from RareCore to
the downloads tab for game installation. This also includes filtering
games based on updates and other attributes.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel b0c4fb4212 GameUtils: Adapt to use RareGame
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 4640f8af6f RareGame: Add metadata loading into RareGame itself and adapt tray icon to use the same file structure
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 9ca39d94ab GlobalSignals: Reorganize signals into groups
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 7b6a3e181a Shared: Move GameUtils and CloudSaveUtils into rare.shared
Removed `rare.utils.legendary_utils`, the `uninstall_game` function
was moved to `rare.shared.game_utils` for now

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 96b80bc423 Library: Introduce new tile design from refactor_backend
Currently broken but Rare starts

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 652968b6bf RareGame: Introduce RareGame from refactor_backend branch
Shared: Move WineResolver to `rare/shared/workers`
PathSpec: Move to `rare/models`

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 5370355e5d Lgndr: Restructure module to follow legendary's file hierarchy
Move overloaded class files into the folders following
legendary's structure. Move Rare's integration classes into
their own subfolder.
2022-10-29 14:50:18 +03:00
loathingKernel 2c36ffcd51 Lgndr: Adjust for d8af06c936 2022-09-01 11:49:42 +03:00
loathingKernel 5e022e6d28 Lgndr: Rename a few fields to reflect legendary's names 2022-08-08 21:06:58 +03:00
loathingKernel e97e9fe841 Downloads: Add skip_dlcs and with_dlcs arguments. 2022-08-08 17:26:38 +03:00
loathingKernel 3ee789a695 Update DownloadThread 2022-08-03 02:33:50 +03:00
loathingKernel 7408116deb Lgndr: Don' use lambda with default argument 2022-08-02 10:42:38 +03:00
loathingKernel f51563ea93 Models: Move installation related models into their own file 2022-08-02 10:42:38 +03:00
loathingKernel 3a28f2f0a2 Implement image manager
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2022-06-19 17:12:59 +03:00