Skip to content
Snippets Groups Projects
Commit fa1a29b8 authored by Jimmy's avatar Jimmy Committed by Vrelnir
Browse files

Removal of `?.` from scripts

parent ff2031b4
No related branches found
No related tags found
No related merge requests found
......@@ -48,23 +48,23 @@ class EventData {
}
get(index) {
return V.event?.buffer.find(e => e.slot === index);
return V.event ? V.event.buffer.find(e => e.slot === index) : -1;
}
has(index) {
return V.event?.buffer.some(e => e.slot === index);
return V.event ? V.event.buffer.some(e => e.slot === index) : false;
}
getEvery(index) {
return V.event?.buffer.filter(e => e.slot === index) ?? [];
return V.event ? V.event.buffer.filter(e => e.slot === index) : [];
}
count() {
return V.event?.buffer.length || 0;
return V.event ? V.event.buffer.length : 0;
}
any() {
return V.event?.buffer.length > 0;
return V.event ? V.event.buffer.length > 0 : false;
}
clear() {
......@@ -73,7 +73,7 @@ class EventData {
}
isSlotTaken(index) {
return V.event?.buffer.some(e => e.slot === index);
return V.event ? V.event.buffer.some(e => e.slot === index) : false;
}
get Disable() {
......@@ -124,11 +124,7 @@ class EventData {
continue;
} else if (V.debugdisable === "f" || V.debug) {
// NPC position is being used more than once, although not a gap, flag.
console.warn(
"NPC slot",
element.slot,
"is being used more than once. Existing NPCs should be disposed before using their slot."
);
console.warn("NPC slot", element.slot, "is being used more than once. Existing NPCs should be disposed before using their slot.");
return false;
}
}
......
:: mobileStats [widget]
<<widget "mobileStats">>
<<if $options.sidebarStats is "all" or $pain gt 50>>
<<if Number.isFinite($pain) and ($options.sidebarStats is "all" or $pain gt 50)>>
<<mobileStatsColor "pain">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">P<span>Pain: <<print $pain?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">P<span>Pain: <<print $pain.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $options.sidebarStats is "all" or $arousal gt $arousalmax / 2>>
<<if Number.isFinite($arousal) and ($options.sidebarStats is "all" or $arousal gt $arousalmax / 2)>>
<<mobileStatsColor "arousal">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">Ar<span>Arousal: <<print $arousal?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">Ar<span>Arousal: <<print $arousal.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $options.sidebarStats is "all" or $tiredness gt C.tiredness.max / 2>>
<<if Number.isFinite($tiredness) and ($options.sidebarStats is "all" or $tiredness gt C.tiredness.max / 2)>>
<<mobileStatsColor "fatigue">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">F<span>Fatigue: <<print $tiredness?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">F<span>Fatigue: <<print $tiredness.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $options.sidebarStats is "all" or $stress gt $stressmax / 2>>
<<if Number.isFinite($stress) and ($options.sidebarStats is "all" or $stress gt $stressmax / 2)>>
<<mobileStatsColor "stress">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">S<span>Stress: <<print $stress?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">S<span>Stress: <<print $stress.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $innocencestate is 1 and ($options.sidebarStats is "all" or $awareness gt -100)>>
<<if Number.isFinite($innocencestate) or $innocencestate is 1 and ($options.sidebarStats is "all" or $awareness gt -100)>>
<<mobileStatsColor "innocence">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">I<span>Innocence: <<print $innocencestate?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">I<span>Innocence: <<print $innocencestate.toFixed(2)>></span></mouse>
</div>
<<elseif $options.sidebarStats is "all" or $trauma gt $traumamax / 2>>
<<elseif Number.isFinite(trauma) and ($options.sidebarStats is "all" or $trauma gt $traumamax / 2)>>
<<mobileStatsColor "trauma">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">T<span>Trauma: <<print $trauma?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">T<span>Trauma: <<print $trauma.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $options.sidebarStats is "all" or $control gt $controlmax / 2>>
<<if Number.isFinite($control) and ($options.sidebarStats is "all" or $control gt $controlmax / 2)>>
<<mobileStatsColor "control">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">C<span>Control: <<print $control?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">C<span>Control: <<print $control.toFixed(2)>></span></mouse>
</div>
<</if>>
<<mobileStatsColor "allure">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">AL<span>Allure: <<print $allure?.toFixed(2)>></span></mouse>
</div>
<<if $drunk gt 0>>
<<if Number.isFinite($allure)>>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">AL<span>Allure: <<print $allure.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if Number.isFinite($drunk) and $drunk gt 0>>
<<mobileStatsColor "drunk">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">DK<span>Drunk: <<print $drunk?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">DK<span>Drunk: <<print $drunk.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $drugged gt 0>>
<<if Number.isFinite($drugged) and $drugged gt 0>>
<<mobileStatsColor "drugged">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">DG<span>Drugged: <<print $drugged?.toFixed(2)>></span></mouse>
<mouse class="tooltip-centertop">DG<span>Drugged: <<print $drugged.toFixed(2)>></span></mouse>
</div>
<</if>>
<<if $hallucinogen gt 0>>
<<if Number.isFinite($hallucinogen) and $hallucinogen gt 0>>
<<mobileStatsColor "hallucinogen">>
<div @class="'stat ' + _mobileColor">
<mouse class="tooltip-centertop">H<span>Hallucinogen: $hallucinogen?.toFixed(2)</span></mouse>
<mouse class="tooltip-centertop">H<span>Hallucinogen: $hallucinogen.toFixed(2)</span></mouse>
</div>
<</if>>
<</widget>>
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment