Skip to content

Commit

Permalink
Remove settings for client control of auto apply persistent
Browse files Browse the repository at this point in the history
This didn't actually work.  Remove the "Allow" setting and turn the client
settings into world settings.
  • Loading branch information
xyzzy42 committed Aug 9, 2024
1 parent 6d6815d commit 39b8808
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 122 deletions.
6 changes: 1 addition & 5 deletions src/module/feature/damageHandler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,9 @@ export function persistentDamageHealing(message: ChatMessagePF2e) {
const rolls = message.rolls as Rolled<DamageRoll>[];

let dtype: "Damage" | "Healing" | undefined;
if (
game.settings.get(MODULENAME, "applyPersistentAllow") !== "none" &&
rolls[0]?.instances.some((i) => i.persistent && i.options.evaluatePersistent)
) {
if (rolls[0]?.instances.some((i) => i.persistent && i.options.evaluatePersistent)) {
dtype = "Damage";
} else if (
game.settings.get(MODULENAME, "applyPersistentAllow") !== "none" &&
rolls.some((r) => r.kinds.has("healing")) &&
(message.flavor?.includes(
game.i18n.localize("PF2E.Encounter.Broadcast.FastHealing.fast-healing.ReceivedMessage"),
Expand Down
10 changes: 0 additions & 10 deletions src/module/feature/settingsHandler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ export function toggleMenuSettings(html: JQuery, settings: SettingsMenuPF2eWorkb
// html.find(`select[name="${settingName}"]`).parent().parent().toggle(!valueFunction);
// }

// Disable all dependent persistentDamage settings
if (settingName !== "applyPersistentAllow" && settingName.startsWith("applyPersistent")) {
const applyToggle = !(
game.settings.get(MODULENAME, "applyPersistentAllow") === "none" ||
(game.user?.isGM
? game.settings.get(MODULENAME, "applyPersistentAllow") === "players"
: game.settings.get(MODULENAME, "applyPersistentAllow") === "gm")
);
html.find(`input[name="${settingName}"]`).parent().parent().toggle(applyToggle);
}
if (settingName !== `handleDyingRecoveryRollAllow` && settingName.startsWith("handleDyingRecoveryRoll")) {
const applyToggle = !(
game.settings.get(MODULENAME, "handleDyingRecoveryRollAllow") === "none" ||
Expand Down
30 changes: 0 additions & 30 deletions src/module/settings/automation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,6 @@ export class WorkbenchClientAutomationSettings extends SettingsMenuPF2eWorkbench
default: true,
type: Boolean,
},
applyPersistentDamage: {
name: `${MODULENAME}.SETTINGS.applyPersistentDamage.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentDamage.hint`,
scope: "client",
config: true,
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
applyPersistentDamageRecoveryRoll: {
name: `${MODULENAME}.SETTINGS.applyPersistentDamageRecoveryRoll.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentDamageRecoveryRoll.hint`,
scope: "client",
config: true,
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
applyPersistentHealing: {
name: `${MODULENAME}.SETTINGS.applyPersistentHealing.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentHealing.hint`,
scope: "client",
config: true,
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
handleDyingRecoveryRoll: {
name: `${MODULENAME}.SETTINGS.handleDyingRecoveryRoll.name`,
hint: `${MODULENAME}.SETTINGS.handleDyingRecoveryRoll.hint`,
Expand Down
36 changes: 25 additions & 11 deletions src/module/settings/automation-world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,33 @@ export class WorkbenchWorldAutomationSettings extends SettingsMenuPF2eWorkbench
onChange: () => updateHooks(),
requiresReload: true,
},
applyPersistentAllow: {
name: `${MODULENAME}.SETTINGS.applyPersistentAllow.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentAllow.hint`,
applyPersistentDamage: {
name: `${MODULENAME}.SETTINGS.applyPersistentDamage.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentDamage.hint`,
scope: "world",
config: true,
default: "none",
type: String,
choices: {
none: game.i18n.localize(`${MODULENAME}.SETTINGS.applyPersistentAllow.none`),
all: game.i18n.localize(`${MODULENAME}.SETTINGS.applyPersistentAllow.all`),
gm: game.i18n.localize(`${MODULENAME}.SETTINGS.applyPersistentAllow.gm`),
players: game.i18n.localize(`${MODULENAME}.SETTINGS.applyPersistentAllow.players`),
},
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
applyPersistentDamageRecoveryRoll: {
name: `${MODULENAME}.SETTINGS.applyPersistentDamageRecoveryRoll.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentDamageRecoveryRoll.hint`,
scope: "world",
config: true,
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
applyPersistentHealing: {
name: `${MODULENAME}.SETTINGS.applyPersistentHealing.name`,
hint: `${MODULENAME}.SETTINGS.applyPersistentHealing.hint`,
scope: "world",
config: true,
default: false,
type: Boolean,
onChange: () => updateHooks(),
requiresReload: true,
},
Expand Down
8 changes: 0 additions & 8 deletions static/lang/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@
"name": "谁会被提醒动作",
"players": "玩家"
},
"applyPersistentAllow": {
"all": "所有",
"players": "玩家",
"gm": "GM",
"hint": "谁可以变更是否自动应用持续伤害/治疗。保存设置以显示/隐藏客户端自动化设置菜单上的其他选项。",
"name": "谁可以变更是否自动应用持续伤害/治疗。",
"none": ""
},
"applyPersistentDamage": {
"name": "持续伤害自动生效。",
"hint": "设置持续伤害是否自动生效。",
Expand Down
12 changes: 2 additions & 10 deletions static/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,9 @@
"numberPostfix": "Zahl als Suffix",
"wordPrefix": "Wort als Präfix"
},
"applyPersistentAllow": {
"none": "Keiner",
"gm": "SL",
"name": "Wer hat die Erlaubnis die Option zum automatischen anwenden von bleibenden Schaden/Heilung zu setzen.",
"players": "Spieler",
"all": "Alle",
"hint": "Auswählen wer die Erlaubnis hat um die Option zum automatischen anwenden von bleibenden Schaden/Heilung zu setzen. Speichern um die zusätzlichen Menüpunkte im Menü Client-Automatisierung ein- bzw. auszublenden."
},
"applyPersistentDamage": {
"name": "Automatisches anwenden von anhaltenden Schaden.",
"hint": "Client-Einstellung um automatisch anhaltenden Schaden anzuwenden.",
"hint": "Welt Einstellung um automatisch anhaltenden Schaden anzuwenden.",
"wasDamaged": "{damage} Schaden wurde automatisch angewendet"
},
"autoCollapseItemChatCardContent": {
Expand All @@ -273,7 +265,7 @@
"name": "Ziele des Benutzers hinzufügen"
},
"applyPersistentHealing": {
"hint": "Client-Einstellung um anhaltende Heilung automatisch vom System anwenden zu lassen. Einstellungen speichern um zusätzliche Optionen ein- bzw. auszublenden.",
"hint": "Welt Einstellung um anhaltende Heilung automatisch vom System anwenden zu lassen.",
"name": "Automatisches anwenden von anhaltender Heilung, welche vom System ausgewürfelt wird.",
"wasHealed": "{healing} Heilung wurde automatisch angewendet."
},
Expand Down
12 changes: 2 additions & 10 deletions static/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,16 @@
"name": "Add user targets",
"title": "Select user to add targets for"
},
"applyPersistentAllow": {
"all": "All",
"gm": "GM",
"hint": "Select who is allowed to set the option to automatically apply persistent damage/healing. Save settings to show/hide additional options on the client automation setting menu.",
"name": "Who is allowed to set the option to automatically apply persistent damage/healing.",
"none": "None",
"players": "Players"
},
"applyPersistentDamage": {
"hint": "Client setting to automatically apply persistent damage.",
"hint": "World setting to automatically apply persistent damage.",
"name": "Automatically apply persistent damage."
},
"applyPersistentDamageRecoveryRoll": {
"hint": "... and automatically roll recovery after that. Requires the setting above to be enabled.",
"name": "... and automatically roll recovery after that."
},
"applyPersistentHealing": {
"hint": "Client setting to automatically apply persistent healing rolled by the system. Save settings to show/hide additional options.",
"hint": "World setting to automatically apply persistent healing rolled by the system.",
"name": "Automatically apply persistent healing rolled by the system.",
"wasHealed": "{healing} healing was automatically applied."
},
Expand Down
6 changes: 0 additions & 6 deletions static/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
"clearFor": "Limpiar objetivos para",
"name": "Agregar los objetivos del usuario"
},
"applyPersistentAllow": {
"all": "Todos",
"gm": "MJ",
"players": "Jugadores",
"none": "Ninguno"
},
"applyPersistentDamage": {
"wasDamaged": "{damage} daño fue aplicado automáticamente"
},
Expand Down
8 changes: 0 additions & 8 deletions static/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
"name": "Ajouter les cibles de l'utilisateur",
"title": "Choisissez l'utilisateur pour lui ajouter les cibles"
},
"applyPersistentAllow": {
"all": "Tous",
"gm": "MJ",
"hint": "Choisissez qui est autorisé à régler l'option pour appliquer automatiquement les dégâts/soins persistants. Sauvegarder les réglages pour montrer/cacher les options supplémentaires sur le menu des réglages de l'automatisation du client.",
"name": "Qui est autorisé à régler l'option pour appliquer automatiquement les dégâts/soins persistants.",
"none": "Aucun",
"players": "Joueurs"
},
"applyPersistentDamage": {
"hint": "Paramètre du client permettant d'appliquer automatiquement des dégâts persistants.",
"name": "Appliquer automatiquement les dégâts persistants.",
Expand Down
8 changes: 0 additions & 8 deletions static/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@
"clearFor": "Wyczyść cele dla",
"hint": "Powiązanie klawiszy w celu dodania wybranych i najechanych tokenów do celów wybranego użytkownika."
},
"applyPersistentAllow": {
"all": "Wszyscy",
"gm": "MG",
"name": "Kto może ustawić opcję automatycznego stosowania trwałych obrażeń/leczenia.",
"hint": "Wybierz, kto może ustawić opcję automatycznego stosowania trwałych obrażeń/leczenia. Zapisz ustawienia, aby wyświetlić/ukryć dodatkowe opcje w menu ustawień automatyzacji klienta.",
"none": "Nikt",
"players": "Gracze"
},
"nonLethalIsNotLethal": {
"unconscious": "Nieśmiercionośne obrażenia nie zabijają",
"no": "Obrażenia nieśmiercionośne to po prostu obrażenia",
Expand Down
8 changes: 0 additions & 8 deletions static/lang/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"name": "Adicionar Alvos",
"title": "Selecione o usuário que marcará os alvos"
},
"applyPersistentAllow": {
"all": "Todos",
"gm": "MJ",
"hint": "Selecione quem pode definir a opção de aplicar dano ou cura persistente automaticamente. Salve a configuração para mostrar/ocultar as opções nas Automações de Cliente.",
"name": "Permissão: aplicar dano/cura persistente",
"none": "Ninguém",
"players": "Jogadores"
},
"applyPersistentDamage": {
"hint": "Automaticamente aplica dano persistente.",
"name": "Aplicar dano persistente",
Expand Down
8 changes: 0 additions & 8 deletions static/lang/zh_Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,6 @@
"name": "新增使用者目標",
"title": "選擇要為其新增目標的使用者"
},
"applyPersistentAllow": {
"all": "所有",
"gm": "GM",
"hint": "誰可以變更是否自動應用持續傷害/治療。儲存設定以顯示/隱藏客戶端自動化設定菜單上的其他選項。",
"name": "誰可以變更是否自動應用持續傷害/治療。",
"none": "",
"players": "玩家"
},
"applyPersistentDamage": {
"hint": "設定Persistent Damage模組骰出的持續傷害是否自動生效。",
"name": "Persistent Damage模組骰出的持續傷害自動生效。",
Expand Down

0 comments on commit 39b8808

Please sign in to comment.