From a684e456c54f6430b694c8120a976ee6b4a0ce25 Mon Sep 17 00:00:00 2001 From: U~man Date: Fri, 10 Jul 2020 02:07:37 +0200 Subject: [PATCH] FIX: individual init restored --- package/ose-v0.6.zip | Bin 83867 -> 83913 bytes src/module/settings.js | 1 + src/ose.js | 22 +++++++++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/package/ose-v0.6.zip b/package/ose-v0.6.zip index aee75f2ff9b3f2d2d3a777a605f536ce5dea4486..521125cef5786bac4748275098096bff27959512 100644 GIT binary patch delta 4194 zcmZuz2|QG58=rT^G=ssA8T%HpQ?_iwSW8meL{#EhN>?+w$Woenb*WIPbM>OoLeZ{6 z5+#)uH_sqC%`o1&2-^_WR=l}elb)Iwf@21|~O_lQTqKHY5hzlq6 z?FpVuA%3>0?-4T<-dSmi%aiEnbDY$NaimlPl>tw9z1GYWnQTFBX@ko~wX!#^zB)1G zX=8E}Pl{#K>eP_>1r<#@b&l)goZkPjE+M^`cb=tl<&n%Dx8{^)Rr3vuk=j2Suaqo0 zk@fZ(rTcQxvxOto-Jd^Z#8On2>*u*L8>(4ZR9?H&&3v)LckOK68cpm|EIT7Q?FKanhXDRAc zN$oqyyV=|*Q*2?*$^qY%)jKag zRm`2yU)U}#(>A*OrLpf%e94-JoRa+8Ukme6ZVT>T46t$7elzB4hDKJ{35rJevf_18 zg3kY3sbzYcUG(*@tZZuk*V^V2+g31 zu7mo0idWh=#s9an&Pv0#Lba9!M`RU-_^W0V>IA=qu!4kJ-^AriE_MDw2DZQy&JKfSR zFLeJ((uu!`?G5yJTvyC1O4fI~^sunoCOxo3%KCCaz>t3NxXJbOBmVDX>Zm&`o@G$2 zMr%4g7F+f?YS=&7qjD?oM#a(oueXZgpX-mVnj6$PQ?N@{HzXo&$MtSwEj6C@xufxZ zEbp~CYBP5DJr-N56chJIwoC3t#*zLlqXiENG%G?h_*>Hxw%T{SIKUZ7*j#`7&Vf{4 zR)R@ViPznGHPRgWx;tvD4Hwj#+8?m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G%~IQ*z>tW* zpV_$io07pwGoS*bV6Pdl0#;CF9bh2MMX1#8@^IfeunJjQiXJW1SW>B>q!HE^X~Hv> z|GaqK@rx`&ZO)Ca)DvuLmkf0)~PLC5fd?(?M7&F|-p?fSmO}l;_R^ zM=^B6ten)h8B61WhNx7)S^(siB$gXH!WxycsvE+S+NMMzsV_;)1&=TXt8o>CuI700 z58sC2=75eXA+)x@$Cn$Sw*}BcimKoQVYh385*EM+c31#4r1v45zz4W4!U#*eKl)&@ zCD4U&gsou+Rqs{*e`!it;c4dlgRfWtH6Ig&E>=JkUbn;p26-TSWeJp_s}+9IzZ)jJ zV6qiZgi{2dF^ZQ%4lRBy0~yvp=s#hFB?RlSG1w&pG~g>MAP&_C%IYy_Z3$>lc>_Ku z9p}{svhV@?%LWL*Rt8W;`rq*34-7zsVT7akG!H>tJ}!qhHsHJ6Fhc+aP|_ABj<5x4 zWP@1}OtU4J@evaGp0MjcA6u{tuC&9EhjV;VA3HoBmNh=jo<(BUP^k$?n1U-dKLL&% zZYli8_q`$xmPvlydkrYevIbPLDFPs109iun*OKi7cq1h=U|Je_Fo87u+Xfd_wjd9t z@ri8-XjX{t2@l!;Q}Q;EPow)bKmpPj_$uyDc#tC8%K%1XQBmGV7M2o~Xtc#s%M*jo zY{5o8r;$C5bV?G4KCD^>mcx?{_(Ia{@%0wU5%4Pb)E?*N)pj=%_r9ROhlwW*tYqTV znIXLOsb63%{GkKs4*0=pQzbwR814X=NW0dTfe3u+@R_uoARW`;M{_ms2IZwNGUA= diff --git a/src/module/settings.js b/src/module/settings.js index 7fbc0cf..7c765d0 100644 --- a/src/module/settings.js +++ b/src/module/settings.js @@ -6,6 +6,7 @@ export const registerSettings = function () { scope: "world", type: Boolean, config: true, + onChange: _ => window.location.reload() }); game.settings.register("ose", "ascendingAC", { diff --git a/src/ose.js b/src/ose.js index 4115135..347cf8f 100644 --- a/src/ose.js +++ b/src/ose.js @@ -81,14 +81,22 @@ Hooks.once("ready", async () => { }); Hooks.on("preCreateCombatant", (combat, data, options, id) => { - OseCombat.addCombatant(combat, data, options, id); + let init = game.settings.get("ose", "individualInit"); + if (!init) { + OseCombat.addCombatant(combat, data, options, id); + } }); Hooks.on("preUpdateCombatant", (combat, combatant, data, diff, id) => { - if (data.initiative) { + let init = game.settings.get("ose", "individualInit"); + if (data.initiative && !init) { let groupInit = data.initiative; combat.combatants.forEach((ct) => { - if (ct.initiative && ct._id != data._id && ct.flags.ose.group == combatant.flags.ose.group) { + if ( + ct.initiative && + ct._id != data._id && + ct.flags.ose.group == combatant.flags.ose.group + ) { groupInit = ct.initiative; data.initiative = parseInt(groupInit); } @@ -97,11 +105,15 @@ Hooks.on("preUpdateCombatant", (combat, combatant, data, diff, id) => { }); Hooks.on("renderCombatTracker", (object, html, data) => { - OseCombat.format(object, html, data); + let init = game.settings.get("ose", "individualInit"); + if (!init) { + OseCombat.format(object, html, data); + } }); Hooks.on("preUpdateCombat", async (combat, data, diff, id) => { - if (!data.round) { + let init = game.settings.get("ose", "individualInit"); + if (!data.round || init) { return; } OseCombat.rollInitiative(combat, data, diff, id);