-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Added RouteOpisometer and related changes. #606
Conversation
Hello and thank you for the contribution! It's definitely a viable solution. I have added a few minor things to fix (if you don't have time, I can fix on my own). I also believe there should be a validation that added cell is unique, so I got the idea of measuring routes. But you cannot follow the exact route this way, so I don't see a real reason to limit user for using only cells with some route. It just confuse users. Can we turn it the way to use any cell? |
Sure, I can implement a set of cells to eliminate repeats. I'm not sure what you mean about not following the exact route. When I was testing it the line was extremely close (with some wobble for curves). |
I believe that there is no a lot of sense to stick to routes. It can be both ways, shift to stick or shift to not stick. |
The idea is that I used this generator to make a world map for my tabletop RPG and measuring the routes allows me to figure out travel time for my adventurers. I didn't change the old opisometer, I just added a second one. The old one can measure anything and this one measures manufactured routes. That's what I was thinking. Tomorrow I'll add the extra features to my code. |
…ts. Also allow holding shift to go off-road while drawing it.
Done. Got the cellStops changed to act like a set (still an array for indexing reasons) and added holding shift to go off-road. |
Thanks, would you please also check the review comments? There are a few minor issue and class should be refactored |
Where are review comments? I do not see them. On top of this page it says "Reviewers No reviews." Did you publish the review? |
class RouteOpisometer extends Measurer { | ||
constructor(points) { | ||
super(points); | ||
if (pack.cells) { |
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.
Not sure, in what cases pack.cells
is false?
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.
This is to fix an error when loading a map. If you make a map, draw a RouteOpisometer, save to storage, set options to load last saved map, and reload the page, pack.cells is not defined at the time when rulers are recreated. I found that error while testing to make sure that it loaded properly again.
Ok, that was on my side, thanks for checking. |
Reverted icons.css to master Removed index.html/icon-route class and modified size for SVG icon on button Refactored RouteOpisometer.trackCell so that duplicate code is pulled outside of if blocks
… temperature display. I put it back.
I addressed all the review comments. Thank you for your patience while I worked through this. |
thanks for the edits, I will check and merge it soon |
Looks good, thanks for the new feature! |
Announced the change on Reddit and Discord so that people know new functional is there. |
This new tool lets you draw an opisometer that always sticks to cells that have routes and you can drag it backward to "undo" that part of the route. It works on main roads, trails, and sea routes.
Changes:
Adds RouteOpisometer class based on Opisometer
Adds button to Units dialog to draw new route opisometer
Adds SVG symbol "icon-route" for the button
Adds commented out CSS icon entry for if FontAwesome is updated in the future
I am not very familiar with web development and I strongly dislike JavaScript but I did my best to match your existing code style.
Closes #605