Commit Graph

4549 Commits

Author SHA1 Message Date
flow
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
flow
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
flow
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
flow
0331f5a1eb
feat(tests): add tests for resource pack parsing
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00
flow
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
flow
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
flow
dd9e30b24a
feat: add resource icon to InfoFrame
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
flow
6a93688b2e
fix: filtering in regex search in resource packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
flow
3ab17a97a8
fix: sorting by pack format
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:21 -03:00
flow
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
flow
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
flow
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
flow
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
Sefa Eyeoglu
2f167b1512
Merge pull request #1095 from flowln/ensure_file_path_in_override 2022-09-01 09:54:22 +02:00
flow
ba3ac85356
Merge pull request #1067 from Scrumplex/classpath-epicness
Move classpath definition into NewLaunch itself
2022-08-31 18:28:29 -03:00
flow
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
flow
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
flow
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
flow
2186b134a4
fix: Mod type enum -> Resource type enum
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-28 14:47:52 -03:00
Sefa Eyeoglu
f371ec210c
Merge pull request #1052 from flowln/resource_model 2022-08-28 16:52:53 +02:00
Sefa Eyeoglu
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
flow
fbf542d205
Merge pull request #1087 from DioEgizio/fix-ftblegacy-url
fix: fix urls on ftb legacy
2022-08-24 20:37:07 -03:00
DioEgizio
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
flow
ddf1e1ccee
fix: make FML libraries cache eternal
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-21 13:47:49 -03:00
flow
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
flow
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
flow
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
flow
0b81b283bf
fix: LGTM warnings
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:49:56 -03:00
flow
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
flow
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
flow
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
flow
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
flow
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
flow
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
flow
256f8094f5
refactor: make Resource Pack model inherit from ResourceFolderModel
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20 10:47:11 -03:00
flow
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
flow
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
flow
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
flow
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
flow
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
flow
2dcff83be7
Merge pull request #1035 from Scrumplex/fix-coremods
Make Coremods / Mods seperation more clear
2022-08-20 10:15:50 -03:00
Sefa Eyeoglu
afb9ebcd99
fix: distinguish Coremods
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-08-20 12:53:13 +02:00
Sefa Eyeoglu
92d7e44525
Merge pull request #878 from flowln/lazy_settings 2022-08-20 12:50:56 +02:00
Sefa Eyeoglu
a517f442ea
Merge pull request #1023 from flowln/better_shared_ptr 2022-08-20 12:50:50 +02:00
Sefa Eyeoglu
311758233b
Merge pull request #1044 from flowln/better_orphan_fix 2022-08-20 12:50:43 +02:00
Sefa Eyeoglu
6e086eb808
Merge pull request #992 from Scrumplex/refactor-version 2022-08-20 12:50:25 +02:00
Sefa Eyeoglu
7e8644430c
Merge pull request #1007 from Gingeh/disable-update-button 2022-08-20 12:50:19 +02:00
Sefa Eyeoglu
70a8f6743a
Merge pull request #919 from kumquat-ir/download-all-blocked 2022-08-20 12:50:01 +02:00
dada513
69eafd0e11
Merge pull request #1058 from DioEgizio/fix-update-org.polymc.PolyMC.metainfo.xml.in 2022-08-19 20:34:11 +02:00
DioEgizio
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