@@ -123,9 +123,11 @@ local SlideNoteList = {}
123123-- ! @brief Creates new SingleNoteObject
124124-- ! @param note_data SIF-compilant note data
125125-- ! @returns New NoteObject
126- local function NewNoteObject (note_data )
126+ local function NewNoteObject (note_data , offset )
127+ offset = offset or 0
128+
127129 local noteobj = {
128- ZeroAccuracyTime = note_data .timing_sec * 1000 ,
130+ ZeroAccuracyTime = note_data .timing_sec * 1000 + offset ,
129131 Attribute = tonumber (note_data .notes_attribute ),
130132 Position = note_data .position ,
131133 Audio = {
@@ -137,6 +139,7 @@ local function NewNoteObject(note_data)
137139 FirstCircle = {480 , 160 }
138140 }
139141 local idolpos = assert (DEPLS .IdolPosition [note_data .position ], " Invalid idol position" )
142+ local note_effect = note_data .effect % 10
140143
141144 -- Idol position
142145 noteobj .NoteposDiff = {idolpos [1 ] - 416 , idolpos [2 ] - 96 }
@@ -148,39 +151,33 @@ local function NewNoteObject(note_data)
148151 noteobj .SimulNote = true
149152 end
150153
151- if note_data .effect == 2 then
152- -- Token note
153- noteobj .TokenNote = true
154- elseif note_data .effect == 4 then
155- -- Star note
156- noteobj .StarNote = true
157- elseif note_data .effect == 11 then
158- -- Slide note
154+ -- Swing note
155+ noteobj .SlideNote = (note_data .effect - 1 ) / 10 >= 1 and note_effect < 4
156+
157+ if noteobj .SlideNote then
159158 local newnotedata = Yohane .CopyTable (note_data )
160159
161- noteobj .SlideNote = true
162160 SlideNoteList [# SlideNoteList + 1 ] = newnotedata
163161 newnotedata .noteobj = noteobj
164162 newnotedata .index = Note .TotalNotes
165- elseif note_data .effect == 3 or note_data .effect == 13 then
166- -- Long note (necessarily with swing)
167- if note_data .effect == 13 then
168- local newnotedata = Yohane .CopyTable (note_data )
169-
170- noteobj .SlideNote = true
171- noteobj .SlideNote = true
172- SlideNoteList [# SlideNoteList + 1 ] = newnotedata
173- newnotedata .noteobj = noteobj
174- newnotedata .index = Note .TotalNotes
175- end
176-
163+ end
164+
165+ if note_effect == 2 then
166+ -- Token note
167+ noteobj .TokenNote = true
168+ elseif note_effect == 4 then
169+ -- Star note
170+ noteobj .StarNote = true
171+ elseif note_effect == 3 then
177172 -- Long note. Use LongNoteObject metatable
178173 noteobj .Audio2 = {
179174 Perfect = DEPLS .Sound .PerfectTap :clone (),
180175 Great = DEPLS .Sound .GreatTap :clone (),
181176 Good = DEPLS .Sound .GoodTap :clone (),
182177 Bad = DEPLS .Sound .BadTap :clone (),
183178 }
179+
180+ -- Create trail mesh vertices
184181 noteobj .Vert = {}
185182 noteobj .SecondCircle = {480 , 160 }
186183 noteobj .ZeroAccuracyEndNote = note_data .effect_value * 1000
@@ -206,10 +203,6 @@ local function NewNoteObject(note_data)
206203 return noteobj
207204 end
208205
209- if note_data .effect ~= 11 then
210- PreviousSlideNote = nil
211- end
212-
213206 -- SingleNoteObject in here
214207 noteobj .Audio .StarExplode = DEPLS .Sound .StarExplode :clone ()
215208 noteobj .ScoreMultipler2 = 1
@@ -695,10 +688,10 @@ end
695688
696689-- ! @brief Add note
697690-- ! @param note_data SIF-compilant note data
698- function Note .Add (note_data )
691+ function Note .Add (note_data , offset )
699692 Note .NoteRemaining = Note .NoteRemaining + 1
700693 Note .TotalNotes = Note .TotalNotes + 1
701- table.insert (Note [note_data .position ], NewNoteObject (note_data ))
694+ table.insert (Note [note_data .position ], NewNoteObject (note_data , offset ))
702695end
703696
704697local function initnote_pos (a )
@@ -757,9 +750,8 @@ function Note.InitializeImage()
757750 applyswing (chainswing )
758751 end
759752
760-
761753 if (chainswing .effect == 13 and
762- chainswing .timing_sec + chainswing .effect_value or
754+ chainswing .timing_sec + chainswing .effect_value or
763755 chainswing .timing_sec
764756 ) - last_timing > 0.25
765757 then
0 commit comments