Skip to content
Snippets Groups Projects
Commit 7cfee095 authored by dg's avatar dg
Browse files

Reading lore does not randomly turn the fotn italic or bold

git-svn-id: http://svn.net-core.org/repos/t-engine4@2085 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4ebb9b4e
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,7 @@ function _M:display()
-- Erase and the display
self.dlist = {}
local h = 0
local old_style = self.font:getStyle()
for z = 1 + self.scroll, #self.log do
local stop = false
local tstr = self.log[z]
......@@ -126,6 +127,7 @@ function _M:display()
end
if stop then break end
end
self.font:setStyle(old_style)
return
end
......
......@@ -78,9 +78,11 @@ function _M:getNext(remove)
local line = self.log[1]
self.surface:erase(0,0,0,0)
local old_style = self.font:getStyle()
if line then
self.surface:drawColorStringBlended(self.font, line, 0, 0, self.color[1], self.color[2], self.color[3], true)
end
self.font:setStyle(old_style)
self.surface:updateTexture(self.texture)
self.changed = true
end
......
......@@ -64,6 +64,7 @@ function _M:generate()
end
-- Draw the list items
local old_style = self.font:getStyle()
self.list = {}
local r, g, b = 255, 255, 255
local s = core.display.newSurface(fw, fh)
......@@ -90,6 +91,8 @@ function _M:generate()
self.scrollbar.bar.w, self.scrollbar.bar.h, self.scrollbar.bar.tex, self.scrollbar.bar.texw, self.scrollbar.bar.texh = ssb_w, self.h - fh, s:glTexture()
end
self.font:setStyle(old_style)
-- Add UI controls
self.mouse:registerZone(0, 0, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event)
if button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP")
......
......@@ -73,6 +73,8 @@ function _M:generate()
end
function _M:createItem(item, text)
local old_style = self.font:getStyle()
-- Handle normal text
if type(text) == "string" then
local list = text:splitLines(self.w, self.font)
......@@ -116,6 +118,7 @@ function _M:createItem(item, text)
max_display = max_display,
}
end
self.font:setStyle(old_style)
end
function _M:switchItem(item, create_if_needed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment