Fix crash on invalid idol animation #44
|
@ -33,7 +33,7 @@
|
|||
|
||||
"Crew": { "type": "label" },
|
||||
"single_idol": {
|
||||
"label": "!!!ALWAYS MATCH THE NAME!!!",
|
||||
"label": "Crew idol animations, folder name in `crew/anim/`",
|
||||
"type": "text",
|
||||
"default": "nothing"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local MAJOR = 0
|
||||
local MINOR = 2
|
||||
local PATCH = 2
|
||||
local PATCH = 3
|
||||
|
||||
local function getLongVersion()
|
||||
return "USC:E:G:S:" .. MAJOR .. MINOR .. PATCH
|
||||
|
@ -18,4 +18,4 @@ return {
|
|||
PATCH = PATCH,
|
||||
getLongVersion = getLongVersion,
|
||||
getVersion = getVersion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ local spinnybg = require('components.background');
|
|||
local msg = game.GetSkinSetting("MSG");
|
||||
local normname = game.GetSkinSetting("username")
|
||||
|
||||
local creww = game.GetSkinSetting("single_idol")
|
||||
local crew = game.GetSkinSetting("single_idol")
|
||||
|
||||
local m_jacket = gfx.CreateSkinImage("multi/lobby/multi_jacket.png", 1);
|
||||
local m_base_panel = gfx.CreateSkinImage("multi/lobby/multi_base_panel.png", 1);
|
||||
|
@ -28,9 +28,11 @@ local bg = gfx.CreateSkinImage("multi/lobby/bg.png", 1);
|
|||
local bg_graid1 = gfx.CreateSkinImage("multi/lobby/gradient_bottom.png", 1);
|
||||
local bg_graid2 = gfx.CreateSkinImage("multi/lobby/gradient_top.png", 1);
|
||||
|
||||
local idolAnimation = gfx.LoadSkinAnimation('crew/anim/'..creww, 1 / 30, 0, true);
|
||||
local idolAnimation = gfx.LoadSkinAnimation('crew/anim/'..crew, 1 / 30, 0, true);
|
||||
local idolAnimTransitionScale = 0;
|
||||
|
||||
if not idolAnimation then
|
||||
game.Log("Crew folder crew/anim/"..crew.." does not exist.", game.LOGGER_WARNING)
|
||||
end
|
||||
|
||||
local resX,resY = game.GetResolution()
|
||||
|
||||
|
@ -118,17 +120,19 @@ end
|
|||
local SERVER = game.GetSkinSetting("multi.server")
|
||||
|
||||
local drawIdol = function(deltaTime)
|
||||
local idolAnimTickRes = gfx.TickAnimation(idolAnimation, deltaTime);
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale);
|
||||
if idolAnimation then
|
||||
local idolAnimTickRes = gfx.TickAnimation(idolAnimation, deltaTime);
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale);
|
||||
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60;
|
||||
if (idolAnimTransitionScale > 1) then
|
||||
idolAnimTransitionScale = 1;
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60;
|
||||
if (idolAnimTransitionScale > 1) then
|
||||
idolAnimTransitionScale = 1;
|
||||
end
|
||||
|
||||
gfx.ImageRect(0, 0, resX,resY, idolAnimation, 1, 0);
|
||||
gfx.GlobalAlpha(1);
|
||||
end
|
||||
|
||||
gfx.ImageRect(0, 0, resX,resY, idolAnimation, 1, 0);
|
||||
gfx.GlobalAlpha(1);
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ local lang = require("language.call")
|
|||
|
||||
require('common.gameconfig')
|
||||
|
||||
local creww = game.GetSkinSetting("single_idol")
|
||||
local crew = game.GetSkinSetting("single_idol")
|
||||
|
||||
local VolforceWindow = require('components.volforceWindow')
|
||||
|
||||
|
@ -137,7 +137,11 @@ local clearBadgeImages = {
|
|||
}
|
||||
|
||||
-- ANIMS
|
||||
local idolAnimation = gfx.LoadSkinAnimation('crew/anim/'..creww, 1 / 30, 0, true);
|
||||
local idolAnimation = gfx.LoadSkinAnimation('crew/anim/'..crew, 1 / 30, 0, true);
|
||||
|
||||
if not idolAnimation then
|
||||
game.Log("Crew folder crew/anim/"..crew.." does not exist.", game.LOGGER_WARNING)
|
||||
end
|
||||
|
||||
local transitionEnterScale = 0;
|
||||
local idolAnimTransitionScale = 0;
|
||||
|
@ -265,17 +269,19 @@ function drawTimingBar(y, value, max, type)
|
|||
end
|
||||
|
||||
local drawIdol = function(deltaTime)
|
||||
local idolAnimTickRes = gfx.TickAnimation(idolAnimation, deltaTime);
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale);
|
||||
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60;
|
||||
if (GameConfig["AutoScoreScreenshot"] or idolAnimTransitionScale > 1) then
|
||||
idolAnimTransitionScale = 1;
|
||||
if idolAnimation then
|
||||
local idolAnimTickRes = gfx.TickAnimation(idolAnimation, deltaTime);
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale);
|
||||
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60;
|
||||
if (GameConfig["AutoScoreScreenshot"] or idolAnimTransitionScale > 1) then
|
||||
idolAnimTransitionScale = 1;
|
||||
end
|
||||
|
||||
gfx.ImageRect(0, 0, desw, desh, idolAnimation, 1, 0);
|
||||
gfx.GlobalAlpha(1);
|
||||
end
|
||||
|
||||
gfx.ImageRect(0, 0, desw, desh, idolAnimation, 1, 0);
|
||||
gfx.GlobalAlpha(1);
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -826,4 +832,4 @@ end
|
|||
|
||||
screenshot_captured = function(path)
|
||||
game.PlaySample("shutter")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,6 +40,10 @@ local resources = {
|
|||
}
|
||||
}
|
||||
|
||||
if not resources.anims.idolAnimation then
|
||||
game.Log("Crew folder crew/anim/"..crew.." does not exist.", game.LOGGER_WARNING)
|
||||
end
|
||||
|
||||
-- load audio samples
|
||||
for _, path in pairs(resources.audiosamples) do
|
||||
game.LoadSkinSample(path)
|
||||
|
@ -306,16 +310,18 @@ local function draw_titlescreen(deltaTime)
|
|||
gfx.BeginPath()
|
||||
Background.draw(deltaTime)
|
||||
|
||||
local idolAnimTickRes = gfx.TickAnimation(resources.anims.idolAnimation, deltaTime)
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale)
|
||||
if resources.anims.idolAnimation then
|
||||
local idolAnimTickRes = gfx.TickAnimation(resources.anims.idolAnimation, deltaTime)
|
||||
if idolAnimTickRes == 1 then
|
||||
gfx.GlobalAlpha(idolAnimTransitionScale)
|
||||
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60
|
||||
if (idolAnimTransitionScale > 1) then idolAnimTransitionScale = 1 end
|
||||
idolAnimTransitionScale = idolAnimTransitionScale + 1 / 60
|
||||
if (idolAnimTransitionScale > 1) then idolAnimTransitionScale = 1 end
|
||||
|
||||
gfx.BeginPath()
|
||||
gfx.ImageRect(0, 0, Dim.design.width, Dim.design.height, resources.anims.idolAnimation, 1, 0)
|
||||
gfx.GlobalAlpha(1)
|
||||
gfx.BeginPath()
|
||||
gfx.ImageRect(0, 0, Dim.design.width, Dim.design.height, resources.anims.idolAnimation, 1, 0)
|
||||
gfx.GlobalAlpha(1)
|
||||
end
|
||||
end
|
||||
|
||||
-- Draw selector background
|
||||
|
|
Loading…
Reference in New Issue