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 { ...@@ -48,23 +48,23 @@ class EventData {
} }
get(index) { 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) { 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) { getEvery(index) {
return V.event?.buffer.filter(e => e.slot === index) ?? []; return V.event ? V.event.buffer.filter(e => e.slot === index) : [];
} }
count() { count() {
return V.event?.buffer.length || 0; return V.event ? V.event.buffer.length : 0;
} }
any() { any() {
return V.event?.buffer.length > 0; return V.event ? V.event.buffer.length > 0 : false;
} }
clear() { clear() {
...@@ -73,7 +73,7 @@ class EventData { ...@@ -73,7 +73,7 @@ class EventData {
} }
isSlotTaken(index) { 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() { get Disable() {
...@@ -124,11 +124,7 @@ class EventData { ...@@ -124,11 +124,7 @@ class EventData {
continue; continue;
} else if (V.debugdisable === "f" || V.debug) { } else if (V.debugdisable === "f" || V.debug) {
// NPC position is being used more than once, although not a gap, flag. // NPC position is being used more than once, although not a gap, flag.
console.warn( console.warn("NPC slot", element.slot, "is being used more than once. Existing NPCs should be disposed before using their slot.");
"NPC slot",
element.slot,
"is being used more than once. Existing NPCs should be disposed before using their slot."
);
return false; return false;
} }
} }
......
:: mobileStats [widget] :: mobileStats [widget]
<<widget "mobileStats">> <<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">> <<mobileStatsColor "pain">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</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">> <<mobileStatsColor "arousal">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</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">> <<mobileStatsColor "fatigue">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</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">> <<mobileStatsColor "stress">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</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">> <<mobileStatsColor "innocence">>
<div @class="'stat ' + _mobileColor"> <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> </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">> <<mobileStatsColor "trauma">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</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">> <<mobileStatsColor "control">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</if>>
<<mobileStatsColor "allure">> <<mobileStatsColor "allure">>
<div @class="'stat ' + _mobileColor"> <<if Number.isFinite($allure)>>
<mouse class="tooltip-centertop">AL<span>Allure: <<print $allure?.toFixed(2)>></span></mouse> <div @class="'stat ' + _mobileColor">
</div> <mouse class="tooltip-centertop">AL<span>Allure: <<print $allure.toFixed(2)>></span></mouse>
<<if $drunk gt 0>> </div>
<</if>>
<<if Number.isFinite($drunk) and $drunk gt 0>>
<<mobileStatsColor "drunk">> <<mobileStatsColor "drunk">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</if>>
<<if $drugged gt 0>> <<if Number.isFinite($drugged) and $drugged gt 0>>
<<mobileStatsColor "drugged">> <<mobileStatsColor "drugged">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</if>>
<<if $hallucinogen gt 0>> <<if Number.isFinite($hallucinogen) and $hallucinogen gt 0>>
<<mobileStatsColor "hallucinogen">> <<mobileStatsColor "hallucinogen">>
<div @class="'stat ' + _mobileColor"> <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> </div>
<</if>> <</if>>
<</widget>> <</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