dialogv2, force appv1 for sheets, event refs, registering
This commit is contained in:
@@ -7,8 +7,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
//pop up the death save dialog box
|
||||
new Dialog({
|
||||
title: `Death Save`,
|
||||
new new foundry.applications.api.DialogV2({
|
||||
window: {title: `Death Save`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -43,22 +44,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
<h4>Select your roll type:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Advantage`,
|
||||
action: `action_advantage`,
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table0eDeath'),`1d10 [+]`,`high`,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Normal`,
|
||||
action: `action_normal`,
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table0eDeath'),`1d10`,`high`,false,false,null,null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Disadvantage`,
|
||||
action: `action_disadvantage`,
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table0eDeath'),`1d10 [-]`,`high`,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,59 +6,63 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Calm`,
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
background: rgb(230,230,230);
|
||||
border-radius: 9px;
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Gain Calm`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
background: rgb(230,230,230);
|
||||
border-radius: 9px;
|
||||
}
|
||||
.macro_img{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
padding-right: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-column: span 2 / span 2;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class ="macro_window" style="margin-bottom : 7px;">
|
||||
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
|
||||
<div class="macro_img"><img src="systems/mosh/images/icons/ui/macros/relieve_stress.png" style="border:none"/></div>
|
||||
<div class="macro_desc"><h3>Gain Calm</h3>Occasionally, certain moments, places, or events can automatically <strong>calm you down.</strong> Escaping perilous situations, finding a serene location, or experiencing a touching moment with a loved one can have meaningful impacts on your mood and outlook on life. If your Calm is getting close to 0, you should consider making a <strong>Rest Save</strong> - as the effects of a failed <strong>Panic Check</strong> can be devastating.</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: [
|
||||
{
|
||||
label: `Gain 5 Calm`,
|
||||
action: `gain_5`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',5,null,true),
|
||||
icon: `<i class="fas fa-angle-up"></i>`
|
||||
},
|
||||
{
|
||||
label: `Gain 10 Calm`,
|
||||
action: `gain_10`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',10,null,true),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
{
|
||||
label: `Gain 1d20 Calm`,
|
||||
action: `gain_1d20`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`1d20`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-up"></i>`
|
||||
}
|
||||
.macro_img{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
padding-right: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-column: span 2 / span 2;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class ="macro_window" style="margin-bottom : 7px;">
|
||||
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
|
||||
<div class="macro_img"><img src="systems/mosh/images/icons/ui/macros/relieve_stress.png" style="border:none"/></div>
|
||||
<div class="macro_desc"><h3>Gain Calm</h3>Occasionally, certain moments, places, or events can automatically <strong>calm you down.</strong> Escaping perilous situations, finding a serene location, or experiencing a touching moment with a loved one can have meaningful impacts on your mood and outlook on life. If your Calm is getting close to 0, you should consider making a <strong>Rest Save</strong> - as the effects of a failed <strong>Panic Check</strong> can be devastating.</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
label: `Gain 5 Calm`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',5,null,true),
|
||||
icon: `<i class="fas fa-angle-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
label: `Gain 10 Calm`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',10,null,true),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button3: {
|
||||
label: `Gain 1d20 Calm`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`1d20`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-up"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Stress`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Gain Stress`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Gain 1 Stress`,
|
||||
action: `gain_1`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',1,null,true),
|
||||
icon: `<i class="fas fa-angle-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Gain 2 Stress`,
|
||||
action: `gain_2`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',2,null,true),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Gain 1d5 Stress`,
|
||||
action: `gain_1d5`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`1d5`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-up"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Lose Calm`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Lose Calm`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Lose 5 Calm`,
|
||||
action: `lose_5`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-5,null,true),
|
||||
icon: `<i class="fas fa-angle-down"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Lose 10 Calm`,
|
||||
action: `lose_10`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-10,null,true),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Lose 1d20 Calm`,
|
||||
action: `lose_1d20`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`-1d20`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -7,8 +7,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
//pop up the panic check dialog box
|
||||
new Dialog({
|
||||
title: `Panic Check`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Panic Check`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
<h4>Select your roll type:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Advantage`,
|
||||
action: `action_advantage`,
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,`[+]`,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Normal`,
|
||||
action: `action_normal`,
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,``,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Disadvantage`,
|
||||
action: `action_disadvantage`,
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,`[-]`,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,60 +6,65 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Stress`,
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
background: rgb(230,230,230);
|
||||
border-radius: 9px;
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Gain Stress`},
|
||||
position: {width: 600,height: 265},
|
||||
title: `Gain Stress`,
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
background: rgb(230,230,230);
|
||||
border-radius: 9px;
|
||||
}
|
||||
.macro_img{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
padding-right: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-column: span 2 / span 2;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class ="macro_window" style="margin-bottom : 7px;">
|
||||
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
|
||||
<div class="macro_img"><img src="systems/mosh/images/icons/ui/macros/relieve_stress.png" style="border:none"/></div>
|
||||
<div class="macro_desc"><h3>Relieve Stress</h3>Occasionally, certain moments, places, or events can automatically <strong>relieve your stress.</strong> Escaping perilous situations, finding a serene location, or experiencing a touching moment with a loved one can have meaningful impacts on your mood and outlook on life. If your stress is getting close to 20, you should consider making a <strong>Rest Save</strong> - as the effects of a failed <strong>Panic Check</strong> can be devastating.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: [
|
||||
{
|
||||
label: `Relieve 1 Stress`,
|
||||
action: `relieve_1`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-1,null,true),
|
||||
icon: `<i class="fas fa-angle-down"></i>`
|
||||
},
|
||||
{
|
||||
label: `Relieve 2 Stress`,
|
||||
action: `relieve_2`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-2,null,true),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
},
|
||||
{
|
||||
label: `Relieve 1d5 Stress`,
|
||||
action: `relieve_1d5`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`-1d5`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-down"></i>`
|
||||
}
|
||||
.macro_img{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
padding-right: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-column: span 2 / span 2;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class ="macro_window" style="margin-bottom : 7px;">
|
||||
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
|
||||
<div class="macro_img"><img src="systems/mosh/images/icons/ui/macros/relieve_stress.png" style="border:none"/></div>
|
||||
<div class="macro_desc"><h3>Relieve Stress</h3>Occasionally, certain moments, places, or events can automatically <strong>relieve your stress.</strong> Escaping perilous situations, finding a serene location, or experiencing a touching moment with a loved one can have meaningful impacts on your mood and outlook on life. If your stress is getting close to 20, you should consider making a <strong>Rest Save</strong> - as the effects of a failed <strong>Panic Check</strong> can be devastating.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
label: `Relieve 1 Stress`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-1,null,true),
|
||||
icon: `<i class="fas fa-angle-down"></i>`
|
||||
},
|
||||
button2: {
|
||||
label: `Relieve 2 Stress`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-2,null,true),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
},
|
||||
button3: {
|
||||
label: `Relieve 1d5 Stress`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`-1d5`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Rest Save`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Rest Save`},
|
||||
position: {width: 600,height: 237},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -41,12 +42,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
action: `next`,
|
||||
callback: () => game.mosh.initRollCheck(null,'low','restSave',null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 237}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Save`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Save`},
|
||||
position: {width: 600,height: 545},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -93,12 +94,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</label>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
action: `next`,
|
||||
callback: (html) => game.mosh.initRollCheck(null,'low',html.find("input[name='save']:checked").val(),null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 545}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Stat Check`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Stat Check`},
|
||||
position: {width: 600,height: 545},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -94,12 +95,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</label>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
action: `next`,
|
||||
callback: (html) => game.mosh.initRollCheck(null,'low',html.find("input[name='stat']:checked").val(),null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 545}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -7,8 +7,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
//pop up the death save dialog box
|
||||
new Dialog({
|
||||
title: `Death Save`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Death Save`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -43,22 +44,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
<h4>Select your roll type:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Advantage`,
|
||||
action: 'action_advantage',
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table1eDeath'),`1d10 [+]`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Normal`,
|
||||
action: 'action_normal',
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table1eDeath'),`1d10`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Disadvantage`,
|
||||
action: 'action_disadvantage',
|
||||
callback: () => game.mosh.initRollTable(game.settings.get('mosh','table1eDeath'),`1d10 [-]`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Calm`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Gain Calm`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -43,22 +44,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Gain 5 Calm`,
|
||||
action: 'button_1',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',5,null,true),
|
||||
icon: `<i class="fas fa-angle-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Gain 10 Calm`,
|
||||
action: 'button_2',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',10,null,true),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Gain 1d20 Calm`,
|
||||
action: 'button_3',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`1d20`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-up"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Stress`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Gain Stress`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Gain 1 Stress`,
|
||||
action: 'button_1',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',1,null,true),
|
||||
icon: `<i class="fas fa-angle-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Gain 2 Stress`,
|
||||
action: 'button_2',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',2,null,true),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Gain 1d5 Stress`,
|
||||
action: 'button_3',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`1d5`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-up"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Lose Calm`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Lose Calm`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -19,7 +20,7 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
justify-content: center;
|
||||
}
|
||||
.macro_desc{
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 400;
|
||||
padding-top: 8px;
|
||||
@@ -35,31 +36,34 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class ="macro_window" style="margin-bottom : 7px;">
|
||||
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
|
||||
<div class="macro_img"><img src="systems/mosh/images/icons/ui/macros/gain_stress.png" style="border:none"/></div>
|
||||
<div class="macro_desc"><h3>Lose Calm</h3>Occasionally, certain locations or entities can automatically give you Stress from interacting with or witnessing them. You live in a terrifying, uncaring universe, so your <strong>Maximum Calm</strong> caps out at 85 and cannot go lower than zero.</div>
|
||||
<div class ='macro_window' style='margin-bottom : 7px;'>
|
||||
<div class='grid grid-2col' style='grid-template-columns: 150px auto'>
|
||||
<div class='macro_img'><img src='systems/mosh/images/icons/ui/macros/gain_stress.png' style='border:none'/></div>
|
||||
<div class='macro_desc'><h3>Lose Calm</h3>Occasionally, certain locations or entities can automatically give you Stress from interacting with or witnessing them. You live in a terrifying, uncaring universe, so your <strong>Maximum Calm</strong> caps out at 85 and cannot go lower than zero.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Lose 5 Calm`,
|
||||
action: `lose_5`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-5,null,true),
|
||||
icon: `<i class="fas fa-angle-down"></i>`
|
||||
icon: `<i class='fas fa-angle-down'></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Lose 10 Calm`,
|
||||
action: `lose_10`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-10,null,true),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
icon: `<i class='fas fa-angle-double-down'></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Lose 1d20 Calm`,
|
||||
action: `lose_1d20`,
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`-1d20`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-down"></i>`
|
||||
icon: `<i class='fas fa-arrow-circle-down'></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -7,8 +7,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
//pop up the panic check dialog box
|
||||
new Dialog({
|
||||
title: `Panic Check`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Panic Check`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
<h4>Select your roll type:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Advantage`,
|
||||
action: 'button_advantage',
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,`[+]`,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Normal`,
|
||||
action: 'button_normal',
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,``,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Disadvantage`,
|
||||
action: 'button_disadvantage',
|
||||
callback: () => game.mosh.initRollTable(`panicCheck`,`[-]`,null,false,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Gain Stress`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Relieve Stress`},
|
||||
position: {width: 600,height: 265},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -44,22 +45,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
|
||||
<h4>Select your modification:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Relieve 1 Stress`,
|
||||
action: 'button_1',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-1,null,true),
|
||||
icon: `<i class="fas fa-angle-down"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Relieve 2 Stress`,
|
||||
action: 'button_2',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',-2,null,true),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Relieve 1d5 Stress`,
|
||||
action: 'button_3',
|
||||
callback: () => game.mosh.initModifyActor('system.other.stress.value',null,`-1d5`,true),
|
||||
icon: `<i class="fas fa-arrow-circle-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 265}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Rest Save`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Rest Save`},
|
||||
position: {width: 600,height: 237},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -41,12 +42,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
action: 'button_next',
|
||||
callback: () => game.mosh.initRollCheck(null,'low','restSave',null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 237}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Save`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Save`},
|
||||
position: {width: 600,height: 470},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -80,12 +81,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</label>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
callback: (html) => game.mosh.initRollCheck(null,'low',html.find("input[name='save']:checked").val(),null,null,null),
|
||||
action: 'button_1',
|
||||
callback: (event, button, dialog) => game.mosh.initRollCheck(null,'low',button.form.querySelector("input[name='save']:checked").value,null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 470}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -6,8 +6,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
game.mosh.noCharSelected();
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
new Dialog({
|
||||
title: `Stat Check`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Stat Check`},
|
||||
position: {width: 600,height: 545},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -94,12 +95,13 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</div>
|
||||
</label>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Next`,
|
||||
callback: (html) => game.mosh.initRollCheck(null,'low',html.find("input[name='stat']:checked").val(),null,null,null),
|
||||
action: 'button_1',
|
||||
callback: (event, button, dialog) => game.mosh.initRollCheck(null,'low',button.form.querySelector("input[name='stat']:checked").value,null,null,null),
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 545}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
@@ -7,8 +7,9 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
//else pop up the dialog
|
||||
} else {
|
||||
//pop up the wound roll dialog box
|
||||
new Dialog({
|
||||
title: `Wound Roll`,
|
||||
new foundry.applications.api.DialogV2({
|
||||
window: {title: `Wound Roll`},
|
||||
position: {width: 600,height: 650},
|
||||
content: `
|
||||
<style>
|
||||
.macro_window{
|
||||
@@ -109,22 +110,25 @@ if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 't
|
||||
</label>
|
||||
<h4>Select your roll type:</h4>
|
||||
`,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: `Advantage`,
|
||||
callback: (html) => game.mosh.initRollTable(html.find("input[name='wound_table']:checked").val(),`1d10 [+]`,`low`,true,false,null,null),
|
||||
action: 'action_advantage',
|
||||
callback: (event, button, dialog) => game.mosh.initRollTable(button.form.querySelector("input[name='wound_table']:checked").value,`1d10 [+]`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: `Normal`,
|
||||
callback: (html) => game.mosh.initRollTable(html.find("input[name='wound_table']:checked").val(),`1d10`,`low`,true,false,null,null),
|
||||
action: 'action_normal',
|
||||
callback: (event, button, dialog) => game.mosh.initRollTable(button.form.querySelector("input[name='wound_table']:checked").value,`1d10`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: `Disadvantage`,
|
||||
callback: (html) => game.mosh.initRollTable(html.find("input[name='wound_table']:checked").val(),`1d10 [-]`,`low`,true,false,null,null),
|
||||
action: 'action_disadvantage',
|
||||
callback: (event, button, dialog) => game.mosh.initRollTable(button.form.querySelector("input[name='wound_table']:checked").value,`1d10 [-]`,`low`,true,false,null,null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
},{width: 600,height: 650}).render(true);
|
||||
]
|
||||
}).render({force: true});
|
||||
}
|
||||
+24
-24
@@ -3,7 +3,7 @@ import { DLActorGenerator } from "../windows/actor-generator.js";
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class MothershipActorSheet extends ActorSheet {
|
||||
export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -46,8 +46,8 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
|
||||
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.notes = await TextEditor.enrichHTML(superData.notes, {async: true});
|
||||
data.data.enriched.biography = await TextEditor.enrichHTML(superData.biography, {async: true});
|
||||
data.data.enriched.notes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(superData.notes, {async: true});
|
||||
data.data.enriched.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(superData.biography, {async: true});
|
||||
|
||||
|
||||
//SKILL XP BUTTONS
|
||||
@@ -254,7 +254,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
item.sheet.render({force: true});
|
||||
});
|
||||
|
||||
//Quantity adjuster
|
||||
@@ -314,7 +314,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
html.find('.skill-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const skill = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
skill.sheet.render(true);
|
||||
skill.sheet.render({force: true});
|
||||
});
|
||||
|
||||
//Weapons
|
||||
@@ -325,7 +325,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
weapon.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Attribute
|
||||
@@ -551,47 +551,47 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
const itemData = {
|
||||
name: name,
|
||||
type: type,
|
||||
data: data
|
||||
system: data
|
||||
};
|
||||
// Remove the type from the dataset since it's in the itemData.type prop.
|
||||
delete itemData.data["type"];
|
||||
|
||||
let d = new Dialog({
|
||||
title: "New Skill",
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: `New Skill`},
|
||||
content: "<h2> Name </h2>\
|
||||
<input type='text' id='name' name='name' value='New Skill'>\
|
||||
<h2> Rank </h2> <select style='margin-bottom:10px;'name='rank' id='rank'>\
|
||||
<option value='Trained'>Trained</option>\
|
||||
<option value='Expert'>Expert</option>\
|
||||
<option value='Master'>Master</option></select> <br/>",
|
||||
buttons: {
|
||||
roll: {
|
||||
buttons: [
|
||||
{
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
action: "create",
|
||||
label: "Create",
|
||||
callback: (html) => {
|
||||
var rank = html.find('[id=\"rank\"]')[0].value;
|
||||
callback: (event, button, dialog) => {
|
||||
var rank = button.form.querySelector('[id=\"rank\"]')?.value;
|
||||
if (rank == "Trained")
|
||||
itemData.data.bonus = 10;
|
||||
itemData.system.bonus = 10;
|
||||
if (rank == "Expert")
|
||||
itemData.data.bonus = 15;
|
||||
itemData.system.bonus = 15;
|
||||
if (rank == "Master")
|
||||
itemData.data.bonus = 20;
|
||||
itemData.system.bonus = 20;
|
||||
|
||||
itemData.data.rank = rank;
|
||||
itemData.name = html.find('[id=\"name\"]')[0].value
|
||||
itemData.system.rank = rank;
|
||||
itemData.name = button.form.querySelector('[id=\"name\"]')?.value
|
||||
this.actor.createEmbeddedDocuments("Item", [itemData]);
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
{
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
action: "cancel",
|
||||
label: "Cancel",
|
||||
callback: () => { }
|
||||
}
|
||||
},
|
||||
],
|
||||
default: "roll",
|
||||
close: () => { }
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
|
||||
// Finally, create the item!
|
||||
return;
|
||||
@@ -655,6 +655,6 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
new DLActorGenerator(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
}
|
||||
|
||||
+220
-211
@@ -4,7 +4,7 @@ import { fromIdUuid } from "../mosh.js";
|
||||
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
||||
* @extends {Actor}
|
||||
*/
|
||||
export class MothershipActor extends Actor {
|
||||
export class MothershipActor extends foundry.appv1.Actor {
|
||||
|
||||
//Augment the basic actor data with additional dynamic data.
|
||||
prepareData() {
|
||||
@@ -899,67 +899,70 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.ChooseAStat"),
|
||||
window: {title: game.i18n.localize("Mosh.ChooseAStat")},
|
||||
position: {width: 600,height: 500},
|
||||
content: dialogDesc + buttonDesc,
|
||||
buttons: {}
|
||||
buttons: []
|
||||
};
|
||||
//add adv/normal/dis buttons if we need a rollString
|
||||
if (!rollString) {
|
||||
//we need to generate a roll string
|
||||
//Advantage
|
||||
dialogData.buttons.button1 = {
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
callback: (html) => {
|
||||
dialogData.buttons = [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100 [+]`;
|
||||
aimFor = `low`;
|
||||
attribute = html.find("input[name='stat']:checked").attr("value");
|
||||
attribute = button.form.querySelector("input[name='stat']:checked")?.getAttribute("value");
|
||||
resolve([rollString, aimFor, attribute]);
|
||||
console.log(`User left the chooseAttribute dialog with: rollString:${rollString}, aimFor:${aimFor}, attribute:${attribute}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
};
|
||||
//Normal
|
||||
dialogData.buttons.button2 = {
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
callback: (html) => {
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100`;
|
||||
aimFor = `low`;
|
||||
attribute = html.find("input[name='stat']:checked").attr("value");
|
||||
attribute = button.form.querySelector("input[name='stat']:checked")?.getAttribute("value");
|
||||
resolve([rollString, aimFor, attribute]);
|
||||
console.log(`User left the chooseAttribute dialog with: rollString:${rollString}, aimFor:${aimFor}, attribute:${attribute}`);
|
||||
},
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
};
|
||||
//Disadvantage
|
||||
dialogData.buttons.button3 = {
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
callback: (html) => {
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100 [-]`;
|
||||
aimFor = `low`;
|
||||
attribute = html.find("input[name='stat']:checked").attr("value");
|
||||
attribute = button.form.querySelector("input[name='stat']:checked")?.getAttribute("value");
|
||||
resolve([rollString, aimFor, attribute]);
|
||||
console.log(`User left the chooseAttribute dialog with: rollString:${rollString}, aimFor:${aimFor}, attribute:${attribute}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
};
|
||||
}
|
||||
]
|
||||
//add a next button if we dont need a rollString
|
||||
} else {
|
||||
dialogData.buttons.button1 = {
|
||||
label: game.i18n.localize("Mosh.Next"),
|
||||
callback: (html) => {
|
||||
aimFor = `low`;
|
||||
attribute = html.find("input[name='stat']:checked").attr("value");
|
||||
resolve([rollString, aimFor, attribute]);
|
||||
console.log(`User left the chooseAttribute dialog with: rollString:${rollString}, aimFor:${aimFor}, attribute:${attribute}`);
|
||||
},
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
};
|
||||
dialogData.buttons = [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Next"),
|
||||
action: `action_next`,
|
||||
callback: (event, button, dialog) => {
|
||||
aimFor = `low`;
|
||||
attribute = button.form.querySelector("input[name='stat']:checked")?.getAttribute("value");
|
||||
resolve([rollString, aimFor, attribute]);
|
||||
console.log(`User left the chooseAttribute dialog with: rollString:${rollString}, aimFor:${aimFor}, attribute:${attribute}`);
|
||||
},
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
]
|
||||
}
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 500
|
||||
}).render(true);
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -975,7 +978,6 @@ export class MothershipActor extends Actor {
|
||||
//create HTML for this window
|
||||
//header
|
||||
let skillHeader = await renderTemplate('systems/mosh/templates/dialogs/choose-skill-dialog-header.html');
|
||||
|
||||
//skill template
|
||||
let skillRow = `
|
||||
<label for="[RADIO_ID]">
|
||||
@@ -1010,17 +1012,17 @@ export class MothershipActor extends Actor {
|
||||
//set temprow as template
|
||||
let tempRow = skillRow;
|
||||
//replace ID
|
||||
tempRow = tempRow.replaceAll("[RADIO_ID]", item.name);
|
||||
tempRow = tempRow.replaceAll("[RADIO_ID]", item.name);
|
||||
//replace value
|
||||
tempRow = tempRow.replace("[RADIO_VALUE]", item.system.bonus);
|
||||
tempRow = tempRow.replace("[RADIO_VALUE]", item.system.bonus);
|
||||
//replace img
|
||||
tempRow = tempRow.replace("[RADIO_IMG]", item.img);
|
||||
tempRow = tempRow.replace("[RADIO_IMG]", item.img);
|
||||
//replace name
|
||||
tempRow = tempRow.replace("[RADIO_BONUS]", item.system.bonus);
|
||||
tempRow = tempRow.replace("[RADIO_BONUS]", item.system.bonus);
|
||||
//replace name
|
||||
tempRow = tempRow.replace("[RADIO_NAME]", item.name);
|
||||
tempRow = tempRow.replace("[RADIO_NAME]", item.name);
|
||||
//replace desc
|
||||
tempRow = tempRow.replace("[RADIO_DESC]", item.system.description.replace("<p>", "<strong>:</strong> "));
|
||||
tempRow = tempRow.replace("[RADIO_DESC]", item.system.description.replace("<p>", "<strong>:</strong> "));
|
||||
//add to skillList
|
||||
skillList = skillList + tempRow;
|
||||
//increment skill count
|
||||
@@ -1038,73 +1040,76 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
//create button header if needed
|
||||
if (!rollString) {
|
||||
buttonDesc = `<h4>` + game.i18n.localize("Mosh.SelectYourRollType") + `:</h4>`;
|
||||
buttonDesc = `<h4>` + game.i18n.localize("Mosh.SelectYourRollType") + `:</h4>`;
|
||||
} else {
|
||||
buttonDesc = ``;
|
||||
}
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: dlgTitle,
|
||||
window: {title: dlgTitle},
|
||||
position: {width: 600,height: dialogHeight},
|
||||
content: skillHeader + skillList + buttonDesc,
|
||||
buttons: {}
|
||||
buttons: []
|
||||
};
|
||||
//add adv/normal/dis buttons if we need a rollString
|
||||
if (!rollString) {
|
||||
//we need to generate a roll string
|
||||
//Advantage
|
||||
dialogData.buttons.button1 = {
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
callback: (html) => {
|
||||
dialogData.buttons = [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100 [+]`;
|
||||
skill = html.find("input[name='skill']:checked").attr("id");
|
||||
skillValue = html.find("input[name='skill']:checked").attr("value");
|
||||
skill = button.form.querySelector("input[name='skill']:checked")?.getAttribute("id");
|
||||
skillValue = button.form.querySelector("input[name='skill']:checked")?.getAttribute("value");
|
||||
resolve([rollString, skill, skillValue]);
|
||||
console.log(`User left the chooseSkill dialog with: rollString:${rollString}, skill:${skill}, skillValue:${skillValue}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
};
|
||||
//Normal
|
||||
dialogData.buttons.button2 = {
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
callback: (html) => {
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100`;
|
||||
skill = html.find("input[name='skill']:checked").attr("id");
|
||||
skillValue = html.find("input[name='skill']:checked").attr("value");
|
||||
skill = button.form.querySelector("input[name='skill']:checked")?.getAttribute("id");
|
||||
skillValue = button.form.querySelector("input[name='skill']:checked")?.getAttribute("value");
|
||||
resolve([rollString, skill, skillValue]);
|
||||
console.log(`User left the chooseSkill dialog with: rollString:${rollString}, skill:${skill}, skillValue:${skillValue}`);
|
||||
},
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
};
|
||||
//Disadvantage
|
||||
dialogData.buttons.button3 = {
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
callback: (html) => {
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = `1d100 [-]`;
|
||||
skill = html.find("input[name='skill']:checked").attr("id");
|
||||
skillValue = html.find("input[name='skill']:checked").attr("value");
|
||||
skill = button.form.querySelector("input[name='skill']:checked")?.getAttribute("id");
|
||||
skillValue = button.form.querySelector("input[name='skill']:checked")?.getAttribute("value");
|
||||
resolve([rollString, skill, skillValue]);
|
||||
console.log(`User left the chooseSkill dialog with: rollString:${rollString}, skill:${skill}, skillValue:${skillValue}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
};
|
||||
}
|
||||
]
|
||||
//add a next button if we dont need a rollString
|
||||
} else {
|
||||
dialogData.buttons.button1 = {
|
||||
label: game.i18n.localize("Mosh.Next"),
|
||||
callback: (html) => {
|
||||
skill = html.find("input[name='skill']:checked").attr("id");
|
||||
skillValue = html.find("input[name='skill']:checked").attr("value");
|
||||
resolve([rollString, skill, skillValue]);
|
||||
console.log(`User left the chooseSkill dialog with: rollString:${rollString}, skill:${skill}, skillValue:${skillValue}`);
|
||||
},
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
};
|
||||
dialogData.buttons = [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Next"),
|
||||
action: `action_next`,
|
||||
callback: (event, button, dialog) => {
|
||||
skill = button.form.querySelector("input[name='skill']:checked")?.getAttribute("id");
|
||||
skillValue = button.form.querySelector("input[name='skill']:checked")?.getAttribute("value");
|
||||
resolve([rollString, skill, skillValue]);
|
||||
console.log(`User left the chooseSkill dialog with: rollString:${rollString}, skill:${skill}, skillValue:${skillValue}`);
|
||||
},
|
||||
icon: `<i class="fas fa-chevron-circle-right"></i>`
|
||||
}
|
||||
]
|
||||
}
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: dialogHeight
|
||||
}).render(true);
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1119,47 +1124,44 @@ export class MothershipActor extends Actor {
|
||||
let dieDis = die + ` [-]`;
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: dlgTitle,
|
||||
buttonDesc: `<h4>` + game.i18n.localize("Mosh.SelectYourRollType") + `:</h4>`,
|
||||
buttons: {}
|
||||
window: {title: dlgTitle},
|
||||
position: {width: 600,height: 105},
|
||||
content: `<h4>` + game.i18n.localize("Mosh.SelectYourRollType") + `:</h4>`,
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = dieAdv;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = die;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: (event, button, dialog) => {
|
||||
rollString = dieDis;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//Advantage
|
||||
dialogData.buttons.button1 = {
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
callback: (html) => {
|
||||
rollString = dieAdv;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
};
|
||||
//Normal
|
||||
dialogData.buttons.button2 = {
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
callback: (html) => {
|
||||
rollString = die;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
};
|
||||
//Disadvantage
|
||||
dialogData.buttons.button3 = {
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
callback: (html) => {
|
||||
rollString = dieDis;
|
||||
resolve([rollString]);
|
||||
console.log(`User left the chooseAdvantage dialog with: rollString:${rollString}`);
|
||||
},
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 105
|
||||
}).render(true);
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2261,23 +2263,23 @@ export class MothershipActor extends Actor {
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue"),
|
||||
content: `<h4>` + game.i18n.localize("Mosh.OutOfAmmoNeedReload") + `</h4><br/>`,
|
||||
buttons: {}
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Reload"),
|
||||
action: `action_reload`,
|
||||
callback: () => this.reloadWeapon(itemId),
|
||||
icon: `<i class="fas fa-check"></i>`
|
||||
},
|
||||
{
|
||||
label: `Cancel`,
|
||||
action: `action_cancel`,
|
||||
callback: () => {},
|
||||
icon: `<i class="fas fa-times"></i>`
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//reload
|
||||
dialogData.buttons.roll = {
|
||||
label: game.i18n.localize("Mosh.Reload"),
|
||||
callback: () => this.reloadWeapon(itemId),
|
||||
icon: `<i class="fas fa-check"></i>`
|
||||
};
|
||||
//cancel
|
||||
dialogData.buttons.cancel = {
|
||||
label: `Cancel`,
|
||||
callback: () => {},
|
||||
icon: `<i class="fas fa-times"></i>`
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData).render(true);
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
});
|
||||
//log what was done
|
||||
console.log(`Asked for reload.`);
|
||||
@@ -2291,17 +2293,17 @@ export class MothershipActor extends Actor {
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.WeaponIssue"),
|
||||
content: `<h4>` + game.i18n.localize("Mosh.OutOfAmmo") + `</h4><br/>`,
|
||||
buttons: {}
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.OK"),
|
||||
action: `action_okay`,
|
||||
callback: () => {},
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//Ok
|
||||
dialogData.buttons.cancel = {
|
||||
label: game.i18n.localize("Mosh.OK"),
|
||||
callback: () => {},
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData).render(true);
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
});
|
||||
//log what was done
|
||||
console.log(`Told user they are out of ammo.`);
|
||||
@@ -2376,11 +2378,11 @@ export class MothershipActor extends Actor {
|
||||
ChatMessage.create({
|
||||
id: chatId,
|
||||
user: game.user.id,
|
||||
speaker: {
|
||||
actor: this.id,
|
||||
token: this.token,
|
||||
alias: this.name
|
||||
},
|
||||
speaker: {
|
||||
actor: this.id,
|
||||
token: this.token,
|
||||
alias: this.name
|
||||
},
|
||||
content: messageContent
|
||||
}, {
|
||||
keepId: true
|
||||
@@ -2588,28 +2590,27 @@ export class MothershipActor extends Actor {
|
||||
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.Cover"),
|
||||
window: {title: game.i18n.localize("Mosh.Cover")},
|
||||
position: {width: 600,height: 580},
|
||||
content: msgContent,
|
||||
buttons: {}
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.OK"),
|
||||
action: `action_okay`,
|
||||
callback: (event, button, dialog) => {
|
||||
this.update({
|
||||
'system.stats.armor.cover': button.form.querySelector("input[name='cover']:checked")?.getAttribute("value")
|
||||
});
|
||||
console.log(`User's cover is now:${button.form.querySelector("input[name='cover']:checked")?.getAttribute("value")}`);
|
||||
},
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//Ok
|
||||
dialogData.buttons.cancel = {
|
||||
label: game.i18n.localize("Mosh.OK"),
|
||||
callback: (html) => {
|
||||
this.update({
|
||||
'system.stats.armor.cover': html.find("input[name='cover']:checked").attr("value")
|
||||
});
|
||||
console.log(`User's cover is now:${html.find("input[name='cover']:checked").attr("value")}`);
|
||||
},
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 580
|
||||
}).render(true);
|
||||
});
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2622,32 +2623,34 @@ export class MothershipActor extends Actor {
|
||||
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.DistressSignal"),
|
||||
window: {title: game.i18n.localize("Mosh.DistressSignal")},
|
||||
position: {width: 600,height: 265},
|
||||
content: msgContent,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: () => this.rollTable(game.settings.get('mosh', 'table1eDistressSignal'), `1d10 [+]`, `low`, true, false, null, null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: () => this.rollTable(game.settings.get('mosh', 'table1eDistressSignal'), `1d10`, `low`, true, false, null, null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: () => this.rollTable(game.settings.get('mosh', 'table1eDistressSignal'), `1d10 [-]`, `low`, true, false, null, null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 265
|
||||
}).render(true);
|
||||
});
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2661,32 +2664,34 @@ export class MothershipActor extends Actor {
|
||||
`;
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.MaintenanceCheck"),
|
||||
window: {title: game.i18n.localize("Mosh.MaintenanceCheck")},
|
||||
position: {width: 600,height: 265},
|
||||
content: msgContent,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: () => this.rollTable(`maintenanceCheck`, `1d100 [+]`, `low`, null, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: () => this.rollTable(`maintenanceCheck`, `1d100`, `low`, null, null, null, null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: () => this.rollTable(`maintenanceCheck`, `1d100 [-]`, `low`, null, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 265
|
||||
}).render(true);
|
||||
});
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2700,32 +2705,34 @@ export class MothershipActor extends Actor {
|
||||
`;
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: game.i18n.localize("Mosh.BankrupcySave"),
|
||||
window: {title: game.i18n.localize("Mosh.BankrupcySave")},
|
||||
position: {width: 600,height: 265},
|
||||
content: msgContent,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: () => this.rollCheck(`1d100 [+]`, `low`, `bankruptcySave`, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: () => this.rollCheck(`1d100`, `low`, `bankruptcySave`, null, null, null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: () => this.rollCheck(`1d100 [-]`, `low`, `bankruptcySave`, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 265
|
||||
}).render(true);
|
||||
});
|
||||
new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2774,32 +2781,34 @@ export class MothershipActor extends Actor {
|
||||
`;
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: `Morale Check`,
|
||||
window: {title: `Morale Check`},
|
||||
position: {width: 600,height: 265},
|
||||
content: msgContent,
|
||||
buttons: {
|
||||
button1: {
|
||||
buttons: [
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Advantage"),
|
||||
action: `action_advantage`,
|
||||
callback: () => this.rollCheck(`1d10 [+]`, `high-equal`, `moraleCheck`, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-up"></i>`
|
||||
},
|
||||
button2: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Normal"),
|
||||
action: `action_normal`,
|
||||
callback: () => this.rollCheck(`1d10`, `high-equal`, `moraleCheck`, null, null, null),
|
||||
icon: `<i class="fas fa-minus"></i>`
|
||||
},
|
||||
button3: {
|
||||
{
|
||||
label: game.i18n.localize("Mosh.Disadvantage"),
|
||||
action: `action_disadvantage`,
|
||||
callback: () => this.rollCheck(`1d10 [-]`, `high-equal`, `moraleCheck`, null, null, null),
|
||||
icon: `<i class="fas fa-angle-double-down"></i>`
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData, {
|
||||
width: 600,
|
||||
height: 265
|
||||
}).render(true);
|
||||
});
|
||||
const dialog = new foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { DLCreatureSettings } from "../settings/creature-settings.js";
|
||||
|
||||
export class MothershipCreatureSheet extends ActorSheet {
|
||||
export class MothershipCreatureSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -43,7 +43,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
new DLCreatureSettings(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
async _updateObject(event, formData) {
|
||||
@@ -85,8 +85,8 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
|
||||
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.description = await TextEditor.enrichHTML(data.data.system.description, {async: true});
|
||||
data.data.enriched.biography = await TextEditor.enrichHTML(data.data.system.biography, {async: true});
|
||||
data.data.enriched.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.description, {async: true});
|
||||
data.data.enriched.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.biography, {async: true});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
item.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Attribute
|
||||
@@ -172,7 +172,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
weapon.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Weapon
|
||||
|
||||
@@ -9,7 +9,7 @@ import { DLShipMacros } from "../windows/ship-macros.js";
|
||||
import { DLShipMegaDamage } from "../windows/ship-megadamage.js";
|
||||
import { DLShipSetup } from "../windows/ship-setup.js";
|
||||
|
||||
export class MothershipShipSheetSBT extends ActorSheet {
|
||||
export class MothershipShipSheetSBT extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -35,7 +35,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
new DLShipDeckplan(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
_onOpenMacros(event) {
|
||||
@@ -43,7 +43,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
new DLShipMacros(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
_onOpenSetup(event) {
|
||||
@@ -51,7 +51,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
new DLShipSetup(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
_onOpenMegadamage(event) {
|
||||
@@ -59,7 +59,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
new DLShipMegaDamage(this.actor, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -98,7 +98,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
superData.supplies.hull.percentage = " [ " + Math.round(maxHull * 0.25) + " | " + Math.round(maxHull * 0.5) + " | " + Math.round(maxHull * 0.75) + " ]";
|
||||
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.biography = await TextEditor.enrichHTML(data.data.system.biography, {async: true});
|
||||
data.data.enriched.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.biography, {async: true});
|
||||
|
||||
|
||||
//Run Setup
|
||||
@@ -270,7 +270,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
item.sheet.render({force: true});
|
||||
|
||||
let amount = item.system.quantity;
|
||||
|
||||
@@ -318,7 +318,7 @@ export class MothershipShipSheetSBT extends ActorSheet {
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
weapon.sheet.render({force: true});
|
||||
});
|
||||
|
||||
// Rollable Weapon - not needed since individual ship weapons are not fired
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class MothershipShipSheet extends ActorSheet {
|
||||
export class MothershipShipSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -48,7 +48,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
superData.supplies.hull.percentage = " [ " + Math.round(maxHull * 0.25) + " | " + Math.round(maxHull * 0.5) + " | " + Math.round(maxHull * 0.75) + " ]";
|
||||
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.biography = await TextEditor.enrichHTML(data.data.system.biography, {async: true});
|
||||
data.data.enriched.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.biography, {async: true});
|
||||
|
||||
return data.data;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
item.sheet.render({force: true});
|
||||
|
||||
let amount = item.system.quantity;
|
||||
|
||||
@@ -161,7 +161,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
weapon.sheet.render({force: true});
|
||||
});
|
||||
// Rollable Weapon
|
||||
html.find('.weapon-roll').click(ev => {
|
||||
|
||||
+31
-27
@@ -61,14 +61,14 @@ export class MothershipClassSheet extends MothershipItemSheet {
|
||||
}*/
|
||||
|
||||
data.enriched=[];
|
||||
data.enriched.description = await TextEditor.enrichHTML(data.system.description, {async: true});
|
||||
data.enriched.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.system.description, {async: true});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async _onDrop(event){
|
||||
await super._onDrop(event);
|
||||
const droppedUuid = TextEditor.getDragEventData(event);
|
||||
const droppedUuid = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||
if (droppedUuid.type != "Item"){
|
||||
return;
|
||||
}
|
||||
@@ -247,48 +247,51 @@ export class MothershipClassSheet extends MothershipItemSheet {
|
||||
event.preventDefault();
|
||||
let choose_stat = this.object.system.selected_adjustment.choose_stat;
|
||||
|
||||
let DialogContent = `<h2>${game.i18n.localize("Mosh.CharacterGenerator.StatOption")}</h2>\
|
||||
<div> <input type="number" id='modification' placeholder="${game.i18n.localize("Mosh.Value")}" /></label></div>\
|
||||
<div> <input type="checkbox" id='strength' />${game.i18n.localize("Mosh.Strength")}</label></div>\
|
||||
<div> <input type="checkbox" id='speed' />${game.i18n.localize("Mosh.Speed")}</label></div>\
|
||||
<div> <input type="checkbox" id='intellect' />${game.i18n.localize("Mosh.Intellect")}</label></div>\
|
||||
<div> <input type="checkbox" id='combat' />${game.i18n.localize("Mosh.Combat")}</label></div>\
|
||||
<div> <input type="checkbox" id='sanity' />${game.i18n.localize("Mosh.Sanity")}</label></div>\
|
||||
<div> <input type="checkbox" id='fear' />${game.i18n.localize("Mosh.Fear")}</label></div>\
|
||||
<div> <input type="checkbox" id='body' />${game.i18n.localize("Mosh.Body")}</label></div>`
|
||||
let DialogContent = `
|
||||
<h2>${game.i18n.localize("Mosh.CharacterGenerator.StatOption")}</h2>\
|
||||
<div> <input type="number" id='modification' placeholder="${game.i18n.localize("Mosh.Value")}" /></label></div>\
|
||||
<div> <input type="checkbox" id='strength' />${game.i18n.localize("Mosh.Strength")}</label></div>\
|
||||
<div> <input type="checkbox" id='speed' />${game.i18n.localize("Mosh.Speed")}</label></div>\
|
||||
<div> <input type="checkbox" id='intellect' />${game.i18n.localize("Mosh.Intellect")}</label></div>\
|
||||
<div> <input type="checkbox" id='combat' />${game.i18n.localize("Mosh.Combat")}</label></div>\
|
||||
<div> <input type="checkbox" id='sanity' />${game.i18n.localize("Mosh.Sanity")}</label></div>\
|
||||
<div> <input type="checkbox" id='fear' />${game.i18n.localize("Mosh.Fear")}</label></div>\
|
||||
<div> <input type="checkbox" id='body' />${game.i18n.localize("Mosh.Body")}</label></div>
|
||||
`
|
||||
|
||||
let d = new Dialog({
|
||||
title: "Select Stat",
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: `Select Stat`},
|
||||
content: DialogContent,
|
||||
buttons: {
|
||||
create: {
|
||||
buttons: [
|
||||
{
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
action: "create",
|
||||
label: "Create",
|
||||
callback: (html) => {
|
||||
callback: (event, button, dialog) => {
|
||||
|
||||
let new_stat_option = {
|
||||
modification: html.find('[id=\"modification\"]').prop("value"),
|
||||
modification: button.form.querySelector('[id=\"modification\"]').prop("value"),
|
||||
stats: [],
|
||||
}
|
||||
if (html.find('[id=\"strength\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"strength\"]')?.checked){
|
||||
new_stat_option.stats.push("strength");
|
||||
}
|
||||
if (html.find('[id=\"speed\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"speed\"]')?.checked){
|
||||
new_stat_option.stats.push("speed");
|
||||
}
|
||||
if (html.find('[id=\"intellect\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"intellect\"]')?.checked){
|
||||
new_stat_option.stats.push("intellect");
|
||||
}
|
||||
if (html.find('[id=\"combat\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"combat\"]')?.checked){
|
||||
new_stat_option.stats.push("combat");
|
||||
}
|
||||
if (html.find('[id=\"sanity\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"sanity\"]')?.checked){
|
||||
new_stat_option.stats.push("sanity");
|
||||
}
|
||||
if (html.find('[id=\"fear\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"fear\"]')?.checked){
|
||||
new_stat_option.stats.push("fear");
|
||||
}
|
||||
if (html.find('[id=\"body\"]')[0].checked){
|
||||
if (button.form.querySelector('[id=\"body\"]')?.checked){
|
||||
new_stat_option.stats.push("body");
|
||||
}
|
||||
if(new_stat_option.stats.length < 2){
|
||||
@@ -301,16 +304,17 @@ export class MothershipClassSheet extends MothershipItemSheet {
|
||||
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
{
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
action: "cancel",
|
||||
label: "Cancel",
|
||||
callback: () => { }
|
||||
}
|
||||
},
|
||||
],
|
||||
default: "create",
|
||||
close: () => { }
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
|
||||
// Finally, create the item!
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class MothershipItemSheet extends ItemSheet {
|
||||
export class MothershipItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -50,7 +50,7 @@ export class MothershipItemSheet extends ItemSheet {
|
||||
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
|
||||
|
||||
data.data.enriched = [];
|
||||
data.data.enriched.description = await TextEditor.enrichHTML(data.data.system.description, {async: true});
|
||||
data.data.enriched.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(data.data.system.description, {async: true});
|
||||
|
||||
return data.data;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
* Extend the basic Item with some very simple modifications.
|
||||
* @extends {Item}
|
||||
*/
|
||||
export class MothershipItem extends Item {
|
||||
export class MothershipItem extends foundry.appv1.Item {
|
||||
/**
|
||||
* Augment the basic Item data model with additional dynamic data.
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ export class MothershipSkillSheet extends MothershipItemSheet {
|
||||
|
||||
async _onDrop(event){
|
||||
await super._onDrop(event);
|
||||
const droppedUuid = TextEditor.getDragEventData(event);
|
||||
const droppedUuid = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||
if (droppedUuid.type != "Item"){
|
||||
return;
|
||||
}
|
||||
|
||||
+34
-368
@@ -46,31 +46,15 @@ Hooks.once('init', async function () {
|
||||
|
||||
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
|
||||
Actors.registerSheet("mosh", MothershipActorSheet, {
|
||||
types: ['character'],
|
||||
makeDefault: true
|
||||
});
|
||||
Actors.registerSheet("mosh", MothershipCreatureSheet, {
|
||||
types: ['creature'],
|
||||
makeDefault: false
|
||||
});
|
||||
|
||||
Actors.registerSheet("mosh", MothershipShipSheetSBT, {
|
||||
types: ['ship'],
|
||||
makeDefault: true
|
||||
});
|
||||
|
||||
Actors.registerSheet("mosh", MothershipShipSheet, {
|
||||
types: ['ship'],
|
||||
makeDefault: false
|
||||
});
|
||||
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("mosh", MothershipClassSheet, {types: ['class'], makeDefault: true });
|
||||
Items.registerSheet("mosh", MothershipSkillSheet, {types: ['skill'], makeDefault: true });
|
||||
Items.registerSheet("mosh", MothershipItemSheet, {
|
||||
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
|
||||
foundry.documents.collections.Actors.registerSheet("mosh", MothershipActorSheet, {types: ['character'], makeDefault: true});
|
||||
foundry.documents.collections.Actors.registerSheet("mosh", MothershipCreatureSheet, {types: ['creature'], makeDefault: false});
|
||||
foundry.documents.collections.Actors.registerSheet("mosh", MothershipShipSheetSBT, {types: ['ship'], makeDefault: true});
|
||||
foundry.documents.collections.Actors.registerSheet("mosh", MothershipShipSheet, {types: ['ship'], makeDefault: false});
|
||||
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
|
||||
foundry.documents.collections.Items.registerSheet("mosh", MothershipClassSheet, {types: ['class'], makeDefault: true});
|
||||
foundry.documents.collections.Items.registerSheet("mosh", MothershipSkillSheet, {types: ['skill'], makeDefault: true});
|
||||
foundry.documents.collections.Items.registerSheet("mosh", MothershipItemSheet, {
|
||||
types: [
|
||||
"item",
|
||||
"weapon",
|
||||
@@ -79,8 +63,10 @@ Hooks.once('init', async function () {
|
||||
"module",
|
||||
"condition",
|
||||
"crew",
|
||||
"repair",],
|
||||
makeDefault: true });
|
||||
"repair"
|
||||
],
|
||||
makeDefault: true
|
||||
});
|
||||
|
||||
// If you need to add Handlebars helpers, here are a few useful examples:
|
||||
Handlebars.registerHelper('concat', function () {
|
||||
@@ -309,7 +295,7 @@ Hooks.on('renderSidebarTab', async (app, html) => {
|
||||
console.log("testing~");
|
||||
let button = $(`<button class="import-json"><i class="fas fa-file-import"></i> Import JSON</button>`);
|
||||
button.click(function () {
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
});
|
||||
html.find(".directory-footer").append(button);
|
||||
}
|
||||
@@ -366,326 +352,6 @@ console.log(command);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Actor from JSON */
|
||||
/* -------------------------------------------- */
|
||||
// If there's a better place for these, please do move them
|
||||
let skillValues = {
|
||||
"archeology": { "value": 10, "rank": "Trained" },
|
||||
"archaelogy": { "value": 10, "rank": "Trained" }, //The mobile app has a typo so needs this.
|
||||
"archaeology": { "value": 10, "rank": "Trained" },
|
||||
"art": { "value": 10, "rank": "Trained" },
|
||||
"athletics": { "value": 10, "rank": "Trained" },
|
||||
"botany": { "value": 10, "rank": "Trained" },
|
||||
"chemistry": { "value": 10, "rank": "Trained" },
|
||||
"computers": { "value": 10, "rank": "Trained" },
|
||||
"geology": { "value": 10, "rank": "Trained" },
|
||||
"industrialequipment": { "value": 10, "rank": "Trained" },
|
||||
"juryrigging": { "value": 10, "rank": "Trained" },
|
||||
"linguistics": { "value": 10, "rank": "Trained" },
|
||||
"mathematics": { "value": 10, "rank": "Trained" },
|
||||
"militarytraining": { "value": 10, "rank": "Trained" },
|
||||
"rimwise": { "value": 10, "rank": "Trained" },
|
||||
"theology": { "value": 10, "rank": "Trained" },
|
||||
"zerog": { "value": 10, "rank": "Trained" },
|
||||
"zoology": { "value": 10, "rank": "Trained" },
|
||||
"asteroidmining": { "value": 15, "rank": "Expert" },
|
||||
"ecology": { "value": 15, "rank": "Expert" },
|
||||
"explosives": { "value": 15, "rank": "Expert" },
|
||||
"fieldmedicine": { "value": 15, "rank": "Expert" },
|
||||
"firearms": { "value": 15, "rank": "Expert" },
|
||||
"hacking": { "value": 15, "rank": "Expert" },
|
||||
"handtohandcombat": { "value": 15, "rank": "Expert" },
|
||||
"mechanicalrepair": { "value": 15, "rank": "Expert" },
|
||||
"mysticism": { "value": 15, "rank": "Expert" },
|
||||
"pathology": { "value": 15, "rank": "Expert" },
|
||||
"pharmacology": { "value": 15, "rank": "Expert" },
|
||||
"physics": { "value": 15, "rank": "Expert" },
|
||||
"piloting": { "value": 15, "rank": "Expert" },
|
||||
"psychology": { "value": 15, "rank": "Expert" },
|
||||
"tactics": { "value": 15, "rank": "Expert" },
|
||||
"wildernesssurvival": { "value": 15, "rank": "Expert" },
|
||||
"artificialintenligence": { "value": 20, "rank": "Master" },
|
||||
"command": { "value": 20, "rank": "Master" },
|
||||
"cybernetics": { "value": 20, "rank": "Master" },
|
||||
"engineering": { "value": 20, "rank": "Master" },
|
||||
"exobiology": { "value": 20, "rank": "Master" },
|
||||
"hyperspace": { "value": 20, "rank": "Master" },
|
||||
"planetology": { "value": 20, "rank": "Master" },
|
||||
"robotics": { "value": 20, "rank": "Master" },
|
||||
"sophontology": { "value": 20, "rank": "Master" },
|
||||
"surgery": { "value": 20, "rank": "Master" },
|
||||
"xenoesoterism": { "value": 20, "rank": "Master" },
|
||||
}
|
||||
|
||||
let conditions = {
|
||||
"adrenalinerush": "[+] on all rolls for the next 2d10 minutes. Reduce your Stress by 1d5.",
|
||||
"anxious": "Gain 1 Stress.",
|
||||
"jumpy": "Gain 1 Stress. All Close crewmembers gain 2 Stress.",
|
||||
"overwhelmed": "All actions at [-] for 1d10 minutes. Permanently raise your Minimum Stress by 1.",
|
||||
"coward": "Gain a new Condition: You must make a Fear Save to engage in violence or flee.",
|
||||
"frightened": "Gain a new Condition: Phobia: When encountering your Phobia make a Fear Save [-] or gain 1d5 Stress.",
|
||||
"nightmares": "Gain a new Condition: Sleep is difficult, gain [-] on all Rest Saves.",
|
||||
"lossofconfidence": "Gain a new Condition: Choose one of your Skills and lose that Skill's bonus.",
|
||||
"deflated": "Gain a new Condition: Whenever a Close crewmember fails a Save, gain 1 Stress.",
|
||||
"doomed": "Gain a new Condition: You feel cursed and unlucky. All Critical Successes are instead Critical Failures.",
|
||||
"paranoid": "For the next week, whenever someone joins your group (even if they only left for a short period of time), make a Fear Save or gain 1 Stress.",
|
||||
"haunted": "Gain a new Condition: Something starts visiting you at night. In your dreams. Out of the corner of your eye. And soon it will start making demands.",
|
||||
"deathwish": "For the next 24 hours, whenever you encounter a stranger or known enemy, you must make a Sanity Save or immediately attack them.",
|
||||
"propheticvision": "You immediately experience an intense hallucination or vision of an impending terror or horrific event. Gain 1 Stress.",
|
||||
"catatonic": "Become unresponsive and unmoving for 2d10 minutes. Reduce Stress by 1d10.",
|
||||
"rage": "Immediately attack the closest crewmember until you inflict at least 2d10 DMG. If there is no crewmember Close, you attack your surrounding environment.",
|
||||
"spiraling": "Gain a new Condition: You make Panic Checks with Disadvantage.",
|
||||
"compoundingproblems": "Roll twice on this table. Permanently raise your Minimum Stress by 1.",
|
||||
"heartattack": "Permanently lose 1 Wound. Gain [-] on all rolls for 1d10 hours. Permanently raise your Minimum Stress by 1.",
|
||||
"collapse": "You no longer control this character. Hand your sheet to the Warden and roll up a new character to play."
|
||||
}
|
||||
|
||||
async function createActorFromJson(jsonData) {
|
||||
let actorData;
|
||||
let newActor;
|
||||
try {
|
||||
actorData = JSON.parse(jsonData);
|
||||
newActor = {
|
||||
"name": actorData.name,
|
||||
"type": "character",
|
||||
"img": "icons/svg/mystery-man.svg",
|
||||
"system": {
|
||||
"health": {
|
||||
"value": actorData.health,
|
||||
"max": actorData.maxHealth,
|
||||
"min": 0
|
||||
},
|
||||
"hits": {
|
||||
"value": actorData.wounds,
|
||||
"max": actorData.maxWounds
|
||||
},
|
||||
"biography": "",
|
||||
"notes": "",
|
||||
"weight": { "current": 0, "capacity": 0 },
|
||||
"settings": { "useCalm": false },
|
||||
"class": {
|
||||
"value": actorData.characterClass.charAt(0).toUpperCase() + actorData.characterClass.slice(1)
|
||||
},
|
||||
"rank": { "value": "" },
|
||||
"pronouns": { "value": actorData.pronouns },
|
||||
"credits": { "value": actorData.credits },
|
||||
"stressdesc": { "value": actorData.traumaResponse },
|
||||
"xp": { "value": 0, "html": 0, "selectedSkill": "" },
|
||||
"stressdesc": { "value": actorData.traumaResponse },
|
||||
"attributes": { "level": { "value": actorData.highScore } },
|
||||
"stats": {
|
||||
"strength": {
|
||||
"value": actorData.strength, "label": "Strength", "mod": 0
|
||||
},
|
||||
"speed": {
|
||||
"value": actorData.speed, "label": "Speed", "mod": 0
|
||||
},
|
||||
"intellect": {
|
||||
"value": actorData.intellect, "label": "Intellect", "mod": 0
|
||||
},
|
||||
"combat": {
|
||||
"value": actorData.combat, "label": "Combat", "mod": 0
|
||||
},
|
||||
"sanity": {
|
||||
"value": actorData.sanity, "label": "Sanity", "mod": 0
|
||||
},
|
||||
"fear": {
|
||||
"value": actorData.fear, "label": "Fear", "mod": 0
|
||||
},
|
||||
"body": {
|
||||
"value": actorData.body, "label": "Body", "mod": 0
|
||||
}
|
||||
},
|
||||
"other": {
|
||||
"stress": {
|
||||
"value": actorData.stress, "min": actorData.minStress, "label": "Stress"
|
||||
},
|
||||
"resolve": 0
|
||||
}
|
||||
}
|
||||
};
|
||||
var items = [];
|
||||
if (actorData.trinket) {
|
||||
items.push({
|
||||
"name": "Trinket: " + actorData.trinket, "type": "item"
|
||||
})
|
||||
}
|
||||
if (actorData.patch) {
|
||||
items.push({
|
||||
"name": "Patch: " + actorData.patch, "type": "item"
|
||||
})
|
||||
}
|
||||
// Equipment
|
||||
for (let i = 0; i < actorData.equipment.length; i++) {
|
||||
items.push({
|
||||
"name": actorData.equipment[i].name,
|
||||
"type": "item",
|
||||
"system": {
|
||||
"description": actorData.equipment[i].description,
|
||||
"cost": actorData.equipment[i].cost,
|
||||
"quantity": actorData.equipment[i].quantity
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
// Items
|
||||
for (let i = 0; i < actorData.items.length; i++) {
|
||||
items.push({
|
||||
"name": actorData.items[i].title,
|
||||
"type": "item",
|
||||
"system": {
|
||||
"description": actorData.items[i].description,
|
||||
"cost": actorData.items[i].cost,
|
||||
"quantity": actorData.items[i].quantity
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
// Armor
|
||||
for (let i = 0; i < actorData.armor.length; i++) {
|
||||
items.push({
|
||||
"name": actorData.armor[i].name,
|
||||
"type": "armor",
|
||||
"system": {
|
||||
"description": actorData.armor[i].notes,
|
||||
"cost": actorData.armor[i].cost,
|
||||
"bonus": actorData.armor[i].armorPoints,
|
||||
"equipped": actorData.armor[i].equipped
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
// Weapons
|
||||
for (let i = 0; i < actorData.weapons.length; i++) {
|
||||
console.log(actorData.weapons[i]);
|
||||
items.push({
|
||||
"name": actorData.weapons[i].name,
|
||||
"type": "weapon",
|
||||
"system": {
|
||||
"description": actorData.weapons[i].special,
|
||||
"cost": actorData.weapons[i].cost,
|
||||
"ranges": {
|
||||
"short": 0,
|
||||
"medium": 0,
|
||||
"long": 0,
|
||||
"value": actorData.weapons[i].weaponRange
|
||||
},
|
||||
"equipped": actorData.weapons[i].equipped,
|
||||
"critEffect": actorData.weapons[i].critical,
|
||||
"shots": actorData.weapons[i].shots,
|
||||
"curShots": actorData.weapons[i].shots,
|
||||
"ammo": actorData.weapons[i].magazines,
|
||||
"shotsPerFire": "1",
|
||||
"useAmmo": false,
|
||||
"ammoType": "",
|
||||
"critDmg": actorData.weapons[i].critical,
|
||||
"critEffect": "",
|
||||
"damage": actorData.weapons[i].damageString.replace("DMG", "")
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
// Skills
|
||||
for (let i = 0; i < actorData.skills.length; i++) {
|
||||
|
||||
if(actorData.skills[i] == undefined) continue;
|
||||
console.log(actorData.skills[i]);
|
||||
console.log(skillValues[actorData.skills[i].toLowerCase()]);
|
||||
|
||||
// Really betting for the app to only export base skills, if in the future
|
||||
// they add custom skills, they'll need to be checked if they even exist
|
||||
let words = actorData.skills[i].split(/(?=[A-Z])/);
|
||||
let skillName = words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
||||
items.push({
|
||||
"name": skillName,
|
||||
"type": "skill",
|
||||
"system": {
|
||||
"description": "",
|
||||
"bonus": skillValues[actorData.skills[i].toLowerCase()].value,
|
||||
"rank": skillValues[actorData.skills[i].toLowerCase()].rank
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
// Conditions
|
||||
for (let i = 0; i < actorData.conditions.length; i++) {
|
||||
// Same thing as skills
|
||||
let conName = actorData.conditions[i].conditionType;
|
||||
let words = conName.split(/(?=[A-Z])/);
|
||||
let name = words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
||||
//-Minor consideration since the app eports heartAttack for both
|
||||
if (actorData.characterClass == "android" && conName.toLowerCase() == "heartattack") {
|
||||
name = "Short Circuit"
|
||||
}
|
||||
items.push({
|
||||
"name": name,
|
||||
"type": "condition",
|
||||
"system": {
|
||||
"description": conditions[conName.toLowerCase()],
|
||||
"treatment": { "value": 0, "html": "" }
|
||||
},
|
||||
"img": "icons/svg/item-bag.svg",
|
||||
})
|
||||
}
|
||||
newActor.items = items
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ui.notifications.error("Invalid JSON, make sure you exported it from the Mothership Companion App");
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure the type of the actor (e.g., 'character') is correctly set according to your system
|
||||
newActor.type = 'character';
|
||||
// Here we assume the actorData structure is correctly formed according to your system needs
|
||||
|
||||
// You might need additional checks/transformations depending on the JSON data structure
|
||||
|
||||
try {
|
||||
await Actor.create(newActor);
|
||||
ui.notifications.info("Character imported successfully!");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
ui.notifications.error("Failed to import character, check console for more details.");
|
||||
}
|
||||
}
|
||||
|
||||
let d = new Dialog({
|
||||
title: "Mothership Companion JSON Import",
|
||||
content: `
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>JSON File:</label>
|
||||
<input type="file" id="json-upload" accept=".json">
|
||||
</div>
|
||||
</form>
|
||||
`,
|
||||
buttons: {
|
||||
upload: {
|
||||
label: "Upload",
|
||||
callback: (html) => {
|
||||
let fileInput = html.find('#json-upload')[0];
|
||||
let file = fileInput.files[0];
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.onload = (event) => {
|
||||
let contents = event.target.result;
|
||||
createActorFromJson(contents);
|
||||
};
|
||||
|
||||
reader.onerror = (event) => {
|
||||
console.error(`File could not be read: ${event.target.error}`);
|
||||
};
|
||||
|
||||
reader.readAsText(file);
|
||||
}
|
||||
}
|
||||
},
|
||||
default: "upload"
|
||||
})
|
||||
d.render(true);
|
||||
|
||||
|
||||
/**
|
||||
* Roll Macro from a Weapon.
|
||||
* @param {string} itemName
|
||||
@@ -909,19 +575,19 @@ async function noCharSelected() {
|
||||
}
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: `Macro Issue`,
|
||||
window: {title: `Macro Issue`},
|
||||
content: errorMessage,
|
||||
buttons: {}
|
||||
buttons: [
|
||||
{
|
||||
label: `Ok`,
|
||||
action: 'action_ok',
|
||||
callback: () => { },
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//Ok
|
||||
dialogData.buttons.cancel = {
|
||||
label: `Ok`,
|
||||
callback: () => { },
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData).render(true);
|
||||
const dialog = foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
//log what was done
|
||||
console.log(`Told the user that no character was selected.`);
|
||||
});
|
||||
@@ -941,19 +607,19 @@ async function noShipSelected() {
|
||||
}
|
||||
//create final dialog data
|
||||
const dialogData = {
|
||||
title: `Macro Issue`,
|
||||
window: {title: `Macro Issue`},
|
||||
content: errorMessage,
|
||||
buttons: {}
|
||||
buttons: [
|
||||
{
|
||||
label: `Ok`,
|
||||
action: 'action_ok',
|
||||
callback: () => { },
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
}
|
||||
]
|
||||
};
|
||||
//add buttons
|
||||
//Ok
|
||||
dialogData.buttons.cancel = {
|
||||
label: `Ok`,
|
||||
callback: () => { },
|
||||
icon: '<i class="fas fa-check"></i>'
|
||||
};
|
||||
//render dialog
|
||||
const dialog = new Dialog(dialogData).render(true);
|
||||
const dialog = foundry.applications.api.DialogV2(dialogData).render({force: true});
|
||||
//log what was done
|
||||
console.log(`Told the user that no character was selected.`);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class DLCreatureSettings extends FormApplication {
|
||||
export class DLCreatureSettings extends foundry.appv1.FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
@@ -150,6 +150,6 @@ export class DLCreatureSettings extends FormApplication {
|
||||
this.object.update({
|
||||
formData
|
||||
});
|
||||
this.object.sheet.render(true);
|
||||
this.object.sheet.render({force: true});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class DLActorGenerator extends FormApplication {
|
||||
export class DLActorGenerator extends foundry.appv1.FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
@@ -121,7 +121,7 @@ export class DLActorGenerator extends FormApplication {
|
||||
} else if (tableResult.results[i].type == "text") {
|
||||
let tableTextmatch = tableResult.results[i].text.match(/(.*)(@UUID.*)/i);
|
||||
if (type == "ul") {
|
||||
this._element.find(`ul[id="${id}.text"]`).append(`<li>${await TextEditor.enrichHTML(tableTextmatch[2].replace(/(\<br\s\/>)+/i, ""), { async: true })}</li>`);
|
||||
this._element.find(`ul[id="${id}.text"]`).append(`<li>${await foundry.applications.ux.TextEditor.implementation.enrichHTML(tableTextmatch[2].replace(/(\<br\s\/>)+/i, ""), { async: true })}</li>`);
|
||||
}
|
||||
else {
|
||||
resultText += tableTextmatch[1].replace(/(\<br\s\/>)+/i, "");
|
||||
@@ -193,23 +193,23 @@ export class DLActorGenerator extends FormApplication {
|
||||
*/
|
||||
async fixedSkillOptionPopup(html, skillPopupOptions) {
|
||||
return new Promise((resolve) => {
|
||||
let buttons_options = {};
|
||||
let buttons_options = [];
|
||||
for (let j = 0; j < skillPopupOptions.length; j++) {
|
||||
buttons_options[j] = {
|
||||
buttons_options.push({
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: skillPopupOptions[j].name,
|
||||
callback: () => resolve(skillPopupOptions[j].uuid),
|
||||
};
|
||||
});
|
||||
}
|
||||
let d = new Dialog({
|
||||
title: game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupTitle"),
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupTitle")},
|
||||
content: `<p>${game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupText")}</p>`,
|
||||
buttons: buttons_options,
|
||||
default: "1",
|
||||
//render: html => console.log("Register interactivity in the rendered dialog"),
|
||||
//close: html => console.log("This always is logged no matter which option is chosen")
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ export class DLActorGenerator extends FormApplication {
|
||||
}
|
||||
new_skills.push(skill.uuid);
|
||||
/**we need to keep only the Uuid of the item, not the complete string (for now) */
|
||||
let li_html = `<li><img src="${skill.img}" title="${skill.name}" width="24" height="24"/> ${await TextEditor.enrichHTML(skill.name, { async: true })}</li>`;
|
||||
let li_html = `<li><img src="${skill.img}" title="${skill.name}" width="24" height="24"/> ${await foundry.applications.ux.TextEditor.implementation.enrichHTML(skill.name, { async: true })}</li>`;
|
||||
html.find(`ul[id="system.class.skils.text"]`).append(li_html);
|
||||
|
||||
}
|
||||
@@ -324,15 +324,15 @@ export class DLActorGenerator extends FormApplication {
|
||||
let popUpContent = await renderTemplate(template, skillPopupData);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
let d = new Dialog({
|
||||
title: game.i18n.localize("Mosh.CharacterGenerator.SkillOption.PopupTitle"),
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: game.i18n.localize("Mosh.CharacterGenerator.SkillOption.PopupTitle")},
|
||||
content: popUpContent,
|
||||
buttons: {
|
||||
"1": {
|
||||
buttons: [
|
||||
{
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Save",
|
||||
callback: (html) => {
|
||||
let form = html.find('form')[0];
|
||||
callback: (event, button, dialog) => {
|
||||
let form = button.form.querySelector('form');
|
||||
let formData = new FormData(form);
|
||||
let new_skills = [];
|
||||
formData.forEach((value, key) => {
|
||||
@@ -345,11 +345,11 @@ export class DLActorGenerator extends FormApplication {
|
||||
this.updateSkillHtmlUl(this._element, new_skills);
|
||||
resolve();
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
default: "1",
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -365,25 +365,23 @@ export class DLActorGenerator extends FormApplication {
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
||||
let buttonsData = {};
|
||||
let buttonsData = [];
|
||||
for (let i=0;i<list_option_skills_or.length;i++){
|
||||
buttonsData[i]={
|
||||
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: list_option_skills_or[i].name,//game.i18n.localize("Mosh.CharacterGenerator.SkillOption.ChoiceWord") + ` ${i}`,
|
||||
callback: () => {
|
||||
resolve(list_option_skills_or[i]);
|
||||
}
|
||||
|
||||
};
|
||||
buttonsData.push({
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: list_option_skills_or[i].name,//game.i18n.localize("Mosh.CharacterGenerator.SkillOption.ChoiceWord") + ` ${i}`,
|
||||
callback: () => {
|
||||
resolve(list_option_skills_or[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
let d = new Dialog({
|
||||
title: game.i18n.localize("Mosh.CharacterGenerator.SkillOption.PopupTitle"),
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: game.i18n.localize("Mosh.CharacterGenerator.SkillOption.PopupTitle")},
|
||||
content: popUpContent,
|
||||
window:{width: 500,},
|
||||
window:{width: 500},
|
||||
buttons: buttonsData,
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -477,24 +475,24 @@ export class DLActorGenerator extends FormApplication {
|
||||
for(let i =0;i<list_option_stats_and_saves.length;i++){
|
||||
let option_stats_and_saves = list_option_stats_and_saves[i];
|
||||
if (option_stats_and_saves.modification) {
|
||||
let buttons_options = {};
|
||||
let buttons_options = [];
|
||||
for (let j = 0; j < option_stats_and_saves.stats.length; j++) {
|
||||
let prev_bonus = this._element.find(`input[name="system.stats.${option_stats_and_saves.stats[j]}.bonus"]`).prop("value");
|
||||
buttons_options[j] = {
|
||||
buttons_options.push({
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: option_stats_and_saves.stats[j],//.replace(/\.bonus/i,"").replace(/(.*)\.+/i,""),
|
||||
callback: () => this._element.find(`input[name="system.stats.${option_stats_and_saves.stats[j]}.bonus"]`).prop("value", (parseInt(option_stats_and_saves.modification) + parseInt(prev_bonus)))
|
||||
};
|
||||
});
|
||||
}
|
||||
let d = new Dialog({
|
||||
title: game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupTitle"),
|
||||
let d = new foundry.applications.api.DialogV2({
|
||||
window: {title: game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupTitle")},
|
||||
content: `<p>${game.i18n.localize("Mosh.CharacterGenerator.StatOptionPopupText")} (${option_stats_and_saves.modification})</p>`,
|
||||
buttons: buttons_options,
|
||||
default: "1",
|
||||
//render: html => console.log("Register interactivity in the rendered dialog"),
|
||||
//close: html => console.log("This always is logged no matter which option is chosen")
|
||||
});
|
||||
d.render(true);
|
||||
d.render({force: true});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +508,7 @@ export class DLActorGenerator extends FormApplication {
|
||||
|
||||
async _onDrop(event) {
|
||||
await super._onDrop(event);
|
||||
const droppedUuid = TextEditor.getDragEventData(event);
|
||||
const droppedUuid = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||
if (droppedUuid.type != "Item") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class rolltableConfig extends FormApplication {
|
||||
export class rolltableConfig extends foundry.appv1.FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
console.log(options);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class DLShipDeckplan extends ActorSheet {
|
||||
export class DLShipDeckplan extends foundry.appv1.sheets.ActorSheet {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
@@ -57,6 +57,6 @@ export class DLShipDeckplan extends ActorSheet {
|
||||
this.object.update({
|
||||
formData
|
||||
});
|
||||
this.object.sheet.render(true);
|
||||
this.object.sheet.render({force: true});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DLShipDeckplan } from "../windows/ship-deckplan.js";
|
||||
|
||||
|
||||
export class DLShipMacros extends BaseSheet {
|
||||
export class DLShipMacros extends foundry.applications.sheets.BaseSheet {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
@@ -27,7 +27,7 @@ export class DLShipMacros extends BaseSheet {
|
||||
new DLShipDeckplan(this.object, {
|
||||
top: this.position.top + 40,
|
||||
left: this.position.left + (this.position.width - 400) / 2
|
||||
}).render(true);
|
||||
}).render({force: true});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fromIdUuid } from "../mosh.js";
|
||||
export class DLShipMegaDamage extends FormApplication {
|
||||
export class DLShipMegaDamage extends foundry.appv1.FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class DLShipSetup extends FormApplication {
|
||||
export class DLShipSetup extends foundry.appv1.FormApplication {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.id = 'sheet-modifiers';
|
||||
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.107 5884 Delete type=3 #1
|
||||
2025/01/05-13:03:25.761 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.763 43f4 Level-0 table #5: 15355 bytes OK
|
||||
2025/01/05-13:03:25.766 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.778 43f4 Manual compaction at level-0 from '!items!1r6ruvSdxn2bHHIk' @ 72057594037927935 : 1 .. '!items!zbKI2RCl5h3vowoy' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:16.947 9e0 Delete type=3 #1
|
||||
2025/01/05-13:03:25.746 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.749 43f4 Level-0 table #5: 24497 bytes OK
|
||||
2025/01/05-13:03:25.751 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.752 43f4 Manual compaction at level-0 from '!items!0ZAwhewvLBwX3opf' @ 72057594037927935 : 1 .. '!items!z0avrplKe6M0RcXk' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:16.980 5f1c Delete type=3 #1
|
||||
2025/01/05-13:03:25.728 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.732 43f4 Level-0 table #5: 24089 bytes OK
|
||||
2025/01/05-13:03:25.734 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.751 43f4 Manual compaction at level-0 from '!items!1HNvL7XEUcMQbLps' @ 72057594037927935 : 1 .. '!items!zRzb3Laiuw4ac6p0' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.136 9e0 Delete type=3 #1
|
||||
2025/01/05-13:03:25.772 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.775 43f4 Level-0 table #5: 24937 bytes OK
|
||||
2025/01/05-13:03:25.778 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.778 43f4 Manual compaction at level-0 from '!macros!2xRvRAixuocjCm40' @ 72057594037927935 : 1 .. '!macros!ilBclUmPwcd7aNQK' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
+10
-10
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.011 5a8 Delete type=3 #1
|
||||
2025/01/05-13:03:25.735 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.737 43f4 Level-0 table #5: 33305 bytes OK
|
||||
2025/01/05-13:03:25.740 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.752 43f4 Manual compaction at level-0 from '!macros!2u4a5gEogtLd3XQz' @ 72057594037927935 : 1 .. '!macros!trU0DtBJvJCPddsQ' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.165 5a8 Delete type=3 #1
|
||||
2025/01/05-13:03:25.766 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.769 43f4 Level-0 table #5: 24964 bytes OK
|
||||
2025/01/05-13:03:25.772 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.778 43f4 Manual compaction at level-0 from '!macros!0Yw4QWSAeOuUzRqB' @ 72057594037927935 : 1 .. '!macros!z5V92LyXHjfMxnRQ' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.040 5884 Delete type=3 #1
|
||||
2025/01/05-13:03:25.740 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.743 43f4 Level-0 table #5: 48976 bytes OK
|
||||
2025/01/05-13:03:25.746 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.752 43f4 Manual compaction at level-0 from '!macros!06NSvDYTtmkeUtLq' @ 72057594037927935 : 1 .. '!macros!zLRsweb35Lw0NMev' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.196 5884 Delete type=3 #1
|
||||
2025/01/05-13:03:25.779 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.785 43f4 Level-0 table #5: 34959 bytes OK
|
||||
2025/01/05-13:03:25.788 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.797 43f4 Manual compaction at level-0 from '!tables!1vCm4ElRPotQXgNB' @ 72057594037927935 : 1 .. '!tables.results!kqKpQAXyLTEEyz6Z.xdwwswzfoPuVifvw' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
MANIFEST-000002
|
||||
@@ -1,5 +0,0 @@
|
||||
2025/01/05-13:02:17.072 5f1c Delete type=3 #1
|
||||
2025/01/05-13:03:25.753 43f4 Level-0 table #5: started
|
||||
2025/01/05-13:03:25.758 43f4 Level-0 table #5: 80209 bytes OK
|
||||
2025/01/05-13:03:25.761 43f4 Delete type=0 #3
|
||||
2025/01/05-13:03:25.778 43f4 Manual compaction at level-0 from '!tables!31YibfjueXuZdNLb' @ 72057594037927935 : 1 .. '!tables.results!ypcoikqHLhnc9tNs.zJkYrssfrdWBSeRm' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
Reference in New Issue
Block a user