
I have seen several posts on this forum about layers, I know there are also a lot older posts about it as well, but from what I have seen none of them offer any suggestions on HOW to do this. I am not saying we can offer much, because we can't look at roll20's code, all we can really offer is how the UI would look as well as a little pseudo code offering. I am also making the assumption, based on a Roll20 Roundtable Hour post (<a href="https://youtu.be/cRrxsfMYCW8?t=550" rel="nofollow">https://youtu.be/cRrxsfMYCW8?t=550</a>) that the roll20 team probably wont touch layers unless it is to implement a system of undefined custom layers. Currently layers use a button on the top left menu, this can work for the new system as well. Maybe replace the current icon, which changes based on what layer you are on, into a more universally applicable icon. Clicking this button would open a menu similar to now it works now, except the length of the menu would depend on how many layers you have. Each row of this menu would have a string of text and two check boxes. The text would be the name of the layer, be it "GM," "Object," or "Map" by default or a custom string. The two check boxes represent whether the layer is visible to the GM and to the Player. Visible to player is fairly obvious, the GM layer is and needs to be invisible to players. But the button to hide from GM would be appreciated as well, hide on the map that is, it should still be visible on the layer list. I feel like this would be valuable for two main reasons. First, weather effects like fog (or hopefully rain once gifs hit live) are great for setting ambiance for the players but all they serve for the GM is to obscure the map and further clutter the screen for him/her. Second, being able to temporarily hide an entire layer without having to mess with "send to back" and such would be super helpful. In order to add or remove layers you could use the right click menu like is seen on the entire right panel of the UI. Picture for reference: Onto the code where I pretend I know what I am talking about. As it stands I am assuming the layers are referenced in the code as something along the lines of layer1, layer2, and layer3. The naming doesn't matter but the point is, each variable is probably pointing to a separate layer object. Instead maybe have an array, or whatever you can get away with that's not fixed length. The hotkeys, instead of taking you straight to a layer, would have to merely shift you up and down. The biggest problem, I assume, would be getting your database to store this new system without completely breaking everything. Existing maps could theoretically converted without much issue by just adding the current layers to spots 0, 1, and 2 of the new array. If anyone has a better idea of how roll20's code might work please offer your own suggestions below, I only know Java and C++ and I doubt roll20 is coded in either of those, hence the vagueness instead of any language specifics. Also I personally haven't worked with websites so I don't know if object oriented programming would be used or not. Also, if someone has a better idea how to handle the map's grid on a variable system, I would love to hear that. Please, the more opinions the better.