-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
320bb5a
commit ada0847
Showing
199 changed files
with
10,889 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DrawRoute } from "../../lib/routes/Draw/DrawRoute"; | ||
import { t } from "../i18n"; | ||
|
||
export async function generateMetadata() { | ||
return { | ||
title: t("draw-route.meta.title"), | ||
description: t("draw-route.meta.description"), | ||
}; | ||
} | ||
|
||
export default async function CharacterPage() { | ||
return <DrawRoute></DrawRoute>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
lib/contexts/CharacterTemplatesContext/CharacterTemplatesContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client"; | ||
import { createContext } from "react"; | ||
import { ICharacterTemplate } from "../../services/character-templates/CharacterTemplateService"; | ||
|
||
export const CharacterTemplatesContext = createContext<{ | ||
templates: Array<ICharacterTemplate>; | ||
}>(undefined as any); | ||
|
||
export const CharacterTemplatesProvider = CharacterTemplatesContext.Provider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +0,0 @@ | ||
let allCharactersTemplatesFiles: Record< | ||
string, | ||
() => Promise<{ | ||
[key: string]: any; | ||
}> | ||
> = {}; | ||
try { | ||
// allCharactersTemplatesFiles = import.meta.glob( | ||
// "./character-templates/*/*.json" | ||
// ); | ||
} catch (error) {} | ||
|
||
export type ICharacterTemplate = { | ||
category: string; | ||
fileName: string; | ||
importFunction: any; | ||
}; | ||
|
||
export const allTemplates = Object.keys(allCharactersTemplatesFiles).reduce( | ||
(acc: Array<ICharacterTemplate>, fileLocation): Array<ICharacterTemplate> => { | ||
const importFunction = allCharactersTemplatesFiles[fileLocation]; | ||
|
||
const folderAndFileName = fileLocation | ||
.split("./character-templates/") | ||
.join(""); | ||
const folderName = folderAndFileName.split("/")[0]; | ||
const fileName = folderAndFileName.split("/")[1].split(".json")[0]; | ||
|
||
return [ | ||
...acc, | ||
{ | ||
fileName, | ||
category: folderName, | ||
importFunction, | ||
}, | ||
]; | ||
}, | ||
[], | ||
); | ||
|
||
export const CharacterTemplates = [...allTemplates].sort((a, b) => { | ||
if (a.category === "Fari RPGs" && b.category === "Fari RPGs") { | ||
return a.fileName.length - b.fileName.length; | ||
} | ||
|
||
if (a.category === "Fari RPGs") { | ||
return -1; | ||
} | ||
|
||
if (a.category === b.category) { | ||
return a.fileName.length - b.fileName.length; | ||
} | ||
return 0; | ||
}); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import { ICharacterTemplate } from "./CharacterType"; | ||
import { ICharacterTemplate } from "../../services/character-templates/CharacterTemplateService"; | ||
|
||
export const DefaultTemplates = { | ||
BlankTemplate: { | ||
category: "Default", | ||
fileName: "Blank", | ||
importFunction: async () => | ||
import("./character-templates/Defaults/Blank.json"), | ||
publisher: "Default", | ||
name: "Blank", | ||
fetchPath: "/public/character-templates/Blank/Blank.json", | ||
} as ICharacterTemplate, | ||
FateCondensed: { | ||
category: "Default", | ||
fileName: "FateCondensed", | ||
importFunction: async () => | ||
import("./character-templates/Fate Condensed/Fate Condensed.json"), | ||
} as ICharacterTemplate, | ||
FateAccelerated: { | ||
category: "Default", | ||
fileName: "FateAccelerated", | ||
importFunction: async () => | ||
import("./character-templates/Fate Accelerated/Fate Accelerated.json"), | ||
} as ICharacterTemplate, | ||
publisher: "Default", | ||
name: "FateCondensed", | ||
fetchPath: "/public/character-templates/Fate Condensed/Fate Condensed.json", | ||
FateAccelerated: { | ||
publisher: "Default", | ||
name: "FateAccelerated", | ||
fetchPath: | ||
"/public/character-templates/Fate Accelerated/Fate Accelerated.json", | ||
} as ICharacterTemplate, | ||
}, | ||
} as const; |
1 change: 0 additions & 1 deletion
1
lib/domains/character/character-templates/Adventurers/Adventurers Revised.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
lib/domains/character/character-templates/Blade Runner/Case File Time Tracker.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.