Skip to content

Commit

Permalink
在没有指定判定线 speedEvents 时使用默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
MisaLiu committed Oct 31, 2022
1 parent 5dcd7ba commit 29f22d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
13 changes: 13 additions & 0 deletions src/chart/judgeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,24 @@ export default class Judgeline
{
if (this.eventLayers.length <= 0) throw new Error('No event layer in this judgeline');

let noSpeedEvents = false;
this.eventLayers.forEach((eventLayer) =>
{
eventLayer.speed = utils.arrangeSameSingleValueEvent(eventLayer.speed);
if (eventLayer.speed.length < 1) noSpeedEvents = true;
});

if (noSpeedEvents)
{
console.warn('Line ' + this.id + ' don\'t have any speed event, use default speed.');
this.eventLayers[0].speed.push({
startTime: 0,
endTime: 1e4,
start: 1,
end: 1
});
}

let sameTimeSpeedEventAlreadyExist = {};
let currentFloorPosition = 0;
let floorPositions = [];
Expand Down
21 changes: 12 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import { BrowserTracing } from '@sentry/tracing';

(() =>
{
// Init sentry
Sentry.init({
dsn: "https://c0f2c5052bd740c3b734b74c7dd6d350@o4504077358792704.ingest.sentry.io/4504077363183616",
integrations: [ new BrowserTracing() ],
tracesSampleRate: 1.0,
maxBreadcrumbs: 50,
debug: (GITHUB_CURRENT_GIT_HASH == '{{' + 'CURRENT_HASH' + '}}'),
release: (GITHUB_CURRENT_GIT_HASH != '{{' + 'CURRENT_HASH' + '}}')
});
if (GITHUB_CURRENT_GIT_HASH != '{{' + 'CURRENT_HASH' + '}}')
{
// Init sentry
Sentry.init({
dsn: "https://c0f2c5052bd740c3b734b74c7dd6d350@o4504077358792704.ingest.sentry.io/4504077363183616",
integrations: [ new BrowserTracing() ],
tracesSampleRate: 1.0,
maxBreadcrumbs: 50,
debug: false,
release: true
});
}
})();


Expand Down

0 comments on commit 29f22d5

Please sign in to comment.