unitystation / unitystation

The original unitystation
https://unitystation.org
GNU Affero General Public License v3.0
704 stars 648 forks source link

Adds dynamic sizing to paletteable sprites #5405

Closed Ruzihm closed 3 years ago

Ruzihm commented 3 years ago

Paletteable sprites now support dynamic sizes of palettes from 1 to 256. The tool has been updated accordingly.

Unused swatches in paletted shoes have been removed and now they have palette size of 5 instead of 8.

Paletteable sprite docs have been improved as well.

Tool and docs have been reworded to use "swatch" instead of clunky "palette index", etc.

Refactors palette logic in SpriteHandler just a little to help with clarity.

See #2110

fixes #5419

Ruzihm commented 3 years ago

marvinj-0.9.js is a dependency. should we have codacy ignore that particular lib directory?

corp-0 commented 3 years ago

marvinj-0.9.js is a dependency. should we have codacy ignore that particular lib directory?

yes. Let me fix that for you.

corp-0 commented 3 years ago

do an empty push

Ruzihm commented 3 years ago

@corp-0 ok, done!

Bod9001 commented 3 years ago

oh yeah, NetUpdate have you changed that to support the new variable pallet length

Bod9001 commented 3 years ago

SpriteUpdateMessage if (spriteChange.Pallet.Count != 8) { Logger.Log("Pallet Is not the right length has to be eight it is " + spriteChange.Pallet.Count); ToReturn.Append("£"); return; }

        ToReturn.Append("%");

        foreach (var Colour in spriteChange.Pallet)
        {
            ToReturn.Append(Convert.ToChar(Mathf.RoundToInt(Colour.r * 255)));
            ToReturn.Append(Convert.ToChar(Mathf.RoundToInt(Colour.g * 255)));
            ToReturn.Append(Convert.ToChar(Mathf.RoundToInt(Colour.b * 255)));
            ToReturn.Append(Convert.ToChar(Mathf.RoundToInt(Colour.a * 255)));
        }
Ruzihm commented 3 years ago

oh yeah, NetUpdate have you changed that to support the new variable pallet length

Ooh no I didn't. thank you!!

Bod9001 commented 3 years ago

yeah, Variable length is going to be a bit strange to handle, ask me if you need any help with it

Bod9001 commented 3 years ago

probably just inserting numbers like 001 for the number of colours following should be good

Bod9001 commented 3 years ago

256 or rrepresenting that as a character

Bod9001 commented 3 years ago

yeah, is massive pain feel free throw out old system

Ruzihm commented 3 years ago

I figured it out :) Just need to test

NoooneyDude commented 3 years ago

Good to merge?

Ruzihm commented 3 years ago

@NoooneyDude not yet! Almost though :) Have a weird networking thing occurring

Bod9001 commented 3 years ago

remember there's a fake pass to clear out invalid IDs on the client, in the serialisation

Ruzihm commented 3 years ago

Actually, I'm having the same bug on this pull request as I am on develop... On client, all the wrong sprites are rendered for clothing and/or items-in-hand. Is there a step I need to do to fix that before building or something?

NoooneyDude commented 3 years ago

We're not sure what is triggering that bug you mention yet, though it could be related to issue #5417.

Ruzihm commented 3 years ago

Ah ok. If it's just my dev setup causing the weirdness then I'll push what I've got when I get to my dev machine later today then we can merge this.

Bod9001 commented 3 years ago

have you updated To the stuff in #5410

Ruzihm commented 3 years ago

No, I haven't done that.Thanks for pointing it out. Will try that before I push anything.

Bod9001 commented 3 years ago

Codacy Here is an overview of what got changed by this pull request:


Issues
======
+ Solved 2

See the complete overview on Codacy

Ruzihm commented 3 years ago

@NoooneyDude All ready for a merge!