Skip to content
Snippets Groups Projects
Commit 5f563439 authored by dg's avatar dg
Browse files

Loadscreen now have little tips/lore pieces displayed at random

git-svn-id: http://svn.net-core.org/repos/t-engine4@5173 51575b47-30f0-44d4-a5cc-537603b46e54
parent 513ce387
No related branches found
No related tags found
No related merge requests found
......@@ -399,10 +399,48 @@ function _M:loadScreen(mod)
local bar = {core.display.loadImage("/data/gfx/waiter/bar.png"):glTexture()}
local font = core.display.newFont("/data/font/DroidSans.ttf", 12)
local bfont = core.display.newFont("/data/font/DroidSans.ttf", 16)
local dw, dh = math.floor(sw / 2), left[7]
local dx, dy = math.floor((sw - dw) / 2), sh - dh
local tip = nil
if mod.load_tips then
local l = rng.table(mod.load_tips)
local img = nil
if l.image then
local i = core.display.loadImage(l.image)
if i then img = {i:glTexture()} end
end
local text = bfont:draw(l.text, dw - (img and img[6] or 0), 255, 255, 255)
local text_h = #text * text[1].h
local Base = require "engine.ui.Base"
local frame = Base:makeFrame("ui/tooltip/", dw + 30, math.max((img and img[7] or 0) + (l.img_y_off or 0), text_h) + 30)
tip = function(x, y)
y = y - frame.h - 30
Base:drawFrame(frame, x+1, y+1, 0, 0, 0, 0.3)
Base:drawFrame(frame, x-3, y-3, 1, 1, 1, 0.75)
x = x + 10
y = y + 10
if img then
img[1]:toScreenFull(x, y + (l.img_y_off or 0), img[6], img[7], img[2], img[3])
x = x + img[6] + 7
end
y = y - 10 + math.floor((frame.h - text_h) / 2)
for i = 1, #text do
local item = text[i]
if not item then break end
item._tex:toScreenFull(x+2, y+2, item.w, item.h, item._tex_w, item._tex_h, 0, 0, 0, 0.8)
item._tex:toScreenFull(x, y, item.w, item.h, item._tex_w, item._tex_h)
y = y + item.h
end
end
end
return function()
-- Background
local x, y = 0, 0
......@@ -451,6 +489,8 @@ function _M:loadScreen(mod)
txt[1]:toScreenFull(dx + (dw - txt[6]) / 2 + 2, dy + (bar[7] - txt[7]) / 2 + 2, txt[6], txt[7], txt[2], txt[3], 0, 0, 0, 0.6)
txt[1]:toScreenFull(dx + (dw - txt[6]) / 2, dy + (bar[7] - txt[7]) / 2, txt[6], txt[7], txt[2], txt[3])
end
if tip then tip(dw / 2, dy) end
end
end)
core.display.forceRedraw()
......
game/modules/tome/data/gfx/loadtiles/alchemist_golem.png

16.6 KiB

game/modules/tome/data/gfx/loadtiles/farportal.png

32 KiB

game/modules/tome/data/gfx/loadtiles/lava.png

25.4 KiB

game/modules/tome/data/gfx/loadtiles/toknor_mirvenia.png

24.5 KiB

......@@ -57,6 +57,24 @@ profile_stats_fields = {"artifacts", "characters", "deaths", "uniques", "scores"
allow_userchat = true -- We can talk to the online community
no_get_name = true -- Name setting for new characters is done by the module itself
load_tips = {
{image="/data/gfx/shockbolt/npc/humanoid_human_linaniil_supreme_archmage.png", img_y_off=-50, text=[[Though magic is still shunned in Maj'Eyal, rumours abound of secret havens of mages.]]},
{image="/data/gfx/shockbolt/npc/humanoid_orc_orc_elite_berserker.png", text=[[The Rush talent lets you close in on an enemy quickly and daze them, disabling them whilst you hack down their friends.]]},
{image="/data/gfx/shockbolt/npc/humanoid_human_rogue.png", text=[[Stunning an opponent slows down their movement and reduces their damage output, giving you the opportunity to tactically reposition or finish them off at less risk.]]},
{image="/data/gfx/shockbolt/npc/humanoid_human_bandit.png", text=[[Movement is key on the battlefield. A stationary fighter will become a dead fighter. One must always seek the position of greatest tactical advantage and continue to re-evaluate throughout the battle.]]},
{image="/data/gfx/shockbolt/npc/humanoid_orc_orc_blood_mage.png", text=[[In the Age of Pyre the orcs learned the secrets of magic, and with their newfound powers nearly overcame the whole of Maj'Eyal.]]},
{image="/data/gfx/shockbolt/npc/humanoid_orc_orc_berserker.png", text=[[The orcs once terrorised the whole content. In the Age of Ascendancy they were rendered extinct, but rumours abound of hidden groups biding their time to return.]]},
{image="/data/gfx/shockbolt/npc/humanoid_human_fire_wyrmic.png", text=[[Intense willpower lets wyrmics take on the natural powers of dragons.]]},
{image="/data/gfx/loadtiles/alchemist_golem.png", text=[[Alchemist can transmute gems to create fiery explosions, and are known to travel with a sturdy golem for extra protection.]]},
{image="/data/gfx/shockbolt/npc/construct_golem_athamathon_the_giant_golem.png", text=[[In the Age of Pyre the giant golem Atamathon was built with the sole purpose of stopping the orcish leader Garkul the Devourer. The golem was single-handedly destroyed by the orc, who then slaughtered an army of thousands before the demonic fighter was finally slain.]]},
{image="/data/gfx/loadtiles/farportal.png", text=[[None know what the Sher'Tul looked like, or what caused them all to disappear thousands of years ago. Their rare ruins are a source of mystery and terror.]]},
{image="/data/gfx/shockbolt/npc/horror_eldritch_luminous_horror.png", text=[[In deep places dark things dwell beyond description or understanding. None know the source of these hideous horrors.]]},
{image="/data/gfx/shockbolt/npc/humanoid_human_celia.png", img_y_off=-20, text=[[Who knows what dark thoughts drive ones to necromancy? Its art is as old as magic itself, and its creations have plagued all the races since the earliest memories.]]},
{image="/data/gfx/shockbolt/npc/undead_mummy_greater_mummy_lord.png", text=[[Some say that in their early days the Shaloren kings experimented with necromancy to preserve their flesh after death, but with little success. The Shaloren vehemently deny this.]]},
{image="/data/gfx/loadtiles/toknor_mirvenia.png", img_y_off=-10, text=[[120 years ago Toknor and Mirvenia united the human and halfling kingdoms and wiped out the orcish race, thus establishing the Age of Ascendancy.]]},
{image="/data/gfx/loadtiles/lava.png", text=[["The Spellblaze tore Eyal apart and nearly brought about the end of all civilisation. Two thousand years on its shadow still hangs over many lands, and the prideful mages have never been forgiven their place in bringing it about.]]},
}
-- Define the fields that are sync'ed online, and how they are sync'ed
profile_defs = {
allow_build = { {name="index:string:30"}, receive=function(data, save) save[data.name] = true end, export=function(env) for k, _ in pairs(env) do add{name=k} end end },
......
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