-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
214 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import {sGet, sSet, settingData} from './utils.js' | ||
import {updateSettings} from './logic.js' | ||
|
||
export class HealthEstimateDeathSettings extends FormApplication { | ||
|
||
constructor (object, options = {}) { | ||
super(object, options) | ||
this.gradFn = new Function() | ||
this.gradColors = [] | ||
} | ||
|
||
/** | ||
* Default Options for this FormApplication | ||
*/ | ||
static get defaultOptions () { | ||
return mergeObject(super.defaultOptions, { | ||
id : 'healthestimate-death-form', | ||
title : 'Health Estimate Death Settings', | ||
template : './modules/healthEstimate/templates/deathSettings.hbs', | ||
classes : ['sheet'], | ||
width : 640, | ||
height : "auto", | ||
closeOnSubmit: true | ||
}) | ||
} | ||
|
||
getData (options) { | ||
|
||
function prepSetting (key) { | ||
let data = settingData(`core.${key}`) | ||
return { | ||
value: sGet(`core.${key}`), | ||
name : data.name, | ||
hint : data.hint | ||
} | ||
} | ||
|
||
return { | ||
deathState : prepSetting('deathState'), | ||
deathStateName : prepSetting('deathStateName'), | ||
NPCsJustDie : prepSetting('NPCsJustDie'), | ||
deathMarker : prepSetting('deathMarker'), | ||
} | ||
} | ||
|
||
/** | ||
* Executes on form submission | ||
* @param {Event} e - the form submission event | ||
* @param {Object} d - the form data | ||
*/ | ||
async _updateObject(e,d) { | ||
const iterableSettings = Object.keys(d); | ||
for (let key of iterableSettings) { | ||
sSet(`core.${key}`, d[key]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.