manuelVo / foundryvtt-drag-ruler

A Foundry VTT module that shows a ruler when dragging tokens so you can see how far you've dragged them
MIT License
39 stars 50 forks source link

printfmt for ruler label #290

Closed n0q closed 1 year ago

n0q commented 1 year ago

The label printed next to the cursor while dragging is using a static, canned format right now. Quite a few systems might wish to provide more information than what is presently available, here.

Let's propose the following format rules:

%d: Length of ray. %D: Sum length of all rays. %u: Unit label.

The standard drag ruler label could then be described by %d %u [%D %u].

Rather than have a canned print format, I'd love to see a printfmt class which contains a number of definitions (speed category name, speed category color, and so on). A provider could override this class to add new, system specific definitions (typically game mechanics based on the proposed token movement), and could then specify a custom printfmt via the API. I feel this would add a great deal of flexibility to the module and make it even more useful to players.

manuelVo commented 1 year ago

That's an interesting suggestion. Though I wonder if it wouldn't be better to just modify the Labels for Foundry VTTs native Ruler and then have Drag Ruler inherit that modification. That way, a module could update both the native ruler and Drag Ruler at the same time.

Do you have any specific feature in mind, that you'd like this API for? If so, is there any reason to not have the native Foundry Ruler be modded as well?

n0q commented 1 year ago

You know, I honestly didn't realize that's where it came from in the first place. Yes, it would be easier to do it without DR. My bad!