Skip to content

Commit 7a3f2d0

Browse files
authored
Add-browser-back-and-forward (#628)
1 parent ac8070a commit 7a3f2d0

36 files changed

+560
-315
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,39 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## Unreleased
7+
## 2.8.8
88

99
### Added
10+
- Browser back and forward navigation!
1011
- Quick roleplay questions to the toolbox
1112
- Homebrewery export function
1213
- Hyperlinking to both Homebrewery and GMBinder exports (so you can click on links in the PDF to jump to the profile.)
14+
- Added some CSS for the details elements, indicating when there's an expandable element.
15+
- Added toast notifications for settings that only propagate on restart.
16+
- Added a toast notification that warns when two column format is not supported.
17+
1318

1419
### Changed
1520
- Changed the background from a vomit-inducing pink to a dark grey when dialogues or settings are open.
21+
- Fixed biome not showing up in town editing.
22+
- Adjusted the CSS so that the `<h1>` heading on the town page is always visible, no matter the viewport size.
23+
- Dark mode secondary colour has been changed from a brown to a gold.
24+
- Made one column the default and two columns the optional.
1625
- Fixed an error where "pastors" were not being found.
26+
- Shifted the quick scenario generator to the bottom of the page.
1727
- Banner links now open in new tabs
18-
- Toolbox is now one column
28+
- Toolbox is now one always column.
1929
- Made the sexuality descriptors more inclusive
2030
- Breadcrumb now displays the character's name, not their description
2131
- Fixed an issue with editing probability of deities that are at 0% worship.
32+
- Fixed an issue where the breadcrumb would create empty paragraphs.
33+
- Fixed an issue with widowed elements.
34+
- Fixed an issue with Patreon supporters not displaying properly on subsequent navigation.
35+
- Cookies consent is now a dialog box.
36+
- Welcome page is now a dialog box.
37+
38+
### Removed
39+
- "Sliders" popup.
2240

2341
## 2.8.7
2442

src/Factions/components/FactionSliders.twee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:: FactionSliders [force-one-column, nobr]
1+
:: FactionSliders [force-one-column nobr]
22
<<set $currentPassage to $town.factions[$currentPassage.key]>>
33
<<run $("body").on("change", [".type"], function() {
44
$(document).trigger(":liveupdate");

src/Meta/CookieConsent.twee

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1-
:: CookieConsent
2-
<div id="cookie"><<notify 500000 'cookie'>><<button "X Disallow">><<set settings.disableAnalytics to true>><<run State.metadata.set('disableAnalytics', settings.disableAnalytics)>>
3-
<<run window['ga-disable-UA-119249239-1'] = settings.disableAnalytics>><<include "RemoveCookieNotifier">><</button>><<button "X Close">>
1+
:: CookieConsent [nobr]
2+
<div id="cookie">
3+
We use cookies to anonymously track site usage, like most modern websites. This helps us understand what parts of the website are being used with what technologies, and other anonymous data.
4+
<br>
5+
If you don't want to be tracked, you can disallow now, or later turn it off in settings, install the Google Analytics Opt Out add on, or build the generator from source on our GitHub page.
6+
<br>
7+
By closing this banner or continuing to browse otherwise, you agree to the use of cookies and our Google Analytics tracking.
8+
<br>
9+
<<run State.metadata.set('cookiePopupWasShown', true)>>
10+
<<button "X Disallow">>
11+
<<set settings.disableAnalytics to true>>
12+
<<run State.metadata.set('disableAnalytics', settings.disableAnalytics)>>
13+
<<run window['ga-disable-UA-119249239-1'] = settings.disableAnalytics>>
414
<<include "RemoveCookieNotifier">>
5-
<</button>> -- We use cookies to anonymously track site usage, like most modern websites. This helps us understand what parts of the website are being used with what technologies, and other anonymous data.
15+
<</button>> --
16+
<<button "X Close">>
17+
<<include "RemoveCookieNotifier">>
18+
<</button>>
19+
</div>
620

7-
If you don't want to be tracked, you can turn it off in settings, install the Google Analytics Opt Out add on, or build the generator from source on our GitHub page.
8-
9-
By closing this banner or continuing to browse otherwise, you agree to the use of cookies and our Google Analytics tracking.<</notify>></div>
21+
:: RemoveCookieNotifier
22+
<<if Dialog.isOpen()>>
23+
<<if State.metadata.get("neverShowWelcome") is true>>
24+
<<if State.metadata.get("showBiomeGeneration") is true>>
25+
<<run Dialog.close()>>
26+
<<run Engine.play("BiomeGeneration")>>
27+
<<else>>
28+
<<run Dialog.close()>>
29+
<<run Engine.play("Start")>>
30+
<</if>>
31+
<<else>>
32+
<<run Dialog.close()>>
33+
<<run Engine.play("Start")>>
34+
<</if>>
35+
<<else>>
36+
<<run document.getElementById("notify").remove()>>
37+
<</if>>

src/Meta/PatreonSupporters.twee

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
:: PatreonSupporters [nobr]
22
<h2>Patreon Supporters</h2>
33
Special thanks to my [[Patreon|https://www.patreon.com/join/eigengrausgenerator?]] supporters!
4-
<<if setup.supporters>><table>
5-
<tbody><<set _supportersList to setup.supporters>>
6-
<<for _i to 0; _i lt 10; _i++>>
7-
<<set $patreonSupporters to lib.weightRandom(_supportersList)>>
8-
<<run delete _supportersList[$patreonSupporters]>>
9-
<<set $patreonSupporters2 to lib.weightRandom(_supportersList)>>
10-
<<run delete _supportersList[$patreonSupporters2]>>
11-
<tr>
12-
<td>- $patreonSupporters</td>
13-
<td>- $patreonSupporters2</td>
14-
</tr>
15-
<</for>>
16-
</tbody>
17-
</table><</if>>
4+
<<if setup.supporters>>
5+
<ul style="columns:2; -webkit-columns:2; -moz-columns:2;">
6+
<<for _index, _item range setup.printSupporters()>><li>_item</li><</for>>
7+
</ul><</if>>

src/Meta/Popup.twee

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
:: Popup
2-
<<nobr>><<if !_isTextOutput>>
3-
<<set _roll to random(1, 99)>>
4-
<<if _roll gt 80>>
5-
<blockquote class='interactive-only hide-on-print'>Find us on Reddit at [[/r/EigengrausGenerator|https://www.reddit.com/r/EigengrausGenerator]]!</blockquote>
6-
<<elseif _roll gt 55>>
7-
<blockquote class='interactive-only hide-on-print'><<include "PatreonSupporters">></blockquote>
8-
<<elseif _roll gt 40>>
9-
<blockquote class='interactive-only hide-on-print'><<include "EmailSignUp">></blockquote>
10-
<<elseif _roll lte 40>>
11-
<blockquote class='interactive-only hide-on-print'>If you have any bug reports, please click here: [[Submit a bug report|https://github.com/ryceg/Eigengrau-s-Essential-Establishment-Generator/issues/]]</blockquote>
2+
<<if !_isTextOutput>>
3+
<<set _roll to random(1, 5)>>
4+
<<if _roll is 5>>
5+
<blockquote class='interactive-only hide-on-print'>Did you know? Eigengrau's Generator can <<link "Export to Foundry" OutputEverything>><<set $history.length to 0>><<run setup.history({passageName: "OutputEverything", linkDescription: "Export", name: "Export"})>><</link>></blockquote>
6+
<<elseif _roll is 4>>
7+
<blockquote class='interactive-only hide-on-print'>Find us on Reddit at [[/r/EigengrausGenerator|https://www.reddit.com/r/EigengrausGenerator]]!</blockquote>
8+
<<elseif _roll is 3>>
9+
<blockquote class='interactive-only hide-on-print'><<include "PatreonSupporters">></blockquote>
10+
<<elseif _roll is 2>>
11+
<blockquote class='interactive-only hide-on-print'><<include "EmailSignUp">></blockquote>
12+
<<elseif _roll is 1>>
13+
<blockquote class='interactive-only hide-on-print'>If you have any bug reports, please click here: [[Submit a bug report|https://github.com/ryceg/Eigengrau-s-Essential-Establishment-Generator/issues/]]</blockquote>
14+
<</if>>
1215
<</if>>
13-
<</if>><</nobr>>

src/Meta/RemoveCookieNotifier.twee

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/Meta/supporters.js

Lines changed: 132 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,135 @@
11
setup.supporters = {
2-
'Kald Hade': 2,
3-
'CJLS': 1,
4-
'Vivacia': 1,
5-
'Vanille Keks': 2,
6-
'Chen Zhang': 1,
7-
'Shane Newsom': 1,
8-
'Christopher Allbritton': 5,
9-
'Matt Cherwin': 5,
10-
'Joel': 5,
11-
'Fiordhraoi': 5,
12-
'Keith Avery': 1,
13-
'Misha': 1,
14-
'Larrisunshine': 10,
15-
'AWP': 2,
16-
'Mitchell Stevenson': 2,
17-
'Scott Cook': 1,
18-
'Sandra Johnson': 5,
19-
'Alan Gibson': 5,
20-
'Aaron Lutomski': 2,
21-
'Alfred Vergara': 5,
22-
'Phillip Liljestrand': 1,
23-
'Michael': 5,
24-
'Stephen': 5,
25-
'Thodoris Econox': 5,
26-
'William Haber': 5,
27-
'Douglas C Ward': 1,
28-
'Kevin': 5,
29-
'Crimson Tc': 5,
30-
'David Hatch': 1,
31-
'Monicle': 5,
32-
'Dave campbell': 5,
33-
'The Digital DM': 1,
34-
'OniNoKen': 15,
35-
'Armand': 15,
36-
'elzzid': 1,
37-
'Chris': 1,
2+
'Daniel Auchenpaugh': 10,
3+
"Giuseppe D'Aristotile": 1,
4+
'David Lawson': 5,
5+
'Dunkin McCloud': 5,
6+
'Hilmi': 5,
7+
'JMR1991': 15,
8+
'Ben': 5,
9+
'Elling N√∏kleby': 5,
10+
'Trevor Johnson': 5,
11+
'Faer-Anne': 5,
12+
'Terence Mruz': 5,
13+
'Fiona Gröschel': 1,
14+
'Jofu': 2,
15+
'Sam': 5,
16+
'Grygon': 5,
17+
'nick brown': 5,
18+
'Atakan Altıner': 5,
19+
'Quentin Flanders': 5,
20+
'Michael Brown': 5,
21+
'Shashwat S': 1,
22+
'Adam Lister': 5,
23+
'Matthew Savoy': 10,
24+
'Wayne': 5,
25+
'Bryce Shafer': 5,
26+
'Edgar Diamond': 1,
27+
'Seren Grey': 5,
28+
'LunarRust': 5,
29+
'Zach Benes': 5,
30+
'Warren Fear': 5,
31+
'Joe Smith': 5,
32+
'Sam Barrie': 5,
33+
'Gustavo Cunha': 5,
34+
'Eric': 5,
35+
'Brad Scott': 5,
36+
'Carlos Ortiz': 5,
37+
'Viktor Boström': 1,
38+
'Jake Lasky': 1,
39+
'James Caruso': 5,
40+
'Jenn Nsk': 5,
41+
'Daniel Quaresma': 5,
42+
'GadgetBoy': 2,
43+
'Michael Saint Gregory': 5,
44+
'Brian Trepanier': 5,
45+
'Steele': 5,
46+
'Jennine Cerra': 1,
47+
'Tales of Exalted Heroes': 5,
48+
'Nathan Tobin': 1,
49+
'Austin Elizondo': 5,
50+
'Josh Hawfield': 5,
51+
'Neroth': 5,
52+
'Tyziel': 5,
53+
'Xzallion': 5,
54+
'Lars Michael Norregaard': 1,
55+
'Connor Weston': 5,
56+
'James Knevitt': 1,
57+
'Rachel Halliday': 5,
58+
'Chris Covert': 5,
59+
'Taran': 2,
60+
'Simon Fraser': 2,
61+
'Medric Riley': 5,
62+
'AK_Zephyr': 5,
63+
'Tyrian': 1,
64+
'Rhys': 1,
65+
'Jack': 5,
66+
'Mortifiedonuts': 2,
67+
'Cooper Ratliff': 5,
68+
'Rhianna Ulrich': 1,
69+
'Pere Alonso Albaladejo': 2,
70+
'Waldue': 5,
71+
'cesarvillavi': 5,
72+
'robert schaefer': 1,
73+
'WarWizardGames': 5,
74+
'Jamie Chang': 5,
3875
'Rinzler': 5,
39-
'Jamie Chang': 5
76+
'Chris': 1,
77+
'elzzid': 1,
78+
'Armand': 15,
79+
'Dave campbell': 5,
80+
'David Hatch': 1,
81+
'Crimson Tc': 5,
82+
'Kevin': 5,
83+
'Douglas C Ward': 1,
84+
'William Haber': 5,
85+
'Stephen': 5,
86+
'Phillip Liljestrand': 1,
87+
'Aaron Lutomski': 2,
88+
'Alan Gibson': 5,
89+
'Sandra Johnson': 5,
90+
'Scott Cook': 1,
91+
'Keith Avery': 1,
92+
'Matt Cherwin': 5,
93+
'Shane Newsom': 1,
94+
'Chen Zhang': 1,
95+
'Vanille Keks': 2,
96+
'Vivacia': 1,
97+
'Caitlin Brown': 2,
98+
'Morden': 2,
99+
'Doug Churchman': 2,
100+
'Braden': 5,
101+
'Adam Portman': 2,
102+
'Hayden': 5,
103+
'PHILIP A COFFEY': 5,
104+
'Catherine': 5,
105+
'John Senner': 5,
106+
'Jack Lawson': 5,
107+
'Mario Buehling': 1,
108+
'Sarah Kouklis': 5,
109+
'Jooshyboy': 1,
110+
'Runixzan': 1,
111+
'Brett Ritter': 1,
112+
'DisjointedImages': 2,
113+
'Carolyn': 1,
114+
'M Nickelson': 1,
115+
'Damien Pinto-Martin': 1,
116+
'Andrew Mullinax': 2,
117+
'Duncan Thomson': 1,
118+
'Gordon Randall': 1,
119+
'KroyVR': 2,
120+
'Lewis Kelly': 1,
121+
'Wendy Birb': 1
122+
}
123+
124+
setup.printSupporters = () => {
125+
const pool = setup.supporters
126+
const list = []
127+
for (let i = 0; i < 20; i++) {
128+
const temp = lib.weightRandom(pool)
129+
if (!list.includes(temp)) {
130+
list.push(temp)
131+
delete pool[temp]
132+
}
133+
}
134+
return list
40135
}

src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
:: GuardhouseOutput [nobr]
2-
<<include "PrintImage">>
32
<<set $currentPassage to lib.findInArray($town.buildings, "key", $currentPassage.key)>>
43
<<set $currentFaction to lib.getPolice($town.factions)>>
54
<<set $associatedNPC to $npcs[$currentPassage.associatedNPC.key]>>
65
<<set $currentPassage.availableRelationships to lib.guardhouseData.get.customers>>
6+
<<include "PrintImage">>
77
<h1 class="interactive-only">$currentPassage.name</h1><span @id="$building.key"></span><p>You make your way down <<print lib.createTippyFull($town.roads[$currentPassage.road].description, $town.roads[$currentPassage.road].name)>>, and enter $currentPassage.name $currentPassage.structure.descriptor. $currentPassage.name is known for $currentPassage.notableFeature</p>
88
<p>It is run by <<profile $town.factions[$currentFaction.key]>>, who are $currentPassage.expertise.
99
At the moment, <<print lib.weightedRandomFetcher($town, lib.guardhouseData.get.event($town, $currentPassage), $currentPassage, undefined)>></p>

src/NPCGeneration/NPCProfile/components-edit/NPCProfileEdit.twee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:: NPCProfileEdit [force-one-column nobr]
1+
:: NPCProfileEdit [force-one-column nobr nofx]
22
<<liveblock>><span class="auto-update"><h1><<include "NPCSaveEdits">><<if def $npcs[$currentPassage.key].title>><<print $npcs[$currentPassage.key].title>> <</if>><label name="name"><<textbox "$npcs[$currentPassage.key].name" $npcs[$currentPassage.key].name>></label></h1></span>
33
<<set $currentPassage.deleteEnabled to true>>
44
<<include "NPCEditListbox">>

src/Settings/Breadcrumb.twee

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11
:: Breadcrumb
2-
<<liveblock>><<nobr>>
3-
<<set $town.ignoreGender to settings.ignoreGender>>
4-
<nav><<link "The $town.type of $town.name">>
5-
<<if $town.generated === 'biome'>><<set $town to setup.createTown($town)>><</if>>
6-
<<unset $currentPassage>>
7-
<<unset $currentNPC>>
8-
<<set $history to []>>
9-
<<goto "Start">>
10-
<</link>></nav>
11-
<<for _i, _passage range $history>><<set _link to lib.toTitleCase(_passage.linkDescription)>>
12-
<<capture _i, _passage, _link>>
13-
<<if _i < $history.length - 1>>
14-
<nav class="breadcrumb-link">
15-
<<link _link _passage.passageName>>
16-
<<set $currentPassage to _passage.data>>
17-
<<run $history.length = _i>>
18-
<<run setup.history(_passage.data, _passage.passageName, _passage.linkDescription)>>
19-
<</link>>
20-
</nav>
21-
<</if>>
22-
<</capture>>
23-
<</for>>
24-
<<if def $history.last()>>
25-
<nav class="breadcrumb-link last">
26-
<<print lib.toTitleCase($history.last().linkDescription)>>
27-
</nav>
28-
<</if>>
29-
<</nobr>><</liveblock>>
2+
<<nosp>><<liveblock>>
3+
<<set $town.ignoreGender to settings.ignoreGender>>
4+
<nav>
5+
<<link "The $town.type of $town.name">><<if $town.generated === 'biome'>><<set $town to setup.createTown($town)>><</if>><<unset $currentPassage>><<unset $currentNPC>><<set $history to []>><<goto "Start">><</link>>
6+
</nav>
7+
<<for _i, _passage range $history>><<set _link to lib.toTitleCase(_passage.linkDescription)>><<capture _i, _passage, _link>><<if _i < $history.length - 1>><nav class="breadcrumb-link"><<link _link _passage.passageName>><<set $currentPassage to _passage.data>><<run $history.length = _i>><<run setup.history(_passage.data, _passage.passageName, _passage.linkDescription)>><</link>></nav><</if>><</capture>><</for>><<if def $history.last()>><nav class="breadcrumb-link last"><<print lib.toTitleCase($history.last().linkDescription)>></nav><</if>>
8+
<</liveblock>><</nosp>>

0 commit comments

Comments
 (0)