Add images to the beginnning of rooms

This commit is contained in:
Howard Abrams 2025-08-17 13:09:59 -07:00
parent cef7bab8a2
commit 303c78f3be
2 changed files with 15 additions and 1 deletions

View file

@ -83,6 +83,13 @@ class Room(ObjectParent, ExtendedRoom, ContribRPRoom, Listener):
self.get_time_of_day(), self.get_season())
def get_display_header(self, looker, **kwargs):
"""
Possibly send an image to webclients.
"""
image = self.db.title_image
if image:
looker.msg(image=(f"https://www.howardabrams.com/cozy-players-guide/{image}",
{"type": "background-pane"}))
return "|n"
def get_display_footer(self, looker, **kwargs):

View file

@ -8,6 +8,7 @@ from evennia import (
CmdSet,
TICKER_HANDLER,
)
from evennia.utils import delay
from evennia.prototypes.spawner import spawn
from typeclasses.npcs import CarriableNPC
@ -158,7 +159,6 @@ class TutorBird(CarriableNPC):
"""
Spawn the bird and attach it to character.
"""
bird = spawn({
"typeclass": "typeclasses.tutorial.TutorBird",
"key": "bird",
@ -166,6 +166,13 @@ class TutorBird(CarriableNPC):
"desc": "Gray feathered bird perched on your shoulder. It's large black eyes looks at you quizically. Its yellow cheeks are adorable, making it seem overly helpful.",
})[0]
bird.location = character
delay(1, bird.display_image)
def display_image(self):
"""
Displays an image for the tutorial for the webclient.
"""
self.location.msg(image=("https://www.howardabrams.com/cozy-players-guide/bubba.jpg"))
def do_speak(self):
"""