This file contains hidden or 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
| (async () => { | |
| // UI Styling | |
| const parchment = `background: #fdf6e3; color: #1a1c1d; padding: 15px; font-family: 'Segoe UI', sans-serif; border: 2px solid #333; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); box-sizing: border-box; display: flex; flex-direction: column; overflow-y: auto;`; | |
| const h2Style = `color: #856704; margin: 0; text-transform: uppercase; font-weight: 900; letter-spacing: 2px;`; | |
| const labelStyle = `font-weight: 900; text-transform: uppercase; font-size: 0.7rem; color: #444; margin-bottom: 2px; display: block;`; | |
| const fieldStyle = `height: 28px; line-height: 26px; box-sizing: border-box; background: #fff; border: 1px solid #333; color: #000; padding: 0 8px; width: 100%; font-family: monospace; font-size: 0.85rem; vertical-align: middle;`; | |
| // TE Styles (pulled from torgeternity.css (may break in the future ... )) | |
| const torgStyles = { | |
| h1: "font-family: Alaska; background-image: url('../../../systems/torgeternity/images/tab-header.webp'); background-repeat: no- |
This file contains hidden or 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
| const T_REGIONS = [ | |
| { | |
| "name": "Very Vulnerable Zone", | |
| "color": "#ff2600", | |
| "shapes": [], | |
| "elevation": { | |
| "bottom": null, | |
| "top": null | |
| }, | |
| "behaviors": [ |
This file contains hidden or 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
| Array.prototype.unique = function(property) { | |
| if(!property){ | |
| return this.filter(function(element, index){ | |
| return this.indexOf(element) === index; | |
| }, this); | |
| } | |
| return this; | |
| }; | |
| Array.prototype.flatten = function() { |
This file contains hidden or 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
| /* Detecting collision between 2 rectangle */ | |
| /* Credit to Bill : http://stackoverflow.com/users/1029936/bill */ | |
| rect_collision = function (x1, y1, size1, x2, y2, size2) { | |
| var a = {top: y1, bottom: y1+size1, left: x1, right: x1+size1}; | |
| var b = {top: y2, bottom: y2+size2, left: x2, right: x2+size2}; | |
| // this is the general way to figure out if two rects are overlapping | |
| return !(a.left >= b.right || a.right <= b.left || | |
| a.top >= b.bottom || a.bottom <= b.top); |