Switched to a new font, properly
This commit is contained in:
parent
087aa580a4
commit
e055ea1f5d
@ -53,11 +53,7 @@ exit $lint_errors
|
||||
|
||||
heapq is a thing for the speed sorting
|
||||
|
||||
## Font File Credits and links
|
||||
|
||||
https://ggbot.itch.io/public-pixel-font
|
||||
https://2bitcrook.itch.io/44-game-boy-fonts
|
||||
https://arcade.itch.io/1980
|
||||
https://speakthesky.itch.io/typeface-angel-sealing-glyphs
|
||||
## Credits and links
|
||||
|
||||
Font: https://2bitcrook.itch.io/44-game-boy-fonts
|
||||
|
||||
|
BIN
assets/16 Bit Dreams Mono.ttf
Normal file
BIN
assets/16 Bit Dreams Mono.ttf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 8.2 KiB |
@ -82,19 +82,13 @@ class MeleeAction(BaseAction):
|
||||
#calculate message output
|
||||
engine: Engine = self.entity.floor_map.engine
|
||||
msg_text = f"{self.entity.name} attacked {target.name}"
|
||||
msg_color = colors.white
|
||||
|
||||
if self.entity is engine.player:
|
||||
msg_color = colors.white
|
||||
else:
|
||||
msg_color = colors.white
|
||||
|
||||
if damage > 0:
|
||||
msg_text += f" for {damage} damage"
|
||||
else:
|
||||
msg_text += f" but was ineffective"
|
||||
|
||||
engine.message_log.add_message(text = msg_text, color=msg_color)
|
||||
engine.message_log.add_message(text = msg_text)
|
||||
|
||||
#actually applying the change here, so the player's death event is at the bottom of the message log
|
||||
target.stats.current_hp -= damage
|
||||
|
@ -3,6 +3,7 @@ from typing import Optional, TYPE_CHECKING
|
||||
|
||||
import tcod
|
||||
|
||||
import colors
|
||||
from actions import BaseAction, QuitAction, BumpAction, WaitAction
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@ -146,14 +147,22 @@ class LogHistoryViewer(EventHandler):
|
||||
log_console = tcod.console.Console(console.width - 6, console.height - 6)
|
||||
|
||||
#rendering a nice log window
|
||||
log_console.draw_frame(0, 0, log_console.width, log_console.height)
|
||||
log_console.draw_frame(
|
||||
0,0, log_console.width, log_console.height,
|
||||
# "╔═╗║ ║╚═╝"
|
||||
decoration="\\x/x x/x\\",
|
||||
fg=colors.terminal_dark, bg=colors.black
|
||||
)
|
||||
log_console.print_box(
|
||||
0, 0, log_console.width, 1, "Message History", alignment=tcod.constants.CENTER
|
||||
0, 0, log_console.width, log_console.height,
|
||||
string = "Message History",
|
||||
alignment=tcod.constants.CENTER,
|
||||
fg=colors.terminal_light, bg=colors.black
|
||||
)
|
||||
self.engine.message_log.render_messages(
|
||||
log_console,
|
||||
1, 1,
|
||||
log_console.width - 2, log_console.height - 2,
|
||||
2, 2,
|
||||
log_console.width - 4, log_console.height - 4,
|
||||
self.engine.message_log.messages[:self.cursor + 1]
|
||||
)
|
||||
log_console.blit(console, 3, 3) #into the middle
|
||||
|
@ -8,8 +8,7 @@ import colors
|
||||
|
||||
def main() -> None:
|
||||
#screen dimensions depend partially on the tileset
|
||||
tileset = tcod.tileset.load_truetype_font("assets/PublicPixel.ttf", 16, 16)
|
||||
#TODO: see if there's a nicer tilesheet
|
||||
tileset = tcod.tileset.load_truetype_font("assets/16 Bit Dreams Mono.ttf", 16, 16)
|
||||
|
||||
#how big is the map's dimensions
|
||||
map_width = 80
|
||||
@ -35,9 +34,10 @@ def main() -> None:
|
||||
ui_height = ui_height,
|
||||
|
||||
initial_log= [
|
||||
Message(" Movement: Numpad", colors.terminal_light),
|
||||
Message(" See Log: Backtick", colors.terminal_light),
|
||||
Message(" Quit: Esc", colors.terminal_light),
|
||||
Message(" Move/Attack: Numpad", colors.terminal_dark),
|
||||
Message(" See Log: Backtick", colors.terminal_dark),
|
||||
Message(" Quit: Esc", colors.terminal_dark),
|
||||
Message(" ~ ~ ~", colors.terminal_dark),
|
||||
Message("Welcome to the Cave of Gobbos!", colors.cyan),
|
||||
]
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ class MessageLog:
|
||||
def __init__(self):
|
||||
self.messages: List[Message] = []
|
||||
|
||||
def add_message(self, text: str, color: Tuple[int, int, int] = colors.white, *, stack: bool = True) -> None:
|
||||
def add_message(self, text: str, color: Tuple[int, int, int] = colors.terminal_light, *, stack: bool = True) -> None:
|
||||
if stack and self.messages and text == self.messages[-1].raw_text:
|
||||
self.messages[-1].count += 1
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user