mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-24 17:00:54 +00:00
Update script for tilemap generation
This commit is contained in:
parent
bcd7cb2c85
commit
df46afacb3
1 changed files with 36 additions and 5 deletions
|
|
@ -27,6 +27,41 @@ local function getCellId(cell)
|
|||
end
|
||||
|
||||
|
||||
local function showCompletionMessage()
|
||||
if world.isMapExtractionActive() then
|
||||
async:newUnsavableSimulationTimer(0.1, showCompletionMessage)
|
||||
return
|
||||
end
|
||||
|
||||
local pl = world.players[1]
|
||||
pl:sendEvent("builtin:map_extractor:updateMenu", {
|
||||
line1 = "Map extraction complete.",
|
||||
line2 = "",
|
||||
line3 = "",
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
local function generateTilemap()
|
||||
if world.isMapExtractionActive() then
|
||||
async:newUnsavableSimulationTimer(0.1, generateTilemap)
|
||||
return
|
||||
end
|
||||
|
||||
local pl = world.players[1]
|
||||
pl:sendEvent("builtin:map_extractor:updateMenu", {
|
||||
line1 = "Generating tile world map...",
|
||||
line2 = "The game may freeze for a short time.",
|
||||
line3 = "",
|
||||
})
|
||||
|
||||
async:newUnsavableSimulationTimer(0.2, function ()
|
||||
world.generateTileWorldMap(util.color.rgb(0.255, 0.224, 0.180))
|
||||
showCompletionMessage()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
local function processAndTeleport(skipExtraction)
|
||||
local pl = world.players[1]
|
||||
|
||||
|
|
@ -98,11 +133,7 @@ local function processAndTeleport(skipExtraction)
|
|||
until i <= 0
|
||||
|
||||
if i <= 0 then
|
||||
pl:sendEvent("builtin:map_extractor:updateMenu", {
|
||||
line1 = "Map extraction complete.",
|
||||
line2 = "",
|
||||
line3 = "",
|
||||
})
|
||||
generateTilemap()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue