Skip to content
Snippets Groups Projects
Commit dc0d2e5b authored by Vrelnir's avatar Vrelnir
Browse files

Merge branch 'pernpcfixv4' into 'dev'

more pernpc and other fixes

See merge request !1193
parents c9947dea 918f01d3
No related branches found
No related tags found
No related merge requests found
......@@ -81,9 +81,10 @@ Macro.add(['button', 'link'], {
//check V.nextPassage and redirect all links to it if present
if (V.nextPassage){ V.nextPassageIntended = passage; passage = V.nextPassage; delete V.nextPassage };
//save sidebar scrolling position
window.scroll_uibar = document.querySelector("#storyCaptionDiv").scrollTop;
let target = document.querySelector("#storyCaptionDiv");
window.scroll_uibar = target ? target.scrollTop : null;
//if passage hasn't changed (i.e. during combat), store scrolling position
window.scroll_main = (V.passage === V.passagePrev ? document.scrollingElement.scrollTop : 0);
window.scroll_main = document.scrollingElement.scrollTop;
//finally, play the passage
Engine.play(passage) }
: null
......
......@@ -3,7 +3,7 @@
$(document).on(":passageend", function (event) {
//simplified fix, iteration 2
if (window.scroll_uibar) document.querySelector("#storyCaptionDiv").scroll(0, window.scroll_uibar);
if (window.scroll_main) document.scrollingElement.scroll(0, window.scroll_main);
if (V.scroll_remember && V.passage === V.passagePrev) document.scrollingElement.scroll(0, window.scroll_main);
/*previous version
//get sidebar dom element, assign it to variable for convenience
let sidebar = document.querySelector("#storyCaptionDiv");
......
......@@ -2,7 +2,7 @@
<<set $passagePrev to $passage ? $passage : "none">>
<<set $passage to passage()>><<set $tags to tags()>>
<<if $passage isnot "Start" and $passage isnot "Start2">>
<<if !["Start", "Start2", "Clothes Testing", "Renderer Test Page", "Tips"].includes($passage)>>
/* Run stuff on every save load */
<<if onLoadUpdateCheck>>
......
......@@ -32,7 +32,9 @@
<</if>>
<<set $per_npc to {}>>
<<set $perNPCFix to 3>>
<<set $perNPCFix to 4>>
<<set $scroll_remember to true>>
<<set $physique to ($physiquesize / 7) * 3>>
<<set $beauty to ($beautymax / 7)>>
......
......@@ -2684,8 +2684,12 @@
<</if>>
<!-- persistent npc fix v3 -->
<<if $perNPCFix isnot 3>>
<<set $perNPCFix to 3>>
<<if $perNPCFix isnot 4>>
<<set $perNPCFix to 4>>
<!-- clean nulls and undefineds from name lists -->
<<run $NPC_names_f.delete(null, undefined)>>
<<run $NPC_names_m.delete(null, undefined)>>
<<set $_per_keys to Object.keys($per_npc)>>
<<for $_per_ctrl range $_per_keys>>
<<if !$per_npc[$_per_ctrl]>>
......@@ -2700,6 +2704,11 @@
<!-- prison npcs -->
<<for $_npc range ["anxious_guard", "methodical_guard", "relaxed_guard", "veteran_guard", "scarred_inmate"]>>
<<if $per_npc[$_npc]>>
<!-- restore null names-->
<<if !$per_npc[$_npc].name>>
<<set $per_npc[$_npc].name to ($per_npc[$_npc].pronoun is "m" ? $NPC_names_m.pluck() : $NPC_names_f.pluck())>>
<</if>>
<!-- fix descriptions -->
<<if $per_npc[$_npc].name_known>>
<<set $per_npc[$_npc].fullDescription to $per_npc[$_npc].name>>
<<else>>
......
......@@ -47,9 +47,14 @@ Passage Line Height: <<link "1.75">><<unset $reducedLineHeight>><<removeclass "#
Disable autosave on sleeping
</label>
<br>
<label>
<<checkbox "$scroll_remember" false true autocheck>>
Restore scrolling position during combat
</label>
<br>
<label>
<<checkbox "$numpad" false true autocheck>>
Enable numpad. Useful on mobile if links break due to translation software.
Enable numpad. Useful on mobile if links break due to translation software
</label>
<<if $map isnot undefined>>
......
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