text entry speed being affected by word length actually feels bad
This commit is contained in:
parent
356ef82817
commit
5a3ee678db
36
vacation.p8
36
vacation.p8
@ -656,9 +656,9 @@ def_15_fade = split"0,0,128,129,133,141,13,13,6,6,15,15,7"
|
|||||||
def_13_fade = split"0,0,0,0,0,128,129,133,141,140,140,13,12"
|
def_13_fade = split"0,0,0,0,0,128,129,133,141,140,140,13,12"
|
||||||
def_shd_fade = split"0,0,0,128,130,141,2"
|
def_shd_fade = split"0,0,0,128,130,141,2"
|
||||||
|
|
||||||
-- frames per character to wait
|
-- frames between words during
|
||||||
-- during zonk text display.
|
-- zonk txt
|
||||||
fchr=2
|
fbw=8
|
||||||
|
|
||||||
zonk_mode = {
|
zonk_mode = {
|
||||||
files={},
|
files={},
|
||||||
@ -763,25 +763,24 @@ end
|
|||||||
function zonk_mode:next_item()
|
function zonk_mode:next_item()
|
||||||
if not self.line then
|
if not self.line then
|
||||||
if (not self.file or #self.file == 0) return
|
if (not self.file or #self.file == 0) return
|
||||||
|
local line = deli(self.file, 1)
|
||||||
if self.expect_cfg_line then
|
if self.expect_cfg_line then
|
||||||
self.expect_cfg_line = false
|
self.expect_cfg_line = false
|
||||||
local cfg_line = deli(self.file, 1)
|
for i,cmd in ipairs(split(line, " ")) do
|
||||||
for i,cmd in ipairs(split(cfg_line, " ")) do
|
|
||||||
if #cmd > 0 then
|
if #cmd > 0 then
|
||||||
local frags = split(cmd,":")
|
local frags = split(cmd,":")
|
||||||
assert(type(self[frags[1]])=="function", tostr(i).." - "..cfg_line)
|
assert(type(self[frags[1]])=="function", tostr(i).." - "..line)
|
||||||
self[frags[1]](self, unpack(frags))
|
self[frags[1]](self, unpack(frags))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return self:next_item()
|
return self:next_item()
|
||||||
end
|
end
|
||||||
local line = deli(self.file, 1)
|
|
||||||
if line == "-----" then
|
if line == "-----" then
|
||||||
self.line = nil
|
self.line = nil
|
||||||
self.expect_cfg_line = true
|
self.expect_cfg_line = true
|
||||||
self.cx,self.cy = 0,0
|
self.cx = 0
|
||||||
self.cy = 0
|
self.cy = 0
|
||||||
return 0, nil
|
return nil
|
||||||
end
|
end
|
||||||
self.line = split(line, " ")
|
self.line = split(line, " ")
|
||||||
end
|
end
|
||||||
@ -800,13 +799,11 @@ function zonk_mode:next_item()
|
|||||||
end
|
end
|
||||||
local pp,cmult=nrm_txt_pal,1
|
local pp,cmult=nrm_txt_pal,1
|
||||||
if (token[1]==">") token,self.cx=sub(token,2),self.cx+self.spc_full\2
|
if (token[1]==">") token,self.cx=sub(token,2),self.cx+self.spc_full\2
|
||||||
if (token[1]=="$") token,cmult=sub(token,2),2
|
|
||||||
if (token[1]=="^") token,cmult=sub(token,2),0.5
|
|
||||||
if (token[1]=="!") token,pp=sub(token,2),sfd_txt_pal
|
if (token[1]=="!") token,pp=sub(token,2),sfd_txt_pal
|
||||||
if (token[1]=="#") token,pp=sub(token,2),hlt_txt_pal
|
if (token[1]=="#") token,pp=sub(token,2),hlt_txt_pal
|
||||||
local ret = zonk_txt(token,self.cx,self.cy,pp,self.txmd,self.txf,self.txd*cmult)
|
local ret = zonk_txt(token,self.cx,self.cy,pp,self.txmd,self.txf,self.txd*cmult)
|
||||||
self.cx = ret.eff_w+self.spc_full
|
self.cx = ret.eff_w+self.spc_full
|
||||||
return #token,ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
function zonk_mode:empty()
|
function zonk_mode:empty()
|
||||||
@ -823,19 +820,13 @@ function zonk_mode:update()
|
|||||||
if self.playing_text then
|
if self.playing_text then
|
||||||
self.twt -= 1
|
self.twt -= 1
|
||||||
if self.twt <= 0 then
|
if self.twt <= 0 then
|
||||||
local cn,item = self:next_item()
|
local item = self:next_item()
|
||||||
if not cn then
|
if not item then
|
||||||
self:next_file()
|
if (not self.file or #self.file == 0) self:next_file()
|
||||||
self.playing_text=false
|
self.playing_text=false
|
||||||
elseif cn < 0 then
|
|
||||||
self.twt = -cn
|
|
||||||
else
|
else
|
||||||
self.twt = cn*fchr*self.cmul
|
|
||||||
end
|
|
||||||
if item then
|
|
||||||
self.txt_frame:push(item)
|
self.txt_frame:push(item)
|
||||||
else
|
self.twt = fbw*self.cmul
|
||||||
self.playing_text=false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1796,6 +1787,7 @@ sunset_pal=split"12,13,14,8,137,9,10,129,1,130,2,140,5,6,7"
|
|||||||
|
|
||||||
function ggwp:draw()
|
function ggwp:draw()
|
||||||
pal()
|
pal()
|
||||||
|
camera()
|
||||||
clear_alt_pal_bits()
|
clear_alt_pal_bits()
|
||||||
pal(sunset_pal,1)
|
pal(sunset_pal,1)
|
||||||
for i=0,5 do
|
for i=0,5 do
|
||||||
|
Loading…
Reference in New Issue
Block a user