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