DP diff hidden lock by gm choice
This commit is contained in:
@@ -10,6 +10,12 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
*/
|
*/
|
||||||
_actor = null;
|
_actor = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If GM as set to hidden, lock the player choice so he cannot look the TN
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
_difficultyHiddenIsLock = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payload Object
|
* Payload Object
|
||||||
*/
|
*/
|
||||||
@@ -130,16 +136,10 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DifficultyHidden
|
// DifficultyHidden
|
||||||
if (options.difficultyHidden) {
|
this.difficultyHidden = !!options.difficultyHidden;
|
||||||
this.difficultyHidden = options.difficultyHidden;
|
|
||||||
} else {
|
|
||||||
this.difficultyHidden = game.settings.get("l5r5e", "initiative.difficulty.hidden");
|
|
||||||
}
|
|
||||||
|
|
||||||
// InitiativeRoll
|
// InitiativeRoll
|
||||||
if (options.isInitiativeRoll) {
|
this.object.isInitiativeRoll = !!options.isInitiativeRoll;
|
||||||
this.object.isInitiativeRoll = !!options.isInitiativeRoll;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,7 +147,7 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
*/
|
*/
|
||||||
async refresh() {
|
async refresh() {
|
||||||
this.difficulty = game.settings.get("l5r5e", "initiative.difficulty.value");
|
this.difficulty = game.settings.get("l5r5e", "initiative.difficulty.value");
|
||||||
this.difficultyHidden = game.settings.get("l5r5e", "initiative.difficulty.hidden");
|
this.difficultyHidden = false;
|
||||||
this.render(false);
|
this.render(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,6 +243,11 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
* @param isHidden
|
* @param isHidden
|
||||||
*/
|
*/
|
||||||
set difficultyHidden(isHidden) {
|
set difficultyHidden(isHidden) {
|
||||||
|
// If GM hide, then player choice don't matter
|
||||||
|
this._difficultyHiddenIsLock = game.settings.get("l5r5e", "initiative.difficulty.hidden");
|
||||||
|
if (this._difficultyHiddenIsLock) {
|
||||||
|
isHidden = true;
|
||||||
|
}
|
||||||
this.object.difficulty.hidden = !!isHidden;
|
this.object.difficulty.hidden = !!isHidden;
|
||||||
this.object.difficulty.add_void_point = this.object.difficulty.hidden;
|
this.object.difficulty.add_void_point = this.object.difficulty.hidden;
|
||||||
this._updateVoidPointUsage();
|
this._updateVoidPointUsage();
|
||||||
@@ -271,6 +276,7 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
canUseVoidPoint:
|
canUseVoidPoint:
|
||||||
this.object.difficulty.add_void_point || !this._actor || this._actor.data.data.void_points.value > 0,
|
this.object.difficulty.add_void_point || !this._actor || this._actor.data.data.void_points.value > 0,
|
||||||
disableSubmit: this.object.skill.value < 1 && this.object.ring.value < 1,
|
disableSubmit: this.object.skill.value < 1 && this.object.ring.value < 1,
|
||||||
|
difficultyHiddenIsLock: this._difficultyHiddenIsLock,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,10 +148,12 @@
|
|||||||
{{!-- Fourth line--}}
|
{{!-- Fourth line--}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
{{^if difficultyHiddenIsLock}}
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="diff_hidden" name="difficulty.hidden" value="1" {{checked data.difficulty.hidden}}>
|
<input type="checkbox" id="diff_hidden" name="difficulty.hidden" value="1" {{checked data.difficulty.hidden}}>
|
||||||
{{localize 'l5r5e.dicepicker.difficulty_hidden_label'}}
|
{{localize 'l5r5e.dicepicker.difficulty_hidden_label'}}
|
||||||
</label>
|
</label>
|
||||||
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{#if canUseVoidPoint}}
|
{{#if canUseVoidPoint}}
|
||||||
|
|||||||
Reference in New Issue
Block a user