Skip to content

Commit

Permalink
Fixed broken characters and colors on TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
JanekKermit committed Jun 13, 2024
1 parent 00a348f commit 1cb8210
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 72 deletions.
14 changes: 9 additions & 5 deletions pokete_classes/roadmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time
import threading
import random
from os import environ
from pokete_general_use_fns import liner
from .hotkeys import ACTION_DIRECTIONS, Action, ActionList, get_action
from .loops import std_loop, easy_exit_loop
Expand All @@ -32,8 +33,8 @@ def __init__(self, text, width, height, ob_class=se.Object):
self.text = text
self.ob_args = {}
self.__create()
if self.desc == "_LAKE":
threading.Thread(target = self.animate_water, daemon = True).start()
#if self.desc == "_LAKE":
#threading.Thread(target = self.animate_water, daemon = True).start()

def __create(self):
for ry in range(self.height):
Expand Down Expand Up @@ -82,13 +83,16 @@ class Station(StationObject):
choosen = None
obs = []

def __init__(self, roadmap, associate, additionals, width, height, desc, color="",
def __init__(self, roadmap, associate, additionals, width, height, desc, color="", colorTTY="",
text="#", w_next="", a_next="", s_next="", d_next=""):
self.desc = desc
self.roadmap = roadmap
self.org_char = text
self.associates = [associate] + [obmp.ob_maps[i] for i in additionals]
self.color = color
if colorTTY!="" and environ['TERM']=="linux":
self.color = colorTTY
else:
self.color = color
if self.associates[0]:
self.name = self.associates[0].pretty_name
super().__init__(text, width, height)
Expand Down Expand Up @@ -149,7 +153,7 @@ def is_city(self):
def hide_if_visited(self, choose=False):
"""Marks a station as visited"""
if self.associates[0] is not None and not self.has_been_visited():
features = ["A", "P", "$", "C", "⌂"]
features = ["A", "P", "$", "C", "⌂", "#"]
for ch in features:
self.text=self.text.replace(ch, " ")

Expand Down
Loading

0 comments on commit 1cb8210

Please sign in to comment.