-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f646d45
commit bf0acfc
Showing
4 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Version check function from Forien Unedintified item module | ||
*/ | ||
export default class VersionCheck { | ||
static _r = false; | ||
|
||
static _reg(mN) { | ||
if (this._r) return; | ||
|
||
game.settings.register(mN, 'version', { | ||
name: `${mN} Version`, | ||
default: "0.0.0", | ||
type: String, | ||
scope: 'client', | ||
}); | ||
|
||
this._r = true; | ||
} | ||
|
||
static check(mN) { | ||
if (!this._r) this._reg(mN); | ||
|
||
let mV = this.get(mN); | ||
let oV = game.settings.get(mN, "version"); | ||
|
||
return isNewerVersion(mV, oV); | ||
}; | ||
|
||
static set(mN, v) { | ||
if (!this._r) this._reg(mN); | ||
|
||
game.settings.set(mN, "version", v); | ||
} | ||
|
||
static get(mN) { | ||
return game.modules.get(mN).data.version; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { BRTCONFIG } from '../core/config.js'; | ||
import VersionCheck from "./version-check.mjs"; | ||
|
||
/** | ||
* Based on https://github.com/Moerill/mess | ||
* modified by Forien | ||
*/ | ||
class WelcomeScreen extends Application { | ||
static get defaultOptions() { | ||
let title = game.modules.get(BRTCONFIG.NAMESPACE).data.title; | ||
return mergeObject(super.defaultOptions, { | ||
template: `modules/${BRTCONFIG.NAMESPACE}/templates/welcome-screen.html`, | ||
resizable: true, | ||
width: 450, | ||
height: 636, | ||
classes: ["welcome-screen"], | ||
title: `${title} - Welcome Screen` | ||
}); | ||
} | ||
|
||
getData(options = {}) { | ||
options = super.getData(options);; | ||
options.isChecked = !VersionCheck.check(BRTCONFIG.NAMESPACE); | ||
return options; | ||
} | ||
|
||
activateListeners(html) { | ||
super.activateListeners(html); | ||
|
||
html.find('.show-again').on('change', event => { | ||
let version = "0.0.0"; | ||
if (event.currentTarget.checked) | ||
version = VersionCheck.get(BRTCONFIG.NAMESPACE); | ||
VersionCheck.set(BRTCONFIG.NAMESPACE, version) | ||
}) | ||
} | ||
} | ||
|
||
export default function renderWelcomeScreen() { | ||
(new WelcomeScreen()).render(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- | ||
/** | ||
* Based on https://github.com/Moerill/mess | ||
*/ | ||
--> | ||
<style> | ||
.welcome-screen a[href] { | ||
color: #4a52ca; | ||
} | ||
.welcome-screen .window-content > * { | ||
flex: 0; | ||
} | ||
</style> | ||
|
||
<h1>Welcome to Better RollTables!</h1> | ||
<p>Check the <a href="https://github.com/ultrakorne/better-rolltables/blob/master/README.md">README</a> or <a href="https://github.com/ultrakorne/better-rolltables/wiki">wiki</a> for more info on the module features</p> | ||
<h3><a href="https://www.youtube.com/watch?v=TRg4y0joOKA&feature=youtu.be"> Youtube Better Tables Overview! </a></h3> | ||
<h2>Bugs or Suggestions?</h2> | ||
<p>Add an <a href="https://github.com/ultrakorne/better-rolltables/issues">issue on Github</a> or drop me a line on Discord!</p> | ||
|
||
<p style="font-weight: bold; text-align: right;">Ultrakorne#6240</p> | ||
|
||
<p style="display: flex; flex-flow: row nowrap; align-items: center; justify-content: flex-start;"><input type="checkbox" class='show-again' id="welcome-screen-show-again" {{checked isChecked}}/> <label for="welcome-screen-show-again">Don't show this screen again until next update.</label></p> | ||
<p style="text-align: right"><strong>My Tip Jar: <a href="paypal.me/ultrakorne">Paypal</a></strong></p> | ||
|
||
<h1>Patchnotes</h1> | ||
<h2 id="v140">v1.4.0</h2> | ||
<ul> | ||
<li>New Welcome screen with patchnotes!</li> | ||
<li>New Tables with a lot of Human names, Orc names and surnames (check inside the Story Tables). They will be used in NPC Generators in future releases</li> | ||
<li>Localized in Portoguese (thanks to rinnocenti)</li> | ||
<li>Korean Localization updated (thanks KLO)</li> | ||
</ul> | ||
<h2 id="v130">v1.3.0</h2> | ||
<ul> | ||
<li>new API to generate Tables from compendia! (check how in the <a href="https://github.com/ultrakorne/better-rolltables/wiki/API-for-macros-and-modules#how-to-generate-tables-from-compendia"> wiki</a>)</li> | ||
</ul> |