checking in
This commit is contained in:
@@ -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,18 +1,22 @@
|
||||
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'
|
||||
|
||||
interface CharacterArchiverData {
|
||||
potato: string;
|
||||
reads: Character[];
|
||||
playerHandle: string;
|
||||
characterName: string;
|
||||
characterAlias: string;
|
||||
potato: string;
|
||||
reads: Character[];
|
||||
playerHandle: string;
|
||||
characterName: string;
|
||||
characterAlias: string;
|
||||
tableName: string;
|
||||
}
|
||||
|
||||
export class CharacterArchiver extends Application {
|
||||
|
||||
|
||||
readonly characterId: String;
|
||||
readonly character: Actor | undefined;
|
||||
|
||||
@@ -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;
|
||||
// }
|
||||
@@ -104,4 +104,4 @@ Hooks.on("getActorDirectoryEntryContext", async (html: any, options: any) => {
|
||||
},
|
||||
);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user