Compare commits

...

2553 Commits
1.0.1 ... 6.3

Author SHA1 Message Date
39bba9cbfa Merge pull request #815 from Scrumplex/fix-funny 2023-02-03 18:44:33 +01:00
104c231740 Merge pull request #816 from Scrumplex/bump-6.3 2023-02-03 18:44:13 +01:00
bc376b22c7 chore: bump to 6.3
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-02-03 18:40:10 +01:00
54e03d602f Merge pull request #813 from Scrumplex/bump-6.2 2023-02-03 17:07:48 +01:00
d8a84d2aa3 chore: bump to 6.2
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-02-03 10:58:22 +01:00
a7ff74365d Merge pull request #804 from flowln/improve_big_concurrent_task_test 2023-02-03 10:57:21 +01:00
68c884f20d Merge pull request #810 from flowln/error_on_bad_file_paths_as_we_should_catquake 2023-02-03 10:49:17 +01:00
b7e96bdf62 Merge pull request #779 from TheLastRar/zlib-undo-rename 2023-02-02 15:17:16 +01:00
16b48866f4 Merge pull request #784 from flowln/fix_resource_folder_double_smart_ptrs 2023-02-02 15:17:16 +01:00
4827f7e317 Merge pull request #781 from Ryex/patch-1 2023-02-02 15:17:16 +01:00
92f6a34624 Merge pull request #758 from flowln/fix_process_events_backstab 2023-02-02 15:17:16 +01:00
c5ce8bfb3e Merge pull request #772 from TheLastRar/zlib-fallback-bundled-fix
Fix: zlib fallback not working
2023-02-02 15:17:15 +01:00
6429088472 Merge pull request #746 from RaptaG/patch-1 2023-02-02 15:17:15 +01:00
bf9885dd7e Merge pull request #743 from flowln/fix_mods_with_wrong_modListVersion 2023-02-02 15:17:15 +01:00
d16b6fe634 Merge pull request #732 from DioEgizio/actually-fix-openssl3-mac-failures 2023-02-02 15:17:15 +01:00
4539d58d7d Merge pull request #731 from flowln/windows_server_trash 2023-02-02 15:17:15 +01:00
a8611a56fc Merge pull request #726 from TheLastRar/qt6-win-darkmode
Closes https://github.com/PrismLauncher/PrismLauncher/issues/158
2023-02-02 15:17:15 +01:00
c3d64aa984 Merge pull request #716 from DioEgizio/qt6.4.2-winmsvc
closes https://github.com/PrismLauncher/PrismLauncher/issues/288
2023-02-02 15:17:15 +01:00
3fc63fa196 Merge pull request #710 from byquanton/develop
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/708
2023-02-02 15:17:15 +01:00
4438684ce6 Merge pull request #713 from redstrate/fix-html-rendering 2023-02-02 15:17:14 +01:00
699fce4482 Merge pull request #684 from Scrumplex/logging-categories
Prevents private credentials from leaking in the logs of general users
2023-02-02 15:17:14 +01:00
49060beae7 Merge pull request #680 from AshtakaOOf/flathub-screenshots 2023-02-02 15:17:14 +01:00
de561e4fd3 Merge pull request #666 from getchoo/pls-scrump
scrump heard your pleads, rejoice!
2023-02-02 15:17:14 +01:00
1de301752f Merge pull request #665 from flowln/logging_categories 2023-02-02 15:17:10 +01:00
cb8c389303 Merge pull request #648 from Scrumplex/bump-6.1 2022-12-19 16:45:02 +01:00
e1e0166c95 Merge pull request #649 from Scrumplex/fix-winget-release-no9999999 2022-12-19 16:38:13 +01:00
6f8e1ccf89 chore: bump to 6.1
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-19 16:11:10 +01:00
3751856a4e Merge pull request #647 from Scrumplex/update-flake 2022-12-19 16:10:14 +01:00
5203e72199 Merge pull request #628 from flowln/fix_multiple_resource_packs_crash
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/624
2022-12-19 15:36:51 +01:00
3b1ab3c974 Merge pull request #642 from DioEgizio/dont-ship-unnecessary-tlsbackends
fix: exclude unused tls backends
2022-12-18 17:46:58 +01:00
3476bbebd9 Merge pull request #636 from flowln/fix_component_version_when_updating
Correctly set component versions in Modrinth pack updating
2022-12-17 18:20:41 +01:00
45870497c6 Merge pull request #630 from leo78913/yeet-scrollbars 2022-12-17 18:20:41 +01:00
bcf506488f Merge pull request #631 from getchoo/better-msvc-flags 2022-12-17 15:19:42 +01:00
040774d67b Merge pull request #607 from flowln/dont_crash_on_zip_import
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/609
2022-12-16 18:05:35 +01:00
94410352f5 Merge pull request #625 from Edgars-Cirulis/develop 2022-12-15 17:29:52 +01:00
2a819f1ca0 Merge pull request #593 from Scrumplex/fix-winget-release-no999999 2022-12-15 16:36:26 +01:00
25c63dd1e0 Merge pull request #605 from flowln/fix_crash_in_downloader_image
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/590
2022-12-15 16:36:20 +01:00
d7223972d8 Merge pull request #612 from DioEgizio/move-cat-right
closes https://github.com/PrismLauncher/PrismLauncher/issues/611
2022-12-14 13:05:22 +01:00
0a6c1238eb Merge pull request #601 from Scrumplex/fix-translations-3 2022-12-14 13:05:22 +01:00
c11575f5f5 Merge pull request #604 from flowln/fix_crash_with_gtk2
fix: crash with GTK2 theme due to QProxyStyle in ManagedPackPage
2022-12-13 11:09:00 +01:00
783761ca2e Merge pull request #600 from TheLastRar/reset-stylesheet
Resolves https://github.com/PrismLauncher/PrismLauncher/issues/510
2022-12-13 11:09:00 +01:00
15084c8d6d Merge pull request #587 from unascribed/patch/libraries-wording 2022-12-11 16:57:45 -08:00
Una
822c5a530e Not all libraries are from Mojang
Signed-off-by: Una <me@unascribed.com>
2022-12-11 16:11:32 -08:00
6eb641ae56 Merge pull request #585 from DioEgizio/remove-leftover-todo 2022-12-11 13:02:08 -08:00
9eb14e6b9b fix: remove leftover TODO
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-11 20:35:39 +01:00
7cc42269a9 Merge pull request #569 from Jan200101/PR/fix-mangohud 2022-12-11 18:31:05 +01:00
c45442760c Merge pull request #584 from TayouVR/fix-breeze-colors-and-matrix-icon 2022-12-11 09:24:53 -08:00
83f0611200 fix breeze icon colors and matrix icon
Signed-off-by: Tayou <tayou@gmx.net>
2022-12-11 17:36:05 +01:00
d95625ed88 Merge pull request #486 from flowln/wide_bar_customization 2022-12-11 04:16:45 -08:00
5622bcc563 Merge pull request #461 from flowln/fix_big_resource_pack_imgs
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/360
2022-12-11 04:16:21 -08:00
deb9c98630 chore: replace naive mangohud preload with vklayer detection
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
2022-12-11 11:01:34 +01:00
2c1e887c8d chore: replace naive mangohud detection with vulkan layer detection
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
2022-12-11 11:01:33 +01:00
4a13d72997 Merge pull request #32 from flowln/modpack_update_page
Closes https://github.com/PrismLauncher/PrismLauncher/issues/180
Closes https://github.com/PrismLauncher/PrismLauncher/issues/170
2022-12-10 06:34:18 -08:00
590875d022 Merge pull request #575 from Ryex/blockedmods-only-drop-local
Prevent potental crash if droping non local files in BlockedModsDialog
2022-12-10 02:46:55 +01:00
8f30237765 fix: prevent potental crash if droping non local files
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-12-09 17:21:40 -07:00
cb0339b492 Merge pull request #572 from DioEgizio/breeze-icons-improvements 2022-12-09 04:14:36 -08:00
e427174ff0 Merge pull request #571 from Ryex/blocked-targetFolder
fix(blockedmods): Track and use targetFolder for blocked files
2022-12-09 08:33:10 +01:00
fc4c57f0d9 feat: improve new.svg in breeze icon packs
makes it better and more similar to the one in legacy

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-09 07:49:16 +01:00
9ad4ae5340 Merge pull request #568 from leo78913/flatpak-shortcuts 2022-12-08 17:53:33 -08:00
0f48e0fc06 fix(blockedmods): Track and use targetFolder for blocked files
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-12-08 18:42:51 -07:00
37ad1b40d8 fix: fix creating instance shortcuts in flatpak
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-12-08 20:18:07 -03:00
514e7ae6a0 fix: re-add LD_LIBARY_PATH to mangohud
Upstream officially supports the use of $LIB/mangohud/

Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
2022-12-08 23:09:14 +01:00
34230bfcf4 fix: don't try updating Flame instance names when updating versions
Since the exact version string is only available in the manifest,
there's no easy way of getting it before commiting to the update, so
there's not much of a good way of showing the updated name in the UI,
and using the displayName is weird and gives some buggy behavior.

We may want to re-enable it in the future if we find a reliable way of
showing the correct info on the UI before starting the update.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-07 18:05:46 -03:00
c390e211ee Merge pull request #565 from DioEgizio/shortcut-menu-bar 2022-12-07 12:57:46 -08:00
b0d69db878 fix: add instance shortcut creation action to menubar
also moves deleteinstance to the same place as the instance toolbar

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-07 16:52:06 +01:00
b373beee21 Merge pull request #511 from Scrumplex/fix-blocked-mods-usability 2022-12-07 06:12:09 -08:00
6f50809457 fix(FlamePage): don't assert / suggest blocked modpacks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:35 -03:00
bb386a1162 fix(ManagedPackPage): only update the current instance exactly
Also carry on the original ID to avoid updating the wrong instance.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
80054e4db2 fix(ManagedPackPage): preserve pack ID from Modrinth update
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
1630a23fb0 refactor(InstanceImport): require rvalue from 'extra_info' mappings
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
4e75419e08 fix(ManagedPagePage): don't reload pack info when not needed
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
089018015a refactor(ManagedPackPage): use smart pointers instead of raw ones
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
feb6f285ce feat(ManagedPackPage): add reload button when in a fail state
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
cb12c51afc fix(ManagedPackPage): check app capabilities for creating the CF page
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:34 -03:00
c5c426ecbc chore(ManagedPackPage): format and add headers
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
74f7039abf fix(ManagedPackPage): clear combo boxes when adding new versions
Prevents versions to undergo mitosis.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
57b905be24 feat(ManagedPackPage): implement Flame modpack updating button
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
34794cc4af fix(ManagedPackPage): give extra_info to InstanceImportTask in MR packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
38f59fdf39 fix(ManagedPackPage): add warning about old bug with pack IDs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
527c1113f1 feat(ManagedPackPage): add Flame UI
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
04dbe28793 fix(ManagedPackPage): better changelog text when fetching / no changelog
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:33 -03:00
968366c2ae feat+fix: allow forwarding extra info to InstanceImportTask
This allows us to pass to the creation instances their actual pack ID
and version ID, that in Flame's case, are only available before starting
to create an instance.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
7f5dea28bb feat(ManagedPackPage): add link to the Modrinth's pack page
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
d4979974b4 fix(ManagedPackPage): better UX for when network requests fail / are pending
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
9539230915 fix: do not display managed pack page for providers without an impl. yet
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
25cfa26e7b fix: use rich text in changelog for modrinth modpacks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
0ff8891c66 feat: add ManagedPackPage to the instance pages
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
58d2c15ffa feat: add functionality to MR modpack update in the page :D
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
82699cc297 feat: allow skipping the update confirmation dialog
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:32 -03:00
08d008a5aa refactor: abstract away update confirmation dialog
... so that we can avoid code duplication.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 17:00:29 -03:00
9e17ff884f feat: add PageContainer::getPage
This allows us to directly access a page from outside. This will be
useful for telling the ManagedPackPage who is the window it's on, so
that we can close it when updating :^)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 16:54:54 -03:00
1c567232e3 feat: add (current) indicator to the currently installed version in MR
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 16:54:54 -03:00
cba2608c1c feat: add logic for the modrinth instance modpack page
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 16:54:54 -03:00
e5c42f68c2 feat: add basic ManagedPackPage classes
The idea is to have a base class that defines common behavior, and
subclasses for each modpack provider, adding specific behavior.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 16:54:54 -03:00
02b4468bcd feat(ui): add ManagedPackPage ui
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-06 16:54:50 -03:00
746f6945da fix: remove rogue notr
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:52:32 +01:00
5cab4d8864 chore: reformat code
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:52:31 +01:00
5cedfcbfaf chore: add license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:52:14 +01:00
c06abd9b6b refactor: replace Open All with Open Missing
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:52:13 +01:00
e08d97825d feat: implement lax filename match in BlockedModsDialog
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:51:18 +01:00
d61323aa6d fix: improve resize behavior of BlockedModsDialog
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 20:51:18 +01:00
5ae044db93 Merge pull request #556 from DioEgizio/modrinth-icon-larger 2022-12-06 11:50:35 -08:00
c6e4fdac7e Merge pull request #557 from Scrumplex/fix-fswatcher-segfault
Closes https://github.com/PrismLauncher/PrismLauncher/issues/555
2022-12-06 11:50:03 -08:00
9669377b06 Merge pull request #560 from edgarogh/fix-minutes-unit
Closes https://github.com/PrismLauncher/PrismLauncher/issues/553
2022-12-06 14:45:46 +01:00
c8c3fe1023 chore: add license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 13:18:50 +01:00
85bddbed86 chore: reformat code
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-06 13:16:27 +01:00
318a2a429c Fix minutes unit
Replaced "m" with "min" in `Time::prettifyDuration`

Signed-off-by: Edgar Onghena <dev@edgar.bzh>
2022-12-06 13:01:43 +01:00
07359865c6 fix: don't allocate BlockedsModsDialog
Fixes temporary memory leak!

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-05 21:39:26 +01:00
2fd7338cd3 dix: disable FS watcher after closing BlockedModsDialog
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-05 21:39:24 +01:00
ce3cfa212c fix: make modrinth icon larger
before it was considerably smaller than the other modpack platform icons which looked weird

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-05 20:27:29 +01:00
b29c99656e Merge pull request #546 from DioEgizio/add-server-icon
feat: add a proper server icon
2022-12-05 07:49:55 +01:00
45b0762096 Merge pull request #547 from flowln/fix_copying_instance
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/545
2022-12-04 23:47:09 +01:00
aceafb28f6 feat: add server icon to simple colored icons too
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Co-Authored-By: leo78913 <leo3758@riseup.net>
2022-12-04 21:29:00 +01:00
928939cbe3 fix(Inst.Copy): create FS::copy object inside the secundary thread
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-04 12:29:38 -03:00
2462b8e524 feat+fix: better flat icon
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-04 13:30:24 +01:00
263a72879d fix: oyxgen is lgpl3!
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-04 12:50:40 +01:00
70620d5137 feat: add a proper server icon
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-12-04 12:45:39 +01:00
79d5beff8d Merge pull request #541 from ryanccn/warn-before-trash-instance
Closes https://github.com/PrismLauncher/PrismLauncher/issues/192
closes https://github.com/PrismLauncher/PrismLauncher/issues/462
2022-12-03 15:20:49 +01:00
fa3caf091a fix: warn before trashing instances
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-12-03 21:54:41 +08:00
93707560cb Merge pull request #506 from Protrikk/develop 2022-12-02 22:04:33 +01:00
5c6f325071 Remove blue-ish tint from remaining flat white icons
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-02 20:47:11 +01:00
b9a17f5999 Merge branch 'upstream/develop' into develop
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-02 20:46:04 +01:00
ab23f542c6 Merge pull request #423 from TheKodeToad/addagent
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/414
2022-12-02 06:40:18 -08:00
fa98bf1ee7 Merge pull request #481 from ryanccn/import-resource-pack-dialog-uwu 2022-12-02 06:39:54 -08:00
3cc987a5b4 fix: explicitly set scheme for local file in -I argument
Otherwise isLocalFile() will return false for local files without the
file:// thingy.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-01 22:54:03 -03:00
d1a1b8b6e8 Merge pull request #524 from DioEgizio/woa
add windows on arm builds
2022-12-01 23:09:37 +01:00
0d08e082be Merge pull request #538 from flowln/fix_some_cf_imports
A couple fixes for CF instance imports
2022-12-01 23:06:35 +01:00
386fb28a35 fix(FileResolvingTask): Fail instead of crash when there's API errors
Also remove non-used variable (rip).

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-01 15:33:35 -03:00
79b79b752c fix(Inst.Import): Show error reason in fail dialog
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-01 15:32:26 -03:00
a116778402 fix(Inst.Import): don't search inside 'overrides/' for the manifest
It will never be there anyways, and saves a **bunch** of time when the
overrides folder is big and we traverse all the tree when searching for
the MMC 'instance.cfg' file.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-12-01 15:15:15 -03:00
4c1c26a0e6 chore: drop Windows-MinGW-w64-Legacy
this brings back the number of builds as the same as before the pr

this is one of the slowest builds + windows 7/8.1 users can just use Windows-MSVC-Legacy

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-30 18:45:34 +01:00
9e1653ebb4 Merge pull request #436 from Scrumplex/feat-change-maxmem
Closes https://github.com/PrismLauncher/PrismLauncher/issues/426
2022-11-30 18:22:55 +01:00
99dd9874df refactor+fix: refactor the windows part of the release workflow and add arm to it
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-30 13:46:55 +01:00
24193163e1 Maybe fix ResourceFolderModel Clang64 test failure
Previously this test would fail sometimes without including ECMQueryQt

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-30 13:46:55 +01:00
94d164c0f2 Remove unused QT_DATA_DIR/QT_MKSPECS_DIR
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-30 13:46:55 +01:00
efef2e95ab Use ECMQueryQt Only with Qt5
Qt6 provides CMake variables for the paths we need

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-30 13:46:55 +01:00
5efa725e92 feat(actions) add arm64 build
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-30 13:46:55 +01:00
42c00213ce Merge pull request #238 from santiagocezar/new-icons 2022-11-29 14:30:29 -08:00
b7d1b9ac61 Merge pull request #527 from DioEgizio/revert-6.4.1-winmsvc 2022-11-29 14:27:29 -08:00
52d06ed814 chore: move instance_icons.svg
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-29 20:07:00 +01:00
46a1c855a9 Merge pull request #528 from Scrumplex/fix-resourcepages-runningstate 2022-11-29 19:50:00 +01:00
31dc82b1a6 Make requested changes
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-29 09:43:08 +00:00
4e27e132a0 fix: don't disable interaction on non-mod models when inst. is running
It is still useful for mods though, since we don't wnt to allow
disabling mods when the instance is running, as that wouldn't affect the
running instance, possibly causing confusion

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-28 12:02:38 -03:00
a5b0b4800a fix: make resource buttons work when instance is running
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-27 23:10:32 +01:00
e6244c937a Merge branch 'develop' into new-icons
Signed-off-by: Santiago Cézar <48573316+santiagocezar@users.noreply.github.com>
2022-11-27 16:28:42 -03:00
3cbf8d4993 resolving reviews
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-27 16:24:45 -03:00
f3279a0697 Merge remote-tracking branch 'upstream/develop' into import-resource-pack-dialog-uwu 2022-11-27 20:05:21 +01:00
8cac61f0be fix: check resource pack validity solely using pack format
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-27 18:41:52 +01:00
236c196e68 fix: improve code readability
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-27 18:38:56 +01:00
6c09efd630 fix: use qt 6.4.0 on windows msvc for now
qt 6.4.1 has a very bad scaling regression

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-27 15:24:15 +01:00
cc92e1b0b6 Merge pull request #521 from Scrumplex/missing-icons 2022-11-26 19:02:03 +01:00
c90f2c3ac6 fix: use monochrome icon for breeze
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-26 15:05:08 +01:00
6bdd27a08e Merge pull request #493 from Scrumplex/cachix
Closes https://github.com/PrismLauncher/PrismLauncher/issues/491
2022-11-26 14:24:06 +01:00
80ff0b1418 Merge pull request #492 from Scrumplex/update-nix 2022-11-26 14:03:51 +01:00
a8943ce1ee remove unused ftb icon
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 15:15:08 -03:00
71d35dc70b meat is now round
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 15:15:08 -03:00
9daf2a2996 resize to 24x24
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 15:15:07 -03:00
f5d6aea942 forgot ftb
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 15:15:07 -03:00
5850447fd0 merge with upstream
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 15:14:52 -03:00
e12a7a4415 gradients!
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 14:22:49 -03:00
81d84b8d02 initial icons
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-25 14:22:49 -03:00
bae0a0530b fix(RPImportDialog): allow changing item size to accomodate wrapped text
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-25 11:51:08 -03:00
cbf4159c7e fix: add missing shortcut icons
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-25 14:03:10 +01:00
4a1d082614 reafctor(WideBar): connect to signal instead of overriding menu method
This makes stuff more standard and closer to what we do in other places
in the codebase.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-25 09:33:05 -03:00
fd8b4c5368 Merge pull request #227 from Leo40Git/feature/instance-shortcuts
Closes https://github.com/PrismLauncher/PrismLauncher/issues/210
2022-11-25 13:11:00 +01:00
5872c34315 Merge pull request #412 from leo78913/legacy-icons
add the missing icons to the legacy icon theme
2022-11-25 08:36:42 +01:00
b60fe08d44 Merge pull request #514 from DioEgizio/force-bundled-libs-win 2022-11-23 15:11:45 -08:00
6a51eda361 fix: force bundled libs on win msvc
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-23 19:53:55 +01:00
96e8217b00 Button to add agent
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-23 09:46:55 +00:00
e6cb6cae11 Merge pull request #508 from TheLastRar/ForceBundledLibs 2022-11-23 09:49:24 +01:00
980f03dd20 Fix: Launcher_FORCE_BUNDLED_LIBS Failing to find bundled zlib
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-22 19:23:09 +00:00
20c281d6f8 fix: reset wide bar settings when the list of actions changes
This prevents changes to the actions to cause non-intuitive issues in
the Wide bar, hiding items that previously weren't hidden.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-22 14:30:54 -03:00
66f9fed2f2 Remove blue-ish tint from flat white icons
Signed-off-by: Trisave <42098407+Protrikk@users.noreply.github.com>
2022-11-22 18:30:21 +01:00
68b7aa0a4d Merge pull request #498 from Scrumplex/fix-copy-signal 2022-11-21 13:44:43 -08:00
f916ce8752 Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into import-resource-pack-dialog-uwu 2022-11-21 23:19:50 +08:00
4208c2c72a fix: actually emit fileCopied
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-21 15:47:15 +01:00
5cc91965d0 Merge pull request #487 from TayouVR/breeze-icon-themes 2022-11-21 14:43:58 +01:00
c74f852364 Merge pull request #243 from Scrumplex/migration-dialog
Closes https://github.com/PrismLauncher/PrismLauncher/issues/46
Closes https://github.com/PrismLauncher/PrismLauncher/issues/204
2022-11-21 12:14:49 +01:00
c1b3a3adb4 fix(actions): don't ignore nix files
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-21 11:43:46 +01:00
7096f02b88 fix: text wrapping
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-21 18:15:03 +08:00
70a11935a8 feat(actions): add Nix build
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-21 00:22:25 +01:00
f601135cc0 refactor(nix): synchronize changes from nixpkgs
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-20 23:49:11 +01:00
884fe0d574 feat: validate maximum memory allocation in wizard
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-20 18:16:19 +01:00
ffcbf97dcc fix: add Breeze copyright notice to COPYING
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-20 17:48:44 +01:00
f55fc51e9b fix: remove commented-out assertions
They may not hold true at all times, and that's fine.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-20 11:11:08 -03:00
df0f9259c0 refactor: move RP/TP validation to their respective utils
This makes it easier to validate individual resources, and allows the
logic to be used in other places in the future, if we need to.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-20 11:10:26 -03:00
bb7a321c6e add breeze themes
Signed-off-by: Tayou <tayou@gmx.net>
2022-11-20 05:24:10 +01:00
2d69d63efe feat(InstancePages): save/load wide bar visibility settings
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-19 18:41:31 -03:00
479843f56b feat(WideBar): allow loading/unloading visibility via a byte array
I really wanted to use a QBitArray :c

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-19 18:41:31 -03:00
6e1639551b feat(WideBar): allow hiding buttons with right-click
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-19 18:41:30 -03:00
2367903ac6 refactor: clean up WideBar a bit
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-19 18:41:30 -03:00
30607c34a1 Merge pull request #291 from TheKodeToad/betterjavalauncher 2022-11-19 18:45:15 +01:00
817947c928 Merge pull request #483 from jopejoe1/patch-1 2022-11-19 18:44:09 +01:00
29926a59bb Merge pull request #482 from DioEgizio/fix-cache-flatpak 2022-11-19 18:10:03 +01:00
d92ae530d7 fix: stray include
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-20 00:34:44 +08:00
e0e428ce38 fix: add support for CLI and drag and drop
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-20 00:28:35 +08:00
d1db7a0e23 Fix New Zealand English display
Signed-off-by: jopejoe1 <34899572+jopejoe1@users.noreply.github.com>
2022-11-19 16:28:27 +00:00
c27ebde575 fix(actions): fix cache on flatpak
currently there's a [bug](https://github.com/flatpak/flatpak-github-actions/issues/80) on the stable version of the flatpak action which causes the cache key to be wrong. this commit work arounds it

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-19 17:14:19 +01:00
a99cd16422 fix: resource pack import dialog icons and add message
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-20 00:14:16 +08:00
1f6b8f9d2b fix instance IDs and resource pack imports
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-19 23:59:30 +08:00
a33b804923 fix: add resource pack format for 1.19.3
Co-authored-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-19 23:47:47 +08:00
f527958cb3 fix: check if packFormat is valid for resourcepack parsing
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-19 23:42:56 +08:00
b1bdc6f745 fix resource packs and add support for texture packs
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-19 23:38:05 +08:00
8dacbafc8b feat: initial support for smart resource pack parsing on file handler
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-19 23:14:57 +08:00
70fa92f22c Remove dirty printStackTrace hacks
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-19 13:59:22 +00:00
3482076a20 Merge pull request #476 from Scrumplex/matrix 2022-11-19 05:07:33 -08:00
f7239f7f8a chore: update community links
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-19 13:34:02 +01:00
20ba787c00 Merge pull request #474 from Scrumplex/translations-maybe2 2022-11-19 03:41:54 -08:00
669eef92eb Make requested changes and utilise AssertionError
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-19 08:54:17 +00:00
c6d9edb78f chore: improve display names of more languages
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-18 22:21:55 +01:00
347ae0a9ad Merge pull request #456 from DioEgizio/flatpak-build
closes https://github.com/PrismLauncher/PrismLauncher/issues/62
2022-11-18 21:37:14 +01:00
dbd01d35e6 Merge pull request #455 from leo78913/menubar-stuff 2022-11-18 17:20:50 +01:00
b24c09665f Merge pull request #439 from Ryex/better-blocked-mods 2022-11-17 11:29:28 -08:00
fa96ebd382 Merge pull request #471 from IDeletedSystem64/develop 2022-11-17 20:28:42 +01:00
52d43f843b feat(BlockModsDialog): remove redundant Ui info
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-17 11:46:14 -07:00
90376749f0 Fix AUR qt5-git and git having the wrong AUR links
Signed-off-by: Sophie Marie <twilightsparkle@duck.com>
2022-11-17 12:42:34 -06:00
5cf2a8b5fc Merge pull request #454 from RedsonBr140/menu-themes 2022-11-17 09:47:55 -08:00
f72ac94c11 fix: Fix usage below
Signed-off-by: Redson <redson@riseup.net>
2022-11-17 06:39:05 -03:00
bd3a693e70 chore: Change var name
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: RedsonBr140 <redson@riseup.net>
2022-11-17 06:20:53 -03:00
298871e207 Merge pull request #467 from Scrumplex/fix-meta-extensions-json
Fix serialization of components with custom metadata
2022-11-16 23:54:26 +01:00
ce958f4ffd refactor: use isEmpty instead of size for lists
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-16 23:20:47 +01:00
2de150bfc8 Merge pull request #431 from FayneAldan/version 2022-11-16 18:20:32 +01:00
40970a1a87 fix: serialize metadata extensions
Prism has introduced a few extensions to the meta component version
format, which were not exported as JSON in the launcher. This caused the
`Customize` button on the version page to not write these new properties
to the custom component file.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-16 18:11:18 +01:00
8aae652be1 fix: remove unnecessary condition
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-16 18:10:54 +01:00
37a117d2ef chore: Var definition inside the for loop
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: RedsonBr140 <redson@riseup.net>
2022-11-16 12:24:28 -03:00
debc1659e1 Merge pull request #464 from DioEgizio/qt-6.4.1 2022-11-16 15:23:52 +05:30
23e411c42b Merge pull request #459 from Scrumplex/bump-tomlplusplus 2022-11-16 01:34:15 -08:00
88feebe499 chore: use qt 6.4.1 on Windows-MSVC
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-16 09:55:46 +01:00
e8b871ac72 Merge branch 'PrismLauncher:develop' into version 2022-11-15 18:34:24 -07:00
9f30c6d94b Add commit hash to --version
Signed-off-by: Fayne Aldan <FayneAldan@gmail.com>
2022-11-15 18:33:51 -07:00
c4c1e75de8 fix: use QPixmapCache only from the main thread
It's a required condition.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-15 18:14:03 -03:00
c1763cc4b0 fix: disable FLOAT16 in toml++
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-15 21:23:20 +01:00
ee096edfff chore: bump tomlplusplus
Should fix issues with builds on aarch64

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-15 20:58:07 +01:00
464b9ebc95 feat: add flatpak builds to the ci for testing
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-15 17:45:12 +01:00
7705f290ca fix: don't retry to load RP images that can't fit in the cache
Avoids an infinite loop when the image is too big.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-15 12:07:11 -03:00
7439fd6bcb fix: Fix some stuff in the menu bar
- Remove duplicated launch actions
 - Enable the add instance action icon in menus
 - Remove ugly separator at the end of the help menu if the updater is disabled
 - Add icons to the help and news menu items

Signed-off-by: leo78913 <leo3758@riseup.net>
2022-11-15 10:56:41 -03:00
6fe626ab9a feat: Make the changes persistent.
Signed-off-by: Redson <redson@riseup.net>
2022-11-15 06:09:13 -03:00
a12f892841 fix: Check the box when the theme is changed via settings
Signed-off-by: Redson <redson@riseup.net>
2022-11-15 05:46:24 -03:00
aa3ea79f94 fix: Check the current theme box on startup.
Signed-off-by: Redson <redson@riseup.net>
2022-11-15 05:38:31 -03:00
ef53455b66 fix: Build on QT6
Signed-off-by: Redson <redson@riseup.net>
2022-11-15 05:19:46 -03:00
ba46ff6692 Merge remote-tracking branch 'upstream/develop' into feature/instance-shortcuts 2022-11-15 10:05:04 +02:00
0e916244f0 feat: Add themes and their logic.
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-11-14 21:10:48 -03:00
1e4ee02cbc Merge branch 'PrismLauncher:develop' into menu-themes 2022-11-14 21:09:37 -03:00
cedc7754d9 Merge pull request #428 from DioEgizio/fixes-to-CI 2022-11-14 14:16:01 -08:00
fece9e207b Merge pull request #448 from TheLastRar/fixup-warnings 2022-11-14 14:15:46 -08:00
cca052ccc9 Restore QRC headers
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-14 22:46:41 +02:00
5be9472912 fix: fix potentially uninitialized variable
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-14 21:20:38 +01:00
f60b09568c Merge pull request #112 from ryanccn/macos-add-to-path 2022-11-14 21:12:36 +01:00
be765f8d88 feat: Add empty menu
Signed-off-by: Redson <redson@riseup.net>
2022-11-14 16:33:25 -03:00
8d6aecd944 add the missing icons to the legacy icon theme
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-11-14 16:16:52 -03:00
aef5349aee Pass index.parent() as parent parameter for rowCount
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:57 +00:00
ac993aa31f Use Q_UNUSED instead of [[maybe_unused]] in onParseFailed
Qt5 on Ubuntu cannot handle [[maybe_unused]] in this function

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:57 +00:00
fce323b945 Check parent in rowCount/columnCount/canFetchMore
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:57 +00:00
5558f3d2cc Mark paramaters of dropMimeData as unused
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:57 +00:00
08f8623cb7 Mark paramaters of onParseFailed as unused
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
f8a137a26e Mark loadExtraPackInfo abstract
All classes that inherit from ModModel override this method

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
3cba359d38 Mark paramater runtimeContext as unused
Base class uses variable, but ImplicitRule does not

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
b8d7aedb2c Mark paramater line as unused in guessLevel()
The base method doesn't use this variable, but classes overriding this method do

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
55c7b291e1 Remove unused qhash function
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
472d931b4b Prefix member variables in HttpMetaCache
MSVC warns about shadowing variables

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-14 19:05:56 +00:00
ce892c9e77 Add icon
NOTE: Currently missing on Legacy, Flat and Flat (White)
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-14 21:02:31 +02:00
e14b998da3 refactor: improve readability
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-14 18:38:12 +01:00
2c9452efaf Merge branch 'develop' into macos-add-to-path 2022-11-14 19:26:31 +08:00
97a7af855f slight reword: "install to PATH"
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-14 19:21:47 +08:00
5be8545edc Windows, Linux: prevent segfault on missing icon
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 20:18:51 +02:00
0a04c3a2a7 fix: Fix the error that CodeQL caught
Signed-off-by: txtsd <code@ihavea.quest>
2022-11-13 18:54:55 +01:00
dcfc15a0a1 feat+fix: move codeql to its own workflow
i think it's better practice, it should slightly improve linux qt6 build times and i noticed ccache? is messing up with it because alerts get randomly fixed

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-13 18:54:55 +01:00
841c2e9166 fix: disable caching Qt on release
it's good practice to not cache on release builds

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-13 18:54:55 +01:00
07392d493c fix: disable building snaps on release
the snap infra should already be able to deal with it, i think

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-13 18:54:55 +01:00
acd50969e0 Linux: remove TryExec entry from .desktop files
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 19:50:27 +02:00
074b53eb6b Merge pull request #445 from flowln/optimize_edit_instance 2022-11-13 17:18:06 +01:00
c4cfec1e94 Undo accidental tomlplusplus downgrade
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 18:00:18 +02:00
b0269e6dfc Linux: fixes
- Fix shortcut icons
- Possibly fix shortcut creation on AppImages
- Fix shortcut not working if path to launcher contains spaces

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 17:51:29 +02:00
43b9d9484d tabs -> spaces
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 15:49:28 +02:00
69bbb29328 Mac: attempt 2
- create .command files instead of .sh
- fix shortcuts not working if path to Prism Launcher contains spaces
- fix path to executable in shortcutss
- add check for running from extracted folder (prevents creating shortcuts)

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-13 15:47:37 +02:00
577069cfb4 fix: don't have the clear button on instance page filters
This thing is otherworldly unoptimized. o.O

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-12 19:23:57 -03:00
fe94c3609e fix: implement code review suggestions
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
173aed7fd8 chore: add REUSE headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
335bec68fb fix: prevent abort for un-abortable tasks
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
bbb7e9f5c7 feat: show current copy operation in migration dialog
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
086304f7f2 feat: add initial Migration dialog
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
bd7065eece feat: add SimplePrefixMatcher
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:30 +01:00
15aaff7c1c feat: add dryRun to copy operation
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:28:29 +01:00
e048bce13e refactor: allow copy operation with whitelist
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:27:13 +01:00
ddfb449b28 fix: remove PolyMC data paths
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-12 20:27:13 +01:00
5322155b19 Mac: fix build
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:48:21 +02:00
45ce72593a Windows: remove icon if shortcut creation fails
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:43:58 +02:00
b813c867b5 refactor #if checks
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:41:52 +02:00
f7d7d76ee8 Mac: now supported! [UNTESTED]
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:36:49 +02:00
7e5076b068 Linux: fix path shortcut is written to
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:32 +02:00
dbe0553b4a Move addAction call above left-align loop
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:31 +02:00
9be48f1dc4 this ain't static, falco
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:31 +02:00
6043444e4e Apply suggestions from code review
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:30 +02:00
487e352642 Fix nested #if directive
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:29 +02:00
cc5f82bfac Windows: fix window icon being replaced
Dunno why it happens but the fix was literally 2 lines, so whatever I guess

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:28 +02:00
4d4dfab388 Windows: add instance icon to shortcut
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:28 +02:00
b83f9be1bd Add missing fail check for CoInitialize
Add a few comments

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:27 +02:00
6ae3b183fd Remove unnessecary "is defined" check
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:27 +02:00
f12117c532 [UNTESTED] Linux: add icons to shortcuts
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:26 +02:00
70768189ba Windows: implement FS::createShortcut
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:19:25 +02:00
30b266622c Add 'Create shortcut' button to instance toolbar
Implemented on Windows only rn!

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
2022-11-12 20:18:49 +02:00
25b306b7e1 feat: mark folder paths as links
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 18:32:11 -07:00
9af1b00df5 feat: add list of watched folders
move explanation text into dialog class and it's own label

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 18:05:19 -07:00
51c27e2748 always use the pending path set to avoid task duplication.
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 16:33:52 -07:00
b9e2c3524c chore: clang format & cleanup
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 16:07:57 -07:00
3f6cc17818 properly handle a currently running hashing task
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 15:45:40 -07:00
5909af9878 drag&drop + add folder to watch
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 14:17:33 -07:00
64576f4c4c Merge pull request #304 from Ryex/move-downloads
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/222
2022-11-11 12:48:53 -08:00
21dbd28a2f Merge pull request #266 from Ryex/windows-file-association 2022-11-11 15:46:03 +01:00
b57fee1a44 fix: swap spin box and state icon
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-11 15:24:14 +01:00
cabd887866 feat: use icons to show memory allocation state
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-11 15:22:16 +01:00
863a168cb5 feat: raise memory limits to 1TiB
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-11 15:05:00 +01:00
5ee4fb3522 feat: validate maximum memory allocation
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-11 15:04:05 +01:00
bb8ac9b99a changed name of file type association
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 05:46:41 -07:00
2f10fa8b61 add some extra debug logs for CF blocked mods
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-11 05:41:32 -07:00
46a8e18841 Merge pull request #367 from TheKodeToad/linkjumping
fix https://github.com/PrismLauncher/PrismLauncher/issues/363
2022-11-10 08:08:44 -08:00
6c53e68a52 Merge pull request #406 from Scrumplex/fix-clear-metadata 2022-11-10 07:50:14 -08:00
392452d422 Merge pull request #397 from flowln/windows_mod_updater_fixes_maybe
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/226
2022-11-10 14:34:15 +01:00
99ed0b6c2c Implement flowln's suggestions
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-10 11:14:58 +00:00
e6d057fe6d Merge pull request #415 from TayouVR/fix-main-warning 2022-11-09 18:27:40 +01:00
9ad6eb11a3 refactor: fix CodeQL warnings in StringUtils::naturalCompare
I have no idea why this function exists, so better to just let it exist.
=D

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-09 14:14:25 -03:00
32c2ad2bbd A lot more cleanup
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 17:51:18 +00:00
f2ca9a6b31 Revert switch to JUL for better colours
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 17:38:23 +00:00
50d40257fe Always use this for consistency
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 17:38:23 +00:00
d90eff64d0 Add StringUtils to CMakeLists.txt
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
e6dc34fe10 More license fixing
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
745c331311 Remove last case of printStackTrace
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
1ea2e85415 Implicit is generally prefered
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
4a2df30f92 Try to use more standard exit codes
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
922220c11e More consistent logging text
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
56d5035c63 Fix the warnings properly
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:27 +00:00
4abf3a20c6 More standard code formatting profile
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:25 +00:00
5912ef3b45 Just ignore empty lines
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:00 +00:00
9931c9a286 Remove arguments being passed twice
Passing the classpath into stdin has no effect. Java is already provided the classpath with -cp, which pretty much takes up the largest part of the arguments anyway, which leads me to wonder, what's the point of stdin arguments at all?

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:00 +00:00
1da834f650 *opinionated change* Remove LauncherFactory
Factories in OOP are a classic example of over-enginneering. When you only have two launchers I personally think that it's not very useful.

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:37:00 +00:00
fb677a7489 So turns out we can have nice things
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:36:55 +00:00
404796d4b2 Sorry for reverting a lot but copying a list just hurts me
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:36:35 +00:00
5b9bfe8891 Attempt to mimic clang-format
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:36:33 +00:00
779bc2c63d Fix WrongMethodTypeException. Invoke exact don't work like that
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:35:46 +00:00
cae1ba7cd8 Less needless verbosity, and return fallback
Needlessly verbose commit message ik.

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:35:46 +00:00
8ce78dcc54 Try to improve consistency
- Makes code formatting more consistent with the C++ codebase. Probably removes some trailing whitespace. Maybe it would be best to commit an Eclipse or IntelliJ code format preferences file?
- Removes obscure suppressions. I personally think it's better to only suppress warnings that javac complains about. Suppressing a lot of non-standardised warnings (many of them turned off by default even in IntelliJ) just creates needless clutter.
- Fixes some trivial warnings instead of suppressing them. serialVersionUID is sort of stupid, but I'd rather mentally ignore it or just fix it if it's really that annoying.

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:35:43 +00:00
afe088dba1 Fix license headers
- Update license headers in several files to remove multimc apache reference, when unneeded
  - LauncherFactory: we've entirely rewritten this class at this point, so it's fully under GPL code
  - Launcher: this interface contains zero logic, and only a single method named `launch`, so I doubt you can actually copyright that
  - LauncherProvider: same as above
  - ParseException, ParameterNotFoundException: same as above; this class contains almost no logic (And the logic that was added is under GPL)
  - ReflectionUtils, StringUtils: add license header
  - Everything else: modify the program name in the license header from "PolyMC - Minecraft Launcher" to "Prism Launcher"

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
e899e31745 More informative exceptions in entrypoint
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
dabb84f62a Cleanup launcher classes
Cleanup a bunch of the code in launcher classes
- Migrate the majority of the reflection to ReflectionUtils
- Decrease logic in AbstractLauncher
- Add logging to launcher classes at FINE level
- make mcParams in AbstractLauncher an immutable list to prevent runtime manipulation
  - StandardLauncher instead copies the list to modify it

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
9b8096c699 Get rid of gross HashMap being used by LauncherFactory and instead use *fancy* enum
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
ac5b74301e Cleanup splitting string into a pair
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
609b30110b Make main static
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>

Inline local variable

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
35d200356f Create launcher.impl.legacy
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
0cd1d7aa7e Excessive safety
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
ade7526f5f Remove the need for LegacyUtils
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
a7b1700d42 Better variable naming
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
c0b8c53e69 Attempt to sort out copyright headers
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
e86fbc697f Fix formatting
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:25:09 +00:00
e5622ce824 Code cleanup to net.minecraft.Launcher
No code logic has been changed, only:
- add @Override annotatons
- change setVisible(boolean b) -> setVisible(boolean visible)
- Change block commend on class -> javadoc comment

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
99d9868116 Cleanup EntryPoint code
- Don't return an int from listen(). An enum is preferred.
- Make parseLine() static, and pass Parameters to it.

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
107fa6b4f7 Code refactors
- Refactor LauncherFactory.LauncherProvider to LauncherFactory
- Refactor all launcher related components to launcher package
- some basic code cleanup
- Rename all, allSafe -> getList and first, firstSafe -> getString
- Rename Utils -> LegacyUtils

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
9062d28704 Get rid of singleton, and refactor LauncherFactory to be a static class
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2022-11-08 16:25:09 +00:00
e68dcea6bc Various tweaks to the Java component of the launcher
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-08 16:24:55 +00:00
787c5a515f Merge pull request #407 from AshtakaOOf/readme 2022-11-08 17:25:19 +05:30
ce2df4b36f chore(readme): Specify openSUSE Tumbleweed
Signed-off-by: txtsd <code@ihavea.quest>
2022-11-08 17:24:00 +05:30
fcb9733df0 Merge pull request #392 from PrismLauncher/max_ram_logic 2022-11-08 12:23:24 +05:30
245928a064 Update README.md
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-07 20:33:09 +01:00
589d160515 fix: use cross-platform toStdString in FlameHasher
Almost the same issue from toml++ :p

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-07 14:04:48 -03:00
380e76a2e3 Add Tumbleweed
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-07 17:14:16 +01:00
9ac6114b63 Fix warning in main function
main could according to the compiler end up not returning. of course it will always return, but I satisfied the compiler by adding a default case.

Signed-off-by: Tayou <tayou@gmx.net>
2022-11-07 14:33:37 +01:00
d558ff305a Merge pull request #411 from TheLastRar/configurationless-install
Fix: Configuration-less config for Qt Install
2022-11-07 13:30:39 +01:00
89aaac3a70 Update README.md
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-06 21:56:02 +01:00
456999eee6 Fix: Configuration-less config for Qt Install
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-06 14:25:38 +00:00
16e3b786fc Implement Scrumplex's suggestions
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-06 10:09:06 +00:00
126bbd67f7 Merge pull request #405 from AshtakaOOf/spooky 2022-11-06 07:27:39 +01:00
38e1d44dbb Update README.md
Add copr

Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-06 03:42:51 +01:00
9fb80a2687 Merge pull request #242 from marcelohdez/more-copy-options 2022-11-06 01:10:24 +01:00
d5d224d89a fix: save metacache after clearing
If the user closes the launcher right after clearing, it probably
didn't actually clear the cache yet.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-06 01:05:13 +01:00
4708ce4226 refactor: rename halloween cats to -spooky
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-06 00:47:33 +01:00
a0580946dc fix: allow -ween variants for all cats
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-06 00:04:43 +01:00
e68fd7c1e3 Merge pull request #383 from leo78913/toolbar-lock 2022-11-06 00:00:47 +01:00
369419870e add: Spooky Rory
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-05 23:55:43 +01:00
0938f80b41 Update launcher/ui/MainWindow.cpp
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-11-05 18:10:36 -03:00
9f462dcc27 fix: update tomlplusplus submodule
This fixes an issue with Windows TOML file parsing with non-latin
characters.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-05 16:28:54 -03:00
96008d3bb2 add -I import flag & don't clobber .zip assoc
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-05 08:07:58 -07:00
c05f744ec2 windows file association is *hard*
new macros!

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-05 08:07:58 -07:00
3df31579a1 fix: @timoreo22
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 22:31:38 +08:00
f1d3481a29 fix: remove dumb FS::symlink function
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 22:25:22 +08:00
cf3aad9c41 fix: use osascript to get admin privileges
inspired from VSCode's approach

Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 22:18:05 +08:00
7b1e68bfa8 initial support for add to PATH action
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 22:17:59 +08:00
82256a2fe8 Merge pull request #400 from DioEgizio/bump-6.0 2022-11-05 14:35:21 +01:00
016b3448e8 chore: bump to 6.0
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-11-05 13:34:02 +01:00
2dde26e485 Merge pull request #399 from ryanccn/readme-adaptive-logo-fix 2022-11-05 13:07:53 +01:00
2999afe781 fix: width="50%"
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 19:20:08 +08:00
bfc5a6488b fix(docs): use new format for adaptive images in README
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-05 19:16:56 +08:00
4af22d663a Merge pull request #229 from ryanccn/macos-drag-n-drop 2022-11-05 11:17:21 +01:00
ba8322aa5c Merge pull request #396 from leozamboni/develop 2022-11-05 11:17:13 +01:00
e4bd82190a Merge pull request #149 from TayouVR/better-custom-themes 2022-11-05 11:16:41 +01:00
695734636f Merge pull request #294 from piperswe/add-snapcraft-yml 2022-11-05 11:09:51 +01:00
bdac2a5f4d fix: add missing newline
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-05 11:09:35 +01:00
f8ea6212c7 fix: fix icon install path
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-05 10:42:44 +01:00
5e9b26dbef Merge pull request #366 from TheLastRar/MSVC-Build 2022-11-04 23:49:54 +01:00
67c99369ab fix: use KDEInstallDirs for manpage
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-04 23:43:18 +01:00
d35c2db41e fix: separate types of std::string in Packwiz
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:25 -03:00
dff5fea976 feat: add more separation between types of std::string in StringUtils
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:25 -03:00
ab6c7244fc refactor: move FS's toStdString to StringUtils
This is so that anyone can use it :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:25 -03:00
353b51f11e refactor: move MMCStrings -> StringUtils
General utilities can go in here >:)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:24 -03:00
76050880f1 fix: use unicode variant for marking '.index' hidden
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-04 16:53:21 -03:00
396a7994f9 Workflow: Add MSVC Builds to release workflow
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
e29259cd55 Fix: Resolve ambiguous overload errors
Clang-cl fails to select the correct function and instead errors

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
79a728d7d2 Fix: Conflicting types for hoedown functions
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
98444bd865 CI: Add VC variables before packaging on Windows
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
3f75e1cb1d CI: Build MSVC Legacy as 32bit
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
4f327120ac CI: Link to release libraries even in debug
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:39 +00:00
cc8456ec6b CI: Use msbuild generator for msvc builds
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:38 +00:00
f8ad1a052f CMake: Support multi-configuration generators
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:38 +00:00
372ce588cd CI: Add MSVC Builds
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:38 +00:00
12632ec404 CMake: Build flags for MSVC
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:37 +00:00
e777c26a14 CMake: Add fallback to bundled ECM
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:37 +00:00
1d38248194 Libraries: Add ECM
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:36 +00:00
d52868c6c5 CI: Exclude zlib tests
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:36 +00:00
29c1639b1d CMake: Force bundled zlib to take our IPO settings
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:36 +00:00
653a953d2f CMake: Add zlib
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-04 18:11:35 +00:00
9f5537d936 feat: spooky cat for halloween
Signed-off-by: leozamboni <leonardonunes169@gmail.com>
2022-11-04 15:09:57 -03:00
21a7af535c Merge branch 'develop' into macos-drag-n-drop 2022-11-04 18:30:42 +01:00
a241d3f187 refactor(cmake): use KDEInstallDirs for Linux install paths
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-04 18:29:19 +01:00
8f045af867 Merge pull request #374 from flowln/fix_lto 2022-11-04 15:39:41 +05:30
6d4efc0443 Libraries: Add zlib
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-03 21:35:28 +00:00
e2e6d00064 CMake: Remove CMP0020 OLD
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-03 21:35:28 +00:00
e682c3e9b8 Fix: Correct exclusions for debug QT plugins
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-03 21:35:28 +00:00
fe347262e9 Fix: Using uint8_t in std::uniform_int_distribution is undefined
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-03 21:35:27 +00:00
c993209b76 Fix: Explicitly specify Version.h path
MSVC uses a different search mechanism that ends up picking the mete Version.h

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-03 21:35:27 +00:00
2cf4d5f8ec Merge pull request #389 from PrismLauncher/renovate/hendrikmuhs-ccache-action-1.x 2022-11-03 21:58:29 +01:00
c6ab9718ae chore(deps): update hendrikmuhs/ccache-action action to v1.2.5 2022-11-03 19:50:27 +00:00
3e3ef03855 Merge pull request #379 from TheLastRar/win-stacksize 2022-11-03 10:52:36 +05:30
c2f37716e5 clang_format for PR files
I'm getting a rendezvous... I thought I did this already

Signed-off-by: Tayou <tayou@gmx.net>
2022-11-03 05:05:07 +01:00
e9bfd43ff7 added requested changes
Signed-off-by: Tayou <tayou@gmx.net>
2022-11-03 05:04:36 +01:00
2958ffa73f Merge pull request #382 from PrismLauncher/renovate/hendrikmuhs-ccache-action-1.x 2022-11-02 16:50:47 -07:00
3d11d044d2 add an option to lock the toolbars
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-11-02 20:33:02 -03:00
7eb0b1c69a chore(deps): update hendrikmuhs/ccache-action action to v1.2.4 2022-11-02 23:02:32 +00:00
8d39a9ea61 Fix: Increase stack size on Windows to 8MiB
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-11-02 20:13:44 +00:00
cb796dbdfb Remove unnecessary block
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-02 16:38:32 +00:00
4254c20eda experimental: install mime info in CMake
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-11-02 23:28:42 +08:00
094b57bb23 Merge pull request #372 from santiagocezar/rory 2022-11-02 12:06:08 +01:00
9ca4f19aea remove logcat
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-02 07:45:43 -03:00
a29d88c313 Even more fixes
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-02 09:59:58 +00:00
a1ed8154f7 Another fix
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-02 09:31:39 +00:00
6c45a990ef A good use of auto
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-02 09:13:44 +00:00
8dfa3393dc Formatting and forward-declaration
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-02 08:43:46 +00:00
d12323396f Merge pull request #346 from ryanccn/more-user-friendly-java-warning-text-ahaha 2022-11-02 10:38:26 +05:30
48d34741f3 keyboard navigation is important
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-01 22:53:45 -03:00
76203018e9 forgot the qrc
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
2022-11-01 20:21:34 -03:00
7956e6f04e fix: don't use forward-declared Ptr types in meta/
This would cause ODR violations when those headers were included in
other places that also included stuff like "Version.h" (note the
"meta/Version.h"), which can cause problems, especially in LTO.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-11-01 19:48:26 -03:00
668342b470 add rory flat too (and holiday variants)
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
Co-authored-by: Ashtaka <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-01 19:31:37 -03:00
0a0ce74105 add rory
Signed-off-by: Santiago Cézar <santiagocezar2013@gmail.com>
Co-authored-by: Ashtaka <66513643+AshtakaOOf@users.noreply.github.com>
2022-11-01 19:06:27 -03:00
f6a3fa55b1 Merge pull request #368 from PrismLauncher/credits 2022-11-01 21:56:26 +01:00
718a9a3559 change: Update credits
Replaces txtsd's GitHub link with their website
Moves DioEgizio and flowln from contributors to dev team

Signed-off-by: txtsd <code@ihavea.quest>
2022-11-02 01:20:58 +05:30
5485c5aaed Merge pull request #365 from Scrumplex/fix-logo 2022-11-01 20:34:23 +01:00
afcdf4b9cf condensed icon theme code
Signed-off-by: Tayou <tayou@gmx.net>
2022-11-01 20:18:07 +01:00
a3f5ea3598 added suggested changes
Signed-off-by: Tayou <tayou@gmx.net>
2022-11-01 20:17:53 +01:00
fef60a9da0 add support for multiple custom themes
also moved theme related code from Application.cpp to new ui/themes/ThemeManager.cpp, this class should cleanly isolate theme related functions and help avoid code duplication in future theme related additions.
Themes can now be just qss or css files, they won't have color pallette information with them in that case

Signed-off-by: Tayou <tayou@gmx.net>
2022-11-01 20:10:12 +01:00
576867605d Add another fallback
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 18:40:12 +00:00
d1626d20bd Slight cleanup
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 18:30:11 +00:00
c890aa18f7 Only select correct mod
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 18:25:54 +00:00
6c7d040439 Hacky tweaks
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 18:12:27 +00:00
d03ae34b61 Auto-select first result
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 17:19:54 +00:00
b9547adce7 Add more license headers
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 17:02:24 +00:00
7f32c6464d Initial better mod browser link implementation
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
2022-11-01 16:58:22 +00:00
209a1650e4 clang_format and code cleanup
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 07:06:36 -07:00
b142e2a7a7 fix: fix logo name
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-11-01 13:59:11 +01:00
6010ce0dc5 chore(remove FS::copyFile):
Now that #333 is merged and FS::copy works on non directory copyFile can be removed.

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:28:57 -07:00
a7a331a26e ensure FS::copyFile is marked for removal
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
fda2c116be code quality cleanup
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
d2f3dbaa29 fix mispellings and wrap strings for translation
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
e9d4793b1e minor clean up and add some docs
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
13c7efa058 copy found mods to instance (FTB and Flame)
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
1598d65824 watch filesystem, compute and match hashes
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
028e086960 send blocked mod info to dialog & prototype UI
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2022-11-01 04:24:11 -07:00
04b39294ba Merge pull request #333 from flowln/fix_atl_packs_post_modpack_update 2022-11-01 09:56:16 +01:00
3a446c410c Merge pull request #329 from flowln/only_safe_workarounds 2022-11-01 09:55:43 +01:00
35edea2141 Merge pull request #359 from Chrono-byte/develop 2022-11-01 08:17:14 +01:00
ce1a4857cc Merge branch 'PrismLauncher:develop' into develop 2022-10-31 20:06:59 -04:00
dfdf739282 remove one space
Signed-off-by: Chrono <me@disilla.org>
2022-10-31 19:44:55 -04:00
7086b1e65c Merge pull request #351 from Scrumplex/fix-trash 2022-10-31 22:56:07 +01:00
f2d445d27b fix: fix undo key sequence
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-31 11:34:48 +01:00
29d362a6e0 fix: do not trash instances in Flatpak
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-31 11:34:46 +01:00
c8adc4e356 Merge pull request #354 from Scrumplex/translations-maybe
Improve display names of certain languages
2022-10-31 08:43:43 +01:00
8467daa0ec oop
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-31 14:58:38 +08:00
13e14b712e Merge pull request #352 from TheLastRar/Win-setDarkWinTitlebar-10OrGreater 2022-10-31 07:51:13 +01:00
27dfe30fe6 Update VerifyJavaInstall.cpp
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-31 14:44:11 +08:00
d89a541a8d Merge pull request #353 from FayneAldan/accounts-consistency 2022-10-30 16:52:36 -07:00
42350e689d chore: improve display names of certain languages
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-30 23:50:57 +01:00
b7d5fee995 Change Profiles to Accounts for consistency
Signed-off-by: Fayne Aldan <FayneAldan@gmail.com>
2022-10-30 15:56:45 -06:00
fd099166c6 Fix: Check if Windows 10 before calling setDarkWinTitlebar()
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-10-30 20:49:56 +00:00
b4be28b9bb fix: fix disabled trash undo action
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-30 18:37:06 +01:00
19a8d51bf3 fix: more user friendly Java warning text
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-30 11:56:43 +08:00
5d1aac3c53 added option to not copy screenshots
+ moved select all checkbox to top row, centered.

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-29 22:27:31 -04:00
87b0d3fe11 Merge pull request #342 from fn2006/prism-svg-fix 2022-10-30 01:51:14 +05:30
98891a036d use existing variables
Signed-off-by: fn2006 <usernamefn2006alreadyused@protonmail.com>
2022-10-29 17:35:37 +01:00
b142a6da5b fix hardcoded svg
Signed-off-by: fn2006 <usernamefn2006alreadyused@protonmail.com>
2022-10-29 16:42:37 +01:00
1c0139c5f4 Merge pull request #340 from PrismLauncher/repology 2022-10-29 16:16:12 +02:00
1b7ae4321d Merge pull request #338 from Scrumplex/fix-credits-1 2022-10-29 16:15:34 +02:00
7f991ed897 feat: Add Repology badge to README
Signed-off-by: txtsd <code@ihavea.quest>
2022-10-29 19:37:00 +05:30
5ed7eb9d53 chore: update credits
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-29 13:12:51 +02:00
c00f96c7ca create getters and setters for InstanceCopyPrefs
+ use pragma once like other .h files in this directory

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-29 00:55:33 -04:00
81333515e0 feat(tests): add test for FS::copy with files
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-28 20:55:25 -03:00
be3c9abcfe fix: copy single files too in FS::copy
eek

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-28 20:54:58 -03:00
177f17450a Merge pull request #173 from Scrumplex/fix-icons 2022-10-29 00:35:48 +02:00
150a3adaaf Merge pull request #267 from leo78913/toolbar-icons 2022-10-28 21:28:44 +02:00
76146e0f17 add a flat white version of the launch icon
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-10-28 15:51:20 -03:00
4500e345b3 Merge branch 'PrismLauncher:develop' into toolbar-icons 2022-10-28 15:46:02 -03:00
e885f3c26a Merge pull request #65 from he3als/develop 2022-10-28 18:43:30 +02:00
e6e92f2b0e fix: only allow workarounds for blocked mods from MR when 100% safe
If a version on Modrinth has more than a single mod loader associated,
it means that it's possible we might get the wrong file for download,
since individual files don't really have this kind of metadata in the
API response.

So, in such cases, it's best to let the user take care of it instead.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-28 13:31:21 -03:00
03b48554b1 fix(style): convert tabs to spaces
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-29 00:01:22 +08:00
f229574758 Merge pull request #322 from DioEgizio/64bit-it 2022-10-28 18:43:32 +05:30
7b446dd30f Merge pull request #319 from Scrumplex/fix-avoid-mr-segfault 2022-10-28 13:40:52 +02:00
a5be974f1a feat: use clang64 on qt6 builds
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-28 08:05:31 +02:00
952615eadb Merge pull request #301 from DioEgizio/clang-attempt
feat(actions): use clang32 for building on windows
2022-10-28 07:54:17 +02:00
93894f62ff fix: avoid segfault for unexpected API reponse
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-28 00:08:15 +02:00
2051de51b5 Merge pull request #318 from TheLastRar/manifest-platform
Fix: Don't specify x86 in manifest
2022-10-27 22:53:15 +02:00
2ba3de79d8 chore: add comment about copy bug
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-27 21:23:17 +02:00
d35c985d2e feat(actions): use clang32 for building on windows
*way* faster

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-27 21:23:17 +02:00
b18466da84 Fix: Don't specify x86 in manifest
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2022-10-27 18:37:08 +01:00
90714a93f3 Merge pull request #315 from AshtakaOOf/develop
Remove appveyor from README
2022-10-27 13:15:53 -03:00
990cfb7b33 Remove appveyor
I forgor 💀 
But seriously I forgor to remove the &logo=appveyor thing AAAAAH!!!

Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-10-27 18:08:56 +02:00
aacf7938ae Add CI build for Snap
Signed-off-by: Piper McCorkle <contact@piperswe.me>
2022-10-26 09:25:58 -05:00
2e0f818905 Add a snapcraft.yml for building Snaps
The included snapcraft.yml can be used to build a Snap (the application
format used by Canonical's modern package manager) out of Prism. If the
project wants in the future, Prism can publish these Snaps to the Snap
Store so the Prism Launcher can be installed through the Ubuntu Software
app on vanilla Ubuntu.

I haven't registered the Snap name, so it's currently free for anyone to
reserve. I'd suggest that a Prism developer register the name
prismlauncher at https://snapcraft.io/register-snap to ensure the name
belongs to the project, even if there are no plans of setting up CI to
publish snaps in the short term.

I have also modified JavaUtils.cpp to be able to autodetect the Java
versions included in the Snap, and added "*.snap" to the .gitignore so
the compiled Snap isn't accidentally committed to the repository.

Signed-off-by: Piper McCorkle <contact@piperswe.me>
2022-10-26 09:25:54 -05:00
63b6c6685c Abstract away InstanceCopyPrefs' internals through new getSelectedFiltersAsRegex() function
+ fix typo in comment
+ remove unused import
+ add [[nodiscard]] to methods

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-26 00:20:36 -04:00
610b971117 Improve a bit README.md (#305)
Add Open Collective and fix some stuff.
2022-10-25 21:09:45 -03:00
318f657c31 Merge pull request #231 from tobimori/patch-1 2022-10-25 20:15:31 +02:00
482d3a1d76 update macos copyright year
Signed-off-by: tobimori <tobias@moeritz.cc>
2022-10-25 15:24:41 +02:00
b516dd970f Merge pull request #206 from flowln/changelog_height_fix 2022-10-25 11:29:14 +02:00
d9463620e6 move .app rename to packaging process, update mac copyright string
Signed-off-by: tobimori <tobias@moeritz.cc>
2022-10-25 09:34:07 +02:00
385c452ddf remove checkBool function, add updateSelectAllCheckbox function
Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-24 20:49:40 -04:00
a89df42561 Simplify bool check in CopyInstanceDialog.cpp
Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-24 19:31:40 -04:00
08cd5d52fa Merge pull request #283 from flowln/fix_abort_on_autosearch 2022-10-24 23:00:02 +02:00
d0e668e1d8 Merge pull request #211 from Hibiii/show-instace-arg 2022-10-24 22:51:30 +02:00
eeb95f89e1 add .mrpack mime type
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-25 00:12:27 +08:00
e4e0c27e1c Merge pull request #281 from Scrumplex/fix-nsis-displayname 2022-10-24 11:09:23 -03:00
b638a6ae95 fix: retry mod search job after aborting it
This way, we don't get stuck with an aborted job in our way! :o

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-24 09:09:24 -03:00
74b98af8e5 fix: use display name in NSIS
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-24 12:43:13 +02:00
6a474a0125 fix: update icon generate script
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-24 11:18:53 +02:00
224304813a Merge pull request #274 from Protrikk/patch-1 2022-10-24 11:13:42 +02:00
4caf06bc99 Check "Select all" checkbox if all options are already selected
+ code cleanup

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-23 19:30:41 -04:00
15593b5c09 Add "Select all" checkbox + ui revamp + code cleanup
Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-23 19:30:41 -04:00
e7e56eb1e3 add more options to copy instance dialog
- Copy game options, copy resource packs, copy shaders,
copy servers, and copy mods
- Also made a new InstanceCopyPrefs struct to store those
options rather than passing 7 different booleans into
InstanceCopyTask's constructor

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
2022-10-23 19:30:28 -04:00
43bf601f12 add icons to the instance toolbar
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-10-23 20:04:19 -03:00
d5109f024b Better dark theme selection contrast
Tweak background of the selection background in order to make text more readable

Signed-off-by: Trisave <42098407+Protrikk@users.noreply.github.com>
2022-10-23 20:32:04 +02:00
7f441f5b87 Merge pull request #228 from bensuperpc/change_cast 2022-10-23 14:28:33 -03:00
0aac85dda1 Replace tab with spaces in flat_white.qrc
Signed-off-by: he3als <65787561+he3als@users.noreply.github.com>
2022-10-23 14:35:33 +01:00
4777a45722 Fix new flat white icons
Signed-off-by: he3als <65787561+he3als@users.noreply.github.com>
2022-10-23 14:32:35 +01:00
29e6e170cc Merge pull request #240 from jn64/fix/version-label-width 2022-10-23 02:07:29 +02:00
01db80d19a Fix version labels width
Make labels fit to the contents, so Ibeam cursor doesn't appear
over empty space. Should have been done with 90025ed.

Signed-off-by: jn64 <23169302+jn64@users.noreply.github.com>
2022-10-23 03:35:23 +08:00
8b28ed67ae Merge pull request #234 from AliceDTRH/fix/dedupejava 2022-10-22 13:14:26 -03:00
f35a30d371 oops
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-22 23:47:53 +08:00
1a8de111a3 add linux support
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-22 23:46:53 +08:00
9bb62e1bba Merge pull request #233 from jamierocks/atl-fix-aborting-installs 2022-10-22 12:19:58 -03:00
b2789fef0f Use correct variable for Windows
Signed-off-by: AliceDTRH <57547425+AliceDTRH@users.noreply.github.com>
2022-10-22 17:19:34 +02:00
46fe7e77b3 DCO Remediation Commit for he3als <65787561+he3als@users.noreply.github.com>
I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: d87f743a2bd2fac761b94de77ed7255d7a983f03
I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 92dfd659f1a3e11accdbf0ebbdc7cb91f74d9a21
I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: a6e65dfc7a7e8080297b59ecf322b788d1c9bad2
I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 99e1c13e80d12764f57a993661656d9ed7de27bb

Signed-off-by: he3als <65787561+he3als@users.noreply.github.com>
2022-10-22 16:14:50 +01:00
99e1c13e80 fix: add flat_white to code 2022-10-22 15:50:06 +01:00
a6e65dfc7a Add new flat white icons 2022-10-22 15:40:39 +01:00
1471eddc7e Deduplicates java installs before passing it on
Signed-off-by: AliceDTRH <57547425+AliceDTRH@users.noreply.github.com>
2022-10-22 16:40:31 +02:00
89fd84d916 Merge branch 'PrismLauncher:develop' into develop 2022-10-22 15:30:40 +01:00
0e17eee096 ATLauncher: Fix pack installation always aborting
I made a mistake during when cherry picking a previous commit, this
applies the change - and fixes installing ATLauncher packs.
2022-10-22 15:22:30 +01:00
81f1305270 Merge pull request #215 from forkiesassds/develop 2022-10-22 10:48:00 -03:00
2ec4310104 Merge pull request #230 from Scrumplex/add-pr-template 2022-10-22 15:32:00 +02:00
24e4db676a Merge pull request #224 from jamierocks/atl-abort-close-optional-mods-dialog 2022-10-22 15:31:53 +02:00
6e21a9829d Merge pull request #225 from Scrumplex/fix-segfault-fileresolver 2022-10-22 15:31:46 +02:00
4e99e10cbd Merge pull request #218 from getchoo/change-jars-path 2022-10-22 10:18:58 -03:00
500a7eceab update macOS build process to work with new .app
Signed-off-by: Tobias Möritz <tobias@moeritz.cc>
2022-10-22 15:10:32 +02:00
1dad35ca76 update macos plist contents (fixes #132)
Signed-off-by: Tobias Möritz <tobias@moeritz.cc>
2022-10-22 15:00:52 +02:00
8b3093e758 chore: add PR template
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-22 14:59:57 +02:00
a406aeb3ea feat: register as zip/mrpack handler on macOS
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
2022-10-22 20:51:46 +08:00
970e4b020e fix: fix segfault when resolving Flame resources
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-22 14:11:51 +02:00
a4f4f2891c DCO Remediation Commit for a6b13487
I, Jamie Mansfield <jmansfield@cadixdev.org>, hereby add my
Signed-off-by to this commit: a6b13487f0e27c8bea1917720a0c5c1eb1eb206c

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-10-22 12:58:56 +01:00
a6b13487f0 ATLauncher: Abort install if optional mods dialog is closed
This matches the behaviour of ATLauncher.
2022-10-22 12:35:34 +01:00
56ae4e5b6a Change old style cast to C++ cast
Change old style cast to C++ cast

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2022-10-22 13:04:48 +02:00
54c26b05fa Merge pull request #185 from flowln/fix_blocked_mods_crash 2022-10-22 12:44:20 +02:00
bd376d5217 Merge pull request #203 from Scrumplex/fix-dont-build-renove-branches
Don't build renovate branches
2022-10-22 10:59:49 +02:00
2592c69021 semicolon fail
i was off by one key :(

Signed-off-by: seth <getchoo@tuta.io>
2022-10-21 21:40:21 -04:00
4a2b25e841 fix: use correct variable for jars path
Signed-off-by: seth <getchoo@tuta.io>
2022-10-21 21:40:21 -04:00
ba4af1a890 fix: make jars path specific to prism
Signed-off-by: seth <getchoo@tuta.io>
2022-10-21 21:40:20 -04:00
9b17cde019 CurseForge modpack page improvements
Signed-off-by: forkiesassds <icanttellyou@memeware.net>
2022-10-22 01:20:08 +03:00
7a8c963722 Merge pull request #147 from Minion3665/enhancement/update-nix-derivation 2022-10-21 19:04:35 -03:00
82d1dbf173 DCO Remediation Commit for Hibi <69405847+Hibiii@users.noreply.github.com>
I, Hibi <69405847+Hibiii@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 1288b926153c86b7966727e60de4af8e7dcb4031
I, Hibi <69405847+Hibiii@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 5b75869c0ba60e00147d723d5633c9f6a5d6304e

Signed-off-by: Hibi <69405847+Hibiii@users.noreply.github.com>
2022-10-21 17:59:35 -03:00
aefb8b353e Merge pull request #187 from leo78913/menu-icons 2022-10-21 22:39:35 +02:00
5b75869c0b Add --show to manual page 2022-10-21 16:10:03 -03:00
1288b92615 Add argument to show instance window 2022-10-21 15:40:28 -03:00
7eecf454e8 fix: remove max height logic for mod update changelogs
It's not worth it to keep this, it's just a heuristic that fails from
time to time.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-21 14:07:43 -03:00
ccf7d1e0c4 material design icons
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-10-21 14:04:04 -03:00
e4b5cd23e6 the trashcan icons dont look like trash now
Signed-off-by: leo78913 <leo3758@riseup.net>
2022-10-21 13:49:31 -03:00
819296cc9c Merge pull request #198 from PrismLauncher/renovate/hendrikmuhs-ccache-action-1.x 2022-10-21 22:13:09 +05:30
67c7d80f41 Merge pull request #197 from PrismLauncher/renovate/actions-cache-3.x 2022-10-21 22:12:48 +05:30
919f8c54d7 fix: don't build renovate branches
They will be built using the pull_requests event anyway.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-21 17:42:39 +02:00
cbaf71f581 Merge pull request #201 from Scrumplex/add-netlify-sponsor 2022-10-21 17:37:18 +02:00
f118c602e6 Merge pull request #202 from Heath123/patch-1 2022-10-21 17:37:09 +02:00
ff2f40f5e1 Fix typo
Signed-off-by: circuit10 <heath.mitchell27@gmail.com>
2022-10-21 16:28:04 +01:00
9758c9b2a2 chore: add Netlify as sponsor
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-21 17:04:21 +02:00
09e4e100a2 chore(deps): update hendrikmuhs/ccache-action action to v1.2.3 2022-10-21 14:55:49 +00:00
bdd5c180d3 chore(deps): update actions/cache action to v3.0.11 2022-10-21 14:55:42 +00:00
749b085063 Merge pull request #196 from PrismLauncher/renovate/configure 2022-10-21 16:55:17 +02:00
c5a796ad8e chore(deps): add renovate.json 2022-10-21 14:43:02 +00:00
12d8409e65 Merge pull request #39 from Sebbl0508/mod_dialog_fontsize 2022-10-21 15:25:28 +02:00
8db89b4cfb Merge branch 'PrismLauncher:develop' into menu-icons 2022-10-20 17:54:43 -03:00
31dc92dafe add icons to the instance menu and 4 new icons:
delete
rename
tag
export

Signed-off-by: leo78913 <leo3758@riseup.net>
2022-10-20 17:48:57 -03:00
01b90809e8 fix: memory leak when finishing blocked mods job
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-20 16:55:22 -03:00
0a7383a4e1 fix: hide ProgressDialog when failing/succeeding tasks
WHY IS QT LIKE THAT AAAAAAAA

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-20 16:54:39 -03:00
5e86a34925 Merge pull request #184 from Chrono-byte/develop 2022-10-20 21:52:24 +02:00
ece206b81c Remove erroneous space
Signed-off-by: Chrono-byte <me@disilla.org>
2022-10-20 15:22:04 -04:00
88341b923a fix contributor notices in AboutDialog.cpp for license compliance
Signed-off-by: Chrono-byte <me@disilla.org>
2022-10-20 15:14:26 -04:00
5d27633821 fix: show a single line in ProjectItem's desc. when there's no more space
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-20 15:03:46 -03:00
a9d4370ad4 Merge pull request #47 from TheOPtimal/develop 2022-10-20 10:01:46 +02:00
8a0318c779 Merge pull request #119 from Scrumplex/update-readme-sponsors 2022-10-20 09:59:00 +02:00
8e754d9a56 fix: update README
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-20 09:54:23 +02:00
0e209dcb02 Merge pull request #148 from ZombieNub/prismlauncher-rename 2022-10-20 09:44:25 +02:00
6f2d6425a2 update meta to not break flatpak
Signed-off-by: Zeke <ezekielsmith@protonmail.com>
2022-10-20 16:54:57 +10:00
b46c4a81e0 check space requirements of project description
if there isn't enough space for 2 lines of project description, only
draw one

Signed-off-by: Sebastian Rueth <sebastian.rueth@protonmail.com>
2022-10-20 08:02:05 +02:00
b6aa33f3a6 Add Matrix Room
Co-authored-by: Fayne Aldan <FayneAldan@gmail.com>
Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com>
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
ab68d9198d PrismLauncher → Prism Launcher (again)
Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com>
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
32eebd3ca7 PrismLauncher → Prism Launcher
Co-authored-by: Fayne Aldan <FayneAldan@gmail.com>
Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com>
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
3f2e5633b4 Add OpenCollective
Co-authored-by: Fayne Aldan <FayneAldan@gmail.com>
Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com>
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
a99b9e80b8 Remove PolyMC's OpenCollective
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
42ed7e4626 Remove Matrix room link until one is created
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
ae910eea62 Change issue templates to Prism branding
Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-10-20 09:13:37 +04:00
d35920f356 Merge pull request #123 from MMK21Hub/patch-1 2022-10-19 22:00:23 -03:00
c29e7477f0 Merge branch 'develop' into prismlauncher-rename
Signed-off-by: IroncladLandship <jack.huffstutler@gmail.com>
2022-10-19 19:21:08 -05:00
86bbc7939c Merge pull request #100 from TheEvilSkeleton/improve-approachability 2022-10-19 21:15:37 -03:00
dab091a7b7 Update NIX.md so it has more methods + is clearer
- Add proper headings
- Change flake codeblocks so that configuration stuff isn't in the same
  place as flake.nix stuff
- Add instructions for not using the overlay with flakes
- Add instructions for running ad-hoc with flakes

Signed-off-by: Skyler Grey <skyler3665@gmail.com>
2022-10-19 23:50:48 +01:00
513d93cfc7 Change the derivation to have parity with nixpkgs
- Symlink rather than copying libraries
- Update maintainers
- Reformat with nixpkgs-fmt

Signed-off-by: Skyler Grey <skyler3665@gmail.com>
2022-10-19 23:48:56 +01:00
d7478c14fd Renamed inappropriate instances of "PrismLauncher" to "Prism Launcher"
Signed-off-by: IroncladLandship <jack.huffstutler@gmail.com>
2022-10-19 16:03:18 -05:00
297c593edd Improve approachability
Signed-off-by: TheEvilSkeleton <theevilskeleton@riseup.net>
2022-10-19 15:10:35 -04:00
6439ef11aa Fix incorrect release titles
Signed-off-by: MMK21Hub <KAGfan2018@outlook.com>
2022-10-19 19:21:48 +01:00
d6479e133d fix: properly center project descriptions
In particular, this takes into account the space used by the title, so
(hopefully) there won't be problems with custom themes with that.

Signed-off-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Sebastian Rüth <sebastian.rueth@protonmail.com>
2022-10-19 20:12:50 +02:00
50bbf2aacc fix text clipping
Signed-off-by: Sebastian Rüth <sebastian.rueth@protonmail.com>
2022-10-19 20:12:50 +02:00
41032aaac2 Merge pull request #110 from Scrumplex/fix-nsis-shortcut 2022-10-19 14:28:36 +02:00
4e08f28246 Merge pull request #31 from flowln/who_needs_webview 2022-10-19 14:28:29 +02:00
46c57e120f Merge pull request #27 from flowln/ftb_install_improve 2022-10-19 13:51:35 +02:00
6b52ee61ae Merge pull request #92 from Scrumplex/new-logo 2022-10-19 13:41:56 +02:00
61fbc5a791 refactor: replace with new logo
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-19 13:08:23 +02:00
22365205f9 fix: use display name for NSIS
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-19 12:17:06 +02:00
c6515c1dad Merge pull request #54 from Samisafool/develop 2022-10-19 12:13:13 +02:00
8201d1df02 Rename
Signed-off-by: Samisafool <thenerdiestguy@gmail.com>
2022-10-19 15:02:43 +05:30
ddf168c536 Merge pull request #75 from Gideon9212/develop 2022-10-19 06:27:09 +02:00
c9f81f56e9 Fix banner
Removed boosted URL for plain

Signed-off-by: Gideon9212 <gideon_gallagher@zoho.com>
2022-10-18 18:35:03 -07:00
570264e1e9 Merge branch 'develop' into develop
Signed-off-by: Gideon9212 <gideon_gallagher@zoho.com>
2022-10-18 17:28:42 -07:00
325e58d98c Merge pull request #88 from FayneAldan/multimc-fallback
go all the way up the fork chain!
2022-10-18 19:27:24 -03:00
23a2960aa3 Merge pull request #60 from jitterdev/develop 2022-10-18 18:53:30 -03:00
888a87463e Add fallback for multimc.cfg
Signed-off-by: Fayne Aldan <FayneAldan@gmail.com>
2022-10-18 14:40:34 -06:00
2ebaf46095 Merge pull request #82 from flowln/i_broke_something_again 2022-10-18 22:15:08 +02:00
3a95a3b7c1 fix: don't take item from a possibly empty list
The list gets destroyed when we take the last object, so things explode.
😔

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-18 16:51:42 -03:00
c4edffb388 Update banner
Changed to Join instead of Support server.

Signed-off-by: Gideon9212 <gideon_gallagher@zoho.com>
2022-10-18 12:10:29 -07:00
5eec7cc788 Change discord invite to a banner
To help direct people to support with a big banner.

Signed-off-by: Gideon9212 <gideon_gallagher@zoho.com>
2022-10-18 11:40:23 -07:00
fb4cf0b75d Merge pull request #55 from flowln/config_add_fallback 2022-10-18 19:50:34 +02:00
5584884fe6 Merge pull request #68 from nightsnowlinouo/develop 2022-10-18 19:43:02 +02:00
3bb1068ef0 Merge pull request #59 from CutestNekoAqua/bug-35 2022-10-18 19:26:57 +02:00
b1b85313ae Fix hosted weblate translation website URL
Signed-off-by: 雪鈴 SnowLin <113241163+nightsnowlinouo@users.noreply.github.com>
2022-10-19 01:22:58 +08:00
92dfd659f1 Fix .QRC file for flat white icons 2022-10-18 17:54:26 +01:00
d87f743a2b Add flat white icons
This is mainly for dark mode users, as I think that the regular colour of the flat icons do not look good with dark mode.
2022-10-18 17:49:35 +01:00
aec3e7b0fc correct non-proper noun
Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com>
2022-10-18 11:14:27 -05:00
243600b75b Merge pull request #61 from pog5/develop 2022-10-18 18:03:34 +02:00
3d89d126d0 PlaceholderMC => PrismLauncher
Small Correction

Signed-off-by: Nightly <62222436+pog5@users.noreply.github.com>
2022-10-18 15:52:32 +00:00
54281e53a1 Update README.md
Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com>
2022-10-18 10:35:00 -05:00
6befd2be81 Update README.md
Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com>
2022-10-18 10:34:27 -05:00
1f0ca9ed92 Update README.md
Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com>
2022-10-18 10:34:11 -05:00
f3db9c3920 Merge pull request #48 from flowln/fix_nbt 2022-10-18 17:31:46 +02:00
83ceb26151 Streamline Button changes to improve source readability. 2022-10-18 17:28:23 +02:00
32cdfb871c fix: add fallback for polymc.cfg
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-18 12:22:42 -03:00
801e7da5ee feat: allow specifying fallbacks to INI files
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-18 12:22:42 -03:00
2cf1ab7ec5 Merge pull request #43 from SSUPII/develop 2022-10-18 11:31:38 -03:00
d049c1afaf chore: update flake
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 16:28:30 +02:00
9f45389bc1 Merge pull request #45 from NotNite/update-readme 2022-10-18 11:23:10 -03:00
d875481969 fix: update libnbtplusplus submodule's URL
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-18 11:11:34 -03:00
17a1e1245c Updated HTML tags to Markdown
Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 16:04:28 +02:00
06d28c3eec Updated project naming
Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 15:57:43 +02:00
684982c25c README: PlaceholderMC -> Prism Launcher
Also cleaned it up a bit to make my Markdown linter happy.
2022-10-18 09:52:36 -04:00
421522a61a Added further clarifications
Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 15:52:00 +02:00
f3b29d67f4 Merge branch 'PrismLauncher:develop' into develop 2022-10-18 15:39:29 +02:00
2ee5c6b2a1 Totally skipped a typo
Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 15:38:32 +02:00
5083772c6f Fixed markdown errors
Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 15:37:11 +02:00
fd51e5df47 Added build instructions for Linux
Added build instructions in the main repository as a temporary reference

Signed-off-by: Sergio <42090377+SSUPII@users.noreply.github.com>
2022-10-18 15:35:40 +02:00
3405fd91c6 Merge pull request #33 from DioEgizio/remove-useless-actions 2022-10-18 15:31:32 +02:00
194822f11e Merge pull request #28 from flowln/fix_copy 2022-10-18 15:27:53 +02:00
98963d4cdf Merge pull request #29 from Scrumplex/feat-clear-metadata 2022-10-18 15:25:56 +02:00
804ef36b20 Merge pull request #26 from Scrumplex/armhf 2022-10-18 15:24:33 +02:00
3c6ff8fddf Merge pull request #36 from DioEgizio/fix-copying 2022-10-18 15:05:31 +02:00
511893d535 update COPYING
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-18 14:47:20 +02:00
e05fe77bfe feat: remove redundant actions from instance toolbar and redundant "instance"s
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-18 14:43:29 +02:00
2b7b9a2abb Merge pull request #25 from PlaceholderMC/fix-data-path
Fix Data path
2022-10-18 14:05:22 +02:00
6db3f68ae1 refactor: use correct data path
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 13:58:50 +02:00
3773f2e7a5 Merge pull request #23 from PlaceholderMC/new-cf-key 2022-10-18 13:29:36 +02:00
1f8bffc15a fix: new CurseForge key
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 13:24:57 +02:00
afaef4e83b Merge pull request #13 from PlaceholderMC/rebrand 2022-10-18 13:05:24 +02:00
b746f723cb fix: add Prism copyright header
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 13:01:32 +02:00
cfaf44f57b fix: add sparkle public key
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 12:49:08 +02:00
eed541201e fix: add new MSA client id
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 10:37:35 +02:00
a8bcb85f7b fix(actions): change to PrismLauncher
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 10:13:44 +02:00
981e9cf290 Merge pull request #14 from leumasme/develop 2022-10-18 13:27:10 +05:30
3ac398ac49 fix: use display name in code
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 09:50:27 +02:00
2d0728395f Update README.md discord vanity link 2022-10-18 09:44:50 +02:00
722194405a refactor: initial rebrand
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-18 09:37:59 +02:00
0868a5e534 Merge pull request #11 from AshtakaOOf/temp-readme
More readable README.md :)
2022-10-18 01:42:54 +02:00
a86b9c82ce Update README.md
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-10-18 01:38:49 +02:00
f8642548c8 Update README.md
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-10-18 01:35:30 +02:00
27873f7ed4 Update README.md
Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-10-18 01:27:51 +02:00
b3eda6bcbb Merge pull request #5 from AshtakaOOf/AshtakaOOf-readme
Temporary README.md
2022-10-17 23:08:21 +02:00
1c7799e292 Update README.md
Change some stuff temporarily

Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com>
2022-10-17 22:53:02 +02:00
aecd158d3c Merge pull request #1208 from DioEgizio/fix-unused-libs
Removes `classparser` and `xz-embedded`
2022-10-16 10:41:43 -03:00
87d35f0d16 fix: remove some unused libs
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-15 20:16:15 +02:00
c089f9b59f Merge pull request #1203 from DioEgizio/macos-legacy 2022-10-15 15:24:30 +02:00
82d7f9f5a4 chore(tests): add test for FS copy with dot folders/files
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-15 09:40:00 -03:00
8bc529be3d fix: include hidden files when copying instances
fixes instance ccopy on linux .-.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-15 09:20:31 -03:00
924c1634d3 Merge pull request #1194 from flowln/fix_opted_out_on_any_filter 2022-10-15 13:18:35 +02:00
03d077e915 fix(nix): add ghc_filesystem dependency
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-15 13:13:56 +02:00
303628bb05 refactor: support system ghc-filesystem
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-15 13:13:38 +02:00
3b92ec8e82 chore: clang-format RuntimeContext
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-15 12:43:15 +02:00
545944cb0d refactor: support armhf
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-15 12:41:16 +02:00
c90a88b6b6 fix: correct ftb legacy too
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-14 12:18:06 -03:00
89e45a61b3 fix: workaround ghc::filesystem bug
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-14 16:45:13 +02:00
2aff7bac4a fix: disable updater on macOS-Legacy
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-14 15:58:16 +02:00
124097d3a5 feat!: use ghc/filesystem in place of std's one if needed
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-14 14:08:48 +02:00
c520faed6d feat: add gulrak/filesystem submodule
... for old macs that don't have std::filesystem in their stdlib.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-14 14:08:42 +02:00
5bdb3703ed fix: stop forcing libc++ on macOS
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-14 14:08:05 +02:00
2901039a48 feat(actions): macOS-Legacy package
still no updater part though

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-14 14:08:05 +02:00
dfa220ef02 fix: issues with aborts (again)
i hate it

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-13 15:10:35 -03:00
f26be00571 fix: abort search if we're already trying to download a pack
Meaning we don't have to wait for the searches to finish in the
background to finally start the modpack download, when we have already
selected it -_-

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-13 13:49:06 -03:00
83654a193e refactor+fix: Make FTB install task similar to other install tasks
In particular, this changes the order so that the instance gets created
before downloading the mods (like other install tasks), and the mod download
directly puts the files in the staging folder (like the others), instead
of that weird makeCached and copy stuff.

This fixes some issues with modpack downloads from FTB, like creating an
instance with no mods in it.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-13 13:27:52 -03:00
b2a5d8daf4 fix: don't include opted out versions with the 'Any' filter on the MD
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-12 10:26:14 -03:00
19ee736e1d Merge pull request #1190 from TayouVR/merged-launch-button1 2022-10-11 16:21:41 -03:00
fda3f1352e feat: add image support for the news reader :^)
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-11 16:11:08 -03:00
d194b02e28 fix: prevent images overriding content when changing pages
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-11 15:51:54 -03:00
aaba99dc10 Update launcher/ui/MainWindow.cpp
make " Offline" string for profilers translatable

Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Tayou <31988415+TayouVR@users.noreply.github.com>
2022-10-11 14:58:34 +02:00
93a2e0f777 Merge Launch Buttons
Signed-off-by: Tayou <tayou@gmx.net>
2022-10-10 23:23:06 +02:00
71f3c6b461 feat: add clear metadata action
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-10 12:48:25 +02:00
aabcca5059 Merge pull request #1175 from Ozynt/patch-1 2022-10-09 20:20:05 +02:00
7e67fd8c79 Update LaunchController.cpp
Signed-off-by: Ozynt <104643560+Ozynt@users.noreply.github.com>
2022-10-09 13:20:50 +02:00
fecf1ffcb9 Update LaunchController.cpp
Signed-off-by: Ozynt <104643560+Ozynt@users.noreply.github.com>
2022-10-09 13:19:38 +02:00
fafc9cf9ca Merge pull request #1033 from Scrumplex/multi-arch-support 2022-10-08 20:12:40 +02:00
3111e6a721 chore: add missing license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-08 20:12:07 +02:00
e436f471a0 Merge pull request #1177 from DioEgizio/codeql
bye LGTM 👋
2022-10-08 15:04:23 -03:00
28f84902f6 Merge pull request #1185 from DioEgizio/fix-tooltip
Fix outdated 'Disable mod metadata' button's warning message.
2022-10-08 14:34:59 -03:00
ebee50eedc Improve default light and dark themes (#1174) 2022-10-08 14:33:24 -03:00
e0ef09dfe1 Merge pull request #1183 from Scrumplex/fix-capabilities-first-run 2022-10-08 14:29:14 -03:00
d7992ab29d feat: add image support for FTB packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-08 14:12:05 -03:00
60f19f305e feat: add image support for modrinth modpack pages
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-08 14:12:03 -03:00
d99976f5d7 fix: make mod and modpack caches separate for Modrinth
This makes it similar to CF mods / modpacks. The mods cache is
maintained with the same name because it most likely has more data it
in, so this commit will affect existing caches as minimally as possible.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-08 14:11:20 -03:00
db158a5735 feat: add image support for mod pages
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-08 14:11:20 -03:00
ea3be17220 feat: add widget for a text browser with image support
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-08 14:11:20 -03:00
f26049009e fix: mod updating isn't upcoming anymore :p
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-08 16:20:46 +02:00
787234a53a Merge pull request #1163 from flowln/fix_list_icons 2022-10-08 12:12:38 +02:00
fc3a64056c Merge pull request #1154 from Scrumplex/epic-formatting-codes 2022-10-08 12:12:26 +02:00
6ebc9abb80 fix: update capabilities before first-run wizard
On first run, the condition for the wizard would return, before running
updateCapabilities(). This moves that call up, as its only dependency is
the settings system.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-10-06 14:46:13 +02:00
80e9eed35a fix: remove old unused lgtm.yml, exclude cpp/fixme-comment
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-04 16:17:57 +02:00
23b3990f99 feat(code scanning): enable security-and-quality query
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-04 16:17:57 +02:00
41276403df feat(actions): add codeql code scanning
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-10-04 16:17:57 +02:00
e3e9e39498 Merge pull request #1171 from vedantmgoyal2009/patch-1 2022-10-02 15:08:59 +02:00
f315025a8d Merge pull request #1167 from Scrumplex/epic-commandline 2022-10-02 00:41:34 +05:30
8e43d97133 Microsoft account only
Signed-off-by: stoltsvensk <104643560+stoltsvensk@users.noreply.github.com>
2022-10-01 16:47:23 +02:00
c97a47dc62 Merge pull request #1172 from Scrumplex/fix-includes 2022-09-30 18:08:45 -03:00
7ccafdc993 fix: add missing includes to fix Qt 6.4 build
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-30 19:56:01 +02:00
0dca9cb6b8 Merge pull request #1162 from Trial97/feature/Replace-toml-library 2022-09-30 19:44:45 +02:00
be3d780720 Update winget.yml
Signed-off-by: Vedant <83997633+vedantmgoyal2009@users.noreply.github.com>
2022-09-30 22:51:47 +05:30
0f59a1dde1 fix(nix): add tomlplusplus
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 15:42:45 +02:00
7c6bb80cee fix: move toml++ find call
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 13:46:01 +02:00
62841c5b23 fix: pin tomlplusplus to latest release
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 13:44:28 +02:00
aad4f8d1f7 fix: update Git modules
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 13:44:28 +02:00
11c44c676c fix: remove unused MACOS_HINT
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 13:28:46 +02:00
370c3aa598 Merge pull request #894 from flowln/update_from_external_source
epic PR
2022-09-26 08:25:12 -03:00
1cdadafdf8 refactor: use QCommandLineParser instead
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-26 13:21:27 +02:00
dd6f670dec fix: Fixed memory leak
Signed-off-by: timoreo <contact@timoreo.fr>
2022-09-26 11:50:55 +02:00
9ff364b0d3 huge nit: added const refs, everywhere
Signed-off-by: timoreo <contact@timoreo.fr>
2022-09-26 11:50:31 +02:00
58a5331f7b Merge pull request #1164 from Scrumplex/fix-sort-languages 2022-09-25 19:50:55 +02:00
ed261f0af9 Update launcher/minecraft/mod/tasks/LocalModParseTask.cpp
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
2022-09-25 20:38:55 +03:00
c01b475cbf Merge pull request #1165 from ErogigGit/develop 2022-09-25 09:33:29 -03:00
3d4feeec8d DCO Remediation Commit for ErogigGit <eric.hagerstrand@gmail.com>
I, ErogigGit <eric.hagerstrand@gmail.com>, hereby add my Signed-off-by to this commit: 8a4f1c66f83a339d33ab0ba0076d8c1141055067

Signed-off-by: ErogigGit <eric.hagerstrand@gmail.com>
2022-09-24 23:31:30 +02:00
a1800ec23f Prefer the system tomlplusplus
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2022-09-25 00:20:01 +03:00
8a4f1c66f8 Allow double clicking to mark for dowload
Signed-off-by: Erogig <erogigabyte@gmail.com>
2022-09-24 22:37:51 +02:00
b187231b0e fix: sort languages by their name instead of key
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-24 11:53:41 +02:00
60b38de69f fix: fallback for languages without a native name
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-24 11:48:33 +02:00
600c49f7f0 Replaced tomlc99 with tomlplusplus
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
2022-09-24 00:10:27 +03:00
e7380e70a3 fix: use placeholder icon when the project has no icon in MR
Projects with no icon return a null icon URL in Modrinth's API.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-23 18:05:58 -03:00
3df8594f19 feat: change project item delegate for modrinth modpacks
more info! \ ^-^/

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-23 16:59:40 -03:00
ee4a829293 fix: remove manual icon resize in ModModel
THis fixes a FIXME, now that we fixed the issue :o

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-23 16:59:40 -03:00
1862f3c124 fix: set icon sizes correctly in ProjectItemDelegate
no more dumb hacks with icons!!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-23 16:59:40 -03:00
777ab3416f feat: also format resource/texture pack names
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-21 15:00:28 +02:00
ecf5ab75e7 feat: support more formatting codes
also fix some crashes

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-21 14:59:01 +02:00
4f6d964217 fix: don't change groups when updating an instance
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
06019f01e3 feat: add dialog to ask whether to chaneg instance's name
This prevents custom names from being lost when updating, by only
changing the name if the old instance name constains the old version,
so that we can update it if the user whishes to.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
ddde885084 fix: show warning in case there's no old index when updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
be8c6f218c refactor: setAbortStatus -> setAbortable
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
9eb35ea7c8 fix: don't load specific settings for managed pack info
This avoids loading all settings for all instances when searching for
one with a specific managed pack name.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
d2fdbec41d fix: move file deletion to the end of the instance update
This makes it harder for problems in the updating process to affect the
current instance. Network issues, for instance, will no longer put the
instance in an invalid state.

Still, a possible improvement to this would be passing that logic to
InstanceStaging instead, to be handled with the instance commiting
directly. However, as it is now, the code would become very spaguetti-y,
and given that the override operation in the commiting could also put
the instance into an invalid state, it seems to me that, in order to
fully error-proof this, we would need to do a copy operation on the
whole instance, in order to modify the copy, and only in the end
override everything an once with a rename. That also has the possibility
of corrupting the instance if done without super care, however, so I
think we may need to instead create an automatic backup system, with an
undo command of sorts, or something like that. This doesn't seem very
trivial though, so it'll probably need to wait until another PR. In the
meantime, the user is advised to always backup their instances before
doing this kind of action, as always.

What a long commit message o.O

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
2dd372600c fix: some abort-related issues
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
eda6cf11ef feat(ui): improve info dialog before updating an instance
Adds a 'Cancel' option, and add a note about doing a backup before
updating.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
68facd6b93 fix(ui): hook up abort status signal in ProgressDialog
Now we have a visual indication on when tasks are abortable!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
87002fb8f8 fix: hook up setAbortStatus in instance import tasks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
6a50fa35ec feat: add canAbort() status change in Task
By now, it's a recurring pattern of wanting to restrict aborting in
certain situations. This avoids further code duplication, and adds a
signal that external users can hook up to to respond to such change.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
6541570969 fix: simplify abort handling and add missing emits
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
4b0ceea894 fix: correctly set managed pack fields in CF pack
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
8c0816c166 feat: add override awareness to CF modpack updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
be769d07f1 fix: correctly set all managed pack fields in Modrinth pack
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
3a9d58e31c feat: add override handling in modrinth pack update
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
7024acac06 feat: add override helper functions
These help us keep track of relevant metadata information about
overrides, so that we know what they are when we update a pack.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
6131346e2f refactor: change the way instance names are handled
While working on pack updating, instance naming always gets in the way,
since we need both way of respecting the user's name choice, and a
standarized way of getting the original pack name / version.

This tries to circunvent such problems by abstracting away the naming
schema into it's own struct, holding both the original name / version,
and the user-defined name, so that everyone can be happy and world peace
can be achieved! (at least that's what i'd hope :c).

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
eed73c9078 refactor: clean up InstanceImportTask a bit
Also removes a divide by two in the download progress
(why was it there???)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
795d6f35ee feat: add curseforge modpack updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
ebd46705d5 refactor: move creation of CF file download task to a separate function
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
72d2ca234e refactor: move flame modpack import to separate file
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:07 -03:00
2246c3359b refactor: add throw_on_blocked arg to Flame file parse
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:07 -03:00
242fb156a2 feat: add 'getFiles' by fileIds route in Flame API
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:07 -03:00
208ed73e59 feat: add early modrinth pack updating
Still some FIXMEs and TODOs to consider, but the general thing is here!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:06 -03:00
4441b37338 refactor: move modrinth modpack import to separate file
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:32:36 -03:00
941d75824a refactor: add instance creation abstraction and move vanilla
This is so that 1. Code is more cleanly separated, and 2. Allows to more
easily add instance updating :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:32:36 -03:00
ec9ddc4f22 chore: add helper function for copying managed pack data between insts.
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:32:36 -03:00
98b6f90172 fix: add more legacy architectures
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 16:01:08 +02:00
7e280de361 refactor: drop 64-bit check
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 16:01:08 +02:00
7bd8bd13fe feat: support multiarch system classifiers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 16:01:06 +02:00
09e85e948c refactor: introduce RuntimeContext
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 15:59:43 +02:00
9ec1c00887 fix: register JavaRealArchitecture for MinecraftInstance
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 15:58:56 +02:00
c6bcb6228b Merge pull request #1108 from Scrumplex/better_texture_packs 2022-09-20 13:28:33 +02:00
a24d589845 fix: ensure all resource folders exist
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:39:05 +02:00
ebbcc9f6da fix: actually render color codes for texture packs
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
23fc453fae fix: comments and naming of texture pack stuff
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
aad6f74db6 fix: tests
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
07dcefabcb feat: add texture pack parsing
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
40c68595d7 Merge pull request #1150 from flowln/fix_crash_on_game_quit 2022-09-20 09:41:59 +05:30
fe9a4fece4 Merge pull request #1142 from flowln/better_fs 2022-09-20 09:00:19 +05:30
098327f128 Merge pull request #903 from jopejoe1/demo-launch 2022-09-18 14:41:25 +02:00
0873b8d304 fix: prevent container detaching in ResourceFolderModel
and use const accessors whenever we can!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-16 20:12:31 -03:00
c9eb584ac8 fix: prevent deletes by shared pointer accidental creation
This fixes the launcher crashing when opening the game :iea:

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-16 20:12:30 -03:00
10493bd44a fix: move newly allocated resources to the main thread
This avoids them getting deleted when the worker thread exits, due to
thread affinity on the created thread.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-16 20:12:30 -03:00
9e35230467 fix: memory leak when getting mods from the mods folder
friendly reminder to always delete your news.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-16 20:12:30 -03:00
81e326571b fix: enable demo launch only on supported instances
e.g. >= 1.3.1 instances

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-15 19:27:42 -03:00
1b2a7de4e2 fix: show 'demo' instead of 'offline' in log when in demo mode
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-15 18:44:18 -03:00
11216d200c change: move demo action to "Play offline" menu
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-15 18:44:18 -03:00
777be6a48d Add 'Ctrl+Alt+O' Shortcut to launch demo instance.
Signed-off-by: jopejoe1 <johannes@joens.email>
2022-09-15 18:44:18 -03:00
5765a1fdf1 fix: allow demo for older versions
We were not propagating the '--demo' flag in the legacy launcher,
unconditionally setting the 'demo' parameter to false.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-15 18:44:18 -03:00
29dcb9d274 Added Launch Demo button.
Signed-off-by: jopejoe1 <johannes@joens.email>
2022-09-15 18:44:18 -03:00
8674ac4f68 Merge pull request #1146 from Scrumplex/fix-launch-rd 2022-09-15 17:55:08 -03:00
684b8f24f3 fix: allow starting rd- versions
Using `Collections.emptyList()` doesn't allow us to later append stuff
into that list. Use an empty `ArrayList` instead.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-15 09:29:48 +02:00
1ca2be0039 Merge pull request #982 from DavidoTek/windarkmode2 2022-09-14 13:17:17 +02:00
8c41ff68f7 chore(actions)!: bump macOS required version to 10.15
This is needed for std::filesystem support in macOS's libc.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 18:41:13 -03:00
931d6c280a chore(tests): add test for copy operation with blacklist
I almost 💀 because no tests used this x.x

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:12:55 -03:00
ee0fb2d0e0 fix: use std::wstring for Windows filenames
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:24 -03:00
c496ad1237 chore: make DirNameFromString add normal duplicate identifier
Wrap the number in parenthesis to be similar to other software.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:24 -03:00
277fa21f5f refactor: remove Win32 'crap' in FileSystem
We should use std::filesystem symlink and hardlink functions instead.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
1cf949226e refactor: use std::filesystem for overrides
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
be3fae6511 refactor: use std::filesystem for path deletion
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
5932f36285 refactor: use std::filesystem for file copy
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
30abb65368 Merge pull request #1133 from Scrumplex/refactor-tests
Move tests to a separate folder, to fix issues and improve maintenance
2022-09-12 12:57:55 -03:00
64a06b5ed6 Merge pull request #1123 from flowln/fix_abort_inst 2022-09-12 17:11:19 +05:30
69d18f17a5 fix(actions, win): only copy openssl libs on qt5 builds (#1130) 2022-09-12 07:57:18 -03:00
4c7d3a103c refactor: restructure tests
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-11 22:29:01 +02:00
10320bdeb4 Merge pull request #1129 from dada513/metainfo_fix
Fixes FlatHub's image metadata for the 1.4.2 release
2022-09-11 09:39:21 -03:00
4261dcff39 fix meta
Signed-off-by: dada513 <dada513@protonmail.com>
2022-09-11 10:45:42 +02:00
a091245793 fix: emit signals when aborting NetJob
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-10 09:10:16 -03:00
ca282f9fb3 Merge pull request #1117 from flowln/fix_updater
Fix the mod updater not working as intended
2022-09-08 09:28:05 +02:00
7cf2c3be0f fix: start at least one task in ConcurrentTask
This allows us to emit all the necessary stuff when we're finished in
the case of starting a task with no subtasks. In particular, this caused
the mod updater to not work properly :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-07 12:11:42 -03:00
f65d506f26 Merge pull request #997 from flowln/fix_major_version_filter 2022-09-07 10:34:50 -03:00
333dbca01e Merge pull request #1105 from flowln/better_resource_packs
Add basic resource pack parsing and fix issues
2022-09-07 08:30:36 -03:00
42eb265624 refactor: create mod pages and filter widget by factory methods
This takes most expensive operations out of the constructors.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-07 08:29:58 -03:00
8a65726e9d fix: use more robust method of finding matches for major version
This uses the proper version list to find all MC versions matching the
major number (_don't say anything about SemVer_ 🔫).

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-07 08:27:53 -03:00
1b0ca47682 Merge pull request #939 from flowln/mod_downloader_improve
Some more UI / UX improvements to the mod downloader!
2022-09-07 08:27:11 -03:00
8e3f5c3305 Merge pull request #966 from flowln/refactor_tasks
Reduce code duplication in tasks, fix some bugs and add some tests
2022-09-07 08:26:28 -03:00
3c0a6987cd Merge pull request #1113 from timoreo22/develop
Fix compilation warning due to uninitiated variables.
2022-09-06 18:50:46 -03:00
e37f70b9f7 Merge pull request #1114 from DioEgizio/bump-installqtaction-v3 2022-09-06 20:36:35 +05:30
03c148ce50 chore: update install-qt-action to v3
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-09-06 15:41:32 +02:00
4817f0312d Fixed up a warning
Signed-off-by: timoreo <contact@timoreo.fr>
2022-09-06 14:32:19 +02:00
b70a82c609 Merge pull request #1111 from PolyMC/revert-1067-classpath-epicness 2022-09-05 20:06:33 +02:00
25d1e0c4e6 Merge pull request #1107 from DioEgizio/smaller-about 2022-09-05 17:52:16 +02:00
8e3356f11a Merge pull request #1034 from Scrumplex/detect-performance-features 2022-09-05 17:45:17 +02:00
1b559c7776 Revert "Move classpath definition into NewLaunch itself"
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-05 17:37:10 +02:00
d5583f0f02 make the about dialog smaller
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-09-04 14:32:33 +02:00
bedd3c50b6 fix: improve handling of unrecognized pack formats
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 15:05:23 -03:00
43a7af3f44 fix: removing mods with their metadata as well
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:23 -03:00
9db27c6acc fix: crash when adding resource packs directly in the folder
This fixes an issue in which, when adding a new resource pack externally
to PolyMC, when the resource pack view was open, would crash poly.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
42c81395b3 fix: race condition on ResourceFolderModel tests
This (hopefully) fixes the race contiditions that sometimes got
triggered in tests.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
3b13e692d2 feat: move resource pack images to QPixmapCache
This takes care of evicting entries when the cache gets too big for us,
so we can add new entries without much worries.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
0331f5a1eb feat(tests): add tests for resource pack parsing
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
8a7e117f6b refactor: move resource pack file parsing utilities to separate namespace
This makes it easier to use that logic in other contexts.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
9b984cedac feat: add image from pack.png to resource packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
dd9e30b24a feat: add resource icon to InfoFrame
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
6a93688b2e fix: filtering in regex search in resource packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
3ab17a97a8 fix: sorting by pack format
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
f21ae66265 feat: add basic resource pack parsing of pack.mcmeta
This parses the pack format ID and the description from the local file,
from both a ZIP and a folder, and hooks it into the model.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
afa1a5e932 feat: modify InfoFrame and ResourcePackPage to show ResourcePack info
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
050768c266 feat: add more resource pack info
Adds pack format id and description to ResourcePack, that'll be parsed
from pack.mcmeta.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
cda2bfc240 feat: allow specifying factory for resources in BasicFolderLoadTask
This allows us to hook our own resource type, that possibly has more
content than the base Resource, to it.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:20 -03:00
2f167b1512 Merge pull request #1095 from flowln/ensure_file_path_in_override 2022-09-01 09:54:22 +02:00
ba3ac85356 Merge pull request #1067 from Scrumplex/classpath-epicness
Move classpath definition into NewLaunch itself
2022-08-31 18:28:29 -03:00
ec29cedeb7 Merge pull request #1080 from flowln/eternal_cache
Never invalidate libraries cache entries by time elapsed
2022-08-31 18:28:07 -03:00
064ae49d2b fix: make MultipleOptionsTask inherit directly from SequentialTask
It's not a good idea to have multiple concurrent tasks running on a
sequential thing like this one.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:02 -03:00
247f99ce2f feat(test): add more tests to Tasks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
7b6d269904 refactor: make NetJob inherit from ConcurrentTask as well!
Avoids lots of code duplication

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
87a0482b8b refactor: make MultipleOptionsTask inherit from ConcurrentTask too
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
e899699918 refactor: make SequentialTask inherit from ConcurrentTask
In a way, sequential tasks are just concurrent tasks with only a single
task running concurrently, so we can remove LOTS of duplicated logic :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
bdf464e792 fix: abort logic running subsequent tasks anyways some times
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
c410bb4ecb fix: 'succeeded while not running' spam in ConcurrentTask
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
a720bcc637 fix: bogus progress update when the total step progress was zero
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:01 -03:00
369a8cdc74 fix: only try to start tasks that are really there
This fixes an annoying issue where concurrent tasks would try to start
multiple tasks even when there was not that many tasks to run in the
first place, causing some amount of log spam.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:29:00 -03:00
3f4e55be4f fix: ensure destination file paths exist when overriding folders
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 16:28:23 -03:00
9171f471ab Merge pull request #1094 from flowln/fix_the_thing
Fix build due to merge without rebase messing things up :p
2022-08-28 16:27:41 -03:00
2186b134a4 fix: Mod type enum -> Resource type enum
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 14:47:52 -03:00
f371ec210c Merge pull request #1052 from flowln/resource_model 2022-08-28 16:52:53 +02:00
afcd669d2f Merge pull request #965 from flowln/fat_files_in_memory
Refactor a bit EnsureMetadataTask and calculate hashes in a incremental manner
2022-08-28 11:03:12 +02:00
fbf542d205 Merge pull request #1087 from DioEgizio/fix-ftblegacy-url
fix: fix urls on ftb legacy
2022-08-24 20:37:07 -03:00
13184eb8e9 fix: fix urls on ftb legacy
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-24 12:31:38 +02:00
ddf1e1ccee fix: make FML libraries cache eternal
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-21 13:47:49 -03:00
5ac4e73697 fix: make libraries cache eternal
This restores the behavior prior to PR #920.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-21 13:47:49 -03:00
6be59b53f1 feat: add eternal cache entries
Those are entries that don't get stale over time, so we don't invalidate
them if they 'expire'.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-21 13:47:49 -03:00
bb54fec907 Merge pull request #1073 from DioEgizio/update-copying
fix(COPYING): fix COPYING.md by adding some missing copyright notices
2022-08-21 13:09:30 -03:00
0b81b283bf fix: LGTM warnings
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:49:56 -03:00
e2ab2aea32 change: add enable/disable to resources
TIL that zip resource packs, when disabled, actually have the effect of
not showing up in the game at all. Since this can be useful to someone,
I moved the logic for it to the resources.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:49:54 -03:00
c3ceefbafb refactor+fix: add new tests for Resource models and fix issues
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:49:23 -03:00
e7cf9932a9 refactor: simplify Mod structure
No need to keep track of pointers left and right. A single one already
gives enough headaches!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:48:51 -03:00
0c9d03f5df fix(tests): add timeout on ModFolderModel's tests
If the update never ends, the signal is not emitted and we become stuck
in the event loop forever. So a very lenient timer is added to prevent
that.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:48:01 -03:00
92aa24ae34 fix: don't give shared pointer to obj. external to the model
It causes some weird problems and adds refcounting overhead.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:48:00 -03:00
97a74d5c1f refactor: adapt rest of the codebase to the new resource model
In order to access the ModFolderModel from the ModFolderPage, i created
a new m_model for the correct type, shadowing the m_model of type
ResourceFolderModel. This creates two shared_ptr references to the same object,
but since they will have the same lifetime, it doesn't generate a memory
leak.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:47:58 -03:00
256f8094f5 refactor: make Resource Pack model inherit from ResourceFolderModel
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:47:11 -03:00
1e2f0ab308 refactor: move more tied logic to model and move logic to the resources
This moves the QSortFilterProxyModel to the resource model files,
acessible via a factory method, and moves the sorting and filtering to
the objects themselves, decoupling the code a bit.

This also adds a basic implementation of methods in the
ResourceFolderModel, simplifying the process of constructing a new model
from it.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:47:08 -03:00
af2cf2734d refactor: move things around in the mod model
Makes the method order in the cpp file the same as in the header file.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:46:33 -03:00
ec62d8e973 refactor: move general code from mod model to its own model
This aims to continue decoupling other types of resources (e.g. resource
packs, shader packs, etc) from mods, so that we don't have to
continuously watch our backs for changes to one of them affecting the
others.

To do so, this creates a more general list model for resources, based on
the mods one, that allows you to extend it with functionality for other
resources.

I had to do some template and preprocessor stuff to get around the
QObject limitation of not allowing templated classes, so that's sadge :c

On the other hand, I tried cleaning up most general-purpose code in the
mod model, and added some documentation, because it looks nice :D

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:45:01 -03:00
3225f514f6 refactor: move general info from Mod to Resource
This allows us to create other resources that are not Mods, but can
still share a significant portion of code.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:41:59 -03:00
2d63c86022 feat: make Task a QRunnable
This makes it possible to run a task in another thread.

I added a variable to toggle debug prints because they seem to trigger
an assertion on Qt internals when the task in on another thread. Of
course, this isn't awesome, but can wait until we improve our logging.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:41:59 -03:00
2dcff83be7 Merge pull request #1035 from Scrumplex/fix-coremods
Make Coremods / Mods seperation more clear
2022-08-20 10:15:50 -03:00
afb9ebcd99 fix: distinguish Coremods
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-20 12:53:13 +02:00
92d7e44525 Merge pull request #878 from flowln/lazy_settings 2022-08-20 12:50:56 +02:00
a517f442ea Merge pull request #1023 from flowln/better_shared_ptr 2022-08-20 12:50:50 +02:00
311758233b Merge pull request #1044 from flowln/better_orphan_fix 2022-08-20 12:50:43 +02:00
6e086eb808 Merge pull request #992 from Scrumplex/refactor-version 2022-08-20 12:50:25 +02:00
7e8644430c Merge pull request #1007 from Gingeh/disable-update-button 2022-08-20 12:50:19 +02:00
70a8f6743a Merge pull request #919 from kumquat-ir/download-all-blocked 2022-08-20 12:50:01 +02:00
69eafd0e11 Merge pull request #1058 from DioEgizio/fix-update-org.polymc.PolyMC.metainfo.xml.in 2022-08-19 20:34:11 +02:00
6b6a095b91 fix(COPYING): fix COPYING.md by adding some missing copyright notices
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-19 18:42:26 +02:00
d5a2185030 Merge pull request #1068 from TayouVR/improvedWindowsJavaCheck 2022-08-19 14:26:36 +02:00
26f31e9288 use qEnvironmentVariable instead of qgetenv in JavaUtils
Signed-off-by: Tayou <tayou@gmx.net>
2022-08-18 23:59:35 +02:00
e654e66839 Merge pull request #1049 from flowln/waiting_for_news_-_- 2022-08-18 22:53:41 +02:00
bb4861cf0d check for java installs in PATH on windows
this should find java installs from scoop as well as any other installer, that registers java in the PATH environment variable.

Signed-off-by: Tayou <tayou@gmx.net>
2022-08-18 18:24:32 +02:00
01505910f4 refactor: move classpath definition into NewLaunch itself
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-18 18:14:01 +02:00
ab766a0598 Merge pull request #968 from magneticflux-/utf8-logging
Decode process lines as UTF-8
2022-08-18 10:44:01 +02:00
51c664a678 fix: update org.polymc.PolyMC.metainfo.xml.in to not make flatpak break next release
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-15 20:34:56 +02:00
3c4b45c9e7 Use C locale codec for decoding
This should correctly decode multi-byte non-UTF-8 text, such as Windows-936 (Simplified Chinese)

Signed-off-by: Mitchell Skaggs <skaggsm333@gmail.com>
2022-08-13 10:39:05 -05:00
93507a263b fix: hide 'More news...' button if the news aren't loaded yet
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-12 17:41:11 -03:00
1175461030 refactor: switch to new versioning scheme
The new versioning system is based on the versioning system used by the
GNOME Foundation for the GNOME desktop.

We are dropping the "major version" as defined by SemVer and move to a
version number with a most and least significant number.

The most significant number must be incremented, if there are new
features or significant changes since last major release.

Otherwise, the least significant number must be incremented, if there
are only minor changes since the last release. New features or
significant changes mustn't be introduced by a bump of the least
significant number.

If a minor change would introduce small user-facing changes (like a
message-box or slight UI changes), it could still be classified as a
minor change.
At the end of the day, a human shall decide, if a change is minor or
significant, as there is no clear line that would separate a "minor" and
a "significant" change in a GUI-application.

Definitions:

feature: New user-facing functionality
significant change: Something that changes user-facing behavior
minor change: Something that fixes unexpected behavior

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-12 14:22:24 +02:00
2f5e55bea0 fix: only remove orphaned metadata on first opening
This avoids deleting the metadata while one is updating their mods.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-11 13:11:56 -03:00
c375e7b4df Merge pull request #897 from jamierocks/atl-updating-initial 2022-08-11 08:50:05 +02:00
5d188c69ed Merge pull request #1039 from budak7273/fix-world-safety-nag-title-text 2022-08-11 07:33:13 +02:00
6bff7751d0 Merge pull request #909 from txtsd/markdownlint 2022-08-11 07:33:04 +02:00
1a5986abe0 Merge pull request #920 from flowln/metacache_fix 2022-08-11 07:32:43 +02:00
cebac3c10e Make new title strings translatable
Signed-off-by: Robb <computerguy440+gh@gmail.com>
2022-08-10 12:07:24 -05:00
a5da3db966 Merge pull request #1018 from Scrumplex/fix-infinite-auth-loop 2022-08-10 18:14:26 +02:00
cd30f75173 fix: Make world safety nag title text match the action being performed instead of always saying 'Copy World'
Signed-off-by: Robb <computerguy440+gh@gmail.com>
2022-08-09 16:01:21 -05:00
94df4ceb36 Fix use of Qt 5.14 enum
Signed-off-by: Mitchell Skaggs <skaggsm333@gmail.com>
2022-08-09 00:17:53 -05:00
a14476c5fb Replace local 8-bit decoding with UTF-8 decoding
Handles incomplete byte sequences using `QTextDecoder`

Signed-off-by: Mitchell Skaggs <skaggsm333@gmail.com>
2022-08-08 23:54:01 -05:00
d82bb29919 fix: don't apply GameMode/MangoHud, if they aren't supported
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-08 21:19:46 +02:00
33af0c6a7c refactor: don't include mangohud's library path
This could cause issues on some environments. Users should just put
MangoHud libs into global LD_LIBRARY_PATH, just like with any other
library

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-08 21:16:37 +02:00
68f3f98bc3 feat: detect GameMode and MangoHud's presence
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-08 21:16:37 +02:00
f873cd5b1a refactor: store current capabilities
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-08 21:16:37 +02:00
fa8df286d9 chore(ci): Add markdownlint config to ignored paths
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:57 +05:30
76aa0c434a feat(markdown): Add markdownlint config
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:57 +05:30
78dc0cfdf3 chore(markdown): MD001 Heading levels should only increment by one level at a time
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:57 +05:30
9654728bfb chore(markdown): Align inline HTML correctly
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:57 +05:30
123d1864f4 chore(markdown): MD037 Spaces inside emphasis markers
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:57 +05:30
96a91e988d chore(markdown): MD010 Hard tabs
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:56 +05:30
19ecb1701e chore(markdown): MD031 Fenced code blocks should be surrounded by blank lines
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:56 +05:30
8085b2728d chore(markdown): MD032 Lists should be surrounded by blank lines
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:56 +05:30
56cad31a36 chore(markdown): MD034 Bare URL used
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 13:00:46 +05:30
3275bc4e93 chore(markdown): MD009 Trailing spaces
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:57:30 +05:30
8963378039 chore(markdown): MD007 Unordered list indentation
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:57:30 +05:30
c7d435bb7a chore(markdown): MD025 Multiple top-level headings in the same document
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:57:11 +05:30
06cc7e4ea0 chore(markdown): MD046 Code block style
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:55:11 +05:30
fba20e2cfb chore(markdown): MD040 Fenced code blocks should have a language specified
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:55:11 +05:30
358f080c76 chore(markdown): MD012 Multiple consecutive blank lines
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:55:11 +05:30
8cea57ff0f chore(markdown): MD022 Headings should be surrounded by blank lines
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-08-06 12:53:50 +05:30
7b27f200b1 fix: don't mutate QHash while iterating over it
Even though it was using a QMutableHashIterator, sometimes it didn't
work quite well, so this is a bit better.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-05 16:30:12 -03:00
f4b207220c fix: add some more nullptr checks / protection
die sigsegv 🔫

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-05 15:10:44 -03:00
d835e1d14e refactor: simplify smart pointers more
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-05 11:38:46 -03:00
75f92de8f8 Merge pull request #1017 from flowln/kill_orphan_metadata
Remove orphaned metadata to avoid problems with auto-updating instances
2022-08-04 12:57:20 -07:00
293c1deee5 Merge pull request #1014 from DioEgizio/downgrade-qt-macos
chore: downgrade to Qt 6.3.0 on macos
2022-08-04 12:56:55 -07:00
4dee05a967 Merge pull request #1006 from DioEgizio/appimage-ubuntu-moment
fix: work around ubuntu 22.04 openssl appimage issues by copying openssl libs
2022-08-04 12:56:38 -07:00
8d6414d74a Merge pull request #1019 from Scrumplex/fix-openbsd-root
Add root path detection on OpenBSD
2022-08-04 21:47:35 +02:00
362ecdb583 refactor+fix: use QSharedPointer for shared_qobject_ptr
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-04 15:33:51 -03:00
058b9f9272 Merge pull request #994 from Scrumplex/fix-winget-releaser
Fix WinGet releaser
2022-08-04 16:20:23 +01:00
355762aa30 fix: emit abort in LaunchController
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-04 10:07:36 +02:00
be4fb65470 fix: Add root path detection on OpenBSD
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-03 21:14:32 +02:00
4ed296bad4 fix: allow user to interrupt launch after 3 tries
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-03 20:38:40 +02:00
a8aa862919 Move large condition into a new lambda
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-08-03 16:39:30 +10:00
31ba1de53b fix: remove orphaned metadata to avoid problems with auto-updating insts
Just as my master has taught me. 🔫

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-02 16:15:39 -03:00
bca1fef2b2 chore: downgrade to Qt 6.3.0 on macos
seems to fix some emoji-related issues

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-02 10:59:54 +02:00
f33b31e048 Check for running instance when re-opening the mod folder page and when selecting mods
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-08-02 14:14:45 +10:00
0d10ebb7ca Update launcher/ui/pages/instance/ModFolderPage.h
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-08-02 12:50:25 +10:00
4a8abc948e fix: prevent segfault due to callbacks into deleted objects
Since network requests are, for the most part, asynchronous, there's a
chance a request only comes through after the request sender has already
been deleted.

This adds a global (read static) hash table relating models for the mod
downloader to their status (true = alive, false = destroyed). It is a
bit of a hack, but I couldn't come up with a better way of doing this.

To reproduce the issue before this commit: scroll really quickly through
CF mods, to trigger network requests for their versions and description.
Then, in the middle of it close the mod downloader. Sometimes this will
create a crash.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 18:34:15 -03:00
6fd3672618 Merge pull request #1012 from DioEgizio/patch-10
fix: remove iconfix from libraries/README.MD
2022-08-01 20:31:11 +02:00
abd090bd48 fix: remove iconfix from libraries/README.MD
someone forgor (💀) to remove it

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-01 20:21:19 +02:00
bd9140f1f3 Merge pull request #1008 from DioEgizio/qt-version-issue-template
chore: update issue template to ask about Qt version
2022-08-01 18:40:11 +02:00
9d78b2d259 Update .github/ISSUE_TEMPLATE/bug_report.yml
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-08-01 14:51:19 +02:00
9c9528838a chore: update issue template to ask about Qt version
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-01 14:40:55 +02:00
77b640b76b Disable "Check for Updates" and "Download Mods" while the game is running
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-08-01 20:56:05 +10:00
a8dfe98b1a Disable "Check for Updates" if all mods are removed
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-08-01 20:56:05 +10:00
cee41b87f7 fix(ui): force redraw of mod list when (de)selecting a mod
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:31 -03:00
7a95314e42 feat(ui): remember mod download dialog's geometry
Makes it consistent with other modal dialogs.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:31 -03:00
6aaf1f4f21 feat: lazy-load CF mod descriptions
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
368a0ddd44 feat: add mod descriptions to CF mods
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
0808a10b7b feat: cache mod versions
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
6f052baa94 refactor: use function cb instead of class cb in getVersions
I've discovered even more functional programming! :^)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
5bc67d3f6b feat: cache extra mod info (like links and body)
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
74c6c5cfbc refactor: use function cb instead of class cb in getModInfo
I've discovered functional programming :^)
This makes this route more fit for general use.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
158b7fd166 feat+refactor: clean up ProgressWidget and add progress indicatior to
mod downloader

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
c3f647dc96 feat: add (semi) instant searching in mod downloader
It has a delay of 350ms from the last typed character to search, in
order to cache small changes while typing.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:30 -03:00
5936c7b65c change: preserve search term across different mod providers
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
a8bcd85c93 feat+refactor: add shortcuts to mod downloader and clean up
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
127b558f95 change: change button names to be more user-friendly
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
6e9a27f40f feat: display the 'body' of a MR mod on the mod downloader
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
4a13dbe3bb feat: create delegate for project item views
This allows us to define custom painting for list view items. In
particular, this is applied to the mod downloader, in order to allow
displaying both the mod name and mod description, and settings their
effects (like bold or underline) independent of each other.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
0f61f5ba03 fix(ui): missing tr() in mod download dialog's title
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-01 07:33:29 -03:00
5f1efbeb67 fix: work around ubuntu 22.04 openssl appimage issues by copying openssl libs
terrible hack but it works™️

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-08-01 09:57:14 +02:00
9c105914f0 use BlockedModsDialog for ftb packs as well
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-31 15:05:47 -04:00
579582740e Merge remote-tracking branch 'origin/develop' into download-all-blocked
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-31 14:54:50 -04:00
b15544c163 Trash instances instead of deleting (when possible) (#549)
Squashed because of :pofat: commit history
2022-07-30 14:42:33 -03:00
94a63e3859 Merge pull request #941 from Scrumplex/bump-cxx-standard
Bump to C++17
2022-07-30 17:10:59 +01:00
842b7e6c39 use c11 instead
c17 dont work properly with lgtm's build system and c11 is already almost identical to c17 at least in gcc
2022-07-30 15:35:48 +01:00
22f5011451 fix(winget): strictly match non-Legacy setup
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-29 16:25:12 +02:00
74120fe1f3 Merge pull request #699 from Scrumplex/resolve-ftb-mods-cf 2022-07-28 09:43:39 +02:00
b4e8abd0ad feat: win32 enable dark titlebar for dark theme
Signed-off-by: DavidoTek <54072917+DavidoTek@users.noreply.github.com>
2022-07-26 23:25:17 +02:00
336f1f4f50 Merge pull request #974 from flowln/accounts_qt6
Fix adding multiple accounts in Qt6
2022-07-26 16:08:05 -03:00
1c256d8876 Merge pull request #958 from jopejoe1/readme 2022-07-27 00:16:35 +05:30
1ce0f0e7a5 fix: progress dialog going away even if the task was not aborted
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 20:33:33 +02:00
fbf1901d86 refactor: shuffle some things around to improve readability
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 20:33:33 +02:00
0382f33c46 fix(ui): pump events to show "Copying modpack files..." text
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 20:33:33 +02:00
13372f3f99 chore: clean up FTBPackInstallTask a bit and connect missing signals
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 20:33:33 +02:00
e741cb7f0a fix: add abort handlign in Flame's FileResolvingTask
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 20:33:33 +02:00
fb289c6b17 chore: add license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-26 20:33:29 +02:00
75a7ea55d4 feat: implement mod resolving for FTB
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-26 20:33:10 +02:00
86573a5ccd Merge pull request #961 from flowln/fix_resource_filter 2022-07-26 20:14:18 +02:00
6fe55a79f1 fix: use const qualifier for operator==() and allow other comparisons
This fixes an implicit behavior changed by C++17.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 15:11:56 -03:00
1a6cb9ee99 chore: add some debugging prints in AccountList
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-26 15:11:56 -03:00
a495d9eca5 chore: Normalize sentence in readme
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-07-26 22:00:40 +05:30
65a945f968 Merge pull request #956 from flowln/jar_mods_aa
Fix segmentation fault when using jar mods
2022-07-25 06:57:40 +01:00
a9e8ed5087 fix: pump events and do a queued start for concurrent tasks
Heavy workloads can consume a ton of time doing their stuff, and starve
the event loop out of events. This adds an event processing call after
every concurrent task has been completed, to decrease the event loop
stravation on such loads.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:54 -03:00
00520b6a0e feat: add hashing tasks to the sequential task in ModUpdateDialog
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:54 -03:00
e6f2a3893a refactor+feat: improve code separation in ensure metadata
... and avoid calculating the same hash multiple times

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:54 -03:00
24c034ff6a change(libs): use a 4MiB buffer by default in murmur2 hashing
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:54 -03:00
631a93bcd8 refactor: add a HashUtils place for hashing stuff
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:54 -03:00
b1763353ea feat: do incremental calculation of CF's hash
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:53 -03:00
f95bcf45ad feat(libs): add incremental version of murmurhash2 calculation
This does two passes for a given file, which is kinda slow, but I don't
know how else to get the size excluding the filtered ones :<

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:53 -03:00
15ec1abb6a feat: use QIODevice for calcuating the JAR hash on Modrinth
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:53 -03:00
cfda8dbb2b refactor: use QIODevice instead of a whole QByteArray for hash calc.
This allows Qt to do its thing and optimize the data gathering from the
JAR.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-24 17:46:53 -03:00
3aa2003951 fix: filter in external resource pages not working
For some reason, using setFilterFixedString() doesn't seem to update the
QRegularExpression object with a new value, instead leaving it empty. It
updates QRegExp just fine, so maybe that's an Qt bug? o.O

Anyway, using regex in the filter is kinda cool actually :D

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-23 23:50:56 -03:00
0e473f4570 Merge pull request #951 from flowln/performace_tab_fix
Hide the entire performance tab on the instance settings in non-Linux OSes
2022-07-23 18:31:04 -03:00
bfa824ee71 Fix broken url in readme
Signed-off-by: jopejoe1 <johannes@joens.email>
2022-07-23 23:22:39 +02:00
1157436a24 fix: sigsegv when trying to use jar mods
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-23 14:24:24 -03:00
4596e78df0 Merge pull request #952 from Scrumplex/fix-pre-post-launch
Fix variable substitution in pre launch/post exit hooks
2022-07-23 18:06:12 +01:00
813dfbd2d3 fix: hide the entire performance tab on instance settings in non-Linux
"just woke up after a major release has just been made" coding style

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-23 13:29:39 -03:00
ba7dfb360c fix: actually substitute variables in pre/post launch
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-23 17:51:58 +02:00
6aad750fe0 Merge pull request #893 from Scrumplex/refactor-env-handling 2022-07-23 14:08:10 +02:00
5e443ae347 fix(nix): change license to gpl3Only
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-23 14:00:11 +02:00
c65f5f7728 Merge pull request #877 from Scrumplex/refactor-offline-accounts 2022-07-23 13:54:36 +02:00
74b62727af Merge pull request #947 from flowln/unicode_uhh 2022-07-23 13:38:48 +02:00
2e94562f79 fix: treat accounts as offline, if auth servers are down
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-23 12:38:01 +02:00
061ea5648e Merge pull request #922 from DioEgizio/qt6-tarballs
feat(actions): package and deliver qt6 tarballs
2022-07-23 14:18:00 +05:30
439e7bbf4e change: unicode chars for folders and disabled mods in mod list
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-22 17:45:27 -03:00
0f1d51f866 Update .github/workflows/build.yml
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-22 22:11:53 +02:00
75cfaf0672 Merge pull request #938 from Scrumplex/fix-i18n3 2022-07-22 22:45:53 +05:30
ceaa732e5f Merge pull request #932 from Scrumplex/fix-nix 2022-07-22 22:43:57 +05:30
deb2a2bd14 Merge pull request #930 from TheOPtimal/develop 2022-07-22 22:43:00 +05:30
33853b6107 fix: use single-space unicode char for checkmark in mod list
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-22 11:48:08 -03:00
ab6e1b112b change(cache): use cache-specific http headers for their lifetime
This uses the 'Age', 'Cache-Control' and 'Expires' HTTP headers to more
accurately set up the cache lifetime, falling back to a static 1-week
time if they're not present in the response.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-21 19:19:24 -03:00
220e823c8d DCO Remediation Commit for Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
I, Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>, hereby add my Signed-off-by to this commit: 3746a2566d7b0f758a1de7a3f78cb88bd28bb1e5

Signed-off-by: Jacob Gogichaishvili <iakob.gogichaishvili@gmail.com>
2022-07-20 23:27:07 +04:00
c666c3e251 refactor!: bump to C++17 and C17
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-20 14:22:10 +02:00
9cc1773fa7 fix: move HTML code outside of translation
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-20 10:15:21 +02:00
e78c7af715 Merge pull request #936 from Scrumplex/fix-windows-crap-2 2022-07-20 10:07:10 +02:00
b96e76134a fix(nix): switch to LD_LIBRARY_PATH
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-19 18:09:48 +02:00
fd2b206997 fix: support LD_* for OpenBSD
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-19 18:07:58 +02:00
2d53c7c5b2 refactor: filter values in environment variables
Before this change, you had to specify custom LD_* variables using the
prefix GAME_LD_*. Now instead of dropping all LD_* variables by default,
we should just filter them and remove the values we *know* are from our
start script.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-19 18:07:58 +02:00
28ae5d710e fix: fix translations for mod updater
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-19 18:03:45 +02:00
7a13412ec7 feat(actions): package and deliver qt6 tarballs
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-07-19 17:07:34 +02:00
c86610b917 Merge pull request #934 from virchau13/fix-non-nixos-libraries
fix(nix): only load stdenv.cc.cc.lib on NixOS
2022-07-19 11:28:08 -03:00
502750492c Merge pull request #929 from flowln/dark_theme_dark_font 2022-07-19 11:17:40 +02:00
8fc1653b0c fix: fix Java Checker on Windows, again
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-19 11:12:11 +02:00
6841ebc31d fix(nix): only load stdenv.cc.cc.lib on NixOS
On non-NixOS, launching any external process from Minecraft (e.g.
clicking on links) will fail due to a conflict between the system
libraries and the Nix stdenv.cc.cc.lib. This works around that issue by
only loading stdenv.cc.cc.lib on NixOS.

Signed-off-by: Vir Chaudhury <virchau13@hexular.net>
2022-07-19 09:03:54 +08:00
8757281467 fix(nix): switch to PolyMC libnbtplusplus
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-18 20:34:36 +02:00
20b1723e78 merge origin/develop
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-18 14:05:23 -04:00
be78afeee5 qtcreator moment
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-18 14:03:06 -04:00
3746a2566d Add more Nix meta information 2022-07-18 21:47:26 +04:00
0cb47cf7d7 fix: dark placeholder text in dark background on dark theme
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-18 14:25:00 -03:00
dec81c4f27 Merge pull request #588 from flowln/mod_update
Implement mod updater (😎)
2022-07-18 12:40:25 -03:00
54b335711a fix: raw-pointers and leaks in ModFolderLoadTask
Co-authored-by: timoreo <contact@timoreo.fr>
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:56:23 -03:00
6bb8332b4b fix: bogus returns in EnsureMetadataTask
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:43:12 -03:00
de9e304236 fix: std::list -> QList
Qt6 removed Qlist::toStdList() 😭

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:45 -03:00
650af5eb64 change: use ModStatus as a simple member instead of a pointer
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
47bdcb6050 feat: make second metadata pass concurrent
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
58dc3e93d3 fix: clean up execWithTask in Progress Dialog
This prevents weird problems, such as dialogs being non-modal when they
should be!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
79b0a16f7a fix: try finding a good height for short changelogs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
2b65ee433f fix: changelogs with too much space between lines
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
001bbef9ee fix: don't use shared_ptr for a background task T_T
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
c4316e81e6 change: make Mod a QObject used as a pointer
Prevents problems when copying it around!

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
fac63541a4 fix: work around HoeDown bug(?) in changelog line breaks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
dfd6cb29be feat: improve changelog and sort updatable mods
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:44 -03:00
5f75e531e6 fix: handling around disabled mods
Don't update disabled mods to prevent mod duplication. Also, chop
filename in the metadata with a '.disabled'.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
a7648d60ce fix: don't require non-essential items in mod index
Also adds slug field.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
52c45c2d32 feat: add some mod api calls
- Get Project: Already existed but required a specific caller type. This
  is more general.
- Get Projects: A single call to multiple of the above

Both providers support these calls.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
fd6755c93f change: mod metadata improvements
- Use slug instead of name
- Keep temporary status before having local details

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
a53ee2e35c fix: mod parsing of 'String-fied' version (i.e. OpenBlocks)
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
4e6978ff6f feat: improve metadata gen. networking and performance
This makes the metadata generation code a lot messier and harder to use,
but there's not really much else that can be done about it while
preserving all it's capabilities :(

At least we now have speed

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
91a5c4bdcb feat: add metadata get/delete via mod id
This is, in many cases, more reliable than name comparisons, so it's
useful specially in cases where a mod changes name between versions

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
9a07ede615 fix: filter out opted-out mods in mod downloader
Maintains Pre-Updater behaviour

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:43 -03:00
dfab55112b feat: remove existing mod when updating/redownloading it
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
1709b47bb7 fix: don't double add mods in mod downloader/updater
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
2d10c246a8 feat: add update mods to the ui / mod model
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
6e2869834f feat: add mod update dialog
This subclasses the Review mods dialog to make a "Update review" one.
Also, all the necessary components built until now are put together in a
coherent unity that checks and generates metadata on-the-fly and checks for
mod updates, while giving and receiving feedback to the user.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
b8b71c7dd2 feat: add mod update check tasks
Those tasks take a list of mods and check on the mod providers for
updates. They assume that the mods have metadata already.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
c3f6c3dd82 feat: add changelog to mod providers
The Modrinth changelog is fairly straight-forward, as it's given to us
directly with the API call we already did. Flame, on the other hand,
requires us to do another call to get the changelog, so it can introduce
quite a heavy performance impact. This way, we make it optional to get
such changelog.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
844b245776 feat: add EnsureMetadataTask
This task is responsible for checking if the mod has metadata for a
specific provider, and create it if it doesn't.

In the context of the mod updater, this is not the best architecture,
since we do a single task for each mod. However, this way of structuring
it allows us to use it later on in more diverse scenarios.

This way we decouple this task from the mod updater, trading off some performance
(though that will be mitigated when we have a way of running arbitrary tasks
concurrently).

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
4bcf8e6975 feat: add api call to flame
Call added:
- Get Fingerprints Matches
- Get Mod File Changelog

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:42 -03:00
0e52112016 feat: add some api calls to modrinth
Calls added:
- Get version from hash
- Get versions from hashes
- Latest version of a project from a hash, loader(s), and game version(s)
- Latest versions of multiple project from hashes, loader(s), and game version(s)

Some of those are not used yet, but may be of use later on, so we have
it if we need it :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
32a9545360 libs: add murmur2 library
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
9a44c92211 feat: add MultipleOptionsTask
This is a variation of a Sequential Task, in which a subtask failing
will prompt the next one to execute, and a subtask being successful will
stop the task.

This way, this can be used for easily managing fallbacks with tasks. :D

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
dd6aabf9ab feat: add ChooseProviderDialog
Allows you to prompt the user for choosing a (mod) provider. This should
be fairly independent of the mod updater logic, so it can be used for
other ends later down the road :^)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
91776311c7 fix: allow aborting upload tasks
This maintains the same behaviour as the Download task.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
882c82f82c fix: always update global progress of sequential tasks
Previously, it would not update the global counter if the subTask didn't
update its progress, even though progress was being made.

This also prevents a segmentation fault while aborting the task.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
43b9db6e45 change: allow deleting mods while preserving their metadata
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
032ceefa1d feat: add some helping methods to WideBar
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:41 -03:00
05fa266e6b fix: provide default value to is_indexed in ModDownloadTask
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17 11:33:40 -03:00
56085310cb Merge pull request #913 from Gingeh/cape-without-skin 2022-07-17 09:57:03 +02:00
6a1d611fd1 Restore ScrollMessageBox
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-17 02:40:27 -04:00
c8a72c876d fix: add missing HttpMetaCache entry for CF mods
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-16 21:25:29 -03:00
ec87a8ddfc fix: add expiration time to cache entries
This is to prevent problems where the cache entry would still be used
way after the remote resource got updated. The limit is hardcoded for 1
week, which I think is a reasonable time, but this could be further
tweaked.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-16 21:25:28 -03:00
33e34ebb83 Add "Open All" button to blocked mods dialog
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
2022-07-16 19:14:54 -04:00
dce435c882 Merge pull request #917 from Scrumplex/fix-translations-2 2022-07-16 22:27:03 +02:00
396b3c3952 fix: add missing full-stop to message
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-16 21:26:23 +02:00
8cf42f4e15 Merge pull request #902 from Scrumplex/fix-unicode-windows 2022-07-16 21:15:55 +02:00
17ea51ce27 fix: fix memory leak on Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-16 20:08:08 +02:00
04818ca626 Merge pull request #914 from DioEgizio/cacheqt 2022-07-16 00:42:44 +05:30
6732b77594 chore(actions): Remove superfluous whitespace
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-07-15 22:40:12 +05:30
3e4346e321 feat(actions): bring back qt caching
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-07-15 10:02:11 +02:00
4dfc01899a Make skin upload optional
Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
2022-07-15 12:23:11 +10:00
b0b8ccfd4a Merge pull request #911 from Scrumplex/fix-release-workflow-2 2022-07-14 07:59:34 +02:00
4d35c66af3 fix(actions): fix release workflow
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-13 22:47:55 +02:00
509f7bd018 fix: move time record overrides to BaseInstance
This is needed so that we can show time stats in the UI without having
to load all type-specific settings, which would make all the previous
changes useless :c

This is apparently done with console settings too, so I don't think
there's a problem doing this too :>

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-12 21:15:59 -03:00
42b9b3d72a Merge pull request #905 from DioEgizio/fix-copying 2022-07-12 19:19:09 +05:30
e280f9fe3e chore(COPYING): update COPYING.MD a bit
Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-07-12 15:20:26 +02:00
89493a2f1d Merge pull request #904 from virchau13/add-stdenv-lib
fix(nix): add stdenv.cc.cc.lib to GAME_LIBRARY_PATH
2022-07-12 07:47:06 -03:00
e259bffca6 Merge pull request #810 from Scrumplex/refactor-launcher-version
Hide channel from version for tagged commits
2022-07-12 07:46:46 -03:00
ba9164022d fix(nix): add stdenv.cc.cc.lib to GAME_LIBRARY_PATH
Some mods (like DiscordRichPresence) require libstdc++.
This commit adds stdenv.cc.cc.lib to $GAME_LIBRARY_PATH so that these
mods function correctly.

Signed-off-by: Vir Chaudhury <virchau13@hexular.net>
2022-07-12 05:16:32 +08:00
a4672ba00f fix: remove unnecessary code for Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-11 19:09:20 +02:00
c0bf267bae fix: fix unicode issue with JavaChecker on Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-11 18:53:20 +02:00
1a26a53659 Merge pull request #901 from txtsd/scdoc 2022-07-11 14:56:19 +02:00
8f4d7ac655 Merge pull request #678 from Scrumplex/improvements-around-proprietary-services 2022-07-11 14:56:09 +02:00
c5625d8d32 Merge pull request #847 from EliteTK/switch-to-scdoc 2022-07-11 14:47:44 +02:00
548a2a1d64 Merge pull request #900 from DioEgizio/CI/fix
fix(actions): fix ccache on windows
2022-07-11 08:02:27 -03:00
df01a58099 feat(ci): Install scdoc to build manpage
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-07-11 14:30:46 +05:30
ac8ee9f981 Merge pull request #479 from kthchew/feature/sparkle-mac 2022-07-11 09:02:41 +02:00
b1805b70ea fix(actions): fix ccache on windows
Also removes some unnecessary dependencies for the generic Linux package

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-07-11 08:13:02 +02:00
eae8a2914e Remove use of obsolete method
Fixes Qt 6 build

Signed-off-by: Kenneth Chew <kenneth.c0@protonmail.com>
2022-07-10 19:09:58 -04:00
03429db528 Switch to production Sparkle appcast
DCO Remediation Commit for Kenneth Chew <kenneth.c0@protonmail.com>

I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: 92b913ca3740ea1aa799a69d65dc13d0c3612b87
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: 7eb61a28be3b66c1016eab434ae93b5d94eb11af
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: ea4ef1655bdadf04c36768f0f641ca7579f754cf
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: b5bdfa6c2e9a0eb62e476dd399b82bfa972e0320
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: f9f46609ee288d8df80dd978f8c619a7e02e4787
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: 34adcec6165662d6245a55ee0a75c36753061df2
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: 05cd30ac06b67ebc594773fc7e7ccf110fc336a3
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: f3c72f4f0888aa16793354890055e17df07084fc
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: b1f486518e3db19cca8ea9f33eb1d8d1afa247e7
I, Kenneth Chew <kenneth.c0@protonmail.com>, hereby add my Signed-off-by to this commit: 3bc02b9662b84c2ab86b5de1b08b4537177fde90

Signed-off-by: Kenneth Chew <kenneth.c0@protonmail.com>
2022-07-10 18:51:52 -04:00
10f27250ee DCO Remediation Commit for bf560f4
I, Jamie Mansfield <jmansfield@cadixdev.org>, hereby add my
Signed-off-by to this commit: bf560f4594e4c17b493725f1ac98f0becfff5c2e

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-07-10 19:14:05 +01:00
aed7963d11 DCO Remediation Commit for a7fc23d
I, Jamie Mansfield <jmansfield@cadixdev.org>, hereby add my
Signed-off-by to this commit: a7fc23dd96981b1bc2449b5bf32f1913b45ecbc8

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-07-10 19:13:34 +01:00
2810413112 DCO Remediation Commit for 9e69b8f
I, Jamie Mansfield <jmansfield@cadixdev.org>, hereby add my
Signed-off-by to this commit: 9e69b8fe1bf8b325f6c386b7578408da4b775177

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-07-10 19:12:57 +01:00
31fd92e071 DCO Remediation Commit for e0ae631
I, Jamie Mansfield <jmansfield@cadixdev.org>, hereby add my
Signed-off-by to this commit: e0ae631d59103cd32d758dec76e55b3a40b86be2

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-07-10 19:12:08 +01:00
b3b76d5d56 Merge branch 'develop' into feature/sparkle-mac
# Conflicts:
#	.github/workflows/build.yml
2022-07-10 19:38:30 +02:00
cd948dceae Merge pull request #575 from Scrumplex/qt6 2022-07-10 19:21:01 +02:00
eb33a87ff5 fix: remove TODOs
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 18:11:13 +02:00
bf560f4594 ATLauncher: Move the UI support implementation into it's own class
This will allow it to be used in multiple locations.
2022-07-10 11:27:42 +01:00
d77237ca5d refactor(actions): rename Windows builds
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
211d596fdd refactor(actions): switch to system QuaZip on Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
f464b347b2 fix: install TLS plugins for release builds
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
203c3ec233 refactor(actions): speed up package installations for Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
e2a74dfc30 feat(actions): enable Windows-i686 Qt 6 builds
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
4e99da7b62 refactor: query Qt variables using ECM
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
eb5ed50824 fix: set UNICODE and _UNICODE for Qt 5 builds
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
3b4539de79 chore: update license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
3e4d1c04de fix: include TLS plugins in bundle
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
fdf5748029 feat(actions): use Qt 6 on macOS and AppImage
Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
3562e94650 Revert "fix: ignore deprecation again"
We want to see deprecation warnings now

This reverts commit 47d0da2d96bc375410f5d494ac9371d47adf33d5.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
15c5bbcf22 fix: fix slots for Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
c363423718 refactor: fix deprecation up to Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:15 +02:00
e58158c3cd feat: add Qt 6 support to CMake
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:19:14 +02:00
ff2cd50bfa refactor: replace QRegExp with QRegularExpression
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:17:52 +02:00
984692dc62 refactor: fix deprecation up to Qt 5.15
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10 12:17:52 +02:00
a7fc23dd96 ATLauncher: Reset existing directory if required 2022-07-10 11:15:48 +01:00
c1bcbf8c63 Merge pull request #880 from Scrumplex/fix-loader-importance
Make loader components not important
2022-07-10 15:44:17 +05:30
9e69b8fe1b ATLauncher: Parse keeps and deletes from pack manifests 2022-07-10 11:05:11 +01:00
e0ae631d59 ATLauncher: Add modes to install task and display appropriate message
This will display the update/reinstall message for the installation
method currently in use..
2022-07-10 10:55:05 +01:00
3b187b5246 Merge pull request #876 from Scrumplex/revert-updater-stuff
Revert "fix: remove updater if it is not used"
2022-07-10 10:50:03 +02:00
20666763f0 Rewrite polymc.6 in scdoc, build, and install it
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Tomasz Kramkowski <tomasz@kramkow.ski>
2022-07-09 23:25:09 +01:00
f591c87665 Merge pull request #851 from russellbanks/patch-1 2022-07-09 01:16:07 +02:00
e6fe701727 Merge pull request #808 from Scrumplex/fix-lgtm-warnings 2022-07-09 01:10:59 +02:00
35a698ef72 Merge pull request #884 from jopejoe1/ftbuifixed
Updated FTB Classic layout
2022-07-08 16:19:14 -03:00
998271414e Merge pull request #890 from Scrumplex/fix-technic-forge
Fix Technic instances using Forge
2022-07-08 16:18:59 -03:00
1749f25420 Merge pull request #881 from gytis-ivaskevicius/develop 2022-07-08 17:29:12 +02:00
4ab0e70a9a fix(technic): map loader libraries to components properly
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 17:28:06 +02:00
08989bde5e Merge pull request #839 from flowln/modrinth_packs_bug_hunt 2022-07-08 16:25:35 +02:00
87cbff391c fix: disable MSA login if it is NOT supported
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
962923bbce chore: add missing license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
311b081e60 feat: add validation for Flame key and MSA client ID
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
4103948132 feat: track capabilities of application
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
906f26698b fix: spelling of CF
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
8a1a583afe refactor: rename references to CurseForge to Flame
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-08 16:25:03 +02:00
9e19b73ce6 Updated FTB Classic layout
Signed-off-by: jopejoe1 <johannes@joens.email>
2022-07-07 23:18:13 +02:00
e11706d99d Cleanup flake.nix
Signed-off-by: Gytis Ivaskevicius <me@gytis.io>
2022-07-07 19:25:14 +03:00
301b811310 fix: make loader components not important
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-07 09:58:03 +02:00
273cf3d565 feat: lazy-load MinecraftInstance settings
Makes the startup go fast!

vrum

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-06 17:17:54 -03:00
f432cfd73a change: put settings initialization in a separate function
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-06 16:18:09 -03:00
ffa756ccee fix: remove tests for updater
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-06 18:13:51 +02:00
e210a4b244 Revert "fix: remove updater if it is not used"
This reverts commit 2ff0aa09e35eb6910ef0a030ea41f84a1ed95782.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-06 18:13:51 +02:00
f1902a4471 Merge pull request #794 from Scrumplex/resolve-jars-dynamically 2022-07-06 17:40:09 +02:00
04b865adae Merge pull request #707 from Jan200101/PR/gamemode
Add Performance related settings
2022-07-06 17:11:43 +02:00
00df092a99 chore(readme): Reword and place entry in alphabetical order
Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
2022-07-06 09:34:17 +02:00
cad581388f Add Performance related settings
Integrates support for Feral Gamemode, discrete GPU support for Mesa and the proprietary Nvidia driver and MangoHud support

Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
2022-07-06 09:34:14 +02:00
e7ed3abb79 Merge pull request #871 from Scrumplex/configure-dco 2022-07-03 18:16:25 +02:00
e5f6dc1b14 fix: aborts when using a Qt build with assertions enabled
Preventing undefined behaviour hooray! :D

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:44:19 -03:00
145da82cd8 fix: show invalid version even when there's none
Having a blank instead of _anything_ is bad UX. Instead, even when
there's not a valid version (most likely disabled redistribution), we
show a message in the UI, to differentiate from the loading state.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:05 -03:00
64776d6bac feat+fix: cache Flame modpack versions
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:05 -03:00
64d123f524 fix: use better naming for Modrinth pack versions
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:04 -03:00
0ec4ade683 feat+fix: cache versions and extra info in Modrinth packs
When you change a copy thinking you're changing the original data smh

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:04 -03:00
4bfc445cf8 fix: add progress indicator on Flame mod resolution dialog
This code is super :pofat: omg

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:04 -03:00
4232b1cedb fix: don't use uniform sizes in Modrinth modpack viewer
Apparently, when Qt sees an icon with the height smaller than the rest,
with this option set, it will change the height of all other items to be
that one, causing #828.

While we do lose some performance changing this option, the issue is
gone, so :|

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-03 12:43:00 -03:00
474d77ac57 feat: resolve JARs dynamically
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:31:01 +02:00
3c40355d7c chore(DCO): allow remediation
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:28:01 +02:00
cbc1aad58d fix: don't assume stable channel, if tag is unset
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:23:13 +02:00
89a30a47c5 fix: use semver format for build tag
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:23:13 +02:00
881a5603dc feat: hide channel if git tag is set
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:23:13 +02:00
68c48b2c8a feat: store git tag in buildconfig
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:23:13 +02:00
0f9260869b chore: update Git CMake module
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 17:23:13 +02:00
412fdb0f7b Merge pull request #870 from Scrumplex/fix-release-build
Fix release builds
2022-07-04 00:25:03 +10:00
81d52b6169 Merge pull request #869 from DarkKirb/nix-ecm
fix: Add extra-cmake-modules to the nix build
2022-07-03 11:07:11 -03:00
278d2169da fix: initialize accountIsOnline to fix build
CMAKE_BUILD_TYPE=Release makes the build fail otherwise.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03 14:32:31 +02:00
5599b5a337 Merge pull request #855 from Gingeh/account-list 2022-07-03 12:55:36 +02:00
471d6d6031 fix: Add extra-cmake-modules to the nix build
Signed-off-by: Charlotte 🦝 Delenk <lotte@chir.rs>
2022-07-03 10:30:45 +01:00
b90d6b0f26 Merge pull request #857 from Scrumplex/dco
Add Developer's Certificate of Origin (DCO)
2022-07-03 16:23:25 +10:00
cd22da9c62 Merge pull request #864 from ivanpu/uncensored-offline
Don't censor "offline" word when that's the access token
2022-07-02 17:56:04 -03:00
fb75c23f4e Merge pull request #784 from Scrumplex/refactor-cmake
Refactor tests
2022-07-02 17:50:08 -03:00
7f22994f68 Merge pull request #831 from flowln/abort_connections
Add missing connections to the abort signal in some tasks
2022-07-03 01:50:36 +10:00
7aba7b6064 Merge pull request #818 from flowln/tiny_mod_icons
Always scale mod icons to the right size
2022-07-03 01:49:09 +10:00
e32030f364 Merge pull request #860 from kthchew/fix/status-version
Show MC version of instance in status bar
2022-07-03 01:47:27 +10:00
b40619bcbd don't censor offline access token 2022-07-02 18:05:33 +03:00
fe2e1d931f Merge pull request #786 from flowln/concurrent_tasks_slimmed 2022-07-01 20:09:18 +02:00
2e17e78052 Merge pull request #845 from flowln/news_in_launcher 2022-07-01 20:04:06 +02:00
f2fa82fd3c Merge pull request #863 from Scrumplex/fix-braindead-moment
update NewLaunch package name
2022-07-01 19:55:01 +02:00
8cec4b60a6 fix: update NewLaunch package name 2022-07-01 19:50:41 +02:00
bf9888099c Merge pull request #800 from Scrumplex/refactor-newlaunch-package
Rename NewLaunch package
2022-07-01 10:05:07 -03:00
02201631e7 feat: use ConcurrentTask for mod downloads
Way faster :)

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-01 08:34:17 -03:00
8e80b4bfc1 feat: add ConcurrentTask
This tasks (or rather, meta-task) has the ability to run several other
sub tasks concurrently.

Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-01 08:34:10 -03:00
63dfc0633f Merge pull request #652 from flowln/mod_page 2022-07-01 10:00:36 +02:00
50f1847904 Merge pull request #785 from icelimetea/reformat-javacheck 2022-07-01 10:00:08 +02:00
79840f0fca Remove redundant type name from status bar
The type name is always "Minecraft", so it showed "Minecraft X.X.X (Minecraft)"
2022-06-30 23:02:56 -04:00
06bf7b0f31 Fix Minecraft version not appearing in status bar 2022-06-30 23:02:56 -04:00
dbb63b97bd Merge branch 'PolyMC:develop' into account-list 2022-07-01 10:43:41 +10:00
3039cb5c02 chore: add DCO requirement
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-30 16:37:13 +02:00
b5d2570fe2 Change Online status to Ready 2022-06-30 22:17:15 +10:00
5f951e8f21 change: better regex for removing 'The' when sorting mods
Teh :|

Co-authored-by: timoreo22 <timo.oreo34@gmail.com>
2022-06-30 07:04:47 -03:00
286f82cc99 Merge pull request #826 from kthchew/fix/kill-menubar 2022-06-30 11:50:43 +02:00
ed5415aeb8 Merge pull request #837 from DioEgizio/fix-sort-mr 2022-06-30 08:24:51 +02:00
bef79df6bb Disable the refresh button for offline accounts 2022-06-30 09:08:53 +10:00
2edabe0f99 Merge remote-tracking branch 'origin/account-list' into account-list
# Conflicts:
#	launcher/minecraft/auth/AccountData.cpp
2022-06-30 09:00:21 +10:00
91b5f0228d add tr() to offline account name
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-06-30 08:59:41 +10:00
d639da741b add tr() to offline account name
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-06-30 08:49:40 +10:00
84bd5ace6c Move account checkboxes to the profile column (oops) 2022-06-29 19:58:41 +10:00
63589d2ba9 Rename profile column to username and update the tooltip 2022-06-29 18:49:06 +10:00
d6f4ff26b5 Disable skin buttons for offline accounts 2022-06-29 18:46:39 +10:00
b606a2e040 Make the profile and account name columns use all available space 2022-06-29 18:45:36 +10:00
f685139d89 Move the profile name column to the left 2022-06-29 18:43:29 +10:00
68d6ce60a9 Don't show account name for offline accounts 2022-06-29 18:42:01 +10:00
2bba64fe3a Create winget.yml 2022-06-28 12:11:52 +01:00
774ed044fc Merge pull request #827 from kthchew/fix/menubar-separator
Workaround Qt bug to fix menu bar separators on macOS
2022-06-27 01:14:15 +10:00
9cc235cde0 Merge pull request #811 from jn64/fix/window-title
Fix duplicate name in window title
2022-06-27 01:13:58 +10:00
91375e4c6d Merge pull request #834 from DioEgizio/reword-flame-warning
chore(flame): reword warning
2022-06-27 01:12:18 +10:00
0ef8da64e0 Merge pull request #724 from Zetvue/patch-1
* Resize PolyMC logo

Co-authored-by: Tatsuya Noda <topia@clovery.jp>
2022-06-26 08:31:18 -03:00
9ef38171e2 fix: use clicked instead of pressed signal for button clicks
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-26 08:10:52 -03:00
455e4de6f3 feat: add news reader dialog
Makes it easier to read about new blog posts! Yay :D
2022-06-25 20:15:16 -03:00
4e319254dd fix: use right name for the content of a News entry 2022-06-25 20:14:27 -03:00
04e8780dd0 fix(modrinth): fix sorting 2022-06-24 10:47:02 +02:00
0fe4384067 Update launcher/ui/pages/modplatform/flame/FlamePage.ui
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-23 17:58:54 +02:00
bdfcd0b99e chore(flame): reword warning 2022-06-23 17:06:49 +02:00
5da87d1904 fix: add missing connections to the abort signal
Beginning with efa3fbff39bf0dabebdf1c6330090ee320895a4d, we separated
the failing and the aborting signals, as they can mean different
things in certain contexts. Still, some places are not yet changed to
reflect this modification. This can cause aborting of progress dialogs
to not work, instead making the application hang in an unusable satte.

This goes through some places where it's not hooked up yet, fixing their
behaviour in those kinds of situation.
2022-06-22 20:20:39 -03:00
821edf0f51 Merge pull request #830 from Scrumplex/fix-launchermeta
Replace old reference to launchermeta
2022-06-22 18:12:20 -03:00
04e822acfb fix: remove old reference to launchermeta 2022-06-22 20:47:47 +02:00
c31fce3621 Workaround Qt bug to fix menu bar separators on macOS 2022-06-22 00:34:04 -04:00
5c05cf2206 Disable launch actions in menu bar when last instance is deleted
This caused a crash when the action was selected!
2022-06-21 19:19:55 -04:00
d4e544c62c Separate the kill and launch instance actions 2022-06-21 19:19:55 -04:00
d232248268 Merge pull request #807 from Scrumplex/lgtm-config
Add LGTM config
2022-06-22 01:14:08 +10:00
90025ed45d Merge pull request #812 from jn64/fix/about-labels
Make version labels in About dialog selectable
2022-06-22 01:13:43 +10:00
964151d9c7 Merge pull request #817 from flowln/zip_ensure_path
Don't create unnecessary folders when extracting ZIPs
2022-06-22 01:13:23 +10:00
409c9bf9d2 Merge pull request #778 from Scrumplex/track-real-architecture
Track real CPU architecture for instances
2022-06-22 01:13:10 +10:00
a135c06bcf fix: scale mod icons to the right size 2022-06-21 06:41:56 -03:00
efb1f4abf2 Merge pull request #797 from kthchew/fix/update-shortcut 2022-06-21 11:29:15 +02:00
036a826b3a Merge pull request #788 from kthchew/fix/win-install-version 2022-06-21 11:29:06 +02:00
8d2b66a0fd Merge pull request #715 from Heath123/patch-1 2022-06-21 11:18:37 +02:00
31d6278b31 Merge pull request #729 from OldWorldOrdr/develop
Update bug_report.yml to use latest version as the version suggestion
2022-06-21 01:12:04 +10:00
5558d7eef8 Update bug_report.yml 2022-06-20 11:03:22 -04:00
6103d86a47 Merge branch 'PolyMC:develop' into develop 2022-06-20 11:02:40 -04:00
b8899a534d Merge pull request #633 from Scrumplex/chore-remove-unused-workflows
Remove unused GH Workflows
2022-06-20 11:42:53 -03:00
fa6829a6a1 Set beam cursor on selectable labels 2022-06-20 14:28:38 +08:00
5335540c33 Rename main window 2022-06-20 13:45:36 +08:00
7f62de3854 fix: don't create unnecessary folders when extracting ZIPs 2022-06-19 22:03:02 -03:00
0afa2e92d5 Make GitHub link focusable by keyboard 2022-06-18 22:20:38 +08:00
6d1b166ad7 Make labels selectable
User can copy version/build info easily.
2022-06-18 22:19:23 +08:00
4b6ddfb89b Add version to Qt applicationDisplayName 2022-06-18 20:00:28 +08:00
9ec260619b fix: fix warnings reported by LGTM.com 2022-06-17 16:34:32 +02:00
4c6ac9e4fe chore: add LGTM config 2022-06-17 16:24:06 +02:00
08fc3ea2e0 fix: add classpath exception to launcher library
Signed-off-by: icelimetea <fr3shtea@outlook.com>
2022-06-16 17:58:38 +02:00
03e454b71d Merge pull request #694 from Technous285/develop-1
Add OpenBSD support
2022-06-15 06:32:14 -03:00
c527ea83fb Merge pull request #799 from DioEgizio/fix-oopsie
fix websiteurl in cf modpacks (part 2)
2022-06-15 06:28:09 -03:00
8b9ac63657 chore: update COPYING.md 2022-06-15 10:15:35 +02:00
0ba02f0830 refactor: rename NewLaunch package 2022-06-15 10:05:35 +02:00
1f6cef6f8a fix https://github.com/PolyMC/PolyMC/issues/798 2022-06-15 09:11:23 +02:00
251942323e Deselect desktop shortcut by default
Follows the guidelines at https://docs.microsoft.com/en-us/windows/win32/uxguide/winenv-desktop
2022-06-15 00:46:34 -04:00
8e3efec40f Unselect shortcut installation by default if PolyMC is already installed
This is the same behavior as the `/NoShortcuts` switch.
2022-06-15 00:41:52 -04:00
3d0740f80e fix(cmake): allow disabling tests 2022-06-14 21:42:44 +02:00
707a68cb4f Merge pull request #787 from DioEgizio/macos-12-gha
update macos runner to macos 12
2022-06-14 23:30:41 +05:30
e6b1a1fa76 Merge pull request #716 from flowln/mod_perma_2
Hide index folder on Windows
2022-06-14 23:58:35 +10:00
3e8d450741 Merge pull request #665 from jamierocks/h-managed-packs
PackPlatforms: Record where packs come from
2022-06-14 23:54:44 +10:00
d0881b7420 Merge pull request #731 from Scrumplex/update-readme-macstadium
Add sponsors to README
2022-06-14 23:52:38 +10:00
27239b2dde Merge pull request #634 from flowln/donate_links
More links for CF / Modrinth mods / modpacks
2022-06-14 23:52:00 +10:00
3fbbaddece fix(actions): install extra-cmake-modules 2022-06-14 14:44:49 +02:00
effe46db86 refactor: move away from UnitTest.cmake 2022-06-14 14:44:49 +02:00
ba939c92ec feat(actions): test before packaging 2022-06-14 14:44:49 +02:00
e25cdd9d12 refector: move download action to ExternalResourcesPage 2022-06-14 07:04:31 -03:00
d394235ee0 refactor: Create a more clear hierarchy for some instance pages
Previously, the Shaders, Texture packs and Resource packs tabs had as
parent the ModFolderPage, making it so that making changes only to the
Mods page would require checking the id of the page for the correct one.
This was hackish and error-prone.

Now, those pages all inherit from a single class, ExternalResourcesPage,
that handles the basic behaviour of all of them, while allowing for
individual modification in code.

This is still not a clear separation, since internally, all those
resources are derived from Mods, so for now there's still some awkward
common code :/
2022-06-14 07:04:31 -03:00
349fc4143d Merge pull request #714 from Scrumplex/fix-tests
Fix mod metadata tests
2022-06-13 23:10:35 +02:00
4be9e6a0bc refactor: make is_indexed false by default
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-06-13 22:07:42 +02:00
cb258146c4 Merge pull request #782 from Scrumplex/chore-bump-1.4.0 2022-06-13 22:05:40 +02:00
9f039cef72 Set correct installer properties and uninstall registry keys 2022-06-12 14:21:56 -04:00
d08815bbc1 Merge pull request #759 from flowln/mod_perma_3 2022-06-12 19:17:08 +02:00
c04e38d011 update macos runner to macos 12 2022-06-12 19:13:19 +02:00
794022d399 Merge pull request #783 from Scrumplex/fix-avoid-settings-register-warnings
Avoid re-registering InstanceType
2022-06-12 13:46:46 -03:00
8e43190984 Compile JavaCheck for Java 7 2022-06-12 17:46:40 +01:00
2212a6e40f Merge pull request #679 from kthchew/fix/win-install-version 2022-06-12 18:12:42 +02:00
63b69c0b0c Change formatting of JavaCheck 2022-06-12 16:29:39 +01:00
278219b1d8 fix(installer): use Windows version number format 2022-06-12 16:24:05 +02:00
2ce4ce9064 fix(installer): add version info to installer 2022-06-12 14:52:54 +02:00
4448418b63 fix: segfault when the same mod is present enabled and disabled at once
This maintains the previous behaviour
2022-06-12 09:44:03 -03:00
9f1f37e780 fix: correctly handle disabled mods with metadata
im stupid
2022-06-12 09:25:25 -03:00
40ccd1a469 fix: handling of incomplete mods
(i.e. mods without ModDetails that may have metadata)
2022-06-12 09:25:21 -03:00
a4ef0940ed chore: add license headers 2022-06-12 13:50:58 +02:00
2ff0aa09e3 fix: remove updater if it is not used 2022-06-12 13:39:47 +02:00
32217a774f fix(tests): wait until ModFolderModel has updated 2022-06-12 13:33:17 +02:00
8856c8cd62 refactor(test): fix loading mod metadata setting 2022-06-12 13:33:17 +02:00
e843b8e188 fix(test): fix packwiz test 2022-06-12 13:33:17 +02:00
c4f2e3a955 Merge pull request #771 from flowln/modrinth_multiple_downloads 2022-06-12 10:50:57 +02:00
91301ec7fe Merge pull request #632 from ryanccn/macos-app-heuristic 2022-06-12 10:46:49 +02:00
13b03e7e50 Update Application.cpp 2022-06-12 11:44:04 +08:00
8a0aa5a0c8 fix: avoid re-registering InstanceType 2022-06-11 23:06:42 +02:00
2bd8e7dca4 Merge pull request #780 from flowln/guo_ext_2 2022-06-11 19:45:51 +02:00
d75571ffa1 Merge pull request #773 from vancez/fix-launch-button 2022-06-11 19:41:02 +02:00
8683d529fc chore: bump version 2022-06-11 19:35:40 +02:00
2ee4b6768d Merge pull request #770 from flowln/technic_links 2022-06-11 19:34:59 +02:00
a9f0a85590 Merge pull request #764 from Scrumplex/fix-compile-flags 2022-06-11 19:34:01 +02:00
37160f973f fix: account for the dequeued url when checking the number of urls
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-11 14:31:50 -03:00
9bbf50e864 Merge pull request #720 from icelimetea/fix-legacy-issues 2022-06-11 19:29:59 +02:00
51258ab28c Merge pull request #709 from Scrumplex/fix-instancetypes
Always store InstanceType
2022-06-11 19:29:46 +02:00
29e5a213a5 fix: dequeue first added file in mrpack import
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-11 14:19:51 -03:00
2d261607df Merge pull request #732 from MrMelon54/develop 2022-06-11 19:14:26 +02:00
54144154f9 fix: apply client overrides in mrpacks
another oopsie x.x
2022-06-11 13:44:31 -03:00
81daffe68e fix: remove file filter from translation 2022-06-11 14:10:42 +02:00
2ea20a8b29 fix: allow discovering mrpacks in languages without dot 2022-06-11 07:12:59 -03:00
2257c875f5 Merge pull request #708 from ryanccn/custom-user-agent 2022-06-11 10:53:58 +02:00
8a2e8ad953 feat: track real CPU architecture for instances 2022-06-11 10:48:58 +02:00
fa5b1d9978 change slot name 2022-06-10 15:48:18 +08:00
529fb07b42 I changed my mind 2022-06-10 15:18:47 +08:00
4a261cac1a fix: update toolbar when instance state changes 2022-06-10 10:25:13 +08:00
b3c8f9d508 revert: don't check modrinth whitelisted hosts
people didn't seem to like it, and its not required
2022-06-09 19:57:51 -03:00
1b878030aa fix: enable using more than one download url in mrpacks
Kinda, it's ugly and hackish, since we don't have the facilities to
do this properly (yet!)
2022-06-09 19:54:50 -03:00
46e403b20b fix: properly parse mrpacks without the 'env' field
It's optional, so some files may not have it (like most of FO).
2022-06-09 19:53:29 -03:00
1b1f728c58 fix: allow opening external links in technic modpack page 2022-06-09 18:46:19 -03:00
309013efb3 Merge pull request #762 from muscaln/flake
Bump flake lock
2022-06-09 05:58:42 +05:30
705cf6499e Merge pull request #734 from babbaj/extra-jdks
nix: add package argument for extra jdks
2022-06-09 05:57:23 +05:30
f2ed4a92e2 Update README.md
Co-authored-by: Tatsuya Noda <topia@clovery.jp>
2022-06-08 15:55:28 -04:00
0c8ca1b3c0 fix: remove debug CXX flags 2022-06-08 21:04:27 +02:00
6ee5ee496e flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/41cc1d5d9584103be4108c1815c350e07c807036' (2022-05-23)
  → 'github:nixos/nixpkgs/43ecbe7840d155fa933ee8a500fb00dbbc651fc8' (2022-06-08)
2022-06-08 14:32:08 +03:00
7f8aa2099c Make it responsive 2022-06-07 18:58:02 -04:00
1d9797660b QString::locateAwareCompare() is better for human-like sorting 2022-06-07 15:27:57 +01:00
cd0d8a76c5 chore: add sponsors to README 2022-06-07 10:33:09 +02:00
3f1251e78b nix: add package argument for extra jdks 2022-06-06 22:13:10 -04:00
89d4405563 Simplify sorting logic to a single std::sort call 2022-06-06 22:18:19 +01:00
8966364648 Merge pull request #685 from kthchew/fix/technic-quilt
Add Quilt support for Technic modpacks
2022-06-06 18:03:05 -03:00
1c60e9b4fc Add initial sorting function 2022-06-06 21:51:08 +01:00
843c860d98 Update bug_report.yml 2022-06-06 13:52:50 -04:00
6587e39992 Resize PolyMC logo 2022-06-05 18:05:09 -04:00
757fa1410c Update launcher/Application.cpp
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-06-05 23:52:21 +08:00
dd6d8e0002 Make Launcher class to look more like original 2022-06-05 02:43:14 +01:00
cd49406bfe Fix launching process for some legacy Forge versions 2022-06-05 01:18:59 +01:00
7a3acc3249 refactor(ui): use tabs for APIPage 2022-06-04 22:04:36 +02:00
db1c804812 Merge pull request #718 from DioEgizio/revert-unfunny-pr 2022-06-04 21:49:15 +02:00
493d58f358 Merge pull request #719 from RaptaG/patch-1
Capitalization fix in the README
2022-06-04 16:16:15 -03:00
fcd56dddc2 Capitalization fix 2022-06-04 22:08:35 +03:00
91b85f9919 Revert "Merge pull request #315 from txtsd/display_scaling"
This reverts commit fcf728f3b5f4923cc05edfeb45f8340f420669cf.
2022-06-04 17:09:11 +02:00
4cecba8787 make $LAUNCHER_VER actually work 2022-06-04 22:59:57 +08:00
5930acc418 change UI to scroll
let me just say, this does not look right
2022-06-04 22:54:05 +08:00
61d36c1723 Clarify the forking policy a bit more 2022-06-04 15:20:49 +01:00
c2a43c6f40 fix: hide .index folder on Windows 2022-06-04 11:02:59 -03:00
1ab00ca8b2 Merge pull request #426 from flowln/mod_perma
Add on-disk mod metadata information
2022-06-04 13:23:38 +02:00
778baa6dbe fix: always store InstanceType 2022-06-04 11:59:12 +02:00
25ab121e42 feat: custom user-agent 2022-06-04 15:33:17 +08:00
cf4949b4f5 Prepare for Nix 2.7 (#286)
* Prepare for Nix 2.7

* Fix embarassing oopsie
2022-06-03 22:26:46 -03:00
4ca634d229 Merge pull request #701 from jn64/patch-1
Add "mc" keyword to desktop file
2022-06-03 09:30:36 +02:00
ca21b31696 Add "mc" keyword to desktop file
Certain launchers (e.g. GNOME) only search from word boundaries, so typing "mc" doesn't currently match to "PolyMC".
2022-06-03 09:58:57 +08:00
38ff76d2b8 Add OpenBSD support
Adds OpenBSD support.
2022-06-02 02:02:42 +10:00
147bde5294 Merge pull request #692 from glowiak/patch-6 2022-06-01 17:46:12 +02:00
1a004f0c4d Update MCEditTool.cpp 2022-06-01 15:50:43 +02:00
7d21bf15e8 Update UpdateController.cpp 2022-06-01 15:50:02 +02:00
a88ad8025b Merge pull request #682 from istudyatuni/fix-add-account-behaviour 2022-06-01 10:13:35 +02:00
e06bf17d13 Merge branch 'PolyMC:develop' into macos-app-heuristic 2022-06-01 00:12:14 +08:00
04a3669fc4 Merge pull request #687 from PolyMC/LennyMcLennington-patch-1
Change forking policy a bit
2022-05-31 08:22:33 +02:00
795075f90d Update README.md 2022-05-30 23:59:48 +01:00
2727df704f change the wording a bit 2022-05-30 23:52:12 +01:00
8ce8aadd9b fix typo 2022-05-30 23:50:35 +01:00
2999e69f0f Change forking policy a bit
Ask people forking PolyMC to make it clear that their fork is not endorsed by us.
2022-05-30 23:05:29 +01:00
7ac16ed073 Use QStringList instead of QSet<QString>
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-05-30 14:40:20 -04:00
3585e4764b Add Quilt support for Technic modpacks 2022-05-30 14:14:03 -04:00
065e38c6aa Move Windows installer configure to program_info 2022-05-30 12:56:29 -04:00
9054ee18a1 Merge pull request #505 from flowln/improve_download_ux 2022-05-30 13:41:02 +02:00
9d8b95107d fix: do not show the "profile select" dialog if the user refused to add an account 2022-05-30 13:33:07 +03:00
8731c86d0d Use CMake for Windows installer branding
As a side effect, fixes an issue where the installer wrote the incorrect version to the registry.
2022-05-29 19:50:44 -04:00
d7fad4bd04 Merge pull request #677 from timoreo22/fix-modrinth-link
Fix modrinth search filters
2022-05-29 18:36:03 +02:00
2746251dcd Fix modrinth search filters 2022-05-29 18:23:34 +02:00
73e46e569f Merge pull request #662 from Scrumplex/chore-bump-1.3.1 2022-05-29 17:05:02 +02:00
4f0f74d201 Merge pull request #675 from muscaln/nix
Nix updates
2022-05-29 11:21:47 -03:00
adf1e1982a fix: remove unnecessary translation (#674) 2022-05-29 16:14:01 +02:00
f5405e835e Merge pull request #624 from ryanccn/global-jvm-args
Make global JVM arguments multi-line
2022-05-29 16:10:55 +02:00
85ee7fb3a4 Merge pull request #672 from Scrumplex/fix-ftblegacy-pack-version
fix: add version to Legacy FTB packs
2022-05-29 16:10:43 +02:00
ee00a5d8ee nix: make LTO optional 2022-05-29 17:07:12 +03:00
65d23fc9b9 Merge pull request #671 from Scrumplex/fix-importing-flame-mmc-packs 2022-05-29 15:15:18 +02:00
3448d7cb70 Merge pull request #659 from Scrumplex/fix-apikey-tos
Clarify terms and conditions for API keys
2022-05-29 18:44:32 +05:30
db1abb02d6 Merge pull request #661 from flowln/wow_curseforge_is_being_uncompetitive_im_so_surprised 2022-05-29 14:42:49 +02:00
36d78577e2 Merge pull request #669 from Scrumplex/fix-binary-version-windows
Set version for Windows binaries
2022-05-29 22:37:23 +10:00
20832682ef Update launcher/ui/pages/global/JavaPage.cpp
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-05-29 20:35:57 +08:00
8e6c592ad9 fix: add version to Legacy FTB packs 2022-05-29 14:28:54 +02:00
0b3115997a fix: fix importing Flame/MMC packs 2022-05-29 14:16:13 +02:00
b07c5982e1 fix: set version for Windows binaries 2022-05-29 13:09:13 +02:00
4a0b0d8735 Merge pull request #653 from muscaln/nix 2022-05-29 13:08:56 +02:00
7b9f67f4b4 Merge pull request #667 from DioEgizio/patch-7 2022-05-29 13:07:25 +02:00
577f17c916 remove vista support from the manifest
we don't support qt <5.12 anymore anyways
2022-05-29 09:45:20 +02:00
d4c1d62781 Update launcher/ui/pages/global/JavaPage.cpp
Co-authored-by: Kenneth Chew <79120643+kthchew@users.noreply.github.com>
2022-05-29 12:15:20 +08:00
80da1f1bb9 ATLauncher: Use ATLauncher rather than FTB in error messages 2022-05-29 00:04:28 +01:00
febdb85f96 ModpacksCH: Use ModpacksCH rather than FTB in error messages 2022-05-29 00:04:28 +01:00
96b76c8f5c ModpacksCH: Make packs managed when installing 2022-05-29 00:04:27 +01:00
411bf3be03 ATLauncher: Make packs managed when installing 2022-05-29 00:04:27 +01:00
a98b6663e1 ATLauncher: Pass the full pack name through to the install task 2022-05-29 00:04:27 +01:00
e7f35e6ca3 API: Add settings to support managed packs
Managed packs means an installation of a modpack through a modpack
provider. Managed packs track their origins (pack platform, name, id),
so that in future features can exist around this - such as updating, and
reinstalling.
2022-05-29 00:04:26 +01:00
f0ec165d42 feat: add warning of non-whitelisted URLs instead of a hard fail
Based on people's votes on Discord :^)
2022-05-28 18:04:16 -03:00
abd240468e clean up validateDownloadUrl 2022-05-28 17:11:55 -03:00
b5e00027d1 change: add 'gitlab.com' to whitelisted Modrinth modpack urls 2022-05-28 17:01:58 -03:00
1698554024 debug: add non-translated debug logging for 'non-whitelisted url' fails 2022-05-28 17:01:57 -03:00
f4604bbf79 change: update whitelisted hosts in Modrinth modpacks 2022-05-28 17:01:52 -03:00
699ad316f0 Rework curseforge download (#611)
* Use the bulk endpoint on mod resolution for faster download
* Search on modrinth for api blocked mods
* Display a dialog for manually downloading blocked mods
2022-05-28 21:53:12 +02:00
fcbe233fdb Merge pull request #651 from Scrumplex/fix-mnemonic-apipage
Fix mnemonics in APIPage
2022-05-28 15:46:38 +02:00
4af8a9ed2d Merge pull request #650 from flowln/modrinth_icons
Fix modpack icon importing with non-standard icon paths
2022-05-28 15:45:26 +02:00
80627b4f89 chore: bump version 2022-05-28 15:42:54 +02:00
83078cd49a Merge pull request #657 from JJL772/fix/misc-fixes
Fix crash when aborting instance import
2022-05-28 15:38:36 +02:00
53e0d13142 Merge pull request #625 from ryanccn/light-macos-icon
Use light background macOS icon
2022-05-28 15:36:26 +02:00
85901082a2 Merge pull request #639 from Scrumplex/fix-prio-modpack-formats
Prefer stricter modpack formats during import
2022-05-28 15:36:18 +02:00
f19e27e875 Merge pull request #629 from kthchew/feature/desktop-shortcut
Add desktop shortcut to Windows installer
2022-05-28 15:36:12 +02:00
c864046cee Merge pull request #623 from ryanccn/clang-format
Add a .clang-format
2022-05-28 15:36:01 +02:00
2d68235e55 Merge branch 'develop' into global-jvm-args 2022-05-28 21:15:19 +08:00
2be8100e7c Merge branch 'develop' into global-jvm-args 2022-05-28 21:15:00 +08:00
ab3e2562db fix: clarify terms and conditions for API keys 2022-05-28 13:52:22 +02:00
123d6c72e4 nix: fix nix-build 2022-05-28 11:32:16 +03:00
0ea2135aa5 nix: initial support for qt6 2022-05-28 11:32:13 +03:00
48e20cb5f7 Fix crash when aborting instance import
Also turned a loop var into a reference to avoid copies on each iteration
2022-05-27 16:41:57 -07:00
0ffe0b6894 nix: move files to nix/ 2022-05-27 22:56:42 +03:00
338156500b nix: override msa id via cmake flag 2022-05-27 22:56:42 +03:00
bfd9bd43c9 flake.lock: update
• Updated input 'flake-compat':
    'github:edolstra/flake-compat/64a525ee38886ab9028e6f61790de0832aa3ef03' (2022-03-25)
  → 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/30d3d79b7d3607d56546dd2a6b49e156ba0ec634' (2022-03-25)
  → 'github:nixos/nixpkgs/41cc1d5d9584103be4108c1815c350e07c807036' (2022-05-23)
• Removed input 'quazip'
2022-05-27 22:56:42 +03:00
283e50e670 nix: use nixpkgs's quazip 2022-05-27 22:56:40 +03:00
6fb5bb6a5e fix: fix mnemonics in APIPage 2022-05-27 14:50:06 +02:00
5d3bef32ca fix: use absolute path when installing icons 2022-05-27 09:15:32 -03:00
3ff26d5cfe Merge pull request #642 from ryanccn/metaserver-show-default
Show default metaserver in settings
2022-05-26 20:09:07 -03:00
88c1e504b0 Merge pull request #618 from DioEgizio/patch-6
fix appimage not having imageformats
2022-05-26 20:03:03 -03:00
0263677e1f fix: prefer stricter modpack formats during import
Flame modpacks use "manifest.json" as their only characteristic for
identification. Some modpacks might have other files called
"manifest.json", which is why we should prefer modpack formats that have
a stricter structure.
2022-05-26 22:41:20 +02:00
940455f81c Merge pull request #645 from PolyMC/revert-609-feature/fix-blocked-modpacks 2022-05-26 19:20:39 +02:00
f541ea659c better new icon 2022-05-26 18:16:32 +08:00
938cae1130 revert: remove CurseForge workaround for packs too
Partial revert. Handles missing download URLs.
2022-05-25 23:14:13 +02:00
7f73e57c67 Merge pull request #630 from jamierocks/h-atl-depends 2022-05-25 14:52:34 +02:00
e50ec31351 fix 2022-05-25 14:44:47 +08:00
a28fa219d7 fix indent width 2022-05-25 14:21:09 +08:00
8a1ba03bcb show default metaserver 2022-05-25 11:46:15 +08:00
f8e7fb3d48 fix: better handle corner case 2022-05-24 20:27:25 -03:00
e8b7e70ec9 Merge pull request #637 from byquanton/patch-1 2022-05-24 20:53:19 +02:00
67c5aa0be9 Update org.polymc.PolyMC.metainfo.xml.in
Should fix Flatpak/Flathub build
2022-05-24 17:44:23 +02:00
e644380160 feat: add links to curseforge modpacks 2022-05-24 12:27:32 -03:00
c5eb6fe6fb feat: add links for curseforge mods
NOT DOWNLOAD LINKS! (someone would ask it i'm sure :p)
2022-05-24 12:14:08 -03:00
ae2ef324f2 feat: add remaining links to modrinth mods 2022-05-24 11:58:11 -03:00
d0337da8ea feat: add remaining links to modrinth modpacks 2022-05-24 11:52:27 -03:00
17b30b2ae2 clean up .clang-format 2022-05-24 22:37:00 +08:00
5e17d53c7f fix: missing tr() and update donate message 2022-05-24 11:11:40 -03:00
22e0527502 feat: add donate info to modrinth modpacks 2022-05-24 09:46:58 -03:00
ca3c6c5e8a feat: add donate links for modrinth mods 2022-05-24 09:38:48 -03:00
4bd30f5e72 chore: remove unused GH Workflows 2022-05-24 14:17:44 +02:00
3cc26b15a1 Merge pull request #631 from kthchew/fix/quazip-warn 2022-05-24 10:25:04 +02:00
9673dac22b add more #ifdefs 2022-05-24 16:18:02 +08:00
0426149580 standard macOS app behavior 2022-05-24 13:35:01 +08:00
fce5c57548 Silence CMake QuaZip not found warnings
These are expected most of the time, and thus just noise.
2022-05-23 17:27:35 -04:00
4ee5264e24 ATLauncher: Delete files from configs if they conflict with a mod 2022-05-23 21:44:01 +01:00
101ca60b2b ATLauncher: Handle extra arguments depends 2022-05-23 20:57:15 +01:00
f28a0aa666 ATLauncher: Handle main class depends 2022-05-23 20:57:14 +01:00
997bf91442 Add desktop shortcut to Windows installer 2022-05-23 14:15:49 -04:00
5a1de15332 fix: use a more robust method of finding metadata indexes
Often times, mods can have their name in different forms, changing one
letter to caps or the other way (e.g. JourneyMaps -> Journeymaps).
This makes it possible to find those as well, which is not perfect by
any means, but should suffice for the majority of cases.
2022-05-23 14:58:15 -03:00
42f8ec5b14 fix: do modrinth changes on flame too
Also fix a dumb moment
2022-05-23 14:58:14 -03:00
2fc1b99911 chore: add license headers
Prevents a massive inload of Scrumplex ditto's :)

I didn't add it to every file modified in this PR because the other
changes are pretty minor, and would explode the diff of the PR. I hope
that's not a problem O_O
2022-05-23 14:58:14 -03:00
3a923060ce fix: use correct hash_type when creating metadata
also fix: wrong parameter name in LocalModUpdateTask's constructor
also fix: correct hash_format in CF
2022-05-23 14:58:14 -03:00
0985adfd74 change: support newest changes with packwiz regarding CF 2022-05-23 14:58:08 -03:00
59d628208b feat: allow trying to use multiple hash types 2022-05-23 14:43:31 -03:00
5c5699bba5 refactor: move individual pack version parsing to its own function 2022-05-23 14:43:31 -03:00
67e0214fa5 fix: don't try to delete mods multiple times
Shows a more helpful message if there's a parsing error when reading the
index file.

Also fixes a clazy warning with using the `.data()` method in a
temporary QByteArray object.
2022-05-23 14:43:10 -03:00
e17b6804a7 fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when
building the metadata.
2022-05-23 14:43:09 -03:00
96e36f0604 refactor: make mod metadata presence (or lack of) easier to find out 2022-05-23 14:43:09 -03:00
a99858c64d refactor: move code out of ModIndex.h
Now it's in ModIndex.cpp
2022-05-23 14:43:07 -03:00
ba50765c30 tidy: apply clang-tidy to some files
Mostly the ones created in this PR + Mod.h / Mod.cpp / ModDetails.h
2022-05-23 14:42:28 -03:00
d7f6b36990 test+fix: add basic tests and fix issues with it 2022-05-23 14:42:28 -03:00
4439666e67 feat: allow disabling mod metadata usage 2022-05-23 14:42:28 -03:00
23febc6d94 feat: cache metadata in ModDetails
Allows for more easy access to the metadata by outside entities
2022-05-23 14:42:28 -03:00
fab4a7a602 refactor: abstract metadata handling and clarify names 2022-05-23 14:42:28 -03:00
092d2f8917 feat: add support for converting builtin -> packwiz mod formats
Also adds more documentation.
2022-05-23 14:42:28 -03:00
e9fb566c07 refactor: remove unused mod info and organize some stuff 2022-05-23 14:42:27 -03:00
5a34e8fd7c refactor: move mod tasks to their own subfolder
Makes the launcher/minecraft/mod/ folder a little more organized.
2022-05-23 14:42:27 -03:00
fcfb2cfc3d feat: use mod metadata for getting mod information
For now this doesn't mean much, but it will help when we need data
exclusive from the metadata, such as addon id and mod provider.

Also removes the metadata when the mod is deleted, and make the Mod.h
file a little more pleasing to look at :)
2022-05-23 14:42:27 -03:00
e93b9560b5 feat: add method to delete mod metadata
Also moves indexDir setting from LocalModUpdateTask -> ModFolderModel
2022-05-23 14:42:27 -03:00
8e4438b375 feat: add parser for current impl of packwiz mod.toml
This reads a local mod.toml file and extract information from it. Using
C libs in C++ is kind of a pain tho :(
2022-05-23 14:42:27 -03:00
eaa5ce4467 feat(ui): adapt SequentialTask to nested SequentialTasks 2022-05-23 14:42:27 -03:00
c86c719e1a feat: add mod index updating to ModDownloadTask
This makes ModDownloadTask into a SequentialTask with 2 subtasks:
Downloading the mod files and updating the index with the new
information.

The index updating is done first so that, in the future, we
can prompt the user before download if, for instance, we discover
there's another version already installed.
2022-05-23 14:42:27 -03:00
b30b88716e feat: add very early mod.toml packwiz support
Also use it as a on-disk format for storing mod metadata. This will be
used later on to make better mod managment.
2022-05-23 14:42:22 -03:00
c3e6b1aa8a use light bigsur icon 2022-05-23 18:40:46 +08:00
6d0ea13f97 make JVM args PlainTextEdit 2022-05-23 16:52:12 +08:00
dca4ea5cea Merge pull request #621 from Scrumplex/remove-curseforge-workarounds 2022-05-23 10:47:30 +02:00
be1e2c07ec Merge pull request #622 from Scrumplex/chore-bump-1.3.0
Bump version to 1.3.0
2022-05-23 08:44:56 +05:30
2a0018e730 add a .clang-format 2022-05-23 08:29:30 +08:00
ac4497a1f2 Merge pull request #605 from jamierocks/h-atl-improv
ATLauncher: Various work to improve the platform support
2022-05-22 20:09:13 -03:00
d72c75db23 chore: bump version 2022-05-22 22:56:52 +02:00
6821a45b7f Merge pull request #620 from Scrumplex/update-cxxflags 2022-05-22 22:55:04 +02:00
f24cdd6564 Merge pull request #425 from dada513/dynamic_meta 2022-05-22 22:47:00 +02:00
cb69869836 revert: remove CurseForge workaround
We have been asked by CurseForge to remove this workaround as it
violates their terms of service. This is just a partial revert, as the
UI changes were otherwise unrelated.

This reverts commit 92e8aaf36f72b7527322add169b253d0698939d0, reversing
changes made to 88a93945d4c9a11bf53016133335d359b819585e.
2022-05-22 22:07:03 +02:00
0b85051a23 fix: more generous optimizations for debug builds 2022-05-22 21:41:41 +02:00
f2e2053134 feat: add trailing slash to meta URL if it is missing 2022-05-22 21:36:31 +02:00
b181f4bc30 fix: improve spacing in APIPage 2022-05-22 21:36:30 +02:00
f00dbdc215 Make Metaserver changable in settings
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-05-22 21:35:20 +02:00
309dcc82ca Revert "fix: temporarily ignore stringop-overflow warning"
This reverts commit 90007e2d9d4f63cfc9dc73888af34a17657b5102.
2022-05-22 20:57:52 +02:00
0922a7f410 refactor: use -O2 for release and -O1 for debug builds 2022-05-22 20:50:37 +02:00
7d91db607f Merge pull request #554 from PolyMC/more_paste_services 2022-05-22 20:49:11 +02:00
2be583ad4d Merge branch 'PolyMC:develop' into patch-6 2022-05-22 20:03:10 +02:00
efcba698ac Merge pull request #616 from Scrumplex/fix-windows-crap
fix: temporarily ignore stringop-overflow warning
2022-05-22 18:43:31 +02:00
b191291737 Merge pull request #577 from PolyMC/fix/toolbar_🦀_fix 2022-05-22 18:11:00 +02:00
c988b4d213 fix appimage not having imageformats
fixes stuff like the iris icon
2022-05-22 17:26:27 +02:00
90007e2d9d fix: temporarily ignore stringop-overflow warning 2022-05-22 16:13:30 +02:00
29ef1e2c4b Merge pull request #597 from Scrumplex/refactor-modloader-modapi 2022-05-22 13:17:53 +02:00
fbe84f9e47 Merge pull request #614 from txtsd/ccache_release_fix
Avoid invoking ccache on Release builds
2022-05-22 16:16:14 +05:30
b036d95bab Merge pull request #576 from kthchew/feature/win-installer
Create Windows installer
2022-05-22 12:26:43 +02:00
bfffcb3910 fix(workflow): Avoid invoking ccache on Release builds 2022-05-22 13:42:33 +05:30
3bc02b9662 Fix Sparkle signing step 2022-05-21 13:23:02 -04:00
bc450e4cee Merge pull request #612 from DioEgizio/update-cf-logo-real
change cf icon to a more fancy one
2022-05-21 09:53:31 -07:00
de02deac98 Make if statement condition more readable
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-05-21 17:30:54 +01:00
e2ad3b0183 Add migration wizard, fix migration from custom paste instance
- Very basic wizard just to allow the user to choose whether to keep
  their old paste settings or use the new default settings.

- People who used custom 0x0 instances would just be kept on those
  settings and won't see the wizard.
2022-05-21 17:30:19 +01:00
caf6d02728 Change paste settings and add copyright headers
- There's now a notice reminding people to change the base URL if they
  had a custom base URL and change the paste type (that was something I
  personally had problems with when I was testing, so a reminder was
  helpful for me).

- Broke down some of the long lines on APIPage.cpp to be more readable.

- Added copyright headers where they were missing.

- Changed the paste service display names to the names they are more
  commonly known by.

- Changed the default hastebin base URL to https://hst.sh due to the
  acquisition of https://hastebin.com by Toptal.
2022-05-21 17:30:09 +01:00
35f71f5793 Support paste.gg, hastebin, and mclo.gs 2022-05-21 17:28:22 +01:00
b2a89ee4b9 change cf icon to a more fancy one
taken from QuiltMC/art in the emoji folder, so it's licensed under CC0
2022-05-21 17:49:52 +02:00
b84d52be3d ATLauncher: Display warnings when selecting optional mods 2022-05-21 15:20:38 +01:00
305973c0e7 ATLauncher: Display install messages if applicable 2022-05-21 15:19:55 +01:00
7c251efc47 ATLauncher: Display mod colours in optional mod dialog 2022-05-21 15:18:50 +01:00
166f872712 fix: various issues with ProgressDialog and SequentialTasks
- Fix aborting sequential tasks
- Fix displaying wrong number of tasks concluded
- Fix text cutting when the URL is too big
2022-05-21 08:36:36 -03:00
8f2c485c92 feat(ui): make selected mods in downloader bold with underline
Makes it easier to find which mods are selected in case you want to
change those.
2022-05-21 08:04:26 -03:00
613f2fc447 feat: allow deselecting mods from the mod confirmation dialog
This adds a checkbox to each mod on the dialog that shows up when
confirming the mods to download, so you can deselect some of those if
you want to.
2022-05-21 08:02:27 -03:00
9a0d6124f3 Merge pull request #609 from timoreo22/feature/fix-blocked-modpacks 2022-05-21 12:22:45 +02:00
2646ae29f0 Merge pull request #520 from icelimetea/refactor-java-launcher-v2 2022-05-21 12:06:45 +02:00
b4707f46ad Merge pull request #500 from flowln/net_refactor
Refactor a little the code in `launcher/net/` files
2022-05-21 12:06:34 +02:00
482e049ac7 Merge pull request #606 from jamierocks/h-launch-version 2022-05-21 11:43:19 +02:00
c04adf7452 Do the url trick on initial modpack download too 2022-05-21 08:31:07 +02:00
92e8aaf36f Merge pull request #608 from timoreo22/feature/curseforge-fix
Very Temporary Fix for curseforge
2022-05-21 06:34:43 +02:00
b1f486518e Use GitHub Actions to get signature for Sparkle
Requires a secret called `SPARKLE_ED25519_KEY`, in the format of a private key file
2022-05-21 00:32:14 -04:00
3cab0e69f1 Fix default install location 2022-05-20 17:23:11 -04:00
1ec7878c07 Add /NoShortcuts parameter for Windows installer 2022-05-20 17:22:30 -04:00
cdd83c279c Remove portable option in Windows installer 2022-05-20 17:12:08 -04:00
12cadf3af0 Add /NoUninstaller parameter for Windows installer 2022-05-20 17:09:42 -04:00
2bc6da038d Add installer to release workflow 2022-05-20 17:09:26 -04:00
3b4b34b369 fix(ui): make CF and MR modpack dialogs more consistent 2022-05-20 22:48:42 +02:00
6542f5f15a Apply suggestions 2022-05-20 22:06:36 +02:00
30b56dbcbd Port temp fix to mods too 2022-05-20 22:00:38 +02:00
cbc8c1aed6 Use consistent naming scheme
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-05-20 15:56:13 -04:00
6afe59e76b Very Temporary Fix for curseforge 2022-05-20 21:19:19 +02:00
88a93945d4 Merge pull request #607 from dada513/curse_set 2022-05-20 20:41:42 +02:00
2847cefff7 Add cursefrog key override 2022-05-20 19:56:27 +02:00
96f16069a9 Launch: Apply the Minecraft version correctly
It was previously using a deprecated field.
2022-05-20 18:47:11 +01:00
188c5aaa35 Launch: Match Vanilla launcher version string behaviour
This removes a means of profiling users.
2022-05-20 18:43:47 +01:00
f5f59203a2 ATLauncher: Reduce boilerplate code for fetching versions 2022-05-20 18:05:58 +01:00
c329730de8 ATLauncher: Install LiteLoader as a component where possible 2022-05-20 18:03:32 +01:00
97a83c9b7a ATLauncher: Avoid downloading Forge twice for older packs
This resolves a quirk where Forge would still be downloaded for use as
a jarmod, even when we detected Forge as a component.
2022-05-20 17:58:00 +01:00
1e6df7eec0 Merge pull request #592 from flowln/technic
Use empty string when version is null in the Technic pack manifest
2022-05-20 10:56:42 +02:00
f3c72f4f08 Actually install the full Sparkle.framework
CMake's `fixup_bundle` did not copy everything in the framework, which caused the app to crash when updating. Oops.
2022-05-19 20:22:45 -04:00
05cd30ac06 Refactor code, create abstract class ExternalUpdater
(Hopefully) this makes implementing updaters using external libraries easier on other platforms. To implement an updater on a new platform, create a new class that implements the pure virtual methods from `ExternalUpdater` and add code in the `UpdateChecker` initializer to initialize the new class.
2022-05-19 15:16:37 -04:00
34adcec616 Add functionality to (Sparkle) updater settings on macOS
Also remove a debug line I accidentally left in
2022-05-19 15:16:37 -04:00
f9f46609ee Use my public key and appcast URL for testing purposes
This is for testing the PR only. If merged, this must be removed.
2022-05-19 15:16:37 -04:00
b5bdfa6c2e Implement automatic and manual updates on macOS 2022-05-19 15:16:37 -04:00
ea4ef1655b Create SparkleUpdater class for access from Qt/C++
To actually get automatic updates going, all that needs to happen is that `SparkleUpdater` needs to be initialized.

The rest of the functions can be connected to elements in the UI.
2022-05-19 15:16:37 -04:00
7eb61a28be Add build options for Sparkle updater
Two new build options are added:

`MAC_SPARKLE_PUB_KEY`: the public key used to verify the signatures of the appcast
`MAC_SPARKLE_APPCAST_URL`: the URL where the `appcast.xml` is located

If the updater should be disabled on macOS, set either of these to an empty string.
2022-05-19 15:16:37 -04:00
92b913ca37 Add Sparkle Updater framework to macOS build 2022-05-19 15:16:37 -04:00
3806f23b02 Merge pull request #594 from Scrumplex/fix-support-split-natives
Support Mojang's new split natives
2022-05-19 17:42:17 +02:00
36045a8b0a chore: improve readability
Co-authored-by: flow <thiagodonato300@gmail.com>
2022-05-19 12:37:20 +02:00
943090db98 refactor: allow tracking multiple mod loaders 2022-05-19 08:49:27 +02:00
77caaca50d fix: only consider enabled mod loaders 2022-05-19 08:09:37 +02:00
f66e0fa0e8 fix: support split natives
Mojang introduced a new structure for natives, notably for LWJGL.
Now instead of using the `natives` structure of the version format, Mojang
chose to create a seperate library entry for each platform, which uses
the `rules` structure to specify the platform. These new split natives
carry the same groupId and artifactId, as the main library, but have an
additional classifier, like `natives-linux`.

When comparing GradleSpecifiers we don't look at the classifier, so when
the launcher sees an artifact called `org.lwjgl:lwjgl:3.3.1` and right
after that an artifact called `org.lwjgl:lwjgl:3.3.1:natives-linux`, it
will treat it as "already added" and forget it.

This change will include the classifier in that comparison.
2022-05-18 22:51:15 +02:00
441075f610 fix: version field in technic pack manifest being null
Sometimes, the version field, that is supposed to be a string, was a
null instead. Inspecting other entries, seems like the default for not
having a version should be "", so I made it like that in case the
version was null.

I hope this fixes the issue :^)
2022-05-18 17:17:16 -03:00
b2878dca1d Merge pull request #590 from DioEgizio/fix-qmj-over-fmj
fix(quilt) always prefer qmj over fmj
2022-05-18 19:18:18 +02:00
b883ce5c51 Merge pull request #127 from Scrumplex/refactor-bump-qt5.12 2022-05-18 15:47:17 +02:00
127dfadc6c fix(quilt) always prefer qmj over fmj
this fixes Quilt-only mods like ok zoomer showing wrong metadata
2022-05-18 14:33:58 +02:00
ff9f3cb31f fix conflicts with develop 2022-05-17 18:25:08 -03:00
a21bd41580 fix: ignore deprecation again 2022-05-17 22:25:50 +02:00
8e9f1bcf18 fix: remove unnecessary Qt version checks 2022-05-17 22:25:50 +02:00
4b06fc5323 chore!: drop support for Qt <5.12
BREAKING CHANGE: If there are references to stuff that's deprecated as
of Qt 5.12, the compilation will fail. This means that support for
versions below 5.12 is hereby dropped
2022-05-17 22:25:50 +02:00
cc27bb3231 fix(updater): remove Windows version check
Qt 5.12 doesn't support anything older than Windows 7 anyway, so we
can't really check if we are on an older platform.
2022-05-17 22:25:50 +02:00
c1700054f4 fix: replace deprecated stuff as of Qt 5.12 2022-05-17 22:25:50 +02:00
cc13310083 Merge pull request #565 from Scrumplex/modrinth-packs
Initial Modrinth modpack support
2022-05-17 16:09:22 +02:00
1012912272 Merge pull request #567 from Scrumplex/quilt-metadata
Support `quilt.mod.json` metadata
2022-05-17 16:08:59 +02:00
edbd90a4e6 fix: update links for Quilt metadata format 2022-05-17 15:17:20 +02:00
ddc3b5eb0b Update launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui
Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
2022-05-17 15:14:53 +02:00
17bbfe8d89 fix: virtual signal in Task.h 2022-05-17 06:47:00 -03:00
96deb5b09d chore: remove copyright from files i didnt mess with
This is what happens when you auto-pilot stuff xdd
2022-05-17 06:36:30 -03:00
9b387d73e5 Merge pull request #529 from flowln/vertical_toolbar
Set right orientation for instance toolbar when moving it around
2022-05-17 12:14:34 +05:30
c02a6780b0 Merge pull request #540 from kthchew/fix/executable-screenshot
Show "executable" screenshots in the screenshot manager
2022-05-17 10:59:55 +05:30
85ec9d95a4 Support installer languages other than English 2022-05-16 19:28:04 -04:00
6dfec4db40 Fix toolbar disappearing in a certain circumstance. 2022-05-17 00:21:57 +01:00
2e9d7f5c3d fix: mod skipping between pages and remove dead code 2022-05-16 19:17:37 -03:00
696a711e39 fix: missed change to metacache entry lookup 2022-05-16 19:10:31 -03:00
887246a66b fix: typo and useless code 2022-05-16 17:09:14 -03:00
2993318d19 Remove admin requirement (no multi-user install option) 2022-05-16 15:29:37 -04:00
2b52cf01f5 Build Windows installer 2022-05-16 15:23:32 -04:00
cd9e0e0cc0 fix: use own metacache base for modrinth icons 2022-05-16 20:17:19 +02:00
f66598db8a Merge pull request #564 from flowln/cf_icon 2022-05-16 20:06:59 +02:00
cf5c752dda Merge pull request #568 from kthchew/fix/mac-steam-overlay 2022-05-16 20:06:34 +02:00
a6d2c5e181 fix: better hack for icons that cant be natively scaled to 48x48 2022-05-16 14:35:01 -03:00
82760f4b91 fix: import modrinth packs with weird overrides structure
Probably because of Packwiz limitations, or an space optimizer that did
this :)
2022-05-16 12:11:50 -03:00
62e099ace5 feat: better handling of optional mods
This disables the optional mods by default and tell the user about it.
Pretty hackish, but a better solution would involve the modrinth
metadata to have the mod names...

Also sorry for the diffs, my clangd went rogue x.x
2022-05-15 22:16:52 -03:00
e92b7bd25e change: switch to modrinth production servers 2022-05-15 21:50:42 -03:00
e7bb3b2776 fix: macos compilation
i forgor macos is cringe with static arrays 💀

edit: WHY DONT MAC LET ME USE STD::ARRAY ;----;
2022-05-15 21:18:29 -03:00
ec3c882a44 change: add alpha note to modrinth page 2022-05-15 20:52:57 -03:00
66ce5a4a2d fix: pack sorting and other search parameters 2022-05-15 20:45:27 -03:00
a110d445ac feat: support quilt.mod.json metadata 2022-05-15 23:00:09 +02:00
a67f3131e7 Merge pull request #560 from kthchew/feature/close-pmc-override
Add instance overrides for miscellaneous settings
2022-05-15 17:40:53 -03:00
7f305aad1b Add Allow DYLD Environment Variables Entitlement to macOS build
This allows the Steam overlay to be injected into Minecraft.
2022-05-15 16:34:53 -04:00
80908efdcb Fix indentation of macOS resources 2022-05-15 16:33:52 -04:00
e5d0097116 Merge pull request #531 from Ozynt/patch-1
Remove reference to legacy Minecraft accounts
2022-05-15 22:18:34 +02:00
6d78ea5a45 Merge pull request #539 from kthchew/fix/translation-switch
Fix untranslated strings after changing language
2022-05-15 17:11:21 -03:00
550d6a6a9b Merge pull request #547 from kthchew/feature/hidden-temp 2022-05-15 21:54:46 +02:00
9be8160bf2 Merge pull request #546 from kthchew/feature/scrollable-accounts 2022-05-15 21:43:34 +02:00
3070565fa3 Merge pull request #545 from DioEgizio/patch-4 2022-05-15 21:42:51 +02:00
7194bb1b81 fix: validate whitelisted download urls 2022-05-15 16:06:49 -03:00
78cf0c73c8 fix: always show project url, if available 2022-05-15 20:38:27 +02:00
4adc61bda9 change: update modrinth icon
Updates to the version at https://github.com/modrinth/docs/blob/master/static/img/logo.svg
2022-05-15 11:26:15 -03:00
93e0041d0e change: use modrinth icon as default on modrinth packs 2022-05-15 11:09:45 -03:00
682a7fb6ba feat: add version of Modrinth modpack to instance name 2022-05-15 13:36:55 +02:00
5f2398fe59 chore: license headers 2 2022-05-15 08:26:34 -03:00
3abf466632 chore: add/update license headers 2022-05-15 13:20:05 +02:00
4bb429a0fb change: use build variables for the modrinth API URLs
Make it more consistent with the others
2022-05-15 07:43:02 -03:00
4a0e4fdb85 fix: add author page url 2022-05-15 07:15:56 -03:00
a43f882d48 feat: add support for Quilt Loader in Modrinth packs 2022-05-15 12:06:01 +02:00
9731e06728 fix: fix build on Qt 5.12 2022-05-15 11:49:27 +02:00
8e764fc8fb Merge pull request #4 from flowln/modrinth_pack 2022-05-15 11:48:09 +02:00
4745ed2818 fix: choose valid download url even if it's not the primary one
It seems to be possible to have modpack versions that have to primary
file. In those cases, we pick a valid one "at random".
2022-05-14 22:50:04 -03:00
49de5d9b07 change: list what file types can be entered in the importer 2022-05-14 22:04:40 -03:00
365cc198ba refactor: some random improvements 2022-05-14 21:50:54 -03:00
9899a0e098 fix: Have the URL be the project URL itself
(I think, doesn't seem to work for the waffle though, probably because
of the staging API :/)
2022-05-14 21:47:35 -03:00
5ea8cec16f fix: make all modrinth modpacks have the same icon size 2022-05-14 21:29:48 -03:00
9dd70ca9ae fix: download icon as well when importing modrinth modpacks 2022-05-14 20:26:20 -03:00
4fda35b466 feat: add modrinth pack downloading
Things that don't work / work poorly (there's more for sure but those
are the evident ones):
    - Icons are broken in the import dialog
    - No way to search for private packs
    - Icons are not downloaded when downloading a mod
    - No support for multiple download URLs
    - Probably a lot more...
2022-05-14 20:19:26 -03:00
31988f0529 fix: adapt upstream Modrinth code to our codebase 2022-05-14 20:27:45 +02:00
db03846358 Add support for importing Modrinth packs from files 2022-05-14 20:01:09 +02:00
c6b3eccbdf refactor: rename Modrinth classes to ModrinthMod 2022-05-14 20:00:54 +02:00
3f259eb97a Refactor script parsing 2022-05-14 16:48:14 +01:00
fac0b027b3 Fix the license header 2022-05-14 16:46:57 +01:00
84b962f256 fix: Handle icons with a dot in their names
E.g. some FTB modpacks.
Also fixes an issue with the name viewing on the Icon Chooser dialog
when the name was too big.
2022-05-13 17:21:35 -03:00
123ed5bd2e Merge pull request #519 from Scrumplex/cleanup-cmake
Remove in-tree CMake modules where possible
2022-05-13 22:05:04 +02:00
c3336251e0 Add the license header to EntryPoint 2022-05-13 18:10:11 +01:00
c054d0f329 Add the license header to LauncherFactory 2022-05-13 17:21:35 +01:00
8dd68580a6 Merge pull request #528 from flowln/guo_ext 2022-05-13 18:17:40 +02:00
067484a6a8 Fix formatting 2022-05-13 16:59:00 +01:00
c83e16aba4 Merge pull request #553 from DioEgizio/add-version-PolyMC
chore: add version of polymc area in bug report template
2022-05-13 14:42:26 +02:00
d85fc456a9 Merge pull request #557 from PolyMC/ZekeSmith-cf-api 2022-05-13 13:36:36 +02:00
dd2b324d8f chore: add license header to remaining files
Also remove some unused imports
2022-05-12 18:11:55 -03:00
0bce08d30f chore: add polymc license headers to launcher/net files 2022-05-12 18:11:55 -03:00
57d65177c8 fix: abort and fail logic in tasks
Also sets up correctly the status connections
2022-05-12 18:11:55 -03:00
040ee919e5 refactor: more net cleanup
This runs clang-tidy on some other files in launcher/net/.

This also makes use of some JSON wrappers in HttpMetaCache, instead of
using the Qt stuff directly.

Lastly, this removes useless null checks (crashes don't occur because of
this, but because of concurrent usage / free of the QByteArray pointer),
and fix a fixme in Download.h
2022-05-12 18:11:55 -03:00
efa3fbff39 refactor: remove some superfluous signals
Since now we're inheriting from Task, some signals can be reused.
2022-05-12 18:11:55 -03:00
8c8eabf7ac refactor: organize a little more the code in launcher/net/
This also reduces some code duplication by using some Task logic in
NetAction.
2022-05-12 18:11:49 -03:00
3aea639fe4 Add UI for miscellaneous instance setting overrides 2022-05-12 17:11:06 -04:00
046f1e6e58 Add instance overrides for miscellaneous settings 2022-05-12 17:08:06 -04:00
37e8f495b4 CurseForge API Key update to PolyMC key
Use the key CurseForge provided me to use for PolyMC

*pr done on mobile if someone could test that would be great*
2022-05-12 23:39:48 +10:00
512d7b07d0 chore: add version of polymc area in bug report template 2022-05-11 15:18:07 +02:00
527fa7ba9c Hide temporary directory in instances folder 2022-05-09 18:34:47 -04:00
288e7bc9c5 Make profile menu scrollable 2022-05-09 15:37:56 -04:00
649b8ac7c6 Merge pull request #537 from PolyMC/stable
Merge stable into develop
2022-05-09 18:06:56 +02:00
96b2758169 fix websiteurl in curseforge modpacks 2022-05-09 17:42:17 +02:00
40e0252d7d Show "executable" screenshots in the screenshot manager
Since the readable/writable filter was removed to do this, extra code was added to enable/disable certain buttons based on whether the screenshot is readable or writable.
2022-05-09 00:54:47 -04:00
5171d99fe5 Retranslate playtime text immediately when language is changed 2022-05-08 23:42:37 -04:00
ea9d61c21c Retranslate account actions after switching language 2022-05-08 23:19:23 -04:00
da25f3b84e Merge pull request #533 from DioEgizio/patch-5 2022-05-08 21:43:18 +02:00
1e34de98ab Merge pull request #534 from DioEgizio/stable 2022-05-08 21:43:06 +02:00
7b46f50cf1 Merge pull request #530 from ryanccn/cfcore-backport 2022-05-08 21:42:40 +02:00
cab40026f2 Merge pull request #475 from Scrumplex/fix-hide-all-tokens
Hide all tokens for non-Debug builds for log and logfiles
2022-05-08 16:56:26 +02:00
ac66bddeda Merge pull request #482 from TheCodex6824/mojang-auth-fix 2022-05-08 16:52:31 +02:00
f4237be9bd Merge pull request #492 from DioEgizio/appimage-fix 2022-05-08 16:52:14 +02:00
dd11ccb3fd bump to 1.2.2 2022-05-08 16:30:12 +02:00
c4549a5375 Update launcher/modplatform/flame/FlameModIndex.cpp
Co-authored-by: flow <thiagodonato300@gmail.com>
2022-05-08 16:25:51 +02:00
e9b3140d12 Update launcher/modplatform/flame/FlameModIndex.cpp 2022-05-08 16:25:45 +02:00
bdd2d57808 This makes more sense 2022-05-08 11:19:53 +02:00
22f5128e39 adopt changes from #497 remapped 2022-05-08 15:22:50 +08:00
ae1aa6f63e gitignore stuff 2022-05-08 15:02:21 +08:00
29a53d7e95 fix: always have the instance toolbar be vertical
This overrides the orientation set automatically by Qt when we start
moving the toolbar around.
2022-05-07 20:44:44 -03:00
2fbb7be23b fix: filter based on MIME type instead of plaintext suffix
Suffixes are unreliable in different locales, while MIME types are more
standarized.
2022-05-07 20:16:55 -03:00
f7f39854f8 Merge pull request #495 from ryanccn/big-sur-icon 2022-05-05 14:29:04 +02:00
113528e1f2 Make line count check more lenient 2022-05-05 07:20:33 +01:00
6bffa06063 Fix typo 2022-05-05 07:16:16 +01:00
dcc41ef885 Improve mpticket file parsing code 2022-05-05 07:14:32 +01:00
e909cc363d add big sur-style icon 2022-05-05 08:10:36 +08:00
9a87ae575e More minor fixes 2022-05-03 03:19:26 +01:00
860a7af679 Fix method access modifier 2022-05-03 00:53:22 +01:00
4fdb21b414 Compile with Java 7 in mind 2022-05-03 00:27:14 +01:00
eeb5297284 Use only Java 7 features (in order to deal with #515) 2022-05-03 00:25:26 +01:00
8de63b60b1 Refactor some parts of NewLaunch (part 2) 2022-05-02 22:36:55 +01:00
0b38d878a1 fix: remove in-tree CMake modules where possible 2022-05-02 16:27:15 +02:00
d29720fbce Merge pull request #518 from timoreo22/develop
Fix nightly.link pr comment
2022-05-02 12:23:00 +02:00
0556ae4749 Merge pull request #503 from txtsd/mnemonics_fix
Fix mnemonics that didn't parse
2022-05-02 11:19:30 +02:00
1a86f72690 Fix nightly.link pr comment 2022-05-02 11:13:46 +02:00
25d380f051 Merge pull request #510 from txtsd/ccache_gha
CI Speedup [1/3]: Use ccache to speed up CI builds
2022-05-02 10:47:28 +02:00
546d394868 Merge pull request #475 from Scrumplex/fix-hide-all-tokens
Hide all tokens for non-Debug builds for log and logfiles
2022-05-02 10:45:58 +02:00
8110040f86 Merge pull request #511 from dada513/hide_java_wizard
add hide java wizard toggle
2022-05-01 08:48:37 +02:00
239e4adf29 refactor(workflow): Only use ccache on Debug builds 2022-05-01 00:34:37 +05:30
5662d41062 Update launcher/ui/pages/global/JavaPage.ui
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-30 16:20:05 +02:00
1e03ef484d Update launcher/ui/pages/global/JavaPage.ui
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-30 16:14:48 +02:00
1d95f10090 Merge pull request #489 from kthchew/fix/old-mac-cleanup 2022-04-30 15:54:10 +02:00
6768768373 Remove symlink 2022-04-30 15:22:31 +02:00
dac801c8ac add hide java wizard toggle 2022-04-30 15:19:57 +02:00
ece5ca52b2 feat(workflow): Use ccache 2022-04-30 17:26:34 +05:30
3205d9e9da Merge pull request #492 from DioEgizio/appimage-fix 2022-04-29 09:10:32 +02:00
b931dc0f93 fix(mnemonics): Add missing buddies to labels
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-29 01:30:47 +05:30
efe4e7df06 fix some appimage issues building with qt 5.15.2
some users are having weird scaling issues since we're using qt 5.12.8 for the appimage
2022-04-28 18:17:02 +02:00
b94f70ea96 Merge pull request #498 from ryanccn/polymc-instance-icon
Add PolyMC icon as instance icon
2022-04-28 07:18:57 +02:00
bd946c78f3 Merge pull request #486 from icelimetea/refactor-java-launcher
Refactor some parts of NewLaunch
2022-04-28 07:18:39 +02:00
a507907443 Merge pull request #477 from flowln/iconfix_static
Always build iconfix as static library
2022-04-28 07:18:22 +02:00
0507b56bed feat: add PolyMC icon as instance icon 2022-04-27 20:30:50 +08:00
ac405aa564 Remove old macOS data migration code 2022-04-25 19:57:47 -04:00
aad7c63282 Merge pull request #482 from TheCodex6824/mojang-auth-fix 2022-04-25 21:55:00 +02:00
1ff459d995 Use suggested error handling 2022-04-25 14:08:27 -04:00
52454ca77b Merge pull request #480 from dschemp/develop 2022-04-25 14:26:10 +02:00
884f772362 Clarify exception messages 2022-04-25 11:22:56 +01:00
bc06571dba Merge pull request #478 from Scrumplex/update-readme 2022-04-25 11:21:21 +02:00
1e8ad3d979 Merge pull request #408 from jamierocks/atl-share-codes 2022-04-25 11:21:10 +02:00
b0a469baab Use java.util.logging instead of custom logging 2022-04-24 15:10:35 +01:00
c968c1be78 Refactor some parts of NewLaunch 2022-04-24 14:45:01 +01:00
a0bafa4952 Re-add base64 decode option for Qt versions that support it 2022-04-23 11:11:55 -04:00
e56f0db11b Remove base64 decode option that was added in Qt 5.15 2022-04-23 10:32:52 -04:00
8bcbe07c87 Fix Mojang auth failing due to Mojang rejecting requests to the profile endpoint 2022-04-22 23:39:38 -04:00
ba9059c7c8 ATLauncher: Replace usage of QPushButton::pressed with ::clicked 2022-04-22 20:37:55 +01:00
45783c1661 ATLauncher: Support using share codes 2022-04-22 20:37:55 +01:00
71777e7a6f added and fixed some Mnemonics in MainWindow 2022-04-22 00:31:03 +02:00
c86ec0bd36 added: Mnemonics for Settings/APIs 2022-04-22 00:23:36 +02:00
08b1b2669a added: Mnemonics for Settings/Accounts 2022-04-22 00:22:50 +02:00
94a655b055 added: Mnemonics for Settings/External Tools 2022-04-22 00:20:54 +02:00
717067e9eb added: Mnemonics for Settings/Proxy 2022-04-22 00:19:54 +02:00
5a5797d914 added: Mnemonics for Settings/Custom Commands 2022-04-22 00:18:39 +02:00
75826aca13 added: Mnemonics for Settings/Java 2022-04-22 00:16:11 +02:00
f52b7c030f added: Mnemonics for Settings/Minecraft+ 2022-04-22 00:14:24 +02:00
c1386bcb04 added: Mnemonics for Settings/Launcher 2022-04-22 00:12:20 +02:00
234a9e48e9 chore: add FUNDING 2022-04-21 22:53:45 +02:00
908e6364c9 fix: update README 2022-04-21 22:52:05 +02:00
3ec511010f fix: Build iconfix as static library
On CI we build using the bundled Quazip, and automatically set
-DBUILD_STATIC_LIBS to true, so it build iconfix statically as well.

However, since we recently added support for using the system quazip,
this flag is not set anymore, and PolyMC fails to run because iconfix
neither is statically linked, nor it creates a .so file for dynamic
linking.

Since most other libs are built statically, we should make this one
static as well. Maybe we should consider allowing for dynamic linking of
libs now that quazip is not much of an issue anymore. :^)
2022-04-21 09:34:44 -03:00
b3e1691c01 fix: hide LauncherLoginStep tokens for non-Debug builds 2022-04-20 18:33:33 +02:00
5adcc26190 Merge pull request #472 from Scrumplex/fix-download-mods-snapshot
fix: disable major version match for snapshots
2022-04-20 21:59:25 +10:00
db6dae7541 fix: disable major version match for snapshots 2022-04-20 09:56:53 +02:00
4e97f2a6fe Merge pull request #470 from kthchew/fix/ml-selector-crash
Fix crash if no Minecraft version is selected in the new instance screen
2022-04-20 09:08:48 +02:00
4643046989 Merge pull request #465 from DioEgizio/bump-1.2.1
bump to 1.2.1
2022-04-20 16:19:20 +10:00
3c3ce71214 Merge pull request #467 from PolyMC/revert-429-develop
Revert "better FreeBSD support"
2022-04-20 08:17:19 +02:00
0682fe544a Fix crash if no Minecraft version is selected in the new instance screen 2022-04-19 22:20:00 -04:00
27e803e4a4 Merge pull request #463 from txtsd/enter_shenanigans
Only trigger macOS instance rename on KeyDown
2022-04-20 08:34:30 +10:00
405c44c9e1 Merge pull request #462 from Scrumplex/fix-world-size-sort
fix: use size in bytes to sort by world size
2022-04-20 08:32:38 +10:00
4c5f701b05 Revert "better FreeBSD support" 2022-04-19 21:49:54 +02:00
c7563a5f7c Merge pull request #454 from kthchew/feature/hardened-runtime 2022-04-19 21:47:57 +02:00
3ff3c335bc Merge pull request #452 from Scrumplex/fix-download-mods-crash 2022-04-19 21:47:05 +02:00
b9d5e1bbf1 Merge pull request #451 from Scrumplex/fix-modloader-selection 2022-04-19 21:01:43 +02:00
e313b366a0 Merge pull request #444 from Scrumplex/fix-release-workflow
Fix release workflow
2022-04-19 21:01:23 +02:00
027c666265 Merge pull request #450 from Scrumplex/fix-quilt-mod-dl 2022-04-19 20:36:37 +02:00
4a3d94aaf9 fix: fix filename of linux portable 2022-04-19 19:06:17 +02:00
c637e3657c bump to 1.2.1 2022-04-19 18:07:42 +02:00
9462dd3ddc Improve security by enabling hardened runtime for macOS
This change also fixes a bug on recent versions of macOS where Minecraft mods that requested access to the microphone would silently fail.
2022-04-19 11:36:03 -04:00
c3524a9d57 fix: bundle binary tarball as user root 2022-04-19 16:18:11 +02:00
53ff66c317 fix: update files for relase workflow 2022-04-19 16:18:11 +02:00
ec2ac2e80c fix: Only trigger rename on KeyPress
This is macOS specific
2022-04-19 18:43:51 +05:30
27c72935f8 fix: use size in bytes to sort by world size 2022-04-19 15:07:14 +02:00
31c757d912 Merge pull request #455 from kthchew/fix/mac-version-num
Fix formatting of version string on macOS
2022-04-19 22:40:01 +10:00
fcdc7a1a35 fix: fix Modrinth query when Quilt is in use 2022-04-19 10:22:50 +02:00
f13c776099 Merge pull request #449 from DioEgizio/CI/specify-build-platform
specify -DLauncher_BUILD_PLATFORM on CI builds (EDIT: also remove "on x")
2022-04-19 09:59:11 +02:00
ebded1ec49 Fix formatting of version string on macOS 2022-04-18 13:56:32 -04:00
7b9d462fbc remove "on x" 2022-04-18 18:31:50 +02:00
c174a1eb01 fix: don't set mod loader as important 2022-04-18 15:05:41 +02:00
ac77997a7a fix: handle network errors when downloading modlist 2022-04-18 14:36:36 +02:00
fa352ff4d3 fix: actually check if a mod loader is selected
Thus also removes a suggestCurrent call from loaderFilterChanged, as it will already be triggered by setSelectedLoaderVersion
2022-04-18 14:15:02 +02:00
fd7745cbeb Merge pull request #442 from kthchew/fix/typos 2022-04-18 13:38:54 +02:00
c348de96e4 Merge pull request #443 from flowln/fix_tr 2022-04-18 13:38:35 +02:00
1bb35b9204 specify -DLauncher_BUILD_PLATFORM on CI builds
more cool
also maybe helps with updater?
2022-04-18 12:22:53 +02:00
cbbcc2d68b fix(translation): don't translate placeholders
Those are modified programatically, and never show up to the user!
2022-04-17 19:24:49 -03:00
fcbf37f60f Fix typos and inconsistent capitalization in sort options 2022-04-17 17:58:51 -04:00
56ce7f5dcd Merge pull request #437 from DioEgizio/bump-1.2.0 2022-04-17 23:51:25 +02:00
0ccbc801cf Merge pull request #411 from kthchew/feature/menubar 2022-04-17 23:19:51 +02:00
4c52cc414f Improve menu bar setting string 2022-04-17 16:39:08 -04:00
6b45386252 Disable instead of hide menu bar option on Linux
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-17 20:32:51 +00:00
3acc761419 Fix bugs with instance menu bar options when opening without instances
- The launch option is no longer empty.
- The program now checks on startup whether an instance is selected to decide whether to disable instance options.

Also, get rid of a dynamic cast.
2022-04-17 12:44:24 -04:00
dd4c67b654 Merge pull request #439 from DioEgizio/CI/new-qt-macos
CHANGE: use Qt 5.15.3 (from brew) on macos
2022-04-17 16:59:05 +05:30
0c581cfb62 CHANGE: use Qt 5.15.3 (from brew) on macos
More updated Qt means less bugs and generally less issues.
The only drawback is losing MacOS Sierra support
2022-04-17 09:53:30 +02:00
703bf9bb7a Merge pull request #431 from Scrumplex/feat-quilt-modrinth
Query for Fabric mods if Quilt is in use
2022-04-17 13:46:22 +10:00
a40dee2230 Merge pull request #436 from flowln/bundled_libs
Don't force bundled libraries by default
2022-04-17 13:45:20 +10:00
cab9afa45f fix: query for Fabric mods if Quilt is in use
Right now we want to include Fabric mods in our searches where possible.
Modrinth allows definining multiple loaders, while Flame only allows a
single value.

As a compromise we ask for Fabric mods only on Flame and for both Fabric
and Quilt mods on Modrinth.
2022-04-16 23:40:10 +02:00
ba5946dc60 Merge pull request #336 from Scrumplex/refactor-portable 2022-04-16 21:25:05 +02:00
9bad83a551 Use TranslatedAction instead of QAction for menu bar actions 2022-04-16 13:35:13 -04:00
a549828655 Remove the Edit menu bar menu
It wouldn't bring much utility.

- The keyboard shortcuts for copy/paste/etc. already work and are well-known. The menu bar likely doesn't need to advertise them.
- There's not very many places you would be able to use these options in the main window (because there's not many places to type stuff in the main window). It would only be applicable on systems with a native menu bar that shows in all other windows as well (but again, the keyboard shortcuts still work).

Also, rename `actionWiki` -> `actionOpenWiki` to match the corresponding `on_actionOpenWiki_triggered`
2022-04-16 13:17:34 -04:00
c1398a6a1a bump to 1.2.0 2022-04-16 18:30:15 +02:00
e11d1b5202 Merge pull request #429 from Irgendwer01/develop
better FreeBSD support
2022-04-16 18:21:54 +02:00
abdb846c3f fix: set install prefix for Linux to /usr 2022-04-16 18:13:12 +02:00
b0b6dd8f87 fix(actions): remove macdeployqt 2022-04-16 18:13:12 +02:00
4a971226e4 refactor(actions): combine steps for unified builds 2022-04-16 18:13:12 +02:00
b10d4d3b8f fix: drop BUNDLE_DEST_DIR 2022-04-16 18:13:12 +02:00
6ed130fc16 fix: don't allow portable builds on macOS 2022-04-16 18:13:12 +02:00
90d4acd1a1 refactor: combine portable and system builds
Portable builds now have the same layout as system builds. If you want
to build a portable bundle, you now need to additionally install the
`portable` component.

For example:

    $ cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install ...
    $ cmake --build build
    $ cmake --install build
    $ cmake --install build --component portable
2022-04-16 18:13:09 +02:00
a42d2afcee Merge pull request #392 from flowln/mod_filter 2022-04-16 18:03:03 +02:00
ba020fbd21 fix: Don't error when not finding valid system quazip 2022-04-16 11:27:00 -03:00
af167e8e67 libs: update bundled submodules 2022-04-16 10:23:15 -03:00
be82f4db9e libs: Don't force bundled libs
Now that QuaZip 1.3 is released, packages from package managers can
include the patch needed for PolyMC, so we can use the users system
libraries if available.
2022-04-16 10:10:13 -03:00
6a97ac603a Use preexisting actions in the menu bar
The code is now much cleaner.

Because the actions already present are enabled elsewhere even when the menu bar is hidden, keyboard shortcuts added to them automatically work regardless of whether the menu bar is visible. This means that the hacky workaround related to this can be removed.
2022-04-16 03:32:08 -04:00
e59d3a339f Close the current window instead of the main window from the menu bar
Systems with native menu bars show the same menu bar for all child windows. As a result, you cannot assume that the menu bar's parent (the `MainWindow`) will be the window in focus.
2022-04-16 02:07:29 -04:00
db7cb12551 Merge pull request #430 from DioEgizio/make-helppages-on-their-own-dir
CHANGE: switch the help pages to their own dir
2022-04-16 10:18:04 +10:00
1049507b3f Add logged in accounts to the profiles menu bar menu
Additionally, add keyboard shortcuts for switching between different accounts.
2022-04-15 19:55:49 -04:00
1303771b58 Add option to always show menu bar instead of toolbar
For those who like keyboard navigation at the expense of aesthetics.
2022-04-15 18:26:41 -04:00
f6605bc3f8 Implement help (open wiki) menu bar action 2022-04-15 16:44:27 -04:00
80ec178d5f Fix keyboard shortcut for delete instance on some devices
My laptop has a key labeled "delete," but for some reason it doesn't work with `QKeySequence::Delete`. Instead it's interpreted as a backspace.
2022-04-15 16:38:26 -04:00
ef76bd355a Merge pull request #398 from kthchew/feature/ml-instance-creation 2022-04-15 22:36:02 +02:00
b0a8bd7dfe Improve menu bar keyboard usability
More reasonable (unique) menu access keys were chosen.

In addition, move the settings action from the Help menu to the Edit menu.
2022-04-15 16:29:29 -04:00
5d8d7740ba Only enable instance options while an instance is selected 2022-04-15 15:55:03 -04:00
3e64935844 Add Quilt install option while creating an instance 2022-04-15 15:37:08 -04:00
7577115c3c Fix Fabric versions appearing for unsupported MC versions
Also remove an old TODO comment, mentioning an issue that was already fixed.
2022-04-15 15:37:08 -04:00
2cb242e9b3 Show no loader selected message when add instance window first opens
This resolves an issue where the message only shows when selecting a mod loader and then selecting "None" again.
2022-04-15 15:37:07 -04:00
7aeccbb6b0 Fix build on Qt 5.6 2022-04-15 15:37:07 -04:00
8406c7f431 Add option to install mod loader during instance creation 2022-04-15 15:37:07 -04:00
8c98cc9458 Merge pull request #333 from oynqr/build/lto 2022-04-15 16:02:06 +02:00
715d7d4424 Merge pull request #417 from Scrumplex/feat-install-manpage
Install manpage on Linux system builds
2022-04-15 21:53:50 +10:00
8e9eca6a97 ui: resize mod download dialog using its parents geometry 2022-04-15 08:49:43 -03:00
5f15f51610 ui: underline search button text when changing filters
This hopefully makes it easier to the user to know that their changes
will only apply after hitting the search button.

I tried setting the background color, but it seems more unreliable on
cross-platform than underlining. Also, it could be worse for daltonic people,
so I don't know what to do :(
2022-04-15 08:49:43 -03:00
277de41200 rework: make the filter as a tabbed widget in the dialog itself
Still needs a clear indication that the filter only applies after you
click the search button...
2022-04-15 08:49:43 -03:00
63bce04648 fix: Polish usage in some cases
Also fiz some typos
2022-04-15 08:49:43 -03:00
76dfb7825a fix: 'All' filter working and get around CF API capabilities 2022-04-15 08:49:43 -03:00
5cb0e75093 fix(ui): Refresh mod list when changing filtering options 2022-04-15 08:49:41 -03:00
c730fd6e5f feat: Use version filter when searching mods 2022-04-15 08:45:30 -03:00
c2b97c3e3f feat: Integrate newly created filter dialog in ModPage 2022-04-15 08:42:30 -03:00
e0ab8207ed feat: Add dialog to filter mod options in mod download 2022-04-15 08:41:12 -03:00
ecad388846 Merge branch 'PolyMC:develop' into develop 2022-04-15 13:04:25 +02:00
9a120f43c8 Update MinecraftInstance.cpp 2022-04-15 13:03:48 +02:00
4ff1306e0c Merge pull request #185 from Scrumplex/quilt
Quilt support
2022-04-15 11:38:50 +02:00
1dd663af6e CHANGE: switch the help pages to their own dir
also renames modrinth-platform/curseforge-platform to just Mod-platform since they have the pages are basically the same
2022-04-15 11:15:17 +02:00
06d9821b2c Update MinecraftInstance.cpp 2022-04-15 01:51:28 +02:00
abb20c65e3 better FreeBSD support 2022-04-15 01:40:25 +02:00
9fb5674233 refactor: cleanup ModLoaderType 2022-04-14 21:55:03 +02:00
18ac109e5a fix: support Quilt from Minecraft 1.14 onwards 2022-04-14 17:20:07 +02:00
14a0e85862 fix: remove unused code 2022-04-14 16:50:04 +02:00
fa2b3bcc63 feat: install manpage 2022-04-10 23:01:00 +02:00
620555d210 Merge pull request #413 from Regular-Baf/develop
Successfully switch to new discord logo. Hopefully.
2022-04-10 12:23:17 +10:00
ea3ceb382a Update launcher/resources/multimc/scalable/discord.svg
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-09 23:42:08 +00:00
37a30fbc3f Update discord.svg 2022-04-09 13:22:39 +00:00
99193a2d7b Update discord.svg 2022-04-09 13:16:55 +00:00
abfb99ba3f Nevermind. It does. 2022-04-09 13:16:03 +00:00
fcb311eecd size doesnt matter? 2022-04-09 13:11:33 +00:00
54e4f88ada Attempt implementing the new discord logo 2022-04-09 13:00:27 +00:00
89125fde22 refactor: switch Quilt mappings to hashed MojMap 2022-04-09 14:56:07 +02:00
9f3eed6ca2 Fix typos causing build failures on non-macOS systems
It also did the exact opposite thing I was trying to do, so that's fixed too...
2022-04-08 17:00:42 -04:00
ab82358dcb Show and hide the menu bar with the 'alt' key
Only applicable for systems without a native menu bar (i.e. almost anything that is not macOS or Ubuntu Unity). On these systems, the menu bar appears on top of the window, which does not look good next to the tool bar already up there.

When the menu bar is hidden, the keyboard shortcuts set by the menu bar are disabled. They should always work, so this also adds a workaround for that.
2022-04-08 16:21:52 -04:00
75fddd0052 Create menubar prototype
Some stuff still needs to be fixed:

- The close window option always closes the main window, even if it is not the currently active window (only applicable on systems with native menu bar)
- None of the (text) editing actions are enabled
- Actions related to instances should only be active when an instance is selected
- The open wiki option ("PolyMC Help") needs to be implemented
- Delete instance keyboard shortcut does not seem to work on my system. Test further
- It would be nice if the profiles menu had all of the logged in accounts, and if they could be selected from that menu (preferably with keyboard shortcuts, probably Ctrl + 1, Ctrl + 2, ...)
2022-04-08 15:39:30 -04:00
8a2c5f5b0d Merge pull request #407 from DioEgizio/upstream-cherrypick 2022-04-08 16:18:28 +02:00
66caac0bbc Update launcher/JavaCommon.cpp
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-04-08 11:16:00 +02:00
ab8d897bd7 Merge pull request #409 from flowln/tasks 2022-04-08 09:45:06 +02:00
3024dbcf2c Apply suggestion
Co-authored-by: Kenneth Chew <79120643+kthchew@users.noreply.github.com>
2022-04-08 08:50:32 +02:00
eeae3eca67 test: add new test to Task test
Also adds one more check to setStatus test
2022-04-07 19:42:26 -03:00
d0cda6d605 test: add basic Task unit test
Only only two tests for now. We can iterate on this later :^)

This is to try to avoid breaking things again!
2022-04-07 19:08:01 -03:00
167e32a69f fix: allow aborting CF modpack importing 2022-04-07 18:56:34 -03:00
be2512bb4b fix: issue with status of non-sequencial tasks 2022-04-07 18:41:32 -03:00
c3f1c13a31 Merge pull request #272 from Kranzes/develop 2022-04-07 20:30:26 +02:00
35cfb41a9c fix: check for Quilt as Fabric-compatible loader 2022-04-07 18:46:09 +02:00
74cdf5350d fix: restrict quilt-mappings versions to MC version 2022-04-07 18:46:00 +02:00
9349232bd4 refactor: dynamically get best version for intermediary mappings 2022-04-07 18:46:00 +02:00
1811302deb NOISSUE save custom offline player name 2022-04-07 18:29:15 +02:00
e6564aa69f NOISSUE fix error string for Xbox authorization failures 2022-04-07 18:29:10 +02:00
566a83b245 NOISSUE prevent -version being passed to the JRE
We want specific JREs, always, not something that is magically resolved.
This counteracts some really bad advice recently being spread on reddit.
2022-04-07 18:28:27 +02:00
9eb9ddc668 feat: initial Quilt support 2022-04-07 18:11:40 +02:00
cc5261051f Merge pull request #364 from Scrumplex/fix-i18n2
Fix translatable strings 2
2022-04-07 23:20:54 +10:00
fa870bc026 Merge pull request #380 from flowln/task-progress 2022-04-06 10:52:38 +02:00
99d569ed0e Merge pull request #384 from jamierocks/technic-improvements 2022-04-06 10:52:27 +02:00
a1a7b9c151 Merge pull request #397 from DioEgizio/manymc-detect-aarch64 2022-04-06 10:52:15 +02:00
Una
dc6340bf38 Allow components to specify Java agents and JVM arguments (#175) 2022-04-06 08:22:24 +02:00
8732bea99b Merge pull request #395 from HarryPeach/develop 2022-04-05 18:01:00 +02:00
bbc6b71138 Merge pull request #389 from DioEgizio/CI/remove-useless-deadcode 2022-04-04 21:03:34 +02:00
5fb096d7b9 Merge pull request #345 from Scrumplex/handle-incompatible-java 2022-04-04 21:01:49 +02:00
cf8680f1ab fix: properly detect arm64 2022-04-04 16:41:23 +02:00
115d8b5945 Merge pull request #390 from PolyMC/ZekeSmith-patch-matrix-reddit
Update matrix and add reddit links
2022-04-04 09:39:40 +02:00
bd8b61651a Check for empty slug before setting pack url 2022-04-03 23:12:46 +01:00
d2ffaee9f8 remove deadcode in CI 2022-04-03 14:43:02 +02:00
8f61633551 Merge pull request #381 from Scrumplex/merge-stable 2022-04-03 13:21:58 +02:00
d33d5b847d Merge pull request #387 from Scrumplex/fix-world-size
fix: calculate world sizes individually
2022-04-03 20:45:23 +10:00
c8879df621 Merge pull request #385 from PolyMC/ZekeSmith-patch-1
Update README.md
2022-04-03 20:42:34 +10:00
c367769781 Update CMakeLists.txt 2022-04-03 20:39:44 +10:00
02b44256b2 Fix matrix links and add reddit 2022-04-03 20:37:50 +10:00
b6e722a048 BuildConfig: Make Technic API base URL and build constants 2022-04-02 13:53:44 +01:00
7f2615b2a5 Technic: Verify checksums for pack build mods 2022-04-02 13:53:44 +01:00
a232c2d509 Technic: Display available versions for Solder packs 2022-04-02 13:53:44 +01:00
c8205fda9f Technic: Replace inline parsing code with API models 2022-04-02 13:53:44 +01:00
8df88e7fbb Technic: Add API models for Solder packs 2022-04-02 13:53:44 +01:00
c8092269ba Technic: Match CurseForge pack description format 2022-04-02 13:53:44 +01:00
9d88f07955 Technic: Include the modpack version in instance title 2022-04-02 13:53:43 +01:00
f267375ac2 Technic: Prevent potential HTML injection 2022-04-02 13:53:43 +01:00
d44fa416ca Technic: Allow pack API urls to be used in search
This mimics the behaviour that the Technic launcher has, and their
website displays API URLs for.

The big benefit of this, is to be able to install private packs now :)
2022-04-02 13:53:43 +01:00
41d7b27d43 fix: calculate world sizes individually 2022-04-02 13:29:37 +02:00
5f461374b8 Update README.md 2022-04-02 17:25:49 +10:00
d5576779b7 Merge pull request #383 from PolyMC/ZekeSmith-license
Update License
2022-04-02 06:11:48 +02:00
c098be40ab flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03)
  → 'github:edolstra/flake-compat/64a525ee38886ab9028e6f61790de0832aa3ef03' (2022-03-25)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/e9545762b032559c27d8ec9141ed63ceca1aa1ac' (2022-03-10)
  → 'github:nixos/nixpkgs/30d3d79b7d3607d56546dd2a6b49e156ba0ec634' (2022-03-25)
2022-04-02 02:35:44 +03:00
333f7cc320 Merge pull request #373 from Scrumplex/feat-world-size 2022-04-02 00:59:15 +02:00
9180c751d8 fix(launch/VerifyJava): reword log output 2022-04-02 00:54:48 +02:00
131a04653f Update License 2022-04-02 07:52:07 +10:00
6e6d495bc7 nix: build with latest jdk version 2022-04-01 16:55:51 +03:00
2c07f758a0 nix: refactor flake (drop flake-utils) 2022-04-01 16:55:51 +03:00
251f0efec2 Merge remote-tracking branch 'upstream/stable' into develop 2022-04-01 15:33:33 +02:00
e8697068fb fix: codestyle 2022-04-01 15:00:05 +02:00
269c1bbf58 Merge pull request #370 from embeddedt/develop
Make launcher icon grayscale for pe_light theme
2022-04-01 22:58:54 +10:00
9b8493c304 feat: Use a single progress dialog when doing multiple tasks
This puts all mod downloading tasks inside a SequentialTask, which is,
for more than one task, a multi step task. This is handled by the
ProgressDialog by showing both the global progress of tasks executed,
and the individual progress of each of them.
2022-04-01 09:32:00 -03:00
c389a711ed fix: remove redundant include 2022-04-01 13:14:04 +02:00
382548e0a7 Merge pull request #355 from dada513/flatpak_properly
Fix flatpak properly
2022-04-01 21:03:14 +10:00
a90fc3d7fe Merge pull request #375 from dada513/fix_modrinth_url 2022-04-01 07:57:59 +02:00
48a6380e31 Fix modrinth usable URL in mod downloader 2022-03-31 20:39:10 +02:00
64ca96f470 feat: track and display world size 2022-03-31 18:45:17 +02:00
59b3e30821 Scrumplex moment 2022-03-31 16:11:04 +02:00
92e5e0e95b Make launcher icon grayscale for pe_light theme 2022-03-30 10:51:37 -04:00
9202996c62 fix(i18n): remove brand names from translations 2022-03-29 15:25:21 +02:00
e22d54abd3 Merge pull request #344 from oynqr/build/allow-disabling-tests 2022-03-29 14:42:49 +02:00
b53ba12fa2 Merge pull request #360 from FayneAldan/patch-2 2022-03-29 14:34:14 +02:00
335115041c Merge pull request #348 from txtsd/issues
Issue template changes
2022-03-29 11:26:22 +02:00
bac67800be Merge pull request #312 from Scrumplex/add-nightly.link
Add nightly.link comments
2022-03-29 11:25:43 +02:00
306df9e17f Merge pull request #352 from Scrumplex/fix-name
Update Credits and Branding
2022-03-29 11:24:48 +02:00
5f2e768376 Merge pull request #356 from flowln/version_optimize
Improve mod versions request to Modrinth
2022-03-29 11:24:12 +02:00
575c92ec47 Merge pull request #357 from FayneAldan/patch-1
Fix POLYMC_JAVA_PATHS env not working on Windows
2022-03-29 11:23:29 +02:00
4d8bf0b621 Convert \s in Windows POLYMC_JAVA_PATHS
Allows you to use either `\` or `/` on Windows
2022-03-28 15:55:54 -06:00
954074942e 😢 fix bully 2022-03-28 20:56:24 +02:00
341eb16a4c Merge branch 'develop' of https://github.com/PolyMC/PolyMC into flatpak_properly 2022-03-28 20:55:06 +02:00
3a7eeff135 Fix 2022-03-28 20:55:03 +02:00
659f93b1de Fix POLYMC_JAVA_PATHS env not working on Windows 2022-03-27 17:21:34 -06:00
ea60e48d9d chore: add license header
chore: add license header
2022-03-27 20:59:56 +02:00
6054abaffb fix(credits): wrap UTF-8 text with QString 2022-03-27 20:59:56 +02:00
3a1feed723 fix: update credits 2022-03-27 20:59:56 +02:00
85f3fc9944 fix: remove "PolyMC" from strings 2022-03-27 20:59:51 +02:00
87cf38a377 Merge pull request #341 from dada513/develop 2022-03-27 20:56:04 +02:00
5e77b548b1 Merge pull request #349 from txtsd/gha_ignore 2022-03-27 20:55:33 +02:00
104de9e795 Merge pull request #220 from flowln/mod_refactor 2022-03-27 20:55:16 +02:00
424f4a72ff Inform user about possible issues when using a Portal as instance folder 2022-03-27 16:08:11 +02:00
ec6409914d newline more like waste 2022-03-27 14:51:48 +02:00
6a25cacc3e Merge branch 'develop' of https://github.com/PolyMC/PolyMC into develop 2022-03-27 14:51:02 +02:00
b1af689546 Add quit launcher after game stops option (Steam Deck)
lecense
2022-03-27 14:50:47 +02:00
0a5dfeb3d7 fix newline (scrumplex nitpick not allowed) 2022-03-27 14:44:40 +02:00
6a180f495f more flatpak fixes 2022-03-27 14:42:02 +02:00
3672dbc5af Fix flatpak properly 2022-03-27 12:43:49 +02:00
81b50c0387 Merge pull request #351 from DioEgizio/lin-nodeps-again 2022-03-26 11:00:44 +01:00
bd60c54911 Merge pull request #314 from Scrumplex/chore-bump-1.1.1
Bump to 1.1.1
2022-03-26 10:55:33 +01:00
87acaa0926 Merge pull request #314 from Scrumplex/chore-bump-1.1.1
Bump to 1.1.1
2022-03-26 09:55:06 +00:00
54d2c91320 bring back portable linux builds 2022-03-26 07:06:37 +01:00
94e7961df0 chore: Don't build release type during development 2022-03-25 23:18:55 +05:30
0d46ea5c71 chore: Ignore more paths 2022-03-25 23:17:14 +05:30
6bd345b1ad fix(templates): Unsplit bulleted line 2022-03-25 22:43:26 +05:30
cb384261b8 fix(templates): Replace dead FAQ link with new wiki link 2022-03-25 22:42:41 +05:30
75301bec4b fix(templates): Use correct labels 2022-03-25 22:41:38 +05:30
d00c320c00 optimize: Improve mod versions request to Modrinth
This uses more arguments in the GET request for mod versions on the
Modrinth API, filtering what versions can be returned, decreasing load
on Modrinth servers and improving a little the time it takes for the versions to be
available to the user.

This also removes the now unneeded check on correct modloaders in
ModrinthPackIndex, since it is now filtered by the Modrinth server.

Lastly, this adds a couple of helper functions in ModModel.
2022-03-24 19:31:11 -03:00
e13ca94061 chore: resolve conflicts and merge upstream 2022-03-24 18:24:51 -03:00
e02369ba6b chore: add license header 2022-03-24 16:10:43 +01:00
82c35f2746 feat: block launch if Java is incompatible
Keep track of compatible Java versions from meta. Launch-step
VerifyJavaInstall will check if current instance's Java version is
compatible.
Also add override option both globally and per-instance in-case the user
doesn't care about the requirement.
2022-03-24 16:10:39 +01:00
a9d935f9ef Merge pull request #337 from oynqr/misc/create-vendored-tarball 2022-03-24 11:16:39 +01:00
92f3154e8f Merge pull request #337 from oynqr/misc/create-vendored-tarball 2022-03-24 11:15:39 +01:00
eb06d0116f Merge pull request #334 from flowln/right_file_2
Fix skipping file in mod version parsing
2022-03-24 11:10:11 +01:00
f66910d054 Merge pull request #334 from flowln/right_file_2
Fix skipping file in mod version parsing
2022-03-24 20:28:12 +11:00
1b47132ebb libnbtplusplus: fix compilation as shared library 2022-03-24 08:32:26 +01:00
a89cbf116d Allow disabling building of tests 2022-03-23 19:48:03 +01:00
471ea680a5 Update used actions and cleanup release flow 2022-03-23 16:18:25 +01:00
51de84407f Create vendored tarball on release 2022-03-23 12:37:44 +01:00
d252917792 Enable LTO for Actions 2022-03-23 11:40:19 +01:00
dfa5f614aa Put LTO behind an optional flag 2022-03-23 10:05:31 +01:00
f3a244e90a fix: fix skipping one on file counting in mod version parse 2022-03-22 19:45:31 -03:00
c7c83a35fa Enable LTO/IPO on release builds 2022-03-22 21:04:35 +01:00
6025cd0ca5 Merge pull request #330 from DioEgizio/notportable
bring back not portable windows builds
2022-03-22 20:11:15 +01:00
ce05ce92bb Merge pull request #322 from oynqr/build/static-rainbow
Build with static rainbow
2022-03-22 20:11:15 +01:00
a5fc640f2c Merge pull request #298 from Scrumplex/fix-i18n
Fix translatable strings
2022-03-22 20:11:15 +01:00
0a4a3fece5 Merge pull request #323 from Scrumplex/retranslate-pages
Retranslate all settings pages
2022-03-22 20:11:15 +01:00
fcf728f3b5 Merge pull request #315 from txtsd/display_scaling
Allow fractional DPI scaling
2022-03-22 20:11:15 +01:00
cd4851c98b Merge pull request #311 from DioEgizio/patch-2
fix webp
2022-03-22 20:11:15 +01:00
3db5f30403 Merge pull request #316 from Scrumplex/fix-disabled-controls 2022-03-22 20:11:15 +01:00
58957122b9 Merge pull request #306 from Scrumplex/limit-instance-lengths
Limit instance names to 128 chars
2022-03-22 20:11:15 +01:00
8b46658b05 Merge pull request #294 from oynqr/msys2
Switch to msys2 for Windows builds
2022-03-22 20:11:15 +01:00
571e322d66 Merge pull request #200 from Scrumplex/scrumplex-license-header 2022-03-22 20:11:15 +01:00
ddda02f092 Merge pull request #292 from lack/offline_username_limits
Limit offline username to 16 characters with override
2022-03-22 20:11:15 +01:00
bf6fa6bce4 Merge pull request #295 from Scrumplex/fix-portable
Make Launcher_PORTABLE work on all platforms
2022-03-22 20:11:15 +01:00
025a3cf730 Merge pull request #296 from flowln/right_file
Use primary file for mod downloading on Modrinth
2022-03-22 20:11:15 +01:00
6d9eaee7f9 Merge pull request #297 from DioEgizio/patch-1
bundle jre8u312 instead of latest on appimage
2022-03-22 20:11:15 +01:00
7471ce4530 Merge pull request #299 from flowln/paste_serv
Remove paste.polymc.org
2022-03-22 20:11:15 +01:00
149ffb844f Merge pull request #278 from Scrumplex/fix-copying
Clarify GPL-3.0-only
2022-03-22 20:11:15 +01:00
4cf3ac42c8 Merge pull request #280 from oynqr/gitdir-notfound-check
Add GITDIR-NOTFOUND check
2022-03-22 20:11:15 +01:00
d16c6b0e69 Merge pull request #265 from Scrumplex/fix-javacheck-appimage
Define JARs path relative to application root
2022-03-22 20:11:15 +01:00
76e1aba58b Merge pull request #273 from DioEgizio/extra-rebranding-macos
extra rebranding for macos
2022-03-22 20:11:15 +01:00
c560d06b8d Merge pull request #270 from flowln/dialog
Make a better "Mod download confirmation dialog"
2022-03-22 20:11:15 +01:00
0681568d3e Merge pull request #254 from Scrumplex/fix-update-metainfo
Update metainfo URLs
2022-03-22 20:11:15 +01:00
c7fdfb8116 Merge pull request #330 from DioEgizio/notportable
bring back not portable windows builds
2022-03-22 16:42:40 +01:00
c6b1a776dc fix some typos 2022-03-22 07:38:00 +01:00
8accb6f04e fix typos
opz :P
2022-03-21 19:29:33 +01:00
d1d055564c fix typo 2022-03-21 19:21:09 +01:00
2741c58a01 bring back notportable builds 2022-03-21 19:11:55 +01:00
64399dd8d6 Merge pull request #322 from oynqr/build/static-rainbow
Build with static rainbow
2022-03-21 16:58:37 +01:00
f2ca11688e Merge pull request #326 from Scrumplex/feat-backport-pr 2022-03-21 15:55:12 +01:00
3c0c57359b feat(actions): add backport bot 2022-03-21 14:46:01 +01:00
062fc79286 Merge pull request #298 from Scrumplex/fix-i18n
Fix translatable strings
2022-03-21 14:21:06 +01:00
2da565f5d4 Merge pull request #323 from Scrumplex/retranslate-pages
Retranslate all settings pages
2022-03-22 00:06:16 +11:00
e8373bbf65 Build with static rainbow 2022-03-21 12:47:42 +01:00
26acc836d9 Revert "fix: use our own prefix for rainbow lib"
This reverts commit 61db1c46beb465c33124ec4f34dfdcefd4d804d3.
2022-03-21 09:40:20 +01:00
9c22af9685 Merge pull request #315 from txtsd/display_scaling
Allow fractional DPI scaling
2022-03-21 11:21:21 +11:00
75d0078a38 fix: retranslate CustomCommands 2022-03-20 21:51:36 +01:00
536b1a23fc fix: retranslate mod download pages 2022-03-20 21:51:23 +01:00
cafff5e504 chore: add license header 2022-03-20 21:40:49 +01:00
dd5c4b6864 App: Retranslate all pages when the language is changed 2022-03-20 20:48:12 +01:00
a2c85a8531 App: Retranslate page header titles
This fixes a bug that is only practically effects the title of the
language page not updating the header when changing the language.
2022-03-20 20:02:21 +01:00
de4d757650 Merge pull request #311 from DioEgizio/patch-2
fix webp
2022-03-20 22:20:02 +05:30
f22cd0e8c7 Merge pull request #316 from Scrumplex/fix-disabled-controls 2022-03-20 17:46:09 +01:00
702a1da0ac fix: disable "Install Forge" button when needed 2022-03-20 15:35:35 +01:00
768007d980 fix: disable "Download mods" button when needed
Fixes #271
2022-03-20 15:34:13 +01:00
2e40ab6244 (fix): Allow fractional DPI scaling 2022-03-20 20:02:24 +05:30
95182ed74b chore: bump version 2022-03-20 15:11:43 +01:00
8bc6cdf55c Merge pull request #306 from Scrumplex/limit-instance-lengths
Limit instance names to 128 chars
2022-03-21 01:04:40 +11:00
6c0b101fed Merge branch 'PolyMC:develop' into patch-2 2022-03-20 15:02:04 +01:00
9841c0a63d Merge pull request #294 from oynqr/msys2
Switch to msys2 for Windows builds
2022-03-21 01:01:05 +11:00
17d200dc88 chore(actions): add nightly.link comments 2022-03-20 14:56:47 +01:00
c8fec556c0 Merge pull request #305 from flowln/gui_changes 2022-03-20 13:39:12 +01:00
b7f2959353 fix 2022-03-20 13:15:56 +01:00
4899d3c458 Merge pull request #200 from Scrumplex/scrumplex-license-header 2022-03-20 12:04:39 +01:00
c311dba465 fix: limit instance names to 128 chars 2022-03-19 23:23:08 +01:00
75ec4256e2 feat(ui): allow users to move toolbars to different places 2022-03-19 17:59:00 -03:00
bb5a91c179 Update CMakeLists.txt 2022-03-19 19:01:51 +01:00
8225f1ac92 Merge pull request #292 from lack/offline_username_limits
Limit offline username to 16 characters with override
2022-03-19 16:02:28 +01:00
06d16c6b13 Merge pull request #295 from Scrumplex/fix-portable
Make Launcher_PORTABLE work on all platforms
2022-03-19 15:59:38 +01:00
90780818ca Limit offline username to 16 characters with override
Offline usernames longer than 16 characters won't be able to connect to
LAN games or offline-mode servers, so just don't let it happen.

Add a checkbox to allow people to unrestrict usernames if they want.

Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
2022-03-19 10:12:07 -04:00
a160bd0062 chore: add license header to files I modified 2022-03-19 12:46:56 +01:00
7e0312493b fix(i18n): improve social platform actions 2022-03-19 12:36:04 +01:00
ccfd06ad21 fix(i18n): remove brand names from translations 2022-03-19 12:35:15 +01:00
48c2146a42 fix(i18n): fix translatable strings 2022-03-19 12:29:46 +01:00
abb9fa8cbd Merge pull request #296 from flowln/right_file
Use primary file for mod downloading on Modrinth
2022-03-19 11:41:36 +11:00
f99245b917 Merge pull request #297 from DioEgizio/patch-1
bundle jre8u312 instead of latest on appimage
2022-03-19 11:40:17 +11:00
e35db82c27 Merge pull request #299 from flowln/paste_serv
Remove paste.polymc.org
2022-03-19 11:39:48 +11:00
6202525372 Readd short rev to artifact names 2022-03-18 22:28:52 +01:00
ec66c8fd3d fix(ui): remove paste.polymc.org 2022-03-18 14:21:42 -03:00
19804c5718 bundle jre8u312 instead of latest
8u320 or higher breaks old forge
2022-03-18 15:28:44 +01:00
fa5fa53592 fix: Use primary file for mod download on Modrinth 2022-03-18 10:52:47 -03:00
da43ed8ce1 fix silly mistakes and merge upstream 2022-03-18 07:54:47 -03:00
2d1f99b765 fix: make Launcher_PORTABLE work on all platforms
Fixes #261
2022-03-18 11:38:13 +01:00
f01b8f29c6 Use Temurin instead of AdoptOpenJDK 2022-03-17 23:32:44 +01:00
440e9731e2 Switch to msys2 for Windows builds 2022-03-17 22:06:06 +01:00
acdb54b88e Merge pull request #278 from Scrumplex/fix-copying
Clarify GPL-3.0-only
2022-03-16 12:37:05 +01:00
00c3336ec8 Merge pull request #280 from oynqr/gitdir-notfound-check
Add GITDIR-NOTFOUND check
2022-03-16 07:27:29 +01:00
a268ac7141 Add GITDIR-NOTFOUND check
This adds a check for a GIT_REFSPEC value of "GITDIR-NOTFOUND" and sets
the VERSION_CHANNEL to stable in that case. Without this change,
"GITDIR-N" is appended to the version string when building from a source
archive instead of a git checkout.
2022-03-15 09:04:43 +01:00
aedb513c9e Merge pull request #265 from Scrumplex/fix-javacheck-appimage
Define JARs path relative to application root
2022-03-14 23:31:38 +01:00
ac3a7acc45 Merge pull request #273 from DioEgizio/extra-rebranding-macos
extra rebranding for macos
2022-03-14 23:31:23 +01:00
8409aa2571 tidy: Fix clang-tidy issues on files changed in this PR
The checks used are roughly the same as the ones proposed in the
clang-tidy PR (except perhaps that I used modernize-* instead of listing
them individually,though I don't think this caused any readability
detriments).

In ModrinthModel.cpp and FlameModModel.cpp I ignored the
modernize-avoid-c-arrays one, mostly because making the sorts array an
std::array would most likely increase the code complexity because of the
virtual function. Aside from that, the static_cast warning from
Application.h was not dealt with, since it's not in this PR's scope.
2022-03-14 17:43:36 -03:00
199740cc61 fix(metainfo): clarify GPL-3.0-only 2022-03-14 18:44:02 +01:00
a0f76cba62 chore: clarify GPL-3.0-only 2022-03-14 18:42:41 +01:00
5b8003cbe5 Merge pull request #188 from PolyMC/removal/notifications
remove notifications
2022-03-15 00:51:28 +11:00
c0719102a0 Merge pull request #270 from flowln/dialog
Make a better "Mod download confirmation dialog"
2022-03-15 00:50:49 +11:00
9d8bbf34e6 Merge pull request #250 from Scrumplex/update-logo 2022-03-13 21:02:47 +01:00
ec9d0e70fb [macos] update copyright and info string 2022-03-13 17:57:25 +01:00
f1e44291cc add translation string 2022-03-13 13:11:35 -03:00
b3b613d8b4 feat(ui): make a better "Mod download confirmation dialog" 2022-03-13 11:50:18 -03:00
177b685557 Merge pull request #240 from PolyMC/ZekeSmith-move-to-wiki
Update Readme to link development building to the website wiki. also fix forking and licensing.
2022-03-14 00:26:09 +11:00
71a4333f55 Update README.md 2022-03-13 23:25:17 +10:00
f1c21a912a fix: simplify header SVG using SVGO 2022-03-13 14:22:31 +01:00
84a142096f chore: switch logo font to Josefin Sans 2022-03-13 14:22:18 +01:00
bb2b344d33 fix: define jars path relative to application root
Fixes #117
2022-03-13 12:48:24 +01:00
b96572774f Merge pull request #254 from Scrumplex/fix-update-metainfo
Update metainfo URLs
2022-03-13 13:22:42 +11:00
641a96e4a9 fix(metainfo): update URLs 2022-03-12 18:17:25 +01:00
9f8983b570 Merge pull request #235 from Scrumplex/chore-bump-1.1.0
Bump to 1.1.0
2022-03-12 13:34:36 +00:00
e42c5b00a4 Merge pull request #251 from flowln/fix_tr 2022-03-12 10:58:36 +01:00
a3d7ad731d fix missing translation strings
my mistake, sorry! ToT
2022-03-11 18:43:17 -03:00
dc98609ef8 Merge pull request #241 from PolyMC/ZekeSmith-move-to-wiki-1 2022-03-11 10:42:13 +01:00
c799faaca6 fix: typos 2022-03-11 09:21:59 +01:00
07e4c4d189 Merge pull request #242 from deadmeu/develop
Fix missing space in "No Accounts" message
2022-03-11 14:53:05 +11:00
c4a8fd353c Merge pull request #243 from dada513/mx_button 2022-03-10 18:52:57 +01:00
91524d6d6e Merge pull request #247 from txtsd/actions_fix
Fix Ubuntu system Qt failure
2022-03-10 23:45:32 +11:00
c1201997a3 Fix Ubuntu system Qt failure 2022-03-10 13:38:16 +05:30
d814e21f0d add matrix button 2022-03-08 18:41:23 +01:00
49d122a2c4 Fix missing space in "No Accounts" message 2022-03-08 23:24:11 +10:00
0813eba367 Update BUILD.md 2022-03-08 19:09:54 +10:00
4fe13c64a1 Update README.md 2022-03-08 19:07:21 +10:00
b3c2a56ece fix: delete semicolons at the end of .cpp file's functions
my lsp is weird sometimes
2022-03-07 19:55:20 -03:00
9c57b54a81 refactor: move things around so that related things are close together
This also adds some comments around ModModel.cpp and ModPage.cpp to add
some ease of reading the code.

Also move some things from headers to cpp files.
2022-03-07 19:32:28 -03:00
b131d3b2ec refactor: move more common code to base class
Also removes unused imports and organize the ModModel header
2022-03-07 18:28:24 -03:00
16bfafa29e refactor: de-duplicate common code in network mod APIs 2022-03-07 17:45:28 -03:00
f714adf6d2 refactor: move NetJob away from ModModel to ModAPI
This is done so that 1. ModAPI behaves more like an actual API instead
of just a helper, and 2. Allows for more easily creating other mod
providers that may or may not use network tasks (foreshadowing lol)
2022-03-07 16:22:57 -03:00
dc9e250868 Merge pull request #232 from Scrumplex/fix-help-links
Switch to polymc.org wiki
2022-03-08 01:22:34 +11:00
b6cf0359fa Merge pull request #230 from Scrumplex/fix-iconthemes
Reorganize icon themes
2022-03-08 01:20:35 +11:00
39bd04f06f refactor: use Enum instead of raw int for ModLoaderType 2022-03-06 16:45:39 -03:00
d755174bee clarify some method names and comments 2022-03-06 16:04:24 -03:00
1229e90817 merge upstream 2022-03-06 15:28:18 -03:00
5a638fa977 refactor: move "get versions" task from page to model
This seems more reasonable
2022-03-06 15:23:00 -03:00
5e9d49a910 refactor: use only a single unique_ptr for the api 2022-03-06 13:54:55 -03:00
ae39d16c11 chore: bump to 1.1.0 2022-03-06 11:40:11 +01:00
b93daf1fb7 fix: update news links to point to polymc.org 2022-03-06 11:32:06 +01:00
6545d250e8 refactor: move help URL into buildconfig 2022-03-06 11:31:50 +01:00
b162351ff4 fix: switch to polymc.org wiki 2022-03-05 21:49:13 +01:00
53468ea474 Merge pull request #221 from flowln/install_button 2022-03-05 20:43:44 +01:00
3697d70b48 fix: reorganize icon themes
Rename MultiMC to Legacy
Simple (Colored) is now the first icon theme
Custom is now the last icon theme, which also fixes a loading issue when
Legacy was selected
Fix loading of Legacy theme
2022-03-05 20:29:54 +01:00
e0c025b162 fix extra spacing in resource packs and shader packs, and move button up
hopefully now its finally ok
2022-03-03 09:51:46 -03:00
9e443faba3 hack: hide 'Download Mods' button when not in the mods tab 2022-03-03 04:02:22 -03:00
f95cebaf06 change 'Install Mods' -> 'Download Mods' and change position 2022-03-03 01:10:10 -03:00
9a8599e4ba fix windows compilation 2022-03-03 00:06:37 -03:00
2d68308d49 refactor: move url creation for mods to modplatform/
Moves all things related to creating the URLs of the mod platforms
that go to network tasks to a single place, so that:

1. Maintaining and fixing eventual issues is more straightforward.
2. Makes it possible to factor out more common code between the
   different modplatform pages
2022-03-02 23:13:04 -03:00
0dd1c26cf3 refactor: extract common code in mod pages and model
This creates a hierarchy in which ModPage and ModModel are the parents
of every mod provider, providing the basic functionality common to all
of them.

It also imposes a unique .ui file (they were already equal before, just
duplicated basically) on all mod providers.
2022-03-02 21:52:44 -03:00
881b2f2b38 refactor: Use a single indexed pack for mods
Since there's little difference between them, let's remove duplication
and merge them.
2022-03-02 18:49:19 -03:00
ca211558b5 Merge pull request #216 from txtsd/ignore_paths
Don't build when updating non-code
2022-03-02 11:48:45 +11:00
3a03f90831 Ignore certain paths for CI 2022-03-02 01:17:08 +05:30
9020f632b2 Merge pull request #214 from PolyMC/ZekeSmith-newReadme
Modify readme to use website
2022-03-01 16:56:41 +01:00
8bdd2befe9 Merge pull request #205 from timoreo22/fix-version-select
Fixed wrong version info
2022-03-01 16:56:10 +01:00
ebececf8c6 Update and link latest build to actions 2022-03-01 23:19:30 +10:00
e1f28be151 Merge pull request #163 from txtsd/windows_data_dir
Replace build layouts with Launcher_PORTABLE cmake flag
2022-03-02 00:03:31 +11:00
10231aa404 Modify readme to use website 2022-03-01 10:33:59 +10:00
139ff82432 Merge pull request #207 from flowln/curseforge_api 2022-02-28 13:35:58 +01:00
4e8f075ff3 fix: Do not loop when its not a fabric mod on Flame version validation
Since there's no validation for forge mods since the start, we were just
looping with no porpuse in this situation.
2022-02-27 22:02:43 -03:00
148775b3e9 Update FMLLIBS_BASE_URL
Updated FMLLIBS_BASE_URL to https://files.polymc.org/fmllibs/

Fixes #208
2022-02-27 19:40:52 +00:00
075d900d45 fix: Always tell Flame API which modloader we are using
Fixes #206 partially. Although we don't list mods that have no
compatibility with the mod loader we are using, mods that have support
for both loaders still show up, and the versions for both the loaders
are still shown.

Also simplifies a little the logic in
FlameModIndex::loadIndexedPackVersions
2022-02-27 16:07:45 -03:00
5d1ca33b84 Apply suggestions from code review
Co-authored-by: LennyMcLennington <lenny@sneed.church>
2022-02-27 08:35:47 -08:00
ccc493cb2b Cleanly free NetJob in flame modpack 2022-02-27 13:14:12 +01:00
2745325ae0 Fixed wrong version info 2022-02-27 11:55:24 +01:00
84e9ce71b0 Merge pull request #203 from glowiak/patch-4 2022-02-27 09:53:56 +01:00
88fc1e32ee Merge pull request #201 from Scrumplex/fix-instancetype-reregistration 2022-02-26 14:37:27 +01:00
4f975bfb04 Notify about needed AppBSD version 2022-02-26 13:04:35 +01:00
692b9cf0e0 Merge pull request #195 from babbaj/nix-refactor
nix: Use POLYMC_JAVA_PATHS
2022-02-26 07:34:19 +01:00
ae354688c9 Merge pull request #193 from flowln/develop
Allow for downloading multiple mods at once
2022-02-26 07:33:11 +01:00
c9bf7f9896 fix: load instances no matter their instance type 2022-02-26 00:31:37 +01:00
e8929599a5 nix: Use POLYMC_JAVA_PATHS 2022-02-25 16:47:47 -05:00
27f37315f8 Merge pull request #199 from Scrumplex/fix-translations 2022-02-25 17:47:08 +01:00
c4f4e9e620 merge upstream and resolve conflicts 2022-02-25 13:43:27 -03:00
f2b850ad20 Merge pull request #183 from timoreo22/fix-versions-segfault
Fixed segfault in mod download
2022-02-26 01:55:11 +11:00
ccc27d1b7c Merge pull request #192 from Scrumplex/refactor-remove-legacy-instances
Drop legacy instances
2022-02-26 01:54:15 +11:00
4835ec3f6d fix(i18n): update translations URL 2022-02-25 15:19:15 +01:00
40a9828fba fix: improve readability and set ok button as disabled by default 2022-02-23 19:17:33 -03:00
04840d0638 fix(ui): add translation func to text in the confirm dialog 2022-02-23 14:44:55 -03:00
38f12c50f7 Merge branch 'PolyMC:develop' into develop 2022-02-23 14:34:51 -03:00
ca8b62291f fix: use legacy data path if it exists 2022-02-23 16:22:53 +05:30
69d01204e0 Implement PR suggestions 2022-02-23 16:22:53 +05:30
1e3b896fda Replace layouts with LAUNCH_PORTABLE 2022-02-23 16:22:23 +05:30
9e35560554 Merge pull request #158 from txtsd/actions
CI: Release builds and workflow
2022-02-23 10:36:47 +01:00
f9d4751ec0 Use System Qt for generic Linux build 2022-02-22 20:40:16 +05:30
a66e6a413f Merge pull request #169 from Scrumplex/rfc-template
Add issue template for RFCs
2022-02-23 00:10:09 +10:00
2c911a5475 Merge pull request #174 from dada513/readme_better
Prepare readme for 1.1.0, mark unofficial packages as unofficial
2022-02-23 00:09:56 +10:00
e2c2a38005 Merge pull request #186 from theglitch76-forks/develop
Enable WSL support
2022-02-22 08:23:57 +01:00
aa4a6bb3be Merge pull request #172 from Scrumplex/fix-update-client-id
Switch to new MSA Client ID
2022-02-22 08:23:42 +01:00
4af020161d Merge pull request #180 from Scrumplex/feat-msa-clientid-detection
Detect MSA Client ID change
2022-02-22 08:23:28 +01:00
f8b0d6453a fix: sort mod list in confirmation dialog 2022-02-21 23:25:33 -03:00
0102e91940 feat: add confirm dialog for installing mods
When selecting multiple mods at once, it can become hard to keep track
of which ones you selected.

To address this, a dialog is now displayed
when you finish selecting the mods to download, showing you which ones
you selected and their filenames. From there, you can either accept it
and download the mods, or you can cancel it and go back to the mod
selection dialog.
2022-02-21 23:09:14 -03:00
1004211a66 fix(ui): change text in selection button when there's no valid version 2022-02-21 22:52:50 -03:00
f5cf4eb45f feat(ui): allow downloading multiple mods from CurseForge at once 2022-02-21 21:53:21 -03:00
512395e3f1 feat(ui): allow downloading multiple mods in Modrinth at once 2022-02-21 21:34:53 -03:00
9c6727e27f feat: change task container in ModDownloadDialog to a QHash
Previously, we used a unique_ptr to a ModDownloadTask to keep track of
the selected mod to download when we accepted the dialog.

In order to allow multiple mods to be selected at once for download,
this has been changed to a QHash where the key is the mods name (since
it doesn't seem right to allow for multiple versions of the same mod to
be downloaded at once), and the value is a pointer to the corresponding
ModDownloadTask.
2022-02-21 21:34:06 -03:00
624ab25cd4 refactor: set default InstanceType to OneSix 2022-02-21 22:59:07 +01:00
a70d1f1a91 refactor: drop LegacyInstance 2022-02-21 22:30:44 +01:00
3059f13011 refactor: drop migration for pre-component instances 2022-02-21 22:11:10 +01:00
6d1f9d4d02 fix 2022-02-21 12:44:34 -05:00
d3e7d30ee0 Create releases in a separate workflow 2022-02-21 21:48:31 +05:30
5bbb4f31dc Add generic Linux system builds 2022-02-21 21:48:31 +05:30
da70122d9c remove notifications 2022-02-20 19:23:08 -05:00
8556ff5eac Revert ba6a97557a0d90d77e9eba560931414e39042447
Let evil win.
2022-02-20 15:00:23 -06:00
adacab3349 Fixed segfault when closing window while version info download is still going 2022-02-19 15:17:45 +01:00
613b351f13 Merge pull request #168 from Kloenk/nix_flake_meta
Nix flake meta
2022-02-19 08:25:30 +01:00
80a29af497 fix: typo for account disabled error messages 2022-02-18 19:18:29 +01:00
7e1fad55d9 Merge pull request #178 from Scrumplex/add-contributor-covenant
Add Contributor Covenant 2.1
2022-02-19 00:09:59 +10:00
9b7cd029a7 Grab short version 2022-02-18 19:27:15 +05:30
c5d9944993 feat(accounts): interrupt MSAStep when client ID doesn't match 2022-02-18 12:32:24 +01:00
14717396eb feat(accounts): save client id in MSAStep 2022-02-18 12:32:24 +01:00
9c71f364d2 feat(accounts): add disabled account state 2022-02-18 12:32:24 +01:00
be910374dc feat(accounts): support msa-client-id value 2022-02-18 12:32:24 +01:00
10de75623e readd all packages 2022-02-18 10:28:17 +01:00
7fc55b58fe chore: clarify trolling in code of conduct 2022-02-18 09:44:27 +01:00
12c8a04458 Merge pull request #173 from Scrumplex/fix-application-cpp
fix: improve code readability in Application.cpp
2022-02-17 23:43:59 +00:00
796e58b6f2 Merge pull request #176 from PolyMC/upstream-merge
upstream merge
2022-02-17 23:34:50 +00:00
a7d37fa69a chore: add Contributor Covenant 2022-02-17 23:55:34 +01:00
7b4b997a34 Merge remote-tracking branch 'upstream/develop' into develop 2022-02-17 15:47:43 -05:00
6b4469c6cc fix: combine errors if --launch is missing 2022-02-17 15:29:09 +01:00
107a0ea852 fix2 2022-02-17 13:19:35 +01:00
6d7676202f unofficial => community maintained 2022-02-17 12:53:44 +01:00
0305b7a1fd Prepare readme for 1.1.0, mark unofficial packages as unofficial 2022-02-17 11:55:09 +01:00
02384f81c7 Merge pull request #131 from glowiak/patch-1
Add Slackware package
2022-02-17 11:32:17 +01:00
4536b19512 Merge pull request #171 from DioEgizio/fix-org.polymc-macos
Change: set MACOSX_BUNDLE_GUI_IDENTIFIER to org.polymc (fixes org.multimc.PolyMC)
2022-02-16 21:07:50 +01:00
45f89c6255 Merge branch 'develop' into patch-1 2022-02-16 18:36:28 +01:00
b1cf77e847 update 2022-02-16 18:31:34 +01:00
037b0d7190 fix: improve code readability in Application.cpp 2022-02-16 17:33:28 +01:00
ff17202b43 refactor: switch to new MSA Client ID 2022-02-16 17:03:13 +01:00
a3d8313dcb Change: set MACOSX_BUNDLE_GUI_IDENTIFIER to org.polymc instead of org.multimc 2022-02-16 15:45:16 +01:00
36841eaf63 chore(github): add issue template for RFCs 2022-02-16 12:38:28 +01:00
e24a183dad Only trigger GH Release on stable branch 2022-02-15 14:38:26 +05:30
8596753a63 Allow building release builds and…
…trigger GH release using tags
2022-02-15 14:24:52 +05:30
51183bef33 nix: add meta attribute 2022-02-14 21:08:10 +01:00
2cd837896d Merge pull request #160 from Scrumplex/custom-be-gone 2022-02-14 16:56:53 +01:00
c75ae71190 flake.nix: drop aarch64-darwin
Currently qtbase is broken on aarch64-darwin, therefor dropping support, so the check can succeed
2022-02-14 15:45:51 +01:00
48c20f5aaa Merge pull request #164 from Scrumplex/rebase-stable
Merge stable into develop
2022-02-14 10:10:35 +01:00
929a035f96 Revert "make wsl work"
This reverts commit 5779f20fa1633577889b7bda839c5486eb2ba922.
2022-02-13 18:47:54 +00:00
5779f20fa1 make wsl work 2022-02-13 13:35:15 -05:00
384e0df9e1 Merge remote-tracking branch 'upstream/stable' into rebase-stable 2022-02-13 18:08:41 +01:00
a5b06514c6 Merge pull request #161 from Scrumplex/custom-clientid
Add MSA-Client-ID override in UI
2022-02-13 14:06:27 +00:00
a309f4e721 fix: MSA = Microsoft Authentication 2022-02-12 21:27:35 +01:00
159d868b77 fix(ui): explain why 'Add Microsoft' might be disabled 2022-02-12 21:27:35 +01:00
0854e83ce4 feat: implement MSA client id override
Closes #11
2022-02-12 21:27:32 +01:00
bb02226870 feat(ui): add custom MSA client id setting 2022-02-12 21:05:42 +01:00
9ddbaaf7e8 feat: use commit hash for channel if ref not available 2022-02-12 19:04:45 +01:00
3b7cc4391a fix: don't use custom for version channel
Closes #159
2022-02-12 18:17:56 +01:00
70a055bc27 Merge pull request #143 from Scrumplex/refactor-link-nbtpp-static 2022-02-12 17:47:38 +01:00
61db1c46be fix: use our own prefix for rainbow lib 2022-02-12 17:02:54 +01:00
a60b2feb5f Revert "refactor(build): link rainbow statically"
Windows build fails for some reason. Needs to be investigated later

This reverts commit 812f00eb81158bfb4c2d61b228c0c1c796641ac1.
2022-02-12 16:56:35 +01:00
6ba031f048 refactor(build): link iconfix statically 2022-02-12 16:10:53 +01:00
812f00eb81 refactor(build): link rainbow statically 2022-02-12 16:10:46 +01:00
2f6973e08b Merge pull request #157 from txtsd/actions_fix
Adjust OpenSSL step
2022-02-12 03:15:11 -08:00
fb14796ed7 Adjust OpenSSL step 2022-02-12 14:56:15 +05:30
7d912726d0 Merge pull request #134 from glowiak/patch-2
OpenBSD support and slackware build instructions
2022-02-12 03:30:24 +00:00
e3c8eb062c Merge pull request #149 from ZekeSmith/patch-1
License for assets
2022-02-12 03:29:59 +00:00
3cf81faabc change "loader mods" to "mods"
Closes: #128
2022-02-11 22:09:47 -05:00
0df605e559 Merge pull request #155 from txtsd/actions
fix(ci): Unsplit OpenSSL step
2022-02-12 02:22:23 +00:00
e97a6ef957 Unsplit OpenSSL step 2022-02-12 00:19:11 +05:30
c4dd8d9c72 Update LICENSE 2022-02-12 01:03:33 +10:00
bcfa3246cb Merge pull request #146 from dada513/macos_application_support
[MACOS] Move app data to Application Support
2022-02-11 13:52:56 +00:00
f67871e79e refactor(build): link nbt++ statically 2022-02-11 14:24:01 +01:00
11f892380e Merge pull request #145 from dada513/metainfix
Update metadata
2022-02-11 13:54:14 +01:00
fd72cb034c Merge pull request #140 from txtsd/actions
CI: Build AppImages
2022-02-11 12:38:03 +00:00
b9be8d08d2 Remove superfluous variable 2022-02-11 18:05:26 +05:30
33d369d78c Add missing deploy flags 2022-02-11 18:05:26 +05:30
0e6e6a7521 Remove generic Linux builds
They don't necessarily run on all distros
2022-02-11 18:05:26 +05:30
eb692c2ee9 Split OpenSSL step 2022-02-11 18:05:26 +05:30
3eee38fedd Make 32bit Windows build instead 2022-02-11 18:05:26 +05:30
0ba61bb590 Implement even more PR suggestions 2022-02-11 18:05:26 +05:30
9497485103 Implement more PR suggestions 2022-02-11 18:05:26 +05:30
551d9c86ba Implement PR suggestions 2022-02-11 18:05:26 +05:30
e61e827eb9 Use Adoptium JREs 2022-02-11 18:05:26 +05:30
92a5b12bd9 Remove PrefersNonDefaultGPU 2022-02-11 18:05:26 +05:30
35d1330fe2 Build AppImages for Linux
Now builds windows and macOS builds,
with windeployqt and macdeploqt.
Also adds SHA to the build filenames.
2022-02-11 18:05:26 +05:30
b4e0b7584a newlines 2022-02-11 13:17:11 +01:00
2341212337 Merge pull request #150 from dada513/fix_kwin_icon
Fix freedesktop icons. Again
2022-02-11 12:05:01 +00:00
53ea261350 Merge pull request #151 from dada513/rss_not_begone
Re-add RSS feed with the new PolyMC website
2022-02-11 12:03:29 +00:00
a17e5d0a4d Merge pull request #129 from timoreo22/fix-mod-name
Fixed the download menu putting the wrong name
2022-02-10 23:41:27 +00:00
5d4a66ed8a Merge pull request #152 from Scrumplex/update-translations-url
Update link to translations platform (Weblate)
2022-02-10 23:38:47 +00:00
8d2e7db178 fix: update link to translations platform 2022-02-10 14:55:52 +01:00
383c93ff01 Merge pull request #148 from helpimnotdrowning/develop
Fix Weblate link in README
2022-02-10 13:40:12 +00:00
13d41bde7f remove unused parsing of dates (bloat) 2022-02-10 13:57:18 +01:00
d42d6fe25a fix rss format 2022-02-10 13:57:06 +01:00
beaac54dc9 Merge remote-tracking branch 'polymc/develop' into rss_not_begone 2022-02-10 13:14:30 +01:00
70f8cb81b8 Initial RSS re-add and removed hardcoded strings 2022-02-10 13:14:25 +01:00
f8ca6b4867 Revert "refactor: remove news feed"
This reverts commit 361ce7818ec8891e9a35bdfac4cdea77a0b6a949.
2022-02-10 12:55:07 +01:00
49f5f67467 Update screenshots to use new site 2022-02-10 12:26:33 +01:00
35d2ae3ef7 Remove drama from readme and remove mmc discord link 2022-02-10 11:21:25 +00:00
22ca572ae0 ci: rebuild 2022-02-10 09:32:12 +01:00
619fcbfabf rename LAUNCHER_DESKTOPNAME to LAUNCHER_DESKTOPFILENAME 2022-02-10 08:56:34 +01:00
292869141f Merge remote-tracking branch 'polymc/develop' into fix_kwin_icon 2022-02-10 08:05:17 +01:00
ca9929214d Merge remote-tracking branch 'polymc/develop' into macos_application_support 2022-02-10 08:04:59 +01:00
121ad4e4bf Merge remote-tracking branch 'polymc/develop' into metainfix 2022-02-10 08:04:38 +01:00
2f87a4477e Fix desktop id for GH-150 2022-02-10 07:53:04 +01:00
d72c511131 Revert "Fix freedesktop icons" and fix icon on kwin 2022-02-10 07:46:41 +01:00
8b68c06547 License for assets
The PolyMC logo and assets are licensed under the CC BY-NC-SA 4.0 having it in this folder should help to clear this up.
2022-02-10 13:58:19 +10:00
b911151786 Fix Weblate link in README
original link was missing /projects/ dir and leading to a nonexistant page
2022-02-09 21:40:57 -06:00
7531a2894b Missed a closing parenthesis in README.md, oops. 2022-02-09 23:13:33 +00:00
5b507a8944 Add info about translating PolyMC to the README 2022-02-09 23:00:03 +00:00
d2f86cbf32 Move app data to Application Support 2022-02-09 12:23:18 +01:00
08dff6613b remove redundant data 2022-02-09 08:21:51 +01:00
901ec15dc8 Update metadata 2022-02-09 08:19:34 +01:00
5284d604ef translations 2022-02-09 00:02:51 +00:00
b2b4ab3f0c Update BUILD.md 2022-02-07 10:11:36 +01:00
b646fc5a13 Update build instructions for Slackware 14.2 2022-02-06 12:18:39 +01:00
d35cbfd9c4 Add Slackware instructions 2022-02-06 12:11:20 +01:00
f25152e068 Update BUILD.md 2022-02-06 12:06:08 +01:00
dd8946b15a Update BUILD.md 2022-02-06 12:03:17 +01:00
305350fdc8 Update BUILD.md 2022-02-06 09:41:13 +01:00
f31d5372e7 Update BUILD.md 2022-02-06 09:39:14 +01:00
ca1a2bbe2c Add OpenBSD instructions 2022-02-06 09:38:26 +01:00
dba9199e58 Support OpenBSD in UpdateController.cpp 2022-02-06 09:35:48 +01:00
e806903d7e Support OpenBSD without patches 2022-02-06 09:32:55 +01:00
41d8e3cbd7 add arches 2022-02-05 16:07:31 +01:00
5e32783c4e Update README.md 2022-02-05 16:05:34 +01:00
fdc3a4104b Add OpenBSD 2022-02-05 16:03:16 +01:00
8199941a81 Fix typo 2022-02-05 14:04:34 +01:00
651d237200 Update README.md 2022-02-04 21:07:34 +01:00
6f5b380199 Update README.md 2022-02-04 20:58:12 +01:00
c746d77a06 Update README.md
Co-authored-by: dada513 <dada513@protonmail.com>
2022-02-04 20:42:30 +01:00
9ab3841570 change fbsd icon
Co-authored-by: dada513 <dada513@protonmail.com>
2022-02-04 20:40:47 +01:00
3a28741cc3 Add FreeBSD 2022-02-04 18:12:32 +01:00
22f7a85cf2 Add Slackware package 2022-02-04 17:59:37 +01:00
86935068f5 Fix wrong mod file name 2022-02-04 16:24:19 +01:00
00e12b776b Merge pull request #126 from Scrumplex/fix-quazip-build
fix: link QuaZip statically
2022-02-04 07:40:09 -05:00
3b96a9a8fa Merge pull request #124 from babbaj/develop
nix: fix quazip input
2022-02-04 07:34:13 -05:00
5ac5c767e0 Merge pull request #125 from dada513/based_build_md
fix build.md
2022-02-04 07:33:22 -05:00
f1d3d4a366 fix: link QuaZip statically 2022-02-04 13:24:13 +01:00
1160066f0d fix build.md 2022-02-04 11:06:04 +00:00
8d603d6162 nix: fix quazip input 2022-02-04 02:13:48 -05:00
076efc4cb2 Merge branch 'update-quazip' of git://github.com/Scrumplex/PolyMC into develop 2022-02-03 14:14:12 -05:00
2c62a34c2f Merge branch 'feature/offline_mode' into develop 2022-02-03 13:59:25 -05:00
2177aa2a6b Merge branch 'offline-mode-accounts' of git://github.com/NyaomiDEV/PolyMC into feature/offline_mode 2022-02-03 13:54:27 -05:00
e8a4902a3d Merge branch 'feature/download_mods' into develop 2022-02-03 13:53:30 -05:00
e2952061af Merge branch 'feature/download_mods' of git://github.com/timoreo22/PolyMC into feature/download_mods 2022-02-03 13:45:20 -05:00
fcc4420cfe Merge branch 'feature/close_after_launch' into develop 2022-02-03 13:44:09 -05:00
f5358aa1ca Merge branch 'develop' into feature/close_after_launch 2022-02-03 13:43:44 -05:00
3d3f9a8609 make closeAfterLaunch good 2022-02-03 12:50:24 -05:00
1f176fcb7b fix aur formatting in README 2022-02-03 12:47:16 -05:00
3ca661127f NOISSUE Add missing tooltip for Export Instance action 2022-02-03 18:09:51 +01:00
407f9d9ef0 Merge remote-tracking branch 'upstream/develop' into develop 2022-02-02 11:17:04 -05:00
bff683e6d4 Merge pull request #108 from redstrate/improve_about_page
Improve the About page
2022-02-02 09:17:30 -05:00
770da6317e Merge pull request #122 from txtsd/actions
GitHub Actions for crossplatform builds
2022-02-02 09:14:12 -05:00
cf3c2482c9 fix some windows branding
Closes: #121
2022-02-02 08:46:26 -05:00
2001c5dec7 Merge pull request #123 from Skyblueborb/patch-1
Fix Gentoo Command Syntax
2022-02-02 08:41:31 -05:00
80cf716c98 Fix Gentoo Command Syntax
The proper syntax for adding repos is `eselect repository enable <repo>`
2022-02-02 10:34:26 +01:00
37e1962845 Add build.yml 2022-02-02 06:28:00 +00:00
f8c5d80c66 Merge pull request #4480 from Oreoezi/develop
Update BUILD.md
2022-02-01 22:33:45 +01:00
11841c47e6 Double braindead combo 2022-02-01 22:23:34 +01:00
71b1ac9f34 Fix braindead moments 2022-02-01 21:56:52 +01:00
eda06df878 Update BUILD.md 2022-02-01 20:33:38 +00:00
c4cb7ddc4f fix: bring back JAR Folder mods
what is this?
2022-01-31 21:40:59 +01:00
a8089b76c0 fix: bring back instance exports 2022-01-31 21:40:59 +01:00
71516e6c72 fix: set Launcher_FORCE_BUNDLED_LIBS=on by default
We need to wait for a new QuaZip release to become widely available, until we can turn this off again
2022-01-31 21:40:59 +01:00
88686ef065 refactor: restructure CMake to support future Qt versions 2022-01-31 21:40:59 +01:00
0442b80a2c refactor: simpler includes for quazip 2022-01-31 21:40:59 +01:00
81c72c2038 refactor: bring back methods that need to be reimplemented 2022-01-31 21:40:59 +01:00
3aa809b8c0 refactor: add in-tree QuaZip 2022-01-31 21:40:59 +01:00
efa414c442 refactor: initial migration to QuaZip 1.2
Let's move off our custom QuaZip. In the olden times we needed the
custom version of QuaZip, as it was basically unmaintained and on
SourceForge (eww). But nowadays it's maintained and on GitHub. See
new GitHub page: https://github.com/stachenov/quazip
2022-01-31 21:40:59 +01:00
c39da093bf change COPR to polymc/polymc 2022-01-31 12:35:30 -05:00
aa2c27bf69 Update to Modrinth API V2 2022-01-31 17:18:11 +01:00
1f92125a7f Move RPM package to a separate repo. 2022-01-31 10:41:05 -05:00
5c48b7dfab Merge pull request #104 from dada513/makedeb
Remove debian packages from repo
2022-01-31 10:40:12 -05:00
d664361b15 remove deb packaging 2022-01-31 10:36:57 -05:00
813de1c703 pkgs: remove debian packaging from repo 2022-01-31 16:03:50 +01:00
02f24117f0 better package list 2022-01-31 10:00:25 -05:00
7a7a937f1e remove changelog because it's annoying 2022-01-31 09:54:16 -05:00
0211ee3ef1 Add "PolyMC Contributors" to Credits section
This also adds a link to the PolyMC Contributors page on Github.
2022-01-31 09:09:58 -05:00
c569bfbe6d Merge pull request #111 from DioEgizio/patch-1
improve a bit MacOS build instructions
2022-01-30 11:33:42 -05:00
b925338688 Merge pull request #112 from muscaln/flake
Nix updates
2022-01-30 11:32:49 -05:00
2cf04d034a Merge pull request #4300 from Ghosty141/feature/screenshot_copy
GH-4044 Implemented copy screenshots to the clipboard
2022-01-30 16:11:47 +01:00
049aafd0a1 Merge pull request #4461 from Jan200101/rpm
Update rpm spec to support OpenSuse and conform to Fedora guidelines
2022-01-30 16:07:51 +01:00
e0a04c5031 Lock offline mode support behind insertion of at least one Minecraft account
Co-Authored-By: Naomi Calabretta <tony0000.ac@gmail.com>
2022-01-30 02:42:29 +01:00
9d23ac562f Add offline mode support 2022-01-30 02:35:56 +01:00
0065a29901 Close after Launch setting 2022-01-29 19:04:44 -05:00
8ea1ebaf1b I haven't tested qt 5.6, i use 5.12 2022-01-29 18:14:56 +01:00
5c2d3e430d Merge branch 'develop' into patch-1 2022-01-29 18:10:46 +01:00
b710b719a8 nix: use .desktop file provided by cmake 2022-01-29 17:38:12 +03:00
7df5091fdc flake.lock: Update
Flake lock file changes:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/74f7e4319258e287b0f9cb95426c9853b282730b' (2021-11-28)
  → 'github:numtide/flake-utils/846b2ae0fc4cc943637d3d1def4454213e203cba' (2022-01-20)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/b2737d4980a17cc2b7d600d7d0b32fd7333aca88' (2022-01-11)
  → 'github:nixos/nixpkgs/945ec499041db73043f745fad3b2a3a01e826081' (2022-01-26)
2022-01-29 17:35:50 +03:00
5abb97362f Merge pull request #102 from dada513/rework_docs
docs: rework README and BUILD
2022-01-29 09:24:08 -05:00
b34239ebc6 adoptium 2022-01-29 11:00:13 +01:00
7ef6c586c5 update readme 2022-01-29 10:59:04 +01:00
9d36cf4b5a fix another typo (omg I'm doing too commits) 2022-01-29 10:26:13 +01:00
04be2404ce fix typo 2022-01-29 10:24:49 +01:00
7f4fd04cfe not needed actually 2022-01-29 10:24:06 +01:00
b2bcdb9d9b fix a typo+explain better 2022-01-29 10:18:12 +01:00
d81e2bb0b0 extra refinements 2022-01-29 10:14:00 +01:00
177c10bb0f fix MacOS build instructions 2022-01-29 10:12:04 +01:00
304775952f EVEN MORE BASED 2022-01-29 09:40:27 +01:00
ca00103ee2 make packaging based 2022-01-29 08:56:04 +01:00
3aa9f5c376 Update rpm spec to support OpenSuse and conform to Fedora guidelines 2022-01-28 19:42:30 +01:00
efc44c56a6 Fix button being present in other pages 2022-01-28 19:32:42 +01:00
8b790a6dd9 Merge branch 'PolyMC:develop' into feature/download_mods 2022-01-28 18:12:35 +01:00
f36930d812 Merge pull request #107 from redstrate/fix_icon_bug
Fix icons changing when exiting the settings window
2022-01-28 09:31:41 -05:00
232295bda7 add gentoo instructions 2022-01-28 09:12:55 +01:00
451768ccf9 Merge remote-tracking branch 'upstream/develop' into rework_docs 2022-01-28 09:10:47 +01:00
c1aaf89baa Improve the About page
Improves #106. This more clearly marks the original MultiMC contributors,
and now correctly hides the "Build Platform" if this is set as empty. The
version label is now moved under the "PolyMC" title so it looks just a
little bit better (and matches other applications). The copyright on the
"About" page now correctly attributes the MultiMC contributors just like on
the "License" page.
2022-01-27 19:06:07 -05:00
5ac528f141 Fix icons changing when exiting the settings window 2022-01-27 18:37:57 -05:00
204e3dca22 fix version 2022-01-27 17:23:50 -05:00
33aac2985a Merge pull request #105 from Scrumplex/rss-begone
Remove news
2022-01-27 17:00:15 -05:00
361ce7818e refactor: remove news feed
Closes #63
2022-01-27 22:59:20 +01:00
ad6e3a0868 Fix meta 2022-01-27 16:58:28 -05:00
fd2269ac15 Fix meta 2022-01-27 16:54:05 -05:00
14a8ead6b4 fix conflict 2022-01-27 19:01:20 +01:00
bbf0508846 docs: rework README and BUILD 2022-01-27 18:59:44 +01:00
79314ee67b Merge pull request #103 from redstrate/fix_rpm_build
Fix RPM build instructions
2022-01-27 12:43:54 -05:00
86b0637ef7 Merge pull request #101 from redstrate/fix_freedesktop_icon
Fix Freedesktop icons
2022-01-27 09:56:39 -05:00
1c982b0182 Fix RPM build instructions 2022-01-27 13:17:26 +00:00
cd5faee7d7 Fix RPM spec referencing old desktop file 2022-01-27 08:06:35 -05:00
ec1e27031a Fix Freedesktop icons
This fixes #51. The desktop file is now exactly the same as the window class,
which is also now corrected to org.polymc.polymc. The file capitalization
is also consistent with other Freedesktop files as well.
2022-01-27 00:08:53 -05:00
02889b7a11 Merge pull request #67 from PolyMC/feature/no_paste_ee
Full replacement of paste.ee
2022-01-26 17:40:49 -05:00
0eff21a4f1 Validate Pastebin URL with regex 2022-01-26 00:34:02 +00:00
0680945839 Merge pull request #96 from dada513/develop
rebase with upstream
2022-01-24 19:36:31 -05:00
631e670775 Merge pull request #99 from Jan200101/PR/rpm-opensuse
remove explicit dependencies, correct dependencies to work on OpenSuse
2022-01-24 18:40:44 -05:00
4edd2cff9f remove explicit dependencies, correct dependencies to work on OpenSuse 2022-01-24 23:15:54 +01:00
0235eb5c28 Fix error message
The code is trying to get a string from a json object, and if that fails it should log "is not a string", not "is not a timestamp".
2022-01-24 11:44:47 +01:00
8804b035b2 NOISSUE log server response when failing to fetch profile 2022-01-24 11:44:47 +01:00
54e3438e37 NOISSUE correctly set http status code in auth reply 2022-01-24 11:44:47 +01:00
ddfed7bb87 NOISSUE in java checker, ignore invalid lines altogether
Declaring them as errors is just causing problems because Java
randomly prints garbage to STDOUT now.
2022-01-24 11:44:47 +01:00
70c04745ee NOISSUE add some logging to profile fetching failures 2022-01-24 11:44:47 +01:00
63d4486855 Merge pull request #4447 from Stypox/patch-1
Fix error message
2022-01-24 10:32:14 +01:00
1d0e6bf453 Changed modrinth author data to not be a list 2022-01-24 07:23:01 +01:00
a2d88f6df4 Fixed spacing 2022-01-24 07:12:19 +01:00
019c77f9f7 Merge pull request #52 from oynqr/develop
Default to system locale language
2022-01-23 15:00:26 -05:00
5b5c5afc3a Merge pull request #88 from Scrumplex/launch-msa-login
Add open page & copy code button to MSA login dialog
2022-01-23 14:55:05 -05:00
af20b5ee0e support paste.polymc.org 2022-01-23 12:54:58 -05:00
a1b779da15 Merge pull request #95 from danielhuang/patch-1
Add StartupWMClass to desktop file
2022-01-23 12:05:39 -05:00
8b31c638f3 Fix error message
The code is trying to get a string from a json object, and if that fails it should log "is not a string", not "is not a timestamp".
2022-01-22 21:58:32 +01:00
6961a39cd2 feat: Assign java max mem based on system RAM
If the system has <6GB RAM, it uses (system RAM / 1.5)
If the system has >=6GB, it uses 4GB

Signed-off-by: txtsd <code@ihavea.quest>
2022-01-23 02:12:03 +05:30
3da69d8e53 Update org.polymc.PolyMC.desktop.in 2022-01-22 14:13:21 -05:00
dd76fb0ec7 feat(MSALogin): add open page & copy code button
Closes #55
2022-01-20 21:04:48 +01:00
caeab926bc PasteUpload: Trim whitespace from response body 2022-01-19 19:05:52 +00:00
35caa3c21a Merge pull request #87 from Scrumplex/themed-header-image
Header image's text color should follow GitHub theme
2022-01-19 13:06:45 -05:00
7022d3d401 fix(readme): header color should follow GH theme
As browser color scheme preference and GitHub theme can be different
from each other, let's follow GitHub theme instead of browser
preference.
2022-01-19 18:59:24 +01:00
6d22794cf9 Reduce spaghettiness 2022-01-19 09:47:09 +01:00
b50e584369 PasteUpload task changed to use 0x0.st's protocol
- Modified PasteUpload task to upload the log file to 0x0.st and other
  services with the same protocol.

- Modified Paste settings UI to allow the user to select a custom paste
  URL, simplified the settings page code.
2022-01-19 08:27:26 +00:00
affc2521aa Various fixes 2022-01-18 12:28:55 +01:00
63098b6f19 Merge pull request #4428 from MandipJoshi/patch-1
Update README.md copyright date changed
2022-01-17 10:00:40 +01:00
83e1dd285a Set default lang only if index received 2022-01-17 09:52:04 +01:00
b9beb3c7d2 Sort system locale to front of list 2022-01-17 09:52:04 +01:00
2dd2555a63 Update selected language automatically 2022-01-17 09:52:04 +01:00
126e6d13aa Use isEmpty instead of 0 length check 2022-01-17 09:52:04 +01:00
236c0166f6 Default to system locale language 2022-01-17 09:52:04 +01:00
9a33fb1f49 Update README.md 2022-01-17 12:09:36 +05:45
2c2c22ccf8 Merge pull request #82 from PolyMC/revert-offline-mode
Revert offline mode support (#81 and #50)
2022-01-17 03:56:27 +00:00
55597b458c Revert "Merge pull request #50 from bexnoss/offline-mode"
This reverts commit b4f750e7db40352111417ea89a9f375ae8c746ab, reversing
changes made to b19e3156154ba0dd232a3d165b1759c57e2858f2.
2022-01-17 03:45:47 +00:00
f55297eca9 Revert "Merge pull request #81 from bexnoss/fix-msa-account-refresh"
This reverts commit 0bc8baf1172d6967cdb2993826e3469ecd9aab66, reversing
changes made to 81fe41a038ee12ff2ee0200525b39e4ad650bec2.
2022-01-17 03:45:33 +00:00
0bc8baf117 Merge pull request #81 from bexnoss/fix-msa-account-refresh 2022-01-16 17:32:13 -05:00
5f9270ed4b Fix MSA account refresh 2022-01-16 23:30:17 +01:00
81fe41a038 Default to colored icons, update copyright
Closes: #74
2022-01-16 12:03:30 -05:00
0316cf88aa Merge pull request #78 from bexnoss/readme-svg-header 2022-01-16 10:33:35 -05:00
917f8a31e3 NOISSUE log server response when failing to fetch profile 2022-01-16 12:51:42 +01:00
aa770b63fb NOISSUE correctly set http status code in auth reply 2022-01-16 12:46:20 +01:00
c1bf31cb27 NOISSUE in java checker, ignore invalid lines altogether
Declaring them as errors is just causing problems because Java
randomly prints garbage to STDOUT now.
2022-01-16 12:05:40 +01:00
86d99f80c3 NOISSUE add some logging to profile fetching failures 2022-01-16 11:43:19 +01:00
975f77756d Added curseforge selection 2022-01-16 11:20:21 +01:00
8172dcd2d5 Replace PNG README header with SVG
Instead of GitHub specific MarkDown based theming this uses CSS in SVG.
2022-01-16 07:55:10 +01:00
b95c27ceef fix readme formatting 2022-01-15 21:26:00 -05:00
f78bb90ed9 GH-4125 fix it better 2022-01-15 16:25:52 -05:00
dc129fd886 GH-4125 workaround for java printing garbage to stdout on bedrock linux 2022-01-15 16:25:52 -05:00
621e0ba4a8 Added smart file selection
This might fail in a few special cases
2022-01-15 10:25:24 +01:00
f6de472da2 Added a no version message 2022-01-15 09:06:48 +01:00
4b37c46889 Filtering per mod loader & mc version 2022-01-15 08:51:47 +01:00
c371558883 Merge pull request #68 from GriffintheFolf/execname
Fix program executable name for shell script
2022-01-14 21:46:46 -05:00
0bbd0ac0b9 Change method of shell script fix per suggestion
The Launcher.in file is now modified rather than CMakeLists.txt
2022-01-14 19:28:10 -07:00
ac93c64cd4 Fix program executable name for shell script 2022-01-14 16:59:16 -07:00
6cd4375aff add arch linux package to readme
closes: #53
2022-01-14 18:39:25 -05:00
a606b47a22 pastebin URL app setting 2022-01-14 18:30:02 -05:00
a62155c1c9 preliminary stuff for paste.ee removal 2022-01-14 18:20:06 -05:00
b4f750e7db Merge pull request #50 from bexnoss/offline-mode
Offline Mode Support
2022-01-14 18:03:35 -05:00
b19e315615 Set maximum memory allocated to 4GB by default 2022-01-14 17:34:50 -05:00
41dba376a8 remove 5 from display name
Closes: #58
2022-01-14 17:33:34 -05:00
2896f70cd8 Removing copyrights 2022-01-14 22:07:54 +01:00
1a8c972aef Fixed icons
Also having a mod loader is now enforced
2022-01-14 20:22:15 +01:00
cdaa397dcf Reword offline mode disclaimer 2022-01-14 14:19:31 +01:00
9e6fa8f29a Added the downloading of the mods 2022-01-14 12:47:18 +01:00
4d599eb118 Added modrinth icon 2022-01-14 10:51:44 +01:00
4e9039be2d Start of mod downloading 2022-01-14 09:56:27 +01:00
395e265564 Add offline mode disclaimer 2022-01-14 00:01:05 +01:00
b07853c9ef Merge pull request #61 from meguminloli/develop 2022-01-13 13:55:29 -05:00
b635a7e693 update NIX.md 2022-01-13 15:43:29 +02:00
f84fc783b6 removed redundant recs
removed file
2022-01-13 15:29:10 +02:00
2301a934b0 Merge pull request #59 from A-UNDERSCORE-D/patch-1 2022-01-13 08:19:08 -05:00
60e9d2754a changed flake.nix
removed result
2022-01-13 13:14:50 +02:00
A_D
d06c2cacb1 Readd original MultiMC/Launcher copyright
The original MMC code remains Apache.
2022-01-13 09:59:16 +02:00
49c2bd477c Merge pull request #45 from cidkidnix/develop 2022-01-12 21:11:09 -05:00
46a3b4de6e Remove unnecessary semicolon 2022-01-12 18:41:33 +01:00
6ecc8c5496 Remove unnecessary license header 2022-01-12 14:57:32 +01:00
a1ff3b1ee3 Add offline mode support 2022-01-12 14:26:02 +01:00
d4b522b6cb Add offline mode UI 2022-01-12 10:36:26 +01:00
3b524e99cc Merge pull request #46 from muscaln/java 2022-01-11 14:44:21 -05:00
3329d94c9b Introduce POLYMC_JAVA_PATHS env 2022-01-11 18:24:37 +03:00
a12118f1a0 Sort java versions from current to oldest 2022-01-11 17:40:58 +03:00
5fe33a98a2 nix: remove patch due to breakage 2022-01-10 18:24:49 -06:00
1d8196e11a More rebranding
Closes: #39

Mostly done with rebranding now. We just need to translate some services
to PolyMC.
2022-01-10 12:47:35 -05:00
c7f6f94930 Merge pull request #42 from Eonfge/patch-1 2022-01-10 12:02:12 -05:00
131615811b Set PrefersNonDefaultGPU for hybrid devices
With the Property 'PrefersNonDefaultGPU', you can signal to dekstop environments like GNOME that you want to run the application using the more powerful secondary graphics card, if such a card is available. Specification: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html

With this change, you won't have to include a special prime-run script.
2022-01-10 14:55:18 +01:00
3fa6e22430 Merge pull request #40 from Jan200101/PR/rpm-1.0.5 2022-01-09 17:57:18 -05:00
c86ac772c8 Update RPM and build instruction 2022-01-09 21:51:56 +01:00
1cc7a193c2 add logo to different styles
Also fixed genicons to automate this.
2022-01-09 14:18:51 -05:00
e50d07f791 remove patreon stuff
Closes: #22

Update to 1.0.5

Remove "Forking/Redistribution" tab in About (why is it even there?)

Metainfo now corresponds to version

add discord

Completely removed Patreon.
2022-01-09 13:51:46 -05:00
b515cb478e fix empty exec line when binary_name is unset 2022-01-09 13:34:01 -05:00
29e9d65cb2 rpm readme update 2022-01-09 13:32:12 -05:00
42574f185e Merge pull request #38 from cidkidnix/develop
Nix: Package fixup
2022-01-09 13:28:32 -05:00
92872e957b nix: package fixup 2022-01-09 12:00:37 -06:00
20747dd50a Merge pull request #37 from Jan200101/PR/rpm
rework rpm spec
2022-01-09 13:00:14 -05:00
a83cb2f2b8 rework rpm spec 2022-01-09 18:50:00 +01:00
541f26b33a Merge pull request #29 from cidkidnix/develop 2022-01-09 10:58:51 -05:00
459aafbca4 Merge pull request #34 from muscaln/develop 2022-01-09 10:56:47 -05:00
9bd86f84de nix: make sure tarball is pointed to proper repo
Co-authored-by: Louis Bettens <lourkeur@users.noreply.github.com>
2022-01-09 08:37:47 -06:00
0ce1b68261 Don't import channel as root, import channel as user
Co-authored-by: Louis Bettens <lourkeur@users.noreply.github.com>
2022-01-09 08:35:52 -06:00
fe9ce7a329 Make instuctions more clear 2022-01-09 08:17:52 -06:00
8ccef671d5 Update instructions 2022-01-09 08:16:15 -06:00
957cd29dbf nix: add support for non-flake builds 2022-01-09 17:08:19 +03:00
72656d41df Merge branch 'develop' into develop 2022-01-09 04:16:15 -06:00
15f62e54ab Make readme reflect new flake changes 2022-01-09 04:12:55 -06:00
5a09dcae68 forgot linebreak 2022-01-09 00:19:21 -05:00
87af5f631d Update branding: New Logo (#30)
New logo
Co-authored-by: swirl <swurl@swurl.xyz>
2022-01-09 00:13:15 -05:00
27eca06947 rpm in readme 2022-01-08 23:55:59 -05:00
c63b5bb132 Merge pull request #32 from getchoo/add-rpm-packaging
add rpm build script and spec file
2022-01-08 23:52:05 -05:00
3b09ee97be Merge pull request #33 from getchoo/remove-wsl-detection
stop cmake from blocking builds on wsl
2022-01-08 23:51:10 -05:00
59ef13f032 add documentation for building a .rpm 2022-01-08 23:13:10 -05:00
390a90b361 stop cmake from blocking builds on wsl 2022-01-08 22:49:30 -05:00
2ca094bd57 add rpm build script and spec file 2022-01-08 22:44:18 -05:00
42eb011e3f Merge pull request #31 from muscaln/flake 2022-01-08 19:59:10 -05:00
4a9d9b268a nix: fix 'nix run' 2022-01-09 02:40:13 +03:00
ae3c613f6c nix: use user package set on overlay and switch to ninja 2022-01-09 01:36:28 +03:00
ccde63bbab add nix result path to .gitignore 2022-01-09 01:36:28 +03:00
9499acedab nix: fix overlay 2022-01-09 00:40:55 +03:00
2a760a8e32 Revert "nix: revert overlay changes and add conditionals to derivation for flake build" 2022-01-08 23:09:53 +03:00
6065b4dcf9 nix: revert overlay changes and add conditionals to derivation for flake build 2022-01-08 23:06:56 +03:00
9611b92b07 nix: fix build 2022-01-08 22:33:06 +03:00
d29d020d6f {nix,flake}: add submodules 2022-01-08 22:33:06 +03:00
8d4f8795de nix: update package and remove meta section since we are not on nixpkgs 2022-01-08 22:33:06 +03:00
b1fa551fd2 flake: updates 2022-01-08 22:33:06 +03:00
8d184958d8 nix: init flake 2022-01-08 22:32:49 +03:00
1e51827ba3 add LICENSE file explicitly
Closes: #24
2022-01-08 10:32:30 -05:00
2776453dfe Make README.md look better for nix 2022-01-08 09:31:50 -06:00
e544637333 Add to README.md 2022-01-08 09:30:51 -06:00
e665d52044 add missing char 2022-01-08 09:28:37 -06:00
0ec2170b5e Add documentation for nix package 2022-01-08 09:27:47 -06:00
83fcebe2a9 Merge pull request #25 from cidkidnix/develop 2022-01-08 10:17:39 -05:00
0399fa7d2a Fix wrong path in overlay 2022-01-08 09:15:24 -06:00
8d000d29fa Fix desktop file and move directories around 2022-01-08 09:12:44 -06:00
52420963cf GH-4125 fix it better 2022-01-08 12:26:16 +01:00
addf5f4e52 NOISSUE update README for clarity 2022-01-08 11:45:10 +01:00
03d7300732 GH-4125 workaround for java printing garbage to stdout on bedrock linux 2022-01-08 11:14:07 +01:00
d68980810a make sure we use our desktop file 2022-01-08 01:50:23 -06:00
2a88099094 fix build 2022-01-08 01:45:52 -06:00
069d4dd2d1 Opps forgot something 2022-01-08 01:42:24 -06:00
e8f56d399b Fix desktop file 2022-01-08 01:41:31 -06:00
73c0a0d43b Make nix support not rely on flakes 2022-01-08 01:34:32 -06:00
fc81b81c26 Add nixos support 2022-01-08 01:33:26 -06:00
2c7d248703 New pixel Ouroboros logo by @karolinaabb 2022-01-06 22:42:33 -05:00
2e43d6cffa match license in metainfo
Closes: #18
2022-01-06 22:37:37 -05:00
915c658a52 Merge pull request #17 from dada513/develop
Fix metainfo parsing
2022-01-04 16:44:23 -05:00
3dcc7dee6c cleaner difference between flatpak and normal manifest 2022-01-04 15:43:41 +01:00
07649b6388 Fix metainfo parsing 2022-01-04 07:31:10 +01:00
0e4ccaca02 fix icon and version
Closes: #16

Fixed the icon so Qt renders it properly, and actually renders it
properly in the About page. Also, scaled it up a bit

Changed launcher.svg icon to temporary Ouroboros logo

fixed genicons again

Fix version to 1.0.3 (making tag rn)

Install the PolyMC icon properly.
2022-01-03 17:46:05 -05:00
b3d8ecb467 fix genicons.sh to new rDNS stuff 2022-01-03 15:54:08 -05:00
97d4b947d0 update README
grammar/punctuation
2022-01-03 15:42:44 -05:00
3613ffa80e rDNS for icons and desktop file, and metainfo
Closes: #12, #13
2022-01-03 15:42:09 -05:00
38a1772f86 Merge pull request #14 from dada513/flathub
Change flatpak to flathub
2022-01-03 15:35:13 -05:00
4382344a7c Merge pull request #15 from dada513/debian_update 2022-01-03 07:55:17 -05:00
c7283adb9f change up deb packaging 2022-01-03 12:13:16 +01:00
672646384f remove icon 2022-01-03 12:08:54 +01:00
52e156908e Change flatpak to flathub 2022-01-03 11:59:23 +01:00
30f899f37d fix2 2021-12-31 17:04:58 -05:00
9dc3647f32 fix desktop file 2021-12-31 16:52:55 -05:00
3f3c5ea247 Rebranding logo
add temporary Ouroboros logo, thanks Lenny for vectorizing

change logo file names

Desktop file now includes proper exec using the app binary name

fix genicons for use with libicns
2021-12-31 16:37:54 -05:00
541e2f0d8d Merge pull request #8 from dada513/upstream_update 2021-12-31 14:27:21 -05:00
fa98ed3ccd Merge remote-tracking branch 'upstream/develop' into upstream_update 2021-12-31 18:05:40 +01:00
9579231ccc NOISSUE fix build and change how NetJob is used
Feed it network upfront...
2021-12-31 05:27:59 +01:00
9cc168c526 NOISSUE fix some OS ifdefs 2021-12-31 00:36:25 +01:00
94fdf13f4a NOISSUE proper fix for missing profile + demo mode 2021-12-30 21:26:29 +01:00
3efcccf334 Merge pull request #4345 from graemeg/freebsd-support
Adds FreeBSD support to MultiMC
2021-12-30 20:00:45 +01:00
5e909a4e85 Merge pull request #4394 from Janrupf/develop
GH-4299 Fix Screenshot upload
2021-12-30 19:58:16 +01:00
e7b90a9a3c Merge pull request #4396 from Bildcraft1/develop
BUILD.MD: Changed from "Install Xcode" to install Xcode Command-Line tools
2021-12-30 19:25:31 +01:00
0c177b1086 added AppImage 2021-12-30 13:17:40 -05:00
a6e59cb4f4 NOISSUE detect when user loses entitlements 2021-12-30 17:19:41 +01:00
1f21d84fdc Update BUILD.md 2021-12-29 21:40:45 +01:00
be029ab360 GH-4299 Fix screenshot upload 2021-12-29 19:45:24 +01:00
6fe07561fe GH-4299 Don't hard crash on when missing network 2021-12-29 19:45:15 +01:00
f42c3a953c Restore getNativePath() to its original form. 2021-12-28 21:59:24 +00:00
4063a496d7 Merge pull request #4392 from iGerman00/patch-1
BUILD.md - Clearer differences with binaries
2021-12-28 02:58:19 +01:00
01e4e62de3 BUILD.md - Clearer differences with binaries
Coming from personal inconvenience - I've tried to build this from source, and was faced with Microsoft accounts not working. Upon re-reading the READMEs, I didn't find a reason for it, so I resorted to messaging in the Discord, which, after some back and forth, allowed me to understand that additional private stuff is needed for it to work. The question could've been avoided entirely, in my opinion, if this was included in BUILD.md - the place where anyone intending to build from source will come for guidance.

(Not) Secrets should've been linked clearly because it's a crucial piece of info for someone building from source, since normally. I'd expect the source code to fully reflect the pre-built binaries.
2021-12-28 05:59:44 +05:00
b1b615e17f Merge pull request #4379 from CreeperzEdge/develop
Use correct title on Java check during setup
2021-12-27 17:44:26 +01:00
95c9a6d8f4 Use correct title on Java check during setup 2021-12-23 00:53:02 +11:00
3bc450a6d7 Restore the previously deleted line. 2021-12-12 16:45:18 +00:00
fce98f5e16 Fixes compilation error expanding from macro 'major'. 2021-12-12 11:45:58 +00:00
7179e75e70 Changes required to support FreeBSD 2021-12-12 11:39:36 +00:00
a97d0a36f4 NOISSUE Copy Image is not shown if the selection is > 1 2021-12-03 16:29:28 +01:00
e9c52ec696 NOISSUE Added Copy File(s) feature for the screenshot page
- Ctrl+C now copies the file instead of the image data
- Renamed Copy to Copy Image
2021-12-03 16:08:11 +01:00
75f2dab3c8 NOISSUE Implemented copy screenshots to the clipboard
- Added context-menu entry
- Ctrl+C keybind works as well
- If multiple screenshots are selected, only the first one gets copied
2021-12-03 03:11:53 +01:00
1107 changed files with 67958 additions and 30078 deletions

16
.clang-format Normal file
View File

@ -0,0 +1,16 @@
---
Language: Cpp
BasedOnStyle: Chromium
IndentWidth: 4
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AllowShortIfStatementsOnASingleLine: false
BraceWrapping:
AfterFunction: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeComma
ColumnLimit: 140
Cpp11BracedListStyle: false

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
open_collective: prismlauncher

View File

@ -1,6 +1,6 @@
name: Bug Report
description: File a bug report
labels: [bug, needs-triage]
labels: [bug]
body:
- type: markdown
attributes:
@ -8,9 +8,9 @@ body:
If you need help with running Minecraft, please visit us on our Discord before making a bug report.
Before submitting a bug report, please make sure you have read this *entire* form, and that:
* You have read the [FAQ](https://github.com/PolyMC/PolyMC/wiki/FAQ) and it has not answered your question
* You have read the [Prism Launcher wiki](https://prismlauncher.org/wiki/) and it has not answered your question.
* Your bug is not caused by Minecraft or any mods you have installed.
* Your issue has not been reported before, [make sure to use the search function!](https://github.com/PolyMC/PolyMC/issues)
* Your issue has not been reported before, [make sure to use the search function!](https://github.com/PrismLauncher/PrismLauncher/issues)
**Do not forget to give your issue a descriptive title.** "Bug in the instance screen" makes it hard to distinguish issues at a glance.
- type: dropdown
@ -23,6 +23,20 @@ body:
- macOS
- Linux
- Other
- type: textarea
attributes:
label: Version of Prism Launcher
description: The version of Prism Launcher used in the bug report.
placeholder: Prism Launcher 5.0
validations:
required: true
- type: textarea
attributes:
label: Version of Qt
description: The version of Qt used in the bug report. You can find it in Help -> About Prism Launcher -> About Qt.
placeholder: Qt 6.3.0
validations:
required: true
- type: textarea
attributes:
label: Description of bug

View File

@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: PolyMC Matrix Support Room
url: https://matrix.to/#/#support:polymc.org
- name: Prism Launcher Matrix Support Room
url: https://matrix.to/#/#prism-support:matrix.org
about: Please ask for support here before opening an issue.

68
.github/ISSUE_TEMPLATE/rfc.yml vendored Normal file
View File

@ -0,0 +1,68 @@
# Template based on https://gitlab.archlinux.org/archlinux/rfcs/-/blob/0ba3b61e987e197f8d1901709409b8564958f78a/rfcs/0000-template.rst
name: Request for Comment (RFC)
description: Propose a larger change and start a discussion.
labels: [rfc]
body:
- type: markdown
attributes:
value: |
### Use this form to suggest a larger change for Prism Launcher.
- type: textarea
attributes:
label: Goal
description: Short description, 1-2 sentences.
placeholder: Remove the cat from the launcher.
validations:
required: true
- type: textarea
attributes:
label: Motivation
description: |
Introduce the topic. If this is a not-well-known section of Prism Launcher, a detailed explanation of the background is recommended.
Some example points of discussion:
- What specific problems are you facing right now that you're trying to address?
- Are there any previous discussions? Link to them and summarize them (don't force your readers to read them though!).
- Is there any precedent set by other software? If so, link to resources.
placeholder: I don't like cats. I think many users also don't like cats.
validations:
required: true
- type: textarea
attributes:
label: Specification
description: A concrete, thorough explanation of what is being planned.
placeholder: Remove the cat button and all references to the cat from the codebase. Including resource files.
validations:
required: true
- type: textarea
attributes:
label: Drawbacks
description: Carefully consider every possible objection and issue with your proposal. This section should be updated as feedback comes in from discussion.
placeholder: Some users might like cats.
validations:
required: true
- type: textarea
attributes:
label: Unresolved Questions
description: |
Are there any portions of your proposal which need to be discussed with the community before the RFC can proceed?
Be careful here -- an RFC with a lot of remaining questions is likely to be stalled.
If your RFC is mostly unresolved questions and not too much substance, it may not be ready.
placeholder: Do a lot of users care about the cat?
validations:
required: true
- type: textarea
attributes:
label: Alternatives Considered
description: A list of alternatives, that have been considered and offer equal or similar features to the proposed change.
placeholder: Maybe the cat could be replaced with an axolotl?
validations:
required: true
- type: checkboxes
attributes:
label: This suggestion is unique
options:
- label: I have searched the issue tracker and did not find an issue describing my suggestion, especially not one that has been rejected.
required: true
- type: textarea
attributes:
label: You may use the editor below to elaborate further.

View File

@ -1,29 +1,29 @@
name: Suggestion
description: Make a suggestion
labels: [idea, needs-triage]
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
### Use this form to suggest a feature for PolyMC.
### Use this form to suggest a feature for Prism Launcher.
- type: input
attributes:
label: Role
description: In what way do you use PolyMC that needs this feature?
description: In what way do you use Prism Launcher that needs this feature?
placeholder: I play modded Minecraft.
validations:
required: true
- type: input
attributes:
label: Suggestion
description: What do you want PolyMC to do?
description: What do you want Prism Launcher to do?
placeholder: I want the cat button to meow.
validations:
required: true
- type: input
attributes:
label: Benefit
description: Why do you need PolyMC to do this?
description: Why do you need Prism Launcher to do this?
placeholder: so that I can always hear a cat when I need to.
validations:
required: true

3
.github/codeql/codeql-config.yml vendored Normal file
View File

@ -0,0 +1,3 @@
query-filters:
- exclude:
id: cpp/fixme-comment

2
.github/dco.yml vendored Normal file
View File

@ -0,0 +1,2 @@
allowRemediationCommits:
individual: true

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

@ -0,0 +1,9 @@
<!--
Hey there! Thanks for your contribution.
Please make sure that your commits are signed off first.
If you don't know how that works, check out our contribution guidelines: https://github.com/PrismLauncher/PrismLauncher/blob/develop/CONTRIBUTING.md#signing-your-work
If you already created your commits, you can run `git rebase --signoff develop` to retroactively sign-off all your commits and `git push --force` to override what you have pushed already.
Note that signing and signing-off are two different things!
-->

41
.github/scripts/prepare_JREs.sh vendored Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
URL_JDK8="https://api.adoptium.net/v3/binary/version/jdk8u312-b07/linux/x64/jre/hotspot/normal/eclipse"
URL_JDK17="https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jre/hotspot/normal/eclipse"
mkdir -p JREs
pushd JREs
wget --content-disposition "$URL_JDK8"
wget --content-disposition "$URL_JDK17"
for file in *;
do
mkdir temp
re='(OpenJDK([[:digit:]]+)U-jre_x64_linux_hotspot_([[:digit:]]+)(.*).tar.gz)'
if [[ $file =~ $re ]];
then
version_major=${BASH_REMATCH[2]}
version_trailing=${BASH_REMATCH[4]}
if [ $version_major = 17 ];
then
hyphen='-'
else
hyphen=''
fi
version_edit=$(echo $version_trailing | sed -e 's/_/+/g' | sed -e 's/b/-b/g')
dir_name=jdk$hyphen$version_major$version_edit-jre
mkdir jre$version_major
tar -xzf $file -C temp
pushd temp/$dir_name
cp -r . ../../jre$version_major
popd
fi
rm -rf temp
done
popd

584
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,584 @@
name: Build
on:
workflow_call:
inputs:
build_type:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string
default: Debug
is_qt_cached:
description: Enable Qt caching or not
type: string
default: true
secrets:
SPARKLE_ED25519_KEY:
description: Private key for signing Sparkle updates
required: false
CACHIX_AUTH_TOKEN:
description: Private token for authenticating against Cachix cache
required: false
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
qt_ver: 5
- os: ubuntu-20.04
qt_ver: 6
qt_host: linux
qt_arch: ''
qt_version: '6.2.4'
qt_modules: 'qt5compat qtimageformats'
qt_tools: ''
- os: windows-2022
name: "Windows-MinGW-w64"
msystem: clang64
- os: windows-2022
name: "Windows-MSVC-Legacy"
msystem: ''
architecture: 'win32'
vcvars_arch: 'amd64_x86'
qt_ver: 5
qt_host: windows
qt_arch: 'win32_msvc2019'
qt_version: '5.15.2'
qt_modules: ''
qt_tools: 'tools_openssl_x86'
- os: windows-2022
name: "Windows-MSVC"
msystem: ''
architecture: 'x64'
vcvars_arch: 'amd64'
qt_ver: 6
qt_host: windows
qt_arch: ''
qt_version: '6.4.2'
qt_modules: 'qt5compat qtimageformats'
qt_tools: ''
- os: windows-2022
name: "Windows-MSVC-arm64"
msystem: ''
architecture: 'arm64'
vcvars_arch: 'amd64_arm64'
qt_ver: 6
qt_host: windows
qt_arch: 'win64_msvc2019_arm64'
qt_version: '6.4.2'
qt_modules: 'qt5compat qtimageformats'
qt_tools: ''
- os: macos-12
name: macOS
macosx_deployment_target: 10.15
qt_ver: 6
qt_host: mac
qt_arch: ''
qt_version: '6.3.0'
qt_modules: 'qt5compat qtimageformats'
qt_tools: ''
- os: macos-12
name: macOS-Legacy
macosx_deployment_target: 10.13
qt_ver: 5
qt_host: mac
qt_version: '5.15.2'
qt_modules: ''
qt_tools: ''
runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
INSTALL_DIR: "install"
INSTALL_PORTABLE_DIR: "install-portable"
INSTALL_APPIMAGE_DIR: "install-appdir"
BUILD_DIR: "build"
CCACHE_VAR: ""
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
steps:
##
# PREPARE
##
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: 'Setup MSYS2'
if: runner.os == 'Windows' && matrix.msystem != ''
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
git
mingw-w64-x86_64-binutils
pacboy: >-
toolchain:p
cmake:p
extra-cmake-modules:p
ninja:p
qt6-base:p
qt6-svg:p
qt6-imageformats:p
quazip-qt6:p
ccache:p
qt6-5compat:p
- name: Force newer ccache
if: runner.os == 'Windows' && matrix.msystem == '' && inputs.build_type == 'Debug'
run: |
choco install ccache --version 4.7.1
- name: Setup ccache
if: (runner.os != 'Windows' || matrix.msystem == '') && inputs.build_type == 'Debug'
uses: hendrikmuhs/ccache-action@v1.2.5
with:
key: ${{ matrix.os }}-qt${{ matrix.qt_ver }}-${{ matrix.architecture }}
- name: Setup ccache (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug'
shell: msys2 {0}
run: |
ccache --set-config=cache_dir='${{ github.workspace }}\.ccache'
ccache --set-config=max_size='500M'
ccache --set-config=compression=true
ccache -p # Show config
ccache -z # Zero stats
- name: Use ccache on Debug builds only
if: inputs.build_type == 'Debug'
shell: bash
run: |
echo "CCACHE_VAR=ccache" >> $GITHUB_ENV
- name: Retrieve ccache cache (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug'
uses: actions/cache@v3.0.11
with:
path: '${{ github.workspace }}\.ccache'
key: ${{ matrix.os }}-mingw-w64
restore-keys: |
${{ matrix.os }}-mingw-w64
- name: Set short version
shell: bash
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -y update
sudo apt-get -y install ninja-build extra-cmake-modules scdoc
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install ninja extra-cmake-modules
- name: Install Qt (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 6
run: |
sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
- name: Install host Qt (Windows MSVC arm64)
if: runner.os == 'Windows' && matrix.architecture == 'arm64'
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_version }}
host: 'windows'
target: 'desktop'
arch: ''
modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }}
cache: ${{ inputs.is_qt_cached }}
cache-key-prefix: host-qt-arm64-windows
dir: ${{ github.workspace }}\HostQt
set-env: false
- name: Install Qt (macOS, Linux, Qt 6 & Windows MSVC)
if: runner.os == 'Linux' && matrix.qt_ver == 6 || runner.os == 'macOS' || (runner.os == 'Windows' && matrix.msystem == '')
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_version }}
host: ${{ matrix.qt_host }}
target: 'desktop'
arch: ${{ matrix.qt_arch }}
modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }}
cache: ${{ inputs.is_qt_cached }}
- name: Install MSVC (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == ''
uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2022
arch: ${{ matrix.vcvars_arch }}
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5
run: |
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage"
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
${{ github.workspace }}/.github/scripts/prepare_JREs.sh
- name: Add QT_HOST_PATH var (Windows MSVC arm64)
if: runner.os == 'Windows' && matrix.architecture == 'arm64'
run: |
echo "QT_HOST_PATH=${{ github.workspace }}\HostQt\Qt\${{ matrix.qt_version }}\msvc2019_64" >> $env:GITHUB_ENV
##
# CONFIGURE
##
- name: Configure CMake (macOS)
if: runner.os == 'macOS' && matrix.qt_ver == 6
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -G Ninja
- name: Configure CMake (macOS-Legacy)
if: runner.os == 'macOS' && matrix.qt_ver == 5
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DMACOSX_SPARKLE_UPDATE_PUBLIC_KEY="" -DMACOSX_SPARKLE_UPDATE_FEED_URL="" -G Ninja
- name: Configure CMake (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != ''
shell: msys2 {0}
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja
- name: Configure CMake (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == ''
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}} -DLauncher_FORCE_BUNDLED_LIBS=ON
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix)
if ("${{ env.CCACHE_VAR }}")
{
Copy-Item C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/ccache.exe -Destination C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/cl.exe
echo "CLToolExe=cl.exe" >> $env:GITHUB_ENV
echo "CLToolPath=C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/" >> $env:GITHUB_ENV
echo "TrackFileAccess=false" >> $env:GITHUB_ENV
}
# Needed for ccache, but also speeds up compile
echo "UseMultiToolTask=true" >> $env:GITHUB_ENV
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
##
# BUILD
##
- name: Build
if: runner.os != 'Windows'
run: |
cmake --build ${{ env.BUILD_DIR }}
- name: Build (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != ''
shell: msys2 {0}
run: |
cmake --build ${{ env.BUILD_DIR }}
- name: Build (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == ''
run: |
cmake --build ${{ env.BUILD_DIR }} --config ${{ inputs.build_type }}
##
# TEST
##
- name: Test
if: runner.os != 'Windows'
run: |
ctest -E "^example64|example$" --test-dir build --output-on-failure
- name: Test (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != ''
shell: msys2 {0}
run: |
ctest -E "^example64|example$" --test-dir build --output-on-failure
- name: Test (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == '' && matrix.architecture != 'arm64'
run: |
ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }}
##
# PACKAGE BUILDS
##
- name: Package (macOS)
if: runner.os == 'macOS'
run: |
cmake --install ${{ env.BUILD_DIR }}
cd ${{ env.INSTALL_DIR }}
chmod +x "PrismLauncher.app/Contents/MacOS/prismlauncher"
sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "PrismLauncher.app/Contents/MacOS/prismlauncher"
mv "PrismLauncher.app" "Prism Launcher.app"
tar -czf ../PrismLauncher.tar.gz *
- name: Make Sparkle signature (macOS)
if: matrix.name == 'macOS'
run: |
if [ '${{ secrets.SPARKLE_ED25519_KEY }}' != '' ]; then
brew install openssl@3
echo '${{ secrets.SPARKLE_ED25519_KEY }}' > ed25519-priv.pem
signature=$(/usr/local/opt/openssl@3/bin/openssl pkeyutl -sign -rawin -in ${{ github.workspace }}/PrismLauncher.tar.gz -inkey ed25519-priv.pem | openssl base64 | tr -d \\n)
rm ed25519-priv.pem
cat >> $GITHUB_STEP_SUMMARY << EOF
### Artifact Information :information_source:
- :memo: Sparkle Signature (ed25519): \`$signature\`
EOF
else
cat >> $GITHUB_STEP_SUMMARY << EOF
### Artifact Information :information_source:
- :warning: Sparkle Signature (ed25519): No private key available (likely a pull request or fork)
EOF
fi
- name: Package (Windows MinGW-w64)
if: runner.os == 'Windows' && matrix.msystem != ''
shell: msys2 {0}
run: |
cmake --install ${{ env.BUILD_DIR }}
- name: Package (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == ''
run: |
cmake --install ${{ env.BUILD_DIR }} --config ${{ inputs.build_type }}
cd ${{ env.INSTALL_DIR }}
if ("${{ matrix.qt_ver }}" -eq "5")
{
Copy-Item D:/a/PrismLauncher/Qt/Tools/OpenSSL/Win_x86/bin/libcrypto-1_1.dll -Destination libcrypto-1_1.dll
Copy-Item D:/a/PrismLauncher/Qt/Tools/OpenSSL/Win_x86/bin/libssl-1_1.dll -Destination libssl-1_1.dll
}
- name: Package (Windows MinGW-w64, portable)
if: runner.os == 'Windows' && matrix.msystem != ''
shell: msys2 {0}
run: |
cp -r ${{ env.INSTALL_DIR }} ${{ env.INSTALL_PORTABLE_DIR }} # cmake install on Windows is slow, let's just copy instead
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable
- name: Package (Windows MSVC, portable)
if: runner.os == 'Windows' && matrix.msystem == ''
run: |
cp -r ${{ env.INSTALL_DIR }} ${{ env.INSTALL_PORTABLE_DIR }} # cmake install on Windows is slow, let's just copy instead
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable
- name: Package (Windows, installer)
if: runner.os == 'Windows'
run: |
cd ${{ env.INSTALL_DIR }}
makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi"
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}
cd ${{ env.INSTALL_DIR }}
tar --owner root --group root -czf ../PrismLauncher.tar.gz *
- name: Package (Linux, portable)
if: runner.os == 'Linux'
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }}
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable
cd ${{ env.INSTALL_PORTABLE_DIR }}
tar -czf ../PrismLauncher-portable.tar.gz *
- name: Package AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5
shell: bash
run: |
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_APPIMAGE_DIR }}/usr
export OUTPUT="PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage"
chmod +x linuxdeploy-*.AppImage
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-{8,17}-openjdk
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp -r ${{ github.workspace }}/JREs/jre8/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk
cp -r ${{ github.workspace }}/JREs/jre17/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-17-openjdk
cp -r /home/runner/work/PrismLauncher/Qt/${{ matrix.qt_version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}//usr/lib/
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64/server"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-17-openjdk/lib"
export LD_LIBRARY_PATH
./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/icons/hicolor/scalable/apps/org.prismlauncher.PrismLauncher.svg
##
# UPLOAD BUILDS
##
- name: Upload binary tarball (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher.tar.gz
- name: Upload binary zip (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: ${{ env.INSTALL_DIR }}/**
- name: Upload binary zip (Windows, portable)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ matrix.name }}-Portable-${{ env.VERSION }}-${{ inputs.build_type }}
path: ${{ env.INSTALL_PORTABLE_DIR }}/**
- name: Upload installer (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ matrix.name }}-Setup-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher-Setup.exe
- name: Upload binary tarball (Linux, Qt 5)
if: runner.os == 'Linux' && matrix.qt_ver != 6
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher.tar.gz
- name: Upload binary tarball (Linux, portable, Qt 5)
if: runner.os == 'Linux' && matrix.qt_ver != 6
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ runner.os }}-Portable-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher-portable.tar.gz
- name: Upload binary tarball (Linux, Qt 6)
if: runner.os == 'Linux' && matrix.qt_ver !=5
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ runner.os }}-Qt6-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher.tar.gz
- name: Upload binary tarball (Linux, portable, Qt 6)
if: runner.os == 'Linux' && matrix.qt_ver != 5
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ runner.os }}-Qt6-Portable-${{ env.VERSION }}-${{ inputs.build_type }}
path: PrismLauncher-portable.tar.gz
- name: Upload AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5
uses: actions/upload-artifact@v3
with:
name: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
path: PrismLauncher-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
snap:
runs-on: ubuntu-20.04
steps:
- name: Checkout
if: inputs.build_type == 'Debug'
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set short version
shell: bash
if: inputs.build_type == 'Debug'
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Package Snap (Linux)
id: snapcraft
if: inputs.build_type == 'Debug'
uses: snapcore/action-build@v1
- name: Upload Snap (Linux)
if: inputs.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: prismlauncher_${{ env.VERSION }}_amd64.snap
path: ${{ steps.snapcraft.outputs.snap }}
flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-5.15-22.08
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v3
if: inputs.build_type == 'Debug'
with:
submodules: 'true'
- name: Build Flatpak (Linux)
if: inputs.build_type == 'Debug'
uses: flatpak/flatpak-github-actions/flatpak-builder@v4
with:
bundle: "Prism Launcher.flatpak"
manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml
cache-key: flatpak-${{ github.sha }}-x86_64
nix:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- prismlauncher
- prismlauncher-qt5
steps:
- name: Clone repository
if: inputs.build_type == 'Debug'
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install nix
if: inputs.build_type == 'Debug'
uses: cachix/install-nix-action@v18
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
if: inputs.build_type == 'Debug'
with:
name: prismlauncher
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build
if: inputs.build_type == 'Debug'
run: nix build .#${{ matrix.package }} --print-build-logs

35
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: "CodeQL Code Scanning"
on: [ push, pull_request, workflow_dispatch ]
jobs:
CodeQL:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
queries: security-and-quality
languages: cpp, java
- name: Install Dependencies
run:
sudo apt-get -y update
sudo apt-get -y install ninja-build extra-cmake-modules scdoc qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
- name: Configure and Build
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DLauncher_QT_VERSION_MAJOR=5 -G Ninja
cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

34
.github/workflows/trigger_builds.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Build Application
on:
push:
branches-ignore:
- 'renovate/**'
paths-ignore:
- '**.md'
- '**/LICENSE'
- 'flake.lock'
- 'packages/**'
- '.github/ISSUE_TEMPLATE/**'
- '.markdownlint**'
pull_request:
paths-ignore:
- '**.md'
- '**/LICENSE'
- 'flake.lock'
- 'packages/**'
- '.github/ISSUE_TEMPLATE/**'
- '.markdownlint**'
workflow_dispatch:
jobs:
build_debug:
name: Build Debug
uses: ./.github/workflows/build.yml
with:
build_type: Debug
is_qt_cached: true
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

105
.github/workflows/trigger_release.yml vendored Normal file
View File

@ -0,0 +1,105 @@
name: Build Application and Make Release
on:
push:
tags:
- '*'
jobs:
build_release:
name: Build Release
uses: ./.github/workflows/build.yml
with:
build_type: Release
is_qt_cached: false
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
create_release:
needs: build_release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
path: 'PrismLauncher-source'
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Grab and store version
run: |
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$")
echo "VERSION=$tag_name" >> $GITHUB_ENV
- name: Package artifacts properly
run: |
mv ${{ github.workspace }}/PrismLauncher-source PrismLauncher-${{ env.VERSION }}
mv PrismLauncher-Linux-Qt6-Portable*/PrismLauncher-portable.tar.gz PrismLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz
mv PrismLauncher-Linux-Qt6*/PrismLauncher.tar.gz PrismLauncher-Linux-Qt6-${{ env.VERSION }}.tar.gz
mv PrismLauncher-Linux-Portable*/PrismLauncher-portable.tar.gz PrismLauncher-Linux-Portable-${{ env.VERSION }}.tar.gz
mv PrismLauncher-Linux*/PrismLauncher.tar.gz PrismLauncher-Linux-${{ env.VERSION }}.tar.gz
mv PrismLauncher-*.AppImage/PrismLauncher-*.AppImage PrismLauncher-Linux-${{ env.VERSION }}-x86_64.AppImage
mv PrismLauncher-macOS-Legacy*/PrismLauncher.tar.gz PrismLauncher-macOS-Legacy-${{ env.VERSION }}.tar.gz
mv PrismLauncher-macOS*/PrismLauncher.tar.gz PrismLauncher-macOS-${{ env.VERSION }}.tar.gz
tar -czf PrismLauncher-${{ env.VERSION }}.tar.gz PrismLauncher-${{ env.VERSION }}
for d in PrismLauncher-Windows-MSVC*; do
cd "${d}" || continue
LEGACY="$(echo -n ${d} | grep -o Legacy || true)"
ARM64="$(echo -n ${d} | grep -o arm64 || true)"
INST="$(echo -n ${d} | grep -o Setup || true)"
PORT="$(echo -n ${d} | grep -o Portable || true)"
NAME="PrismLauncher-Windows-MSVC"
test -z "${LEGACY}" || NAME="${NAME}-Legacy"
test -z "${ARM64}" || NAME="${NAME}-arm64"
test -z "${PORT}" || NAME="${NAME}-Portable"
test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe
test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
cd ..
done
for d in PrismLauncher-Windows-MinGW-w64*; do
cd "${d}" || continue
INST="$(echo -n ${d} | grep -o Setup || true)"
PORT="$(echo -n ${d} | grep -o Portable || true)"
NAME="PrismLauncher-Windows-MinGW-w64"
test -z "${PORT}" || NAME="${NAME}-Portable"
test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe
test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
cd ..
done
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Prism Launcher ${{ env.VERSION }}
draft: true
prerelease: false
files: |
PrismLauncher-Linux-${{ env.VERSION }}.tar.gz
PrismLauncher-Linux-Portable-${{ env.VERSION }}.tar.gz
PrismLauncher-Linux-${{ env.VERSION }}-x86_64.AppImage
PrismLauncher-Linux-Qt6-${{ env.VERSION }}.tar.gz
PrismLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz
PrismLauncher-Windows-MinGW-w64-${{ env.VERSION }}.zip
PrismLauncher-Windows-MinGW-w64-Portable-${{ env.VERSION }}.zip
PrismLauncher-Windows-MinGW-w64-Setup-${{ env.VERSION }}.exe
PrismLauncher-Windows-MSVC-Legacy-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-Legacy-Portable-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-Legacy-Setup-${{ env.VERSION }}.exe
PrismLauncher-Windows-MSVC-arm64-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-arm64-Portable-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-arm64-Setup-${{ env.VERSION }}.exe
PrismLauncher-Windows-MSVC-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-Portable-${{ env.VERSION }}.zip
PrismLauncher-Windows-MSVC-Setup-${{ env.VERSION }}.exe
PrismLauncher-macOS-${{ env.VERSION }}.tar.gz
PrismLauncher-macOS-Legacy-${{ env.VERSION }}.tar.gz
PrismLauncher-${{ env.VERSION }}.tar.gz

15
.github/workflows/winget.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v1
with:
identifier: PrismLauncher.PrismLauncher
version: ${{ github.event.release.tag_name }}
installers-regex: 'PrismLauncher-Windows-MSVC(:?-arm64|-Legacy)?-Setup-.+\.exe$'
token: ${{ secrets.WINGET_TOKEN }}

16
.gitignore vendored
View File

@ -14,6 +14,7 @@ CMakeLists.txt.user.*
/.project
/.settings
/.idea
/.vscode
cmake-build-*/
Debug
@ -40,13 +41,12 @@ run/
.cache/
# Flatpak builds
# Nix/NixOS
result/
# Flatpak
.flatpak-builder
flatbuild
builddir
# Deb
packages/debian/polymc/usr/bin
packages/debian/polymc/usr/lib
packages/debian/polymc/usr/share/polymc/jars
packages/debian/polymc.deb
packages/debian/polymc/DEBIAN/control
# Snap
*.snap

24
.gitmodules vendored
View File

@ -1,8 +1,18 @@
[submodule "depends/libnbtplusplus"]
path = libraries/libnbtplusplus
url = https://github.com/MultiMC/libnbtplusplus.git
pushurl = git@github.com:MultiMC/libnbtplusplus.git
[submodule "libraries/quazip"]
path = libraries/quazip
url = https://github.com/PolyMC/quazip.git
pushurl = git@github.com:PolyMC/quazip.git
path = libraries/quazip
url = https://github.com/stachenov/quazip.git
[submodule "libraries/tomlplusplus"]
path = libraries/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git
[submodule "libraries/filesystem"]
path = libraries/filesystem
url = https://github.com/gulrak/filesystem
[submodule "libraries/libnbtplusplus"]
path = libraries/libnbtplusplus
url = https://github.com/PrismLauncher/libnbtplusplus.git
[submodule "libraries/zlib"]
path = libraries/zlib
url = https://github.com/madler/zlib.git
[submodule "libraries/extra-cmake-modules"]
path = libraries/extra-cmake-modules
url = https://github.com/KDE/extra-cmake-modules

12
.markdownlint.yaml Normal file
View File

@ -0,0 +1,12 @@
# MD013/line-length - Line length
MD013: false
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024:
siblings-only: true
# MD033/no-inline-html Inline HTML
MD033: false
# MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading
MD041: false

2
.markdownlintignore Normal file
View File

@ -0,0 +1,2 @@
libraries/nbtplusplus
libraries/quazip

233
BUILD.md
View File

@ -1,224 +1,53 @@
Build Instructions
==================
# Build Instructions
# Contents
Full build instructions will be available on [the website](https://prismlauncher.org/wiki/development/build-instructions/).
* [Note](#note)
* [Getting the source](#source)
* [Linux](#linux)
* [Windows](#windows)
* [macOS](#macos)
If you would like to contribute or fix an issue with the Build instructions you will be able to do so [here](https://github.com/PrismLauncher/website/blob/master/src/wiki/development/build-instructions.md).
## Getting the source
# Getting the source
Clone the source code using git and grab all the submodules:
Clone the source code using git, and grab all the submodules. This is generic for all platforms you want to build on.
```
git clone https://github.com/PolyMC/PolyMC.git
git submodule init
git submodule update
git clone --recursive https://github.com/PrismLauncher/PrismLauncher
cd PrismLauncher
```
# Linux
## Linux
Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution.
This guide will mostly mention dependant packages by their Debian naming and commands are done by a user in the sudoers file.
### Dependencies
## Build dependencies
* A C++ compiler capable of building C++11 code.
* Qt Development tools 5.6 or newer (`qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5` on Debian-based system)
* cmake 3.1 or newer (`cmake` on Debian-based system)
* zlib (`zlib1g-dev` on Debian-based system)
* Java JDK (`openjdk-17-jdk`on Debian-based system)
* GL headers (`libgl1-mesa-dev` on Debian-based system)
- A C++ compiler capable of building C++17 code (can be found in the package `build-essential`).
- Qt Development tools 5.12 or newer (on Debian 11 or Debian-based distributions, `qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5`).
- `cmake` 3.15 or newer.
- `extra-cmake-modules`.
- zlib (`zlib1g-dev` on Debian 11 or Debian-based distributions).
- Java Development Kit (Java JDK) (`openjdk-17-jdk` on Debian 11 or Debian-based distributions).
- Mesa GL headers (`libgl1-mesa-dev` on Debian 11 or Debian-based distributions).
- (Optional) `scdoc` to generate man pages.
### Building a .deb
You need to install the build dependencies first
In conclusion, to check if all you need is installed (including optional):
```
git clone https://github.com/PolyMC/PolyMC.git
git submodule init && git submodule update
cd packages/debian
./makedeb.sh
sudo apt install build-essential qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 cmake extra-cmake-modules zlib1g-dev openjdk-17-jdk libgl1-mesa-dev scdoc
```
If everything works correctly, the .deb will be next to the build script, in `PolyMC/packages/debian`
### Building from command line
You need a source folder, a build folder and an install folder.
### Compiling
#### Building and installing on the system
This is usually the suggested way to build the client.
```
# make all the folders
mkdir ~/PolyMC && cd ~/PolyMC
mkdir build
mkdir install
# clone the complete source
git clone --recursive https://github.com/PolyMC/PolyMC.git src
# configure the project
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ../src
make -j$(nproc) install
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_LTO=ON
cmake --build build -j$(nproc)
sudo cmake --install build
```
You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code.
### Building & Installing to the System
This is the preferred method for installation, and is suitable for packages.
#### Building a portable binary
```
git clone --recursive https://github.com/PolyMC/PolyMC.git && cd PolyMC
# configure everything
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" for packages, otherwise, leave it at the default "/usr/local".
-DLauncher_LAYOUT=lin-system
make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir})
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j$(nproc)
cmake --install build
cmake --install build --component portable
```
### Installing Qt using the installer (optional)
1. Run the Qt installer.
2. Choose a place to install Qt.
3. Choose the components you want to install.
- You need Qt 5.6.x 64-bit ticked.
- You need Tools/Qt Creator ticked.
- Other components are selected by default, you can untick them if you don't need them.
4. Accept the license agreements.
5. Double check the install details and then click "Install".
- Installation can take a very long time, go grab a cup of tea or something and let it work.
### Loading the project in Qt Creator (optional)
1. Open Qt Creator.
2. Choose `File->Open File or Project`.
3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt.
4. Read the instructions that just popped up about a build location and choose one.
5. You should see "Run CMake" in the window.
- Make sure that Generator is set to "Unix Generator (Desktop Qt 5.6.x GCC 64bit)".
- Hit the "Run CMake" button.
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
- Hit "Finish" if CMake ran successfully.
6. Cross your fingers and press the Run button (bottom left of Qt Creator).
- If the project builds successfully it will run and the Launcher window will pop up.
**If this doesn't work for you, let us know on our Discord.**
# Windows
Getting the project to build and run on Windows is easy if you use Qt's IDE, Qt Creator. The project will simply not compile using Microsoft build tools, because that's not something we do. If it does compile, it is by chance only.
## Dependencies
* [Qt 5.6+ Development tools](http://qt-project.org/downloads) -- Qt Online Installer for Windows
- http://download.qt.io/new_archive/qt/5.6/5.6.0/qt-opensource-windows-x86-mingw492-5.6.0.exe
- Download the MinGW version (MSVC version does not work).
* [OpenSSL](https://github.com/IndySockets/OpenSSL-Binaries/tree/master/Archive/) -- Win32 OpenSSL, version 1.0.2g (from 2016)
- https://github.com/IndySockets/OpenSSL-Binaries/raw/master/Archive/openssl-1.0.2g-i386-win32.zip
- the usual OpenSSL for Windows (http://slproweb.com/products/Win32OpenSSL.html) only provides the newest version of OpenSSL, and we need the 1.0.2g version
- **Download the 32-bit version, not 64-bit.**
- Microsoft Visual C++ 2008 Redist is required for this, there's a link on the OpenSSL download page above next to the main download.
- We use a custom build of OpenSSL that doesn't have this dependency. For normal development, the custom build is not necessary though.
* [zlib 1.2+](http://gnuwin32.sourceforge.net/packages/zlib.htm) - the Setup is fine
* [Java JDK 8](https://adoptium.net/releases.html?variant=openjdk8) - Use the MSI installer.
* [CMake](http://www.cmake.org/cmake/resources/software.html) -- Windows (Win32 Installer)
Ensure that OpenSSL, zlib, Java and CMake are on `PATH`.
## Getting set up
### Installing Qt
1. Run the Qt installer
2. Choose a place to install Qt (C:\Qt is the default),
3. Choose the components you want to install
- You need Qt 5.6 (32 bit) ticked,
- You need Tools/Qt Creator ticked,
- Other components are selected by default, you can untick them if you don't need them.
4. Accept the license agreements,
5. Double check the install details and then click "Install"
- Installation can take a very long time, go grab a cup of tea or something and let it work.
### Installing OpenSSL
1. Download .zip file from the link above.
2. Unzip and add the directory to PATH, so CMake can find it.
### Installing CMake
1. Run the CMake installer,
2. It's easiest if you choose to add CMake to the PATH for all users,
- If you don't choose to do this, remember where you installed CMake.
### Loading the project
1. Open Qt Creator,
2. Choose File->Open File or Project,
3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt,
4. Read the instructions that just popped up about a build location and choose one,
5. If you chose not to add CMake to the system PATH, tell Qt Creator where you installed it,
- Otherwise you can skip this step.
6. You should see "Run CMake" in the window,
- Make sure that Generator is set to "MinGW Generator (Desktop Qt 5.6.x MinGW 32bit)",
- Hit the "Run CMake" button,
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
- Hit "Finish" if CMake ran successfully.
7. Cross your fingers and press the Run button (bottom left of Qt Creator)!
- If the project builds successfully it will run and the Launcher window will pop up,
- Test OpenSSL by making an instance and trying to log in. If Qt Creator couldn't find OpenSSL during the CMake stage, login will fail and you'll get an error.
The following .dlls are needed for the app to run (copy them to build directory if you want to be able to move the build to another pc):
```
platforms/qwindows.dll
libeay32.dll
libgcc_s_dw2-1.dll
libssp-0.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Network.dll
Qt5Svg.dll
Qt5Widgets.dll
Qt5Xml.dll
ssleay32.dll
zlib1.dll
```
**These build instructions worked for me (Drayshak) on a fresh Windows 8 x64 Professional install. If they don't work for you, let us know on our Discord.**
### Compile from command line on Windows
1. If you installed Qt with the web installer, there should be a shortcut called `Qt 5.4 for Desktop (MinGW 4.9 32-bit)` in the Start menu on Windows 7 and 10. Best way to find it is to search for it. Do note you cannot just use cmd.exe, you have to use the shortcut, otherwise the proper MinGW software will not be on the PATH.
2. Once that is open, change into your user directory, and clone PolyMC by doing `git clone --recursive https://github.com/PolyMC/PolyMC.git`, and change directory to the folder you cloned to.
3. Make a build directory, and change directory to the directory and do `cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Path\that\makes\sense\for\you`. By default, it will install to C:\Program Files (x86), which you might not want, if you want a local installation. If you want to install it to that directory, make sure to run the command window as administrator.
3. Do `mingw32-make -jX`, where X is the number of cores your CPU has plus one.
4. Now to wait for it to compile. This could take some time. Hopefully it compiles properly.
5. Run the command `mingw32-make install`, and it should install PolyMC, to whatever the `-DCMAKE_INSTALL_PREFIX` was.
6. In most cases, whenever compiling, the OpenSSL dll's aren't put into the directory to where PolyMC installs, meaning you cannot log in. The best way to fix this is just to do `copy C:\OpenSSL-Win32\*.dll C:\Where\you\installed\PolyMC\to`. This should copy the required OpenSSL dll's to log in.
# macOS
### Install prerequisites:
- Install XCode and set it up to the point where you can build things from a terminal
- Install the official build of CMake (https://cmake.org/download/)
- Install JDK 8 (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
- Get Qt 5.6 and install it (https://download.qt.io/new_archive/qt/5.6/5.6.3/)
### Build
Pick an installation path - this is where the final `.app` will be constructed when you run `make install`. Supply it as the `CMAKE_INSTALL_PREFIX` argument during CMake configuration.
```
git clone --recursive https://github.com/PolyMC/PolyMC.git
cd Launcher
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="$(dirname $PWD)/dist/" \
-DCMAKE_PREFIX_PATH="/path/to/Qt5.6/" \
-DQt5_DIR="/path/to/Qt5.6/" \
-DLauncher_LAYOUT=mac-bundle \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
..
make install
```
**Note:** The final app bundle may not run due to code signing issues, which
need to be fixed with `codesign -fs -`.

View File

@ -1,29 +1,15 @@
cmake_minimum_required(VERSION 3.1)
if(WIN32)
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
cmake_policy(SET CMP0020 OLD)
endif()
cmake_minimum_required(VERSION 3.15) # minimum version required by QuaZip
project(Launcher)
enable_testing()
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD)
if(IS_IN_SOURCE_BUILD)
message(FATAL_ERROR "You are building the Launcher in-source. Please separate the build tree from the source tree.")
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_HOST_SYSTEM_VERSION MATCHES ".*[Mm]icrosoft.*" OR
CMAKE_HOST_SYSTEM_VERSION MATCHES ".*WSL.*"
)
message(FATAL_ERROR "Building the Launcher is not supported in Linux-on-Windows distributions.")
endif()
endif()
##################################### Set CMake options #####################################
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
@ -38,142 +24,299 @@ set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_C_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
include(GenerateExportHeader)
set(CMAKE_CXX_FLAGS " -Wall -pedantic -Werror -Wno-deprecated-declarations -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector-strong --param=ssp-buffer-size=4 -O3 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}")
if(UNIX AND APPLE)
set(CMAKE_CXX_FLAGS " -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
if(MSVC)
# /GS Adds buffer security checks, default on but incuded anyway to mirror gcc's fstack-protector flag
# /permissive- specify standards-conforming compiler behavior, also enabled by Qt6, default on with std:c++20
# Use /W4 as /Wall includes unnesserey warnings such as added padding to structs
set(CMAKE_CXX_FLAGS "/GS /permissive- /W4 ${CMAKE_CXX_FLAGS}")
# LINK accepts /SUBSYSTEM whics sets if we are a WINDOWS (gui) or a CONSOLE programs
# This implicitly selects an entrypoint specific to the subsystem selected
# qtmain/QtEntryPointLib provides the correct entrypoint (wWinMain) for gui programs
# Additinaly LINK autodetects we use a GUI so we can omit /SUBSYSTEM
# This allows tests to still use have console without using seperate linker flags
# /LTCG allows for linking wholy optimizated programs
# /MANIFEST:NO disables generating a manifest file, we instead provide our own
# /STACK sets the stack reserve size, ATL's pack list needs 3-4 MiB as of November 2022, provide 8 MiB
set(CMAKE_EXE_LINKER_FLAGS "/LTCG /MANIFEST:NO /STACK:8388608 ${CMAKE_EXE_LINKER_FLAGS}")
# /GL enables whole program optimizations
# /Gw helps reduce binary size
# /Gy allows the compiler to package individual functions
# /guard:cf enables control flow guard
foreach(lang C CXX)
set("CMAKE_${lang}_FLAGS_RELEASE" "/GL /Gw /Gy /guard:cf")
endforeach()
# See https://github.com/ccache/ccache/issues/1040
# Note, CMake 3.25 replaces this with CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
# See https://cmake.org/cmake/help/v3.25/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html
foreach(config DEBUG RELWITHDEBINFO)
foreach(lang C CXX)
set(flags_var "CMAKE_${lang}_FLAGS_${config}")
string(REGEX REPLACE "/Z[Ii]" "/Z7" ${flags_var} "${${flags_var}}")
endforeach()
endforeach()
if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL "MultiThreadedDLL")
set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG Release "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release "")
endif()
else()
set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}")
# ATL's pack list needs more than the default 1 Mib stack on windows
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}")
endif()
endif()
# Fix build with Qt 5.13
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00")
# Fix aarch64 build for toml++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTOML_ENABLE_FLOAT16=0")
# set CXXFLAGS for build targets
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS_RELEASE}")
option(ENABLE_LTO "Enable Link Time Optimization" off)
if(ENABLE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error)
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE)
if(CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
message(STATUS "IPO / LTO enabled")
else()
message(STATUS "Not enabling IPO / LTO on debug builds")
endif()
else()
message(STATUS "IPO / LTO will only be enabled for release builds")
endif()
else()
message(STATUS "IPO / LTO not supported: <${ipo_error}>")
endif()
endif()
option(BUILD_TESTING "Build the testing tree." ON)
find_package(ECM QUIET NO_MODULE)
if(NOT ECM_FOUND)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt")
message(STATUS "Using bundled ECM")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}")
else()
message(FATAL_ERROR
" Could not find ECM\n \n"
" Either install ECM using the system package manager or clone submodules\n"
" Submodules can be cloned with 'git submodule update --init --recursive'")
endif()
else()
set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}")
endif()
include(CTest)
include(ECMAddTests)
if(BUILD_TESTING)
enable_testing()
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")
##################################### Set Application options #####################################
######## Set URLs ########
set(Launcher_NEWS_RSS_URL "https://multimc.org/rss.xml" CACHE STRING "URL to fetch Launcher's news RSS feed from.")
set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.")
set(Launcher_NEWS_OPEN_URL "https://prismlauncher.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'")
set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help")
######## Set version numbers ########
set(Launcher_VERSION_MAJOR 0)
set(Launcher_VERSION_MINOR 6)
set(Launcher_VERSION_HOTFIX 14)
set(Launcher_VERSION_MAJOR 6)
set(Launcher_VERSION_MINOR 3)
# Build number
set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}")
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.0.0")
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},0,0")
# Build platform.
set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.")
set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.")
# Channel list URL
set(Launcher_UPDATER_BASE "" CACHE STRING "Base URL for the updater.")
# Notification URL
set(Launcher_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.")
# The metadata server
set(Launcher_META_URL "https://meta.multimc.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.")
# paste.ee API key
set(Launcher_PASTE_EE_API_KEY "utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ" CACHE STRING "API key you can get from paste.ee when you register an account")
set(Launcher_META_URL "https://meta.prismlauncher.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.")
# Imgur API Client ID
set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application")
# MSA Client ID
set(Launcher_MSA_CLIENT_ID "17b47edd-c884-4997-926d-9e7f9a6b4647" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application")
# Bug tracker URL
set(Launcher_BUG_TRACKER_URL "https://github.com/PolyMC/PolyMC/issues" CACHE STRING "URL for the bug tracker.")
set(Launcher_BUG_TRACKER_URL "https://github.com/PrismLauncher/PrismLauncher/issues" CACHE STRING "URL for the bug tracker.")
# Translations Platform URL
set(Launcher_TRANSLATIONS_URL "https://hosted.weblate.org/projects/prismlauncher/launcher/" CACHE STRING "URL for the translations platform.")
# Matrix Space
set(Launcher_MATRIX_URL "https://matrix.to/#/#prismlauncher:matrix.org" CACHE STRING "URL to the Matrix Space")
# Discord URL
set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.")
set(Launcher_DISCORD_URL "https://discord.gg/prismlauncher" CACHE STRING "URL for the Discord guild.")
# Subreddit URL
set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.")
set(Launcher_SUBREDDIT_URL "https://www.reddit.com/r/PrismLauncher/" CACHE STRING "URL for the subreddit.")
# Builds
set(Launcher_FORCE_BUNDLED_LIBS OFF CACHE BOOL "Prevent using system libraries, if they are available as submodules")
set(Launcher_QT_VERSION_MAJOR "5" CACHE STRING "Major Qt version to build against")
# API Keys
# NOTE: These API keys are here for convenience. If you rebrand this software or intend to break the terms of service
# of these platforms, please change these API keys beforehand.
# Be aware that if you were to use these API keys for malicious purposes they might get revoked, which might cause
# breakage to thousands of users.
# If you don't plan to use these features of this software, you can just remove these values.
# By using this key in your builds you accept the terms of use laid down in
# https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use
set(Launcher_MSA_CLIENT_ID "c36a9fb6-4f2a-41ff-90bd-ae7cc92031eb" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application")
# By using this key in your builds you accept the terms and conditions laid down in
# https://support.curseforge.com/en/support/solutions/articles/9000207405-curse-forge-3rd-party-api-terms-and-conditions
# NOTE: CurseForge requires you to change this if you make any kind of derivative work.
# This key was issued specifically for Prism Launcher
set(Launcher_CURSEFORGE_API_KEY "$2a$10$wuAJuNZuted3NORVmpgUC.m8sI.pv1tOPKZyBgLFGjxFp/br0lZCC" CACHE STRING "API key for the CurseForge platform")
#### Check the current Git commit and branch
include(GetGitRevisionDescription)
git_get_exact_tag(Launcher_GIT_TAG)
get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT)
message(STATUS "Git commit: ${Launcher_GIT_COMMIT}")
message(STATUS "Git tag: ${Launcher_GIT_TAG}")
message(STATUS "Git refspec: ${Launcher_GIT_REFSPEC}")
set(Launcher_RELEASE_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}")
#### Custom target to just print the version.
add_custom_target(version echo "Version: ${Launcher_RELEASE_VERSION_NAME}")
add_custom_target(tcversion echo "\\#\\#teamcity[setParameter name=\\'env.LAUNCHER_VERSION\\' value=\\'${Launcher_RELEASE_VERSION_NAME}\\']")
string(TIMESTAMP TODAY "%Y-%m-%d")
set(Launcher_BUILD_TIMESTAMP "${TODAY}")
################################ 3rd Party Libs ################################
# Successive configurations of cmake without cleaning the build dir will cause zlib fallback to fail due to cached values
# Record when fallback triggered and skip this find_package
if(NOT Launcher_FORCE_BUNDLED_LIBS AND NOT FORCE_BUNDLED_ZLIB)
find_package(ZLIB QUIET)
endif()
if(NOT ZLIB_FOUND)
set(FORCE_BUNDLED_ZLIB TRUE CACHE BOOL "")
mark_as_advanced(FORCE_BUNDLED_ZLIB)
endif()
# Find the required Qt parts
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Qt5Xml REQUIRED)
include(QtVersionlessBackport)
if(Launcher_QT_VERSION_MAJOR EQUAL 5)
set(QT_VERSION_MAJOR 5)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Concurrent Network Test Xml)
# The Qt5 cmake files don't provide its install paths, so ask qmake.
include(QMakeQuery)
query_qmake(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
query_qmake(QT_INSTALL_IMPORTS QT_IMPORTS_DIR)
query_qmake(QT_INSTALL_LIBS QT_LIBS_DIR)
query_qmake(QT_INSTALL_LIBEXECS QT_LIBEXECS_DIR)
query_qmake(QT_HOST_DATA QT_DATA_DIR)
set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs)
if(NOT Launcher_FORCE_BUNDLED_LIBS)
find_package(QuaZip-Qt5 1.3 QUIET)
endif()
if (NOT QuaZip-Qt5_FOUND)
set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (4, 5 or 6), defaults to ${QT_VERSION_MAJOR}" FORCE)
set(FORCE_BUNDLED_QUAZIP 1)
endif()
# Qt 6 sets these by default. Notably causes Windows APIs to use UNICODE strings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNICODE -D_UNICODE")
elseif(Launcher_QT_VERSION_MAJOR EQUAL 6)
set(QT_VERSION_MAJOR 6)
find_package(Qt6 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml Core5Compat)
list(APPEND Launcher_QT_LIBS Qt6::Core5Compat)
if(NOT Launcher_FORCE_BUNDLED_LIBS)
find_package(QuaZip-Qt6 1.3 QUIET)
endif()
if (NOT QuaZip-Qt6_FOUND)
set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (4, 5 or 6), defaults to ${QT_VERSION_MAJOR}" FORCE)
set(FORCE_BUNDLED_QUAZIP 1)
endif()
else()
message(FATAL_ERROR "Qt version ${Launcher_QT_VERSION_MAJOR} is not supported")
endif()
if(Launcher_QT_VERSION_MAJOR EQUAL 5)
include(ECMQueryQt)
ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS)
ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS)
ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS)
else()
set(QT_PLUGINS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_PLUGINS})
set(QT_LIBS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBS})
set(QT_LIBEXECS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBEXECS})
endif()
# NOTE: Qt 6 already sets this by default
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
####################################### Secrets #######################################
if(NOT Launcher_FORCE_BUNDLED_LIBS)
# Find toml++
find_package(tomlplusplus 3.2.0 QUIET)
# Find ghc_filesystem
find_package(ghc_filesystem QUIET)
endif()
include(ECMQtDeclareLoggingCategory)
####################################### Program Info #######################################
set(Launcher_APP_BINARY_NAME "prismlauncher" CACHE STRING "Name of the Launcher binary")
add_subdirectory(program_info)
####################################### Install layout #######################################
# How to install the build results
set(Launcher_LAYOUT "auto" CACHE STRING "The layout for the launcher installation (auto, win-bundle, lin-nodeps, lin-system, mac-bundle)")
set_property(CACHE Launcher_LAYOUT PROPERTY STRINGS auto win-bundle lin-nodeps lin-system mac-bundle)
if(Launcher_LAYOUT STREQUAL "auto")
if(UNIX AND APPLE)
set(Launcher_LAYOUT_REAL "mac-bundle")
elseif(UNIX)
set(Launcher_LAYOUT_REAL "lin-nodeps")
elseif(WIN32)
set(Launcher_LAYOUT_REAL "win-bundle")
else()
message(FATAL_ERROR "Cannot choose a sensible install layout for your platform.")
endif()
else()
set(Launcher_LAYOUT_REAL ${Launcher_LAYOUT})
if(NOT (UNIX AND APPLE))
# Install "portable.txt" if selected component is "portable"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION "." COMPONENT portable EXCLUDE_FROM_ALL)
endif()
if(Launcher_LAYOUT_REAL STREQUAL "mac-bundle")
if(UNIX AND APPLE)
set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(LIBRARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(PLUGIN_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(FRAMEWORK_DEST_DIR "${Launcher_Name}.app/Contents/Frameworks")
set(RESOURCES_DEST_DIR "${Launcher_Name}.app/Contents/Resources")
set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/MacOS/jars")
set(BUNDLE_DEST_DIR ".")
# Apps to bundle
set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app")
# Mac bundle settings
set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_Name}")
set(MACOSX_BUNDLE_INFO_STRING "${Launcher_Name}: Minecraft launcher and management utility.")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.${Launcher_Name}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}")
set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_DisplayName}")
set(MACOSX_BUNDLE_INFO_STRING "${Launcher_DisplayName}: A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.prismlauncher.${Launcher_Name}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${Launcher_VERSION_NAME}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_NAME}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${Launcher_VERSION_NAME}")
set(MACOSX_BUNDLE_ICON_FILE ${Launcher_Name}.icns)
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2015-2021 ${Launcher_Copyright}")
set(MACOSX_BUNDLE_COPYRIGHT "© 2022 ${Launcher_Copyright_Mac}")
set(MACOSX_SPARKLE_UPDATE_PUBLIC_KEY "v55ZWWD6QlPoXGV6VLzOTZxZUggWeE51X8cRQyQh6vA=")
set(MACOSX_SPARKLE_UPDATE_FEED_URL "https://prismlauncher.org/feed/appcast.xml")
set(MACOSX_SPARKLE_DOWNLOAD_URL "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz" CACHE STRING "URL to Sparkle release archive")
set(MACOSX_SPARKLE_SHA256 "bf6ac1caa9f8d321d5784859c88da874f28412f37fb327bc21b7b14c5d61ef94" CACHE STRING "SHA256 checksum for Sparkle release archive")
set(MACOSX_SPARKLE_DIR "${CMAKE_BINARY_DIR}/frameworks/Sparkle")
# directories to look for dependencies
set(DIRS ${QT_LIBS_DIR} ${QT_LIBEXECS_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(DIRS ${QT_LIBS_DIR} ${QT_LIBEXECS_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${MACOSX_SPARKLE_DIR})
# install as bundle
set(INSTALL_BUNDLE "full")
@ -181,13 +324,12 @@ if(Launcher_LAYOUT_REAL STREQUAL "mac-bundle")
# Add the icon
install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name}.icns)
elseif(Launcher_LAYOUT_REAL STREQUAL "lin-nodeps")
elseif(UNIX)
include(KDEInstallDirs)
set(BINARY_DEST_DIR "bin")
set(LIBRARY_DEST_DIR "bin")
set(PLUGIN_DEST_DIR "plugins")
set(BUNDLE_DEST_DIR ".")
set(RESOURCES_DEST_DIR ".")
set(JARS_DEST_DIR "bin/jars")
set(LIBRARY_DEST_DIR "lib${LIB_SUFFIX}")
set(JARS_DEST_DIR "share/${Launcher_APP_BINARY_NAME}")
# install as bundle with no dependencies included
set(INSTALL_BUNDLE "nodeps")
@ -195,34 +337,23 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "lin-nodeps")
# Set RPATH
SET(Launcher_BINARY_RPATH "$ORIGIN/")
# Install basic runner script
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_SVG} DESTINATION "${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_mrpack_MIMEInfo} DESTINATION ${KDE_INSTALL_MIMEDIR})
if(Launcher_ManPage)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_ManPage} DESTINATION "${KDE_INSTALL_MANDIR}/man6")
endif()
# Install basic runner script if component "portable" is selected
configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name})
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION "." RENAME ${Launcher_Name} COMPONENT portable EXCLUDE_FROM_ALL)
elseif(Launcher_LAYOUT_REAL STREQUAL "lin-system")
set(Launcher_APP_BINARY_NAME "polymc" CACHE STRING "Name of the Launcher binary")
set(Launcher_BINARY_DEST_DIR "bin" CACHE STRING "Path to the binary directory")
set(Launcher_LIBRARY_DEST_DIR "lib${LIB_SUFFIX}" CACHE STRING "Path to the library directory")
set(Launcher_SHARE_DEST_DIR "share/polymc" CACHE STRING "Path to the shared data directory")
set(JARS_DEST_DIR "${Launcher_SHARE_DEST_DIR}/jars")
set(Launcher_DESKTOP_DEST_DIR "share/applications" CACHE STRING "Path to the desktop file directory")
set(BINARY_DEST_DIR ${Launcher_BINARY_DEST_DIR})
set(LIBRARY_DEST_DIR ${Launcher_LIBRARY_DEST_DIR})
MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR")
SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR")
install(FILES ${Launcher_Desktop} DESTINATION ${Launcher_DESKTOP_DEST_DIR})
# install as bundle with no dependencies included
set(INSTALL_BUNDLE "nodeps")
elseif(Launcher_LAYOUT_REAL STREQUAL "win-bundle")
elseif(WIN32)
set(BINARY_DEST_DIR ".")
set(LIBRARY_DEST_DIR ".")
set(PLUGIN_DEST_DIR ".")
set(BUNDLE_DEST_DIR ".")
set(RESOURCES_DEST_DIR ".")
set(JARS_DEST_DIR "jars")
@ -235,7 +366,7 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "win-bundle")
# install as bundle
set(INSTALL_BUNDLE "full")
else()
message(FATAL_ERROR "No sensible install layout set.")
message(FATAL_ERROR "Platform not supported")
endif()
################################ Included Libs ################################
@ -243,30 +374,75 @@ endif()
include(ExternalProject)
set_directory_properties(PROPERTIES EP_BASE External)
option(NBT_BUILD_SHARED "Build NBT shared library" ON)
option(NBT_BUILD_SHARED "Build NBT shared library" OFF)
option(NBT_USE_ZLIB "Build NBT library with zlib support" OFF)
option(NBT_BUILD_TESTS "Build NBT library tests" OFF) #FIXME: fix unit tests.
set(NBT_NAME Launcher_nbt++)
set(NBT_DEST_DIR ${LIBRARY_DEST_DIR})
add_subdirectory(libraries/libnbtplusplus)
add_subdirectory(libraries/systeminfo) # system information library
add_subdirectory(libraries/hoedown) # markdown parser
add_subdirectory(libraries/launcher) # java based launcher part for Minecraft
add_subdirectory(libraries/javacheck) # java compatibility checker
add_subdirectory(libraries/xz-embedded) # xz compression
add_subdirectory(libraries/quazip) # zip manipulation library
if(FORCE_BUNDLED_ZLIB)
message(STATUS "Using bundled zlib")
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) # Suppress cmake warnings and allow INTERPROCEDURAL_OPTIMIZATION for zlib
set(SKIP_INSTALL_ALL ON)
add_subdirectory(libraries/zlib EXCLUDE_FROM_ALL)
# On OS where unistd.h exists, zlib's generated header defines `Z_HAVE_UNISTD_H`, while the included header does not.
# We cannot safely undo the rename on those systems, and they generally have packages for zlib anyway.
check_include_file(unistd.h NEED_GENERATED_ZCONF)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib/zconf.h.included" AND NOT NEED_GENERATED_ZCONF)
# zlib's cmake script renames a file, dirtying the submodule, see https://github.com/madler/zlib/issues/162
message(STATUS "Undoing Rename")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib/zconf.h")
file(RENAME "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib/zconf.h.included" "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib/zconf.h")
endif()
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libraries/zlib" "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib" CACHE STRING "" FORCE)
set_target_properties(zlibstatic PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}")
add_library(ZLIB::ZLIB ALIAS zlibstatic)
set(ZLIB_LIBRARY ZLIB::ZLIB CACHE STRING "zlib library name")
find_package(ZLIB REQUIRED)
else()
message(STATUS "Using system zlib")
endif()
if (FORCE_BUNDLED_QUAZIP)
message(STATUS "Using bundled QuaZip")
set(BUILD_SHARED_LIBS 0) # link statically to avoid conflicts.
set(QUAZIP_INSTALL 0)
add_subdirectory(libraries/quazip) # zip manipulation library
else()
message(STATUS "Using system QuaZip")
endif()
add_subdirectory(libraries/rainbow) # Qt extension for colors
add_subdirectory(libraries/iconfix) # fork of Qt's QIcon loader
add_subdirectory(libraries/LocalPeer) # fork of a library from Qt solutions
add_subdirectory(libraries/classparser) # class parser library
add_subdirectory(libraries/optional-bare)
add_subdirectory(libraries/tomlc99) # toml parser
if(NOT tomlplusplus_FOUND)
message(STATUS "Using bundled tomlplusplus")
add_subdirectory(libraries/tomlplusplus) # toml parser
else()
message(STATUS "Using system tomlplusplus")
endif()
add_subdirectory(libraries/katabasis) # An OAuth2 library that tried to do too much
add_subdirectory(libraries/gamemode)
add_subdirectory(libraries/murmur2) # Hash for usage with the CurseForge API
if (NOT ghc_filesystem_FOUND)
message(STATUS "Using bundled ghc_filesystem")
set(GHC_FILESYSTEM_WITH_INSTALL OFF) # Workaround ghc::filesystem bug
add_subdirectory(libraries/filesystem) # Implementation of std::filesystem for old C++, for usage in old macOS
add_library(ghcFilesystem::ghc_filesystem ALIAS ghc_filesystem)
else()
message(STATUS "Using system ghc_filesystem")
endif()
############################### Built Artifacts ###############################
add_subdirectory(buildconfig)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
# NOTE: this must always be last to appease the CMake deity of quirky install command evaluation order.
add_subdirectory(launcher)

136
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,136 @@
# Contributor Covenant Code of Conduct
This is a modified version of the Contributor Covenant.
See commit history to see our changes.
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling (antagonistic, inflammatory, insincere behaviour), insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement via email at
[coc@scrumplex.net](mailto:coc@scrumplex.net) (Email
address subject to change).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

63
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,63 @@
# Contributions Guidelines
## Code formatting
Try to follow the existing formatting.
If there is no existing formatting, you may use `clang-format` with our included `.clang-format` configuration.
In general, in order of importance:
- Make sure your IDE is not messing up line endings or whitespace and avoid using linters.
- Prefer readability over dogma.
- Keep to the existing formatting.
- Indent with 4 space unless it's in a submodule.
- Keep lists (of arguments, parameters, initializers...) as lists, not paragraphs. It should either read from top to bottom, or left to right. Not both.
## Signing your work
In an effort to ensure that the code you contribute is actually compatible with the licenses in this codebase, we require you to sign-off all your contributions.
This can be done by appending `-s` to your `git commit` call, or by manually appending the following text to your commit message:
```
<commit message>
Signed-off-by: Author name <Author email>
```
By signing off your work, you agree to the terms below:
```
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
These terms will be enforced once you create a pull request, and you will be informed automatically if any of your commits aren't signed-off by you.
As a bonus, you can also [cryptographically sign your commits][gh-signing-commits] and enable [vigilant mode][gh-vigilant-mode] on GitHub.
[gh-signing-commits]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
[gh-vigilant-mode]: https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits

View File

@ -1,51 +1,121 @@
# PolyMC
## Prism Launcher
Copyright (C) 2012-2021 MultiMC Contributors
Copyright (C) 2021 PolyMC Contributors
Prism Launcher - Minecraft Launcher
Copyright (C) 2022-2023 Prism Launcher Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
# MinGW runtime (Windows)
This file incorporates work covered by the following copyright and
permission notice:
Copyright (c) 2012 MinGW.org project
Copyright 2013-2021 MultiMC Contributors
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
The above copyright notice, this permission notice and the below disclaimer
shall be included in all copies or substantial portions of the Software.
http://www.apache.org/licenses/LICENSE-2.0
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# Qt 5
## PolyMC
Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
PolyMC - Minecraft Launcher
Copyright (C) 2021-2022 PolyMC Contributors
Licensed under LGPL v2.1
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
# libnbt++
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
This file incorporates work covered by the following copyright and
permission notice:
Copyright 2013-2021 MultiMC Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## MinGW-w64 runtime (Windows)
Copyright (c) 2009, 2010, 2011, 2012, 2013 by the mingw-w64 project
This license has been certified as open source. It has also been designated
as GPL compatible by the Free Software Foundation (FSF).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions in source code must retain the accompanying copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the accompanying
copyright notice, this list of conditions, and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
3. Names of the copyright holders must not be used to endorse or promote
products derived from this software without prior written permission
from the copyright holders.
4. The right to distribute this software or to use it for any purpose does
not give you the right to use Servicemarks (sm) or Trademarks (tm) of
the copyright holders. Use of them is covered by separate agreement
with the copyright holders.
5. If any files are modified, you must cause the modified files to carry
prominent notices stating that you changed the files and the date of
any change.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Information on third party licenses used in MinGW-w64 can be found in its COPYING.MinGW-w64-runtime.txt.
## Qt 5/6
Copyright (C) 2022 The Qt Company Ltd and other contributors.
Contact: https://www.qt.io/licensing
Licensed under LGPL v3
## libnbt++
libnbt++ - A library for the Minecraft Named Binary Tag format.
Copyright (C) 2013, 2015 ljfa-ag
@ -63,7 +133,7 @@
You should have received a copy of the GNU Lesser General Public License
along with libnbt++. If not, see <http://www.gnu.org/licenses/>.
# rainbow (KGuiAddons)
## rainbow (KGuiAddons)
Copyright (C) 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
Copyright (C) 2007 Olaf Schmidt <ojschmidt@kde.org>
@ -86,7 +156,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
# Hoedown
## Hoedown
Copyright (c) 2008, Natacha Porté
Copyright (c) 2011, Vicent Martí
@ -104,7 +174,7 @@
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Batch icon set
## Batch icon set
You are free to use Batch (the "icon set") or any part thereof (the "icons")
in any personal, open-source or commercial work without obligation of payment
@ -120,7 +190,7 @@
PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OF THE ICONS,
EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
# Material Design Icons
## Material Design Icons
Copyright (c) 2014, Austin Andrews (http://materialdesignicons.com/),
with Reserved Font Name Material Design Icons.
@ -131,76 +201,82 @@
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
# Quazip
## Quazip
Copyright (C) 2005-2011 Sergey A. Tachenov
Copyright (C) 2005-2021 Sergey A. Tachenov
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
The QuaZip library is licensed under the GNU Lesser General Public
License V2.1 plus a static linking exception.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.
The original ZIP/UNZIP package (MiniZip) is copyrighted by Gilles
Vollant and contributors, see quazip/(un)zip.h files for details.
Basically it's the zlib license.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
STATIC LINKING EXCEPTION
The copyright holders give you permission to link this library with
independent modules to produce an executable, regardless of the license
terms of these independent modules, and to copy and distribute the
resulting executable under terms of your choice, provided that you also
meet, for each linked independent module, the terms and conditions of
the license of that module. An independent module is a module which is
not derived from or based on this library. If you modify this library,
you must extend this exception to your version of the library.
See COPYING file for the full LGPL text.
Original ZIP package is copyrighted by Gilles Vollant, see
quazip/(un)zip.h files for details, basically it's zlib license.
## launcher (`libraries/launcher`)
# xz-minidec
PolyMC - Minecraft Launcher
Copyright (C) 2021-2022 PolyMC Contributors
XZ decompressor
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
Authors: Lasse Collin <lasse.collin@tukaani.org>
Igor Pavlov <http://7-zip.org/>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This file has been put into the public domain.
You can do whatever you want with this file.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
# ColumnResizer
As a special exception, the copyright holders of this library give
you permission to link this library with independent modules to
produce an executable, regardless of the license terms of these
independent modules, and to copy and distribute the resulting
executable under terms of your choice, provided that you also meet,
for each linked independent module, the terms and conditions of the
license of that module. An independent module is a module which is
not derived from or based on this library. If you modify this
library, you may extend this exception to your version of the
library, but you are not obliged to do so. If you do not wish to do
so, delete this exception statement from your version.
Copyright (c) 2011-2016 Aurélien Gâteau and contributors.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
All rights reserved.
This file incorporates work covered by the following copyright and
permission notice:
Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the
disclaimer below) provided that the following conditions are met:
Copyright 2013-2021 MultiMC Contributors
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
http://www.apache.org/licenses/LICENSE-2.0
* The name of the contributors may not be used to endorse or
promote products derived from this software without specific prior
written permission.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# lionshead
## lionshead
Code has been taken from https://github.com/natefoo/lionshead and loosely
translated to C++ laced with Qt.
@ -227,60 +303,26 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# optional-bare
Code from https://github.com/martinmoene/optional-bare/
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
# tomlc99
## tomlplusplus
MIT License
Copyright (c) 2017 CK Tan
https://github.com/cktan/tomlc99
Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# O2 (Katabasis fork)
## O2 (Katabasis fork)
Copyright (c) 2012, Akos Polster
All rights reserved.
@ -305,3 +347,96 @@
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## Gamemode
Copyright (c) 2017-2022, Feral Interactive
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Feral Interactive nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
## gulrak/filesystem
Copyright (c) 2018, Steffen Schümann <s.schuemann@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## Breeze icons
Copyright (C) 2014 Uri Herrera <uri_herrera@nitrux.in> and others
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
## Oxygen Icons
The Oxygen Icon Theme
Copyright (C) 2007 Nuno Pinheiro <nuno@oxygen-icons.org>
Copyright (C) 2007 David Vignoni <david@icon-king.com>
Copyright (C) 2007 David Miller <miller@oxygen-icons.org>
Copyright (C) 2007 Johann Ollivier Lapeyre <johann@oxygen-icons.org>
Copyright (C) 2007 Kenneth Wimer <kwwii@bootsplash.org>
Copyright (C) 2007 Riccardo Iaconelli <riccardo@oxygen-icons.org>
and others
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

123
README.md
View File

@ -1,61 +1,102 @@
<p align="center">
<img src="https://avatars.githubusercontent.com/u/96310119" alt="PolyMC logo"/>
<p align="left">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="/program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg">
<source media="(prefers-color-scheme: light)" srcset="/program_info/org.prismlauncher.PrismLauncher.logo.svg">
<img alt="Prism Launcher" src="/program_info/org.prismlauncher.PrismLauncher.logo.svg" width="50%">
</picture>
</p>
PolyMC 5
=========
PolyMC is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.
Prism Launcher is a custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.
This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. The PolyMC community felt that the maintainer was not acting in the spirit of Free Software so this fork was made. Read "[Why was this fork made?](https://github.com/PolyMC/PolyMC/wiki/FAQ)" on the wiki for more details.
This is a **fork** of the MultiMC Launcher and is not endorsed by MultiMC.
## Packages
Several source build packages are available, along with experimental pre-built generic packages.
- An [AUR package](https://aur.archlinux.org/packages/polymc-git/) is available.
- A Gentoo ebuild is available in the [swirl](https://git.swurl.xyz/swirl/ebuilds) overlay, named `games-action/polymc`. Check the README for instructions on how to add the overlay.
- A Flatpak is available. Instructions on building it can be found in [packages/flatpak/BUILDING.md](packages/flatpak/BUILDING.md).
- Generic, prebuilt packages (archived by version) can be found [here](https://packages.polymc.org/) ([latest](https://packages.polymc.org/latest))
- Last build status: https://jenkins.polymc.org/job/PolyMC/lastBuild/
- [Linux (AMD64) System](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst) ([SHA256](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst.sha256)) - this is a generic system package intended to be used as a base for making distro-specific packages.
- [Windows (32-bit)](https://packages.polymc.org/latest/win32/win32.zip) ([SHA256](https://packages.polymc.org/latest/win32/win32.zip.sha256)) - this is a portable package, you can extract it anywhere and run it. This package needs testing.
- [Debian (AMD64)](https://packages.polymc.org/latest/deb/polymc-amd64.deb) ([SHA256](https://packages.polymc.org/latest/deb/polymc-amd64.deb.sha256)) - this is intended to be installed with `dpkg -i`. Alternatively, you may build the `.deb` yourself, by going to `packages/debian` and running `./makedeb.sh`.
- MacOS currently does not have any packages. We are still working on setting up MacOS packaging.
## Installation
## Development
If you want to contribute to PolyMC you might find it useful to join [#development:polymc.org on Matrix](https://matrix.to/#/#development:polymc.org) or join [our Discord server](https://discord.gg/xq7fxrgtMP), which is bridged with the PolyMC Matrix rooms. Thank you!
<a href="https://repology.org/project/prismlauncher/versions">
<img src="https://repology.org/badge/vertical-allrepos/prismlauncher.svg" alt="Packaging status" align="right">
</a>
### Building
If you want to build PolyMC yourself, check [BUILD.md](BUILD.md) for build instructions.
- All downloads and instructions for Prism Launcher can be found on our [Website](https://prismlauncher.org/download/).
- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions).
### Code formatting
Just follow the existing formatting.
### Development Builds
In general, in order of importance:
* Make sure your IDE is not messing up line endings or whitespace and avoid using linters.
* Prefer readability over dogma.
* Keep to the existing formatting.
* Indent with 4 space unless it's in a submodule.
* Keep lists (of arguments, parameters, initializers...) as lists, not paragraphs. It should either read from top to bottom, or left to right. Not both.
There are development builds available [here](https://github.com/PrismLauncher/PrismLauncher/actions). These have debug information in the binaries, so their file sizes are relatively larger.
Prebuilt Development builds are provided for **Linux**, **Windows** and **macOS**.
For **Arch**, **Debian**, **Fedora**, **OpenSUSE (Tumbleweed)** and **Gentoo**, respectively, you can use these packages for the latest development versions:
[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-A80030?style=flat-square&logo=debian&logoColor=white)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-nightly](https://img.shields.io/badge/copr-prismlauncher--nightly-51A2DA?style=flat-square&logo=fedora&logoColor=white)](https://copr.fedorainfracloud.org/coprs/g3tchoo/prismlauncher/) [![prismlauncher-nightly](https://img.shields.io/badge/OBS-prismlauncher--nightly-3AB6A9?style=flat-square&logo=opensuse&logoColor=white)](https://build.opensuse.org/project/show/home:getchoo) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-4D4270?style=flat-square&logo=gentoo&logoColor=white)](https://packages.gentoo.org/packages/games-action/prismlauncher)
## Community & Support
Feel free to create a GitHub issue if you find a bug or want to suggest a new feature. We have multiple community spaces where other community members can help you.
#### Join our Discord server:
[![Prism Launcher Discord server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner2)](https://discord.gg/prismlauncher)
#### Join our Matrix space:
[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?style=for-the-badge&logo=matrix)](https://matrix.to/#/#prismlauncher:matrix.org)
#### Join our Subreddit:
[![r/PrismLauncher](https://img.shields.io/reddit/subreddit-subscribers/prismlauncher?style=for-the-badge&logo=reddit)](https://www.reddit.com/r/PrismLauncher/)
## Building
If you want to build Prism Launcher yourself, check the [Build Instructions](https://prismlauncher.org/wiki/development/build-instructions/).
## Translations
TODO
The translation effort for PrismLauncher is hosted on [Weblate](https://hosted.weblate.org/projects/prismlauncher/launcher/) and information about translating Prism Launcher is available at <https://github.com/PrismLauncher/Translations>
## Forking/Redistributing/Custom builds policy
Do whatever you want, we don't care. Just follow the license. If you have any questions about this feel free to ask in an issue.
## Help & Support
Feel free to create an issue if you need help. However, you might find it easier to ask in the Discord server.
We don't care what you do with your fork/custom build as long as you follow the terms of the [license](LICENSE) (this is a legal responsibility), and if you made code changes rather than just packaging a custom build, please do the following as a basic courtesy:
[![PolyMC Discord](https://img.shields.io/discord/923671181020766230?label=PolyMC%20Discord)](https://discord.gg/xq7fxrgtMP)
- Make it clear that your fork is not PrismLauncher and is not endorsed by or affiliated with the PrismLauncher project (<https://prismlauncher.org>).
- Go through [CMakeLists.txt](CMakeLists.txt) and change PrismLauncher's API keys to your own or set them to empty strings (`""`) to disable them (this way the program will still compile but the functionality requiring those keys will be disabled).
For people who don't want to use Discord, we have a Matrix Space which is bridged to the discord server. Be sure to enable spaces first (Settings -> Labs -> Spaces), and then you may join the space:
If you have any questions or want any clarification on the above conditions please make an issue and ask us.
[![PolyMC Space](https://img.shields.io/matrix/polymc:polymc.org?label=PolyMC%20Space&server_fqdn=matrix.polymc.org)](https://matrix.to/#/#polymc:polymc.org)
Be aware that if you build this software without removing the provided API keys in [CMakeLists.txt](CMakeLists.txt) you are accepting the following terms and conditions:
Matrix's support for spaces is still in development, so if you have issues accessing rooms via the space, then you can join the rooms directly:
- [Microsoft Identity Platform Terms of Use](https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use)
- [CurseForge 3rd Party API Terms and Conditions](https://support.curseforge.com/en/support/solutions/articles/9000207405-curse-forge-3rd-party-api-terms-and-conditions)
[![Support](https://img.shields.io/matrix/support:polymc.org?label=%23support&server_fqdn=matrix.polymc.org)](https://matrix.to/#/#support:polymc.org)
[![Discussion](https://img.shields.io/matrix/discussion:polymc.org?label=%23discussion&server_fqdn=matrix.polymc.org)](https://matrix.to/#/#discussion:polymc.org)
[![Development](https://img.shields.io/matrix/development:polymc.org?label=%23development&server_fqdn=matrix.polymc.org)](https://matrix.to/#/#development:polymc.org)
[![News](https://img.shields.io/matrix/news:polymc.org?label=%23news&server_fqdn=matrix.polymc.org)](https://matrix.to/#/#news:polymc.org)
If you do not agree with these terms and conditions, then remove the associated API keys from the [CMakeLists.txt](CMakeLists.txt) file by setting them to an empty string (`""`).
## Sponsors & Partners
We thank all the wonderful backers over at Open Collective! Support Prism Launcher by [becoming a backer](https://opencollective.com/prismlauncher).
[![OpenCollective Backers](https://opencollective.com/prismlauncher/backers.svg?width=890&limit=1000)](https://opencollective.com/prismlauncher#backers)
Thanks to JetBrains for providing us a few licenses for all their products, as part of their [Open Source program](https://www.jetbrains.com/opensource/).
[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/opensource/)
Thanks to Weblate for hosting our translation efforts.
<a href="https://hosted.weblate.org/engage/prismlauncher/">
<img src="https://hosted.weblate.org/widgets/prismlauncher/-/open-graph.png" alt="Translation status" width="300" />
</a>
Thanks to Netlify for providing us their excellent web services, as part of their [Open Source program](https://www.netlify.com/open-source/)
<a href="https://www.netlify.com"> <img src="https://www.netlify.com/v3/img/components/netlify-color-accent.svg" alt="Deploys by Netlify" /> </a>
Thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes!
<a href="https://www.macstadium.com"><img src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png" alt="Powered by MacStadium" width="300"></a>
## License
All launcher code is available under the GPL-3.0-only license.
![https://github.com/PrismLauncher/PrismLauncher/blob/develop/LICENSE](https://img.shields.io/github/license/PrismLauncher/PrismLauncher?style=for-the-badge&logo=gnu&color=C4282D)
The logo and related assets are under the CC BY-SA 4.0 license.

View File

@ -1,3 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BuildConfig.h"
#include <QObject>
@ -7,11 +42,14 @@ Config::Config()
{
// Name and copyright
LAUNCHER_NAME = "@Launcher_Name@";
LAUNCHER_APP_BINARY_NAME = "@Launcher_APP_BINARY_NAME@";
LAUNCHER_DISPLAYNAME = "@Launcher_DisplayName@";
LAUNCHER_COPYRIGHT = "@Launcher_Copyright@";
LAUNCHER_DOMAIN = "@Launcher_Domain@";
LAUNCHER_CONFIGFILE = "@Launcher_ConfigFile@";
LAUNCHER_GIT = "@Launcher_Git@";
LAUNCHER_DESKTOPFILENAME = "@Launcher_DesktopFileName@";
LAUNCHER_SVGFILENAME = "@Launcher_SVGFileName@";
USER_AGENT = "@Launcher_UserAgent@";
USER_AGENT_UNCACHED = USER_AGENT + " (Uncached)";
@ -19,53 +57,78 @@ Config::Config()
// Version information
VERSION_MAJOR = @Launcher_VERSION_MAJOR@;
VERSION_MINOR = @Launcher_VERSION_MINOR@;
VERSION_HOTFIX = @Launcher_VERSION_HOTFIX@;
VERSION_BUILD = @Launcher_VERSION_BUILD@;
BUILD_PLATFORM = "@Launcher_BUILD_PLATFORM@";
BUILD_DATE = "@Launcher_BUILD_TIMESTAMP@";
UPDATER_BASE = "@Launcher_UPDATER_BASE@";
NOTIFICATION_URL = "@Launcher_NOTIFICATION_URL@";
FULL_VERSION_STR = "@Launcher_VERSION_MAJOR@.@Launcher_VERSION_MINOR@.@Launcher_VERSION_BUILD@";
MAC_SPARKLE_PUB_KEY = "@MACOSX_SPARKLE_UPDATE_PUBLIC_KEY@";
MAC_SPARKLE_APPCAST_URL = "@MACOSX_SPARKLE_UPDATE_FEED_URL@";
if (BUILD_PLATFORM == "macOS" && !MAC_SPARKLE_PUB_KEY.isEmpty() && !MAC_SPARKLE_APPCAST_URL.isEmpty())
{
UPDATER_ENABLED = true;
}
GIT_COMMIT = "@Launcher_GIT_COMMIT@";
GIT_TAG = "@Launcher_GIT_TAG@";
GIT_REFSPEC = "@Launcher_GIT_REFSPEC@";
if(GIT_REFSPEC.startsWith("refs/heads/") && !UPDATER_BASE.isEmpty() && !BUILD_PLATFORM.isEmpty() && VERSION_BUILD >= 0)
// Assume that builds outside of Git repos are "stable"
if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND")
|| GIT_TAG == QStringLiteral("GITDIR-NOTFOUND")
|| GIT_REFSPEC == QStringLiteral("")
|| GIT_TAG == QStringLiteral("GIT-NOTFOUND"))
{
GIT_REFSPEC = "refs/heads/stable";
GIT_TAG = versionString();
}
if (GIT_REFSPEC.startsWith("refs/heads/"))
{
VERSION_CHANNEL = GIT_REFSPEC;
VERSION_CHANNEL.remove("refs/heads/");
UPDATER_ENABLED = true;
if(!UPDATER_BASE.isEmpty() && !BUILD_PLATFORM.isEmpty()) {
UPDATER_ENABLED = true;
}
}
else if (!GIT_COMMIT.isEmpty())
{
VERSION_CHANNEL = GIT_COMMIT.mid(0, 8);
}
else
{
VERSION_CHANNEL = QObject::tr("custom");
VERSION_CHANNEL = "unknown";
}
VERSION_STR = "@Launcher_VERSION_STRING@";
NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@";
PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@";
NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@";
HELP_URL = "@Launcher_HELP_URL@";
IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@";
MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@";
FLAME_API_KEY = "@Launcher_CURSEFORGE_API_KEY@";
META_URL = "@Launcher_META_URL@";
BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@";
TRANSLATIONS_URL = "@Launcher_TRANSLATIONS_URL@";
MATRIX_URL = "@Launcher_MATRIX_URL@";
DISCORD_URL = "@Launcher_DISCORD_URL@";
SUBREDDIT_URL = "@Launcher_SUBREDDIT_URL@";
}
QString Config::versionString() const
{
return QString("%1.%2").arg(VERSION_MAJOR).arg(VERSION_MINOR);
}
QString Config::printableVersionString() const
{
QString vstr = QString("%1.%2.%3").arg(QString::number(VERSION_MAJOR), QString::number(VERSION_MINOR), QString::number(VERSION_HOTFIX));
QString vstr = versionString();
// If the build is not a main release, append the channel
if(VERSION_CHANNEL != "stable")
if(VERSION_CHANNEL != "stable" && GIT_TAG != vstr)
{
vstr += "-" + VERSION_CHANNEL;
}
// if a build number is set, also add it to the end
if(VERSION_BUILD >= 0)
{
vstr += "-" + QString::number(VERSION_BUILD);
}
return vstr;
}

View File

@ -1,28 +1,62 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <QString>
/**
* \brief The Config class holds all the build-time information passed from the build system.
*/
class Config
{
public:
class Config {
public:
Config();
QString LAUNCHER_NAME;
QString LAUNCHER_APP_BINARY_NAME;
QString LAUNCHER_DISPLAYNAME;
QString LAUNCHER_COPYRIGHT;
QString LAUNCHER_DOMAIN;
QString LAUNCHER_CONFIGFILE;
QString LAUNCHER_GIT;
QString LAUNCHER_DESKTOPFILENAME;
QString LAUNCHER_SVGFILENAME;
/// The major version number.
int VERSION_MAJOR;
/// The minor version number.
int VERSION_MINOR;
/// The hotfix number.
int VERSION_HOTFIX;
/// The build number.
int VERSION_BUILD;
/**
* The version channel
@ -35,9 +69,17 @@ public:
/// A short string identifying this build's platform. For example, "lin64" or "win32".
QString BUILD_PLATFORM;
/// A string containing the build timestamp
QString BUILD_DATE;
/// URL for the updater's channel
QString UPDATER_BASE;
/// The public key used to sign releases for the Sparkle updater appcast
QString MAC_SPARKLE_PUB_KEY;
/// URL for the Sparkle updater's appcast
QString MAC_SPARKLE_APPCAST_URL;
/// User-Agent to use.
QString USER_AGENT;
@ -45,22 +87,15 @@ public:
/// User-Agent to use for uncached requests.
QString USER_AGENT_UNCACHED;
/// URL for notifications
QString NOTIFICATION_URL;
/// Used for matching notifications
QString FULL_VERSION_STR;
/// The git commit hash of this build
QString GIT_COMMIT;
/// The git tag of this build
QString GIT_TAG;
/// The git refspec of this build
QString GIT_REFSPEC;
/// This is printed on start to standard output
QString VERSION_STR;
/**
* This is used to fetch the news RSS feed.
* It defaults in CMakeLists.txt to "https://multimc.org/rss.xml"
@ -68,9 +103,14 @@ public:
QString NEWS_RSS_URL;
/**
* API key you can get from paste.ee when you register an account
* URL that gets opened when the user clicks "More News"
*/
QString PASTE_EE_KEY;
QString NEWS_OPEN_URL;
/**
* URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help
*/
QString HELP_URL;
/**
* Client ID you can get from Imgur when you register an application
@ -82,12 +122,19 @@ public:
*/
QString MSA_CLIENT_ID;
/**
* Client API key for CurseForge
*/
QString FLAME_API_KEY;
/**
* Metadata repository URL prefix
*/
QString META_URL;
QString BUG_TRACKER_URL;
QString TRANSLATIONS_URL;
QString MATRIX_URL;
QString DISCORD_URL;
QString SUBREDDIT_URL;
@ -95,15 +142,28 @@ public:
QString LIBRARY_BASE = "https://libraries.minecraft.net/";
QString AUTH_BASE = "https://authserver.mojang.com/";
QString IMGUR_BASE_URL = "https://api.imgur.com/3/";
QString FMLLIBS_BASE_URL = "https://files.multimc.org/fmllibs/";
QString TRANSLATIONS_BASE_URL = "https://files.multimc.org/translations/";
QString FMLLIBS_BASE_URL = "https://files.prismlauncher.org/fmllibs/"; // FIXME: move into CMakeLists
QString TRANSLATIONS_BASE_URL = "https://i18n.prismlauncher.org/"; // FIXME: move into CMakeLists
QString MODPACKSCH_API_BASE_URL = "https://api.modpacks.ch/";
QString LEGACY_FTB_CDN_BASE_URL = "https://dist.creeper.host/FTB2/";
QString ATL_DOWNLOAD_SERVER_URL = "https://download.nodecdn.net/containers/atl/";
QString ATL_API_BASE_URL = "https://api.atlauncher.com/v1/";
QString TECHNIC_API_BASE_URL = "https://api.technicpack.net/";
/**
* The build that is reported to the Technic API.
*/
QString TECHNIC_API_BUILD = "multimc";
QString MODRINTH_STAGING_URL = "https://staging-api.modrinth.com/v2";
QString MODRINTH_PROD_URL = "https://api.modrinth.com/v2";
QString FLAME_BASE_URL = "https://api.curseforge.com/v1";
QString versionString() const;
/**
* \brief Converts the Version to a string.
* \return The version number in string format (major.minor.revision.build).
@ -112,4 +172,3 @@ public:
};
extern const Config BuildConfig;

View File

@ -7,5 +7,5 @@ add_library(BuildConfig STATIC
${CMAKE_CURRENT_BINARY_DIR}/BuildConfig.cpp
)
target_link_libraries(BuildConfig Qt5::Core)
target_link_libraries(BuildConfig Qt${QT_VERSION_MAJOR}::Core)
target_include_directories(BuildConfig PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")

File diff suppressed because it is too large Load Diff

View File

@ -1,786 +0,0 @@
# - Functions to help assemble a standalone bundle application.
# A collection of CMake utility functions useful for dealing with .app
# bundles on the Mac and bundle-like directories on any OS.
#
# The following functions are provided by this module:
# fixup_bundle
# copy_and_fixup_bundle
# verify_app
# get_bundle_main_executable
# get_dotapp_dir
# get_bundle_and_executable
# get_bundle_all_executables
# get_item_key
# clear_bundle_keys
# set_bundle_key_values
# get_bundle_keys
# copy_resolved_item_into_bundle
# copy_resolved_framework_into_bundle
# fixup_bundle_item
# verify_bundle_prerequisites
# verify_bundle_symlinks
# Requires CMake 2.6 or greater because it uses function, break and
# PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
#
# FIXUP_BUNDLE(<app> <libs> <dirs>)
# Fix up a bundle in-place and make it standalone, such that it can be
# drag-n-drop copied to another machine and run on that machine as long as all
# of the system libraries are compatible.
#
# If you pass plugins to fixup_bundle as the libs parameter, you should install
# them or copy them into the bundle before calling fixup_bundle. The "libs"
# parameter is a list of libraries that must be fixed up, but that cannot be
# determined by otool output analysis. (i.e., plugins)
#
# Gather all the keys for all the executables and libraries in a bundle, and
# then, for each key, copy each prerequisite into the bundle. Then fix each one
# up according to its own list of prerequisites.
#
# Then clear all the keys and call verify_app on the final bundle to ensure
# that it is truly standalone.
#
# COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
# Makes a copy of the bundle <src> at location <dst> and then fixes up the
# new copied bundle in-place at <dst>...
#
# VERIFY_APP(<app>)
# Verifies that an application <app> appears valid based on running analysis
# tools on it. Calls "message(FATAL_ERROR" if the application is not verified.
#
# GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
# The result will be the full path name of the bundle's main executable file
# or an "error:" prefixed string if it could not be determined.
#
# GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
# Returns the nearest parent dir whose name ends with ".app" given the full
# path to an executable. If there is no such parent dir, then simply return
# the dir containing the executable.
#
# The returned directory may or may not exist.
#
# GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
# Takes either a ".app" directory name or the name of an executable
# nested inside a ".app" directory and returns the path to the ".app"
# directory in <bundle_var> and the path to its main executable in
# <executable_var>
#
# GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
# Scans the given bundle recursively for all executable files and accumulates
# them into a variable.
#
# GET_ITEM_KEY(<item> <key_var>)
# Given a file (item) name, generate a key that should be unique considering
# the set of libraries that need copying or fixing up to make a bundle
# standalone. This is essentially the file name including extension with "."
# replaced by "_"
#
# This key is used as a prefix for CMake variables so that we can associate a
# set of variables with a given item based on its key.
#
# CLEAR_BUNDLE_KEYS(<keys_var>)
# Loop over the list of keys, clearing all the variables associated with each
# key. After the loop, clear the list of keys itself.
#
# Caller of get_bundle_keys should call clear_bundle_keys when done with list
# of keys.
#
# SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
# <copyflag>)
# Add a key to the list (if necessary) for the given item. If added,
# also set all the variables associated with that key.
#
# GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
# Loop over all the executable and library files within the bundle (and given
# as extra <libs>) and accumulate a list of keys representing them. Set
# values associated with each key such that we can loop over all of them and
# copy prerequisite libs into the bundle and then do appropriate
# install_name_tool fixups.
#
# COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
# Copy a resolved item into the bundle if necessary. Copy is not necessary if
# the resolved_item is "the same as" the resolved_embedded_item.
#
# COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
# Copy a resolved framework into the bundle if necessary. Copy is not necessary
# if the resolved_item is "the same as" the resolved_embedded_item.
#
# By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full
# frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to
# ON before calling fixup_bundle. By default,
# COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the framework dylib itself plus
# the framework Resources directory.
#
# FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
# Get the direct/non-system prerequisites of the resolved embedded item. For
# each prerequisite, change the way it is referenced to the value of the
# _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to
# an "@executable_path" style reference.)
#
# This function requires that the resolved_embedded_item be "inside" the bundle
# already. In other words, if you pass plugins to fixup_bundle as the libs
# parameter, you should install them or copy them into the bundle before
# calling fixup_bundle. The "libs" parameter is a list of libraries that must
# be fixed up, but that cannot be determined by otool output analysis. (i.e.,
# plugins)
#
# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM
# value.
#
# Accumulate changes in a local variable and make *one* call to
# install_name_tool at the end of the function with all the changes at once.
#
# If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
# marked writable before install_name_tool tries to change them.
#
# VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
# Verifies that the sum of all prerequisites of all files inside the bundle
# are contained within the bundle or are "system" libraries, presumed to exist
# everywhere.
#
# VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
# Verifies that any symlinks found in the bundle point to other files that are
# already also in the bundle... Anything that points to an external file causes
# this function to fail the verification.
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# The functions defined in this file depend on the get_prerequisites function
# (and possibly others) found in:
#
get_filename_component(BundleUtilities_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${BundleUtilities_cmake_dir}/GetPrerequisites.cmake")
function(get_bundle_main_executable bundle result_var)
set(result "error: '${bundle}/Contents/Info.plist' file does not exist")
if(EXISTS "${bundle}/Contents/Info.plist")
set(result "error: no CFBundleExecutable in '${bundle}/Contents/Info.plist' file")
set(line_is_main_executable 0)
set(bundle_executable "")
# Read Info.plist as a list of lines:
#
set(eol_char "E")
file(READ "${bundle}/Contents/Info.plist" info_plist)
string(REGEX REPLACE ";" "\\\\;" info_plist "${info_plist}")
string(REGEX REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
# Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
# is the name of the main executable.
#
foreach(line ${info_plist})
if(line_is_main_executable)
string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
break()
endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
set(line_is_main_executable 1)
endif()
endforeach()
if(NOT "${bundle_executable}" STREQUAL "")
if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
set(result "${bundle}/Contents/MacOS/${bundle_executable}")
else()
# Ultimate goal:
# If not in "Contents/MacOS" then scan the bundle for matching files. If
# there is only one executable file that matches, then use it, otherwise
# it's an error...
#
#file(GLOB_RECURSE file_list "${bundle}/${bundle_executable}")
# But for now, pragmatically, it's an error. Expect the main executable
# for the bundle to be in Contents/MacOS, it's an error if it's not:
#
set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
endif()
endif()
else()
#
# More inclusive technique... (This one would work on Windows and Linux
# too, if a developer followed the typical Mac bundle naming convention...)
#
# If there is no Info.plist file, try to find an executable with the same
# base name as the .app directory:
#
endif()
set(${result_var} "${result}" PARENT_SCOPE)
endfunction()
function(get_dotapp_dir exe dotapp_dir_var)
set(s "${exe}")
if(s MATCHES "^.*/.*\\.app/.*$")
# If there is a ".app" parent directory,
# ascend until we hit it:
# (typical of a Mac bundle executable)
#
set(done 0)
while(NOT ${done})
get_filename_component(snamewe "${s}" NAME_WE)
get_filename_component(sname "${s}" NAME)
get_filename_component(sdir "${s}" PATH)
set(s "${sdir}")
if(sname MATCHES "\\.app$")
set(done 1)
set(dotapp_dir "${sdir}/${sname}")
endif()
endwhile()
else()
# Otherwise use a directory containing the exe
# (typical of a non-bundle executable on Mac, Windows or Linux)
#
is_file_executable("${s}" is_executable)
if(is_executable)
get_filename_component(sdir "${s}" PATH)
set(dotapp_dir "${sdir}")
else()
set(dotapp_dir "${s}")
endif()
endif()
set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
endfunction()
function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 0)
if(EXISTS "${app}")
# Is it a directory ending in .app?
if(IS_DIRECTORY "${app}")
if(app MATCHES "\\.app$")
get_bundle_main_executable("${app}" executable)
if(EXISTS "${app}" AND EXISTS "${executable}")
set(${bundle_var} "${app}" PARENT_SCOPE)
set(${executable_var} "${executable}" PARENT_SCOPE)
set(valid 1)
#message(STATUS "info: handled .app directory case...")
else()
message(STATUS "warning: *NOT* handled - .app directory case...")
endif()
else()
message(STATUS "warning: *NOT* handled - directory but not .app case...")
endif()
else()
# Is it an executable file?
is_file_executable("${app}" is_executable)
if(is_executable)
get_dotapp_dir("${app}" dotapp_dir)
if(EXISTS "${dotapp_dir}")
set(${bundle_var} "${dotapp_dir}" PARENT_SCOPE)
set(${executable_var} "${app}" PARENT_SCOPE)
set(valid 1)
#message(STATUS "info: handled executable file in .app dir case...")
else()
get_filename_component(app_dir "${app}" PATH)
set(${bundle_var} "${app_dir}" PARENT_SCOPE)
set(${executable_var} "${app}" PARENT_SCOPE)
set(valid 1)
#message(STATUS "info: handled executable file in any dir case...")
endif()
else()
message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
endif()
endif()
else()
message(STATUS "warning: *NOT* handled - directory/file ${app} does not exist...")
endif()
if(NOT valid)
set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
set(${executable_var} "error: not a bundle" PARENT_SCOPE)
endif()
set(${valid_var} ${valid} PARENT_SCOPE)
endfunction()
function(get_bundle_all_executables bundle exes_var)
set(exes "")
file(GLOB_RECURSE file_list "${bundle}/*")
foreach(f ${file_list})
is_file_executable("${f}" is_executable)
if(is_executable)
set(exes ${exes} "${f}")
endif()
endforeach()
set(${exes_var} "${exes}" PARENT_SCOPE)
endfunction()
function(get_item_key item key_var)
get_filename_component(item_name "${item}" NAME)
if(WIN32)
string(TOLOWER "${item_name}" item_name)
endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE)
endfunction()
function(clear_bundle_keys keys_var)
foreach(key ${${keys_var}})
set(${key}_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_ITEM PARENT_SCOPE)
set(${key}_DEFAULT_EMBEDDED_PATH PARENT_SCOPE)
set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_COPYFLAG PARENT_SCOPE)
endforeach()
set(${keys_var} PARENT_SCOPE)
endfunction()
function(set_bundle_key_values keys_var context item exepath dirs copyflag)
get_filename_component(item_name "${item}" NAME)
get_item_key("${item}" key)
list(LENGTH ${keys_var} length_before)
gp_append_unique(${keys_var} "${key}")
list(LENGTH ${keys_var} length_after)
if(NOT length_before EQUAL length_after)
gp_resolve_item("${context}" "${item}" "${exepath}" "${dirs}" resolved_item)
gp_item_default_embedded_path("${item}" default_embedded_path)
if(item MATCHES "[^/]+\\.framework/")
# For frameworks, construct the name under the embedded path from the
# opening "${item_name}.framework/" to the closing "/${item_name}":
#
string(REGEX REPLACE "^.*(${item_name}.framework/.*/?${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
else()
# For other items, just use the same name as the original, but in the
# embedded path:
#
set(embedded_item "${default_embedded_path}/${item_name}")
endif()
# Replace @executable_path and resolve ".." references:
#
string(REPLACE "@executable_path" "${exepath}" resolved_embedded_item "${embedded_item}")
get_filename_component(resolved_embedded_item "${resolved_embedded_item}" ABSOLUTE)
# *But* -- if we are not copying, then force resolved_embedded_item to be
# the same as resolved_item. In the case of multiple executables in the
# original bundle, using the default_embedded_path results in looking for
# the resolved executable next to the main bundle executable. This is here
# so that exes in the other sibling directories (like "bin") get fixed up
# properly...
#
if(NOT copyflag)
set(resolved_embedded_item "${resolved_item}")
endif()
set(${keys_var} ${${keys_var}} PARENT_SCOPE)
set(${key}_ITEM "${item}" PARENT_SCOPE)
set(${key}_RESOLVED_ITEM "${resolved_item}" PARENT_SCOPE)
set(${key}_DEFAULT_EMBEDDED_PATH "${default_embedded_path}" PARENT_SCOPE)
set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
else()
#message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
endif()
endfunction()
function(get_bundle_keys app libs dirs keys_var)
set(${keys_var} PARENT_SCOPE)
get_bundle_and_executable("${app}" bundle executable valid)
if(valid)
# Always use the exepath of the main bundle executable for @executable_path
# replacements:
#
get_filename_component(exepath "${executable}" PATH)
# But do fixups on all executables in the bundle:
#
get_bundle_all_executables("${bundle}" exes)
# For each extra lib, accumulate a key as well and then also accumulate
# any of its prerequisites. (Extra libs are typically dynamically loaded
# plugins: libraries that are prerequisites for full runtime functionality
# but that do not show up in otool -L output...)
#
foreach(lib ${libs})
set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0)
set(prereqs "")
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach()
endforeach()
# For each executable found in the bundle, accumulate keys as we go.
# The list of keys should be complete when all prerequisites of all
# binaries in the bundle have been analyzed.
#
foreach(exe ${exes})
# Add the exe itself to the keys:
#
set_bundle_key_values(${keys_var} "${exe}" "${exe}" "${exepath}" "${dirs}" 0)
# Add each prerequisite to the keys:
#
set(prereqs "")
get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach()
endforeach()
# Propagate values to caller's scope:
#
set(${keys_var} ${${keys_var}} PARENT_SCOPE)
foreach(key ${${keys_var}})
set(${key}_ITEM "${${key}_ITEM}" PARENT_SCOPE)
set(${key}_RESOLVED_ITEM "${${key}_RESOLVED_ITEM}" PARENT_SCOPE)
set(${key}_DEFAULT_EMBEDDED_PATH "${${key}_DEFAULT_EMBEDDED_PATH}" PARENT_SCOPE)
set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
endforeach()
endif()
endfunction()
function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
if(WIN32)
# ignore case on Windows
string(TOLOWER "${resolved_item}" resolved_item_compare)
string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
else()
set(resolved_item_compare "${resolved_item}")
set(resolved_embedded_item_compare "${resolved_embedded_item}")
endif()
if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}")
message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
else()
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif()
endif()
endfunction()
function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
if(WIN32)
# ignore case on Windows
string(TOLOWER "${resolved_item}" resolved_item_compare)
string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
else()
set(resolved_item_compare "${resolved_item}")
set(resolved_embedded_item_compare "${resolved_embedded_item}")
endif()
if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}")
message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
else()
if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
# Full Framework (everything):
get_filename_component(resolved_dir "${resolved_item}" PATH)
get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
else()
# Framework lib itself:
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
# Plus Resources, if they exist:
string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
if(EXISTS "${resolved_resources}")
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
endif()
endif()
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif()
endif()
endfunction()
function(fixup_bundle_item resolved_embedded_item exepath dirs)
# This item's key is "ikey":
#
get_item_key("${resolved_embedded_item}" ikey)
# Ensure the item is "inside the .app bundle" -- it should not be fixed up if
# it is not in the .app bundle... Otherwise, we'll modify files in the build
# tree, or in other varied locations around the file system, with our call to
# install_name_tool. Make sure that doesn't happen here:
#
get_dotapp_dir("${exepath}" exe_dotapp_dir)
string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length)
set(path_too_short 0)
set(is_embedded 0)
if(${resolved_embedded_item_length} LESS ${exe_dotapp_dir_length})
set(path_too_short 1)
endif()
if(NOT path_too_short)
string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
if("${exe_dotapp_dir}/" STREQUAL "${item_substring}")
set(is_embedded 1)
endif()
endif()
if(NOT is_embedded)
message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
message(" item_substring='${item_substring}'")
message(" resolved_embedded_item='${resolved_embedded_item}'")
message("")
message("Install or copy the item into the bundle before calling fixup_bundle.")
message("Or maybe there's a typo or incorrect path in one of the args to fixup_bundle?")
message("")
message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
endif()
set(prereqs "")
get_prerequisites("${resolved_embedded_item}" prereqs 1 0 "${exepath}" "${dirs}")
set(changes "")
foreach(pr ${prereqs})
# Each referenced item's key is "rkey" in the loop:
#
get_item_key("${pr}" rkey)
if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
else()
message("warning: unexpected reference to '${pr}'")
endif()
endforeach()
if(BU_CHMOD_BUNDLE_ITEMS)
execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
endif()
# Change this item's id and all of its references in one call
# to install_name_tool:
#
execute_process(COMMAND install_name_tool
${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
)
endfunction()
function(fixup_bundle app libs dirs)
message(STATUS "fixup_bundle")
message(STATUS " app='${app}'")
message(STATUS " libs='${libs}'")
message(STATUS " dirs='${dirs}'")
get_bundle_and_executable("${app}" bundle executable valid)
if(valid)
get_filename_component(exepath "${executable}" PATH)
message(STATUS "fixup_bundle: preparing...")
get_bundle_keys("${app}" "${libs}" "${dirs}" keys)
message(STATUS "fixup_bundle: copying...")
list(LENGTH keys n)
math(EXPR n ${n}*2)
set(i 0)
foreach(key ${keys})
math(EXPR i ${i}+1)
if(${${key}_COPYFLAG})
message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
else()
message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
endif()
set(show_status 0)
if(show_status)
message(STATUS "key='${key}'")
message(STATUS "item='${${key}_ITEM}'")
message(STATUS "resolved_item='${${key}_RESOLVED_ITEM}'")
message(STATUS "default_embedded_path='${${key}_DEFAULT_EMBEDDED_PATH}'")
message(STATUS "embedded_item='${${key}_EMBEDDED_ITEM}'")
message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
message(STATUS "copyflag='${${key}_COPYFLAG}'")
message(STATUS "")
endif()
if(${${key}_COPYFLAG})
set(item "${${key}_ITEM}")
if(item MATCHES "[^/]+\\.framework/")
copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}")
else()
copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}")
endif()
endif()
endforeach()
message(STATUS "fixup_bundle: fixing...")
foreach(key ${keys})
math(EXPR i ${i}+1)
if(APPLE)
message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
else()
message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
endif()
endforeach()
message(STATUS "fixup_bundle: cleaning up...")
clear_bundle_keys(keys)
message(STATUS "fixup_bundle: verifying...")
verify_app("${app}")
else()
message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
endif()
message(STATUS "fixup_bundle: done")
endfunction()
function(copy_and_fixup_bundle src dst libs dirs)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
fixup_bundle("${dst}" "${libs}" "${dirs}")
endfunction()
function(verify_bundle_prerequisites bundle result_var info_var)
set(result 1)
set(info "")
set(count 0)
get_bundle_main_executable("${bundle}" main_bundle_exe)
file(GLOB_RECURSE file_list "${bundle}/*")
foreach(f ${file_list})
is_file_executable("${f}" is_executable)
if(is_executable)
get_filename_component(exepath "${f}" PATH)
math(EXPR count "${count} + 1")
message(STATUS "executable file ${count}: ${f}")
set(prereqs "")
get_prerequisites("${f}" prereqs 1 1 "${exepath}" "")
# On the Mac,
# "embedded" and "system" prerequisites are fine... anything else means
# the bundle's prerequisites are not verified (i.e., the bundle is not
# really "standalone")
#
# On Windows (and others? Linux/Unix/...?)
# "local" and "system" prereqs are fine...
#
set(external_prereqs "")
foreach(p ${prereqs})
set(p_type "")
gp_file_type("${f}" "${p}" p_type)
if(APPLE)
if(NOT "${p_type}" STREQUAL "embedded" AND NOT "${p_type}" STREQUAL "system")
set(external_prereqs ${external_prereqs} "${p}")
endif()
else()
if(NOT "${p_type}" STREQUAL "local" AND NOT "${p_type}" STREQUAL "system")
set(external_prereqs ${external_prereqs} "${p}")
endif()
endif()
endforeach()
if(external_prereqs)
# Found non-system/somehow-unacceptable prerequisites:
set(result 0)
set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
endif()
endif()
endforeach()
if(result)
set(info "Verified ${count} executable files in '${bundle}'")
endif()
set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE)
endfunction()
function(verify_bundle_symlinks bundle result_var info_var)
set(result 1)
set(info "")
set(count 0)
# TODO: implement this function for real...
# Right now, it is just a stub that verifies unconditionally...
set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE)
endfunction()
function(verify_app app)
set(verified 0)
set(info "")
get_bundle_and_executable("${app}" bundle executable valid)
message(STATUS "===========================================================================")
message(STATUS "Analyzing app='${app}'")
message(STATUS "bundle='${bundle}'")
message(STATUS "executable='${executable}'")
message(STATUS "valid='${valid}'")
# Verify that the bundle does not have any "external" prerequisites:
#
verify_bundle_prerequisites("${bundle}" verified info)
message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'")
message(STATUS "")
if(verified)
# Verify that the bundle does not have any symlinks to external files:
#
verify_bundle_symlinks("${bundle}" verified info)
message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'")
message(STATUS "")
endif()
if(NOT verified)
message(FATAL_ERROR "error: verify_app failed")
endif()
endfunction()

100
cmake/ECMQueryQt.cmake Normal file
View File

@ -0,0 +1,100 @@
# SPDX-FileCopyrightText: 2014 Rohan Garg <rohan16garg@gmail.com>
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014-2016 Aleix Pol <aleixpol@kde.org>
# SPDX-FileCopyrightText: 2017 Friedrich W. H. Kossebau <kossebau@kde.org>
# SPDX-FileCopyrightText: 2022 Ahmad Samir <a.samir78@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMQueryQt
---------------
This module can be used to query the installation paths used by Qt.
For Qt5 this uses ``qmake``, and for Qt6 this used ``qtpaths`` (the latter has built-in
support to query the paths of a target platform when cross-compiling).
This module defines the following function:
::
ecm_query_qt(<result_variable> <qt_variable> [TRY])
Passing ``TRY`` will result in the method not making the build fail if the executable
used for querying has not been found, but instead simply print a warning message and
return an empty string.
Example usage:
.. code-block:: cmake
include(ECMQueryQt)
ecm_query_qt(bin_dir QT_INSTALL_BINS)
If the call succeeds ``${bin_dir}`` will be set to ``<prefix>/path/to/bin/dir`` (e.g.
``/usr/lib64/qt/bin/``).
Since: 5.93
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
include(CheckLanguage)
check_language(CXX)
if (CMAKE_CXX_COMPILER)
# Enable the CXX language to let CMake look for config files in library dirs.
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/23266
enable_language(CXX)
endif()
if (QT_MAJOR_VERSION STREQUAL "5")
# QUIET to accommodate the TRY option
find_package(Qt${QT_MAJOR_VERSION}Core QUIET)
if(TARGET Qt5::qmake)
get_target_property(_qmake_executable_default Qt5::qmake LOCATION)
set(QUERY_EXECUTABLE ${_qmake_executable_default}
CACHE FILEPATH "Location of the Qt5 qmake executable")
set(_exec_name_text "Qt5 qmake")
set(_cli_option "-query")
endif()
elseif(QT_MAJOR_VERSION STREQUAL "6")
# QUIET to accommodate the TRY option
find_package(Qt6 COMPONENTS CoreTools QUIET CONFIG)
if (TARGET Qt6::qtpaths)
get_target_property(_qtpaths_executable Qt6::qtpaths LOCATION)
set(QUERY_EXECUTABLE ${_qtpaths_executable}
CACHE FILEPATH "Location of the Qt6 qtpaths executable")
set(_exec_name_text "Qt6 qtpaths")
set(_cli_option "--query")
endif()
endif()
function(ecm_query_qt result_variable qt_variable)
set(options TRY)
set(oneValueArgs)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT QUERY_EXECUTABLE)
if(ARGS_TRY)
set(${result_variable} "" PARENT_SCOPE)
message(STATUS "No ${_exec_name_text} executable found. Can't check ${qt_variable}")
return()
else()
message(FATAL_ERROR "No ${_exec_name_text} executable found. Can't check ${qt_variable} as required")
endif()
endif()
execute_process(
COMMAND ${QUERY_EXECUTABLE} ${_cli_option} "${qt_variable}"
RESULT_VARIABLE return_code
OUTPUT_VARIABLE output
)
if(return_code EQUAL 0)
string(STRIP "${output}" output)
file(TO_CMAKE_PATH "${output}" output_path)
set(${result_variable} "${output_path}" PARENT_SCOPE)
else()
message(WARNING "Failed call: ${_command} \"${qt_variable}\"")
message(FATAL_ERROR "${_exec_name_text} call failed: ${return_code}")
endif()
endfunction()

View File

@ -3,7 +3,7 @@
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
#
# Returns the refspec and sha hash of the current head revision
#
@ -12,20 +12,33 @@
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the working tree (--dirty option),
# and adjusting the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
# Uses the return code of "git diff-index --quiet HEAD --".
# Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2013, Iowa State University.
# Copyright 2013-2020, Ryan Pavlik
# Copyright 2013-2020, Contributors
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
@ -39,45 +52,124 @@ set(__get_git_revision_description YES)
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# Function _git_find_closest_git_dir finds the next closest .git directory
# that is part of any directory in the path defined by _start_dir.
# The result is returned in the parent scope variable whose name is passed
# as variable _git_dir_var. If no .git directory can be found, the
# function returns an empty string via _git_dir_var.
#
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
# neither foo nor bar contain a file/directory .git. This wil return
# C:/bla/.git
#
function(_git_find_closest_git_dir _start_dir _git_dir_var)
set(cur_dir "${_start_dir}")
set(git_dir "${_start_dir}/.git")
while(NOT EXISTS "${git_dir}")
# .git dir not found, search parent directories
set(git_previous_parent "${cur_dir}")
get_filename_component(cur_dir "${cur_dir}" DIRECTORY)
if(cur_dir STREQUAL git_previous_parent)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_git_dir_var}
""
PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
set(git_dir "${cur_dir}/.git")
endwhile()
# check if this is a submodule
set(${_git_dir_var}
"${git_dir}"
PARENT_SCOPE)
endfunction()
function(get_git_head_revision _refspecvar _hashvar)
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
else()
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
endif()
if(NOT "${GIT_DIR}" STREQUAL "")
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
"${GIT_DIR}")
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
# We've gone above the CMake root dir.
set(GIT_DIR "")
endif()
endif()
if("${GIT_DIR}" STREQUAL "")
set(${_refspecvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
set(${_hashvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# Check if the current source dir is a git submodule or a worktree.
# In both cases .git is a file instead of a directory.
#
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
# The following git command will return a non empty string that
# points to the super project working tree if the current
# source dir is inside a git submodule.
# Otherwise the command will return an empty string.
#
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse
--show-superproject-working-tree
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT "${out}" STREQUAL "")
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
${submodule})
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
ABSOLUTE)
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
else()
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
file(READ ${GIT_DIR} worktree_ref)
# The .git directory contains a path to the worktree information directory
# inside the parent git repo of the worktree.
#
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
${worktree_ref})
string(STRIP ${git_worktree_dir} git_worktree_dir)
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
endif()
else()
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
"${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
set(${_refspecvar}
"${HEAD_REF}"
PARENT_SCOPE)
set(${_hashvar}
"${HEAD_HASH}"
PARENT_SCOPE)
endfunction()
function(git_describe _var)
@ -86,45 +178,107 @@ function(git_describe _var)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_describe_working_tree _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var}
"CLEAN"
PARENT_SCOPE)
else()
set(${_var}
"DIRTY"
PARENT_SCOPE)
endif()
endfunction()

View File

@ -8,10 +8,12 @@
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Copyright 2009-2012, Iowa State University
# Copyright 2011-2015, Contributors
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# SPDX-License-Identifier: BSL-1.0
set(HEAD_HASH)
@ -19,23 +21,23 @@ file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View File

@ -1,902 +0,0 @@
# - Functions to analyze and list executable file prerequisites.
# This module provides functions to list the .dll, .dylib or .so
# files that an executable or shared library file depends on. (Its
# prerequisites.)
#
# It uses various tools to obtain the list of required shared library files:
# dumpbin (Windows)
# objdump (MinGW on Windows)
# ldd (Linux/Unix)
# otool (Mac OSX)
# The following functions are provided by this module:
# get_prerequisites
# list_prerequisites
# list_prerequisites_by_glob
# gp_append_unique
# is_file_executable
# gp_item_default_embedded_path
# (projects can override with gp_item_default_embedded_path_override)
# gp_resolve_item
# (projects can override with gp_resolve_item_override)
# gp_resolved_file_type
# (projects can override with gp_resolved_file_type_override)
# gp_file_type
# Requires CMake 2.6 or greater because it uses function, break, return and
# PARENT_SCOPE.
#
# GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
# <exepath> <dirs>)
# Get the list of shared library files required by <target>. The list in
# the variable named <prerequisites_var> should be empty on first entry to
# this function. On exit, <prerequisites_var> will contain the list of
# required shared library files.
#
# <target> is the full path to an executable file. <prerequisites_var> is the
# name of a CMake variable to contain the results. <exclude_system> must be 0
# or 1 indicating whether to include or exclude "system" prerequisites. If
# <recurse> is set to 1 all prerequisites will be found recursively, if set to
# 0 only direct prerequisites are listed. <exepath> is the path to the top
# level executable used for @executable_path replacment on the Mac. <dirs> is
# a list of paths where libraries might be found: these paths are searched
# first when a target without any path info is given. Then standard system
# locations are also searched: PATH, Framework locations, /usr/lib...
#
# LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
# Print a message listing the prerequisites of <target>.
#
# <target> is the name of a shared library or executable target or the full
# path to a shared library or executable file. If <recurse> is set to 1 all
# prerequisites will be found recursively, if set to 0 only direct
# prerequisites are listed. <exclude_system> must be 0 or 1 indicating whether
# to include or exclude "system" prerequisites. With <verbose> set to 0 only
# the full path names of the prerequisites are printed, set to 1 extra
# informatin will be displayed.
#
# LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
# Print the prerequisites of shared library and executable files matching a
# globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and <glob_exp> is a
# globbing expression used with "file(GLOB" or "file(GLOB_RECURSE" to retrieve
# a list of matching files. If a matching file is executable, its prerequisites
# are listed.
#
# Any additional (optional) arguments provided are passed along as the
# optional arguments to the list_prerequisites calls.
#
# GP_APPEND_UNIQUE(<list_var> <value>)
# Append <value> to the list variable <list_var> only if the value is not
# already in the list.
#
# IS_FILE_EXECUTABLE(<file> <result_var>)
# Return 1 in <result_var> if <file> is a binary executable, 0 otherwise.
#
# GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
# Return the path that others should refer to the item by when the item
# is embedded inside a bundle.
#
# Override on a per-project basis by providing a project-specific
# gp_item_default_embedded_path_override function.
#
# GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>)
# Resolve an item into an existing full path file.
#
# Override on a per-project basis by providing a project-specific
# gp_resolve_item_override function.
#
# GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>)
# Return the type of <file> with respect to <original_file>. String
# describing type of prerequisite is returned in variable named <type_var>.
#
# Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
# values -- but only for non-embedded items.
#
# Possible types are:
# system
# local
# embedded
# other
# Override on a per-project basis by providing a project-specific
# gp_resolved_file_type_override function.
#
# GP_FILE_TYPE(<original_file> <file> <type_var>)
# Return the type of <file> with respect to <original_file>. String
# describing type of prerequisite is returned in variable named <type_var>.
#
# Possible types are:
# system
# local
# embedded
# other
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(gp_append_unique list_var value)
set(contains 0)
foreach(item ${${list_var}})
if("${item}" STREQUAL "${value}")
set(contains 1)
break()
endif()
endforeach()
if(NOT contains)
set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE)
endif()
endfunction()
function(is_file_executable file result_var)
#
# A file is not executable until proven otherwise:
#
set(${result_var} 0 PARENT_SCOPE)
get_filename_component(file_full "${file}" ABSOLUTE)
string(TOLOWER "${file_full}" file_full_lower)
# If file name ends in .exe on Windows, *assume* executable:
#
if(WIN32 AND NOT UNIX)
if("${file_full_lower}" MATCHES "\\.exe$")
set(${result_var} 1 PARENT_SCOPE)
return()
endif()
# A clause could be added here that uses output or return value of dumpbin
# to determine ${result_var}. In 99%+? practical cases, the exe name
# match will be sufficient...
#
endif()
# Use the information returned from the Unix shell command "file" to
# determine if ${file_full} should be considered an executable file...
#
# If the file command's output contains "executable" and does *not* contain
# "text" then it is likely an executable suitable for prerequisite analysis
# via the get_prerequisites macro.
#
if(UNIX)
if(NOT file_cmd)
find_program(file_cmd "file")
mark_as_advanced(file_cmd)
endif()
if(file_cmd)
execute_process(COMMAND "${file_cmd}" "${file_full}"
OUTPUT_VARIABLE file_ov
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Replace the name of the file in the output with a placeholder token
# (the string " _file_full_ ") so that just in case the path name of
# the file contains the word "text" or "executable" we are not fooled
# into thinking "the wrong thing" because the file name matches the
# other 'file' command output we are looking for...
#
string(REPLACE "${file_full}" " _file_full_ " file_ov "${file_ov}")
string(TOLOWER "${file_ov}" file_ov)
#message(STATUS "file_ov='${file_ov}'")
if("${file_ov}" MATCHES "executable")
#message(STATUS "executable!")
if("${file_ov}" MATCHES "text")
#message(STATUS "but text, so *not* a binary executable!")
else()
set(${result_var} 1 PARENT_SCOPE)
return()
endif()
endif()
# Also detect position independent executables on Linux,
# where "file" gives "shared object ... (uses shared libraries)"
if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)")
set(${result_var} 1 PARENT_SCOPE)
return()
endif()
# "file" version 5.22 does not print "(used shared libraries)"
# but uses "interpreter"
if("${file_ov}" MATCHES "shared object.*interpreter")
set(${result_var} 1 PARENT_SCOPE)
return()
endif()
else()
message(STATUS "warning: No 'file' command, skipping execute_process...")
endif()
endif()
endfunction()
function(gp_item_default_embedded_path item default_embedded_path_var)
# On Windows and Linux, "embed" prerequisites in the same directory
# as the executable by default:
#
set(path "@executable_path")
set(overridden 0)
# On the Mac, relative to the executable depending on the type
# of the thing we are embedding:
#
if(APPLE)
#
# The assumption here is that all executables in the bundle will be
# in same-level-directories inside the bundle. The parent directory
# of an executable inside the bundle should be MacOS or a sibling of
# MacOS and all embedded paths returned from here will begin with
# "@executable_path/../" and will work from all executables in all
# such same-level-directories inside the bundle.
#
# By default, embed things right next to the main bundle executable:
#
set(path "@executable_path/../../Contents/MacOS")
# Embed .dylibs right next to the main bundle executable:
#
if(item MATCHES "\\.dylib$")
set(path "@executable_path/../MacOS")
set(overridden 1)
endif()
# Embed frameworks in the embedded "Frameworks" directory (sibling of MacOS):
#
if(NOT overridden)
if(item MATCHES "[^/]+\\.framework/")
set(path "@executable_path/../Frameworks")
set(overridden 1)
endif()
endif()
endif()
# Provide a hook so that projects can override the default embedded location
# of any given library by whatever logic they choose:
#
if(COMMAND gp_item_default_embedded_path_override)
gp_item_default_embedded_path_override("${item}" path)
endif()
set(${default_embedded_path_var} "${path}" PARENT_SCOPE)
endfunction()
function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 0)
set(resolved_item "${item}")
# Is it already resolved?
#
if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
set(resolved 1)
endif()
if(NOT resolved)
if(item MATCHES "@executable_path")
#
# @executable_path references are assumed relative to exepath
#
string(REPLACE "@executable_path" "${exepath}" ri "${item}")
get_filename_component(ri "${ri}" ABSOLUTE)
if(EXISTS "${ri}")
#message(STATUS "info: embedded item exists (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
else()
message(STATUS "warning: embedded item does not exist '${ri}'")
endif()
endif()
endif()
if(NOT resolved)
if(item MATCHES "@loader_path")
#
# @loader_path references are assumed relative to the
# PATH of the given "context" (presumably another library)
#
get_filename_component(contextpath "${context}" PATH)
string(REPLACE "@loader_path" "${contextpath}" ri "${item}")
get_filename_component(ri "${ri}" ABSOLUTE)
if(EXISTS "${ri}")
#message(STATUS "info: embedded item exists (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
else()
message(STATUS "warning: embedded item does not exist '${ri}'")
endif()
endif()
endif()
if(NOT resolved)
if(item MATCHES "@rpath")
#
# @rpath references are relative to the paths built into the binaries with -rpath
# We handle this case like we do for other Unixes
#
string(REPLACE "@rpath/" "" norpath_item "${item}")
set(ri "ri-NOTFOUND")
find_file(ri "${norpath_item}" ${exepath} ${dirs} NO_DEFAULT_PATH)
if(ri)
#message(STATUS "info: 'find_file' in exepath/dirs (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
endif()
endif()
endif()
if(NOT resolved)
set(ri "ri-NOTFOUND")
find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH)
find_file(ri "${item}" ${exepath} ${dirs} /usr/lib)
if(ri)
#message(STATUS "info: 'find_file' in exepath/dirs (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
endif()
endif()
if(NOT resolved)
if(item MATCHES "[^/]+\\.framework/")
set(fw "fw-NOTFOUND")
find_file(fw "${item}"
"~/Library/Frameworks"
"/Library/Frameworks"
"/System/Library/Frameworks"
)
if(fw)
#message(STATUS "info: 'find_file' found framework (${fw})")
set(resolved 1)
set(resolved_item "${fw}")
set(fw "fw-NOTFOUND")
endif()
endif()
endif()
# Using find_program on Windows will find dll files that are in the PATH.
# (Converting simple file names into full path names if found.)
#
if(WIN32 AND NOT UNIX)
if(NOT resolved)
set(ri "ri-NOTFOUND")
find_program(ri "${item}" PATHS "${exepath};${dirs}" NO_DEFAULT_PATH)
find_program(ri "${item}" PATHS "${exepath};${dirs}")
if(ri)
#message(STATUS "info: 'find_program' in exepath/dirs (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
endif()
endif()
endif()
# Provide a hook so that projects can override item resolution
# by whatever logic they choose:
#
if(COMMAND gp_resolve_item_override)
gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved)
endif()
if(NOT resolved)
message(STATUS "
warning: cannot resolve item '${item}'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
")
# message(STATUS "
#******************************************************************************
#warning: cannot resolve item '${item}'
#
# possible problems:
# need more directories?
# need to use InstallRequiredSystemLibraries?
# run in install tree instead of build tree?
#
# context='${context}'
# item='${item}'
# exepath='${exepath}'
# dirs='${dirs}'
# resolved_item_var='${resolved_item_var}'
#******************************************************************************
#")
endif()
set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE)
endfunction()
function(gp_resolved_file_type original_file file exepath dirs type_var)
#message(STATUS "**")
if(NOT IS_ABSOLUTE "${original_file}")
message(STATUS "warning: gp_resolved_file_type expects absolute full path for first arg original_file")
endif()
set(is_embedded 0)
set(is_local 0)
set(is_system 0)
set(resolved_file "${file}")
if("${file}" MATCHES "^@(executable|loader)_path")
set(is_embedded 1)
endif()
if(NOT is_embedded)
if(NOT IS_ABSOLUTE "${file}")
gp_resolve_item("${original_file}" "${file}" "${exepath}" "${dirs}" resolved_file)
endif()
string(TOLOWER "${original_file}" original_lower)
string(TOLOWER "${resolved_file}" lower)
if(UNIX)
if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
set(is_system 1)
endif()
endif()
if(APPLE)
if(resolved_file MATCHES "^(/System/Library/|/usr/lib/)")
set(is_system 1)
endif()
endif()
if(WIN32)
string(TOLOWER "$ENV{SystemRoot}" sysroot)
string(REGEX REPLACE "\\\\" "/" sysroot "${sysroot}")
string(TOLOWER "$ENV{windir}" windir)
string(REGEX REPLACE "\\\\" "/" windir "${windir}")
if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
set(is_system 1)
endif()
if(UNIX)
# if cygwin, we can get the properly formed windows paths from cygpath
find_program(CYGPATH_EXECUTABLE cygpath)
if(CYGPATH_EXECUTABLE)
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -W
OUTPUT_VARIABLE env_windir
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -S
OUTPUT_VARIABLE env_sysdir
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TOLOWER "${env_windir}" windir)
string(TOLOWER "${env_sysdir}" sysroot)
if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
set(is_system 1)
endif()
endif()
endif()
endif()
if(NOT is_system)
get_filename_component(original_path "${original_lower}" PATH)
get_filename_component(path "${lower}" PATH)
if("${original_path}" STREQUAL "${path}")
set(is_local 1)
else()
string(LENGTH "${original_path}/" original_length)
string(LENGTH "${lower}" path_length)
if(${path_length} GREATER ${original_length})
string(SUBSTRING "${lower}" 0 ${original_length} path)
if("${original_path}/" STREQUAL "${path}")
set(is_embedded 1)
endif()
endif()
endif()
endif()
endif()
# Return type string based on computed booleans:
#
set(type "other")
if(is_system)
set(type "system")
elseif(is_embedded)
set(type "embedded")
elseif(is_local)
set(type "local")
endif()
#message(STATUS "gp_resolved_file_type: '${file}' '${resolved_file}'")
#message(STATUS " type: '${type}'")
if(NOT is_embedded)
if(NOT IS_ABSOLUTE "${resolved_file}")
if(lower MATCHES "^msvc[^/]+dll" AND is_system)
message(STATUS "info: non-absolute msvc file '${file}' returning type '${type}'")
else()
message(STATUS "warning: gp_resolved_file_type non-absolute file '${file}' returning type '${type}' -- possibly incorrect")
endif()
endif()
endif()
# Provide a hook so that projects can override the decision on whether a
# library belongs to the system or not by whatever logic they choose:
#
if(COMMAND gp_resolved_file_type_override)
gp_resolved_file_type_override("${resolved_file}" type)
endif()
set(${type_var} "${type}" PARENT_SCOPE)
#message(STATUS "**")
endfunction()
function(gp_file_type original_file file type_var)
if(NOT IS_ABSOLUTE "${original_file}")
message(STATUS "warning: gp_file_type expects absolute full path for first arg original_file")
endif()
get_filename_component(exepath "${original_file}" PATH)
set(type "")
gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type)
set(${type_var} "${type}" PARENT_SCOPE)
endfunction()
function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs)
set(verbose 0)
set(eol_char "E")
if(NOT IS_ABSOLUTE "${target}")
message("warning: target '${target}' is not absolute...")
endif()
if(NOT EXISTS "${target}")
message("warning: target '${target}' does not exist...")
endif()
set(gp_cmd_paths ${gp_cmd_paths}
"C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"
"C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin"
"C:/Program Files/Microsoft Visual Studio 8/VC/BIN"
"C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN"
"C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN"
"C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN"
"/usr/local/bin"
"/usr/bin"
)
# <setup-gp_tool-vars>
#
# Try to choose the right tool by default. Caller can set gp_tool prior to
# calling this function to force using a different tool.
#
if("${gp_tool}" STREQUAL "")
set(gp_tool "ldd")
if(APPLE)
set(gp_tool "otool")
endif()
if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har!
find_program(gp_dumpbin "dumpbin" PATHS ${gp_cmd_paths})
if(gp_dumpbin)
set(gp_tool "dumpbin")
else() # Try harder. Maybe we're on MinGW
set(gp_tool "objdump")
endif()
endif()
endif()
find_program(gp_cmd ${gp_tool} PATHS ${gp_cmd_paths})
if(NOT gp_cmd)
message(FATAL_ERROR "FATAL ERROR: could not find '${gp_tool}' - cannot analyze prerequisites!")
return()
endif()
set(gp_tool_known 0)
if("${gp_tool}" STREQUAL "ldd")
set(gp_cmd_args "")
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$")
set(gp_regex_error "not found${eol_char}$")
set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
endif()
if("${gp_tool}" STREQUAL "otool")
set(gp_cmd_args "-L")
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 3)
set(gp_tool_known 1)
endif()
if("${gp_tool}" STREQUAL "dumpbin")
set(gp_cmd_args "/dependents")
set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
endif()
if("${gp_tool}" STREQUAL "objdump")
set(gp_cmd_args "-p")
set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
endif()
if(NOT gp_tool_known)
message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...")
message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'")
message(STATUS "Valid gp_tool values are dumpbin, ldd, objdump and otool.")
return()
endif()
if("${gp_tool}" STREQUAL "dumpbin")
# When running dumpbin, it also needs the "Common7/IDE" directory in the
# PATH. It will already be in the PATH if being run from a Visual Studio
# command prompt. Add it to the PATH here in case we are running from a
# different command prompt.
#
get_filename_component(gp_cmd_dir "${gp_cmd}" PATH)
get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE)
# Use cmake paths as a user may have a PATH element ending with a backslash.
# This will escape the list delimiter and create havoc!
if(EXISTS "${gp_cmd_dlls_dir}")
# only add to the path if it is not already in the path
set(gp_found_cmd_dlls_dir 0)
file(TO_CMAKE_PATH "$ENV{PATH}" env_path)
foreach(gp_env_path_element ${env_path})
if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}")
set(gp_found_cmd_dlls_dir 1)
endif()
endforeach()
if(NOT gp_found_cmd_dlls_dir)
file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir)
set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}")
endif()
endif()
endif()
#
# </setup-gp_tool-vars>
if("${gp_tool}" STREQUAL "ldd")
set(old_ld_env "$ENV{LD_LIBRARY_PATH}")
foreach(dir ${exepath} ${dirs})
set(ENV{LD_LIBRARY_PATH} "${dir}:$ENV{LD_LIBRARY_PATH}")
endforeach()
endif()
# Track new prerequisites at each new level of recursion. Start with an
# empty list at each level:
#
set(unseen_prereqs)
# Run gp_cmd on the target:
#
execute_process(
COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
OUTPUT_VARIABLE gp_cmd_ov
)
if("${gp_tool}" STREQUAL "ldd")
set(ENV{LD_LIBRARY_PATH} "${old_ld_env}")
endif()
if(verbose)
message(STATUS "<RawOutput cmd='${gp_cmd} ${gp_cmd_args} ${target}'>")
message(STATUS "gp_cmd_ov='${gp_cmd_ov}'")
message(STATUS "</RawOutput>")
endif()
get_filename_component(target_dir "${target}" PATH)
# Convert to a list of lines:
#
string(REGEX REPLACE ";" "\\\\;" candidates "${gp_cmd_ov}")
string(REGEX REPLACE "\n" "${eol_char};" candidates "${candidates}")
# check for install id and remove it from list, since otool -L can include a
# reference to itself
set(gp_install_id)
if("${gp_tool}" STREQUAL "otool")
execute_process(
COMMAND otool -D ${target}
OUTPUT_VARIABLE gp_install_id_ov
)
# second line is install name
string(REGEX REPLACE ".*:\n" "" gp_install_id "${gp_install_id_ov}")
if(gp_install_id)
# trim
string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}")
#message("INSTALL ID is \"${gp_install_id}\"")
endif()
endif()
# Analyze each line for file names that match the regular expression:
#
foreach(candidate ${candidates})
if("${candidate}" MATCHES "${gp_regex}")
# Extract information from each candidate:
if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}")
else()
string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
endif()
if(gp_regex_cmp_count GREATER 1)
string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}")
endif()
if(gp_regex_cmp_count GREATER 2)
string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}")
endif()
# Use the raw_item as the list entries returned by this function. Use the
# gp_resolve_item function to resolve it to an actual full path file if
# necessary.
#
set(item "${raw_item}")
# Add each item unless it is excluded:
#
set(add_item 1)
if("${item}" STREQUAL "${gp_install_id}")
set(add_item 0)
endif()
if(add_item AND ${exclude_system})
set(type "")
gp_resolved_file_type("${target}" "${item}" "${exepath}" "${dirs}" type)
if("${type}" STREQUAL "system")
set(add_item 0)
endif()
endif()
if(add_item)
list(LENGTH ${prerequisites_var} list_length_before_append)
gp_append_unique(${prerequisites_var} "${item}")
list(LENGTH ${prerequisites_var} list_length_after_append)
if(${recurse})
# If item was really added, this is the first time we have seen it.
# Add it to unseen_prereqs so that we can recursively add *its*
# prerequisites...
#
# But first: resolve its name to an absolute full path name such
# that the analysis tools can simply accept it as input.
#
if(NOT list_length_before_append EQUAL list_length_after_append)
gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item)
set(unseen_prereqs ${unseen_prereqs} "${resolved_item}")
endif()
endif()
endif()
else()
if(verbose)
message(STATUS "ignoring non-matching line: '${candidate}'")
endif()
endif()
endforeach()
list(LENGTH ${prerequisites_var} prerequisites_var_length)
if(prerequisites_var_length GREATER 0)
list(SORT ${prerequisites_var})
endif()
if(${recurse})
set(more_inputs ${unseen_prereqs})
foreach(input ${more_inputs})
get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}")
endforeach()
endif()
set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE)
endfunction()
function(list_prerequisites target)
if("${ARGV1}" STREQUAL "")
set(all 1)
else()
set(all "${ARGV1}")
endif()
if("${ARGV2}" STREQUAL "")
set(exclude_system 0)
else()
set(exclude_system "${ARGV2}")
endif()
if("${ARGV3}" STREQUAL "")
set(verbose 0)
else()
set(verbose "${ARGV3}")
endif()
set(count 0)
set(count_str "")
set(print_count "${verbose}")
set(print_prerequisite_type "${verbose}")
set(print_target "${verbose}")
set(type_str "")
get_filename_component(exepath "${target}" PATH)
set(prereqs "")
get_prerequisites("${target}" prereqs ${exclude_system} ${all} "${exepath}" "")
if(print_target)
message(STATUS "File '${target}' depends on:")
endif()
foreach(d ${prereqs})
math(EXPR count "${count} + 1")
if(print_count)
set(count_str "${count}. ")
endif()
if(print_prerequisite_type)
gp_file_type("${target}" "${d}" type)
set(type_str " (${type})")
endif()
message(STATUS "${count_str}${d}${type_str}")
endforeach()
endfunction()
function(list_prerequisites_by_glob glob_arg glob_exp)
message(STATUS "=============================================================================")
message(STATUS "List prerequisites of executables matching ${glob_arg} '${glob_exp}'")
message(STATUS "")
file(${glob_arg} file_list ${glob_exp})
foreach(f ${file_list})
is_file_executable("${f}" is_f_executable)
if(is_f_executable)
message(STATUS "=============================================================================")
list_prerequisites("${f}" ${ARGN})
message(STATUS "")
endif()
endforeach()
endfunction()

View File

@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSCameraUsageDescription</key>
<string>A Minecraft mod wants to access your camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>A Minecraft mod wants to access your microphone.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
@ -36,5 +40,32 @@
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>SUPublicEDKey</key>
<string>${MACOSX_SPARKLE_UPDATE_PUBLIC_KEY}</string>
<key>SUFeedURL</key>
<string>${MACOSX_SPARKLE_UPDATE_FEED_URL}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>zip</string>
<string>mrpack</string>
</array>
<key>CFBundleTypeName</key>
<string>Prism Launcher instance</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
<string>TUTX</string>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
</dict>
</plist>

View File

@ -1,14 +0,0 @@
if(__QMAKEQUERY_CMAKE__)
return()
endif()
set(__QMAKEQUERY_CMAKE__ TRUE)
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
function(QUERY_QMAKE VAR RESULT)
exec_program(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
if(NOT return_code)
file(TO_CMAKE_PATH "${output}" output)
set(${RESULT} ${output} PARENT_SCOPE)
endif(NOT return_code)
endfunction(QUERY_QMAKE)

View File

@ -0,0 +1,38 @@
#.rst:
# QtVersionOption
# ---------------
#
# Adds a build option to select the major Qt version if necessary,
# that is, if the major Qt version has not yet been determined otherwise
# (e.g. by a corresponding find_package() call).
#
# This module is typically included by other modules requiring knowledge
# about the major Qt version.
#
# ``QT_MAJOR_VERSION`` is defined to either be "5" or "6".
#
#
# Since 5.82.0.
#=============================================================================
# SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
if (DEFINED QT_MAJOR_VERSION)
return()
endif()
if (TARGET Qt5::Core)
set(QT_MAJOR_VERSION 5)
elseif (TARGET Qt6::Core)
set(QT_MAJOR_VERSION 6)
else()
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
if (BUILD_WITH_QT6)
set(QT_MAJOR_VERSION 6)
else()
set(QT_MAJOR_VERSION 5)
endif()
endif()

View File

@ -0,0 +1,97 @@
#=============================================================================
# Copyright 2005-2011 Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Kitware, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# From Qt5CoreMacros.cmake
function(qt_generate_moc)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_generate_moc(${ARGV})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_generate_moc(${ARGV})
endif()
endfunction()
function(qt_wrap_cpp outfiles)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_wrap_cpp("${outfiles}" ${ARGN})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_wrap_cpp("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
function(qt_add_binary_resources)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_binary_resources(${ARGV})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_add_binary_resources(${ARGV})
endif()
endfunction()
function(qt_add_resources outfiles)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_resources("${outfiles}" ${ARGN})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_add_resources("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
function(qt_add_big_resources outfiles)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_big_resources(${outfiles} ${ARGN})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_add_big_resources(${outfiles} ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
function(qt_import_plugins)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_import_plugins(${ARGV})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_import_plugins(${ARGV})
endif()
endfunction()
# From Qt5WidgetsMacros.cmake
function(qt_wrap_ui outfiles)
if(QT_VERSION_MAJOR EQUAL 5)
qt5_wrap_ui("${outfiles}" ${ARGN})
elseif(QT_VERSION_MAJOR EQUAL 6)
qt6_wrap_ui("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()

View File

@ -1,48 +0,0 @@
find_package(Qt5Test REQUIRED)
set(TEST_RESOURCE_PATH ${CMAKE_CURRENT_LIST_DIR})
message(${TEST_RESOURCE_PATH})
function(add_unit_test name)
set(options "")
set(oneValueArgs DATA)
set(multiValueArgs SOURCES LIBS)
cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(WIN32)
add_executable(${name}_test ${OPT_SOURCES} ${TEST_RESOURCE_PATH}/UnitTest/test.rc)
else()
add_executable(${name}_test ${OPT_SOURCES})
endif()
if(NOT "${OPT_DATA}" STREQUAL "")
set(TEST_DATA_PATH "${CMAKE_CURRENT_BINARY_DIR}/data")
set(TEST_DATA_PATH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${OPT_DATA}")
message("From ${TEST_DATA_PATH_SRC} to ${TEST_DATA_PATH}")
string(REGEX REPLACE "[/\\:]" "_" DATA_TARGET_NAME "${TEST_DATA_PATH_SRC}")
if(UNIX)
# on unix we get the third / from the filename
set(TEST_DATA_URL "file://${TEST_DATA_PATH}")
else()
# we don't on windows, so we have to add it ourselves
set(TEST_DATA_URL "file:///${TEST_DATA_PATH}")
endif()
if(NOT TARGET "${DATA_TARGET_NAME}")
add_custom_target(${DATA_TARGET_NAME})
add_dependencies(${name}_test ${DATA_TARGET_NAME})
add_custom_command(
TARGET ${DATA_TARGET_NAME}
COMMAND ${CMAKE_COMMAND} "-DTEST_DATA_URL=${TEST_DATA_URL}" -DSOURCE=${TEST_DATA_PATH_SRC} -DDESTINATION=${TEST_DATA_PATH} -P ${TEST_RESOURCE_PATH}/UnitTest/generate_test_data.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
endif()
target_link_libraries(${name}_test Qt5::Test ${OPT_LIBS})
target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
add_test(NAME ${name} COMMAND ${name}_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endfunction()

View File

@ -1,28 +0,0 @@
#pragma once
#include <QFile>
#include <QCoreApplication>
#include <QTest>
#include <QDir>
#define expandstr(s) expandstr2(s)
#define expandstr2(s) #s
class TestsInternal
{
public:
static QByteArray readFile(const QString &fileName)
{
QFile f(fileName);
f.open(QFile::ReadOnly);
return f.readAll();
}
static QString readFileUtf8(const QString &fileName)
{
return QString::fromUtf8(readFile(fileName));
}
};
#define GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file))
#define GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file))

View File

@ -1,23 +0,0 @@
# Copy files from source directory to destination directory, substituting any
# variables. Create destination directory if it does not exist.
function(configure_files srcDir destDir)
make_directory(${destDir})
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
foreach(templateFile ${templateFiles})
set(srcTemplatePath ${srcDir}/${templateFile})
if(NOT IS_DIRECTORY ${srcTemplatePath})
configure_file(
${srcTemplatePath}
${destDir}/${templateFile}
@ONLY
NEWLINE_STYLE LF
)
else()
configure_files("${srcTemplatePath}" "${destDir}/${templateFile}")
endif()
endforeach()
endfunction()
configure_files(${SOURCE} ${DESTINATION})

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity name="Launcher.Test.0" type="win32" version="5.0.0.0" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<description>Custom Minecraft launcher for managing multiple installs.</description>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates app support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates app support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates app support for Windows Developer Preview / Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>

View File

@ -1,28 +0,0 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
1 RT_MANIFEST "test.manifest"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "MultiMC Contributors"
VALUE "FileDescription", "Testcase"
VALUE "FileVersion", "1.0.0.0"
VALUE "ProductName", "Launcher Testcase"
VALUE "ProductVersion", "5"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0000, 0x04b0 // Unicode
END
END

View File

@ -1,881 +0,0 @@
# - Use Module for Java
# This file provides functions for Java. It is assumed that FindJava.cmake
# has already been loaded. See FindJava.cmake for information on how to
# load Java into your CMake project.
#
# add_jar(TARGET_NAME SRC1 SRC2 .. SRCN RCS1 RCS2 .. RCSN)
#
# This command creates a <TARGET_NAME>.jar. It compiles the given source
# files (SRC) and adds the given resource files (RCS) to the jar file.
# If only resource files are given then just a jar file is created.
#
# Additional instructions:
# To add compile flags to the target you can set these flags with
# the following variable:
#
# set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
#
# To add a path or a jar file to the class path you can do this
# with the CMAKE_JAVA_INCLUDE_PATH variable.
#
# set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
#
# To use a different output name for the target you can set it with:
#
# set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar)
# add_jar(foobar foobar.java)
#
# To use a different output directory than CMAKE_CURRENT_BINARY_DIR
# you can set it with:
#
# set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
#
# To define an entry point in your jar you can set it with:
#
# set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main)
#
# To add a VERSION to the target output name you can set it using
# CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name
# shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
# pointing to the jar with the version information.
#
# set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
# add_jar(shibboleet shibbotleet.java)
#
# If the target is a JNI library, utilize the following commands to
# create a JNI symbolic link:
#
# set(CMAKE_JNI_TARGET TRUE)
# set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
# add_jar(shibboleet shibbotleet.java)
# install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
# install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
#
# If a single target needs to produce more than one jar from its
# java source code, to prevent the accumulation of duplicate class
# files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
# to calling the add_jar() function:
#
# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
# add_jar(foo foo.java)
#
# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
# add_jar(bar bar.java)
#
# Target Properties:
# The add_jar() functions sets some target properties. You can get these
# properties with the
# get_property(TARGET <target_name> PROPERTY <propery_name>)
# command.
#
# INSTALL_FILES The files which should be installed. This is used by
# install_jar().
# JNI_SYMLINK The JNI symlink which should be installed.
# This is used by install_jni_symlink().
# JAR_FILE The location of the jar file so that you can include
# it.
# CLASS_DIR The directory where the class files can be found. For
# example to use them with javah.
#
# find_jar(<VAR>
# name | NAMES name1 [name2 ...]
# [PATHS path1 [path2 ... ENV var]]
# [VERSIONS version1 [version2]]
# [DOC "cache documentation string"]
# )
#
# This command is used to find a full path to the named jar. A cache
# entry named by <VAR> is created to stor the result of this command. If
# the full path to a jar is found the result is stored in the variable
# and the search will not repeated unless the variable is cleared. If
# nothing is found, the result will be <VAR>-NOTFOUND, and the search
# will be attempted again next time find_jar is invoked with the same
# variable.
# The name of the full path to a file that is searched for is specified
# by the names listed after NAMES argument. Additional search locations
# can be specified after the PATHS argument. If you require special a
# version of a jar file you can specify it with the VERSIONS argument.
# The argument after DOC will be used for the documentation string in
# the cache.
#
# install_jar(TARGET_NAME DESTINATION)
#
# This command installs the TARGET_NAME files to the given DESTINATION.
# It should be called in the same scope as add_jar() or it will fail.
#
# install_jni_symlink(TARGET_NAME DESTINATION)
#
# This command installs the TARGET_NAME JNI symlinks to the given
# DESTINATION. It should be called in the same scope as add_jar()
# or it will fail.
#
# create_javadoc(<VAR>
# PACKAGES pkg1 [pkg2 ...]
# [SOURCEPATH <sourcepath>]
# [CLASSPATH <classpath>]
# [INSTALLPATH <install path>]
# [DOCTITLE "the documentation title"]
# [WINDOWTITLE "the title of the document"]
# [AUTHOR TRUE|FALSE]
# [USE TRUE|FALSE]
# [VERSION TRUE|FALSE]
# )
#
# Create java documentation based on files or packages. For more
# details please read the javadoc manpage.
#
# There are two main signatures for create_javadoc. The first
# signature works with package names on a path with source files:
#
# Example:
# create_javadoc(my_example_doc
# PACKAGES com.exmaple.foo com.example.bar
# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
# WINDOWTITLE "My example"
# DOCTITLE "<h1>My example</h1>"
# AUTHOR TRUE
# USE TRUE
# VERSION TRUE
# )
#
# The second signature for create_javadoc works on a given list of
# files.
#
# create_javadoc(<VAR>
# FILES file1 [file2 ...]
# [CLASSPATH <classpath>]
# [INSTALLPATH <install path>]
# [DOCTITLE "the documentation title"]
# [WINDOWTITLE "the title of the document"]
# [AUTHOR TRUE|FALSE]
# [USE TRUE|FALSE]
# [VERSION TRUE|FALSE]
# )
#
# Example:
# create_javadoc(my_example_doc
# FILES ${example_SRCS}
# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
# WINDOWTITLE "My example"
# DOCTITLE "<h1>My example</h1>"
# AUTHOR TRUE
# USE TRUE
# VERSION TRUE
# )
#
# Both signatures share most of the options. These options are the
# same as what you can find in the javadoc manpage. Please look at
# the manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and
# VERSION.
#
# The documentation will be by default installed to
#
# ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
#
# if you don't set the INSTALLPATH.
#
#=============================================================================
# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
# Copyright 2010 Ben Boeckel <ben.boeckel@kitware.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function (__java_copy_file src dest comment)
add_custom_command(
OUTPUT ${dest}
COMMAND cmake -E copy_if_different
ARGS ${src}
${dest}
DEPENDS ${src}
COMMENT ${comment})
endfunction (__java_copy_file src dest comment)
# define helper scripts
set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
function(add_jar _TARGET_NAME)
set(_JAVA_SOURCE_FILES ${ARGN})
if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
if (CMAKE_JAVA_JAR_ENTRY_POINT)
set(_ENTRY_POINT_OPTION e)
set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
endif (CMAKE_JAVA_JAR_ENTRY_POINT)
if (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
else (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
endif (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_INCLUDE_PATH
${CMAKE_JAVA_INCLUDE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_JAVA_OBJECT_OUTPUT_PATH}
${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
)
if (WIN32 AND NOT CYGWIN AND NOT CMAKE_CROSSCOMPILING)
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else ()
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif()
foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach(JAVA_INCLUDE_DIR)
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
elseif (CMAKE_JAVA_TARGET_VERSION)
set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar")
elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME)
set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
endif (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
# reset
set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
set(_JAVA_CLASS_FILES)
set(_JAVA_COMPILE_FILES)
set(_JAVA_DEPENDS)
set(_JAVA_RESOURCE_FILES)
foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES})
get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT)
get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE)
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE)
file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL})
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
if (${_BIN_LEN} LESS ${_SRC_LEN})
set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
else (${_BIN_LEN} LESS ${_SRC_LEN})
set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
endif (${_BIN_LEN} LESS ${_SRC_LEN})
get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
if (_JAVA_EXT MATCHES ".java")
list(APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE})
set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class")
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE})
elseif (_JAVA_EXT MATCHES ".jar"
OR _JAVA_EXT MATCHES ".war"
OR _JAVA_EXT MATCHES ".ear"
OR _JAVA_EXT MATCHES ".sar")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_SOURCE_FILE})
elseif (_JAVA_EXT STREQUAL "")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
else (_JAVA_EXT MATCHES ".java")
__java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE}
${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}
"Copying ${_JAVA_SOURCE_FILE} to the build directory")
list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE})
endif (_JAVA_EXT MATCHES ".java")
endforeach(_JAVA_SOURCE_FILE)
# create an empty java_class_filelist
if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
endif()
if (_JAVA_COMPILE_FILES)
# Compile the java files and create a list of class files
add_custom_command(
# NOTE: this command generates an artificial dependency file
OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
COMMAND ${Java_JAVAC_EXECUTABLE}
${CMAKE_JAVA_COMPILE_FLAGS}
-classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}"
-d ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
${_JAVA_COMPILE_FILES}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
DEPENDS ${_JAVA_COMPILE_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building Java objects for ${_TARGET_NAME}.jar"
)
add_custom_command(
OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
COMMAND ${CMAKE_COMMAND}
-DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}"
-P ${_JAVA_CLASS_FILELIST_SCRIPT}
DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif (_JAVA_COMPILE_FILES)
# create the jar file
set(_JAVA_JAR_OUTPUT_PATH
${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
if (CMAKE_JNI_TARGET)
add_custom_command(
OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE}
-cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT}
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT}
DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
)
else ()
add_custom_command(
OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE}
-cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT}
WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
)
endif (CMAKE_JNI_TARGET)
# Add the target and make sure we have the latest resource files.
add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
INSTALL_FILES
${_JAVA_JAR_OUTPUT_PATH}
)
if (_JAVA_TARGET_OUTPUT_LINK)
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
INSTALL_FILES
${_JAVA_JAR_OUTPUT_PATH}
${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
)
if (CMAKE_JNI_TARGET)
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
JNI_SYMLINK
${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
)
endif (CMAKE_JNI_TARGET)
endif (_JAVA_TARGET_OUTPUT_LINK)
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
JAR_FILE
${_JAVA_JAR_OUTPUT_PATH}
)
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
CLASSDIR
${CMAKE_JAVA_CLASS_OUTPUT_PATH}
)
endfunction(add_jar)
function(INSTALL_JAR _TARGET_NAME _DESTINATION)
get_property(__FILES
TARGET
${_TARGET_NAME}
PROPERTY
INSTALL_FILES
)
if (__FILES)
install(
FILES
${__FILES}
DESTINATION
${_DESTINATION}
)
else (__FILES)
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
endif (__FILES)
endfunction(INSTALL_JAR _TARGET_NAME _DESTINATION)
function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
get_property(__SYMLINK
TARGET
${_TARGET_NAME}
PROPERTY
JNI_SYMLINK
)
if (__SYMLINK)
install(
FILES
${__SYMLINK}
DESTINATION
${_DESTINATION}
)
else (__SYMLINK)
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
endif (__SYMLINK)
endfunction(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
function (find_jar VARIABLE)
set(_jar_names)
set(_jar_files)
set(_jar_versions)
set(_jar_paths
/usr/share/java/
/usr/local/share/java/
${Java_JAR_PATHS})
set(_jar_doc "NOTSET")
set(_state "name")
foreach (arg ${ARGN})
if (${_state} STREQUAL "name")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
elseif (${arg} STREQUAL "NAMES")
set(_state "names")
elseif (${arg} STREQUAL "PATHS")
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
else (${arg} STREQUAL "NAMES")
set(_jar_names ${arg})
if (_jar_doc STREQUAL "NOTSET")
set(_jar_doc "Finding ${arg} jar")
endif (_jar_doc STREQUAL "NOTSET")
endif (${arg} STREQUAL "VERSIONS")
elseif (${_state} STREQUAL "versions")
if (${arg} STREQUAL "NAMES")
set(_state "names")
elseif (${arg} STREQUAL "PATHS")
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
else (${arg} STREQUAL "NAMES")
set(_jar_versions ${_jar_versions} ${arg})
endif (${arg} STREQUAL "NAMES")
elseif (${_state} STREQUAL "names")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
elseif (${arg} STREQUAL "PATHS")
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
else (${arg} STREQUAL "VERSIONS")
set(_jar_names ${_jar_names} ${arg})
if (_jar_doc STREQUAL "NOTSET")
set(_jar_doc "Finding ${arg} jar")
endif (_jar_doc STREQUAL "NOTSET")
endif (${arg} STREQUAL "VERSIONS")
elseif (${_state} STREQUAL "paths")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
elseif (${arg} STREQUAL "NAMES")
set(_state "names")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
else (${arg} STREQUAL "VERSIONS")
set(_jar_paths ${_jar_paths} ${arg})
endif (${arg} STREQUAL "VERSIONS")
elseif (${_state} STREQUAL "doc")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
elseif (${arg} STREQUAL "NAMES")
set(_state "names")
elseif (${arg} STREQUAL "PATHS")
set(_state "paths")
else (${arg} STREQUAL "VERSIONS")
set(_jar_doc ${arg})
endif (${arg} STREQUAL "VERSIONS")
endif (${_state} STREQUAL "name")
endforeach (arg ${ARGN})
if (NOT _jar_names)
message(FATAL_ERROR "find_jar: No name to search for given")
endif (NOT _jar_names)
foreach (jar_name ${_jar_names})
foreach (version ${_jar_versions})
set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
endforeach (version ${_jar_versions})
set(_jar_files ${_jar_files} ${jar_name}.jar)
endforeach (jar_name ${_jar_names})
find_file(${VARIABLE}
NAMES ${_jar_files}
PATHS ${_jar_paths}
DOC ${_jar_doc}
NO_DEFAULT_PATH)
endfunction (find_jar VARIABLE)
function(create_javadoc _target)
set(_javadoc_packages)
set(_javadoc_files)
set(_javadoc_sourcepath)
set(_javadoc_classpath)
set(_javadoc_installpath "${CMAKE_INSTALL_PREFIX}/share/javadoc")
set(_javadoc_doctitle)
set(_javadoc_windowtitle)
set(_javadoc_author FALSE)
set(_javadoc_version FALSE)
set(_javadoc_use FALSE)
set(_state "package")
foreach (arg ${ARGN})
if (${_state} STREQUAL "package")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_packages ${arg})
set(_state "packages")
endif ()
elseif (${_state} STREQUAL "packages")
if (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_packages ${arg})
endif ()
elseif (${_state} STREQUAL "files")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_files ${arg})
endif ()
elseif (${_state} STREQUAL "sourcepath")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_sourcepath ${arg})
endif ()
elseif (${_state} STREQUAL "classpath")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_classpath ${arg})
endif ()
elseif (${_state} STREQUAL "installpath")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_installpath ${arg})
endif ()
elseif (${_state} STREQUAL "doctitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_doctitle ${arg})
endif ()
elseif (${_state} STREQUAL "windowtitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_windowtitle ${arg})
endif ()
elseif (${_state} STREQUAL "author")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_author ${arg})
endif ()
elseif (${_state} STREQUAL "use")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_use ${arg})
endif ()
elseif (${_state} STREQUAL "version")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
elseif (${arg} STREQUAL "FILES")
set(_state "files")
elseif (${arg} STREQUAL "SOURCEPATH")
set(_state "sourcepath")
elseif (${arg} STREQUAL "CLASSPATH")
set(_state "classpath")
elseif (${arg} STREQUAL "INSTALLPATH")
set(_state "installpath")
elseif (${arg} STREQUAL "DOCTITLE")
set(_state "doctitle")
elseif (${arg} STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
elseif (${arg} STREQUAL "AUTHOR")
set(_state "author")
elseif (${arg} STREQUAL "USE")
set(_state "use")
elseif (${arg} STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_version ${arg})
endif ()
endif (${_state} STREQUAL "package")
endforeach (arg ${ARGN})
set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target})
set(_javadoc_options -d ${_javadoc_builddir})
if (_javadoc_sourcepath)
set(_start TRUE)
foreach(_path ${_javadoc_sourcepath})
if (_start)
set(_sourcepath ${_path})
set(_start FALSE)
else (_start)
set(_sourcepath ${_sourcepath}:${_path})
endif (_start)
endforeach(_path ${_javadoc_sourcepath})
set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
endif (_javadoc_sourcepath)
if (_javadoc_classpath)
set(_start TRUE)
foreach(_path ${_javadoc_classpath})
if (_start)
set(_classpath ${_path})
set(_start FALSE)
else (_start)
set(_classpath ${_classpath}:${_path})
endif (_start)
endforeach(_path ${_javadoc_classpath})
set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
endif (_javadoc_classpath)
if (_javadoc_doctitle)
set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
endif (_javadoc_doctitle)
if (_javadoc_windowtitle)
set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
endif (_javadoc_windowtitle)
if (_javadoc_author)
set(_javadoc_options ${_javadoc_options} -author)
endif (_javadoc_author)
if (_javadoc_use)
set(_javadoc_options ${_javadoc_options} -use)
endif (_javadoc_use)
if (_javadoc_version)
set(_javadoc_options ${_javadoc_options} -version)
endif (_javadoc_version)
add_custom_target(${_target}_javadoc ALL
COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
${_javadoc_files}
${_javadoc_packages}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
install(
DIRECTORY ${_javadoc_builddir}
DESTINATION ${_javadoc_installpath}
)
endfunction(create_javadoc)

View File

@ -1,52 +0,0 @@
#
# This script create a list of compiled Java class files to be added to a
# jar file. This avoids including cmake files which get created in the
# binary directory.
#
#=============================================================================
# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
set(_JAVA_GLOBBED_FILES)
if (CMAKE_JAR_CLASSES_PREFIX)
foreach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX})
message(STATUS "JAR_CLASS_PREFIX: ${JAR_CLASS_PREFIX}")
file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class")
if (_JAVA_GLOBBED_TMP_FILES)
list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
endif (_JAVA_GLOBBED_TMP_FILES)
endforeach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX})
else()
file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class")
endif (CMAKE_JAR_CLASSES_PREFIX)
set(_JAVA_CLASS_FILES)
# file(GLOB_RECURSE foo RELATIVE) is broken so we need this.
foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE})
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n)
endforeach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
# write to file
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES})
else (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
message(SEND_ERROR "FATAL: Java class output path doesn't exist")
endif (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
else (CMAKE_JAVA_CLASS_OUTPUT_PATH)
message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH")
endif (CMAKE_JAVA_CLASS_OUTPUT_PATH)

View File

@ -1,32 +0,0 @@
#
# Helper script for UseJava.cmake
#
#=============================================================================
# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
if (_JAVA_TARGET_OUTPUT_NAME)
find_program(LN_EXECUTABLE
NAMES
ln
)
execute_process(
COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
)
else (_JAVA_TARGET_OUTPUT_NAME)
message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
endif (_JAVA_TARGET_OUTPUT_NAME)
endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK)

1
default.nix Normal file
View File

@ -0,0 +1 @@
(import nix/flake-compat.nix).defaultNix

View File

@ -1,66 +0,0 @@
POLYMC(1)
==========
:doctype: manpage
NAME
----
polymc - a launcher and instance manager for Minecraft.
SYNOPSIS
--------
*polymc* ['OPTIONS']
DESCRIPTION
-----------
PolyMC is a custom launcher for Minecraft that allows you to easily manage
multiple installations of Minecraft at once. It also allows you to easily
install and remove mods by simply dragging and dropping.
Here are the current features of PolyMC.
OPTIONS
-------
*-d, --dir*='DIRECTORY'::
Use 'DIRECTORY' as the PolyMC root.
*-l, --launch*='INSTANCE_ID'::
Launch the instance specified by 'INSTANCE_ID'.
*--alive*::
Write a small 'live.check' file after PolyMC starts.
*-h, --help*::
Display help text and exit.
*-v, --version*::
Display program version and exit.
*-a, --profile*='PROFILE'::
Use the account specified by 'PROFILE' (only valid in combination with --launch).
EXIT STATUS
-----------
*0*::
Success
*1*::
Failure (syntax or usage error; configuration error; unexpected error).
BUGS
----
<https://github.com/PolyMC/PolyMC/issues>
RESOURCES
---------
GitHub: <https://github.com/PolyMC/PolyMC>
Main website: <https://polymc.org>
AUTHORS
-------
peterix <peterix@gmail.com>
swurl <swurl@swurl.xyz>
// vim: syntax=asciidoc

61
flake.lock generated Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"libnbtplusplus": {
"flake": false,
"locked": {
"lastModified": 1650031308,
"narHash": "sha256-TvVOjkUobYJD9itQYueELJX3wmecvEdCbJ0FinW2mL4=",
"owner": "PrismLauncher",
"repo": "libnbtplusplus",
"rev": "2203af7eeb48c45398139b583615134efd8d407f",
"type": "github"
},
"original": {
"owner": "PrismLauncher",
"repo": "libnbtplusplus",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1671417167,
"narHash": "sha256-JkHam6WQOwZN1t2C2sbp1TqMv3TVRjzrdoejqfefwrM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bb31220cca6d044baa6dc2715b07497a2a7c4bc7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"libnbtplusplus": "libnbtplusplus",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View File

@ -0,0 +1,37 @@
{
description = "A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once (Fork of MultiMC)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
libnbtplusplus = { url = "github:PrismLauncher/libnbtplusplus"; flake = false; };
};
outputs = { self, nixpkgs, libnbtplusplus, ... }:
let
# User-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
# Supported systems (qtbase is currently broken for "aarch64-darwin")
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported systems.
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
packagesFn = pkgs: rec {
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix { inherit version self libnbtplusplus; };
prismlauncher = pkgs.qt6Packages.callPackage ./nix { inherit version self libnbtplusplus; };
};
in
{
packages = forAllSystems (system:
let packages = packagesFn pkgs.${system}; in
packages // { default = packages.prismlauncher; }
);
overlay = final: packagesFn;
};
}

View File

@ -0,0 +1,83 @@
id: org.prismlauncher.PrismLauncher
runtime: org.kde.Platform
runtime-version: "5.15-22.08"
sdk: org.kde.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17
- org.freedesktop.Sdk.Extension.openjdk8
add-extensions:
com.valvesoftware.Steam.Utility.gamescope:
version: stable
add-ld-path: lib
no-autodownload: true
autodelete: false
directory: utils/gamescope
command: prismlauncher
finish-args:
- --share=ipc
- --socket=x11
- --socket=wayland
- --device=all
- --share=network
- --socket=pulseaudio
# for Discord RPC mods
- --filesystem=xdg-run/app/com.discordapp.Discord:create
# Mod drag&drop
- --filesystem=xdg-download:ro
modules:
- name: prismlauncher
buildsystem: cmake-ninja
config-opts:
- -DLauncher_BUILD_PLATFORM=flatpak
- -DCMAKE_BUILD_TYPE=Debug
build-options:
env:
JAVA_HOME: /usr/lib/sdk/openjdk17/jvm/openjdk-17
JAVA_COMPILER: /usr/lib/sdk/openjdk17/jvm/openjdk-17/bin/javac
sources:
- type: dir
path: ../
- name: openjdk
buildsystem: simple
build-commands:
- mkdir -p /app/jdk/
- /usr/lib/sdk/openjdk17/install.sh
- mv /app/jre /app/jdk/17
- /usr/lib/sdk/openjdk8/install.sh
- mv /app/jre /app/jdk/8
cleanup: [/jre]
- name: xrandr
buildsystem: autotools
sources:
- type: archive
url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.1.tar.xz
sha256: 7bc76daf9d72f8aff885efad04ce06b90488a1a169d118dea8a2b661832e8762
cleanup: [/share/man, /bin/xkeystone]
- name: gamemode
buildsystem: meson
config-opts:
- -Dwith-sd-bus-provider=no-daemon
- -Dwith-examples=false
post-install:
# gamemoderun is installed for users who want to use wrapper commands
# post-install is running inside the build dir, we need it from the source though
- install -Dm755 ../data/gamemoderun -t /app/bin
sources:
- type: git
url: https://github.com/FeralInteractive/gamemode
tag: "1.7"
commit: 4dc99dff76218718763a6b07fc1900fa6d1dafd9
- name: enhance
buildsystem: simple
build-commands:
- mkdir -p /app/utils/gamescope
- install -Dm755 prime-run /app/bin/prime-run
- mv /app/bin/prismlauncher /app/bin/prismrun
- install -Dm755 prismlauncher /app/bin/prismlauncher
sources:
- type: file
path: ../flatpak/prime-run
- type: file
path: ../flatpak/prismlauncher

4
flatpak/prime-run Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
export __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia
exec "$@"

11
flatpak/prismlauncher Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# discord RPC
for i in {0..9}; do
test -S "$XDG_RUNTIME_DIR"/discord-ipc-"$i" || ln -sf {app/com.discordapp.Discord,"$XDG_RUNTIME_DIR"}/discord-ipc-"$i";
done
export PATH="${PATH}${PATH:+:}/app/utils/gamescope/bin:/usr/lib/extensions/vulkan/MangoHud/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/lib/extensions/vulkan/MangoHud/\$LIB/"
exec /app/bin/prismrun "$@"

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,39 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (C) 2022 Tayou <tayou@gmx.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <QApplication>
@ -33,6 +69,7 @@ class BaseDetachedToolFactory;
class TranslationsModel;
class ITheme;
class MCEditTool;
class ThemeManager;
namespace Meta {
class Index;
@ -55,10 +92,22 @@ public:
Initialized
};
enum Capability {
None = 0,
SupportsMSA = 1 << 0,
SupportsFlame = 1 << 1,
SupportsGameMode = 1 << 2,
SupportsMangoHud = 1 << 3,
};
Q_DECLARE_FLAGS(Capabilities, Capability)
public:
Application(int &argc, char **argv);
virtual ~Application();
bool event(QEvent* event) override;
std::shared_ptr<SettingsObject> settings() const {
return m_settings;
}
@ -71,7 +120,7 @@ public:
void setIconTheme(const QString& name);
std::vector<ITheme *> getValidApplicationThemes();
QList<ITheme*> getValidApplicationThemes();
void setApplicationTheme(const QString& name, bool initial);
@ -115,13 +164,28 @@ public:
shared_qobject_ptr<Meta::Index> metadataIndex();
QString getJarsPath();
void updateCapabilities();
/*!
* Finds and returns the full path to a jar file.
* Returns a null-string if it could not be found.
*/
QString getJarPath(QString jarFile);
QString getMSAClientID();
QString getFlameAPIKey();
QString getUserAgent();
QString getUserAgentUncached();
/// this is the root of the 'installation'. Used for automatic updates
const QString &root() {
return m_rootPath;
}
const Capabilities capabilities() {
return m_capabilities;
}
/*!
* Opens a json file using either a system default editor, or, if not empty, the editor
* specified in the settings
@ -136,20 +200,28 @@ public:
void ShowGlobalSettings(class QWidget * parent, QString open_page = QString());
int suitableMaxMem();
signals:
void updateAllowedChanged(bool status);
void globalSettingsAboutToOpen();
void globalSettingsClosed();
#ifdef Q_OS_MACOS
void clickedOnDock();
#endif
public slots:
bool launch(
InstancePtr instance,
bool online = true,
bool demo = false,
BaseProfilerFactory *profiler = nullptr,
MinecraftServerTargetPtr serverToJoin = nullptr,
MinecraftAccountPtr accountToUse = nullptr
);
bool kill(InstancePtr instance);
void closeCurrentWindow();
private slots:
void on_windowClose();
@ -159,6 +231,7 @@ private slots:
void setupWizardFinished(int status);
private:
bool handleDataMigration(const QString & currentData, const QString & oldData, const QString & name, const QString & configFile) const;
bool createSetupWizard();
void performMainStartupAction();
@ -187,15 +260,19 @@ private:
std::shared_ptr<JavaInstallList> m_javalist;
std::shared_ptr<TranslationsModel> m_translations;
std::shared_ptr<GenericPageProvider> m_globalSettingsProvider;
std::map<QString, std::unique_ptr<ITheme>> m_themes;
std::unique_ptr<MCEditTool> m_mcedit;
QString m_jarsPath;
QSet<QString> m_features;
std::unique_ptr<ThemeManager> m_themeManager;
QMap<QString, std::shared_ptr<BaseProfilerFactory>> m_profilers;
QString m_rootPath;
Status m_status = Application::StartingUp;
Capabilities m_capabilities;
#ifdef Q_OS_MACOS
Qt::ApplicationState m_prevAppState = Qt::ApplicationInactive;
#endif
#if defined Q_OS_WIN32
// used on Windows to attach the standard IO streams
@ -227,6 +304,7 @@ public:
QString m_profileToUse;
bool m_liveCheck = false;
QUrl m_zipToImport;
QString m_instanceIdToShowWindowOf;
std::unique_ptr<QFile> logFile;
};

View File

@ -1,18 +1,54 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ApplicationMessage.h"
#include <QJsonDocument>
#include <QJsonObject>
#include "Json.h"
void ApplicationMessage::parse(const QByteArray & input) {
auto doc = QJsonDocument::fromBinaryData(input);
auto root = doc.object();
auto doc = Json::requireDocument(input, "ApplicationMessage");
auto root = Json::requireObject(doc, "ApplicationMessage");
command = root.value("command").toString();
args.clear();
auto parsedArgs = root.value("args").toObject();
for(auto iter = parsedArgs.begin(); iter != parsedArgs.end(); iter++) {
args[iter.key()] = iter.value().toString();
for(auto iter = parsedArgs.constBegin(); iter != parsedArgs.constEnd(); iter++) {
args.insert(iter.key(), iter.value().toString());
}
}
@ -20,12 +56,10 @@ QByteArray ApplicationMessage::serialize() {
QJsonObject root;
root.insert("command", command);
QJsonObject outArgs;
for (auto iter = args.begin(); iter != args.end(); iter++) {
outArgs[iter.key()] = iter.value();
for (auto iter = args.constBegin(); iter != args.constEnd(); iter++) {
outArgs.insert(iter.key(), iter.value());
}
root.insert("args", outArgs);
QJsonDocument out;
out.setObject(root);
return out.toBinaryData();
return Json::toText(root);
}

View File

@ -1,12 +1,12 @@
#pragma once
#include <QString>
#include <QMap>
#include <QHash>
#include <QByteArray>
struct ApplicationMessage {
QString command;
QMap<QString, QString> args;
QHash<QString, QString> args;
QByteArray serialize();
void parse(const QByteArray & input);

View File

@ -17,13 +17,14 @@
#include <memory>
#include "BaseVersion.h"
class MinecraftInstance;
class QDir;
class QString;
class QObject;
class Task;
class BaseVersion;
typedef std::shared_ptr<BaseVersion> BaseVersionPtr;
class BaseInstaller
{
@ -35,7 +36,7 @@ public:
virtual bool add(MinecraftInstance *to);
virtual bool remove(MinecraftInstance *from);
virtual Task *createInstallTask(MinecraftInstance *instance, BaseVersionPtr version, QObject *parent) = 0;
virtual Task *createInstallTask(MinecraftInstance *instance, BaseVersion::Ptr version, QObject *parent) = 0;
protected:
virtual QString id() const = 0;

View File

@ -1,16 +1,37 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BaseInstance.h"
@ -18,6 +39,7 @@
#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include <QRegularExpression>
#include "settings/INISettingsObject.h"
#include "settings/Setting.h"
@ -31,15 +53,27 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
: QObject()
{
m_settings = settings;
m_global_settings = globalSettings;
m_rootDir = rootDir;
m_settings->registerSetting("name", "Unnamed Instance");
m_settings->registerSetting("iconKey", "default");
m_settings->registerSetting("notes", "");
m_settings->registerSetting("lastLaunchTime", 0);
m_settings->registerSetting("totalTimePlayed", 0);
m_settings->registerSetting("lastTimePlayed", 0);
// Game time override
auto gameTimeOverride = m_settings->registerSetting("OverrideGameTime", false);
m_settings->registerOverride(globalSettings->getSetting("ShowGameTime"), gameTimeOverride);
m_settings->registerOverride(globalSettings->getSetting("RecordGameTime"), gameTimeOverride);
// NOTE: Sometimees InstanceType is already registered, as it was used to identify the type of
// a locally stored instance
if (!m_settings->getSetting("InstanceType"))
m_settings->registerSetting("InstanceType", "");
// Custom Commands
auto commandSetting = m_settings->registerSetting({"OverrideCommands","OverrideLaunchCmd"}, false);
m_settings->registerOverride(globalSettings->getSetting("PreLaunchCommand"), commandSetting);
@ -55,6 +89,14 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleMaxLines"), nullptr);
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleOverflowStop"), nullptr);
// Managed Packs
m_settings->registerSetting("ManagedPack", false);
m_settings->registerSetting("ManagedPackType", "");
m_settings->registerSetting("ManagedPackID", "");
m_settings->registerSetting("ManagedPackName", "");
m_settings->registerSetting("ManagedPackVersionID", "");
m_settings->registerSetting("ManagedPackVersionName", "");
}
QString BaseInstance::getPreLaunchCommand()
@ -72,9 +114,59 @@ QString BaseInstance::getPostExitCommand()
return settings()->get("PostExitCommand").toString();
}
bool BaseInstance::isManagedPack() const
{
return m_settings->get("ManagedPack").toBool();
}
QString BaseInstance::getManagedPackType() const
{
return m_settings->get("ManagedPackType").toString();
}
QString BaseInstance::getManagedPackID() const
{
return m_settings->get("ManagedPackID").toString();
}
QString BaseInstance::getManagedPackName() const
{
return m_settings->get("ManagedPackName").toString();
}
QString BaseInstance::getManagedPackVersionID() const
{
return m_settings->get("ManagedPackVersionID").toString();
}
QString BaseInstance::getManagedPackVersionName() const
{
return m_settings->get("ManagedPackVersionName").toString();
}
void BaseInstance::setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version)
{
m_settings->set("ManagedPack", true);
m_settings->set("ManagedPackType", type);
m_settings->set("ManagedPackID", id);
m_settings->set("ManagedPackName", name);
m_settings->set("ManagedPackVersionID", versionId);
m_settings->set("ManagedPackVersionName", version);
}
void BaseInstance::copyManagedPack(BaseInstance& other)
{
m_settings->set("ManagedPack", other.isManagedPack());
m_settings->set("ManagedPackType", other.getManagedPackType());
m_settings->set("ManagedPackID", other.getManagedPackID());
m_settings->set("ManagedPackName", other.getManagedPackName());
m_settings->set("ManagedPackVersionID", other.getManagedPackVersionID());
m_settings->set("ManagedPackVersionName", other.getManagedPackVersionName());
}
int BaseInstance::getConsoleMaxLines() const
{
auto lineSetting = settings()->getSetting("ConsoleMaxLines");
auto lineSetting = m_settings->getSetting("ConsoleMaxLines");
bool conversionOk = false;
int maxLines = lineSetting->get().toInt(&conversionOk);
if(!conversionOk)
@ -87,7 +179,7 @@ int BaseInstance::getConsoleMaxLines() const
bool BaseInstance::shouldStopOnConsoleOverflow() const
{
return settings()->get("ConsoleOverflowStop").toBool();
return m_settings->get("ConsoleOverflowStop").toBool();
}
void BaseInstance::iconUpdated(QString key)
@ -162,7 +254,7 @@ void BaseInstance::setRunning(bool running)
int64_t BaseInstance::totalTimePlayed() const
{
qint64 current = settings()->get("totalTimePlayed").toLongLong();
qint64 current = m_settings->get("totalTimePlayed").toLongLong();
if(m_isRunning)
{
QDateTime timeNow = QDateTime::currentDateTime();
@ -178,7 +270,7 @@ int64_t BaseInstance::lastTimePlayed() const
QDateTime timeNow = QDateTime::currentDateTime();
return m_timeStarted.secsTo(timeNow);
}
return settings()->get("lastTimePlayed").toLongLong();
return m_settings->get("lastTimePlayed").toLongLong();
}
void BaseInstance::resetTimePlayed()
@ -197,8 +289,10 @@ QString BaseInstance::instanceRoot() const
return m_rootDir;
}
SettingsObjectPtr BaseInstance::settings() const
SettingsObjectPtr BaseInstance::settings()
{
loadSpecificSettings();
return m_settings;
}
@ -261,11 +355,11 @@ QString BaseInstance::name() const
QString BaseInstance::windowTitle() const
{
return BuildConfig.LAUNCHER_NAME + ": " + name().replace(QRegExp("[ \n\r\t]+"), " ");
return BuildConfig.LAUNCHER_DISPLAYNAME + ": " + name().replace(QRegularExpression("\\s+"), " ");
}
// FIXME: why is this here? move it to MinecraftInstance!!!
QStringList BaseInstance::extraArguments() const
QStringList BaseInstance::extraArguments()
{
return Commandline::splitArgs(settings()->get("JvmArgs").toString());
}
@ -274,3 +368,8 @@ shared_qobject_ptr<LaunchTask> BaseInstance::getLaunchTask()
{
return m_launchProcess;
}
void BaseInstance::updateRuntimeContext()
{
// NOOP
}

View File

@ -1,16 +1,37 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
@ -33,6 +54,7 @@
#include "net/Mode.h"
#include "minecraft/launch/MinecraftServerTarget.h"
#include "RuntimeContext.h"
class QDir;
class Task;
@ -119,13 +141,22 @@ public:
QString getPostExitCommand();
QString getWrapperCommand();
bool isManagedPack() const;
QString getManagedPackType() const;
QString getManagedPackID() const;
QString getManagedPackName() const;
QString getManagedPackVersionID() const;
QString getManagedPackVersionName() const;
void setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version);
void copyManagedPack(BaseInstance& other);
/// guess log level from a line of game log
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level)
virtual MessageLevel::Enum guessLevel([[maybe_unused]] const QString &line, MessageLevel::Enum level)
{
return level;
};
virtual QStringList extraArguments() const;
virtual QStringList extraArguments();
/// Traits. Normally inside the version, depends on instance implementation.
virtual QSet <QString> traits() const = 0;
@ -141,9 +172,18 @@ public:
/*!
* \brief Gets this instance's settings object.
* This settings object stores instance-specific settings.
*
* Note that this method is not const.
* It may call loadSpecificSettings() to ensure those are loaded.
*
* \return A pointer to this instance's settings object.
*/
virtual SettingsObjectPtr settings() const;
virtual SettingsObjectPtr settings();
/*!
* \brief Loads settings specific to an instance type if they're not already loaded.
*/
virtual void loadSpecificSettings() = 0;
/// returns a valid update task
virtual Task::Ptr createUpdateTask(Net::Mode mode) = 0;
@ -159,6 +199,7 @@ public:
* Create envrironment variables for running the instance
*/
virtual QProcessEnvironment createEnvironment() = 0;
virtual QProcessEnvironment createLaunchEnvironment() = 0;
/*!
* Returns a matcher that can maps relative paths within the instance to whether they are 'log files'
@ -176,10 +217,16 @@ public:
virtual QString instanceConfigFolder() const = 0;
/// get variables this instance exports
virtual QMap<QString, QString> getVariables() const = 0;
virtual QMap<QString, QString> getVariables() = 0;
virtual QString typeName() const = 0;
void updateRuntimeContext();
RuntimeContext runtimeContext() const
{
return m_runtimeContext;
}
bool hasVersionBroken() const
{
return m_hasBrokenVersion;
@ -238,6 +285,11 @@ public:
protected:
void changeStatus(Status newStatus);
SettingsObjectPtr globalSettings() const { return m_global_settings.lock(); };
bool isSpecificSettingsLoaded() const { return m_specific_settings_loaded; }
void setSpecificSettingsLoaded(bool loaded) { m_specific_settings_loaded = loaded; }
signals:
/*!
* \brief Signal emitted when properties relevant to the instance view change
@ -260,12 +312,17 @@ protected: /* data */
bool m_isRunning = false;
shared_qobject_ptr<LaunchTask> m_launchProcess;
QDateTime m_timeStarted;
RuntimeContext m_runtimeContext;
private: /* data */
Status m_status = Status::Present;
bool m_crashed = false;
bool m_hasUpdate = false;
bool m_hasBrokenVersion = false;
SettingsObjectWeakPtr m_global_settings;
bool m_specific_settings_loaded = false;
};
Q_DECLARE_METATYPE(shared_qobject_ptr<BaseInstance>)

View File

@ -25,6 +25,7 @@
class BaseVersion
{
public:
using Ptr = std::shared_ptr<BaseVersion>;
virtual ~BaseVersion() {}
/*!
* A string used to identify this version in config files.
@ -54,6 +55,4 @@ public:
};
};
typedef std::shared_ptr<BaseVersion> BaseVersionPtr;
Q_DECLARE_METATYPE(BaseVersionPtr)
Q_DECLARE_METATYPE(BaseVersion::Ptr)

View File

@ -1,16 +1,36 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BaseVersionList.h"
@ -20,20 +40,20 @@ BaseVersionList::BaseVersionList(QObject *parent) : QAbstractListModel(parent)
{
}
BaseVersionPtr BaseVersionList::findVersion(const QString &descriptor)
BaseVersion::Ptr BaseVersionList::findVersion(const QString &descriptor)
{
for (int i = 0; i < count(); i++)
{
if (at(i)->descriptor() == descriptor)
return at(i);
}
return BaseVersionPtr();
return nullptr;
}
BaseVersionPtr BaseVersionList::getRecommended() const
BaseVersion::Ptr BaseVersionList::getRecommended() const
{
if (count() <= 0)
return BaseVersionPtr();
return nullptr;
else
return at(0);
}
@ -46,12 +66,12 @@ QVariant BaseVersionList::data(const QModelIndex &index, int role) const
if (index.row() > count())
return QVariant();
BaseVersionPtr version = at(index.row());
BaseVersion::Ptr version = at(index.row());
switch (role)
{
case VersionPointerRole:
return qVariantFromValue(version);
return QVariant::fromValue(version);
case VersionRole:
return version->name();
@ -75,12 +95,12 @@ BaseVersionList::RoleList BaseVersionList::providesRoles() const
int BaseVersionList::rowCount(const QModelIndex &parent) const
{
// Return count
return count();
return parent.isValid() ? 0 : count();
}
int BaseVersionList::columnCount(const QModelIndex &parent) const
{
return 1;
return parent.isValid() ? 0 : 1;
}
QHash<int, QByteArray> BaseVersionList::roleNames() const

View File

@ -70,7 +70,7 @@ public:
virtual bool isLoaded() = 0;
//! Gets the version at the given index.
virtual const BaseVersionPtr at(int i) const = 0;
virtual const BaseVersion::Ptr at(int i) const = 0;
//! Returns the number of versions in the list.
virtual int count() const = 0;
@ -90,13 +90,13 @@ public:
* \return A const pointer to the version with the given descriptor. NULL if
* one doesn't exist.
*/
virtual BaseVersionPtr findVersion(const QString &descriptor);
virtual BaseVersion::Ptr findVersion(const QString &descriptor);
/*!
* \brief Gets the recommended version from this list
* If the list doesn't support recommended versions, this works exactly as getLatestStable
*/
virtual BaseVersionPtr getRecommended() const;
virtual BaseVersion::Ptr getRecommended() const;
/*!
* Sorts the version list.
@ -117,5 +117,5 @@ slots:
* then copies the versions and sets their parents correctly.
* \param versions List of versions whose parents should be set.
*/
virtual void updateListData(QList<BaseVersionPtr> versions) = 0;
virtual void updateListData(QList<BaseVersion::Ptr> versions) = 0;
};

View File

@ -4,8 +4,6 @@ project(application)
######## Sources and headers ########
include (UnitTest)
set(CORE_SOURCES
# LOGIC - Base classes and infrastructure
BaseInstaller.h
@ -26,17 +24,24 @@ set(CORE_SOURCES
NullInstance.h
MMCZip.h
MMCZip.cpp
MMCStrings.h
MMCStrings.cpp
StringUtils.h
StringUtils.cpp
RuntimeContext.h
# Basic instance manipulation tasks (derived from InstanceTask)
InstanceCreationTask.h
InstanceCreationTask.cpp
InstanceCopyPrefs.h
InstanceCopyPrefs.cpp
InstanceCopyTask.h
InstanceCopyTask.cpp
InstanceImportTask.h
InstanceImportTask.cpp
# Mod downloading task
ModDownloadTask.h
ModDownloadTask.cpp
# Use tracking separate from memory management
Usable.h
@ -84,18 +89,18 @@ set(CORE_SOURCES
# Time
MMCTime.h
MMCTime.cpp
MTPixmapCache.h
)
if (UNIX AND NOT CYGWIN AND NOT APPLE)
set(CORE_SOURCES
${CORE_SOURCES}
add_unit_test(FileSystem
SOURCES FileSystem_test.cpp
LIBS Launcher_logic
DATA testdata
)
add_unit_test(GZip
SOURCES GZip_test.cpp
LIBS Launcher_logic
# MangoHud
MangoHud.h
MangoHud.cpp
)
endif()
set(PATHMATCHER_SOURCES
# Path matchers
@ -103,6 +108,7 @@ set(PATHMATCHER_SOURCES
pathmatcher/IPathMatcher.h
pathmatcher/MultiMatcher.h
pathmatcher/RegexpMatcher.h
pathmatcher/SimplePrefixMatcher.h
)
set(NET_SOURCES
@ -120,10 +126,13 @@ set(NET_SOURCES
net/NetAction.h
net/NetJob.cpp
net/NetJob.h
net/NetUtils.h
net/PasteUpload.cpp
net/PasteUpload.h
net/Sink.h
net/Validator.h
net/Upload.cpp
net/Upload.h
)
# Game launch logic
@ -140,6 +149,8 @@ set(LAUNCH_SOURCES
launch/steps/TextPrint.h
launch/steps/Update.cpp
launch/steps/Update.h
launch/steps/QuitAfterGameStop.cpp
launch/steps/QuitAfterGameStop.h
launch/LaunchStep.cpp
launch/LaunchStep.h
launch/LaunchTask.cpp
@ -156,25 +167,12 @@ set(UPDATE_SOURCES
updater/UpdateChecker.cpp
updater/DownloadTask.h
updater/DownloadTask.cpp
updater/ExternalUpdater.h
)
add_unit_test(UpdateChecker
SOURCES updater/UpdateChecker_test.cpp
LIBS Launcher_logic
DATA updater/testdata
)
add_unit_test(DownloadTask
SOURCES updater/DownloadTask_test.cpp
LIBS Launcher_logic
DATA updater/testdata
)
# Rarely used notifications
set(NOTIFICATIONS_SOURCES
# Notifications - short warning messages
notifications/NotificationChecker.h
notifications/NotificationChecker.cpp
set(MAC_UPDATE_SOURCES
updater/MacSparkleUpdater.h
updater/MacSparkleUpdater.mm
)
# Backend for the news bar... there's usually no news.
@ -221,7 +219,11 @@ set(MINECRAFT_SOURCES
minecraft/auth/flows/Mojang.h
minecraft/auth/flows/MSA.cpp
minecraft/auth/flows/MSA.h
minecraft/auth/flows/Offline.cpp
minecraft/auth/flows/Offline.h
minecraft/auth/steps/OfflineStep.cpp
minecraft/auth/steps/OfflineStep.h
minecraft/auth/steps/EntitlementsStep.cpp
minecraft/auth/steps/EntitlementsStep.h
minecraft/auth/steps/GetSkinStep.cpp
@ -232,6 +234,8 @@ set(MINECRAFT_SOURCES
minecraft/auth/steps/MigrationEligibilityStep.h
minecraft/auth/steps/MinecraftProfileStep.cpp
minecraft/auth/steps/MinecraftProfileStep.h
minecraft/auth/steps/MinecraftProfileStepMojang.cpp
minecraft/auth/steps/MinecraftProfileStepMojang.h
minecraft/auth/steps/MSAStep.cpp
minecraft/auth/steps/MSAStep.h
minecraft/auth/steps/XboxAuthorizationStep.cpp
@ -278,13 +282,6 @@ set(MINECRAFT_SOURCES
minecraft/launch/VerifyJavaInstall.cpp
minecraft/launch/VerifyJavaInstall.h
minecraft/legacy/LegacyModList.h
minecraft/legacy/LegacyModList.cpp
minecraft/legacy/LegacyInstance.h
minecraft/legacy/LegacyInstance.cpp
minecraft/legacy/LegacyUpgradeTask.h
minecraft/legacy/LegacyUpgradeTask.cpp
minecraft/GradleSpecifier.h
minecraft/MinecraftInstance.cpp
minecraft/MinecraftInstance.h
@ -306,8 +303,6 @@ set(MINECRAFT_SOURCES
minecraft/Rule.h
minecraft/OneSixVersionFormat.cpp
minecraft/OneSixVersionFormat.h
minecraft/OpSys.cpp
minecraft/OpSys.h
minecraft/ParseUtils.cpp
minecraft/ParseUtils.h
minecraft/ProfileUtils.cpp
@ -315,6 +310,8 @@ set(MINECRAFT_SOURCES
minecraft/Library.cpp
minecraft/Library.h
minecraft/MojangDownloadInfo.h
minecraft/VanillaInstanceCreationTask.cpp
minecraft/VanillaInstanceCreationTask.h
minecraft/VersionFile.cpp
minecraft/VersionFile.h
minecraft/VersionFilterData.h
@ -324,19 +321,36 @@ set(MINECRAFT_SOURCES
minecraft/WorldList.h
minecraft/WorldList.cpp
minecraft/mod/MetadataHandler.h
minecraft/mod/Mod.h
minecraft/mod/Mod.cpp
minecraft/mod/ModDetails.h
minecraft/mod/ModFolderModel.h
minecraft/mod/ModFolderModel.cpp
minecraft/mod/ModFolderLoadTask.h
minecraft/mod/ModFolderLoadTask.cpp
minecraft/mod/LocalModParseTask.h
minecraft/mod/LocalModParseTask.cpp
minecraft/mod/Resource.h
minecraft/mod/Resource.cpp
minecraft/mod/ResourceFolderModel.h
minecraft/mod/ResourceFolderModel.cpp
minecraft/mod/ResourcePack.h
minecraft/mod/ResourcePack.cpp
minecraft/mod/ResourcePackFolderModel.h
minecraft/mod/ResourcePackFolderModel.cpp
minecraft/mod/TexturePack.h
minecraft/mod/TexturePack.cpp
minecraft/mod/TexturePackFolderModel.h
minecraft/mod/TexturePackFolderModel.cpp
minecraft/mod/ShaderPackFolderModel.h
minecraft/mod/tasks/BasicFolderLoadTask.h
minecraft/mod/tasks/ModFolderLoadTask.h
minecraft/mod/tasks/ModFolderLoadTask.cpp
minecraft/mod/tasks/LocalModParseTask.h
minecraft/mod/tasks/LocalModParseTask.cpp
minecraft/mod/tasks/LocalModUpdateTask.h
minecraft/mod/tasks/LocalModUpdateTask.cpp
minecraft/mod/tasks/LocalResourcePackParseTask.h
minecraft/mod/tasks/LocalResourcePackParseTask.cpp
minecraft/mod/tasks/LocalTexturePackParseTask.h
minecraft/mod/tasks/LocalTexturePackParseTask.cpp
# Assets
minecraft/AssetsUtils.h
@ -352,51 +366,7 @@ set(MINECRAFT_SOURCES
mojang/PackageManifest.h
mojang/PackageManifest.cpp
)
add_unit_test(GradleSpecifier
SOURCES minecraft/GradleSpecifier_test.cpp
LIBS Launcher_logic
)
add_executable(PackageManifest
mojang/PackageManifest_test.cpp
)
target_link_libraries(PackageManifest
Launcher_logic
Qt5::Test
)
target_include_directories(PackageManifest
PRIVATE ../cmake/UnitTest/
)
add_test(
NAME PackageManifest
COMMAND PackageManifest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_unit_test(MojangVersionFormat
SOURCES minecraft/MojangVersionFormat_test.cpp
LIBS Launcher_logic
DATA minecraft/testdata
)
add_unit_test(Library
SOURCES minecraft/Library_test.cpp
LIBS Launcher_logic
)
# FIXME: shares data with FileSystem test
add_unit_test(ModFolderModel
SOURCES minecraft/mod/ModFolderModel_test.cpp
DATA testdata
LIBS Launcher_logic
)
add_unit_test(ParseUtils
SOURCES minecraft/ParseUtils_test.cpp
LIBS Launcher_logic
)
minecraft/Agent.h)
# the screenshots feature
set(SCREENSHOTS_SOURCES
@ -411,8 +381,12 @@ set(TASKS_SOURCES
# Tasks
tasks/Task.h
tasks/Task.cpp
tasks/ConcurrentTask.h
tasks/ConcurrentTask.cpp
tasks/SequentialTask.h
tasks/SequentialTask.cpp
tasks/MultipleOptionsTask.h
tasks/MultipleOptionsTask.cpp
)
set(SETTINGS_SOURCES
@ -431,11 +405,6 @@ set(SETTINGS_SOURCES
settings/SettingsObject.h
)
add_unit_test(INIFile
SOURCES settings/INIFile_test.cpp
LIBS Launcher_logic
)
set(JAVA_SOURCES
java/JavaChecker.h
java/JavaChecker.cpp
@ -451,11 +420,6 @@ set(JAVA_SOURCES
java/JavaVersion.cpp
)
add_unit_test(JavaVersion
SOURCES java/JavaVersion_test.cpp
LIBS Launcher_logic
)
set(TRANSLATIONS_SOURCES
translations/TranslationsModel.h
translations/TranslationsModel.cpp
@ -491,6 +455,29 @@ set(META_SOURCES
meta/Index.h
)
set(API_SOURCES
modplatform/ModIndex.h
modplatform/ModIndex.cpp
modplatform/ModAPI.h
modplatform/EnsureMetadataTask.h
modplatform/EnsureMetadataTask.cpp
modplatform/CheckUpdateTask.h
modplatform/flame/FlameAPI.h
modplatform/flame/FlameAPI.cpp
modplatform/modrinth/ModrinthAPI.h
modplatform/modrinth/ModrinthAPI.cpp
modplatform/helpers/NetworkModAPI.h
modplatform/helpers/NetworkModAPI.cpp
modplatform/helpers/HashUtils.h
modplatform/helpers/HashUtils.cpp
modplatform/helpers/OverrideUtils.h
modplatform/helpers/OverrideUtils.cpp
)
set(FTB_SOURCES
modplatform/legacy_ftb/PackFetchTask.h
modplatform/legacy_ftb/PackFetchTask.cpp
@ -506,10 +493,27 @@ set(FLAME_SOURCES
# Flame
modplatform/flame/FlamePackIndex.cpp
modplatform/flame/FlamePackIndex.h
modplatform/flame/FlameModIndex.cpp
modplatform/flame/FlameModIndex.h
modplatform/flame/PackManifest.h
modplatform/flame/PackManifest.cpp
modplatform/flame/FileResolvingTask.h
modplatform/flame/FileResolvingTask.cpp
modplatform/flame/FlameCheckUpdate.cpp
modplatform/flame/FlameCheckUpdate.h
modplatform/flame/FlameInstanceCreationTask.h
modplatform/flame/FlameInstanceCreationTask.cpp
)
set(MODRINTH_SOURCES
modplatform/modrinth/ModrinthPackIndex.cpp
modplatform/modrinth/ModrinthPackIndex.h
modplatform/modrinth/ModrinthPackManifest.cpp
modplatform/modrinth/ModrinthPackManifest.h
modplatform/modrinth/ModrinthCheckUpdate.cpp
modplatform/modrinth/ModrinthCheckUpdate.h
modplatform/modrinth/ModrinthInstanceCreationTask.cpp
modplatform/modrinth/ModrinthInstanceCreationTask.h
)
set(MODPACKSCH_SOURCES
@ -519,11 +523,19 @@ set(MODPACKSCH_SOURCES
modplatform/modpacksch/FTBPackManifest.cpp
)
set(PACKWIZ_SOURCES
modplatform/packwiz/Packwiz.h
modplatform/packwiz/Packwiz.cpp
)
set(TECHNIC_SOURCES
modplatform/technic/SingleZipPackInstallTask.h
modplatform/technic/SingleZipPackInstallTask.cpp
modplatform/technic/SolderPackInstallTask.h
modplatform/technic/SolderPackInstallTask.cpp
modplatform/technic/SolderPackManifest.h
modplatform/technic/SolderPackManifest.cpp
modplatform/technic/TechnicPackProcessor.h
modplatform/technic/TechnicPackProcessor.cpp
)
@ -535,25 +547,36 @@ set(ATLAUNCHER_SOURCES
modplatform/atlauncher/ATLPackInstallTask.h
modplatform/atlauncher/ATLPackManifest.cpp
modplatform/atlauncher/ATLPackManifest.h
modplatform/atlauncher/ATLShareCode.cpp
modplatform/atlauncher/ATLShareCode.h
)
add_unit_test(Index
SOURCES meta/Index_test.cpp
LIBS Launcher_logic
######## Logging categories ########
ecm_qt_declare_logging_category(CORE_SOURCES
HEADER Logging.h
IDENTIFIER authCredentials
CATEGORY_NAME "launcher.auth.credentials"
DEFAULT_SEVERITY Warning
DESCRIPTION "Secrets and credentials for debugging purposes"
EXPORT "${Launcher_Name}"
)
if(KDE_INSTALL_LOGGINGCATEGORIESDIR) # only install if there is a standard path for this
ecm_qt_install_logging_categories(
EXPORT "${Launcher_Name}"
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
)
endif()
################################ COMPILE ################################
# we need zlib
find_package(ZLIB REQUIRED)
set(LOGIC_SOURCES
${CORE_SOURCES}
${PATHMATCHER_SOURCES}
${NET_SOURCES}
${LAUNCH_SOURCES}
${UPDATE_SOURCES}
${NOTIFICATIONS_SOURCES}
${NEWS_SOURCES}
${MINECRAFT_SOURCES}
${SCREENSHOTS_SOURCES}
@ -564,17 +587,26 @@ set(LOGIC_SOURCES
${TOOLS_SOURCES}
${META_SOURCES}
${ICONS_SOURCES}
${API_SOURCES}
${FTB_SOURCES}
${FLAME_SOURCES}
${MODRINTH_SOURCES}
${MODPACKSCH_SOURCES}
${PACKWIZ_SOURCES}
${TECHNIC_SOURCES}
${ATLAUNCHER_SOURCES}
)
if(APPLE)
set (LOGIC_SOURCES ${LOGIC_SOURCES} ${MAC_UPDATE_SOURCES})
endif()
SET(LAUNCHER_SOURCES
# Application base
Application.h
Application.cpp
DataMigrationTask.h
DataMigrationTask.cpp
UpdateController.cpp
UpdateController.h
ApplicationMessage.h
@ -598,9 +630,12 @@ SET(LAUNCHER_SOURCES
resources/pe_light/pe_light.qrc
resources/pe_colored/pe_colored.qrc
resources/pe_blue/pe_blue.qrc
resources/breeze_dark/breeze_dark.qrc
resources/breeze_light/breeze_light.qrc
resources/OSX/OSX.qrc
resources/iOS/iOS.qrc
resources/flat/flat.qrc
resources/flat_white/flat_white.qrc
resources/documents/documents.qrc
../${Launcher_Branding_LogoQRC}
@ -632,6 +667,8 @@ SET(LAUNCHER_SOURCES
ui/setupwizard/JavaWizardPage.h
ui/setupwizard/LanguageWizardPage.cpp
ui/setupwizard/LanguageWizardPage.h
ui/setupwizard/PasteWizardPage.cpp
ui/setupwizard/PasteWizardPage.h
# GUI - themes
ui/themes/FusionTheme.cpp
@ -646,6 +683,8 @@ SET(LAUNCHER_SOURCES
ui/themes/ITheme.h
ui/themes/SystemTheme.cpp
ui/themes/SystemTheme.h
ui/themes/ThemeManager.cpp
ui/themes/ThemeManager.h
# Processes
LaunchController.h
@ -664,10 +703,14 @@ SET(LAUNCHER_SOURCES
ui/pages/BasePageProvider.h
# GUI - instance pages
ui/pages/instance/ExternalResourcesPage.cpp
ui/pages/instance/ExternalResourcesPage.h
ui/pages/instance/GameOptionsPage.cpp
ui/pages/instance/GameOptionsPage.h
ui/pages/instance/VersionPage.cpp
ui/pages/instance/VersionPage.h
ui/pages/instance/ManagedPackPage.cpp
ui/pages/instance/ManagedPackPage.h
ui/pages/instance/TexturePackPage.h
ui/pages/instance/ResourcePackPage.h
ui/pages/instance/ShaderPackPage.h
@ -685,8 +728,6 @@ SET(LAUNCHER_SOURCES
ui/pages/instance/OtherLogsPage.h
ui/pages/instance/ServersPage.cpp
ui/pages/instance/ServersPage.h
ui/pages/instance/LegacyUpgradePage.cpp
ui/pages/instance/LegacyUpgradePage.h
ui/pages/instance/WorldListPage.cpp
ui/pages/instance/WorldListPage.h
@ -707,13 +748,18 @@ SET(LAUNCHER_SOURCES
ui/pages/global/LauncherPage.h
ui/pages/global/ProxyPage.cpp
ui/pages/global/ProxyPage.h
ui/pages/global/PasteEEPage.cpp
ui/pages/global/PasteEEPage.h
ui/pages/global/APIPage.cpp
ui/pages/global/APIPage.h
# GUI - platform pages
ui/pages/modplatform/VanillaPage.cpp
ui/pages/modplatform/VanillaPage.h
ui/pages/modplatform/ModPage.cpp
ui/pages/modplatform/ModPage.h
ui/pages/modplatform/ModModel.cpp
ui/pages/modplatform/ModModel.h
ui/pages/modplatform/atlauncher/AtlFilterModel.cpp
ui/pages/modplatform/atlauncher/AtlFilterModel.h
ui/pages/modplatform/atlauncher/AtlListModel.cpp
@ -722,6 +768,8 @@ SET(LAUNCHER_SOURCES
ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h
ui/pages/modplatform/atlauncher/AtlPage.cpp
ui/pages/modplatform/atlauncher/AtlPage.h
ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp
ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h
ui/pages/modplatform/ftb/FtbFilterModel.cpp
ui/pages/modplatform/ftb/FtbFilterModel.h
@ -739,6 +787,15 @@ SET(LAUNCHER_SOURCES
ui/pages/modplatform/flame/FlameModel.h
ui/pages/modplatform/flame/FlamePage.cpp
ui/pages/modplatform/flame/FlamePage.h
ui/pages/modplatform/flame/FlameModModel.cpp
ui/pages/modplatform/flame/FlameModModel.h
ui/pages/modplatform/flame/FlameModPage.cpp
ui/pages/modplatform/flame/FlameModPage.h
ui/pages/modplatform/modrinth/ModrinthPage.cpp
ui/pages/modplatform/modrinth/ModrinthPage.h
ui/pages/modplatform/modrinth/ModrinthModel.cpp
ui/pages/modplatform/modrinth/ModrinthModel.h
ui/pages/modplatform/technic/TechnicModel.cpp
ui/pages/modplatform/technic/TechnicModel.h
@ -748,6 +805,11 @@ SET(LAUNCHER_SOURCES
ui/pages/modplatform/ImportPage.cpp
ui/pages/modplatform/ImportPage.h
ui/pages/modplatform/modrinth/ModrinthModModel.cpp
ui/pages/modplatform/modrinth/ModrinthModModel.h
ui/pages/modplatform/modrinth/ModrinthModPage.cpp
ui/pages/modplatform/modrinth/ModrinthModPage.h
# GUI - dialogs
ui/dialogs/AboutDialog.cpp
ui/dialogs/AboutDialog.h
@ -765,27 +827,42 @@ SET(LAUNCHER_SOURCES
ui/dialogs/ExportInstanceDialog.h
ui/dialogs/IconPickerDialog.cpp
ui/dialogs/IconPickerDialog.h
ui/dialogs/ImportResourcePackDialog.cpp
ui/dialogs/ImportResourcePackDialog.h
ui/dialogs/LoginDialog.cpp
ui/dialogs/LoginDialog.h
ui/dialogs/MSALoginDialog.cpp
ui/dialogs/MSALoginDialog.h
ui/dialogs/OfflineLoginDialog.cpp
ui/dialogs/OfflineLoginDialog.h
ui/dialogs/NewComponentDialog.cpp
ui/dialogs/NewComponentDialog.h
ui/dialogs/NewInstanceDialog.cpp
ui/dialogs/NewInstanceDialog.h
ui/dialogs/NotificationDialog.cpp
ui/dialogs/NotificationDialog.h
ui/dialogs/NewsDialog.cpp
ui/dialogs/NewsDialog.h
ui/pagedialog/PageDialog.cpp
ui/pagedialog/PageDialog.h
ui/dialogs/ProgressDialog.cpp
ui/dialogs/ProgressDialog.h
ui/dialogs/ReviewMessageBox.cpp
ui/dialogs/ReviewMessageBox.h
ui/dialogs/UpdateDialog.cpp
ui/dialogs/UpdateDialog.h
ui/dialogs/VersionSelectDialog.cpp
ui/dialogs/VersionSelectDialog.h
ui/dialogs/SkinUploadDialog.cpp
ui/dialogs/SkinUploadDialog.h
ui/dialogs/ModDownloadDialog.cpp
ui/dialogs/ModDownloadDialog.h
ui/dialogs/ScrollMessageBox.cpp
ui/dialogs/ScrollMessageBox.h
ui/dialogs/BlockedModsDialog.cpp
ui/dialogs/BlockedModsDialog.h
ui/dialogs/ChooseProviderDialog.h
ui/dialogs/ChooseProviderDialog.cpp
ui/dialogs/ModUpdateDialog.cpp
ui/dialogs/ModUpdateDialog.h
# GUI - widgets
ui/widgets/Common.cpp
@ -808,13 +885,21 @@ SET(LAUNCHER_SOURCES
ui/widgets/LineSeparator.h
ui/widgets/LogView.cpp
ui/widgets/LogView.h
ui/widgets/MCModInfoFrame.cpp
ui/widgets/MCModInfoFrame.h
ui/widgets/InfoFrame.cpp
ui/widgets/InfoFrame.h
ui/widgets/ModFilterWidget.cpp
ui/widgets/ModFilterWidget.h
ui/widgets/ModListView.cpp
ui/widgets/ModListView.h
ui/widgets/PageContainer.cpp
ui/widgets/PageContainer.h
ui/widgets/PageContainer_p.h
ui/widgets/ProjectDescriptionPage.h
ui/widgets/ProjectDescriptionPage.cpp
ui/widgets/VariableSizedImageObject.h
ui/widgets/VariableSizedImageObject.cpp
ui/widgets/ProjectItem.h
ui/widgets/ProjectItem.cpp
ui/widgets/VersionListView.cpp
ui/widgets/VersionListView.h
ui/widgets/VersionSelectWidget.cpp
@ -838,15 +923,16 @@ SET(LAUNCHER_SOURCES
ui/instanceview/VisualGroup.h
)
qt5_wrap_ui(LAUNCHER_UI
qt_wrap_ui(LAUNCHER_UI
ui/setupwizard/PasteWizardPage.ui
ui/pages/global/AccountListPage.ui
ui/pages/global/JavaPage.ui
ui/pages/global/LauncherPage.ui
ui/pages/global/PasteEEPage.ui
ui/pages/global/APIPage.ui
ui/pages/global/ProxyPage.ui
ui/pages/global/MinecraftPage.ui
ui/pages/global/ExternalToolsPage.ui
ui/pages/instance/ModFolderPage.ui
ui/pages/instance/ExternalResourcesPage.ui
ui/pages/instance/NotesPage.ui
ui/pages/instance/LogPage.ui
ui/pages/instance/ServersPage.ui
@ -854,44 +940,55 @@ qt5_wrap_ui(LAUNCHER_UI
ui/pages/instance/OtherLogsPage.ui
ui/pages/instance/InstanceSettingsPage.ui
ui/pages/instance/VersionPage.ui
ui/pages/instance/ManagedPackPage.ui
ui/pages/instance/WorldListPage.ui
ui/pages/instance/LegacyUpgradePage.ui
ui/pages/instance/ScreenshotsPage.ui
ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui
ui/pages/modplatform/atlauncher/AtlPage.ui
ui/pages/modplatform/VanillaPage.ui
ui/pages/modplatform/ModPage.ui
ui/pages/modplatform/flame/FlamePage.ui
ui/pages/modplatform/legacy_ftb/Page.ui
ui/pages/modplatform/ImportPage.ui
ui/pages/modplatform/ftb/FtbPage.ui
ui/pages/modplatform/modrinth/ModrinthPage.ui
ui/pages/modplatform/technic/TechnicPage.ui
ui/widgets/InstanceCardWidget.ui
ui/widgets/CustomCommands.ui
ui/widgets/MCModInfoFrame.ui
ui/widgets/InfoFrame.ui
ui/widgets/ModFilterWidget.ui
ui/dialogs/CopyInstanceDialog.ui
ui/dialogs/ProfileSetupDialog.ui
ui/dialogs/ProgressDialog.ui
ui/dialogs/NewInstanceDialog.ui
ui/dialogs/NotificationDialog.ui
ui/dialogs/UpdateDialog.ui
ui/dialogs/NewComponentDialog.ui
ui/dialogs/NewsDialog.ui
ui/dialogs/ProfileSelectDialog.ui
ui/dialogs/SkinUploadDialog.ui
ui/dialogs/ExportInstanceDialog.ui
ui/dialogs/IconPickerDialog.ui
ui/dialogs/ImportResourcePackDialog.ui
ui/dialogs/MSALoginDialog.ui
ui/dialogs/OfflineLoginDialog.ui
ui/dialogs/AboutDialog.ui
ui/dialogs/LoginDialog.ui
ui/dialogs/EditAccountDialog.ui
ui/dialogs/ReviewMessageBox.ui
ui/dialogs/ScrollMessageBox.ui
ui/dialogs/BlockedModsDialog.ui
ui/dialogs/ChooseProviderDialog.ui
)
qt5_add_resources(LAUNCHER_RESOURCES
qt_add_resources(LAUNCHER_RESOURCES
resources/backgrounds/backgrounds.qrc
resources/multimc/multimc.qrc
resources/pe_dark/pe_dark.qrc
resources/pe_light/pe_light.qrc
resources/pe_colored/pe_colored.qrc
resources/pe_blue/pe_blue.qrc
resources/breeze_dark/breeze_dark.qrc
resources/breeze_light/breeze_light.qrc
resources/OSX/OSX.qrc
resources/iOS/iOS.qrc
resources/flat/flat.qrc
@ -901,36 +998,61 @@ qt5_add_resources(LAUNCHER_RESOURCES
######## Windows resource files ########
if(WIN32)
set(LAUNCHER_RCS ../${Launcher_Branding_WindowsRC})
set(LAUNCHER_RCS ${CMAKE_CURRENT_BINARY_DIR}/../${Launcher_Branding_WindowsRC})
endif()
# Add executable
add_library(Launcher_logic STATIC ${LOGIC_SOURCES} ${LAUNCHER_SOURCES} ${LAUNCHER_UI} ${LAUNCHER_RESOURCES})
target_include_directories(Launcher_logic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(Launcher_logic
systeminfo
Launcher_quazip
Launcher_classparser
${NBT_NAME}
Launcher_murmur2
nbt++
${ZLIB_LIBRARIES}
optional-bare
tomlc99
tomlplusplus::tomlplusplus
BuildConfig
Katabasis
Qt${QT_VERSION_MAJOR}::Widgets
ghcFilesystem::ghc_filesystem
)
if (UNIX AND NOT CYGWIN AND NOT APPLE)
target_link_libraries(Launcher_logic
gamemode
)
endif()
target_link_libraries(Launcher_logic
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Xml
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
${Launcher_QT_LIBS}
)
target_link_libraries(Launcher_logic
Qt5::Core
Qt5::Xml
Qt5::Network
Qt5::Concurrent
Qt5::Gui
)
target_link_libraries(Launcher_logic
Launcher_iconfix
${QUAZIP_LIBRARIES}
QuaZip::QuaZip
hoedown
Launcher_rainbow
LocalPeer
Launcher_rainbow
)
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks/")
file(DOWNLOAD ${MACOSX_SPARKLE_DOWNLOAD_URL} ${CMAKE_BINARY_DIR}/Sparkle.tar.xz EXPECTED_HASH SHA256=${MACOSX_SPARKLE_SHA256})
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/Sparkle.tar.xz DESTINATION ${CMAKE_BINARY_DIR}/frameworks/Sparkle)
find_library(SPARKLE_FRAMEWORK Sparkle "${CMAKE_BINARY_DIR}/frameworks/Sparkle")
target_link_libraries(Launcher_logic
"-framework AppKit"
"-framework Carbon"
"-framework Foundation"
"-framework ApplicationServices"
)
target_link_libraries(Launcher_logic ${SPARKLE_FRAMEWORK})
endif()
target_link_libraries(Launcher_logic)
@ -950,11 +1072,19 @@ if(DEFINED Launcher_APP_BINARY_DEFS)
endif()
install(TARGETS ${Launcher_Name}
BUNDLE DESTINATION ${BUNDLE_DEST_DIR} COMPONENT Runtime
BUNDLE DESTINATION "." COMPONENT Runtime
LIBRARY DESTINATION ${LIBRARY_DEST_DIR} COMPONENT Runtime
RUNTIME DESTINATION ${BINARY_DEST_DIR} COMPONENT Runtime
FRAMEWORK DESTINATION ${FRAMEWORK_DEST_DIR} COMPONENT Runtime
)
if (UNIX AND APPLE)
# Add Sparkle updater
# It has to be copied here instead of just allowing fixup_bundle to install it, otherwise essential parts of
# the framework aren't installed
install(DIRECTORY ${MACOSX_SPARKLE_DIR}/Sparkle.framework DESTINATION ${FRAMEWORK_DEST_DIR} USE_SOURCE_PERMISSIONS)
endif()
#### The bundle mess! ####
# Bundle utilities are used to complete the portable packages - they add all the libraries that would otherwise be missing on the target system.
# NOTE: it seems that this absolutely has to be here, and nowhere else.
@ -965,78 +1095,99 @@ if(INSTALL_BUNDLE STREQUAL "full")
COMPONENT Runtime
)
# Bundle plugins
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
# Image formats
# Image formats
install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
CONFIGURATIONS Debug RelWithDebInfo ""
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "tga|tiff|mng" EXCLUDE
)
install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
CONFIGURATIONS Release MinSizeRel
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "tga|tiff|mng" EXCLUDE
REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
)
# Icon engines
install(
DIRECTORY "${QT_PLUGINS_DIR}/iconengines"
CONFIGURATIONS Debug RelWithDebInfo ""
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "fontawesome" EXCLUDE
)
install(
DIRECTORY "${QT_PLUGINS_DIR}/iconengines"
CONFIGURATIONS Release MinSizeRel
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "fontawesome" EXCLUDE
REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
)
# Platform plugins
install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms"
CONFIGURATIONS Debug RelWithDebInfo ""
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "minimal|linuxfb|offscreen" EXCLUDE
)
install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms"
CONFIGURATIONS Release MinSizeRel
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "minimal|linuxfb|offscreen" EXCLUDE
REGEX "[^2]d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
)
# Style plugins
if(EXISTS "${QT_PLUGINS_DIR}/styles")
install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
DIRECTORY "${QT_PLUGINS_DIR}/styles"
CONFIGURATIONS Debug RelWithDebInfo ""
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "tga|tiff|mng|webp" EXCLUDE
)
# Icon engines
install(
DIRECTORY "${QT_PLUGINS_DIR}/iconengines"
DIRECTORY "${QT_PLUGINS_DIR}/styles"
CONFIGURATIONS Release MinSizeRel
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "fontawesome" EXCLUDE
)
# Platform plugins
install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms"
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "minimal|linuxfb|offscreen" EXCLUDE
)
# Style plugins
if(EXISTS "${QT_PLUGINS_DIR}/styles")
install(
DIRECTORY "${QT_PLUGINS_DIR}/styles"
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
)
endif()
else()
# Image formats
install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "tga|tiff|mng|webp" EXCLUDE
REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
)
# Icon engines
endif()
# TLS plugins (Qt 6 only)
if(EXISTS "${QT_PLUGINS_DIR}/tls")
install(
DIRECTORY "${QT_PLUGINS_DIR}/iconengines"
DIRECTORY "${QT_PLUGINS_DIR}/tls"
CONFIGURATIONS Debug RelWithDebInfo ""
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "fontawesome" EXCLUDE
REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
PATTERN "*qopensslbackend*" EXCLUDE
PATTERN "*qcertonlybackend*" EXCLUDE
)
# Platform plugins
install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms"
DIRECTORY "${QT_PLUGINS_DIR}/tls"
CONFIGURATIONS Release MinSizeRel
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "minimal|linuxfb|offscreen" EXCLUDE
REGEX "d\\." EXCLUDE
REGEX "dd\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
PATTERN "*qopensslbackend*" EXCLUDE
PATTERN "*qcertonlybackend*" EXCLUDE
)
# Style plugins
if(EXISTS "${QT_PLUGINS_DIR}/styles")
install(
DIRECTORY "${QT_PLUGINS_DIR}/styles"
DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime
REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE
REGEX "\\.dSYM" EXCLUDE
)
endif()
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in"

View File

@ -1,18 +1,38 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* Authors: Orochimarufan <orochimarufan.x3@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* http://www.apache.org/licenses/LICENSE-2.0
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Authors: Orochimarufan <orochimarufan.x3@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Commandline.h"
@ -47,7 +67,7 @@ QStringList splitArgs(QString args)
if (cchar == '\\')
escape = true;
else if (cchar == inquotes)
inquotes = 0;
inquotes = QChar::Null;
else
current += cchar;
// otherwise
@ -72,412 +92,4 @@ QStringList splitArgs(QString args)
argv << current;
return argv;
}
Parser::Parser(FlagStyle::Enum flagStyle, ArgumentStyle::Enum argStyle)
{
m_flagStyle = flagStyle;
m_argStyle = argStyle;
}
// styles setter/getter
void Parser::setArgumentStyle(ArgumentStyle::Enum style)
{
m_argStyle = style;
}
ArgumentStyle::Enum Parser::argumentStyle()
{
return m_argStyle;
}
void Parser::setFlagStyle(FlagStyle::Enum style)
{
m_flagStyle = style;
}
FlagStyle::Enum Parser::flagStyle()
{
return m_flagStyle;
}
// setup methods
void Parser::addSwitch(QString name, bool def)
{
if (m_params.contains(name))
throw "Name not unique";
OptionDef *param = new OptionDef;
param->type = otSwitch;
param->name = name;
param->metavar = QString("<%1>").arg(name);
param->def = def;
m_options[name] = param;
m_params[name] = (CommonDef *)param;
m_optionList.append(param);
}
void Parser::addOption(QString name, QVariant def)
{
if (m_params.contains(name))
throw "Name not unique";
OptionDef *param = new OptionDef;
param->type = otOption;
param->name = name;
param->metavar = QString("<%1>").arg(name);
param->def = def;
m_options[name] = param;
m_params[name] = (CommonDef *)param;
m_optionList.append(param);
}
void Parser::addArgument(QString name, bool required, QVariant def)
{
if (m_params.contains(name))
throw "Name not unique";
PositionalDef *param = new PositionalDef;
param->name = name;
param->def = def;
param->required = required;
param->metavar = name;
m_positionals.append(param);
m_params[name] = (CommonDef *)param;
}
void Parser::addDocumentation(QString name, QString doc, QString metavar)
{
if (!m_params.contains(name))
throw "Name does not exist";
CommonDef *param = m_params[name];
param->doc = doc;
if (!metavar.isNull())
param->metavar = metavar;
}
void Parser::addShortOpt(QString name, QChar flag)
{
if (!m_params.contains(name))
throw "Name does not exist";
if (!m_options.contains(name))
throw "Name is not an Option or Swtich";
OptionDef *param = m_options[name];
m_flags[flag] = param;
param->flag = flag;
}
// help methods
QString Parser::compileHelp(QString progName, int helpIndent, bool useFlags)
{
QStringList help;
help << compileUsage(progName, useFlags) << "\r\n";
// positionals
if (!m_positionals.isEmpty())
{
help << "\r\n";
help << "Positional arguments:\r\n";
QListIterator<PositionalDef *> it2(m_positionals);
while (it2.hasNext())
{
PositionalDef *param = it2.next();
help << " " << param->metavar;
help << " " << QString(helpIndent - param->metavar.length() - 1, ' ');
help << param->doc << "\r\n";
}
}
// Options
if (!m_optionList.isEmpty())
{
help << "\r\n";
QString optPrefix, flagPrefix;
getPrefix(optPrefix, flagPrefix);
help << "Options & Switches:\r\n";
QListIterator<OptionDef *> it(m_optionList);
while (it.hasNext())
{
OptionDef *option = it.next();
help << " ";
int nameLength = optPrefix.length() + option->name.length();
if (!option->flag.isNull())
{
nameLength += 3 + flagPrefix.length();
help << flagPrefix << option->flag << ", ";
}
help << optPrefix << option->name;
if (option->type == otOption)
{
QString arg = QString("%1%2").arg(
((m_argStyle == ArgumentStyle::Equals) ? "=" : " "), option->metavar);
nameLength += arg.length();
help << arg;
}
help << " " << QString(helpIndent - nameLength - 1, ' ');
help << option->doc << "\r\n";
}
}
return help.join("");
}
QString Parser::compileUsage(QString progName, bool useFlags)
{
QStringList usage;
usage << "Usage: " << progName;
QString optPrefix, flagPrefix;
getPrefix(optPrefix, flagPrefix);
// options
QListIterator<OptionDef *> it(m_optionList);
while (it.hasNext())
{
OptionDef *option = it.next();
usage << " [";
if (!option->flag.isNull() && useFlags)
usage << flagPrefix << option->flag;
else
usage << optPrefix << option->name;
if (option->type == otOption)
usage << ((m_argStyle == ArgumentStyle::Equals) ? "=" : " ") << option->metavar;
usage << "]";
}
// arguments
QListIterator<PositionalDef *> it2(m_positionals);
while (it2.hasNext())
{
PositionalDef *param = it2.next();
usage << " " << (param->required ? "<" : "[");
usage << param->metavar;
usage << (param->required ? ">" : "]");
}
return usage.join("");
}
// parsing
QHash<QString, QVariant> Parser::parse(QStringList argv)
{
QHash<QString, QVariant> map;
QStringListIterator it(argv);
QString programName = it.next();
QString optionPrefix;
QString flagPrefix;
QListIterator<PositionalDef *> positionals(m_positionals);
QStringList expecting;
getPrefix(optionPrefix, flagPrefix);
while (it.hasNext())
{
QString arg = it.next();
if (!expecting.isEmpty())
// we were expecting an argument
{
QString name = expecting.first();
/*
if (map.contains(name))
throw ParsingError(
QString("Option %2%1 was given multiple times").arg(name, optionPrefix));
*/
map[name] = QVariant(arg);
expecting.removeFirst();
continue;
}
if (arg.startsWith(optionPrefix))
// we have an option
{
// qDebug("Found option %s", qPrintable(arg));
QString name = arg.mid(optionPrefix.length());
QString equals;
if ((m_argStyle == ArgumentStyle::Equals ||
m_argStyle == ArgumentStyle::SpaceAndEquals) &&
name.contains("="))
{
int i = name.indexOf("=");
equals = name.mid(i + 1);
name = name.left(i);
}
if (m_options.contains(name))
{
/*
if (map.contains(name))
throw ParsingError(QString("Option %2%1 was given multiple times")
.arg(name, optionPrefix));
*/
OptionDef *option = m_options[name];
if (option->type == otSwitch)
map[name] = true;
else // if (option->type == otOption)
{
if (m_argStyle == ArgumentStyle::Space)
expecting.append(name);
else if (!equals.isNull())
map[name] = equals;
else if (m_argStyle == ArgumentStyle::SpaceAndEquals)
expecting.append(name);
else
throw ParsingError(QString("Option %2%1 reqires an argument.")
.arg(name, optionPrefix));
}
continue;
}
throw ParsingError(QString("Unknown Option %2%1").arg(name, optionPrefix));
}
if (arg.startsWith(flagPrefix))
// we have (a) flag(s)
{
// qDebug("Found flags %s", qPrintable(arg));
QString flags = arg.mid(flagPrefix.length());
QString equals;
if ((m_argStyle == ArgumentStyle::Equals ||
m_argStyle == ArgumentStyle::SpaceAndEquals) &&
flags.contains("="))
{
int i = flags.indexOf("=");
equals = flags.mid(i + 1);
flags = flags.left(i);
}
for (int i = 0; i < flags.length(); i++)
{
QChar flag = flags.at(i);
if (!m_flags.contains(flag))
throw ParsingError(QString("Unknown flag %2%1").arg(flag, flagPrefix));
OptionDef *option = m_flags[flag];
/*
if (map.contains(option->name))
throw ParsingError(QString("Option %2%1 was given multiple times")
.arg(option->name, optionPrefix));
*/
if (option->type == otSwitch)
map[option->name] = true;
else // if (option->type == otOption)
{
if (m_argStyle == ArgumentStyle::Space)
expecting.append(option->name);
else if (!equals.isNull())
if (i == flags.length() - 1)
map[option->name] = equals;
else
throw ParsingError(QString("Flag %4%2 of Argument-requiring Option "
"%1 not last flag in %4%3")
.arg(option->name, flag, flags, flagPrefix));
else if (m_argStyle == ArgumentStyle::SpaceAndEquals)
expecting.append(option->name);
else
throw ParsingError(QString("Option %1 reqires an argument. (flag %3%2)")
.arg(option->name, flag, flagPrefix));
}
}
continue;
}
// must be a positional argument
if (!positionals.hasNext())
throw ParsingError(QString("Don't know what to do with '%1'").arg(arg));
PositionalDef *param = positionals.next();
map[param->name] = arg;
}
// check if we're missing something
if (!expecting.isEmpty())
throw ParsingError(QString("Was still expecting arguments for %2%1").arg(
expecting.join(QString(", ") + optionPrefix), optionPrefix));
while (positionals.hasNext())
{
PositionalDef *param = positionals.next();
if (param->required)
throw ParsingError(
QString("Missing required positional argument '%1'").arg(param->name));
else
map[param->name] = param->def;
}
// fill out gaps
QListIterator<OptionDef *> iter(m_optionList);
while (iter.hasNext())
{
OptionDef *option = iter.next();
if (!map.contains(option->name))
map[option->name] = option->def;
}
return map;
}
// clear defs
void Parser::clear()
{
m_flags.clear();
m_params.clear();
m_options.clear();
QMutableListIterator<OptionDef *> it(m_optionList);
while (it.hasNext())
{
OptionDef *option = it.next();
it.remove();
delete option;
}
QMutableListIterator<PositionalDef *> it2(m_positionals);
while (it2.hasNext())
{
PositionalDef *arg = it2.next();
it2.remove();
delete arg;
}
}
// Destructor
Parser::~Parser()
{
clear();
}
// getPrefix
void Parser::getPrefix(QString &opt, QString &flag)
{
if (m_flagStyle == FlagStyle::Windows)
opt = flag = "/";
else if (m_flagStyle == FlagStyle::Unix)
opt = flag = "-";
// else if (m_flagStyle == FlagStyle::GNU)
else
{
opt = "--";
flag = "-";
}
}
// ParsingError
ParsingError::ParsingError(const QString &what) : std::runtime_error(what.toStdString())
{
}
}

View File

@ -17,12 +17,7 @@
#pragma once
#include <exception>
#include <stdexcept>
#include <QString>
#include <QVariant>
#include <QHash>
#include <QStringList>
/**
@ -39,212 +34,4 @@ namespace Commandline
* @return a QStringList containing all arguments
*/
QStringList splitArgs(QString args);
/**
* @brief The FlagStyle enum
* Specifies how flags are decorated
*/
namespace FlagStyle
{
enum Enum
{
GNU, /**< --option and -o (GNU Style) */
Unix, /**< -option and -o (Unix Style) */
Windows, /**< /option and /o (Windows Style) */
#ifdef Q_OS_WIN32
Default = Windows
#else
Default = GNU
#endif
};
}
/**
* @brief The ArgumentStyle enum
*/
namespace ArgumentStyle
{
enum Enum
{
Space, /**< --option value */
Equals, /**< --option=value */
SpaceAndEquals, /**< --option[= ]value */
#ifdef Q_OS_WIN32
Default = Equals
#else
Default = SpaceAndEquals
#endif
};
}
/**
* @brief The ParsingError class
*/
class ParsingError : public std::runtime_error
{
public:
ParsingError(const QString &what);
};
/**
* @brief The Parser class
*/
class Parser
{
public:
/**
* @brief Parser constructor
* @param flagStyle the FlagStyle to use in this Parser
* @param argStyle the ArgumentStyle to use in this Parser
*/
Parser(FlagStyle::Enum flagStyle = FlagStyle::Default,
ArgumentStyle::Enum argStyle = ArgumentStyle::Default);
/**
* @brief set the flag style
* @param style
*/
void setFlagStyle(FlagStyle::Enum style);
/**
* @brief get the flag style
* @return
*/
FlagStyle::Enum flagStyle();
/**
* @brief set the argument style
* @param style
*/
void setArgumentStyle(ArgumentStyle::Enum style);
/**
* @brief get the argument style
* @return
*/
ArgumentStyle::Enum argumentStyle();
/**
* @brief define a boolean switch
* @param name the parameter name
* @param def the default value
*/
void addSwitch(QString name, bool def = false);
/**
* @brief define an option that takes an additional argument
* @param name the parameter name
* @param def the default value
*/
void addOption(QString name, QVariant def = QVariant());
/**
* @brief define a positional argument
* @param name the parameter name
* @param required wether this argument is required
* @param def the default value
*/
void addArgument(QString name, bool required = true, QVariant def = QVariant());
/**
* @brief adds a flag to an existing parameter
* @param name the (existing) parameter name
* @param flag the flag character
* @see addSwitch addArgument addOption
* Note: any one parameter can only have one flag
*/
void addShortOpt(QString name, QChar flag);
/**
* @brief adds documentation to a Parameter
* @param name the parameter name
* @param metavar a string to be displayed as placeholder for the value
* @param doc a QString containing the documentation
* Note: on positional arguments, metavar replaces the name as displayed.
* on options , metavar replaces the value placeholder
*/
void addDocumentation(QString name, QString doc, QString metavar = QString());
/**
* @brief generate a help message
* @param progName the program name to use in the help message
* @param helpIndent how much the parameter documentation should be indented
* @param flagsInUsage whether we should use flags instead of options in the usage
* @return a help message
*/
QString compileHelp(QString progName, int helpIndent = 22, bool flagsInUsage = true);
/**
* @brief generate a short usage message
* @param progName the program name to use in the usage message
* @param useFlags whether we should use flags instead of options
* @return a usage message
*/
QString compileUsage(QString progName, bool useFlags = true);
/**
* @brief parse
* @param argv a QStringList containing the program ARGV
* @return a QHash mapping argument names to their values
*/
QHash<QString, QVariant> parse(QStringList argv);
/**
* @brief clear all definitions
*/
void clear();
~Parser();
private:
FlagStyle::Enum m_flagStyle;
ArgumentStyle::Enum m_argStyle;
enum OptionType
{
otSwitch,
otOption
};
// Important: the common part MUST BE COMMON ON ALL THREE structs
struct CommonDef
{
QString name;
QString doc;
QString metavar;
QVariant def;
};
struct OptionDef
{
// common
QString name;
QString doc;
QString metavar;
QVariant def;
// option
OptionType type;
QChar flag;
};
struct PositionalDef
{
// common
QString name;
QString doc;
QString metavar;
QVariant def;
// positional
bool required;
};
QHash<QString, OptionDef *> m_options;
QHash<QChar, OptionDef *> m_flags;
QHash<QString, CommonDef *> m_params;
QList<PositionalDef *> m_positionals;
QList<OptionDef *> m_optionList;
void getPrefix(QString &opt, QString &flag);
};
}

View File

@ -0,0 +1,96 @@
// SPDX-FileCopyrightText: 2022 Sefa Eyeoglu <contact@scrumplex.net>
//
// SPDX-License-Identifier: GPL-3.0-only
#include "DataMigrationTask.h"
#include "FileSystem.h"
#include <QDirIterator>
#include <QFileInfo>
#include <QMap>
#include <QtConcurrent>
DataMigrationTask::DataMigrationTask(QObject* parent,
const QString& sourcePath,
const QString& targetPath,
const IPathMatcher::Ptr pathMatcher)
: Task(parent), m_sourcePath(sourcePath), m_targetPath(targetPath), m_pathMatcher(pathMatcher), m_copy(sourcePath, targetPath)
{
m_copy.matcher(m_pathMatcher.get()).whitelist(true);
}
void DataMigrationTask::executeTask()
{
setStatus(tr("Scanning files..."));
// 1. Scan
// Check how many files we gotta copy
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [&] {
return m_copy(true); // dry run to collect amount of files
});
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &DataMigrationTask::dryRunFinished);
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &DataMigrationTask::dryRunAborted);
m_copyFutureWatcher.setFuture(m_copyFuture);
}
void DataMigrationTask::dryRunFinished()
{
disconnect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &DataMigrationTask::dryRunFinished);
disconnect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &DataMigrationTask::dryRunAborted);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
if (!m_copyFuture.isValid() || !m_copyFuture.result()) {
#else
if (!m_copyFuture.result()) {
#endif
emitFailed(tr("Failed to scan source path."));
return;
}
// 2. Copy
// Actually copy all files now.
m_toCopy = m_copy.totalCopied();
connect(&m_copy, &FS::copy::fileCopied, [&, this](const QString& relativeName) {
QString shortenedName = relativeName;
// shorten the filename to hopefully fit into one line
if (shortenedName.length() > 50)
shortenedName = relativeName.left(20) + "" + relativeName.right(29);
setProgress(m_copy.totalCopied(), m_toCopy);
setStatus(tr("Copying %1…").arg(shortenedName));
});
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [&] {
return m_copy(false); // actually copy now
});
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &DataMigrationTask::copyFinished);
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &DataMigrationTask::copyAborted);
m_copyFutureWatcher.setFuture(m_copyFuture);
}
void DataMigrationTask::dryRunAborted()
{
emitFailed(tr("Aborted"));
}
void DataMigrationTask::copyFinished()
{
disconnect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &DataMigrationTask::copyFinished);
disconnect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &DataMigrationTask::copyAborted);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
if (!m_copyFuture.isValid() || !m_copyFuture.result()) {
#else
if (!m_copyFuture.result()) {
#endif
emitFailed(tr("Some paths could not be copied!"));
return;
}
emitSucceeded();
}
void DataMigrationTask::copyAborted()
{
emitFailed(tr("Aborted"));
}

View File

@ -0,0 +1,42 @@
// SPDX-FileCopyrightText: 2022 Sefa Eyeoglu <contact@scrumplex.net>
//
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include "FileSystem.h"
#include "pathmatcher/IPathMatcher.h"
#include "tasks/Task.h"
#include <QFuture>
#include <QFutureWatcher>
/*
* Migrate existing data from other MMC-like launchers.
*/
class DataMigrationTask : public Task {
Q_OBJECT
public:
explicit DataMigrationTask(QObject* parent, const QString& sourcePath, const QString& targetPath, const IPathMatcher::Ptr pathmatcher);
~DataMigrationTask() override = default;
protected:
virtual void executeTask() override;
protected slots:
void dryRunFinished();
void dryRunAborted();
void copyFinished();
void copyAborted();
private:
const QString& m_sourcePath;
const QString& m_targetPath;
const IPathMatcher::Ptr m_pathMatcher;
FS::copy m_copy;
int m_toCopy = 0;
QFuture<bool> m_copyFuture;
QFutureWatcher<bool> m_copyFutureWatcher;
};

View File

@ -1,13 +1,48 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 dada513 <dada513@protonmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2022 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "DesktopServices.h"
#include <QDir>
#include <QDesktopServices>
#include <QProcess>
#include <QDebug>
#include "Application.h"
/**
* This shouldn't exist, but until QTBUG-9328 and other unreported bugs are fixed, it needs to be a thing.
*/
#if defined(Q_OS_LINUX)
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
#include <unistd.h>
#include <errno.h>
@ -83,8 +118,15 @@ bool openDirectory(const QString &path, bool ensureExists)
{
return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
};
#if defined(Q_OS_LINUX)
return IndirectOpen(f);
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
if(!isFlatpak())
{
return IndirectOpen(f);
}
else
{
return f();
}
#else
return f();
#endif
@ -97,8 +139,15 @@ bool openFile(const QString &path)
{
return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
};
#if defined(Q_OS_LINUX)
return IndirectOpen(f);
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
if(!isFlatpak())
{
return IndirectOpen(f);
}
else
{
return f();
}
#else
return f();
#endif
@ -107,12 +156,19 @@ bool openFile(const QString &path)
bool openFile(const QString &application, const QString &path, const QString &workingDirectory, qint64 *pid)
{
qDebug() << "Opening file" << path << "using" << application;
#if defined(Q_OS_LINUX)
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
return IndirectOpen([&]()
if(!isFlatpak())
{
return QProcess::startDetached(application, QStringList() << path, workingDirectory);
}, pid);
return IndirectOpen([&]()
{
return QProcess::startDetached(application, QStringList() << path, workingDirectory);
}, pid);
}
else
{
return QProcess::startDetached(application, QStringList() << path, workingDirectory, pid);
}
#else
return QProcess::startDetached(application, QStringList() << path, workingDirectory, pid);
#endif
@ -121,12 +177,19 @@ bool openFile(const QString &application, const QString &path, const QString &wo
bool run(const QString &application, const QStringList &args, const QString &workingDirectory, qint64 *pid)
{
qDebug() << "Running" << application << "with args" << args.join(' ');
#if defined(Q_OS_LINUX)
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
if(!isFlatpak())
{
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
return IndirectOpen([&]()
{
return QProcess::startDetached(application, args, workingDirectory);
}, pid);
}
else
{
return QProcess::startDetached(application, args, workingDirectory, pid);
}
#else
return QProcess::startDetached(application, args, workingDirectory, pid);
#endif
@ -139,11 +202,27 @@ bool openUrl(const QUrl &url)
{
return QDesktopServices::openUrl(url);
};
#if defined(Q_OS_LINUX)
return IndirectOpen(f);
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
if(!isFlatpak())
{
return IndirectOpen(f);
}
else
{
return f();
}
#else
return f();
#endif
}
bool isFlatpak()
{
#ifdef Q_OS_LINUX
return QFile::exists("/.flatpak-info");
#else
return false;
#endif
}
}

View File

@ -33,4 +33,6 @@ namespace DesktopServices
* Open the URL, most likely in a browser. Maybe.
*/
bool openUrl(const QUrl &url);
bool isFlatpak();
}

View File

@ -1,77 +1,123 @@
// Licensed under the Apache-2.0 license. See README.md for details.
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FileSystem.h"
#include <QDir>
#include <QFile>
#include <QSaveFile>
#include <QFileInfo>
#include <QDebug>
#include <QUrl>
#include <QDir>
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>
#include <QSaveFile>
#include <QStandardPaths>
#include <QTextStream>
#include <QUrl>
#include "DesktopServices.h"
#include "StringUtils.h"
#if defined Q_OS_WIN32
#include <windows.h>
#include <string>
#include <sys/utime.h>
#include <winnls.h>
#include <shobjidl.h>
#include <objbase.h>
#include <objidl.h>
#include <shlguid.h>
#include <shlobj.h>
#define WIN32_LEAN_AND_MEAN
#include <objbase.h>
#include <objidl.h>
#include <shlguid.h>
#include <shlobj.h>
#include <shobjidl.h>
#include <sys/utime.h>
#include <versionhelpers.h>
#include <windows.h>
#include <winnls.h>
#include <string>
#else
#include <utime.h>
#include <utime.h>
#endif
// Snippet from https://github.com/gulrak/filesystem#using-it-as-single-file-header
#ifdef __APPLE__
#include <Availability.h> // for deployment target to support pre-catalina targets without std::fs
#endif // __APPLE__
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include)
#if __has_include(<filesystem>) && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define GHC_USE_STD_FS
#include <filesystem>
namespace fs = std::filesystem;
#endif // MacOS min version check
#endif // Other OSes version check
#ifndef GHC_USE_STD_FS
#include <ghc/filesystem.hpp>
namespace fs = ghc::filesystem;
#endif
namespace FS {
void ensureExists(const QDir &dir)
void ensureExists(const QDir& dir)
{
if (!QDir().mkpath(dir.absolutePath()))
{
throw FileSystemException("Unable to create folder " + dir.dirName() + " (" +
dir.absolutePath() + ")");
if (!QDir().mkpath(dir.absolutePath())) {
throw FileSystemException("Unable to create folder " + dir.dirName() + " (" + dir.absolutePath() + ")");
}
}
void write(const QString &filename, const QByteArray &data)
void write(const QString& filename, const QByteArray& data)
{
ensureExists(QFileInfo(filename).dir());
QSaveFile file(filename);
if (!file.open(QSaveFile::WriteOnly))
{
throw FileSystemException("Couldn't open " + filename + " for writing: " +
file.errorString());
if (!file.open(QSaveFile::WriteOnly)) {
throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString());
}
if (data.size() != file.write(data))
{
throw FileSystemException("Error writing data to " + filename + ": " +
file.errorString());
if (data.size() != file.write(data)) {
throw FileSystemException("Error writing data to " + filename + ": " + file.errorString());
}
if (!file.commit())
{
throw FileSystemException("Error while committing data to " + filename + ": " +
file.errorString());
if (!file.commit()) {
throw FileSystemException("Error while committing data to " + filename + ": " + file.errorString());
}
}
QByteArray read(const QString &filename)
QByteArray read(const QString& filename)
{
QFile file(filename);
if (!file.open(QFile::ReadOnly))
{
throw FileSystemException("Unable to open " + filename + " for reading: " +
file.errorString());
if (!file.open(QFile::ReadOnly)) {
throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString());
}
const qint64 size = file.size();
QByteArray data(int(size), 0);
const qint64 ret = file.read(data.data(), size);
if (ret == -1 || ret != size)
{
throw FileSystemException("Error reading data from " + filename + ": " +
file.errorString());
if (ret == -1 || ret != size) {
throw FileSystemException("Error reading data from " + filename + ": " + file.errorString());
}
return data;
}
@ -105,149 +151,113 @@ bool ensureFolderPathExists(QString foldernamepath)
return success;
}
bool copy::operator()(const QString &offset)
/// @brief Copies a directory and it's contents from src to dest
/// @param offset subdirectory form src to copy to dest
/// @return if there was an error during the filecopy
bool copy::operator()(const QString& offset, bool dryRun)
{
//NOTE always deep copy on windows. the alternatives are too messy.
#if defined Q_OS_WIN32
using copy_opts = fs::copy_options;
m_copied = 0; // reset counter
// NOTE always deep copy on windows. the alternatives are too messy.
#if defined Q_OS_WIN32
m_followSymlinks = true;
#endif
#endif
auto src = PathCombine(m_src.absolutePath(), offset);
auto dst = PathCombine(m_dst.absolutePath(), offset);
QFileInfo currentSrc(src);
if (!currentSrc.exists())
return false;
std::error_code err;
if(!m_followSymlinks && currentSrc.isSymLink())
{
qDebug() << "creating symlink" << src << " - " << dst;
if (!ensureFilePathExists(dst))
{
qWarning() << "Cannot create path!";
return false;
fs::copy_options opt = copy_opts::none;
// The default behavior is to follow symlinks
if (!m_followSymlinks)
opt |= copy_opts::copy_symlinks;
// Function that'll do the actual copying
auto copy_file = [&](QString src_path, QString relative_dst_path) {
if (m_matcher && (m_matcher->matches(relative_dst_path) != m_whitelist))
return;
auto dst_path = PathCombine(dst, relative_dst_path);
if (!dryRun) {
ensureFilePathExists(dst_path);
fs::copy(StringUtils::toStdString(src_path), StringUtils::toStdString(dst_path), opt, err);
}
return QFile::link(currentSrc.symLinkTarget(), dst);
}
else if(currentSrc.isFile())
{
qDebug() << "copying file" << src << " - " << dst;
if (!ensureFilePathExists(dst))
{
qWarning() << "Cannot create path!";
return false;
if (err) {
qWarning() << "Failed to copy files:" << QString::fromStdString(err.message());
qDebug() << "Source file:" << src_path;
qDebug() << "Destination file:" << dst_path;
}
return QFile::copy(src, dst);
m_copied++;
emit fileCopied(relative_dst_path);
};
// We can't use copy_opts::recursive because we need to take into account the
// blacklisted paths, so we iterate over the source directory, and if there's no blacklist
// match, we copy the file.
QDir src_dir(src);
QDirIterator source_it(src, QDir::Filter::Files | QDir::Filter::Hidden, QDirIterator::Subdirectories);
while (source_it.hasNext()) {
auto src_path = source_it.next();
auto relative_path = src_dir.relativeFilePath(src_path);
copy_file(src_path, relative_path);
}
else if(currentSrc.isDir())
{
qDebug() << "recursing" << offset;
if (!ensureFolderPathExists(dst))
{
qWarning() << "Cannot create path!";
return false;
}
QDir currentDir(src);
for(auto & f : currentDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System))
{
auto inner_offset = PathCombine(offset, f);
// ignore and skip stuff that matches the blacklist.
if(m_blacklist && m_blacklist->matches(inner_offset))
{
continue;
}
if(!operator()(inner_offset))
{
qWarning() << "Failed to copy" << inner_offset;
return false;
}
}
}
else
{
qCritical() << "Copy ERROR: Unknown filesystem object:" << src;
return false;
}
return true;
// If the root src is not a directory, the previous iterator won't run.
if (!fs::is_directory(StringUtils::toStdString(src)))
copy_file(src, "");
return err.value() == 0;
}
bool deletePath(QString path)
{
bool OK = true;
QFileInfo finfo(path);
if(finfo.isFile()) {
return QFile::remove(path);
std::error_code err;
fs::remove_all(StringUtils::toStdString(path), err);
if (err) {
qWarning() << "Failed to remove files:" << QString::fromStdString(err.message());
}
QDir dir(path);
if (!dir.exists())
{
return OK;
}
auto allEntries = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden |
QDir::AllDirs | QDir::Files,
QDir::DirsFirst);
for(auto & info: allEntries)
{
#if defined Q_OS_WIN32
QString nativePath = QDir::toNativeSeparators(info.absoluteFilePath());
auto wString = nativePath.toStdWString();
DWORD dwAttrs = GetFileAttributesW(wString.c_str());
// Windows: check for junctions, reparse points and other nasty things of that sort
if(dwAttrs & FILE_ATTRIBUTE_REPARSE_POINT)
{
if (info.isFile())
{
OK &= QFile::remove(info.absoluteFilePath());
}
else if (info.isDir())
{
OK &= dir.rmdir(info.absoluteFilePath());
}
}
#else
// We do not trust Qt with reparse points, but do trust it with unix symlinks.
if(info.isSymLink())
{
OK &= QFile::remove(info.absoluteFilePath());
}
#endif
else if (info.isDir())
{
OK &= deletePath(info.absoluteFilePath());
}
else if (info.isFile())
{
OK &= QFile::remove(info.absoluteFilePath());
}
else
{
OK = false;
qCritical() << "Delete ERROR: Unknown filesystem object:" << info.absoluteFilePath();
}
}
OK &= dir.rmdir(dir.absolutePath());
return OK;
return err.value() == 0;
}
QString PathCombine(const QString & path1, const QString & path2)
bool trash(QString path, QString *pathInTrash = nullptr)
{
if(!path1.size())
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return false;
#else
// FIXME: Figure out trash in Flatpak. Qt seemingly doesn't use the Trash portal
if (DesktopServices::isFlatpak())
return false;
#if defined Q_OS_WIN32
if (IsWindowsServer())
return false;
#endif
return QFile::moveToTrash(path, pathInTrash);
#endif
}
QString PathCombine(const QString& path1, const QString& path2)
{
if (!path1.size())
return path2;
if(!path2.size())
if (!path2.size())
return path1;
return QDir::cleanPath(path1 + QDir::separator() + path2);
}
QString PathCombine(const QString & path1, const QString & path2, const QString & path3)
QString PathCombine(const QString& path1, const QString& path2, const QString& path3)
{
return PathCombine(PathCombine(path1, path2), path3);
}
QString PathCombine(const QString & path1, const QString & path2, const QString & path3, const QString & path4)
QString PathCombine(const QString& path1, const QString& path2, const QString& path3, const QString& path4)
{
return PathCombine(PathCombine(path1, path2, path3), path4);
}
@ -259,17 +269,14 @@ QString AbsolutePath(QString path)
QString ResolveExecutable(QString path)
{
if (path.isEmpty())
{
if (path.isEmpty()) {
return QString();
}
if(!path.contains('/'))
{
if (!path.contains('/')) {
path = QStandardPaths::findExecutable(path);
}
QFileInfo pathInfo(path);
if(!pathInfo.exists() || !pathInfo.isExecutable())
{
if (!pathInfo.exists() || !pathInfo.isExecutable()) {
return QString();
}
return pathInfo.absoluteFilePath();
@ -289,12 +296,9 @@ QString NormalizePath(QString path)
QDir b(path);
QString newAbsolute = b.absolutePath();
if (newAbsolute.startsWith(currentAbsolute))
{
if (newAbsolute.startsWith(currentAbsolute)) {
return a.relativeFilePath(newAbsolute);
}
else
{
} else {
return newAbsolute;
}
}
@ -303,10 +307,8 @@ QString badFilenameChars = "\"\\/?<>:;*|!+\r\n";
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
{
for (int i = 0; i < string.length(); i++)
{
if (badFilenameChars.contains(string[i]))
{
for (int i = 0; i < string.length(); i++) {
if (badFilenameChars.contains(string[i])) {
string[i] = replaceWith;
}
}
@ -318,15 +320,11 @@ QString DirNameFromString(QString string, QString inDir)
int num = 0;
QString baseName = RemoveInvalidFilenameChars(string, '-');
QString dirName;
do
{
if(num == 0)
{
do {
if (num == 0) {
dirName = baseName;
}
else
{
dirName = baseName + QString::number(num);;
} else {
dirName = baseName + "(" + QString::number(num) + ")";
}
// If it's over 9000
@ -345,68 +343,41 @@ bool checkProblemticPathJava(QDir folder)
return pathfoldername.contains("!", Qt::CaseInsensitive);
}
// Win32 crap
#if defined Q_OS_WIN
bool called_coinit = false;
HRESULT CreateLink(LPCSTR linkPath, LPCSTR targetPath, LPCSTR args)
{
HRESULT hres;
if (!called_coinit)
{
hres = CoInitialize(NULL);
called_coinit = true;
if (!SUCCEEDED(hres))
{
qWarning("Failed to initialize COM. Error 0x%08lX", hres);
return hres;
}
}
IShellLink *link;
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
(LPVOID *)&link);
if (SUCCEEDED(hres))
{
IPersistFile *persistFile;
link->SetPath(targetPath);
link->SetArguments(args);
hres = link->QueryInterface(IID_IPersistFile, (LPVOID *)&persistFile);
if (SUCCEEDED(hres))
{
WCHAR wstr[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, linkPath, -1, wstr, MAX_PATH);
hres = persistFile->Save(wstr, TRUE);
persistFile->Release();
}
link->Release();
}
return hres;
}
#endif
QString getDesktopDir()
{
return QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
}
// Cross-platform Shortcut creation
bool createShortCut(QString location, QString dest, QStringList args, QString name,
QString icon)
bool createShortcut(QString destination, QString target, QStringList args, QString name, QString icon)
{
#if defined Q_OS_LINUX
location = PathCombine(location, name + ".desktop");
#if defined(Q_OS_MACOS)
destination += ".command";
QFile f(location);
QFile f(destination);
f.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream stream(&f);
QString argstring;
if (!args.empty())
argstring = " \"" + args.join("\" \"") + "\"";
stream << "#!/bin/bash"
<< "\n";
stream << "\""
<< target
<< "\" "
<< argstring
<< "\n";
stream.flush();
f.close();
f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup | QFileDevice::ExeOther);
return true;
#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
QFile f(destination);
f.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream stream(&f);
@ -418,40 +389,170 @@ bool createShortCut(QString location, QString dest, QStringList args, QString na
<< "\n";
stream << "Type=Application"
<< "\n";
stream << "TryExec=" << dest.toLocal8Bit() << "\n";
stream << "Exec=" << dest.toLocal8Bit() << argstring.toLocal8Bit() << "\n";
stream << "Exec=\"" << target.toLocal8Bit() << "\"" << argstring.toLocal8Bit() << "\n";
stream << "Name=" << name.toLocal8Bit() << "\n";
stream << "Icon=" << icon.toLocal8Bit() << "\n";
if (!icon.isEmpty())
{
stream << "Icon=" << icon.toLocal8Bit() << "\n";
}
stream.flush();
f.close();
f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup |
QFileDevice::ExeOther);
f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup | QFileDevice::ExeOther);
return true;
#elif defined Q_OS_WIN
// TODO: Fix
// QFile file(PathCombine(location, name + ".lnk"));
// WCHAR *file_w;
// WCHAR *dest_w;
// WCHAR *args_w;
// file.fileName().toWCharArray(file_w);
// dest.toWCharArray(dest_w);
#elif defined(Q_OS_WIN)
QFileInfo targetInfo(target);
// QString argStr;
// for (int i = 0; i < args.count(); i++)
// {
// argStr.append(args[i]);
// argStr.append(" ");
// }
// argStr.toWCharArray(args_w);
if (!targetInfo.exists())
{
qWarning() << "Target file does not exist!";
return false;
}
// return SUCCEEDED(CreateLink(file_w, dest_w, args_w));
return false;
target = targetInfo.absoluteFilePath();
if (target.length() >= MAX_PATH)
{
qWarning() << "Target file path is too long!";
return false;
}
if (!icon.isEmpty() && icon.length() >= MAX_PATH)
{
qWarning() << "Icon path is too long!";
return false;
}
destination += ".lnk";
if (destination.length() >= MAX_PATH)
{
qWarning() << "Destination path is too long!";
return false;
}
QString argStr;
int argCount = args.count();
for (int i = 0; i < argCount; i++)
{
if (args[i].contains(' '))
{
argStr.append('"').append(args[i]).append('"');
}
else
{
argStr.append(args[i]);
}
if (i < argCount - 1)
{
argStr.append(" ");
}
}
if (argStr.length() >= MAX_PATH)
{
qWarning() << "Arguments string is too long!";
return false;
}
HRESULT hres;
// ...yes, you need to initialize the entire COM stack just to make a shortcut
hres = CoInitialize(nullptr);
if (FAILED(hres))
{
qWarning() << "Failed to initialize COM!";
return false;
}
WCHAR wsz[MAX_PATH];
IShellLink* psl;
// create an IShellLink instance - this stores the shortcut's attributes
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl);
if (SUCCEEDED(hres))
{
wmemset(wsz, 0, MAX_PATH);
target.toWCharArray(wsz);
psl->SetPath(wsz);
wmemset(wsz, 0, MAX_PATH);
argStr.toWCharArray(wsz);
psl->SetArguments(wsz);
wmemset(wsz, 0, MAX_PATH);
targetInfo.absolutePath().toWCharArray(wsz);
psl->SetWorkingDirectory(wsz); // "Starts in" attribute
if (!icon.isEmpty())
{
wmemset(wsz, 0, MAX_PATH);
icon.toWCharArray(wsz);
psl->SetIconLocation(wsz, 0);
}
// query an IPersistFile interface from our IShellLink instance
// this is the interface that will actually let us save the shortcut to disk!
IPersistFile* ppf;
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if (SUCCEEDED(hres))
{
wmemset(wsz, 0, MAX_PATH);
destination.toWCharArray(wsz);
hres = ppf->Save(wsz, TRUE);
if (FAILED(hres))
{
qWarning() << "IPresistFile->Save() failed";
qWarning() << "hres = " << hres;
}
ppf->Release();
}
else
{
qWarning() << "Failed to query IPersistFile interface from IShellLink instance";
qWarning() << "hres = " << hres;
}
psl->Release();
}
else
{
qWarning() << "Failed to create IShellLink instance";
qWarning() << "hres = " << hres;
}
// go away COM, nobody likes you
CoUninitialize();
return SUCCEEDED(hres);
#else
qWarning("Desktop Shortcuts not supported on your platform!");
return false;
#endif
}
bool overrideFolder(QString overwritten_path, QString override_path)
{
using copy_opts = fs::copy_options;
if (!FS::ensureFolderPathExists(overwritten_path))
return false;
std::error_code err;
fs::copy_options opt = copy_opts::recursive | copy_opts::overwrite_existing;
// FIXME: hello traveller! Apparently std::copy does NOT overwrite existing files on GNU libstdc++ on Windows?
fs::copy(StringUtils::toStdString(override_path), StringUtils::toStdString(overwritten_path), opt, err);
if (err) {
qCritical() << QString("Failed to apply override from %1 to %2").arg(override_path, overwritten_path);
qCritical() << "Reason:" << QString::fromStdString(err.message());
}
return err.value() == 0;
}
}

View File

@ -1,4 +1,37 @@
// Licensed under the Apache-2.0 license. See README.md for details.
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
@ -7,30 +40,29 @@
#include <QDir>
#include <QFlags>
#include <QObject>
namespace FS
{
namespace FS {
class FileSystemException : public ::Exception
{
public:
FileSystemException(const QString &message) : Exception(message) {}
class FileSystemException : public ::Exception {
public:
FileSystemException(const QString& message) : Exception(message) {}
};
/**
* write data to a file safely
*/
void write(const QString &filename, const QByteArray &data);
void write(const QString& filename, const QByteArray& data);
/**
* read data from a file safely\
*/
QByteArray read(const QString &filename);
QByteArray read(const QString& filename);
/**
* Update the last changed timestamp of an existing file
*/
bool updateTimestamp(const QString & filename);
bool updateTimestamp(const QString& filename);
/**
* Creates all the folders in a path for the specified path
@ -44,37 +76,49 @@ bool ensureFilePathExists(QString filenamepath);
*/
bool ensureFolderPathExists(QString filenamepath);
class copy
{
public:
copy(const QString & src, const QString & dst)
/// @brief Copies a directory and it's contents from src to dest
class copy : public QObject {
Q_OBJECT
public:
copy(const QString& src, const QString& dst, QObject* parent = nullptr) : QObject(parent)
{
m_src = src;
m_dst = dst;
m_src.setPath(src);
m_dst.setPath(dst);
}
copy & followSymlinks(const bool follow)
copy& followSymlinks(const bool follow)
{
m_followSymlinks = follow;
return *this;
}
copy & blacklist(const IPathMatcher * filter)
copy& matcher(const IPathMatcher* filter)
{
m_blacklist = filter;
m_matcher = filter;
return *this;
}
bool operator()()
copy& whitelist(bool whitelist)
{
return operator()(QString());
m_whitelist = whitelist;
return *this;
}
private:
bool operator()(const QString &offset);
bool operator()(bool dryRun = false) { return operator()(QString(), dryRun); }
private:
int totalCopied() { return m_copied; }
signals:
void fileCopied(const QString& relativeName);
// TODO: maybe add a "shouldCopy" signal in the future?
private:
bool operator()(const QString& offset, bool dryRun = false);
private:
bool m_followSymlinks = true;
const IPathMatcher * m_blacklist = nullptr;
const IPathMatcher* m_matcher = nullptr;
bool m_whitelist = false;
QDir m_src;
QDir m_dst;
int m_copied;
};
/**
@ -82,9 +126,14 @@ private:
*/
bool deletePath(QString path);
QString PathCombine(const QString &path1, const QString &path2);
QString PathCombine(const QString &path1, const QString &path2, const QString &path3);
QString PathCombine(const QString &path1, const QString &path2, const QString &path3, const QString &path4);
/**
* Trash a folder / file
*/
bool trash(QString path, QString *pathInTrash);
QString PathCombine(const QString& path1, const QString& path2);
QString PathCombine(const QString& path1, const QString& path2, const QString& path3);
QString PathCombine(const QString& path1, const QString& path2, const QString& path3, const QString& path4);
QString AbsolutePath(QString path);
@ -120,8 +169,12 @@ bool checkProblemticPathJava(QDir folder);
// Get the Directory representing the User's Desktop
QString getDesktopDir();
// Create a shortcut at *location*, pointing to *dest* called with the arguments *args*
// call it *name* and assign it the icon *icon*
// return true if operation succeeded
bool createShortCut(QString location, QString dest, QStringList args, QString name, QString iconLocation);
// Overrides one folder with the contents of another, preserving items exclusive to the first folder
// Equivalent to doing QDir::rename, but allowing for overrides
bool overrideFolder(QString overwritten_path, QString override_path);
/**
* Creates a shortcut to the specified target file at the specified destination path.
*/
bool createShortcut(QString destination, QString target, QStringList args, QString name, QString icon);
}

View File

@ -1,164 +0,0 @@
#include <QTest>
#include <QTemporaryDir>
#include <QStandardPaths>
#include "TestUtil.h"
#include "FileSystem.h"
class FileSystemTest : public QObject
{
Q_OBJECT
const QString bothSlash = "/foo/";
const QString trailingSlash = "foo/";
const QString leadingSlash = "/foo";
private
slots:
void test_pathCombine()
{
QCOMPARE(QString("/foo/foo"), FS::PathCombine(bothSlash, bothSlash));
QCOMPARE(QString("foo/foo"), FS::PathCombine(trailingSlash, trailingSlash));
QCOMPARE(QString("/foo/foo"), FS::PathCombine(leadingSlash, leadingSlash));
QCOMPARE(QString("/foo/foo/foo"), FS::PathCombine(bothSlash, bothSlash, bothSlash));
QCOMPARE(QString("foo/foo/foo"), FS::PathCombine(trailingSlash, trailingSlash, trailingSlash));
QCOMPARE(QString("/foo/foo/foo"), FS::PathCombine(leadingSlash, leadingSlash, leadingSlash));
}
void test_PathCombine1_data()
{
QTest::addColumn<QString>("result");
QTest::addColumn<QString>("path1");
QTest::addColumn<QString>("path2");
QTest::newRow("qt 1") << "/abc/def/ghi/jkl" << "/abc/def" << "ghi/jkl";
QTest::newRow("qt 2") << "/abc/def/ghi/jkl" << "/abc/def/" << "ghi/jkl";
#if defined(Q_OS_WIN)
QTest::newRow("win native, from C:") << "C:/abc" << "C:" << "abc";
QTest::newRow("win native 1") << "C:/abc/def/ghi/jkl" << "C:\\abc\\def" << "ghi\\jkl";
QTest::newRow("win native 2") << "C:/abc/def/ghi/jkl" << "C:\\abc\\def\\" << "ghi\\jkl";
#endif
}
void test_PathCombine1()
{
QFETCH(QString, result);
QFETCH(QString, path1);
QFETCH(QString, path2);
QCOMPARE(FS::PathCombine(path1, path2), result);
}
void test_PathCombine2_data()
{
QTest::addColumn<QString>("result");
QTest::addColumn<QString>("path1");
QTest::addColumn<QString>("path2");
QTest::addColumn<QString>("path3");
QTest::newRow("qt 1") << "/abc/def/ghi/jkl" << "/abc" << "def" << "ghi/jkl";
QTest::newRow("qt 2") << "/abc/def/ghi/jkl" << "/abc/" << "def" << "ghi/jkl";
QTest::newRow("qt 3") << "/abc/def/ghi/jkl" << "/abc" << "def/" << "ghi/jkl";
QTest::newRow("qt 4") << "/abc/def/ghi/jkl" << "/abc/" << "def/" << "ghi/jkl";
#if defined(Q_OS_WIN)
QTest::newRow("win 1") << "C:/abc/def/ghi/jkl" << "C:\\abc" << "def" << "ghi\\jkl";
QTest::newRow("win 2") << "C:/abc/def/ghi/jkl" << "C:\\abc\\" << "def" << "ghi\\jkl";
QTest::newRow("win 3") << "C:/abc/def/ghi/jkl" << "C:\\abc" << "def\\" << "ghi\\jkl";
QTest::newRow("win 4") << "C:/abc/def/ghi/jkl" << "C:\\abc\\" << "def" << "ghi\\jkl";
#endif
}
void test_PathCombine2()
{
QFETCH(QString, result);
QFETCH(QString, path1);
QFETCH(QString, path2);
QFETCH(QString, path3);
QCOMPARE(FS::PathCombine(path1, path2, path3), result);
}
void test_copy()
{
QString folder = QFINDTESTDATA("data/test_folder");
auto f = [&folder]()
{
QTemporaryDir tempDir;
tempDir.setAutoRemove(true);
qDebug() << "From:" << folder << "To:" << tempDir.path();
QDir target_dir(FS::PathCombine(tempDir.path(), "test_folder"));
qDebug() << tempDir.path();
qDebug() << target_dir.path();
FS::copy c(folder, target_dir.path());
c();
for(auto entry: target_dir.entryList())
{
qDebug() << entry;
}
QVERIFY(target_dir.entryList().contains("pack.mcmeta"));
QVERIFY(target_dir.entryList().contains("assets"));
};
// first try variant without trailing /
QVERIFY(!folder.endsWith('/'));
f();
// then variant with trailing /
folder.append('/');
QVERIFY(folder.endsWith('/'));
f();
}
void test_getDesktop()
{
QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
}
// this is only valid on linux
// FIXME: implement on windows, OSX, then test.
#if defined(Q_OS_LINUX)
void test_createShortcut_data()
{
QTest::addColumn<QString>("location");
QTest::addColumn<QString>("dest");
QTest::addColumn<QStringList>("args");
QTest::addColumn<QString>("name");
QTest::addColumn<QString>("iconLocation");
QTest::addColumn<QByteArray>("result");
QTest::newRow("unix") << QDir::currentPath()
<< "asdfDest"
<< (QStringList() << "arg1" << "arg2")
<< "asdf"
<< QString()
#if defined(Q_OS_LINUX)
<< GET_TEST_FILE("data/FileSystem-test_createShortcut-unix")
#elif defined(Q_OS_WIN)
<< QByteArray()
#endif
;
}
void test_createShortcut()
{
QFETCH(QString, location);
QFETCH(QString, dest);
QFETCH(QStringList, args);
QFETCH(QString, name);
QFETCH(QString, iconLocation);
QFETCH(QByteArray, result);
QVERIFY(FS::createShortCut(location, dest, args, name, iconLocation));
QCOMPARE(QString::fromLocal8Bit(TestsInternal::readFile(location + QDir::separator() + name + ".desktop")), QString::fromLocal8Bit(result));
//QDir().remove(location);
}
#endif
};
QTEST_GUILESS_MAIN(FileSystemTest)
#include "FileSystem_test.moc"

View File

@ -1,3 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "GZip.h"
#include <zlib.h>
#include <QByteArray>
@ -37,7 +72,7 @@ bool GZip::unzip(const QByteArray &compressedBytes, QByteArray &uncompressedByte
uncompLength *= 2;
}
strm.next_out = (Bytef *)(uncompressedBytes.data() + strm.total_out);
strm.next_out = reinterpret_cast<Bytef *>((uncompressedBytes.data() + strm.total_out));
strm.avail_out = uncompLength - strm.total_out;
// Inflate another chunk.
@ -67,7 +102,7 @@ bool GZip::zip(const QByteArray &uncompressedBytes, QByteArray &compressedBytes)
return true;
}
unsigned compLength = std::min(uncompressedBytes.size(), 16);
unsigned compLength = qMin(uncompressedBytes.size(), 16);
compressedBytes.clear();
compressedBytes.resize(compLength);
@ -94,7 +129,7 @@ bool GZip::zip(const QByteArray &uncompressedBytes, QByteArray &compressedBytes)
{
compressedBytes.resize(compressedBytes.size() * 2);
}
zs.next_out = (Bytef *) (compressedBytes.data() + offset);
zs.next_out = reinterpret_cast<Bytef*>((compressedBytes.data() + offset));
temp = zs.avail_out = compressedBytes.size() - offset;
ret = deflate(&zs, Z_FINISH);
offset += temp - zs.avail_out;
@ -112,4 +147,4 @@ bool GZip::zip(const QByteArray &uncompressedBytes, QByteArray &compressedBytes)
return false;
}
return true;
}
}

View File

@ -42,7 +42,7 @@ public:
}
void put(QByteArray input)
{
hoedown_buffer_put(buf, (uint8_t *) input.data(), input.size());
hoedown_buffer_put(buf, reinterpret_cast<uint8_t *>(input.data()), input.size());
}
const uint8_t * data() const
{

View File

@ -0,0 +1,135 @@
//
// Created by marcelohdez on 10/22/22.
//
#include "InstanceCopyPrefs.h"
bool InstanceCopyPrefs::allTrue() const
{
return copySaves &&
keepPlaytime &&
copyGameOptions &&
copyResourcePacks &&
copyShaderPacks &&
copyServers &&
copyMods &&
copyScreenshots;
}
// Returns a single RegEx string of the selected folders/files to filter out (ex: ".minecraft/saves|.minecraft/server.dat")
QString InstanceCopyPrefs::getSelectedFiltersAsRegex() const
{
QStringList filters;
if(!copySaves)
filters << "saves";
if(!copyGameOptions)
filters << "options.txt";
if(!copyResourcePacks)
filters << "resourcepacks" << "texturepacks";
if(!copyShaderPacks)
filters << "shaderpacks";
if(!copyServers)
filters << "servers.dat" << "servers.dat_old" << "server-resource-packs";
if(!copyMods)
filters << "coremods" << "mods" << "config";
if(!copyScreenshots)
filters << "screenshots";
// If we have any filters to add, join them as a single regex string to return:
if (!filters.isEmpty()) {
const QString MC_ROOT = "[.]?minecraft/";
// Ensure first filter starts with root, then join other filters with OR regex before root (ex: ".minecraft/saves|.minecraft/mods"):
return MC_ROOT + filters.join("|" + MC_ROOT);
}
return {};
}
// ======= Getters =======
bool InstanceCopyPrefs::isCopySavesEnabled() const
{
return copySaves;
}
bool InstanceCopyPrefs::isKeepPlaytimeEnabled() const
{
return keepPlaytime;
}
bool InstanceCopyPrefs::isCopyGameOptionsEnabled() const
{
return copyGameOptions;
}
bool InstanceCopyPrefs::isCopyResourcePacksEnabled() const
{
return copyResourcePacks;
}
bool InstanceCopyPrefs::isCopyShaderPacksEnabled() const
{
return copyShaderPacks;
}
bool InstanceCopyPrefs::isCopyServersEnabled() const
{
return copyServers;
}
bool InstanceCopyPrefs::isCopyModsEnabled() const
{
return copyMods;
}
bool InstanceCopyPrefs::isCopyScreenshotsEnabled() const
{
return copyScreenshots;
}
// ======= Setters =======
void InstanceCopyPrefs::enableCopySaves(bool b)
{
copySaves = b;
}
void InstanceCopyPrefs::enableKeepPlaytime(bool b)
{
keepPlaytime = b;
}
void InstanceCopyPrefs::enableCopyGameOptions(bool b)
{
copyGameOptions = b;
}
void InstanceCopyPrefs::enableCopyResourcePacks(bool b)
{
copyResourcePacks = b;
}
void InstanceCopyPrefs::enableCopyShaderPacks(bool b)
{
copyShaderPacks = b;
}
void InstanceCopyPrefs::enableCopyServers(bool b)
{
copyServers = b;
}
void InstanceCopyPrefs::enableCopyMods(bool b)
{
copyMods = b;
}
void InstanceCopyPrefs::enableCopyScreenshots(bool b)
{
copyScreenshots = b;
}

View File

@ -0,0 +1,41 @@
//
// Created by marcelohdez on 10/22/22.
//
#pragma once
#include <QStringList>
struct InstanceCopyPrefs {
public:
[[nodiscard]] bool allTrue() const;
[[nodiscard]] QString getSelectedFiltersAsRegex() const;
// Getters
[[nodiscard]] bool isCopySavesEnabled() const;
[[nodiscard]] bool isKeepPlaytimeEnabled() const;
[[nodiscard]] bool isCopyGameOptionsEnabled() const;
[[nodiscard]] bool isCopyResourcePacksEnabled() const;
[[nodiscard]] bool isCopyShaderPacksEnabled() const;
[[nodiscard]] bool isCopyServersEnabled() const;
[[nodiscard]] bool isCopyModsEnabled() const;
[[nodiscard]] bool isCopyScreenshotsEnabled() const;
// Setters
void enableCopySaves(bool b);
void enableKeepPlaytime(bool b);
void enableCopyGameOptions(bool b);
void enableCopyResourcePacks(bool b);
void enableCopyShaderPacks(bool b);
void enableCopyServers(bool b);
void enableCopyMods(bool b);
void enableCopyScreenshots(bool b);
protected: // data
bool copySaves = true;
bool keepPlaytime = true;
bool copyGameOptions = true;
bool copyResourcePacks = true;
bool copyShaderPacks = true;
bool copyServers = true;
bool copyMods = true;
bool copyScreenshots = true;
};

View File

@ -5,15 +5,17 @@
#include "pathmatcher/RegexpMatcher.h"
#include <QtConcurrentRun>
InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime)
InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, const InstanceCopyPrefs& prefs)
{
m_origInstance = origInstance;
m_keepPlaytime = keepPlaytime;
m_keepPlaytime = prefs.isKeepPlaytimeEnabled();
if(!copySaves)
QString filters = prefs.getSelectedFiltersAsRegex();
if (!filters.isEmpty())
{
// Set regex filter:
// FIXME: get this from the original instance type...
auto matcherReal = new RegexpMatcher("[.]?minecraft/saves");
auto matcherReal = new RegexpMatcher(filters);
matcherReal->caseSensitive(false);
m_matcher.reset(matcherReal);
}
@ -23,10 +25,12 @@ void InstanceCopyTask::executeTask()
{
setStatus(tr("Copying instance %1").arg(m_origInstance->name()));
FS::copy folderCopy(m_origInstance->instanceRoot(), m_stagingPath);
folderCopy.followSymlinks(false).blacklist(m_matcher.get());
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [this]{
FS::copy folderCopy(m_origInstance->instanceRoot(), m_stagingPath);
folderCopy.followSymlinks(false).matcher(m_matcher.get());
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), folderCopy);
return folderCopy();
});
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &InstanceCopyTask::copyFinished);
connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &InstanceCopyTask::copyAborted);
m_copyFutureWatcher.setFuture(m_copyFuture);
@ -42,10 +46,9 @@ void InstanceCopyTask::copyFinished()
}
// FIXME: shouldn't this be able to report errors?
auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(m_stagingPath, "instance.cfg"));
instanceSettings->registerSetting("InstanceType", "Legacy");
InstancePtr inst(new NullInstance(m_globalSettings, instanceSettings, m_stagingPath));
inst->setName(m_instName);
inst->setName(name());
inst->setIconKey(m_instIcon);
if(!m_keepPlaytime) {
inst->resetTimePlayed();

View File

@ -1,20 +1,21 @@
#pragma once
#include "tasks/Task.h"
#include "net/NetJob.h"
#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
#include "settings/SettingsObject.h"
#include "BaseVersion.h"
#include <QUrl>
#include "BaseInstance.h"
#include "BaseVersion.h"
#include "InstanceCopyPrefs.h"
#include "InstanceTask.h"
#include "net/NetJob.h"
#include "settings/SettingsObject.h"
#include "tasks/Task.h"
class InstanceCopyTask : public InstanceTask
{
Q_OBJECT
public:
explicit InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime);
explicit InstanceCopyTask(InstancePtr origInstance, const InstanceCopyPrefs& prefs);
protected:
//! Entry point for tasks.
@ -22,7 +23,8 @@ protected:
void copyFinished();
void copyAborted();
private: /* data */
private:
/* data */
InstancePtr m_origInstance;
QFuture<bool> m_copyFuture;
QFutureWatcher<bool> m_copyFutureWatcher;

View File

@ -1,31 +1,60 @@
#include "InstanceCreationTask.h"
#include "settings/INISettingsObject.h"
#include "FileSystem.h"
//FIXME: remove this
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
#include <QDebug>
#include <QFile>
InstanceCreationTask::InstanceCreationTask(BaseVersionPtr version)
{
m_version = version;
}
InstanceCreationTask::InstanceCreationTask() = default;
void InstanceCreationTask::executeTask()
{
setStatus(tr("Creating instance from version %1").arg(m_version->name()));
{
auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(m_stagingPath, "instance.cfg"));
instanceSettings->suspendSave();
instanceSettings->registerSetting("InstanceType", "Legacy");
instanceSettings->set("InstanceType", "OneSix");
MinecraftInstance inst(m_globalSettings, instanceSettings, m_stagingPath);
auto components = inst.getPackProfile();
components->buildingFromScratch();
components->setComponentVersion("net.minecraft", m_version->descriptor(), true);
inst.setName(m_instName);
inst.setIconKey(m_instIcon);
instanceSettings->resumeSave();
setAbortable(true);
if (updateInstance()) {
emitSucceeded();
return;
}
// When the user aborted in the update stage.
if (m_abort) {
emitAborted();
return;
}
if (!createInstance()) {
if (m_abort)
return;
qWarning() << "Instance creation failed!";
if (!m_error_message.isEmpty()) {
qWarning() << "Reason: " << m_error_message;
emitFailed(tr("Error while creating new instance:\n%1").arg(m_error_message));
} else {
emitFailed(tr("Error while creating new instance."));
}
return;
}
// If this is set, it means we're updating an instance. So, we now need to remove the
// files scheduled to, and we'd better not let the user abort in the middle of it, since it'd
// put the instance in an invalid state.
if (shouldOverride()) {
setAbortable(false);
setStatus(tr("Removing old conflicting files..."));
qDebug() << "Removing old files";
for (auto path : m_files_to_remove) {
if (!QFile::exists(path))
continue;
qDebug() << "Removing" << path;
if (!QFile::remove(path)) {
qCritical() << "Couldn't remove the old conflicting files.";
emitFailed(tr("Failed to remove old conflicting files."));
return;
}
}
}
emitSucceeded();
return;
}

View File

@ -1,22 +1,46 @@
#pragma once
#include "tasks/Task.h"
#include "net/NetJob.h"
#include <QUrl>
#include "settings/SettingsObject.h"
#include "BaseVersion.h"
#include "InstanceTask.h"
class InstanceCreationTask : public InstanceTask
{
class InstanceCreationTask : public InstanceTask {
Q_OBJECT
public:
explicit InstanceCreationTask(BaseVersionPtr version);
public:
InstanceCreationTask();
virtual ~InstanceCreationTask() = default;
protected:
//! Entry point for tasks.
virtual void executeTask() override;
protected:
void executeTask() final override;
private: /* data */
BaseVersionPtr m_version;
/**
* Tries to update an already existing instance.
*
* This can be implemented by subclasses to provide a way of updating an already existing
* instance, according to that implementation's concept of 'identity' (i.e. instances that
* are updates / downgrades of one another).
*
* If this returns true, createInstance() will not run, so you should do all update steps in here.
* Otherwise, createInstance() is run as normal.
*/
virtual bool updateInstance() { return false; };
/**
* Creates a new instance.
*
* Returns whether the instance creation was successful (true) or not (false).
*/
virtual bool createInstance() { return false; };
QString getError() const { return m_error_message; }
protected:
void setError(QString message) { m_error_message = message; };
protected:
bool m_abort = false;
QStringList m_files_to_remove;
private:
QString m_error_message;
};

View File

@ -1,68 +1,102 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "InstanceImportTask.h"
#include "BaseInstance.h"
#include "FileSystem.h"
#include "Application.h"
#include "FileSystem.h"
#include "MMCZip.h"
#include "NullInstance.h"
#include "settings/INISettingsObject.h"
#include "icons/IconUtils.h"
#include <QtConcurrentRun>
// FIXME: this does not belong here, it's Minecraft/Flame specific
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
#include "modplatform/flame/FileResolvingTask.h"
#include "modplatform/flame/PackManifest.h"
#include "Json.h"
#include <quazipdir.h>
#include "modplatform/technic/TechnicPackProcessor.h"
#include "icons/IconList.h"
#include "Application.h"
#include "icons/IconUtils.h"
InstanceImportTask::InstanceImportTask(const QUrl sourceUrl)
#include "modplatform/technic/TechnicPackProcessor.h"
#include "modplatform/modrinth/ModrinthInstanceCreationTask.h"
#include "modplatform/flame/FlameInstanceCreationTask.h"
#include "settings/INISettingsObject.h"
#include <QtConcurrentRun>
#include <algorithm>
#include <quazip/quazipdir.h>
InstanceImportTask::InstanceImportTask(const QUrl sourceUrl, QWidget* parent, QMap<QString, QString>&& extra_info)
: m_sourceUrl(sourceUrl), m_extra_info(extra_info), m_parent(parent)
{}
bool InstanceImportTask::abort()
{
m_sourceUrl = sourceUrl;
if (!canAbort())
return false;
if (m_filesNetJob)
m_filesNetJob->abort();
m_extractFuture.cancel();
return Task::abort();
}
void InstanceImportTask::executeTask()
{
if (m_sourceUrl.isLocalFile())
{
setAbortable(true);
if (m_sourceUrl.isLocalFile()) {
m_archivePath = m_sourceUrl.toLocalFile();
processZipPack();
}
else
{
} else {
setStatus(tr("Downloading modpack:\n%1").arg(m_sourceUrl.toString()));
m_downloadRequired = true;
const QString path = m_sourceUrl.host() + '/' + m_sourceUrl.path();
const QString path(m_sourceUrl.host() + '/' + m_sourceUrl.path());
auto entry = APPLICATION->metacache()->resolveEntry("general", path);
entry->setStale(true);
m_filesNetJob.reset(new NetJob(tr("Modpack download")));
m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry));
m_archivePath = entry->getFullPath();
auto job = m_filesNetJob.get();
connect(job, &NetJob::succeeded, this, &InstanceImportTask::downloadSucceeded);
connect(job, &NetJob::progress, this, &InstanceImportTask::downloadProgressChanged);
connect(job, &NetJob::failed, this, &InstanceImportTask::downloadFailed);
m_filesNetJob->start(APPLICATION->network());
m_filesNetJob = new NetJob(tr("Modpack download"), APPLICATION->network());
m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry));
connect(m_filesNetJob.get(), &NetJob::succeeded, this, &InstanceImportTask::downloadSucceeded);
connect(m_filesNetJob.get(), &NetJob::progress, this, &InstanceImportTask::downloadProgressChanged);
connect(m_filesNetJob.get(), &NetJob::failed, this, &InstanceImportTask::downloadFailed);
connect(m_filesNetJob.get(), &NetJob::aborted, this, &InstanceImportTask::downloadAborted);
m_filesNetJob->start();
}
}
@ -80,7 +114,13 @@ void InstanceImportTask::downloadFailed(QString reason)
void InstanceImportTask::downloadProgressChanged(qint64 current, qint64 total)
{
setProgress(current / 2, total);
setProgress(current, total);
}
void InstanceImportTask::downloadAborted()
{
emitAborted();
m_filesNetJob.reset();
}
void InstanceImportTask::processZipPack()
@ -97,17 +137,20 @@ void InstanceImportTask::processZipPack()
return;
}
QStringList blacklist = {"instance.cfg", "manifest.json"};
QString mmcFound = MMCZip::findFolderOfFileInZip(m_packZip.get(), "instance.cfg");
bool technicFound = QuaZipDir(m_packZip.get()).exists("/bin/modpack.jar") || QuaZipDir(m_packZip.get()).exists("/bin/version.json");
QString flameFound = MMCZip::findFolderOfFileInZip(m_packZip.get(), "manifest.json");
QuaZipDir packZipDir(m_packZip.get());
// https://docs.modrinth.com/docs/modpacks/format_definition/#storage
bool modrinthFound = packZipDir.exists("/modrinth.index.json");
bool technicFound = packZipDir.exists("/bin/modpack.jar") || packZipDir.exists("/bin/version.json");
QString root;
if(!mmcFound.isNull())
// NOTE: Prioritize modpack platforms that aren't searched for recursively.
// Especially Flame has a very common filename for its manifest, which may appear inside overrides for example
if(modrinthFound)
{
// process as MultiMC instance/pack
qDebug() << "MultiMC:" << mmcFound;
root = mmcFound;
m_modpackType = ModpackType::MultiMC;
// process as Modrinth pack
qDebug() << "Modrinth:" << modrinthFound;
m_modpackType = ModpackType::Modrinth;
}
else if (technicFound)
{
@ -117,12 +160,21 @@ void InstanceImportTask::processZipPack()
extractDir.cd(".minecraft");
m_modpackType = ModpackType::Technic;
}
else if(!flameFound.isNull())
else
{
// process as Flame pack
qDebug() << "Flame:" << flameFound;
root = flameFound;
m_modpackType = ModpackType::Flame;
QStringList paths_to_ignore { "overrides/" };
if (QString mmcRoot = MMCZip::findFolderOfFileInZip(m_packZip.get(), "instance.cfg", paths_to_ignore); !mmcRoot.isNull()) {
// process as MultiMC instance/pack
qDebug() << "MultiMC:" << mmcRoot;
root = mmcRoot;
m_modpackType = ModpackType::MultiMC;
} else if (QString flameRoot = MMCZip::findFolderOfFileInZip(m_packZip.get(), "manifest.json", paths_to_ignore); !flameRoot.isNull()) {
// process as Flame pack
qDebug() << "Flame:" << flameRoot;
root = flameRoot;
m_modpackType = ModpackType::Flame;
}
}
if(m_modpackType == ModpackType::Unknown)
{
@ -180,15 +232,18 @@ void InstanceImportTask::extractFinished()
switch(m_modpackType)
{
case ModpackType::Flame:
processFlame();
return;
case ModpackType::MultiMC:
processMultiMC();
return;
case ModpackType::Technic:
processTechnic();
return;
case ModpackType::Flame:
processFlame();
return;
case ModpackType::Modrinth:
processModrinth();
return;
case ModpackType::Unknown:
emitFailed(tr("Archive does not contain a recognized modpack type."));
return;
@ -197,217 +252,51 @@ void InstanceImportTask::extractFinished()
void InstanceImportTask::extractAborted()
{
emitFailed(tr("Instance import has been aborted."));
return;
emitAborted();
}
void InstanceImportTask::processFlame()
{
const static QMap<QString,QString> forgemap = {
{"1.2.5", "3.4.9.171"},
{"1.4.2", "6.0.1.355"},
{"1.4.7", "6.6.2.534"},
{"1.5.2", "7.8.1.737"}
};
Flame::Manifest pack;
try
{
QString configPath = FS::PathCombine(m_stagingPath, "manifest.json");
Flame::loadManifest(pack, configPath);
QFile::remove(configPath);
}
catch (const JSONValidationError &e)
{
emitFailed(tr("Could not understand pack manifest:\n") + e.cause());
return;
}
if(!pack.overrides.isEmpty())
{
QString overridePath = FS::PathCombine(m_stagingPath, pack.overrides);
if (QFile::exists(overridePath))
{
QString mcPath = FS::PathCombine(m_stagingPath, "minecraft");
if (!QFile::rename(overridePath, mcPath))
{
emitFailed(tr("Could not rename the overrides folder:\n") + pack.overrides);
return;
}
}
else
{
logWarning(tr("The specified overrides folder (%1) is missing. Maybe the modpack was already used before?").arg(pack.overrides));
}
FlameCreationTask* inst_creation_task = nullptr;
if (!m_extra_info.isEmpty()) {
auto pack_id_it = m_extra_info.constFind("pack_id");
Q_ASSERT(pack_id_it != m_extra_info.constEnd());
auto pack_id = pack_id_it.value();
auto pack_version_id_it = m_extra_info.constFind("pack_version_id");
Q_ASSERT(pack_version_id_it != m_extra_info.constEnd());
auto pack_version_id = pack_version_id_it.value();
QString original_instance_id;
auto original_instance_id_it = m_extra_info.constFind("original_instance_id");
if (original_instance_id_it != m_extra_info.constEnd())
original_instance_id = original_instance_id_it.value();
inst_creation_task = new FlameCreationTask(m_stagingPath, m_globalSettings, m_parent, pack_id, pack_version_id, original_instance_id);
} else {
// FIXME: Find a way to get IDs in directly imported ZIPs
inst_creation_task = new FlameCreationTask(m_stagingPath, m_globalSettings, m_parent, {}, {});
}
QString forgeVersion;
QString fabricVersion;
for(auto &loader: pack.minecraft.modLoaders)
{
auto id = loader.id;
if(id.startsWith("forge-"))
{
id.remove("forge-");
forgeVersion = id;
continue;
}
if(id.startsWith("fabric-"))
{
id.remove("fabric-");
fabricVersion = id;
continue;
}
logWarning(tr("Unknown mod loader in manifest: %1").arg(id));
}
QString configPath = FS::PathCombine(m_stagingPath, "instance.cfg");
auto instanceSettings = std::make_shared<INISettingsObject>(configPath);
instanceSettings->registerSetting("InstanceType", "Legacy");
instanceSettings->set("InstanceType", "OneSix");
MinecraftInstance instance(m_globalSettings, instanceSettings, m_stagingPath);
auto mcVersion = pack.minecraft.version;
// Hack to correct some 'special sauce'...
if(mcVersion.endsWith('.'))
{
mcVersion.remove(QRegExp("[.]+$"));
logWarning(tr("Mysterious trailing dots removed from Minecraft version while importing pack."));
}
auto components = instance.getPackProfile();
components->buildingFromScratch();
components->setComponentVersion("net.minecraft", mcVersion, true);
if(!forgeVersion.isEmpty())
{
// FIXME: dirty, nasty, hack. Proper solution requires dependency resolution and knowledge of the metadata.
if(forgeVersion == "recommended")
{
if(forgemap.contains(mcVersion))
{
forgeVersion = forgemap[mcVersion];
}
else
{
logWarning(tr("Could not map recommended forge version for Minecraft %1").arg(mcVersion));
}
}
components->setComponentVersion("net.minecraftforge", forgeVersion);
}
if(!fabricVersion.isEmpty())
{
components->setComponentVersion("net.fabricmc.fabric-loader", fabricVersion);
}
if (m_instIcon != "default")
{
instance.setIconKey(m_instIcon);
}
else
{
if(pack.name.contains("Direwolf20"))
{
instance.setIconKey("steve");
}
else if(pack.name.contains("FTB") || pack.name.contains("Feed The Beast"))
{
instance.setIconKey("ftb_logo");
}
else
{
// default to something other than the MultiMC default to distinguish these
instance.setIconKey("flame");
}
}
QString jarmodsPath = FS::PathCombine(m_stagingPath, "minecraft", "jarmods");
QFileInfo jarmodsInfo(jarmodsPath);
if(jarmodsInfo.isDir())
{
// install all the jar mods
qDebug() << "Found jarmods:";
QDir jarmodsDir(jarmodsPath);
QStringList jarMods;
for (auto info: jarmodsDir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files))
{
qDebug() << info.fileName();
jarMods.push_back(info.absoluteFilePath());
}
auto profile = instance.getPackProfile();
profile->installJarMods(jarMods);
// nuke the original files
FS::deletePath(jarmodsPath);
}
instance.setName(m_instName);
m_modIdResolver = new Flame::FileResolvingTask(APPLICATION->network(), pack);
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::succeeded, [&]()
{
auto results = m_modIdResolver->getResults();
m_filesNetJob.reset(new NetJob(tr("Mod download")));
for(auto result: results.files)
{
QString filename = result.fileName;
if(!result.required)
{
filename += ".disabled";
}
auto relpath = FS::PathCombine("minecraft", result.targetFolder, filename);
auto path = FS::PathCombine(m_stagingPath , relpath);
switch(result.type)
{
case Flame::File::Type::Folder:
{
logWarning(tr("This 'Folder' may need extracting: %1").arg(relpath));
// fall-through intentional, we treat these as plain old mods and dump them wherever.
}
case Flame::File::Type::SingleFile:
case Flame::File::Type::Mod:
{
qDebug() << "Will download" << result.url << "to" << path;
auto dl = Net::Download::makeFile(result.url, path);
m_filesNetJob->addNetAction(dl);
break;
}
case Flame::File::Type::Modpack:
logWarning(tr("Nesting modpacks in modpacks is not implemented, nothing was downloaded: %1").arg(relpath));
break;
case Flame::File::Type::Cmod2:
case Flame::File::Type::Ctoc:
case Flame::File::Type::Unknown:
logWarning(tr("Unrecognized/unhandled PackageType for: %1").arg(relpath));
break;
}
}
m_modIdResolver.reset();
connect(m_filesNetJob.get(), &NetJob::succeeded, this, [&]()
{
m_filesNetJob.reset();
emitSucceeded();
}
);
connect(m_filesNetJob.get(), &NetJob::failed, [&](QString reason)
{
m_filesNetJob.reset();
emitFailed(reason);
});
connect(m_filesNetJob.get(), &NetJob::progress, [&](qint64 current, qint64 total)
{
setProgress(current, total);
});
setStatus(tr("Downloading mods..."));
m_filesNetJob->start(APPLICATION->network());
}
);
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::failed, [&](QString reason)
{
m_modIdResolver.reset();
emitFailed(tr("Unable to resolve mod IDs:\n") + reason);
inst_creation_task->setName(*this);
inst_creation_task->setIcon(m_instIcon);
inst_creation_task->setGroup(m_instGroup);
inst_creation_task->setConfirmUpdate(shouldConfirmUpdate());
connect(inst_creation_task, &Task::succeeded, this, [this, inst_creation_task] {
setOverride(inst_creation_task->shouldOverride(), inst_creation_task->originalInstanceID());
emitSucceeded();
});
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::progress, [&](qint64 current, qint64 total)
{
setProgress(current, total);
});
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::status, [&](QString status)
{
setStatus(status);
});
m_modIdResolver->start();
connect(inst_creation_task, &Task::failed, this, &InstanceImportTask::emitFailed);
connect(inst_creation_task, &Task::progress, this, &InstanceImportTask::setProgress);
connect(inst_creation_task, &Task::status, this, &InstanceImportTask::setStatus);
connect(inst_creation_task, &Task::finished, inst_creation_task, &InstanceCreationTask::deleteLater);
connect(this, &Task::aborted, inst_creation_task, &InstanceCreationTask::abort);
connect(inst_creation_task, &Task::aborted, this, &Task::abort);
connect(inst_creation_task, &Task::abortStatusChanged, this, &Task::setAbortable);
inst_creation_task->start();
}
void InstanceImportTask::processTechnic()
@ -415,14 +304,13 @@ void InstanceImportTask::processTechnic()
shared_qobject_ptr<Technic::TechnicPackProcessor> packProcessor = new Technic::TechnicPackProcessor();
connect(packProcessor.get(), &Technic::TechnicPackProcessor::succeeded, this, &InstanceImportTask::emitSucceeded);
connect(packProcessor.get(), &Technic::TechnicPackProcessor::failed, this, &InstanceImportTask::emitFailed);
packProcessor->run(m_globalSettings, m_instName, m_instIcon, m_stagingPath);
packProcessor->run(m_globalSettings, name(), m_instIcon, m_stagingPath);
}
void InstanceImportTask::processMultiMC()
{
QString configPath = FS::PathCombine(m_stagingPath, "instance.cfg");
auto instanceSettings = std::make_shared<INISettingsObject>(configPath);
instanceSettings->registerSetting("InstanceType", "Legacy");
NullInstance instance(m_globalSettings, instanceSettings, m_stagingPath);
@ -430,28 +318,74 @@ void InstanceImportTask::processMultiMC()
instance.resetTimePlayed();
// set a new nice name
instance.setName(m_instName);
instance.setName(name());
// if the icon was specified by user, use that. otherwise pull icon from the pack
if (m_instIcon != "default")
{
if (m_instIcon != "default") {
instance.setIconKey(m_instIcon);
}
else
{
} else {
m_instIcon = instance.iconKey();
auto importIconPath = IconUtils::findBestIconIn(instance.instanceRoot(), m_instIcon);
if (!importIconPath.isNull() && QFile::exists(importIconPath))
{
if (!importIconPath.isNull() && QFile::exists(importIconPath)) {
// import icon
auto iconList = APPLICATION->icons();
if (iconList->iconFileExists(m_instIcon))
{
if (iconList->iconFileExists(m_instIcon)) {
iconList->deleteIcon(m_instIcon);
}
iconList->installIcons({importIconPath});
iconList->installIcons({ importIconPath });
}
}
emitSucceeded();
}
void InstanceImportTask::processModrinth()
{
ModrinthCreationTask* inst_creation_task = nullptr;
if (!m_extra_info.isEmpty()) {
auto pack_id_it = m_extra_info.constFind("pack_id");
Q_ASSERT(pack_id_it != m_extra_info.constEnd());
auto pack_id = pack_id_it.value();
QString pack_version_id;
auto pack_version_id_it = m_extra_info.constFind("pack_version_id");
if (pack_version_id_it != m_extra_info.constEnd())
pack_version_id = pack_version_id_it.value();
QString original_instance_id;
auto original_instance_id_it = m_extra_info.constFind("original_instance_id");
if (original_instance_id_it != m_extra_info.constEnd())
original_instance_id = original_instance_id_it.value();
inst_creation_task = new ModrinthCreationTask(m_stagingPath, m_globalSettings, m_parent, pack_id, pack_version_id, original_instance_id);
} else {
QString pack_id;
if (!m_sourceUrl.isEmpty()) {
QRegularExpression regex(R"(data\/(.*)\/versions)");
pack_id = regex.match(m_sourceUrl.toString()).captured(1);
}
// FIXME: Find a way to get the ID in directly imported ZIPs
inst_creation_task = new ModrinthCreationTask(m_stagingPath, m_globalSettings, m_parent, pack_id);
}
inst_creation_task->setName(*this);
inst_creation_task->setIcon(m_instIcon);
inst_creation_task->setGroup(m_instGroup);
inst_creation_task->setConfirmUpdate(shouldConfirmUpdate());
connect(inst_creation_task, &Task::succeeded, this, [this, inst_creation_task] {
setOverride(inst_creation_task->shouldOverride(), inst_creation_task->originalInstanceID());
emitSucceeded();
});
connect(inst_creation_task, &Task::failed, this, &InstanceImportTask::emitFailed);
connect(inst_creation_task, &Task::progress, this, &InstanceImportTask::setProgress);
connect(inst_creation_task, &Task::status, this, &InstanceImportTask::setStatus);
connect(inst_creation_task, &Task::finished, inst_creation_task, &InstanceCreationTask::deleteLater);
connect(this, &Task::aborted, inst_creation_task, &InstanceCreationTask::abort);
connect(inst_creation_task, &Task::aborted, this, &Task::abort);
connect(inst_creation_task, &Task::abortStatusChanged, this, &Task::setAbortable);
inst_creation_task->start();
}

View File

@ -1,16 +1,36 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
@ -22,8 +42,9 @@
#include <QFutureWatcher>
#include "settings/SettingsObject.h"
#include "QObjectPtr.h"
#include "modplatform/flame/PackManifest.h"
#include <nonstd/optional>
#include <optional>
class QuaZip;
namespace Flame
@ -35,7 +56,13 @@ class InstanceImportTask : public InstanceTask
{
Q_OBJECT
public:
explicit InstanceImportTask(const QUrl sourceUrl);
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr, QMap<QString, QString>&& extra_info = {});
bool abort() override;
const QVector<Flame::File> &getBlockedFiles() const
{
return m_blockedMods;
}
protected:
//! Entry point for tasks.
@ -44,13 +71,15 @@ protected:
private:
void processZipPack();
void processMultiMC();
void processFlame();
void processTechnic();
void processFlame();
void processModrinth();
private slots:
void downloadSucceeded();
void downloadFailed(QString reason);
void downloadProgressChanged(qint64 current, qint64 total);
void downloadAborted();
void extractFinished();
void extractAborted();
@ -61,12 +90,21 @@ private: /* data */
QString m_archivePath;
bool m_downloadRequired = false;
std::unique_ptr<QuaZip> m_packZip;
QFuture<nonstd::optional<QStringList>> m_extractFuture;
QFutureWatcher<nonstd::optional<QStringList>> m_extractFutureWatcher;
QFuture<std::optional<QStringList>> m_extractFuture;
QFutureWatcher<std::optional<QStringList>> m_extractFutureWatcher;
QVector<Flame::File> m_blockedMods;
enum class ModpackType{
Unknown,
MultiMC,
Technic,
Flame,
Technic
Modrinth,
} m_modpackType = ModpackType::Unknown;
// Extra info we might need, that's available before, but can't be derived from
// the source URL / the resource it points to alone.
QMap<QString, QString> m_extra_info;
//FIXME: nuke
QWidget* m_parent;
};

File diff suppressed because it is too large Load Diff

View File

@ -19,13 +19,15 @@
#include <QAbstractListModel>
#include <QSet>
#include <QList>
#include <QStack>
#include <QPair>
#include "BaseInstance.h"
#include "QObjectPtr.h"
class QFileSystemWatcher;
class InstanceTask;
struct InstanceName;
using InstanceId = QString;
using GroupId = QString;
using InstanceLocator = std::pair<InstancePtr, int>;
@ -46,6 +48,12 @@ enum class GroupsState
Dirty
};
struct TrashHistoryItem {
QString id;
QString polyPath;
QString trashPath;
QString groupName;
};
class InstanceList : public QAbstractListModel
{
@ -93,7 +101,10 @@ public:
InstListError loadList();
void saveNow();
/* O(n) */
InstancePtr getInstanceById(QString id) const;
/* O(n) */
InstancePtr getInstanceByManagedName(const QString& managed_name) const;
QModelIndex getInstanceIndexById(const QString &id) const;
QStringList getGroups();
bool isGroupCollapsed(const QString &groupName);
@ -102,6 +113,9 @@ public:
void setInstanceGroup(const InstanceId & id, const GroupId& name);
void deleteGroup(const GroupId & name);
bool trashInstance(const InstanceId &id);
bool trashedSomething();
void undoTrashInstance();
void deleteInstance(const InstanceId & id);
// Wrap an instance creation task in some more task machinery and make it ready to be used
@ -116,8 +130,10 @@ public:
/**
* Commit the staging area given by @keyPath to the provider - used when creation succeeds.
* Used by instance manipulation tasks.
* should_override is used when another similar instance already exists, and we want to override it
* - for instance, when updating it.
*/
bool commitStagedInstance(const QString & keyPath, const QString& instanceName, const QString & groupName);
bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, const QString& groupName, const InstanceTask&);
/**
* Destroy a previously created staging area given by @keyPath - used when creation fails.
@ -180,4 +196,6 @@ private:
QSet<InstanceId> instanceSet;
bool m_groupsLoaded = false;
bool m_instancesProbed = false;
QStack<TrashHistoryItem> m_trashHistory;
};

View File

@ -1,11 +1,11 @@
#pragma once
#include "minecraft/MinecraftInstance.h"
#include "minecraft/legacy/LegacyInstance.h"
#include <FileSystem.h>
#include "ui/pages/BasePage.h"
#include "ui/pages/BasePageProvider.h"
#include "ui/pages/instance/LogPage.h"
#include "ui/pages/instance/VersionPage.h"
#include "ui/pages/instance/ManagedPackPage.h"
#include "ui/pages/instance/ModFolderPage.h"
#include "ui/pages/instance/ResourcePackPage.h"
#include "ui/pages/instance/TexturePackPage.h"
@ -14,7 +14,6 @@
#include "ui/pages/instance/ScreenshotsPage.h"
#include "ui/pages/instance/InstanceSettingsPage.h"
#include "ui/pages/instance/OtherLogsPage.h"
#include "ui/pages/instance/LegacyUpgradePage.h"
#include "ui/pages/instance/WorldListPage.h"
#include "ui/pages/instance/ServersPage.h"
#include "ui/pages/instance/GameOptionsPage.h"
@ -34,31 +33,21 @@ public:
QList<BasePage *> values;
values.append(new LogPage(inst));
std::shared_ptr<MinecraftInstance> onesix = std::dynamic_pointer_cast<MinecraftInstance>(inst);
if(onesix)
{
values.append(new VersionPage(onesix.get()));
auto modsPage = new ModFolderPage(onesix.get(), onesix->loaderModList(), "mods", "loadermods", tr("Loader mods"), "Loader-mods");
modsPage->setFilter("%1 (*.zip *.jar *.litemod)");
values.append(modsPage);
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", tr("Core mods"), "Core-mods"));
values.append(new ResourcePackPage(onesix.get()));
values.append(new TexturePackPage(onesix.get()));
values.append(new ShaderPackPage(onesix.get()));
values.append(new NotesPage(onesix.get()));
values.append(new WorldListPage(onesix.get(), onesix->worldList()));
values.append(new ServersPage(onesix));
// values.append(new GameOptionsPage(onesix.get()));
values.append(new ScreenshotsPage(FS::PathCombine(onesix->gameRoot(), "screenshots")));
values.append(new InstanceSettingsPage(onesix.get()));
}
std::shared_ptr<LegacyInstance> legacy = std::dynamic_pointer_cast<LegacyInstance>(inst);
if(legacy)
{
values.append(new LegacyUpgradePage(legacy));
values.append(new NotesPage(legacy.get()));
values.append(new WorldListPage(legacy.get(), legacy->worldList()));
values.append(new ScreenshotsPage(FS::PathCombine(legacy->gameRoot(), "screenshots")));
}
values.append(new VersionPage(onesix.get()));
values.append(ManagedPackPage::createPage(onesix.get()));
auto modsPage = new ModFolderPage(onesix.get(), onesix->loaderModList());
modsPage->setFilter("%1 (*.zip *.jar *.litemod)");
values.append(modsPage);
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList()));
values.append(new ResourcePackPage(onesix.get(), onesix->resourcePackList()));
values.append(new TexturePackPage(onesix.get(), onesix->texturePackList()));
values.append(new ShaderPackPage(onesix.get(), onesix->shaderPackList()));
values.append(new NotesPage(onesix.get()));
values.append(new WorldListPage(onesix.get(), onesix->worldList()));
values.append(new ServersPage(onesix));
// values.append(new GameOptionsPage(onesix.get()));
values.append(new ScreenshotsPage(FS::PathCombine(onesix->gameRoot(), "screenshots")));
values.append(new InstanceSettingsPage(onesix.get()));
auto logMatcher = inst->getLogFileMatcher();
if(logMatcher)
{
@ -74,3 +63,4 @@ public:
protected:
InstancePtr inst;
};

View File

@ -1,9 +1,75 @@
#include "InstanceTask.h"
InstanceTask::InstanceTask()
#include "ui/dialogs/CustomMessageBox.h"
InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& old_name, const QString& new_name)
{
auto dialog =
CustomMessageBox::selectable(parent, QObject::tr("Change instance name"),
QObject::tr("The instance's name seems to include the old version. Would you like to update it?\n\n"
"Old name: %1\n"
"New name: %2")
.arg(old_name, new_name),
QMessageBox::Question, QMessageBox::No | QMessageBox::Yes);
auto result = dialog->exec();
if (result == QMessageBox::Yes)
return InstanceNameChange::ShouldChange;
return InstanceNameChange::ShouldKeep;
}
InstanceTask::~InstanceTask()
ShouldUpdate askIfShouldUpdate(QWidget *parent, QString original_version_name)
{
auto info = CustomMessageBox::selectable(
parent, QObject::tr("Similar modpack was found!"),
QObject::tr("One or more of your instances are from this same modpack%1. Do you want to create a "
"separate instance, or update the existing one?\n\nNOTE: Make sure you made a backup of your important instance data before "
"updating, as worlds can be corrupted and some configuration may be lost (due to pack overrides).")
.arg(original_version_name),
QMessageBox::Information, QMessageBox::Ok | QMessageBox::Reset | QMessageBox::Abort);
info->setButtonText(QMessageBox::Ok, QObject::tr("Update existing instance"));
info->setButtonText(QMessageBox::Abort, QObject::tr("Create new instance"));
info->setButtonText(QMessageBox::Reset, QObject::tr("Cancel"));
info->exec();
if (info->clickedButton() == info->button(QMessageBox::Ok))
return ShouldUpdate::Update;
if (info->clickedButton() == info->button(QMessageBox::Abort))
return ShouldUpdate::SkipUpdating;
return ShouldUpdate::Cancel;
}
QString InstanceName::name() const
{
if (!m_modified_name.isEmpty())
return modifiedName();
return QString("%1 %2").arg(m_original_name, m_original_version);
}
QString InstanceName::originalName() const
{
return m_original_name;
}
QString InstanceName::modifiedName() const
{
if (!m_modified_name.isEmpty())
return m_modified_name;
return m_original_name;
}
QString InstanceName::version() const
{
return m_original_version;
}
void InstanceName::setName(InstanceName& other)
{
m_original_name = other.m_original_name;
m_original_version = other.m_original_version;
m_modified_name = other.m_modified_name;
}
InstanceTask::InstanceTask() : Task(), InstanceName() {}

View File

@ -1,52 +1,72 @@
#pragma once
#include "tasks/Task.h"
#include "settings/SettingsObject.h"
#include "tasks/Task.h"
class InstanceTask : public Task
{
/* Helpers */
enum class InstanceNameChange { ShouldChange, ShouldKeep };
[[nodiscard]] InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& old_name, const QString& new_name);
enum class ShouldUpdate { Update, SkipUpdating, Cancel };
[[nodiscard]] ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name);
struct InstanceName {
public:
InstanceName() = default;
InstanceName(QString name, QString version) : m_original_name(std::move(name)), m_original_version(std::move(version)) {}
[[nodiscard]] QString modifiedName() const;
[[nodiscard]] QString originalName() const;
[[nodiscard]] QString name() const;
[[nodiscard]] QString version() const;
void setName(QString name) { m_modified_name = name; }
void setName(InstanceName& other);
protected:
QString m_original_name;
QString m_original_version;
QString m_modified_name;
};
class InstanceTask : public Task, public InstanceName {
Q_OBJECT
public:
explicit InstanceTask();
virtual ~InstanceTask();
public:
InstanceTask();
~InstanceTask() override = default;
void setParentSettings(SettingsObjectPtr settings)
void setParentSettings(SettingsObjectPtr settings) { m_globalSettings = settings; }
void setStagingPath(const QString& stagingPath) { m_stagingPath = stagingPath; }
void setIcon(const QString& icon) { m_instIcon = icon; }
void setGroup(const QString& group) { m_instGroup = group; }
QString group() const { return m_instGroup; }
[[nodiscard]] bool shouldConfirmUpdate() const { return m_confirm_update; }
void setConfirmUpdate(bool confirm) { m_confirm_update = confirm; }
bool shouldOverride() const { return m_override_existing; }
[[nodiscard]] QString originalInstanceID() const { return m_original_instance_id; };
protected:
void setOverride(bool override, QString instance_id_to_override = {})
{
m_globalSettings = settings;
m_override_existing = override;
if (!instance_id_to_override.isEmpty())
m_original_instance_id = instance_id_to_override;
}
void setStagingPath(const QString &stagingPath)
{
m_stagingPath = stagingPath;
}
void setName(const QString &name)
{
m_instName = name;
}
QString name() const
{
return m_instName;
}
void setIcon(const QString &icon)
{
m_instIcon = icon;
}
void setGroup(const QString &group)
{
m_instGroup = group;
}
QString group() const
{
return m_instGroup;
}
protected: /* data */
protected: /* data */
SettingsObjectPtr m_globalSettings;
QString m_instName;
QString m_instIcon;
QString m_instGroup;
QString m_stagingPath;
bool m_override_existing = false;
bool m_confirm_update = true;
QString m_original_instance_id;
};

View File

@ -1,14 +1,51 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "JavaCommon.h"
#include "java/JavaUtils.h"
#include "ui/dialogs/CustomMessageBox.h"
#include <MMCStrings.h>
#include <QRegularExpression>
bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
{
if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]"))
if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegularExpression("-Xm[sx]"))
|| jvmargs.contains("-XX-MaxHeapSize") || jvmargs.contains("-XX:InitialHeapSize"))
{
auto warnStr = QObject::tr(
"You tried to manually set a JVM memory option (using \"-XX:PermSize\", \"-XX-MaxHeapSize\", \"-XX:InitialHeapSize\", \"-Xmx\" or \"-Xms\").\n"
"You tried to manually set a JVM memory option (using \"-XX:PermSize\", \"-XX-MaxHeapSize\", \"-XX:InitialHeapSize\", \"-Xmx\" or \"-Xms\").\n"
"There are dedicated boxes for these in the settings (Java tab, in the Memory group at the top).\n"
"This message will be displayed until you remove them from the JVM arguments.");
CustomMessageBox::selectable(
@ -17,6 +54,17 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
QMessageBox::Warning)->exec();
return false;
}
// block lunacy with passing required version to the JVM
if (jvmargs.contains(QRegularExpression("-version:.*"))) {
auto warnStr = QObject::tr(
"You tried to pass required Java version argument to the JVM (using \"-version:xxx\"). This is not safe and will not be allowed.\n"
"This message will be displayed until you remove this from the JVM arguments.");
CustomMessageBox::selectable(
parent, QObject::tr("JVM arguments warning"),
warnStr,
QMessageBox::Warning)->exec();
return false;
}
return true;
}
@ -40,7 +88,7 @@ void JavaCommon::javaArgsWereBad(QWidget *parent, JavaCheckResult result)
auto htmlError = result.errorLog;
QString text;
htmlError.replace('\n', "<br />");
text += QObject::tr("The specified java binary didn't work with the arguments you provided:<br />");
text += QObject::tr("The specified Java binary didn't work with the arguments you provided:<br />");
text += QString("<font color=\"red\">%1</font>").arg(htmlError);
CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show();
}
@ -49,8 +97,15 @@ void JavaCommon::javaBinaryWasBad(QWidget *parent, JavaCheckResult result)
{
QString text;
text += QObject::tr(
"The specified java binary didn't work.<br />You should use the auto-detect feature, "
"or set the path to the java executable.<br />");
"The specified Java binary didn't work.<br />You should use the auto-detect feature, "
"or set the path to the Java executable.<br />");
CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show();
}
void JavaCommon::javaCheckNotFound(QWidget *parent)
{
QString text;
text += QObject::tr("Java checker library could not be found. Please check your installation.");
CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show();
}
@ -61,6 +116,11 @@ void JavaCommon::TestCheck::run()
emit finished();
return;
}
if (JavaUtils::getJavaCheckPath().isEmpty()) {
javaCheckNotFound(m_parent);
emit finished();
return;
}
checker.reset(new JavaChecker());
connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this,
SLOT(checkFinished(JavaCheckResult)));

View File

@ -10,12 +10,14 @@ namespace JavaCommon
{
bool checkJVMArgs(QString args, QWidget *parent);
// Show a dialog saying that the Java binary was not usable
void javaBinaryWasBad(QWidget *parent, JavaCheckResult result);
// Show a dialog saying that the Java binary was not usable because of bad options
void javaArgsWereBad(QWidget *parent, JavaCheckResult result);
// Show a dialog saying that the Java binary was usable
void javaWasOk(QWidget *parent, JavaCheckResult result);
// Show a dialog saying that the Java binary was not usable because of bad options
void javaArgsWereBad(QWidget *parent, JavaCheckResult result);
// Show a dialog saying that the Java binary was not usable
void javaBinaryWasBad(QWidget *parent, JavaCheckResult result);
// Show a dialog if we couldn't find Java Checker
void javaCheckNotFound(QWidget *parent);
class TestCheck : public QObject
{

View File

@ -1,4 +1,37 @@
// Licensed under the Apache-2.0 license. See README.md for details.
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Json.h"
@ -22,14 +55,6 @@ void write(const QJsonArray &array, const QString &filename)
write(QJsonDocument(array), filename);
}
QByteArray toBinary(const QJsonObject &obj)
{
return QJsonDocument(obj).toBinaryData();
}
QByteArray toBinary(const QJsonArray &array)
{
return QJsonDocument(array).toBinaryData();
}
QByteArray toText(const QJsonObject &obj)
{
return QJsonDocument(obj).toJson(QJsonDocument::Compact);
@ -48,12 +73,8 @@ QJsonDocument requireDocument(const QByteArray &data, const QString &what)
{
if (isBinaryJson(data))
{
QJsonDocument doc = QJsonDocument::fromBinaryData(data);
if (doc.isNull())
{
throw JsonException(what + ": Invalid JSON (binary JSON detected)");
}
return doc;
// FIXME: Is this needed?
throw JsonException(what + ": Invalid JSON. Binary JSON unsupported");
}
else
{

View File

@ -1,4 +1,37 @@
// Licensed under the Apache-2.0 license. See README.md for details.
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
@ -29,8 +62,6 @@ void write(const QJsonObject &object, const QString &filename);
/// @throw FileSystemException
void write(const QJsonArray &array, const QString &filename);
QByteArray toBinary(const QJsonObject &obj);
QByteArray toBinary(const QJsonArray &array);
QByteArray toText(const QJsonObject &obj);
QByteArray toText(const QJsonArray &array);

View File

@ -1,3 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "LaunchController.h"
#include "minecraft/auth/AccountList.h"
#include "Application.h"
@ -16,6 +51,7 @@
#include <QHostInfo>
#include <QList>
#include <QHostAddress>
#include <QPushButton>
#include "BuildConfig.h"
#include "JavaCommon.h"
@ -35,7 +71,10 @@ void LaunchController::executeTask()
return;
}
JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget);
if(!JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget)) {
emitFailed(tr("Invalid Java arguments specified. Please fix this first."));
return;
}
login();
}
@ -54,8 +93,8 @@ void LaunchController::decideAccount()
auto reply = CustomMessageBox::selectable(
m_parentWidget,
tr("No Accounts"),
tr("In order to play Minecraft, you must have at least one Mojang or Minecraft "
"account logged in."
tr("In order to play Minecraft, you must have at least one Microsoft or Mojang "
"account logged in. Mojang accounts can only be used offline. "
"Would you like to open the account manager to add an account now?"),
QMessageBox::Information,
QMessageBox::Yes | QMessageBox::No
@ -66,6 +105,11 @@ void LaunchController::decideAccount()
// Open the account manager.
APPLICATION->ShowGlobalSettings(m_parentWidget, "accounts");
}
else if (reply == QMessageBox::No)
{
// Do not open "profile select" dialog.
return;
}
}
m_accountToUse = accounts->defaultAccount();
@ -101,20 +145,37 @@ void LaunchController::login() {
return;
}
// we try empty password first :)
QString password;
// we loop until the user succeeds in logging in or gives up
bool tryagain = true;
// the failure. the default failure.
const QString needLoginAgain = tr("Your account is currently not logged in. Please enter your password to log in again. <br /> <br /> This could be caused by a password change.");
QString failReason = needLoginAgain;
unsigned int tries = 0;
while (tryagain)
{
if (tries > 0 && tries % 3 == 0) {
auto result = QMessageBox::question(
m_parentWidget,
tr("Continue launch?"),
tr("It looks like we couldn't launch after %1 tries. Do you want to continue trying?")
.arg(tries)
);
if (result == QMessageBox::No) {
emitAborted();
return;
}
}
tries++;
m_session = std::make_shared<AuthSession>();
m_session->wants_online = m_online;
m_session->demo = m_demo;
m_accountToUse->fillSession(m_session);
// Launch immediately in true offline mode
if(m_accountToUse->isOffline()) {
launchInstance();
return;
}
switch(m_accountToUse->accountState()) {
case AccountState::Offline: {
m_session->wants_online = false;
@ -124,13 +185,20 @@ void LaunchController::login() {
if(!m_session->wants_online) {
// we ask the user for a player name
bool ok = false;
QString usedname = m_session->player_name;
QString message = tr("Choose your offline mode player name.");
if(m_session->demo) {
message = tr("Choose your demo mode player name.");
}
QString lastOfflinePlayerName = APPLICATION->settings()->get("LastOfflinePlayerName").toString();
QString usedname = lastOfflinePlayerName.isEmpty() ? m_session->player_name : lastOfflinePlayerName;
QString name = QInputDialog::getText(
m_parentWidget,
tr("Player name"),
tr("Choose your offline mode player name."),
message,
QLineEdit::Normal,
m_session->player_name,
usedname,
&ok
);
if (!ok)
@ -141,40 +209,49 @@ void LaunchController::login() {
if (name.length())
{
usedname = name;
APPLICATION->settings()->set("LastOfflinePlayerName", usedname);
}
m_session->MakeOffline(usedname);
// offline flavored game from here :3
}
if(m_accountToUse->ownsMinecraft() && !m_accountToUse->hasProfile()) {
auto entitlement = m_accountToUse->accountData()->minecraftEntitlement;
QString errorString;
if(!entitlement.canPlayMinecraft) {
errorString = tr("The account does not own Minecraft. You need to purchase the game first to play it.");
QMessageBox::warning(
nullptr,
tr("Missing Minecraft profile"),
errorString,
QMessageBox::StandardButton::Ok,
QMessageBox::StandardButton::Ok
);
emitFailed(errorString);
return;
}
// Now handle setting up a profile name here...
ProfileSetupDialog dialog(m_accountToUse, m_parentWidget);
if (dialog.exec() == QDialog::Accepted)
{
tryagain = true;
continue;
}
else
{
emitFailed(tr("Received undetermined session status during login."));
return;
if(m_accountToUse->ownsMinecraft()) {
if(!m_accountToUse->hasProfile()) {
// Now handle setting up a profile name here...
ProfileSetupDialog dialog(m_accountToUse, m_parentWidget);
if (dialog.exec() == QDialog::Accepted)
{
tryagain = true;
continue;
}
else
{
emitFailed(tr("Received undetermined session status during login."));
return;
}
}
// we own Minecraft, there is a profile, it's all ready to go!
launchInstance();
return;
}
else {
launchInstance();
// play demo ?
QMessageBox box(m_parentWidget);
box.setWindowTitle(tr("Play demo?"));
box.setText(tr("This account does not own Minecraft.\nYou need to purchase the game first to play it.\n\nDo you want to play the demo?"));
box.setIcon(QMessageBox::Warning);
auto demoButton = box.addButton(tr("Play Demo"), QMessageBox::ButtonRole::YesRole);
auto cancelButton = box.addButton(tr("Cancel"), QMessageBox::ButtonRole::NoRole);
box.setDefaultButton(cancelButton);
box.exec();
if(box.clickedButton() == demoButton) {
// play demo here
m_session->MakeDemo();
launchInstance();
}
else {
emitFailed(tr("Launch cancelled - account does not own Minecraft."));
}
}
return;
}
@ -213,6 +290,18 @@ void LaunchController::login() {
emitFailed(errorString);
return;
}
case AccountState::Disabled: {
auto errorString = tr("The launcher's client identification has changed. Please remove this account and add it again.");
QMessageBox::warning(
m_parentWidget,
tr("Client identification changed"),
errorString,
QMessageBox::StandardButton::Ok,
QMessageBox::StandardButton::Ok
);
emitFailed(errorString);
return;
}
case AccountState::Gone: {
auto errorString = tr("The account no longer exists on the servers. It may have been migrated, in which case please add the new account you migrated this one to.");
QMessageBox::warning(
@ -287,13 +376,13 @@ void LaunchController::launchInstance()
}
m_launcher->prependStep(new TextPrint(m_launcher.get(), resolved_servers, MessageLevel::Launcher));
} else {
online_mode = "offline";
online_mode = m_demo ? "demo" : "offline";
}
m_launcher->prependStep(new TextPrint(m_launcher.get(), "Launched instance in " + online_mode + " mode\n", MessageLevel::Launcher));
// Prepend Version
m_launcher->prependStep(new TextPrint(m_launcher.get(), BuildConfig.LAUNCHER_NAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher));
m_launcher->prependStep(new TextPrint(m_launcher.get(), BuildConfig.LAUNCHER_DISPLAYNAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher));
m_launcher->start();
}

View File

@ -1,3 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <QObject>
#include <BaseInstance.h>
@ -28,6 +63,10 @@ public:
m_online = online;
}
void setDemo(bool demo) {
m_demo = demo;
}
void setProfiler(BaseProfilerFactory *profiler) {
m_profiler = profiler;
}
@ -66,6 +105,7 @@ private slots:
private:
BaseProfilerFactory *m_profiler = nullptr;
bool m_online = true;
bool m_demo = false;
InstancePtr m_instance;
QWidget * m_parentWidget = nullptr;
InstanceWindow *m_console = nullptr;

View File

@ -14,17 +14,21 @@ if [[ $EUID -eq 0 ]]; then
fi
LAUNCHER_NAME=@Launcher_Name@
LAUNCHER_NAME=@Launcher_APP_BINARY_NAME@
LAUNCHER_DIR="$(dirname "$(readlink -f "$0")")"
echo "Launcher Dir: ${LAUNCHER_DIR}"
# Set up env - filter out input LD_ variables but pass them in under different names
export GAME_LIBRARY_PATH=${GAME_LIBRARY_PATH-${LD_LIBRARY_PATH}}
export GAME_PRELOAD=${GAME_PRELOAD-${LD_PRELOAD}}
export LD_LIBRARY_PATH="${LAUNCHER_DIR}/bin":$LAUNCHER_LIBRARY_PATH
export LD_PRELOAD=$LAUNCHER_PRELOAD
export QT_PLUGIN_PATH="${LAUNCHER_DIR}/plugins"
export QT_FONTPATH="${LAUNCHER_DIR}/fonts"
# Set up env.
# Pass our custom variables separately so that the launcher can remove them for child processes
export LAUNCHER_LD_LIBRARY_PATH="${LAUNCHER_DIR}/lib@LIB_SUFFIX@"
export LAUNCHER_LD_PRELOAD=""
export LAUNCHER_QT_PLUGIN_PATH="${LAUNCHER_DIR}/plugins"
export LAUNCHER_QT_FONTPATH="${LAUNCHER_DIR}/fonts"
export LD_LIBRARY_PATH="$LAUNCHER_LD_LIBRARY_PATH:$LD_LIBRARY_PATH"
export LD_PRELOAD="$LAUNCHER_LD_PRELOAD:$LD_PRELOAD"
export QT_PLUGIN_PATH="$LAUNCHER_QT_PLUGIN_PATH:$QT_PLUGIN_PATH"
export QT_FONTPATH="$LAUNCHER_QT_FONTPATH:$QT_FONTPATH"
# Detect missing dependencies...
DEPS_LIST=`ldd "${LAUNCHER_DIR}"/plugins/*/*.so 2>/dev/null | grep "not found" | sort -u | awk -vORS=", " '{ print $1 }'`

View File

@ -1,6 +1,42 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "LoggedProcess.h"
#include "MessageLevel.h"
#include <QDebug>
#include <QTextDecoder>
#include "MessageLevel.h"
LoggedProcess::LoggedProcess(QObject *parent) : QProcess(parent)
{
@ -8,7 +44,11 @@ LoggedProcess::LoggedProcess(QObject *parent) : QProcess(parent)
connect(this, &QProcess::readyReadStandardOutput, this, &LoggedProcess::on_stdOut);
connect(this, &QProcess::readyReadStandardError, this, &LoggedProcess::on_stdErr);
connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(on_exit(int,QProcess::ExitStatus)));
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(this, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(on_error(QProcess::ProcessError)));
#else
connect(this, SIGNAL(error(QProcess::ProcessError)), this, SLOT(on_error(QProcess::ProcessError)));
#endif
connect(this, &QProcess::stateChanged, this, &LoggedProcess::on_stateChange);
}
@ -20,25 +60,26 @@ LoggedProcess::~LoggedProcess()
}
}
QStringList reprocess(const QByteArray & data, QString & leftover)
QStringList reprocess(const QByteArray& data, QTextDecoder& decoder)
{
QString str = leftover + QString::fromLocal8Bit(data);
str.remove('\r');
QStringList lines = str.split("\n");
leftover = lines.takeLast();
auto str = decoder.toUnicode(data);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed, QString::SkipEmptyParts);
#else
auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed, Qt::SkipEmptyParts);
#endif
return lines;
}
void LoggedProcess::on_stdErr()
{
auto lines = reprocess(readAllStandardError(), m_err_leftover);
auto lines = reprocess(readAllStandardError(), m_err_decoder);
emit log(lines, MessageLevel::StdErr);
}
void LoggedProcess::on_stdOut()
{
auto lines = reprocess(readAllStandardOutput(), m_out_leftover);
auto lines = reprocess(readAllStandardOutput(), m_out_decoder);
emit log(lines, MessageLevel::StdOut);
}
@ -47,18 +88,6 @@ void LoggedProcess::on_exit(int exit_code, QProcess::ExitStatus status)
// save the exit code
m_exit_code = exit_code;
// Flush console window
if (!m_err_leftover.isEmpty())
{
emit log({m_err_leftover}, MessageLevel::StdErr);
m_err_leftover.clear();
}
if (!m_out_leftover.isEmpty())
{
emit log({m_err_leftover}, MessageLevel::StdOut);
m_out_leftover.clear();
}
// based on state, send signals
if (!m_is_aborting)
{
@ -157,19 +186,6 @@ void LoggedProcess::on_stateChange(QProcess::ProcessState state)
}
}
#if defined Q_OS_WIN32
#include <windows.h>
#endif
qint64 LoggedProcess::processId() const
{
#ifdef Q_OS_WIN
return pid() ? pid()->dwProcessId : 0;
#else
return pid();
#endif
}
void LoggedProcess::setDetachable(bool detachable)
{
m_is_detachable = detachable;

View File

@ -1,21 +1,42 @@
/* Copyright 2013-2021 MultiMC Contributors
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <QProcess>
#include <QTextDecoder>
#include "MessageLevel.h"
/*
@ -43,7 +64,6 @@ public:
State state() const;
int exitCode() const;
qint64 processId() const;
void setDetachable(bool detachable);
@ -69,8 +89,8 @@ private:
void changeState(LoggedProcess::State state);
private:
QString m_err_leftover;
QString m_out_leftover;
QTextDecoder m_err_decoder = QTextDecoder(QTextCodec::codecForLocale());
QTextDecoder m_out_decoder = QTextDecoder(QTextCodec::codecForLocale());
bool m_killed = false;
State m_state = NotRunning;
int m_exit_code = 0;

View File

@ -1,8 +0,0 @@
#pragma once
#include <QString>
namespace Strings
{
int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs);
}

View File

@ -28,11 +28,11 @@ QString Time::prettifyDuration(int64_t duration) {
int days = (int) (duration / 24);
if((hours == 0)&&(days == 0))
{
return QObject::tr("%1m %2s").arg(minutes).arg(seconds);
return QObject::tr("%1min %2s").arg(minutes).arg(seconds);
}
if (days == 0)
{
return QObject::tr("%1h %2m").arg(hours).arg(minutes);
return QObject::tr("%1h %2min").arg(hours).arg(minutes);
}
return QObject::tr("%1d %2h %3m").arg(days).arg(hours).arg(minutes);
return QObject::tr("%1d %2h %3min").arg(days).arg(hours).arg(minutes);
}

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