EncEntry¶
-
class encyclopaedia.EncEntry(parent: Encyclopaedia | EncEntry | Book | None =
None
, number: int | None =None
, name: str =''
, text: str | list[str] =''
, subject: str =''
, viewed: bool =False
, viewed_persistent: bool | None =False
, locked: bool =False
, locked_persistent: bool | None =False
, image: str | None =None
, locked_name: str ='???'
, locked_text: str ='???'
, locked_image: str | None =None
, locked_image_tint: tuple[float, float, float] =(0.0, 0.0, 0.0)
)[source]¶ Bases:
EventEmitter
,object
Store an Entry’s content.
EncEntry instances should be added to an Encyclopaedia or another EncEntry.
- Parameters:¶
- parent: Encyclopaedia | EncEntry | Book | None =
None
¶ The parent container for the EncEntry.
- number: int | None =
None
¶ The entry’s number. If this is not set then it will be given a number automatically.
- name: str =
''
¶ Title, normally used for buttons and headings.
- text: str | list[str] =
''
¶ The text to be displayed when the entry is viewed.
- subject: str =
''
¶ The subject to associate the entry with. Used for sorting and filtering.
- viewed: bool =
False
¶ Set the viewed status of the EncEntry. Default is False. Only use if the Encyclopaedia is save-game independent.
- viewed_persistent: bool | None =
False
¶ Use persistent data for recording viewed status.
- locked: bool =
False
¶ The initial locked status of the EncEntry. Default is False.
- locked_persistent: bool | None =
False
¶ Use persistent data for recording locked status.
- image: str | None =
None
¶ The image displayed with the Entry text. Default is None.
- locked_name: str =
'???'
¶ Placeholder text for the name. Shown when the entry is locked.
- locked_text: str =
'???'
¶ Placeholder text for the text. Shown when the entry is locked.
- locked_image: str | None =
None
¶ Placeholder image for the image. Shown when the entry is locked.
- locked_image_tint: tuple[float, float, float] =
(0.0, 0.0, 0.0)
¶ If no specific locked image is provided, a tinted version of the image will be used. The amount of tinting can be set with RGB values in a tuple.
- parent: Encyclopaedia | EncEntry | Book | None =
- has_image¶
True if an image was provided, else False.
- pages¶
List of all the pages this entry contains.
- add_entry(entry: EncEntry) bool [source]¶
Add multiple pages to the entry in the form of sub-entries.
- property current_page : EncEntry¶
Get the sub-page currently viewing viewed.
Setting this attribute should be done using an integer.
- property image : str¶
The image for the entry. Return placeholder when entry is locked.
- property locked : bool¶
Determine if the entry’s data can be viewed or not.
Changing this variable will modify the entry’s locked status.
- property name : str¶
The name for the entry. Return placeholder when entry is locked.
- property text : list[str]¶
The text for the entry. Return placeholder when entry is locked.
- property viewed : bool¶
Determine if the entry has been viewed or not.
Changing this variable will modify the entry’s viewed status.