My function drawTabInfo() alone is over 6k characters so I can't post it.
function refresh()
WindowRectOp(GCW, 2, 0, 0, 0, 0, WINDOW_BACKGROUND_COLOUR)
WindowShow(GCW, true)
init()
end
function drawTabDefenses()
line_count = 1
-- draw_tab_top == top line info.
-- draw_tab_left == left start
info_tab_left = draw_tab_left
info_tab_top = draw_tab_top
info_tab_bottom = info_tab_top + GetInfo(241)*2 + 2
WindowText(GCW, FONT_ID_NORMAL, "[Have] [Keep] Defenses:", info_tab_left, info_tab_top, 0, 0, WINDOW_TEXT_COLOUR, true)
info_tab_top = info_tab_top + GetInfo(241) + 2
tempcount = 1
for a,b in pairs(def) do
if a == "groundwatch" then defname = "groundwat"
elseif a == "chargeshield" then defname = "charshield"
elseif a == "diamondskin" then defname = "dskin"
elseif a == "stoneskin" then defname = "sskin"
else
defname = a
end
if tempcount == 1 then
temphold1 = defname
if b == 1 then
temphold1t = "X"
else
temphold1t = " "
end
if def_keep[a] == 1 then
temphold1k = "X"
else
temphold1k = " "
end
tempcount = tempcount + 1
elseif tempcount == 2 then
temphold2 = defname
if b == 1 then
temphold2t = "X"
else
temphold2t = " "
end
if def_keep[a] == 1 then
temphold2k = "X"
else
temphold2k = " "
end
tempcount = tempcount + 1
else
temphold3 = defname
if b == 1 then
temphold3t = "X"
else
temphold3t = " "
end
if def_keep[a] == 1 then
temphold3k = "X"
else
temphold3k = " "
end
WindowText(GCW, FONT_ID_NORMAL, "[" .. temphold1t .. "] [" .. temphold1k .. "] " .. string.proper(temphold1) .. " " .. string.rep(" ", 10-string.len(temphold1)) .. "[" .. temphold2t .. "] [" .. temphold2k .. "] " .. string.proper(temphold2) .. " " .. string.rep(" ", 10-string.len(temphold2)) .. "[" .. temphold3t .. "] [" .. temphold3k .. "] " .. string.proper(temphold3), info_tab_left, info_tab_top, 0, 0, WINDOW_TEXT_COLOUR, true)
hotspot_left = info_tab_left + GetInfo(240)*1
hotspot_right = hotspot_left + GetInfo(240)*1
if def[temphold1] == 0 then
WindowAddHotspot(GCW, "def-" .. temphold1, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Turn on " .. string.proper(temphold1), 1, 0)
end
hotspot_left = hotspot_right + GetInfo(240)*3
hotspot_right = hotspot_left + GetInfo(240)*1
WindowAddHotspot(GCW, "defkeep-" .. temphold1, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Keep up " .. string.proper(temphold1), 1, 0)
hotspot_left = hotspot_left + GetInfo(240)*15
hotspot_right = hotspot_left + GetInfo(240)*1
if def[temphold2] == 0 then
WindowAddHotspot(GCW, "def-" .. temphold2, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Turn on " .. string.proper(temphold2), 1, 0)
end
hotspot_left = hotspot_right + GetInfo(240)*3
hotspot_right = hotspot_left + GetInfo(240)*1
WindowAddHotspot(GCW, "defkeep-" .. temphold2, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Keep up " .. string.proper(temphold2), 1, 0)
hotspot_left = hotspot_left + GetInfo(240)*15
hotspot_right = hotspot_left + GetInfo(240)*1
if def[temphold3] == 0 then
WindowAddHotspot(GCW, "def-" .. temphold3, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Turn on " .. string.proper(temphold3), 1, 0)
end
hotspot_left = hotspot_right + GetInfo(240)*3
hotspot_right = hotspot_left + GetInfo(240)*1
WindowAddHotspot(GCW, "defkeep-" .. temphold3, hotspot_left, info_tab_top, hotspot_right, info_tab_bottom, "MouseOver", "CancelMouseOver", "MouseDownDef", "CancelMouseDown", "MouseUp", "Keep up " .. string.proper(temphold3), 1, 0)
info_tab_top = info_tab_top + GetInfo(241) + 2
info_tab_bottom = info_tab_top + GetInfo(241) + 2
tempcount = 1
end
end
WindowText(GCW, FONT_ID_NORMAL, "", info_tab_left, info_tab_top, 0, 0, WINDOW_TEXT_COLOUR, true)
info_tab_top = info_tab_top + GetInfo(241) + 2
WindowText(GCW, FONT_ID_NORMAL, "", info_tab_left, info_tab_top, 0, 0, WINDOW_TEXT_COLOUR, true)
end
|