checking in
This commit is contained in:
18
module.json
18
module.json
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"id": "rush-character-archive-foundry-module",
|
||||
"title": "Rush Character Archive",
|
||||
"description": "A module for sharing character files across foundry instances.",
|
||||
"version": "0.0.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "badgers"
|
||||
}
|
||||
],
|
||||
"compatibility": {
|
||||
"minimum": "11",
|
||||
"verified": "11"
|
||||
},
|
||||
"esmodules": [
|
||||
"scripts/index.js"
|
||||
]
|
||||
}
|
||||
916
package-lock.json
generated
916
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"rollup-plugin-copy": "^3.5.0",
|
||||
"rollup-plugin-scss": "^4.0.1",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^7.0.6"
|
||||
},
|
||||
|
||||
@@ -12,5 +12,6 @@
|
||||
"minimum": "11",
|
||||
"verified": "11"
|
||||
},
|
||||
"esmodules": ["scripts/module.js"]
|
||||
"esmodules": ["scripts/module.js"],
|
||||
"styles": ["styles.css"]
|
||||
}
|
||||
|
||||
1
src/styles/CharacterArchiver.scss
Normal file
1
src/styles/CharacterArchiver.scss
Normal file
@@ -0,0 +1 @@
|
||||
.window-app {}
|
||||
@@ -1,4 +1,4 @@
|
||||
<div>
|
||||
<section>
|
||||
<div class="details">
|
||||
<div class="character-name">Character to Archive: {{this.characterName}}</div>
|
||||
<input class="player-handle" value="{{this.playerHandle}}"/>
|
||||
@@ -12,23 +12,18 @@
|
||||
<th>Player</th>
|
||||
<th>Table</th>
|
||||
<th>Version</th>
|
||||
</tr>
|
||||
<th>Import</th>
|
||||
</trth>
|
||||
{{#each this.reads}}
|
||||
<tr>
|
||||
<td>{{this.characterName}}</td>
|
||||
<td>{{this.playerName}}</td>
|
||||
<td>{{this.sourceTable}}</td>
|
||||
<td>{{this.version}}</td>
|
||||
<td><button class="import-button" id="{{@index}}"">i</button></td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
<tr>
|
||||
<td><input class="character-alias" value="{{this.characterAlias}}"/></td>
|
||||
<td><input class="player-handle" value="{{this.playerHandle}}"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<button class="archive-button">Archive</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { id as moduleId } from "../../module.json";
|
||||
|
||||
import {MODULE_ID, TABLE_NAME} from "../common"
|
||||
|
||||
import { CharacterManagerClient } from "../../proto/character.client";
|
||||
import { Character, CreateCharacterRequest } from '../../proto/character'
|
||||
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
|
||||
@@ -9,6 +12,7 @@ interface CharacterArchiverData {
|
||||
playerHandle: string;
|
||||
characterName: string;
|
||||
characterAlias: string;
|
||||
tableName: string;
|
||||
}
|
||||
|
||||
export class CharacterArchiver extends Application {
|
||||
@@ -29,13 +33,15 @@ export class CharacterArchiver extends Application {
|
||||
playerHandle: "default",
|
||||
characterName: "",
|
||||
characterAlias: "",
|
||||
tableName: "",
|
||||
}
|
||||
|
||||
constructor(characterId: string, tableName: string) {
|
||||
constructor(characterId: string) {
|
||||
super()
|
||||
this.characterId = characterId;
|
||||
this.character = (game as Game).actors!.get(characterId);
|
||||
this.data.characterName = this.character!.name || "";;
|
||||
this.data.characterName = this.character!.name || "";
|
||||
this.data.tableName = (game as Game).settings!.get(MODULE_ID, TABLE_NAME) as string;
|
||||
}
|
||||
|
||||
static override get defaultOptions() {
|
||||
@@ -66,18 +72,20 @@ export class CharacterArchiver extends Application {
|
||||
html
|
||||
.find(".character-handle")
|
||||
.on("input", this.handleChange.bind(this));
|
||||
|
||||
html
|
||||
.find(".import-button")
|
||||
.on("click", this.unarchiveButton.bind(this));
|
||||
}
|
||||
|
||||
private async archiveButton() {
|
||||
|
||||
console.log("Potato");
|
||||
|
||||
let characterMsg: Character = Character.fromJson({
|
||||
playerName: "iamBadgers",
|
||||
characterName: this.character!.name,
|
||||
characterAlias: [],
|
||||
version: "",
|
||||
sourceTable: "BADGERS",
|
||||
sourceTable: this.data.tableName,
|
||||
json: JSON.stringify(this.character!.toJSON())
|
||||
});
|
||||
|
||||
@@ -91,6 +99,11 @@ export class CharacterArchiver extends Application {
|
||||
});
|
||||
}
|
||||
|
||||
private async unarchiveButton(i: Event) {
|
||||
console.log((i!.currentTarget! as HTMLElement).id);
|
||||
|
||||
}
|
||||
|
||||
timeout: NodeJS.Timeout | undefined;
|
||||
|
||||
private async handleChange(e: Event) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { id as moduleId } from "../module.json";
|
||||
import { initializeSettings } from "./settings";
|
||||
import { CharacterArchiver } from "./apps/CharacterArchiver"
|
||||
|
||||
|
||||
import "../styles/CharacterArchiver.scss"
|
||||
// interface MyModule extends Game.ModuleData<ModuleData> {
|
||||
// dogBrowser: DogBrowser;
|
||||
// }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import copy from "rollup-plugin-copy";
|
||||
import scss from "rollup-plugin-scss";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
export default defineConfig({
|
||||
@@ -9,13 +10,18 @@ export default defineConfig({
|
||||
output: {
|
||||
// dir: undefined,
|
||||
// file: "dist/scripts/module.js",
|
||||
dir: "dist/scripts",
|
||||
entryFileNames: "module.js",
|
||||
dir: "dist",
|
||||
entryFileNames: "scripts/module.js",
|
||||
format: "es",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
scss({
|
||||
fileName: "styles.css",
|
||||
sourceMap: true,
|
||||
include: ["src/styles/*.scss"],
|
||||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{ src: "src/module.json", dest: "dist" },
|
||||
|
||||
Reference in New Issue
Block a user