Skip to content

Conversation

@markfickett
Copy link
Contributor

@markfickett markfickett commented Nov 16, 2016

I'm using TMCMR to figure out which region files to delete from our map so we can re-explore nearby territory and find new stuff from the 1.11 update (llamas, woodland mansions). It's very useful, since the images match the region files, but I added a little javascript so you can click to toggle regions, and get a list of the region IDs.

Demo: http://www.markfickett.com/tmp/tmcmr/tiles.1-8.html#r.-7.-3 then click on some tiles. You can also copy/paste the list of regions (if you paste in a new list it updates the highlighted tiles).

I know this is addressing my specific use case; so here it is in case it's useful, but no worries if it isn't something you want to add to your map generator.

This builds on my other pull request. (They should merge cleanly. Since the other one is so small I'm not worrying about splitting it out more separately; I'm not sure if there's a cleaner way to set this up on Github.)


This change is Reviewable

Copy link
Owner

@TOGoS TOGoS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard would it be to do the selecting without jQuery? (I'm sort of against introducing a big external dependency to what is otherwise a pretty simple page.)

@markfickett
Copy link
Contributor Author

Makes sense about keeping it simple.

There are a few things I'm using jQuery for:

  • Select elements using CSS style selection: document.querySelector is supported in all major browsers and would work instead.
  • Add/remove a CSS class (toggleClass): Not too hard to replace, but I don't know a predefined replacement.
  • Get/set text content: innerText should work fine.
  • Event handling (selection.on('input', handler)): I think the native addEventHandler should work; I think I'd need to loop over all elements in the document, or try to handle events at a higher level and find their targets.

So, doable, but a fair number of little changes. Since I've finished doing what I needed to with TMCMR I may not go to the trouble unless you'd really like to have region selection listing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants