CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.29k stars 4.12k forks source link

Allow entry of unicode characters into overmap notes #37309

Open damien opened 4 years ago

damien commented 4 years ago

Is your feature request related to a problem? Please describe.
It would be nice to specify more distinct characters or glyphs into user defined notes in the overmap UI.

Describe the solution you'd like
The ability to directly enter unicode sequences into the overmap notes UI, either by escape sequence (e.g. \u2693, which is ) or direct keyboard input.

Describe alternatives you've considered
Graphical Overmap mod helps here, but doesn't really allow users to define their own overmap glyphs to the extent that is possible via JSON terrain entries.

Additional context
I'm also wondering how hard it would be to allow users to define background/inverted colors for overmap note entries as well. May open up a separate issue for that and try my hand at contributing if these features don't seem like a terrible idea to you all.

ZhilkinSerg commented 4 years ago

You can enter Unicode characters using ALT+numeric keyboard.

image

It depends on the font used which symbols would be available for you.

damien commented 4 years ago

Hey @ZhilkinSerg!

This is totally doable, but I've had a couple difficulties with that particular input method:

  1. I believe this is an input method specific to Windows. If you're on another OS (Linux/macOS), I'm unaware of ways to enter non-ASCII chars that don't appear on a user's keyboard.
  2. While that is a way to input non-ASCII characters on Windows, it's based off of Code page 437 (a very old IBM/DOS charset) or, for charachters with a single leading 0, Windows-1252 , which is another single-byte char encoding. While some of these characters also exist in Unicode, they exist under different code points.
  3. The Windows input method doesn't allow me to use the more fun Unicode chars like (U+262D), (U+2622), or (U+2620).

I'm am happy to hear that I do have more options than I previously thought with the Windows code points you turned me on to with your reply @ZhilkinSerg , but I'd be tickled pink with the ability to mark radioactive areas on my map with :)

EDIT: References:

damien commented 4 years ago

PS: There is a lot of interesting history behind Windows ALT codes. TIL. :joy:

anothersimulacrum commented 4 years ago

I think https://github.com/CleverRaven/Cataclysm-DDA/issues/37301#issuecomment-578329518 was aimed here.

BevapDin commented 4 years ago

get_note_symbol (in "src/overmap_ui.cpp") only extracts a single char from the note to be used as symbol. The game will therefor not show UTF-8 sequences that are encoded with several bytes. This would need to be changed to return arbitrary strings containing a single effective character.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.