Merge branch 'master' of github.com:FajsiEx/exceed

This commit is contained in:
Hersi 2021-11-22 03:13:31 +01:00
commit 3c778b875c
10 changed files with 189 additions and 16 deletions

View File

@ -46,5 +46,14 @@
"label": "Turn on Rasis", "label": "Turn on Rasis",
"type": "bool", "type": "bool",
"default": false "default": false
},
"separator_e": {},
"Gameplay": { "type": "label" },
"gameplay_ucDifferentColor": {
"label": "Use different colors for UC and PUC chain numbers",
"type": "bool",
"default": false
} }
} }

View File

@ -1,5 +1,7 @@
local Easing = require("common.easings"); local Easing = require("common.easings");
local Footer = require("components.footer"); local Footer = require("components.footer");
local DiffRectangle = require('components.diff_rectangle');
local common = require('common.common');
local VolforceWindow = require("components.volforceWindow") local VolforceWindow = require("components.volforceWindow")
@ -23,9 +25,41 @@ local appealCardImage = gfx.CreateSkinImage("crew/appeal_card.png", 0);
local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0); local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0);
local crewImage = gfx.CreateSkinImage("crew/portrait.png", 0); local crewImage = gfx.CreateSkinImage("crew/portrait.png", 0);
local notchesImage = gfx.CreateSkinImage("challenge_result/notches.png", 0);
local trackBarsImage = gfx.CreateSkinImage("challenge_result/track_bars.png", 0);
local completionFailImage = gfx.CreateSkinImage("challenge_result/pass_states/fail.png", 0);
local completionPassImage = gfx.CreateSkinImage("challenge_result/pass_states/pass.png", 0);
local irHeartbeatRequested = false; local irHeartbeatRequested = false;
local IRserverName = ""; local IRserverName = "";
local badgeImages = {
gfx.CreateSkinImage("song_select/medal/nomedal.png", 1),
gfx.CreateSkinImage("song_select/medal/played.png", 1),
gfx.CreateSkinImage("song_select/medal/clear.png", 1),
gfx.CreateSkinImage("song_select/medal/hard.png", 1),
gfx.CreateSkinImage("song_select/medal/uc.png", 1),
gfx.CreateSkinImage("song_select/medal/puc.png", 1),
}
local gradeImages = {
S = gfx.CreateSkinImage("common/grades/S.png", 0),
AAA_P = gfx.CreateSkinImage("common/grades/AAA+.png", 0),
AAA = gfx.CreateSkinImage("common/grades/AAA.png", 0),
AA_P = gfx.CreateSkinImage("common/grades/AA+.png", 0),
AA = gfx.CreateSkinImage("common/grades/AA.png", 0),
A_P = gfx.CreateSkinImage("common/grades/A+.png", 0),
A = gfx.CreateSkinImage("common/grades/A.png", 0),
B = gfx.CreateSkinImage("common/grades/B.png", 0),
C = gfx.CreateSkinImage("common/grades/C.png", 0),
D = gfx.CreateSkinImage("common/grades/D.png", 0),
none = gfx.CreateSkinImage("common/grades/none.png", 0),
}
local percRequired = 1;
local percGet = 0;
-- AUDIO -- AUDIO
game.LoadSkinSample("challenge_result.wav") game.LoadSkinSample("challenge_result.wav")
@ -38,6 +72,7 @@ end
local function handleSfx() local function handleSfx()
if not bgSfxPlayed then if not bgSfxPlayed then
common.stopMusic();
game.PlaySample("challenge_result.wav", true) game.PlaySample("challenge_result.wav", true)
bgSfxPlayed = true bgSfxPlayed = true
end end
@ -49,6 +84,17 @@ local function handleSfx()
end end
end end
function splitString(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end
local function load_number_image(path) local function load_number_image(path)
local images = {} local images = {}
for i = 0, 9 do for i = 0, 9 do
@ -127,21 +173,100 @@ end
local scoreNumber = load_number_image("score_num"); local scoreNumber = load_number_image("score_num");
function drawScorePanelContent() function drawChartResult(deltaTime, x, y, chartResult)
game.Log("Drawing scores...", game.LOGGER_INFO) -- debug gfx.Save()
gfx.LoadSkinFont('NotoSans-Regular.ttf')
gfx.FontSize(28)
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
gfx.BeginPath()
gfx.GlobalAlpha(1);
gfx.Text(chartResult.title, x+160,y+32);
DiffRectangle.render(deltaTime, x+287.5, y+67, 0.85, chartResult.difficulty, chartResult.level)
local score = chartResult.score or 0;
draw_number(x + 500, y+80, 1.0, math.floor(score / 10000), 4, scoreNumber, true, 0.30, 1.12)
draw_number(x + 655, y+85, 1.0, score, 4, scoreNumber, true, 0.22, 1.12)
local gradeImageKey = string.gsub(chartResult.grade, '+', '_P');
local gradeImage = gradeImages[gradeImageKey] or gradeImages.D
gfx.BeginPath()
gfx.ImageRect(x+800, y+12, 79, 79, gradeImage, 1, 0)
if chartResult.badge then
local badgeImage = badgeImages[chartResult.badge+1];
gfx.BeginPath()
gfx.ImageRect(x+900, y+16, 79*1.05, 69*1.05, badgeImage, 1, 0)
end
gfx.Restore()
end
function drawScorePanelContent(deltaTime)
-- game.Log("Drawing scores...", game.LOGGER_INFO) -- debug
for i, chart in ipairs(result.charts) do for i, chart in ipairs(result.charts) do
if chart.score == nil then -- if chart.score == nil then
game.Log("Score does not exist? Quitting loop...", game.LOGGER_WARNING) -- game.Log("Score does not exist? Quitting loop...", game.LOGGER_WARNING)
break -- break
end -- end
game.Log("#" .. i .. " chart.score: " .. chart.score, game.LOGGER_INFO) -- debug
-- Draw score drawChartResult(deltaTime, 0, 836+(165*(i-1)), chart);
draw_number(250, 150, 1.0, math.floor(chart.score / 10000), 4, scoreNumber, true, 0.40, 1.12)
-- still not sure how ui scaling/layers works in this game, still figuring it out :p
end end
end end
function drawDecorations()
gfx.BeginPath()
gfx.ImageRect(118, 846.5, 43*0.855, 429*0.855, notchesImage, 1, 0)
gfx.BeginPath()
gfx.ImageRect(400, 807, 367*0.857, 429*0.857, trackBarsImage, 1, 0)
end
function drawCompletion()
local completitionImage = completionFailImage;
if result.passed then
completitionImage = completionPassImage;
end
gfx.BeginPath()
gfx.ImageRect(63, 1331, 766*0.85, 130*0.85, completitionImage, 1, 0)
draw_number(925, 1370, 1.0, percGet, 3, scoreNumber, true, 0.3, 1.12)
gfx.BeginPath();
gfx.Rect(741, 1402, 278*math.min(1, percGet / percRequired), 6);
gfx.FillColor(255, 128, 0, 255);
gfx.Fill()
end
function result_set()
local reqTextWords = splitString(result.requirement_text, ' ');
for index, word in ipairs(reqTextWords) do
if string.find(word, '%%') ~= nil then -- %% = %, because % is an escape char
local percNumber = tonumber(string.gsub(word, '%%', ''), 10)
percRequired = percNumber;
end
end
game.Log(percRequired, game.LOGGER_ERROR);
local a = 0;
for i, chart in ipairs(result.charts) do
a = a + chart.percent;
game.Log('#' .. i .. ' got ' .. chart.percent .. '% // ACC at ' .. a, game.LOGGER_ERROR);
end
percGet = a / #result.charts;
end
local IR_HeartbeatResponse = function(res) local IR_HeartbeatResponse = function(res)
if res.statusCode == IRData.States.Success then if res.statusCode == IRData.States.Success then
IRserverName = res.body.serverName .. " " .. res.body.irVersion; IRserverName = res.body.serverName .. " " .. res.body.irVersion;
@ -167,9 +292,13 @@ function render(deltaTime)
drawBackground() drawBackground()
drawDecorations()
drawPlayerInfo() drawPlayerInfo()
drawScorePanelContent() drawScorePanelContent(deltaTime)
drawCompletion()
drawHeader() drawHeader()
Footer.draw(deltaTime); Footer.draw(deltaTime);

View File

@ -59,7 +59,7 @@ function render(deltaTime)
end end
function render_crit_base(deltaTime) function render_crit_base(deltaTime)
CritLine.renderBase(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation); CritLine.renderBase(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation, gameplay.critLine.cursors);
Console.render(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation); Console.render(deltaTime, gameplay.critLine.x, gameplay.critLine.y, -gameplay.critLine.rotation);
end end

View File

@ -81,6 +81,10 @@ local render = function (deltaTime, comboState, combo, critLineCenterX, critLine
chainNumbers = chainNumbersPUC --puc chainNumbers = chainNumbersPUC --puc
elseif comboState == 1 then elseif comboState == 1 then
chainNumbers = chainNumbersUC --uc chainNumbers = chainNumbersUC --uc
if (not game.GetSkinSetting('gameplay_ucDifferentColor')) then
chainNumbers = chainNumbersPUC -- force the PUC numbers in case the setting is turned off
end
end end
-- \_ chain _/ -- \_ chain _/

View File

@ -1,6 +1,7 @@
local baseImage = gfx.CreateSkinImage("gameplay/crit_line/base.png", 0) local baseImage = gfx.CreateSkinImage("gameplay/crit_line/base.png", 0)
local textImage = gfx.CreateSkinImage("gameplay/crit_line/text.png", 0) local textImage = gfx.CreateSkinImage("gameplay/crit_line/text.png", 0)
local cursorImage = gfx.CreateSkinImage("gameplay/crit_line/cursor.png", 0)
local CRITBAR_W = 1496 local CRITBAR_W = 1496
local CRITBAR_H = 348 local CRITBAR_H = 348
@ -16,7 +17,28 @@ local setUpTransforms = function (x,y,rotation)
gfx.Scale(scale,scale) gfx.Scale(scale,scale)
end end
local renderBase = function (deltaTime, centerX, centerY, rotation) local drawCursors = function (cursors)
local cursorW = 598*0.2;
local cursorH = 673*0.2;
for i = 0, 1, 1 do
gfx.Save();
local cursor = cursors[i];
gfx.BeginPath();
gfx.SkewX(cursor.skew)
gfx.ImageRect(
cursor.pos - cursorW/2,
-cursorH/2,
cursorW,
cursorH,
cursorImage,
cursor.alpha,
0
);
gfx.Restore();
end
end
local renderBase = function (deltaTime, centerX, centerY, rotation, cursors)
setUpTransforms(centerX, centerY, rotation) setUpTransforms(centerX, centerY, rotation)
gfx.BeginPath() gfx.BeginPath()
@ -35,6 +57,8 @@ local renderBase = function (deltaTime, centerX, centerY, rotation)
0 0
); );
drawCursors(cursors)
gfx.ResetTransform() gfx.ResetTransform()
end end

View File

@ -1,4 +1,6 @@
local common = require('common.common');
game.LoadSkinSample('song_transition_screen/transition_enter.wav'); game.LoadSkinSample('song_transition_screen/transition_enter.wav');
local refBgImage = gfx.CreateSkinImage("songtransition/bg_old.png", 0) local refBgImage = gfx.CreateSkinImage("songtransition/bg_old.png", 0)
@ -75,6 +77,7 @@ end
function render(deltaTime) function render(deltaTime)
if not wasEnterSfxPlayed then if not wasEnterSfxPlayed then
common.stopMusic();
game.PlaySample('song_transition_screen/transition_enter.wav'); game.PlaySample('song_transition_screen/transition_enter.wav');
wasEnterSfxPlayed = true; wasEnterSfxPlayed = true;
end end
@ -135,14 +138,14 @@ function render_screen(progress)
gfx.BeginPath() gfx.BeginPath()
gfx.ImageRect(37.5, 1074, 1180*0.85, 343*0.85, infoOverlayPanel,1,0); gfx.ImageRect(37.5, 1074, 1180*0.85, 343*0.85, infoOverlayPanel,1,0);
gfx.BeginPath()
gfx.ImageRect(10, 195.5, 1060, 1015, albumBgImage,1,0);
local jacket = song.jacket == 0 and noJacket or song.jacket local jacket = song.jacket == 0 and noJacket or song.jacket
gfx.BeginPath(); gfx.BeginPath();
gfx.ImageRect(235, 385, 608, 608, jacket, 1, 0) gfx.ImageRect(235, 385, 608, 608, jacket, 1, 0)
gfx.ClosePath(); gfx.ClosePath();
gfx.BeginPath()
gfx.ImageRect(10, 195.5, 1060, 1015, albumBgImage,1,0);
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
gfx.FontSize(55) gfx.FontSize(55)

View File

@ -1,4 +1,6 @@
local common = require('common.common');
local transitionEnterAnimation; local transitionEnterAnimation;
local transitionLeaveAnimation; local transitionLeaveAnimation;
@ -19,6 +21,8 @@ function loadAnimations()
end end
function render(deltaTime) function render(deltaTime)
common.stopMusic();
if not transitionEnterAnimation then if not transitionEnterAnimation then
loadAnimations() loadAnimations()
end end

View File

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 663 B

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB