-
Notifications
You must be signed in to change notification settings - Fork 0
historybox_EN
windows99-hue edited this page Jul 20, 2026
·
1 revision
[img]
In the end, I decided to create a history box with a DDLC menu style.
dokibox.historybox()| Parameter | Type | Default | Description |
|---|---|---|---|
data |
None, str, or other types |
"" |
A string to be parsed as history records. In most cases, it is automatically passed from dialogbox or diaenterbox. |
pinned |
bool |
True |
Whether the history box is pinned to the top. |
historybox is generally not called directly by users. It is most commonly used internally by dialogbox or diaenterbox.
-
datais an empty string or not provided: Imports the history list fromdokibox.dialogbox._history. -
datais a string: Creates a single history record as[("", data)], where the first element is an empty string (indicating no sender name, i.e. narration) and the second element is the message content. -
datais any other type: Uses it directly asrecords. The expected format is a list or tuple of(name, message)pairs.
Example of the third case:
records = [
("Monika", "Welcome to the Literature Club!"),
("Sayori", "The weather is so nice today!"),
("Yuri", "I'm reading a very interesting book..."),
("Natsuki", "Baka! It's not like I'm a tsundere or anything!"),
]
dokibox.historybox(records)Since dokibox is a GUI library, dialogue history currently exists only in memory.
addhistory() is used to preload existing dialogue history into memory, allowing previously recorded conversations to appear in the history box.
A list of tuples:
dokibox.addhistory([
("Monika", "Hello"),
("Sayori", "Hi there!")
])A list of dictionaries:
dokibox.addhistory([
{"name": "Yuri", "msg": "Hello, everyone!"}
])A JSON string:
import json
dokibox.addhistory(
json.dumps(
[{"name": "Natsuki", "msg": "Hmph!"}],
ensure_ascii=False
)
)- Installation
- ynbox
- msgbox
- choicebox
- dialogbox
- diaenterbox
- enterbox
- textbox
- cmdbox
- notice
- garbled
- A save example
- Finally
- 安装
- ynbox
- msgbox
- choicebox
- dialogbox
- diaenterbox
- enterbox
- textbox
- cmdbox
- notice
- garbled
- 一个运用保存和加载的示例
- 在最后
Just Monika. 💚