Skip to content

Commit

Permalink
started work on settlement sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Dec 19, 2023
1 parent c07e990 commit 61bd448
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
1 change: 1 addition & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ TYPES.Actor.character: Character
TYPES.Actor.creature: Creature
TYPES.Actor.npc: NPC
TYPES.Actor.robot: Robot
TYPES.Actor.settlement: Settlement
TYPES.Item.ammo: Ammo
TYPES.Item.apparel_mod: Apparel Mod
TYPES.Item.apparel: Apparel
Expand Down
18 changes: 16 additions & 2 deletions system/src/hooks/initHook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Roller2D20 } from "../roller/Roller2D20.mjs";

import FalloutMacros from "../system/FalloutMacros.mjs";
import FalloutUtils from "../utils/FalloutUtils.mjs";
import Logger from "../utils/Logger";
import Logger from "../utils/Logger.mjs";

import preloadHandlebarsTemplates from "../templates.mjs";
import { registerHandlebarsHelpers } from "../handlebars.mjs";
Expand Down Expand Up @@ -116,6 +116,20 @@ function registerDocumentSheets() {
Actors.unregisterSheet("core", ActorSheet);
Items.unregisterSheet("core", ItemSheet);

Actors.registerSheet("fallout", sheets.FalloutActorSheet, { makeDefault: true });
Actors.registerSheet("fallout", sheets.FalloutActorSheet, {
types: [
"character",
"creature",
"npc",
"robot",
],
makeDefault: true,
});

Actors.registerSheet("fallout", sheets.FalloutSettlementSheet, {
makeDefault: true,
types: ["settlement"],
});

Items.registerSheet("fallout", sheets.FalloutItemSheet, { makeDefault: true });
}
10 changes: 10 additions & 0 deletions system/src/sheets/FalloutSettlementSheet.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FalloutActorSheet from "./FalloutActorSheet.mjs";

export default class FalloutSettlementSheet extends FalloutActorSheet {

/** @override */
get template() {
return `systems/fallout/templates/actor/${this.actor.type}-sheet.hbs`;
}

}
1 change: 1 addition & 0 deletions system/src/sheets/_module.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export {default as FalloutActorSheet} from "./FalloutActorSheet.mjs";
export {default as FalloutItemSheet} from "./FalloutItemSheet.mjs";
export {default as FalloutSettlementSheet} from "./FalloutSettlementSheet.mjs";
29 changes: 28 additions & 1 deletion system/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"character",
"creature",
"npc",
"robot"
"robot",
"settlement"
],
"character": {
"templates": [
Expand Down Expand Up @@ -109,6 +110,32 @@
"valuables"
]
},
"settlement": {
"beds": {
"value": 0
},
"defense": {
"value": 0
},
"food": {
"value": 0
},
"happiness": {
"value": 0
},
"income": {
"value": 0
},
"people": {
"value": 0
},
"power": {
"value": 0
},
"water": {
"value": 0
}
},
"templates": {
"base": {
"biography": "",
Expand Down
3 changes: 3 additions & 0 deletions system/templates/actor/settlement-sheet.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<form class="{{cssClass}} {{actor.type}} flexcol theme-wrapper" autocomplete="off">

</form>

0 comments on commit 61bd448

Please sign in to comment.