Feature: views#130
Draft
redweller wants to merge 5 commits into
Draft
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
TheGiddyLimit
requested changes
Sep 11, 2022
| const model = o.model; | ||
| if (!model) continue; | ||
| if (`${model.get(query)}`.search(val) > -1) { | ||
| const l = model.attributes.layer; |
Owner
There was a problem hiding this comment.
prefer e.g. const {layer} = model.attributes to randomly one-letter-renaming vars
| $barPage.find(`.handle`).click() | ||
| } | ||
|
|
||
| function doShowDialog (page) { |
Owner
There was a problem hiding this comment.
things are getting a bit nested here; consider pulling out as d20plus.views._doShowDialog
| ]; | ||
| props.forEach(handleProp); | ||
|
|
||
| function doSaveValues () { |
Owner
There was a problem hiding this comment.
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`)) { |
Owner
There was a problem hiding this comment.
consider inverting this condition to early-"exit"/reduce nesting;
if (id && !page.get(`bR20cfg_views${id}Enable`)) continue;
const viewname = ...
| <hr> | ||
| <div> | ||
| <div class='pagedetails__header'> | ||
| <h3 class='page_title'>Weather</h3> |
Owner
There was a problem hiding this comment.
indentation's a bit all over the place here; switch it all out for tabs, would you?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How to use this feature: