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

Skin management #1609

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

Skin management #1609

wants to merge 29 commits into from

Conversation

Trial97
Copy link
Member

@Trial97 Trial97 commented Sep 4, 2023

fixes #330
fixes #2409
Implemented:

  • manage skins similar to icons
  • visualize the 2D textures
  • on the first load try to get the data from the official Minecraft launcher
  • if Prism does not manage the current skin pull it as a new skin
  • saves the cape and the skin model with a specific
  • add skins from the local file
  • importing from a specific user skin or from a URL

Refactored and already there:

  • change skins
  • change cape
  • reset skin

Not implemented and not gonna implement them in this PR:

  • 3d view of texture or any fancy texture display(I have no idea on how to do that and from what I saw that would also require extra dependencies, e.g. opengl as minimum and maybe core3d for ease)
  • ability to select a skin server

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97 Trial97 added enhancement New feature or request needs-testing PRs that should be tested a bit more before being merged changelog:added A PR that appears under "Added" in the changelog labels Sep 4, 2023
@TheKodeToad
Copy link
Member

Looks like there's some less ambitious stuff that's not done. Should this be a draft or can those be done later?

@Trial97
Copy link
Member Author

Trial97 commented Sep 4, 2023

Regarding the not implemented stuff, I do not feel like doing them at all(partially because of the fact that I do not have any idea on how). Obviously I'm ok if there is somebody willing to extend this PR by implementing the mentioned stuff. As this PR solves the basic issue we can have separate PRs for the stuff I did not implemented.
Regarding the failing build I will have a look tomorrow (I'm a little tired).

@TheKodeToad
Copy link
Member

I think using an existing player's skin should be easy

@TheKodeToad
Copy link
Member

I don't think getting data from the official launcher is a great idea:

  • it doesn't happen with anything else
  • it's a proprietary format prone to change
  • it won't work in sandboxed environments

@Trial97 Trial97 marked this pull request as draft September 5, 2023 07:18
@TheKodeToad
Copy link
Member

Removing that would also fix actions (although there's probably something that works with Qt5)

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97 Trial97 marked this pull request as ready for review September 5, 2023 17:22
@Trial97
Copy link
Member Author

Trial97 commented Sep 5, 2023

Ok removed the default launcher stuff.
Added more import options(from a username and from a URL)
Some open items:

  • Do I need to check if two skins are the same? If yes any fast way of doing that?
  • I always rewrite the files on import; Do I need to implement some sort of protection for that or can I leave it as is?
  • I know that I'm not good at designing GUI so do not expect this to look so good(I need a little help on that)

@TayouVR
Copy link
Member

TayouVR commented Sep 5, 2023

3d view of texture

I wanted to implement this, with support for ears x3
Maybe if I have the time and motivation for it i could look into it after this PR.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Copy link
Member

@TayouVR TayouVR left a comment

Choose a reason for hiding this comment

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

I tried renaming a skin and it duplicated it, keeping the original file.
can't reproduce it though and log doesn't say anything about it either as far as i can see.

Also just looked through the code to see if I can find how that could happen...
does FS::move perform a copy if the original file can't be deleted for whichever reason?

Edit: I can reproduce it. If the Skin has a url attached it seems to duplicate when renaming

image
owo and Ears_Wings2 are both from renaming the one with the id as name

Edit2: I am also not able to delete that one in the UI;
prismlauncher_imSSiLpQvk

Edit3: also renaming causes the playermodel (and cape presumably) to be reset, I assume because the rename function just renames the file, it doesn't actually take care of updating the json?

Copy link
Member

@TayouVR TayouVR left a comment

Choose a reason for hiding this comment

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

renaming needs to be handled better, whatever is up with the user-id based skin not being possible to be deleted needs to be changed or better communicated.

 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97
Copy link
Member Author

Trial97 commented Oct 25, 2023

Yeah, you can not remove the current skin. Let me see what I can do regarding that and the rename stuff.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97
Copy link
Member Author

Trial97 commented Oct 26, 2023

Fixed that too. It was a case mismatch the API returned "SLIM" I checked for "slim".

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@TheKodeToad TheKodeToad added this to the 9.0 milestone Nov 19, 2023
@getchoo getchoo self-requested a review March 27, 2024 17:47
@Trial97 Trial97 removed the needs-testing PRs that should be tested a bit more before being merged label Apr 24, 2024
Trial97 and others added 5 commits May 18, 2024 10:36
Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
 into skin_selector

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97
Copy link
Member Author

Trial97 commented May 21, 2024

@getchoo you already said you will review
image

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

most of this LGTM and works well. just two notes:

  • errors are silently ignored. they probably shouldn't be
    • this is very confusing when trying to import the skin of another player for example. if i type the name in wrong and press "import user", i only see a flash of a loading screen that appears to do nothing
    • this also can fool you into thinking your changes applied, when in reality they didn't
  • non-reproducible crash
    • when changing from the slim to classic model, the entire launcher crashed. i had sadly not launched it from the cli so no errors. i haven't been able to replicate it since, and i'd imagine this is an issue in NetJob/Request instead of being introduced here. not going to make this blocker due to that, but something i figured i should bring up

@Trial97
Copy link
Member Author

Trial97 commented May 30, 2024

Added the error message for that buttons, but could not produce any crash so nothing on that front

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

everything else seems good. last issue i've found is that the error messages do display when importing a user's skin, but not when importing from a url

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
if (Parsers::parseMinecraftProfileMojang(*profileOut, mcProfile)) {
downloadSkin->setUrl(mcProfile.skin.url);
} else {
job->abort();
Copy link
Contributor

Choose a reason for hiding this comment

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

should this branch report the error to the user?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, as I consider all steps a whole task here: I display a generic fail message at the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

I take it you mean the error if the resulting skin after all the tasks end isn't valid?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes: if the task fails in any way the skin is not downloaded to path making it invalid

@Ryex
Copy link
Contributor

Ryex commented Jun 9, 2024

other than those two points things look good code wise and I think the interface looks good too

@Trial97
Copy link
Member Author

Trial97 commented Jun 9, 2024

other than those two points things look good code wise and I think the interface looks good too

you pointed out just one. What is the other one

Comment on lines +419 to +422
connect(getUUID.get(), &Task::aborted, uuidLoop.get(), &WaitTask::quit);
connect(getUUID.get(), &Task::failed, uuidLoop.get(), &WaitTask::quit);
connect(getProfile.get(), &Task::aborted, profileLoop.get(), &WaitTask::quit);
connect(getProfile.get(), &Task::failed, profileLoop.get(), &WaitTask::quit);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the failed events should use some logging and or inform the user of the failed task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:added A PR that appears under "Added" in the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change skin upload wording to Wide/Slim Improve the skin/cape selection UI.
6 participants