This commit is contained in:
@@ -67,6 +67,7 @@ Hooks.once("init", () => {
|
||||
SYSTEM,
|
||||
rollMoonStandalone: (actor = null) => CelestopolRoll.rollMoonStandalone(actor),
|
||||
manageFactionAspects: (actor = null) => _manageFactionAspects(actor),
|
||||
resetFactionAspects: () => _resetFactionAspects(),
|
||||
getFactionAspectState: () => _getFactionAspectState(),
|
||||
getFactionAspectSummary: (actor = null) => _getFactionAspectSummary(actor),
|
||||
getFactionDisplayLabel: (value) => _getFactionDisplayLabel(value),
|
||||
@@ -1218,6 +1219,24 @@ async function _setFactionAspectState(state) {
|
||||
return cleanState
|
||||
}
|
||||
|
||||
async function _resetFactionAspects() {
|
||||
if (!game.user.isGM) {
|
||||
ui.notifications.warn(game.i18n.localize("CELESTOPOL.FactionAspect.gmOnly"))
|
||||
return
|
||||
}
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: { title: game.i18n.localize("CELESTOPOL.FactionAspect.resetTitle") },
|
||||
content: `<p>${game.i18n.localize("CELESTOPOL.FactionAspect.resetConfirm")}</p>`,
|
||||
yes: { label: game.i18n.localize("CELESTOPOL.FactionAspect.resetConfirmYes"), icon: "fas fa-redo" },
|
||||
no: { label: game.i18n.localize("Cancel"), icon: "fas fa-times" },
|
||||
rejectClose: false,
|
||||
})
|
||||
if (!confirmed) return
|
||||
const state = _getFactionAspectState()
|
||||
await _setFactionAspectState({ ...state, activatedAspects: [] })
|
||||
ui.notifications.info(game.i18n.localize("CELESTOPOL.FactionAspect.resetSuccess"))
|
||||
}
|
||||
|
||||
function _refreshFactionAspectSheets() {
|
||||
for (const actor of game.actors.contents) {
|
||||
if (actor.type !== "character") continue
|
||||
|
||||
Reference in New Issue
Block a user