- Updated "Data-1.13/Scripts/initunderground.lua": Now it is possible to specify alternate loadscreens when loading a sector (by Realist)

git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@1282 4f8fa57e-7814-0410-bad4-adc449f26b7c
This commit is contained in:
Wanne
2011-04-25 08:27:59 +00:00
parent a2fa8f75e0
commit ac77ff9ded
+28 -12
View File
@@ -116,22 +116,22 @@ CreatureMusic = {
local sectorList = { local sectorList = {
-- Miguel's basement -- Miguel's basement
{ location = "A10-1", loadscreen = "LS_Basement", }, { location = "A10-1", loadscreens = { "LS_Basement", "LS_Upstairs" }, },
-- Tixa -- Tixa
{ location = "J9-1", loadscreen = "LS_Basement", }, { location = "J9-1", loadscreens = { "LS_Basement", "LS_Upstairs" }, },
-- feeding zone -- feeding zone
{ location = "J9-2", loadscreen = "LS_Cave", }, { location = "J9-2", loadscreen = "LS_Cave", },
-- Orta -- Orta
{ location = "K4-1", loadscreen = "LS_Basement", }, { location = "K4-1", loadscreens = { "LS_Basement", "LS_Upstairs" }, },
-- Meduna -- Meduna
{ location = "O3-1", loadscreen = "LS_Basement", }, { location = "O3-1", loadscreens = { "LS_Basement", "LS_Upstairs" }, },
{ location = "P3-1", loadscreen = "LS_Basement", }, { location = "P3-1", loadscreens = { "LS_Basement", "LS_Upstairs" }, },
-- San Mona mine -- San Mona mine
@@ -352,18 +352,34 @@ Return values
function GetLoadscreen(location, timeOfDay) function GetLoadscreen(location, timeOfDay)
local function Return(name)
return "Loadscreens\\" .. name, "sti"
end
local s = sectorList[location] local s = sectorList[location]
if s ~= nil and s.loadscreen ~= nil then if s ~= nil then
return "Loadscreens\\" .. s.loadscreen, "sti"
else -- multiple screens to choose from?
-- resorting to defaults if s.loadscreens ~= nil and #s.loadscreens > 0 then
local screen = s.loadscreens[math.random(#s.loadscreens)]
return Return(screen)
end
-- single screen?
if s.loadscreen ~= nil then
return Return(s.loadscreen)
end
end
-- resorting to defaults
do
-- get last character, aka z level -- get last character, aka z level
level = location:sub(#location, #location) local level = location:sub(#location, #location)
if level == "1" then if level == "1" then
return "Loadscreens\\LS_Mine", "sti" return Return("LS_Mine")
else else
return "Loadscreens\\LS_Cave", "sti" return Return("LS_Cave")
end end
end end
end end