Tile colors can be overwritten
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
from enum import Enum, auto
|
||||
from math import sqrt
|
||||
from random import choice, randint
|
||||
from typing import List, Optional, Any
|
||||
from typing import List, Optional, Any, Tuple
|
||||
|
||||
from .display.texturepack import TexturePack
|
||||
from .translations import gettext as _
|
||||
@ -218,7 +218,19 @@ class Tile(Enum):
|
||||
Translates a Tile to the corresponding character according
|
||||
to the texture pack
|
||||
"""
|
||||
return getattr(pack, self.name)
|
||||
val = getattr(pack, self.name)
|
||||
if isinstance(val, tuple):
|
||||
return val[0]
|
||||
return val
|
||||
|
||||
def color(self, pack: TexturePack) -> Tuple[int, int]:
|
||||
"""
|
||||
Retrieve the tuple (fg_color, bg_color) of the current Tile.
|
||||
"""
|
||||
val = getattr(pack, self.name)
|
||||
if isinstance(val, tuple):
|
||||
return val[1], val[2]
|
||||
return pack.tile_fg_color, pack.tile_bg_color
|
||||
|
||||
def is_wall(self) -> bool:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user