zischenstand
This commit is contained in:
75
src/modules/simplefog/lang/en.json
Normal file
75
src/modules/simplefog/lang/en.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"SIMPLEFOG": {
|
||||
"brushOpacity": "Brush Opacity",
|
||||
"brushSize": "Brush Size",
|
||||
"hide": "Hide",
|
||||
"reveal": "Reveal",
|
||||
|
||||
"gmFogSettings": "GM Fog Settings",
|
||||
"gmColorTint": "Color",
|
||||
"gmColorAlpha": "Color Opacity",
|
||||
|
||||
"playerFogSettings": "Player Fog Settings",
|
||||
"playerColorTint": "Color",
|
||||
"playerColorAlpha": "Color Opacity",
|
||||
|
||||
"fogImageOverlaySettings": "Fog Overlay Image",
|
||||
"fogImageOverlay": "Image",
|
||||
"fogImageOverlayNotes": "Selected image will display above/below the tint color. This image should be the same height and width of the scene background image.",
|
||||
"fogImageOverlayGMAlpha": "GM Image Opacity",
|
||||
"fogImageOverlayPlayerAlpha": "Player Image Opacity",
|
||||
"fogImageOverlayZIndex": "Mask Sorting Order",
|
||||
|
||||
"filterSettings": "Filter Settings",
|
||||
"blurEnable": "Enable Reveal Blur",
|
||||
"blurRadius": "Blur Radius",
|
||||
"blurQuality": "Blur Quality",
|
||||
"blurQualityDesc": "Higher blur quality improves the appearance of the blur effect, but may cause slower performance.",
|
||||
"transitionSettings": "Transition Settings",
|
||||
"enableTransitions": "Enable Transitions",
|
||||
"transitionSpeed": "Transition Speed",
|
||||
"visibilitySettings": "Visibility Settings",
|
||||
"enableAutovis": "Enable Automatic Visibility",
|
||||
"enableForGM": "Enable for GM",
|
||||
"enableAutoFog": "Enable fog Automatically for new scenes",
|
||||
"visThreshold": "Visibility Threshold",
|
||||
"saveAsDef": "Save current settings as default",
|
||||
"ok": "OK",
|
||||
"sf": "Simple Fog",
|
||||
"onoff": "Enable/Disable Simple Fog",
|
||||
|
||||
"brushTool": "Brush Tool",
|
||||
"gridTool": "Grid Tool",
|
||||
"polygonTool": "Polygon Tool",
|
||||
"boxTool": "Box Tool",
|
||||
"ellipseTool": "Ellipse Tool",
|
||||
"sceneConfig": "Scene Configuration",
|
||||
"reset": "Reset Simple Fog",
|
||||
"confirmReset": "Are you sure? Fog of war will be reset.",
|
||||
"autoFogSettings": "AutoFog Settings",
|
||||
"autoFogNotes": "When enabled AND saved as default, fog will automatically render when you create a scene. Please check box and click 'Save current setings as defualt' in order to enable. Do the same to disable",
|
||||
|
||||
"advancedSettings": "Advanced Settings",
|
||||
"configurableZindex": "Simple Fog Z-Index",
|
||||
"configurableZindexNotes": "The z-index determines the order in which various layers are rendered within the Foundry canvas. A higher number will be rendered on top of lower numbered layers (and the objects on that layer). This allows for the adjustment of the z-index to allow for Simple Fog to be rendered above/below other layers; particularly ones added by other modules. Going below 200 will intermingle with Foundry layers such as the foreground image (200), tokens (100), etc... (Default: 220)",
|
||||
|
||||
"confirmDisablingFogSettings": "Toggle Confirmation Settings",
|
||||
"confirmDisablingFog": "Enable confirmation to disable Simple Fog.",
|
||||
"confirmDisablingFogNotes": "When disabling Simple Fog for a scene, present a dialog to confirm disabling before doing so.",
|
||||
"confirmDisableFog": "Are you sure you want to toggle off Simple Fog for this scene?",
|
||||
"disableFog": "Disable Simple Fog",
|
||||
|
||||
"hotkeySettings": "Hotkey Settings",
|
||||
"enableHotkeys": "Enable hotkeys",
|
||||
"hotkeyNotes": "When enabled, you will be able to quickly swap to the simplefog control by using Ctrl+S and toggle the opacity using the hotkey 'T'",
|
||||
"hotKeyToolDesc": "Hotkey Tool",
|
||||
"hotKeyToolNotes": "Determine which tool will be selected when hotkey is activated.",
|
||||
|
||||
"autoVisNotes": "When enabled, Automatic Visibility will show/hide tokens based on fog opacity level at their location based on the threshold setting. Brush color changes to green/red to indicate whether a token would be visible.",
|
||||
|
||||
"versionNotification": "<b>Simple Fog 0.3.4</b><p>This release includes:</p><ul><li>Fixes for v11 by macskay <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/110'>#110</a></li><li>Fixes for v11 by mattd <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/111'>#111</a></li></ul></p>",
|
||||
|
||||
"migration2Notification": "<b>Simple Fog Data Migration</b><p>The Simple Fog data has been migrated to a format supporting v3. It is <b>HIGHLY</b> recommended to review all scenes and fog visibility, both from a GM and a Player view before showing the scene to players."
|
||||
|
||||
}
|
||||
}
|
||||
78
src/modules/simplefog/lang/es.json
Normal file
78
src/modules/simplefog/lang/es.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"I18N.LANGUAGE": "Español",
|
||||
"I18N.MAINTAINERS": "@Viriato139ac#0342",
|
||||
|
||||
"SIMPLEFOG": {
|
||||
"brushOpacity": "Opacidad del pincel",
|
||||
"brushSize": "Tamaño del pincel",
|
||||
"hide": "Ocultar",
|
||||
"reveal": "Mostrar",
|
||||
|
||||
"gmFogSettings": "Ajustes de niebla del GM",
|
||||
"gmColorTint": "Color",
|
||||
"gmColorAlpha": "Opacidad",
|
||||
|
||||
"playerFogSettings": "Ajustes de niebla del jugador",
|
||||
"playerColorTint": "Color",
|
||||
"playerColorAlpha": "Color Opacidad",
|
||||
|
||||
"fogImageOverlaySettings": "Imagen de superposición de niebla",
|
||||
"fogImageOverlay": "Imagen",
|
||||
"fogImageOverlayNotes": "La imagen seleccionada se mostrará arriba/abajo del color del tinte. Esta imagen debe tener la misma altura y anchura que la imagen de fondo de la escena.",
|
||||
"fogImageOverlayGMAlpha": "Opacidad de imagen GM",
|
||||
"fogImageOverlayPlayerAlpha": "Opacidad de la imagen del jugador",
|
||||
"fogImageOverlayZIndex": "Orden de clasificación de máscaras",
|
||||
|
||||
"filterSettings": "Ajustes del filtro",
|
||||
"blurEnable": "Habilitar Revelar desenfoque",
|
||||
"blurRadius": "Radio del difuminado",
|
||||
"blurQuality": "Calidad del difuminado",
|
||||
"blurQualityDesc": "Cuanto mayor sea la calidad mejor será la apariencia del efecto de difuminado, sin embargo, puede causar en que baje el rendimiento",
|
||||
"transitionSettings": "Ajustes de transición",
|
||||
"enableTransitions": "Habilitar transiciones",
|
||||
"transitionSpeed": "Velocidad de la transición",
|
||||
"visibilitySettings": "Ajustes de visibilidad",
|
||||
"enableAutovis": "Habilitar visibilidad automática",
|
||||
"enableForGM": "Habilitar para el GM",
|
||||
"enableAutoFog": "Habilitar la niebla automáticamente para las nuevas escenas",
|
||||
"visThreshold": "Umbral de visibilidad",
|
||||
"saveAsDef": "Guardar como por defecto los ajustes actuales",
|
||||
"ok": "OK",
|
||||
"sf": "Simple Fog",
|
||||
"onoff": "Habilitar/deshabilitar Simple Fog",
|
||||
|
||||
"brushTool": "Herramienta pincel",
|
||||
"gridTool": "Herramienta rejilla",
|
||||
"polygonTool": "Herramienta polígono",
|
||||
"boxTool": "Herramienta rectángulo",
|
||||
"ellipseTool": "Herramienta elipse",
|
||||
"sceneConfig": "Configuración de la escena",
|
||||
"reset": "Reiniciar niebla",
|
||||
"confirmReset": "¿Está seguro? Se reiniciará la niebla de guerra",
|
||||
"autoFogSettings": "Ajustes de niebla automática",
|
||||
"autoFogNotes": "Cuando se activa y se guarda por defecto, la niebla se generará automáticamente cuando cree la escena. Por favor, active esta opción y pulse 'Guardar como por defecto los ajustes actuales' para habilitarlo. Realice el mismo proceso, pero al contrario, para deshabilitarlo",
|
||||
|
||||
"advancedSettings": "Ajustes avanzados",
|
||||
"configurableZindex": "Índice Z de niebla simple",
|
||||
"configurableZindexNotes": "El índice z determina el orden en el que se representan varias capas dentro del lienzo de Foundry. Se representará un número más alto sobre las capas con números más bajos (y los objetos en esa capa). Esto permite el ajuste del índice z para permitir que Simple Fog se represente por encima o por debajo de otras capas; particularmente los agregados por otros módulos. Ir por debajo de 200 se entremezclará con las capas de Foundry, como la imagen de primer plano (200), tokens (100), etc. (Predeterminado: 220)",
|
||||
|
||||
"confirmDisablingFogSettings": "Confirmar la desactivación de la niebla simple",
|
||||
"confirmDisablingFog": "Habilite la confirmación para deshabilitar la niebla simple.",
|
||||
"confirmDisablingFogNotes": "Al deshabilitar niebla para una escena, presente un cuadro de diálogo para confirmar la desactivación antes de hacerlo.",
|
||||
"confirmDisableFog": "¿Estás seguro de que quieres desactivar Simple Fog para esta escena?",
|
||||
"disableFog": "Desactivar niebla",
|
||||
|
||||
"hotkeySettings": "Configuración de teclas de acceso rápido",
|
||||
"enableHotkeys": "Habilitar teclas de acceso rápido",
|
||||
"hotkeyNotes": "Cuando esté habilitado, podrá cambiar rápidamente al control de niebla simple usando Ctrl + S y alternar la opacidad usando la tecla de acceso directo 'T'",
|
||||
"hotKeyToolDesc": "Herramienta de teclas de acceso directo",
|
||||
"hotKeyToolNotes": "Determine qué herramienta se seleccionará cuando se active la tecla de acceso directo.",
|
||||
|
||||
"autoVisNotes": "Cuando se activa, la visibilidad automática mostrará/ocultará los iconos en base al nivel de opacidad de la niebla en su localización y el umbral que se especifique. El color del pincel cambia a verde/rojo para indicar si el token es visible",
|
||||
|
||||
"versionNotification": "<b>Simple Fog 0.3.4</b><p>Esta versión incluye:</p><ul><li>Arreglos para v11 de macskay <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/110'>#110</a></li><li>Arreglos para v11 por mattd <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/111'>#111</a></li></ul></p>",
|
||||
|
||||
"migration2Notification": "<b>Migración de datos de Simple Fog</b><p>Los datos de Simple Fog se han migrado a un formato compatible con v3. Se recomienda <b>MUY</b> revisar todas las escenas y la visibilidad de la niebla, tanto desde la vista del DJ como del jugador, antes de mostrar la escena a los jugadores."
|
||||
|
||||
}
|
||||
}
|
||||
74
src/modules/simplefog/lang/ja.json
Normal file
74
src/modules/simplefog/lang/ja.json
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"SIMPLEFOG": {
|
||||
"brushOpacity": "ブラシの濃度",
|
||||
"brushSize": "ブラシサイズ",
|
||||
"hide": "濃い",
|
||||
"reveal": "薄い",
|
||||
|
||||
"gmFogSettings": "霧の設定(GM用)",
|
||||
"gmColorTint": "色",
|
||||
"gmColorAlpha": "濃度",
|
||||
|
||||
"playerFogSettings": "霧の設定(プレイヤー用)",
|
||||
"playerColorTint": "色",
|
||||
"playerColorAlpha": "色の不透明度",
|
||||
|
||||
"fogImageOverlaySettings": "フォグ オーバーレイ イメージ",
|
||||
"fogImageOverlay": "画像",
|
||||
"fogImageOverlayNotes": "選択した画像は、色合いの上/下に表示されます。 この画像は、シーンの背景画像と同じ高さと幅である必要があります。",
|
||||
"fogImageOverlayGMAlpha": "GM 画像の不透明度",
|
||||
"fogImageOverlayPlayerAlpha": "プレーヤー画像の不透明度",
|
||||
"fogImageOverlayZIndex": "マスクのソート順",
|
||||
|
||||
"filterSettings": "フィルター設定",
|
||||
"blurEnable": "リビールブラーを有効にする",
|
||||
"blurRadius": "ぼかし半径",
|
||||
"blurQuality": "ぼかし品質",
|
||||
"blurQualityDesc": "ぼかし品質が高いと見た目は良くなりますが、パフォーマンスの低下を招くことがあります。",
|
||||
"transitionSettings": "トランジション設定",
|
||||
"enableTransitions": "トランジションを有効にする",
|
||||
"transitionSpeed": "トランジション速度",
|
||||
"visibilitySettings": "可視性の設定",
|
||||
"enableAutovis": "自動可視化を有効にする",
|
||||
"enableForGM": "GMにも適用する",
|
||||
"enableAutoFog": "新しいシーンでフォグを自動的に有効にします。",
|
||||
"visThreshold": "視認性の閾値",
|
||||
"saveAsDef": "この設定をデフォルトに保存",
|
||||
"ok": "適用",
|
||||
"sf": "Simple Fog",
|
||||
"onoff": "霧のオン/オフ",
|
||||
|
||||
"brushTool": "ブラシツール",
|
||||
"gridTool": "グリッドツール",
|
||||
"polygonTool": "多角形ツール",
|
||||
"boxTool": "ボックスツール",
|
||||
"ellipseTool": "楕円ツール",
|
||||
"sceneConfig": "シーン設定",
|
||||
"reset": "霧のリセット",
|
||||
"confirmReset": "霧が初期化されます。本当によろしいですか?",
|
||||
"autoFogSettings": "オートフォグ設定",
|
||||
"autoFogNotes": "この機能を有効にしてデフォルトで保存すると、シーンを作成時にフォグが自動的にレンダリングされます。有効にするにはチェックボックスにチェックを入れ、「この設定をデフォルトに保存」をクリックしてください。無効にする場合も同様です。",
|
||||
|
||||
"advancedSettings": "高度な設定",
|
||||
"configurableZindex": "シンプルフォグZインデックス",
|
||||
"configurableZindexNotes": "z-indexは、Foundryキャンバス内でさまざまなレイヤーがレンダリングされる順序を決定します。 番号の小さいレイヤー(およびそのレイヤー上のオブジェクト)の上に、番号の大きいものがレンダリングされます。 これにより、z-indexを調整して、SimpleFogを他のレイヤーの上/下にレンダリングできるようになります。 特に他のモジュールによって追加されたもの。 200を下回ると、前景画像(200)、トークン(100)などのFoundryレイヤーと混ざり合います...(デフォルト:220)",
|
||||
|
||||
"confirmDisablingFogSettings": "シンプルフォグの無効化を確認する",
|
||||
"confirmDisablingFog": "確認を有効にして、シンプルフォグを無効にします。",
|
||||
"confirmDisablingFogNotes": "シーンのシンプルフォグを無効にする場合は、無効にする前に無効を確認するダイアログを表示します。",
|
||||
"confirmDisableFog": "このシーンでSimpleFogをオフにしてよろしいですか?",
|
||||
"disableFog": "シンプルフォグを無効にする",
|
||||
|
||||
"hotkeySettings": "ホットキー設定",
|
||||
"enableHotkeys": "ホットキーを有効にする",
|
||||
"hotkeyNotes": "有効にすると、Ctrl + Sを使用してsimplefogコントロールにすばやく切り替え、ホットキー「T」を使用して不透明度を切り替えることができます。",
|
||||
"hotKeyToolDesc": "ホットキーツール",
|
||||
"hotKeyToolNotes": "ホットキーがアクティブ化されたときに選択されるツールを決定します。",
|
||||
|
||||
"autoVisNotes": "自動可視化を有効にすると、その場所のトークンの表示/非表示が、閾値として設定した霧の濃度に基づいて決定されるようになります。非表示となる濃度では、ブラシの色が緑から赤に変化してそれを知らせます。",
|
||||
|
||||
"versionNotification": "<b>Simple Fog 0.3.4</b><p>このリリースには以下が含まれます:</p><ul><li>macskay による v11 の修正 <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/110'>#110</a></li><li>mattd による v11 の修正 <a href='https://github.com/League-of-Foundry-Developers/simplefog/pull/111'>#111</a></li></ul></p>",
|
||||
|
||||
"migration2Notification": "<b>Simple Fog データの移行</b><p>Simple Fog データは、v3 をサポートする形式に移行されました。 プレーヤーにシーンを表示する前に、GM ビューとプレーヤー ビューの両方から、すべてのシーンと霧の可視性を確認することを<b>強く</b>お勧めします。"
|
||||
}
|
||||
}
|
||||
236
src/modules/simplefog/libs/hexagons.js
Normal file
236
src/modules/simplefog/libs/hexagons.js
Normal file
@@ -0,0 +1,236 @@
|
||||
/* eslint-disable */
|
||||
// Generated code -- CC0 -- No Rights Reserved -- http://www.redblobgames.com/grids/hexagons/
|
||||
export class Point {
|
||||
constructor(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
export class Hex {
|
||||
constructor(q, r, s) {
|
||||
this.q = q;
|
||||
this.r = r;
|
||||
this.s = s;
|
||||
if (Math.round(q + r + s) !== 0) throw "q + r + s must be 0";
|
||||
}
|
||||
add(b) {
|
||||
return new Hex(this.q + b.q, this.r + b.r, this.s + b.s);
|
||||
}
|
||||
subtract(b) {
|
||||
return new Hex(this.q - b.q, this.r - b.r, this.s - b.s);
|
||||
}
|
||||
scale(k) {
|
||||
return new Hex(this.q * k, this.r * k, this.s * k);
|
||||
}
|
||||
rotateLeft() {
|
||||
return new Hex(-this.s, -this.q, -this.r);
|
||||
}
|
||||
rotateRight() {
|
||||
return new Hex(-this.r, -this.s, -this.q);
|
||||
}
|
||||
static direction(direction) {
|
||||
return Hex.directions[direction];
|
||||
}
|
||||
neighbor(direction) {
|
||||
return this.add(Hex.direction(direction));
|
||||
}
|
||||
diagonalNeighbor(direction) {
|
||||
return this.add(Hex.diagonals[direction]);
|
||||
}
|
||||
len() {
|
||||
return (Math.abs(this.q) + Math.abs(this.r) + Math.abs(this.s)) / 2;
|
||||
}
|
||||
distance(b) {
|
||||
return this.subtract(b).len();
|
||||
}
|
||||
round() {
|
||||
var qi = Math.round(this.q);
|
||||
var ri = Math.round(this.r);
|
||||
var si = Math.round(this.s);
|
||||
var q_diff = Math.abs(qi - this.q);
|
||||
var r_diff = Math.abs(ri - this.r);
|
||||
var s_diff = Math.abs(si - this.s);
|
||||
if (q_diff > r_diff && q_diff > s_diff) {
|
||||
qi = -ri - si;
|
||||
} else if (r_diff > s_diff) {
|
||||
ri = -qi - si;
|
||||
} else {
|
||||
si = -qi - ri;
|
||||
}
|
||||
return new Hex(qi, ri, si);
|
||||
}
|
||||
lerp(b, t) {
|
||||
return new Hex(this.q * (1.0 - t) + b.q * t, this.r * (1.0 - t) + b.r * t, this.s * (1.0 - t) + b.s * t);
|
||||
}
|
||||
linedraw(b) {
|
||||
var N = this.distance(b);
|
||||
var a_nudge = new Hex(this.q + 1e-6, this.r + 1e-6, this.s - 2e-6);
|
||||
var b_nudge = new Hex(b.q + 1e-6, b.r + 1e-6, b.s - 2e-6);
|
||||
var results = [];
|
||||
var step = 1.0 / Math.max(N, 1);
|
||||
for (var i = 0; i <= N; i++) {
|
||||
results.push(a_nudge.lerp(b_nudge, step * i).round());
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
||||
Hex.directions = [
|
||||
new Hex(1, 0, -1),
|
||||
new Hex(1, -1, 0),
|
||||
new Hex(0, -1, 1),
|
||||
new Hex(-1, 0, 1),
|
||||
new Hex(-1, 1, 0),
|
||||
new Hex(0, 1, -1),
|
||||
];
|
||||
Hex.diagonals = [
|
||||
new Hex(2, -1, -1),
|
||||
new Hex(1, -2, 1),
|
||||
new Hex(-1, -1, 2),
|
||||
new Hex(-2, 1, 1),
|
||||
new Hex(-1, 2, -1),
|
||||
new Hex(1, 1, -2),
|
||||
];
|
||||
export class OffsetCoord {
|
||||
constructor(col, row) {
|
||||
this.col = col;
|
||||
this.row = row;
|
||||
}
|
||||
static qoffsetFromCube(offset, h) {
|
||||
var col = h.q;
|
||||
var row = h.r + (h.q + offset * (h.q & 1)) / 2;
|
||||
if (offset !== OffsetCoord.EVEN && offset !== OffsetCoord.ODD) {
|
||||
throw "offset must be EVEN (+1) or ODD (-1)";
|
||||
}
|
||||
return new OffsetCoord(col, row);
|
||||
}
|
||||
static qoffsetToCube(offset, h) {
|
||||
var q = h.col;
|
||||
var r = h.row - (h.col + offset * (h.col & 1)) / 2;
|
||||
var s = -q - r;
|
||||
if (offset !== OffsetCoord.EVEN && offset !== OffsetCoord.ODD) {
|
||||
throw "offset must be EVEN (+1) or ODD (-1)";
|
||||
}
|
||||
return new Hex(q, r, s);
|
||||
}
|
||||
static roffsetFromCube(offset, h) {
|
||||
var col = h.q + (h.r + offset * (h.r & 1)) / 2;
|
||||
var row = h.r;
|
||||
if (offset !== OffsetCoord.EVEN && offset !== OffsetCoord.ODD) {
|
||||
throw "offset must be EVEN (+1) or ODD (-1)";
|
||||
}
|
||||
return new OffsetCoord(col, row);
|
||||
}
|
||||
static roffsetToCube(offset, h) {
|
||||
var q = h.col - (h.row + offset * (h.row & 1)) / 2;
|
||||
var r = h.row;
|
||||
var s = -q - r;
|
||||
if (offset !== OffsetCoord.EVEN && offset !== OffsetCoord.ODD) {
|
||||
throw "offset must be EVEN (+1) or ODD (-1)";
|
||||
}
|
||||
return new Hex(q, r, s);
|
||||
}
|
||||
}
|
||||
OffsetCoord.EVEN = 1;
|
||||
OffsetCoord.ODD = -1;
|
||||
export class DoubledCoord {
|
||||
constructor(col, row) {
|
||||
this.col = col;
|
||||
this.row = row;
|
||||
}
|
||||
static qdoubledFromCube(h) {
|
||||
var col = h.q;
|
||||
var row = 2 * h.r + h.q;
|
||||
return new DoubledCoord(col, row);
|
||||
}
|
||||
qdoubledToCube() {
|
||||
var q = this.col;
|
||||
var r = (this.row - this.col) / 2;
|
||||
var s = -q - r;
|
||||
return new Hex(q, r, s);
|
||||
}
|
||||
static rdoubledFromCube(h) {
|
||||
var col = 2 * h.q + h.r;
|
||||
var row = h.r;
|
||||
return new DoubledCoord(col, row);
|
||||
}
|
||||
rdoubledToCube() {
|
||||
var q = (this.col - this.row) / 2;
|
||||
var r = this.row;
|
||||
var s = -q - r;
|
||||
return new Hex(q, r, s);
|
||||
}
|
||||
}
|
||||
export class Orientation {
|
||||
constructor(f0, f1, f2, f3, b0, b1, b2, b3, start_angle) {
|
||||
this.f0 = f0;
|
||||
this.f1 = f1;
|
||||
this.f2 = f2;
|
||||
this.f3 = f3;
|
||||
this.b0 = b0;
|
||||
this.b1 = b1;
|
||||
this.b2 = b2;
|
||||
this.b3 = b3;
|
||||
this.start_angle = start_angle;
|
||||
}
|
||||
}
|
||||
export class Layout {
|
||||
constructor(orientation, size, origin) {
|
||||
this.orientation = orientation;
|
||||
this.size = size;
|
||||
this.origin = origin;
|
||||
}
|
||||
hexToPixel(h) {
|
||||
var M = this.orientation;
|
||||
var size = this.size;
|
||||
var origin = this.origin;
|
||||
var x = (M.f0 * h.q + M.f1 * h.r) * size.x;
|
||||
var y = (M.f2 * h.q + M.f3 * h.r) * size.y;
|
||||
return new Point(x + origin.x, y + origin.y);
|
||||
}
|
||||
pixelToHex(p) {
|
||||
var M = this.orientation;
|
||||
var size = this.size;
|
||||
var origin = this.origin;
|
||||
var pt = new Point((p.x - origin.x) / size.x, (p.y - origin.y) / size.y);
|
||||
var q = M.b0 * pt.x + M.b1 * pt.y;
|
||||
var r = M.b2 * pt.x + M.b3 * pt.y;
|
||||
return new Hex(q, r, -q - r);
|
||||
}
|
||||
hexCornerOffset(corner) {
|
||||
var M = this.orientation;
|
||||
var size = this.size;
|
||||
var angle = (2.0 * Math.PI * (M.start_angle - corner)) / 6.0;
|
||||
return new Point(size.x * Math.cos(angle), size.y * Math.sin(angle));
|
||||
}
|
||||
polygonCorners(h) {
|
||||
var corners = [];
|
||||
var center = this.hexToPixel(h);
|
||||
for (var i = 0; i < 6; i++) {
|
||||
var offset = this.hexCornerOffset(i);
|
||||
corners.push(new Point(center.x + offset.x, center.y + offset.y));
|
||||
}
|
||||
return corners;
|
||||
}
|
||||
}
|
||||
Layout.pointy = new Orientation(
|
||||
Math.sqrt(3.0),
|
||||
Math.sqrt(3.0) / 2.0,
|
||||
0.0,
|
||||
3.0 / 2.0,
|
||||
Math.sqrt(3.0) / 3.0,
|
||||
-1.0 / 3.0,
|
||||
0.0,
|
||||
2.0 / 3.0,
|
||||
0.5
|
||||
);
|
||||
Layout.flat = new Orientation(
|
||||
3.0 / 2.0,
|
||||
0.0,
|
||||
Math.sqrt(3.0) / 2.0,
|
||||
Math.sqrt(3.0),
|
||||
2.0 / 3.0,
|
||||
0.0,
|
||||
-1.0 / 3.0,
|
||||
Math.sqrt(3.0) / 3.0,
|
||||
0.0
|
||||
);
|
||||
44
src/modules/simplefog/module.json
Normal file
44
src/modules/simplefog/module.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "simplefog",
|
||||
"title": "Simple Fog - Manual Fog of War",
|
||||
"description": "Simple Fog allows you to draw fog of war manually, optionally automatically hiding and revealing tokens underneath based on opacity. It provides a number of tools to quickly draw and erase fog in various shapes - brush, rectangles, ellipses, polygons or to reveal tiles you click/drag on the grid.",
|
||||
"version": "1.1.1",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matheus Clemente",
|
||||
"discord": "mclemente#5524"
|
||||
}
|
||||
],
|
||||
"socket": true,
|
||||
"languages": [
|
||||
{
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/en.json"
|
||||
},
|
||||
{
|
||||
"lang": "es",
|
||||
"name": "Español",
|
||||
"path": "lang/es.json"
|
||||
},
|
||||
{
|
||||
"lang": "ja",
|
||||
"name": "日本語 (Japanese)",
|
||||
"path": "lang/ja.json"
|
||||
}
|
||||
],
|
||||
"esmodules": [
|
||||
"module/simplefog.js"
|
||||
],
|
||||
"styles": [
|
||||
"styles/simplefog.css"
|
||||
],
|
||||
"compatibility": {
|
||||
"minimum": 11,
|
||||
"verified": 11,
|
||||
"maximum": 11
|
||||
},
|
||||
"url": "https://github.com/mclemente/simplefog",
|
||||
"manifest": "https://github.com/mclemente/simplefog/releases/latest/download/module.json",
|
||||
"download": "https://github.com/mclemente/simplefog/releases/download/1.1.1/module.zip"
|
||||
}
|
||||
2148
src/modules/simplefog/module/simplefog.js
Normal file
2148
src/modules/simplefog/module/simplefog.js
Normal file
File diff suppressed because it is too large
Load Diff
1
src/modules/simplefog/module/simplefog.js.map
Normal file
1
src/modules/simplefog/module/simplefog.js.map
Normal file
File diff suppressed because one or more lines are too long
43
src/modules/simplefog/styles/simplefog.css
Normal file
43
src/modules/simplefog/styles/simplefog.css
Normal file
@@ -0,0 +1,43 @@
|
||||
#simplefog-brush-controls {
|
||||
position: absolute;
|
||||
left: 120px;
|
||||
width: 180px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#simplefog-brush-controls h3,
|
||||
#simplefog-brush-controls .label {
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 0 #000;
|
||||
}
|
||||
|
||||
#simplefog-brush-controls .label {
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
}
|
||||
#simplefog-brush-controls .brush-opacity {
|
||||
position: relative;
|
||||
}
|
||||
#simplefog-brush-controls .right-label {
|
||||
right: 0;
|
||||
}
|
||||
#simplefog-brush-controls .left-label {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Webkit browsers */
|
||||
#simplefog-brush-controls input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
height: 24px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
#simplefog-brush-controls input[type="range"]::-moz-range-thumb {
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
/* IE */
|
||||
#simplefog-brush-controls input[type="range"]::-ms-thumb {
|
||||
height: 24px;
|
||||
}
|
||||
18
src/modules/simplefog/templates/brush-controls.html
Normal file
18
src/modules/simplefog/templates/brush-controls.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div id="simplefog-brush-controls">
|
||||
<form id="simplefog-brush-controls-form">
|
||||
<div id="brush-size-container">
|
||||
<h3 class="form-header">{{localize 'SIMPLEFOG.brushSize'}}</h3>
|
||||
<div class="form-group">
|
||||
<input type="range" name="brushSize" value="{{ brushSize }}" min="10" max="500" step="10" data-dtype="Number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="brush-opacity-container">
|
||||
<h3 class="form-header">{{localize 'SIMPLEFOG.brushOpacity'}}</h3>
|
||||
<div class="form-group brush-opacity">
|
||||
<input type="range" name="brushOpacity" value="{{ brushOpacity }}" min="0" max="100" step="1" data-dtype="Number"/>
|
||||
<div class="label left-label">{{localize 'SIMPLEFOG.reveal'}}</div>
|
||||
<div class="label right-label">{{localize 'SIMPLEFOG.hide'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
111
src/modules/simplefog/templates/scene-config.html
Normal file
111
src/modules/simplefog/templates/scene-config.html
Normal file
@@ -0,0 +1,111 @@
|
||||
<form>
|
||||
<h3 class="form-header"><i class="fas fa-crown"></i> {{localize 'SIMPLEFOG.gmFogSettings'}}</h3>
|
||||
<div class="form-group">
|
||||
<label for="gmColorTint">{{localize 'SIMPLEFOG.gmColorTint'}}</label>
|
||||
<input class="color" type="text" name="gmColorTint" value="{{ gmColorTint }}" data-dtype="String" />
|
||||
<input type="color" value="{{ gmColorTint }}" data-edit="gmColorTint" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="gmColorAlpha">{{localize 'SIMPLEFOG.gmColorAlpha'}}</label>
|
||||
<input type="range" name="gmColorAlpha" value="{{ gmColorAlpha }}" min="0" max="100" step="1" data-dtype="Number" />
|
||||
<span class="range-value">{{ gmColorAlpha }}</span>
|
||||
</div>
|
||||
|
||||
<h3 class="form-header"><i class="fas fa-users"></i> {{localize 'SIMPLEFOG.playerFogSettings'}}</h3>
|
||||
<div class="form-group">
|
||||
<label for="playerColorTint">{{localize 'SIMPLEFOG.playerColorTint'}}</label>
|
||||
<input class="color" type="text" name="playerColorTint" value="{{ playerColorTint }}" data-dtype="String" />
|
||||
<input type="color" value="{{ playerColorTint }}" data-edit="playerColorTint" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="playerColorAlpha">{{localize 'SIMPLEFOG.playerColorAlpha'}}</label>
|
||||
<input type="range" name="playerColorAlpha" value="{{ playerColorAlpha }}" min="0" max="100" step="1"
|
||||
data-dtype="Number" />
|
||||
<span class="range-value">{{ playerColorAlpha }}</span>
|
||||
</div>
|
||||
|
||||
<h3 class="form-header"><i class="fas fa-image"></i> {{localize 'SIMPLEFOG.fogImageOverlaySettings'}}</h3>
|
||||
<div class="form-group">
|
||||
<label for="fogImageOverlayFilePath">{{localize 'SIMPLEFOG.fogImageOverlay'}}</label>
|
||||
<button type="button" class="file-picker" data-type="imagevideo" data-target="fogImageOverlayFilePath" title="Browse Files" tabindex="-1">
|
||||
<i class="fas fa-file-import fa-fw"></i>
|
||||
</button>
|
||||
<input class="image" type="text" name="fogImageOverlayFilePath" value="{{ fogImageOverlayFilePath }}" placeholder="{{localize 'SIMPLEFOG.fogImageOverlay'}}" data-dtype="String" />
|
||||
</div>
|
||||
<p class="notes">
|
||||
{{ localize 'SIMPLEFOG.fogImageOverlayNotes' }}
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label for="fogImageOverlayGMAlpha">{{localize 'SIMPLEFOG.fogImageOverlayGMAlpha'}}</label>
|
||||
<input type="range" name="fogImageOverlayGMAlpha" value="{{ fogImageOverlayGMAlpha }}" min="0" max="100" step="1"
|
||||
data-dtype="Number" />
|
||||
<span class="range-value">{{ fogImageOverlayGMAlpha }}</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fogImageOverlayPlayerAlpha">{{localize 'SIMPLEFOG.fogImageOverlayPlayerAlpha'}}</label>
|
||||
<input type="range" name="fogImageOverlayPlayerAlpha" value="{{ fogImageOverlayPlayerAlpha }}" min="0" max="100" step="1"
|
||||
data-dtype="Number" />
|
||||
<span class="range-value">{{ fogImageOverlayPlayerAlpha }}</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fogImageOverlayZIndex">{{localize 'SIMPLEFOG.fogImageOverlayZIndex'}}</label>
|
||||
<select name="fogImageOverlayZIndex">
|
||||
{{selectOptions fogImageOverlayZIndexOptions selected=fogImageOverlayZIndex}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<h3 class="form-header"><i class="fas fa-filter"></i> {{localize 'SIMPLEFOG.filterSettings'}}</h3>
|
||||
<div class="form-group">
|
||||
<label for="blurEnable">{{localize 'SIMPLEFOG.blurEnable'}}</label>
|
||||
<input type='checkbox' {{#if blurEnable}}checked{{/if}} name='blurEnable' />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="blurRadius">{{localize 'SIMPLEFOG.blurRadius'}}</label>
|
||||
<input type="range" name="blurRadius" value="{{ blurRadius }}" min="0" max="50" step="1" data-dtype="Number" />
|
||||
<span class="range-value">{{ blurRadius }}</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="blurQuality">{{localize 'SIMPLEFOG.blurQuality'}}</label>
|
||||
<input type="range" name="blurQuality" value="{{ blurQuality }}" min="1" max="8" step="1" data-dtype="Number" />
|
||||
<span class="range-value">{{ blurQuality }}</span>
|
||||
<p class="notes">{{localize 'SIMPLEFOG.blurQualityDesc'}}</p>
|
||||
</div>
|
||||
|
||||
<h3 class="form-header"><i class="fas fa-adjust"></i> {{localize 'SIMPLEFOG.transitionSettings'}}</h3>
|
||||
<div class="form-group">
|
||||
<label for="transition">{{localize 'SIMPLEFOG.enableTransitions'}}</label>
|
||||
<input type='checkbox' {{#if transition}}checked{{/if}} name='transition' />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="transitionSpeed">{{localize 'SIMPLEFOG.transitionSpeed'}}</label>
|
||||
<input type="range" name="transitionSpeed" value="{{ transitionSpeed }}" min="100" max="5000" step="100"
|
||||
data-dtype="Number" />
|
||||
<span class="range-value">{{ transitionSpeed }}</span>
|
||||
</div>
|
||||
<h3 class="form-header"><i class="fas fa-low-vision"></i> {{localize 'SIMPLEFOG.visibilitySettings'}}</h3>
|
||||
<p class="notes">{{ localize 'SIMPLEFOG.autoVisNotes' }}</p>
|
||||
<div class="form-group">
|
||||
<label for="autoVisibility">{{localize 'SIMPLEFOG.enableAutovis'}}</label>
|
||||
<input type='checkbox' {{#if autoVisibility}}checked{{/if}} name='autoVisibility' />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="autoVisGM">{{localize 'SIMPLEFOG.enableForGM'}}</label>
|
||||
<input type='checkbox' {{#if autoVisGM}}checked{{/if}} name='autoVisGM' />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="vThreshold">{{localize 'SIMPLEFOG.visThreshold'}}</label>
|
||||
<input type="range" name="vThreshold" value="{{ vThreshold }}" min="0" max="100" step="1" data-dtype="Number" />
|
||||
<span class="range-value">{{ vThreshold }}</span>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<footer class="sheet-footer flexrow">
|
||||
<button type="submit" name="saveDefaults">
|
||||
<i class="fas fa-save"></i> {{localize 'SIMPLEFOG.saveAsDef'}}
|
||||
</button>
|
||||
<button type="submit" name="submit">
|
||||
<i class="fa fa-check"></i> {{localize 'SIMPLEFOG.ok'}}
|
||||
</button>
|
||||
</footer>
|
||||
</form>
|
||||
Reference in New Issue
Block a user