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

Reduce Mii editor HTTP requests from 4 to 1 on every change #367

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

ariankordi
Copy link

Currently on the Pretendo Mii editor, four requests are made every single time a change is made to the Mii. Here's what those are and how this PR addresses them:

  • Two requests for icons meant for the save screen, representing the old Mii with a sorrow expression and new Mii with a happy expression.
    • Needlessly updated on every single change when they only show on the save screen.

Those icons are now deferred and not requested on every change.

  • Two more requests for the actual Mii head shown and a bald version.

The bald head is meant to maintain the neck when a Mii's hair goes behind it. Here's what would happen if you overlaid the head of such a Mii without accounting for this:

But more requests to Nintendo is never a good thing, and they have a solution for this that had not been in the mii-js repo for the longest time: the splitMode param puts the front part and back part of the head in the same image. That is used by this commit and the result looks like it should.

(I held off on submitting the PR to the website back in September because I thought it needed a corresponding change to add the splitMode field in mii-js. Nobody responded to my PR. Turns out it this still works without that. OOOOOOOPS!)

Requesting a split depth render results in getting two renders in one
image, the top half having the back half of the Mii head (usually the
hair) and then the bottom half having the front half.

This is needed for the Mii editor because it's drawing the body
manually, and you want some elements of the head (hair) to be behind the
body and the rest to be in front.

Previously, it solved this problem by loading a copy of the Mii head
that's bald, but this along with other stuff added up to four Mii Studio
requests on every render - now it's just one.

NOTE!!!!: This actually doesn't handle importing mii-js from the new
TypeScript project, so as of this commit it WILL NOT work - installing
the new repo, which this doesn't even reference, doesn't produce
compiled JS from the TS source, so it will simply not import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant