You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
931 B
36 lines
931 B
5 years ago
|
-- __ _ _______ _ __
|
||
|
-- / / /\ | | |__ __| | | \ \
|
||
|
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
|
||
|
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
|
||
|
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
|
||
|
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
|
||
|
|
||
|
Quantum.Dialogue = {}
|
||
|
|
||
|
Quantum.DialogueTbl = {}
|
||
|
|
||
|
function Quantum.Dialogue.Create( id, tbl )
|
||
|
local dialogue = {
|
||
|
bye = tbl.bye || "Nevermind, goodbye.",
|
||
|
options = tbl.options || {}
|
||
|
}
|
||
|
|
||
|
Quantum.DialogueTbl[id] = dialogue
|
||
|
return dialogue
|
||
|
end
|
||
|
|
||
|
function Quantum.Dialogue.AddQuestion( id, qid, q )
|
||
|
Quantum.DialogueTbl[id][qid] = {
|
||
|
question = q || "...",
|
||
|
response = {}
|
||
|
}
|
||
|
return qid
|
||
|
end
|
||
|
|
||
|
function Quantum.Dialogue.AddResponse( id, qid, tbl, order )
|
||
|
table.insert(Quantum.DialogueTbl[id][qid].response, order, {
|
||
|
text = tbl.text || "...",
|
||
|
func = tbl.func,
|
||
|
newqID = tbl.newqID
|
||
|
})
|
||
|
end
|