Skip to content

Commit

Permalink
rename "name" to "title" in jext.json
Browse files Browse the repository at this point in the history
  • Loading branch information
spartacus04 committed Mar 22, 2024
1 parent df3c2fe commit ef5d1ff
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/CreateDiscModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
const { discTexture, fragmentTexture } = await randomTextures();
const disc : Disc = {
name,
title: name,
author,
"creeper-drop": true,
"model-data": -1,
Expand Down Expand Up @@ -91,7 +91,7 @@
{#if disc.uploadData}
<img src={URL.createObjectURL(disc.uploadData.uploadedTexture)} alt="Disc texture" class="w-10 h-10" />
{/if}
<p>{disc.name} - {disc.author}</p>
<p>{disc.title} - {disc.author}</p>
</div>
{/await}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/EditDiscModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$: multiple = discNamespaces.length > 1;
export let tempDisc : {
name: { value: string, edited: boolean },
title: { value: string, edited: boolean },
author: { value: string, edited: boolean },
"creeper-drop": { value: boolean, edited: boolean },
lores: { value: string[], edited: boolean },
Expand All @@ -47,7 +47,7 @@
}
tempDisc = {
name: { value: discs.every(disc => disc.name === discs[0].name) ? discs[0].name : "", edited: false },
title: { value: discs.every(disc => disc.title === discs[0].title) ? discs[0].title : "", edited: false },
author: { value: discs.every(disc => disc.author === discs[0].author) ? discs[0].author : "", edited: false },
"creeper-drop": { value: discs.every(disc => disc["creeper-drop"] === discs[0]["creeper-drop"]) ? discs[0]["creeper-drop"] : false, edited: false },
lores: { value: discs.every(disc => disc.lores === discs[0].lores) ? discs[0].lores : [], edited: false },
Expand Down Expand Up @@ -233,14 +233,14 @@
}} />
</div>
<div class="flex flex-col flex-1 justify-around gap-2">
<MinecraftTextbox placeholder="Name" bind:value={tempDisc.name.value} on:input={() => setUpdatedPropery('name')} />
<MinecraftTextbox placeholder="Name" bind:value={tempDisc.title.value} on:input={() => setUpdatedPropery('name')} />
<MinecraftTextbox placeholder="Author" bind:value={tempDisc.author.value} on:input={() => setUpdatedPropery('author')}/>
</div>
</div>

<div class="h-2 border-b-2 border-[#232323] mb-2" />

<FormatEditor on:input={() => setUpdatedPropery('lores')} bind:split={tempDisc.lores.value} text={initalText} firstline={tempDisc.author.value != '' ? `${tempDisc.name.value} - ${tempDisc.author.value}` : tempDisc.name.value} />
<FormatEditor on:input={() => setUpdatedPropery('lores')} bind:split={tempDisc.lores.value} text={initalText} firstline={tempDisc.author.value != '' ? `${tempDisc.title.value} - ${tempDisc.author.value}` : tempDisc.title.value} />

<div class="h-2 border-b-2 border-[#232323] mb-2" />

Expand Down
2 changes: 1 addition & 1 deletion src/lib/resourcepack/discs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Disc } from "$lib/types";
import disc_template from "$lib/assets/disc_template.png";
import fragment_template from "$lib/assets/fragment_template.png";

export const namespace = (disc: Disc) => `${disc.name}${disc.author}${disc["model-data"]}`
export const namespace = (disc: Disc) => `${disc.title}${disc.author}${disc["model-data"]}`
.replace(/[^a-zA-Z0-9]/g, '')
.replaceAll('1', 'one')
.replaceAll('2', 'two')
Expand Down
2 changes: 1 addition & 1 deletion src/lib/resourcepack/exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const processResources = async (onError: (err : string) => unknown, onPro
track: track
}

disc['disc-namespace'] = `${disc.name}${disc.author}${disc["model-data"]}`
disc['disc-namespace'] = `${disc.title}${disc.author}${disc["model-data"]}`
.replace(/[^a-zA-Z0-9]/g, '')
.replaceAll('1', 'one')
.replaceAll('2', 'two')
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ConfigNode<T> {
}

export interface Disc {
name: string,
title: string,
author: string,
duration: number,
"disc-namespace": string,
Expand Down
10 changes: 5 additions & 5 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
discsStore.subscribe((discs) => {
discs.forEach((disc, i) => {
if (disc.uploadData) {
disc['disc-namespace'] = `${disc.name}${disc.author}${i}`
disc['disc-namespace'] = `${disc.title}${disc.author}${i}`
.replace(/[^a-zA-Z0-9]/g, '')
.replaceAll('1', 'one')
.replaceAll('2', 'two')
Expand Down Expand Up @@ -306,7 +306,7 @@
<h3
class="h3 font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden"
>
{disc.name}
{disc.title}
</h3>
<p
class="p font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden text-mc-light-gray"
Expand All @@ -329,7 +329,7 @@
<h3
class="h3 font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden"
>
{disc.name}
{disc.title}
</h3>
<p
class="p font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden text-mc-light-gray"
Expand Down Expand Up @@ -395,7 +395,7 @@
<h3
class="h3 font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden"
>
{disc.name}
{disc.title}
</h3>
<p
class="p font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden text-mc-light-gray"
Expand All @@ -418,7 +418,7 @@
<h3
class="h3 font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden"
>
{disc.name}
{disc.title}
</h3>
<p
class="p font-minecraft text-ellipsis w-[calc(100%)] whitespace-nowrap overflow-hidden text-mc-light-gray"
Expand Down

0 comments on commit ef5d1ff

Please sign in to comment.