Skip to content

Commit

Permalink
Add-browser-back-and-forward (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryceg authored May 20, 2021
1 parent ac8070a commit 7a3f2d0
Show file tree
Hide file tree
Showing 36 changed files with 560 additions and 315 deletions.
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,39 @@ All notable changes to this project will be documented in this file.

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

## Unreleased
## 2.8.8

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


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

### Removed
- "Sliders" popup.

## 2.8.7

Expand Down
2 changes: 1 addition & 1 deletion src/Factions/components/FactionSliders.twee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:: FactionSliders [force-one-column, nobr]
:: FactionSliders [force-one-column nobr]
<<set $currentPassage to $town.factions[$currentPassage.key]>>
<<run $("body").on("change", [".type"], function() {
$(document).trigger(":liveupdate");
Expand Down
42 changes: 35 additions & 7 deletions src/Meta/CookieConsent.twee
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
:: CookieConsent
<div id="cookie"><<notify 500000 'cookie'>><<button "X Disallow">><<set settings.disableAnalytics to true>><<run State.metadata.set('disableAnalytics', settings.disableAnalytics)>>
<<run window['ga-disable-UA-119249239-1'] = settings.disableAnalytics>><<include "RemoveCookieNotifier">><</button>><<button "X Close">>
:: CookieConsent [nobr]
<div id="cookie">
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.
<br>
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.
<br>
By closing this banner or continuing to browse otherwise, you agree to the use of cookies and our Google Analytics tracking.
<br>
<<run State.metadata.set('cookiePopupWasShown', true)>>
<<button "X Disallow">>
<<set settings.disableAnalytics to true>>
<<run State.metadata.set('disableAnalytics', settings.disableAnalytics)>>
<<run window['ga-disable-UA-119249239-1'] = settings.disableAnalytics>>
<<include "RemoveCookieNotifier">>
<</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.
<</button>> --
<<button "X Close">>
<<include "RemoveCookieNotifier">>
<</button>>
</div>

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.

By closing this banner or continuing to browse otherwise, you agree to the use of cookies and our Google Analytics tracking.<</notify>></div>
:: RemoveCookieNotifier
<<if Dialog.isOpen()>>
<<if State.metadata.get("neverShowWelcome") is true>>
<<if State.metadata.get("showBiomeGeneration") is true>>
<<run Dialog.close()>>
<<run Engine.play("BiomeGeneration")>>
<<else>>
<<run Dialog.close()>>
<<run Engine.play("Start")>>
<</if>>
<<else>>
<<run Dialog.close()>>
<<run Engine.play("Start")>>
<</if>>
<<else>>
<<run document.getElementById("notify").remove()>>
<</if>>
18 changes: 4 additions & 14 deletions src/Meta/PatreonSupporters.twee
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
:: PatreonSupporters [nobr]
<h2>Patreon Supporters</h2>
Special thanks to my [[Patreon|https://www.patreon.com/join/eigengrausgenerator?]] supporters!
<<if setup.supporters>><table>
<tbody><<set _supportersList to setup.supporters>>
<<for _i to 0; _i lt 10; _i++>>
<<set $patreonSupporters to lib.weightRandom(_supportersList)>>
<<run delete _supportersList[$patreonSupporters]>>
<<set $patreonSupporters2 to lib.weightRandom(_supportersList)>>
<<run delete _supportersList[$patreonSupporters2]>>
<tr>
<td>- $patreonSupporters</td>
<td>- $patreonSupporters2</td>
</tr>
<</for>>
</tbody>
</table><</if>>
<<if setup.supporters>>
<ul style="columns:2; -webkit-columns:2; -moz-columns:2;">
<<for _index, _item range setup.printSupporters()>><li>_item</li><</for>>
</ul><</if>>
24 changes: 13 additions & 11 deletions src/Meta/Popup.twee
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
:: Popup
<<nobr>><<if !_isTextOutput>>
<<set _roll to random(1, 99)>>
<<if _roll gt 80>>
<blockquote class='interactive-only hide-on-print'>Find us on Reddit at [[/r/EigengrausGenerator|https://www.reddit.com/r/EigengrausGenerator]]!</blockquote>
<<elseif _roll gt 55>>
<blockquote class='interactive-only hide-on-print'><<include "PatreonSupporters">></blockquote>
<<elseif _roll gt 40>>
<blockquote class='interactive-only hide-on-print'><<include "EmailSignUp">></blockquote>
<<elseif _roll lte 40>>
<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>
<<if !_isTextOutput>>
<<set _roll to random(1, 5)>>
<<if _roll is 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>
<<elseif _roll is 4>>
<blockquote class='interactive-only hide-on-print'>Find us on Reddit at [[/r/EigengrausGenerator|https://www.reddit.com/r/EigengrausGenerator]]!</blockquote>
<<elseif _roll is 3>>
<blockquote class='interactive-only hide-on-print'><<include "PatreonSupporters">></blockquote>
<<elseif _roll is 2>>
<blockquote class='interactive-only hide-on-print'><<include "EmailSignUp">></blockquote>
<<elseif _roll is 1>>
<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>
<</if>>
<</if>>
<</if>><</nobr>>
3 changes: 0 additions & 3 deletions src/Meta/RemoveCookieNotifier.twee

This file was deleted.

169 changes: 132 additions & 37 deletions src/Meta/supporters.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,135 @@
setup.supporters = {
'Kald Hade': 2,
'CJLS': 1,
'Vivacia': 1,
'Vanille Keks': 2,
'Chen Zhang': 1,
'Shane Newsom': 1,
'Christopher Allbritton': 5,
'Matt Cherwin': 5,
'Joel': 5,
'Fiordhraoi': 5,
'Keith Avery': 1,
'Misha': 1,
'Larrisunshine': 10,
'AWP': 2,
'Mitchell Stevenson': 2,
'Scott Cook': 1,
'Sandra Johnson': 5,
'Alan Gibson': 5,
'Aaron Lutomski': 2,
'Alfred Vergara': 5,
'Phillip Liljestrand': 1,
'Michael': 5,
'Stephen': 5,
'Thodoris Econox': 5,
'William Haber': 5,
'Douglas C Ward': 1,
'Kevin': 5,
'Crimson Tc': 5,
'David Hatch': 1,
'Monicle': 5,
'Dave campbell': 5,
'The Digital DM': 1,
'OniNoKen': 15,
'Armand': 15,
'elzzid': 1,
'Chris': 1,
'Daniel Auchenpaugh': 10,
"Giuseppe D'Aristotile": 1,
'David Lawson': 5,
'Dunkin McCloud': 5,
'Hilmi': 5,
'JMR1991': 15,
'Ben': 5,
'Elling N√∏kleby': 5,
'Trevor Johnson': 5,
'Faer-Anne': 5,
'Terence Mruz': 5,
'Fiona Gröschel': 1,
'Jofu': 2,
'Sam': 5,
'Grygon': 5,
'nick brown': 5,
'Atakan Altıner': 5,
'Quentin Flanders': 5,
'Michael Brown': 5,
'Shashwat S': 1,
'Adam Lister': 5,
'Matthew Savoy': 10,
'Wayne': 5,
'Bryce Shafer': 5,
'Edgar Diamond': 1,
'Seren Grey': 5,
'LunarRust': 5,
'Zach Benes': 5,
'Warren Fear': 5,
'Joe Smith': 5,
'Sam Barrie': 5,
'Gustavo Cunha': 5,
'Eric': 5,
'Brad Scott': 5,
'Carlos Ortiz': 5,
'Viktor Boström': 1,
'Jake Lasky': 1,
'James Caruso': 5,
'Jenn Nsk': 5,
'Daniel Quaresma': 5,
'GadgetBoy': 2,
'Michael Saint Gregory': 5,
'Brian Trepanier': 5,
'Steele': 5,
'Jennine Cerra': 1,
'Tales of Exalted Heroes': 5,
'Nathan Tobin': 1,
'Austin Elizondo': 5,
'Josh Hawfield': 5,
'Neroth': 5,
'Tyziel': 5,
'Xzallion': 5,
'Lars Michael Norregaard': 1,
'Connor Weston': 5,
'James Knevitt': 1,
'Rachel Halliday': 5,
'Chris Covert': 5,
'Taran': 2,
'Simon Fraser': 2,
'Medric Riley': 5,
'AK_Zephyr': 5,
'Tyrian': 1,
'Rhys': 1,
'Jack': 5,
'Mortifiedonuts': 2,
'Cooper Ratliff': 5,
'Rhianna Ulrich': 1,
'Pere Alonso Albaladejo': 2,
'Waldue': 5,
'cesarvillavi': 5,
'robert schaefer': 1,
'WarWizardGames': 5,
'Jamie Chang': 5,
'Rinzler': 5,
'Jamie Chang': 5
'Chris': 1,
'elzzid': 1,
'Armand': 15,
'Dave campbell': 5,
'David Hatch': 1,
'Crimson Tc': 5,
'Kevin': 5,
'Douglas C Ward': 1,
'William Haber': 5,
'Stephen': 5,
'Phillip Liljestrand': 1,
'Aaron Lutomski': 2,
'Alan Gibson': 5,
'Sandra Johnson': 5,
'Scott Cook': 1,
'Keith Avery': 1,
'Matt Cherwin': 5,
'Shane Newsom': 1,
'Chen Zhang': 1,
'Vanille Keks': 2,
'Vivacia': 1,
'Caitlin Brown': 2,
'Morden': 2,
'Doug Churchman': 2,
'Braden': 5,
'Adam Portman': 2,
'Hayden': 5,
'PHILIP A COFFEY': 5,
'Catherine': 5,
'John Senner': 5,
'Jack Lawson': 5,
'Mario Buehling': 1,
'Sarah Kouklis': 5,
'Jooshyboy': 1,
'Runixzan': 1,
'Brett Ritter': 1,
'DisjointedImages': 2,
'Carolyn': 1,
'M Nickelson': 1,
'Damien Pinto-Martin': 1,
'Andrew Mullinax': 2,
'Duncan Thomson': 1,
'Gordon Randall': 1,
'KroyVR': 2,
'Lewis Kelly': 1,
'Wendy Birb': 1
}

setup.printSupporters = () => {
const pool = setup.supporters
const list = []
for (let i = 0; i < 20; i++) {
const temp = lib.weightRandom(pool)
if (!list.includes(temp)) {
list.push(temp)
delete pool[temp]
}
}
return list
}
2 changes: 1 addition & 1 deletion src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:: GuardhouseOutput [nobr]
<<include "PrintImage">>
<<set $currentPassage to lib.findInArray($town.buildings, "key", $currentPassage.key)>>
<<set $currentFaction to lib.getPolice($town.factions)>>
<<set $associatedNPC to $npcs[$currentPassage.associatedNPC.key]>>
<<set $currentPassage.availableRelationships to lib.guardhouseData.get.customers>>
<<include "PrintImage">>
<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>
<p>It is run by <<profile $town.factions[$currentFaction.key]>>, who are $currentPassage.expertise.
At the moment, <<print lib.weightedRandomFetcher($town, lib.guardhouseData.get.event($town, $currentPassage), $currentPassage, undefined)>></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:: NPCProfileEdit [force-one-column nobr]
:: NPCProfileEdit [force-one-column nobr nofx]
<<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>
<<set $currentPassage.deleteEnabled to true>>
<<include "NPCEditListbox">>
Expand Down
35 changes: 7 additions & 28 deletions src/Settings/Breadcrumb.twee
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
:: Breadcrumb
<<liveblock>><<nobr>>
<<set $town.ignoreGender to settings.ignoreGender>>
<nav><<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>></nav>
<<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>>
<</nobr>><</liveblock>>
<<nosp>><<liveblock>>
<<set $town.ignoreGender to settings.ignoreGender>>
<nav>
<<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>>
</nav>
<<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>>
<</liveblock>><</nosp>>
Loading

0 comments on commit 7a3f2d0

Please sign in to comment.