I still can't quite figure out how to get the White Aura style and display it into the mini window.
Currently when reading the lines in between Exits and your prompt, I have it where it only stores the styles if the textcolour is purple.
function check_lines (name, line, wildcards, styles)
require "getstyle"
style = GetStyle (styles, 1)
mob_colour = RGBColourToName (style.textcolour)
if mob_colour == "purple" then
table.insert (room_mobs, styles)
print ("Read and stored styles into table")
draw_a_room_mob ()
end -- mob_colour
end -- check_lines
I tried storing all of the styles instead of just the purple text ones, but then I wasn't sure how to pull specific ones back out for when drawing it into the mini-window.
Here's how it is drawn into the mini-window.
function draw_a_room_mob ()
local font = "f"
local font_height = 11
-- clear the background
check (WindowDrawImage (a_room_mob_window, "a_room_mob_background", 0, 0, 0, 0, 1)) -- redraw the background
local y = font_height * 2 + 5 - 25
for i, styles in ipairs (room_mobs) do
local x = 3
for _, style in ipairs (styles) do
x = x + WindowText (a_room_mob_window, font, style.text, x, y, 0, 0, style.textcolour, false)
end -- for
y = y + font_height
end -- for each mob style
Redraw ()
end -- draw_a_room_mob
So when I have check_lines storing all the styles instead of just the purple ones into the room_mobs table, in draw_a_room_mob function how can I pull it out for the WindowText?
Trying to be able to display mobs with (White Aura) and the mob name and display the normal ones without the white aura.
Here's the styles it shows when looking in a room with a (White Aura) mob in it.
1:
"textcolour"=12632256
"backcolour"=0
"length"=1
"style"=0
"text"="("
2:
"textcolour"=16777215
"backcolour"=0
"length"=10
"style"=1
"text"="White Aura"
3:
"textcolour"=12632256
"backcolour"=0
"length"=2
"style"=0
"text"=") "
4:
"textcolour"=8388736
"backcolour"=0
"length"=55
"style"=0
"text"="A Warden of the Frontier stands here alert for trouble."
|