Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable mod update check #1170

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

Erogig
Copy link

@Erogig Erogig commented Sep 29, 2022

closes #1135 (mostly)

Works using a bool which I added to the metadata of mods called do_updates.

Adds a button beneath "Check for Updates" which disables the update check for the selected mod. The button simply inverts the do_updates bool which can be weird if several mods are selected. Because of this, there is no good way of setting all mods to be updated upon update checks.

The problem above is worsened because I can't figure out how to add an indicator for this setting like #1135 mentioned.

Despite all this the function does technically work although would need a lot of improvement in the future.

image

image

image

image

Add do_updates bool in metadata and check the bool before adding mod to mods list

Signed-off-by: ErogigGit <erogigabyte@gmail.com>
add button to mod menu for inverting the do_updates boolean in metadata

Signed-off-by: ErogigGit <erogigabyte@gmail.com>
Copy link
Contributor

@flowln flowln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

indeed, not having an indicator for this option is a big problem. Though, I think this can be solved by adding another column in ModFolderModel, relating to this setting. similar to the leftmost one, though i'm not sure whether it'll work or not. I can give it a try if i find some time to, but not sure when that'll be, so feel free to try it yourself (but i think we shouldn't merge this PR without at least some sort of visual indicator)

another issue is that these configurations are not saved in disk, so they are forgotten when we close the launcher. not sure if we want them to be saved, but considering all other things you do in that page are saved, having this one thing not be seems a bit weird.

launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
Erogig and others added 5 commits September 29, 2022 18:55
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: ErogigGit <89475886+ErogigGit@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: ErogigGit <89475886+ErogigGit@users.noreply.github.com>
Signed-off-by: ErogigGit <erogigabyte@gmail.com>
Signed-off-by: ErogigGit <erogigabyte@gmail.com>
Not currently connected to the bool and will always display "⭳"

Signed-off-by: ErogigGit <erogigabyte@gmail.com>
@Erogig
Copy link
Author

Erogig commented Sep 30, 2022

currently sorts based on the new column by default

@flowln flowln self-requested a review October 1, 2022 17:11
@flowln flowln added the enhancement New feature or request label Oct 1, 2022
Copy link
Contributor

@flowln flowln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing that particularly sticks out is that the text on the sidebar for disabling the check is quite big, so the sidebar keeps growing and shrinking when moving the selection, which is quite annoying.

also, idk if you're using the debug build, but having assertions enabled triggers the one in https://github.com/PolyMC/PolyMC/blob/develop/launcher/minecraft/mod/ResourceFolderModel.cpp#L479, because you didn't change the sorting keys in the ModFolderModels constructor. For that, the best solution would be to add a new sorting key in Resource.h, and add the sorting logic for it in Mod.cpp, probably similar to the logic from the ENABLED sort key in Resource.cpp. The comments in Resource.h and ResourceFolderModel.h may help a great deal!

launcher/minecraft/mod/ModFolderModel.cpp Outdated Show resolved Hide resolved
launcher/minecraft/mod/ModFolderModel.h Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/ModFolderPage.cpp Outdated Show resolved Hide resolved
@Erogig
Copy link
Author

Erogig commented Oct 6, 2022

I'm unsure how to go about saving the boolean. The only ideas I can think of are eighter a text file or changing the filenames of the mods and I'm wondering if there are better ways of doing this. If this isn't saved when the program is shut down, then I don't see the point of adding this.

@BeansBeefBroccoli
Copy link

I agree, if this reset all the time, it would be useless. I think a text file makes much more sense then renaming the mod file. Also, (I've heard) some mods break of their name is changed.

@flowln
Copy link
Contributor

flowln commented Oct 8, 2022

in the original packwiz specification, a mod is not be automatically updated if its metadata doesn't contain an [update] field. However, that would throw always our previous work of generating that part of the metadata in the first place, so it doesn't look super nice for an interactive environment such as ours.

we could, however, just add a boolean for this as another field in the metadata file itself, and treat it as selected for the check if the mod doesn't have metadata. While it's not in the original specification, other tools that use the same packwiz format ought to just ignore the field we add there, so it shouldn't cause any major problems. Maybe saving the boolean in a field inside the [update] section would work just fine too.

this way, you can keep most of what you've already done here!

(sorry for the wait in responding)

@Erogig
Copy link
Author

Erogig commented Oct 9, 2022

Still needs some slight changes

@DioEgizio
Copy link
Contributor

image

this thing looks pretty bad

@Erogig
Copy link
Author

Erogig commented Oct 10, 2022

image

this thing looks pretty bad

Probably because it is using unicode characters, although I thought qt supported them.

@DioEgizio
Copy link
Contributor

i can't seem to be able to disable update checking for mods without metadata, which kinda breaks the point of it, or at least limits an important use case of it

Signed-off-by: ErogigGit <erogigabyte@gmail.com>
Signed-off-by: ErogigGit <erogigabyte@gmail.com>
@DioEgizio
Copy link
Contributor

image

this thing looks pretty bad

this issue is still not fixed, and even if you found a way to fix it, it'd still be confusing for an end user to see a weird char without any explanation of what it means

@Erogig
Copy link
Author

Erogig commented Oct 12, 2022

image this thing looks pretty bad

this issue is still not fixed, and even if you found a way to fix it, it'd still be confusing for an end user to see a weird char without any explanation of what it means

Any recommendations on what to do instead? I don't really know what I can do to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[removed]
4 participants