Compare commits

...

3 commits

4 changed files with 14 additions and 3 deletions

View file

@ -51,7 +51,7 @@ export default function AdminBanner() {
return (
<>
{shouldShow && message && (
<div className="relative w-full min-h-10 bg-orange-300 border-y-2 border-y-orange-400 mt-1 pl-2 shadow-md flex justify-center text-orange-900 text-nowrap overflow-x-auto font-semibold max-sm:justify-between">
<div className="relative w-full min-h-10 bg-orange-300 border-y-2 border-y-orange-400 mt-1 pl-2 shadow-md flex justify-center items-center text-orange-900 text-nowrap overflow-x-auto font-semibold max-sm:justify-between">
<div className="flex gap-2 h-full items-center w-fit">
<Icon icon="humbleicons:exclamation" className="text-2xl min-w-6" />
<span>{message}</span>

View file

@ -21,6 +21,7 @@ export default function FilterMenu() {
const rawTags = searchParams.get("tags") || "";
const rawExclude = searchParams.get("exclude") || "";
const allowCopying = (searchParams.get("allowCopying") as unknown as boolean) || false;
const isFromSaveFile = (searchParams.get("isFromSaveFile") as unknown as boolean) || false;
const tags = useMemo(
() =>
@ -66,9 +67,10 @@ export default function FilterMenu() {
if (gender) count++;
if (allowCopying) count++;
if (makeup) count++;
if (isFromSaveFile) count++;
setFilterCount(count);
}, [tags, exclude, platform, gender, allowCopying, makeup]);
}, [tags, exclude, platform, gender, allowCopying, makeup, isFromSaveFile]);
return (
<div className="relative">

View file

@ -46,7 +46,7 @@ export default function ProfileLayout() {
const isAdmin = userId === Number(import.meta.env.VITE_ADMIN_USER_ID);
const isContributor = import.meta.env.VITE_CONTRIBUTORS_USER_IDS?.split(",").includes(String(user?.id));
const isOwnProfile = userId === user?.id;
const isOwnProfile = $session?.user?.id && userId === Number($session.user.id);
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
const metaTitle = `${user.name} - TomodachiShare`;

View file

@ -91,6 +91,15 @@ export class SwitchTomodachiLifeMii {
const decompressed = Buffer.from(fzstd.decompress(canvasData));
const deswizzled = new BytesDeswizzle(decompressed, [256, 256], [1, 1], 4, 4).deswizzle();
// Issue (#47)
const gamma = 0.4545;
for (let i = 0; i < deswizzled.length; i += 4) {
deswizzled[i] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i] / 255, gamma)));
deswizzled[i + 1] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i + 1] / 255, gamma)));
deswizzled[i + 2] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i + 2] / 255, gamma)));
}
return await sharp(deswizzled, {
raw: { width: 256, height: 256, channels: 4 },
})