Skip to content

Commit

Permalink
Use FA infinity symbol in placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Dec 28, 2022
1 parent 8264816 commit 76a757f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "dev7355608@gmail.com"
}
],
"version": "4.1.10",
"version": "4.1.11",
"compatibility": {
"minimum": "10.286",
"verified": "10.291",
Expand Down Expand Up @@ -45,8 +45,8 @@
},
"url": "https://github.com/dev7355608/perfect-vision",
"manifest": "https://raw.githubusercontent.com/dev7355608/perfect-vision/main/module.json",
"download": "https://github.com/dev7355608/perfect-vision/archive/v4.1.10.zip",
"changelog": "https://github.com/dev7355608/perfect-vision/releases/tag/v4.1.10",
"download": "https://github.com/dev7355608/perfect-vision/archive/v4.1.11.zip",
"changelog": "https://github.com/dev7355608/perfect-vision/releases/tag/v4.1.11",
"bugs": "https://github.com/dev7355608/perfect-vision/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/perfect-vision/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/perfect-vision/main/LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion scripts/config/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Hooks.on("renderTokenConfig", (sheet, html) => {
sightRange.insertAdjacentHTML("afterend", `\
<label>In light</label>
<input type="number" name="flags.perfect-vision.sight.range" min="0" step="any"
placeholder="&infin;" class="perfect-vision--range"
placeholder="&#xF534;" class="perfect-vision--range"
value="${foundry.utils.getProperty(document, "flags.perfect-vision.sight.range") ?? ""}">`);

sheet.options.height = "auto";
Expand Down
11 changes: 5 additions & 6 deletions scripts/core/point-source-polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ Hooks.once("setup", () => {
function (wrapped, ...args) {
const config = wrapped(...args);
const rayCaster = getRayCaster(this);
const maxR = canvas.dimensions.maxR;

if (rayCaster.maxD < canvas.dimensions.maxR) {
if (config.radius !== undefined) {
config.radius = Math.min(config.radius, rayCaster.maxD);
} else {
config.radius = rayCaster.maxD;
}
config.radius = Math.min(config.radius ?? maxR, rayCaster.maxD);

if (config.radius >= maxR) {
delete config.radius;
}

return config;
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Hooks.once("setup", () => {
return;
}

if (tile._lighting && tile.mesh) {
if (tile._lighting && tile.mesh?.shader?.uniforms) {
tile.mesh.shader.uniforms.depthElevation = tile._lighting.depth;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/core/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Hooks.once("setup", () => {
}

const c = token.center;
const o = Number(token.document.getFlag("core", "occlusionRadius")) || null;
const o = Number(token.document.flags.core?.occlusionRadius) || null;
const m = Math.max(token.mesh.width, token.mesh.height);
const r = Number.isFinite(o) ? Math.max(m, token.getLightRadius(o)) : m;

Expand Down
10 changes: 9 additions & 1 deletion styles/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,13 @@ form .detection-modes.perfect-vision .detection-mode .perfect-vision--detection-
}

input[type="number"].perfect-vision--range::placeholder {
font-size: var(--font-size-18);
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: "Font Awesome 6 Pro";
font-weight: 900;
font-style: normal;
font-variant: normal;
line-height: 1;
text-rendering: auto;
font-size: var(--font-size-12);
}
5 changes: 3 additions & 2 deletions templates/vision-limitation-config.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class="units">({{gridUnits}})</span></label>
<div class="form-fields">
<input name="flags.perfect-vision.{{#if isToken}}light.{{/if}}visionLimitation.sight" type="number"
value="{{sightLimit}}" min="0" step="0.01" placeholder="&infin;" class="perfect-vision--range">
value="{{sightLimit}}" min="0" step="0.01" placeholder="&#xF534;" class="perfect-vision--range">
{{#if isDrawing}}
&nbsp;&nbsp;&nbsp;
<label class="checkbox perfect-vision--override">
Expand All @@ -43,7 +43,8 @@
<div class="detection-mode-id">{{label}}</div>
<div class="detection-mode-range">
<input name="flags.perfect-vision.{{#if ../isToken}}light.{{/if}}visionLimitation.detection.{{id}}"
type="number" value="{{limit}}" min="0" step="0.01" placeholder="&infin;" class="perfect-vision--range">
type="number" value="{{limit}}" min="0" step="0.01" placeholder="&#xF534;"
class="perfect-vision--range">
{{#if ../isDrawing}}
&nbsp;&nbsp;&nbsp;
<label class="checkbox perfect-vision--override">
Expand Down

0 comments on commit 76a757f

Please sign in to comment.