-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: views #130
base: development
Are you sure you want to change the base?
Feature: views #130
Conversation
1. Enable and rename views for your map in the Views dialog (next to Weather settings button) 2. Assign images or paths to your views via the context menu 3. Group of switches in the bottom of layer selection menu on the floating toolbar will allow you to quickly hide or show the items you assigned
To avoid weird selection behavior
To completely hide items, including light sources & nameplates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookin cool
const model = o.model; | ||
if (!model) continue; | ||
if (`${model.get(query)}`.search(val) > -1) { | ||
const l = model.attributes.layer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer e.g. const {layer} = model.attributes
to randomly one-letter-renaming vars
$barPage.find(`.handle`).click() | ||
} | ||
|
||
function doShowDialog (page) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
things are getting a bit nested here; consider pulling out as d20plus.views._doShowDialog
]; | ||
props.forEach(handleProp); | ||
|
||
function doSaveValues () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer arrow functions const doSaveValues = () => { ... }
to avoid clobbering this
(and save a few characters!)
let menuhtml = ""; | ||
if (page.get("bR20cfg_viewsEnable")) { | ||
for (let id = 0; id <= 4; id++) { | ||
if (!id || page.get(`bR20cfg_views${id}Enable`)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider inverting this condition to early-"exit"/reduce nesting;
if (id && !page.get(`bR20cfg_views${id}Enable`)) continue;
const viewname = ...
@@ -379,10 +379,13 @@ Updated | |||
<hr> | |||
<div> | |||
<div class='pagedetails__header'> | |||
<h3 class='page_title'>Weather</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation's a bit all over the place here; switch it all out for tabs, would you?
How to use this feature: