This commit is contained in:
remi 2022-05-04 23:11:16 +02:00
commit 5a3dceb422
11 changed files with 151 additions and 10 deletions

View File

@ -96,7 +96,7 @@ function convertToHeonian(text)
or string.sub(text,i,i) == "\t"
or string.sub(text,i,i) == "-" then -- check if its an unsupported symbol to skip it.
-- adjust i
if string.sub(text,i,i) == " " then
if string.sub(text,i,i) == " " then -- spaces are exception
transcribed_text = transcribed_text .. " "
new_syllable = true
end

View File

@ -1,5 +1,6 @@
require "R2H2"
function strip_symbols(str)
local symbol_table = "'~()!?:></.\t"
for i=1, #symbol_table do
@ -30,7 +31,32 @@ function apply_html(path)
print(html)
end
function convo_image(string,alt_text)
if string then
apply_html("html/convo/header/image/start.html")
print(string)
apply_html("html/convo/header/image/middle.html")
print(alt_text)
apply_html("html/convo/header/image/end.html")
end
end
function convo_header_start()
if not header then
header = true
apply_html("html/convo/header/start.html")
end
end
function convo_header_end()
if header then
header = false
apply_html("html/convo/header/end.html")
end
end
function convo_start(color)
convo_header_end()
if not convo then
if color then
apply_html("html/convo/start_green.html")
@ -42,6 +68,7 @@ function convo_start(color)
end
function convo_end()
convo_header_end()
if convo then
apply_html("html/convo/end.html")
convo = false
@ -61,20 +88,23 @@ local content = ""
local p = 0
local s = 0
local convo = false
local header = false
local green = true
local skip = 1
local user = {}
while p ~= nil do
s = s + 1
local np = string.find(text,"\n",p+1)
if np and p - np ~= 1 then
if p then
skip = 1
if string.sub(text,p+1,p+1) == "\n"
or string.sub(text,p+1,p+1) == "/" then
-- end of new bubble
convo_end()
elseif string.sub(text,p+1,p+1) == "\t" then
-- its tabbed so its spoken?
convo_start(
)
convo_start()
apply_html("html/convo/text/start_roman.html")
print(string.sub(text,p+2,np-1))
--content = content .. " " .. reverse_verbs(strip_symbols(string.sub(text,p+2,np-1)))
@ -84,6 +114,10 @@ while p ~= nil do
apply_html("html/convo/text/start_heonian.html")
print(convertToHeonian(string.sub(text,p+2,np-1)).."")
apply_html("html/convo/text/end.html")
elseif string.sub(text,p+1,p+1) == "i" then -- independant image, no username
convo_start(green)
convo_header_start()
convo_image(string.sub(text,p+3,np-1))
else
-- new user name
convo_end()
@ -93,14 +127,31 @@ while p ~= nil do
green = true
end
convo_start(green)
apply_html("html/convo/header/start.html")
-- this is a header section
convo_header_start()
-- lets check for images
local nl = string.find(text,"\n",p+1)
local nlp = string.find(text,"\n",nl+1)
current_user = string.sub(text,p+1,np-1)
user[current_user] = user[current_user] or {image = nil}
if nlp and string.sub(text,nl+1,nl+1) == "i" then
user[current_user].image = string.sub(text,nl+3,nlp-1)
skip = 2
end
convo_image(user[current_user].image)
apply_html("html/convo/header/name/start.html")
print(string.sub(text,p+1,np-1))
apply_html("html/convo/header/name/end.html")
apply_html("html/convo/header/end.html")
header = true
end
end
p = string.find(text,"\n",p+1)
while skip > 0 do
p = string.find(text,"\n",p+1)
skip = skip - 1
end
else
break
end

BIN
eshnyui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
eshnyui_blush.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

View File

@ -1 +0,0 @@
<p>

View File

@ -0,0 +1 @@
">

View File

@ -0,0 +1 @@
" alt="

View File

@ -0,0 +1 @@
<img src="

View File

@ -1,7 +1,9 @@
LU'NYA
i lunya.jpeg
nyan'pash! balfur yu e she polika'nya dre?
ESH'NYUI
i eshnyui.png
re chu meshu yu polika'nya
(po'nyash!!!)
@ -50,6 +52,7 @@ LU'NYA
balfur chu mya arilaen yu en ka'nya peekaka'nya fa'dre?
ESH'NYUI
i eshnyui_blush.png
yesh-balfur yu mishi'pash~
(>///////////////<)
relfur yu ari'laen parefaka'nya, balfur yu pareka'nya dra?

BIN
lunya.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -39,6 +39,11 @@
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -54,6 +59,11 @@ nyan'pash! balfur yu e she polika'nya dre?
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -75,6 +85,11 @@ re chu meshu yu polika'nya
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -96,6 +111,11 @@ aa, anko!
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -117,6 +137,11 @@ uwu
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -132,6 +157,11 @@ relfur chu mya pu yu mya relfur lup apatka'nya faka'nya'pash ponme mya wawote po
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -153,6 +183,11 @@ balfur yu e ton polika'nya dre?
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -180,6 +215,11 @@ balfurla yu dra?
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -201,6 +241,11 @@ relfur yu shi'ro'bae'pu yu pon'ya ka'nya~
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -216,6 +261,11 @@ puroton yu ponya ton ka'nya!
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -237,6 +287,11 @@ relfur yu meluton mimiku'pash~
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -258,6 +313,11 @@ be'nyui-babanlafura yu meluton naomiminku dre?
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -285,6 +345,11 @@ relfur yu ton mimiku'pash~
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -306,6 +371,11 @@ balfur chu mya arilaen yu en ka'nya peekaka'nya fa'dre?
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui_blush.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -333,6 +403,11 @@ relfur yu ari'laen parefaka'nya, balfur yu pareka'nya dra?
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>
@ -370,6 +445,11 @@ relfur chu arilaenlan luka'nya'pash.
<div class="convo-container right">
<div class="convo">
<div class="convo-header">
<img src="
eshnyui_blush.png
" alt="
nil
">
<span>
ESH'NYUI
</span>
@ -385,6 +465,11 @@ arilaenla shoo chu pikeshe fuka'nya'bash dra?
<div class="convo-container">
<div class="convo">
<div class="convo-header">
<img src="
lunya.jpeg
" alt="
nil
">
<span>
LU'NYA
</span>