Commit Graph

1198 Commits

Author SHA1 Message Date
flow
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
flow
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
flow
be8c6f218c
refactor: setAbortStatus -> setAbortable
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:10 -03:00
flow
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
flow
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
flow
2dd372600c
fix: some abort-related issues
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
flow
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
flow
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
flow
87002fb8f8
fix: hook up setAbortStatus in instance import tasks
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
flow
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
flow
6541570969
fix: simplify abort handling and add missing emits
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:09 -03:00
flow
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
flow
8c0816c166
feat: add override awareness to CF modpack updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
flow
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
flow
3a9d58e31c
feat: add override handling in modrinth pack update
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
flow
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
flow
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
flow
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
flow
795d6f35ee
feat: add curseforge modpack updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00
flow
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
flow
72d2ca234e
refactor: move flame modpack import to separate file
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:07 -03:00
flow
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
flow
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
flow
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
flow
4441b37338
refactor: move modrinth modpack import to separate file
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:32:36 -03:00
flow
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
flow
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
Sefa Eyeoglu
a24d589845
fix: ensure all resource folders exist
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:39:05 +02:00
Sefa Eyeoglu
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
Sefa Eyeoglu
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
Sefa Eyeoglu
aad6f74db6
fix: tests
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
Sefa Eyeoglu
07dcefabcb
feat: add texture pack parsing
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-09-20 10:26:15 +02:00
txtsd
40c68595d7
Merge pull request #1150 from flowln/fix_crash_on_game_quit 2022-09-20 09:41:59 +05:30
txtsd
fe9a4fece4
Merge pull request #1142 from flowln/better_fs 2022-09-20 09:00:19 +05:30
flow
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
flow
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
flow
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
flow
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
flow
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
flow
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
flow
11216d200c change: move demo action to "Play offline" menu
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-15 18:44:18 -03:00
jopejoe1
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
jopejoe1
29dcb9d274 Added Launch Demo button.
Signed-off-by: jopejoe1 <johannes@joens.email>
2022-09-15 18:44:18 -03:00
Sefa Eyeoglu
1ca2be0039
Merge pull request #982 from DavidoTek/windarkmode2 2022-09-14 13:17:17 +02:00
flow
ee0fb2d0e0
fix: use std::wstring for Windows filenames
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:24 -03:00
flow
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
flow
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
flow
1cf949226e
refactor: use std::filesystem for overrides
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
flow
be3fae6511
refactor: use std::filesystem for path deletion
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00
flow
5932f36285
refactor: use std::filesystem for file copy
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-12 13:07:23 -03:00