pokete icon indicating copy to clipboard operation
pokete copied to clipboard

275 improve roadmap (DO NOT MERGE YET)

Open JanekKermit opened this issue 1 year ago • 3 comments

#275 Changelog:

  1. Most important changes to /pokete_classes/roadmap.py
  • enlarged displayed roadmap (61x17 instead of 40x11)
  • added new StationObject class (extension of se.Box)
  • class Station is now an extension of StationObject, not se.Square
  • added map decorations (they are like stations, but do not require full-scale map and it's impossible to get to them with WSAD). They are stored in a variable 'decorations' in /pokete_data/mapstations.py
  • changed method set_color() to hide_if_visited(), the new one hides features like villages, Shops etc if the place has not been visited.
  • added animations for water and cursor (now the indicator of the place where you are blinks making it more visible) [methods StationObject.animate_water() and Station.animate_blink()]
  1. Added new more detailed roadmap layout, stations colors, decorations at /pokete_data/mapstations.py
  2. Changed /pokete_classes/color.py to use 256 color palette (old system caused weird colors in some terminals, like one built-in VS Code)

Preview:

obraz

JanekKermit avatar May 07 '24 18:05 JanekKermit

Changed /pokete_classes/color.py to use 256 color palette (old system caused weird colors in some terminals, like one built-in VS Code)

I wouldn't do that, I chose the smaller color pallet, since it will also be displayed on fullscreen tty

lxgr-linux avatar May 08 '24 14:05 lxgr-linux

PXL_20240508_145533190.MP.jpg

Character wise, this is how the roadmap looks like on TTY, but the colors seam to work.

lxgr-linux avatar May 08 '24 14:05 lxgr-linux

Alright, i think i know what the problem is. I'll install TTY and work on that

JanekKermit avatar May 08 '24 15:05 JanekKermit

@JanekKermit Hey, so I did some formatting, added the periodic event manager to the roadmap and changed the blink animation to not use a thread. Also I would suggest deriving StationObject not from se.Box, but rather from se.Text, this might be better suited for this usecase and therefore the height end width attributes can be removed in mapstations.py. Also se.Text brings buildins for recoloring and other operations. I would also rather have color names than raw escapecodes in the mapstations.py, that's what the Color class is for, also the tty color switching could be made global, since it's a global thing to happen to all colors. Also non city stations should be grayed out again when using teleport.

But so far I really like the new roadmap.

lxgr-linux avatar Jun 13 '24 23:06 lxgr-linux

Hi, thanks for reformating. I tried using se.Test, but i couldn't make it work, if i remember correctly, there was some weird issues with engine interpreting station width incorrectly and destroying the roadmap window. Anyway, I will try to implement it via se.Text again and report if I encounter any errors. When it comes to colors I wanted to use broad color palette, that's why i used raw escape codes, but if you like Color class, I will use it.

JanekKermit avatar Jun 14 '24 09:06 JanekKermit

Hmm, maybe you where setting the colors directly in the text rather than using the esccode attribute so set color. This is a common cause for such behaviour.

lxgr-linux avatar Jun 14 '24 11:06 lxgr-linux

@JanekKermit I refactored the code a bit to make it mergable and changed the Station inheritance

lxgr-linux avatar Jun 17 '24 15:06 lxgr-linux

Thanks again for reformating and sorry for so many mistakes. Only thing I would like to point out is that you deleted is_cave() resulting in setting 3 out of 4 cave stations color to white on the teleportation map. Is this intentional?

JanekKermit avatar Jun 17 '24 17:06 JanekKermit

Nor problem, I really liked, what you did and wanted it merged. And yes that was intentional, i thought it would then be clearer, where the map is.

lxgr-linux avatar Jun 17 '24 20:06 lxgr-linux