generated from yordan-kanchelov/pixi-typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
186 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Util/Beatmap/Data/Sections/Difficulty/DifficultyData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* <a href="https://osu.ppy.sh/wiki/en/Client/Beatmap_editor/Song_setup#difficulty">Difficulty settings</a> | ||
*/ | ||
export class DifficultyData { | ||
/** | ||
* HP setting (0–10) | ||
*/ | ||
public HPDrainRate!: number; | ||
/** | ||
* CS setting (0–10) | ||
*/ | ||
public CircleSize!: number; | ||
/** | ||
* OD setting (0–10) | ||
*/ | ||
public OverallDifficulty!: number; | ||
/** | ||
* AR setting (0–10) | ||
*/ | ||
public ApproachRate!: number; | ||
/** | ||
* Base slider velocity in hundreds of <a href="https://osu.ppy.sh/wiki/en/Client/Beatmap_editor/osu%21_pixel">osu! pixels</a> per beat | ||
*/ | ||
public SliderMultiplier!: number; | ||
/** | ||
* Amount of slider ticks per beat | ||
*/ | ||
public SliderTickRate!: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {EventTypes} from "./EventTypes"; | ||
|
||
export class Event { | ||
/** | ||
* Type of the event. Some events may be referred to by either a name or a number. | ||
*/ | ||
public eventType!: EventTypes; | ||
/** | ||
* Start time of the event, in milliseconds from the beginning of the beatmap's audio. For events that do not use a start time, the default is 0. | ||
*/ | ||
public startTime: number = 0; | ||
/** | ||
* Extra parameters specific to the event's type. | ||
*/ | ||
public eventParams!: (string | number)[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Event} from "./Event"; | ||
import {EventTypes} from "./EventTypes"; | ||
export class EventBackground extends Event { | ||
public eventType = EventTypes.BACKGROUND; | ||
public startTime = 0; | ||
/** | ||
* Location of the background image relative to the beatmap directory. Double quotes are | ||
* usually included surrounding the filename, but they are not required. | ||
*/ | ||
public filename!: string; | ||
/** | ||
* Offset in osu! pixels from the centre of the screen. | ||
* For example, an offset of 50,100 would have the background shown 50 osu! pixels to the | ||
* right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional. | ||
*/ | ||
public xOffset!: number; | ||
/** | ||
* Offset in osu! pixels from the centre of the screen. | ||
* For example, an offset of 50,100 would have the background shown 50 osu! pixels to the | ||
* right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional. | ||
*/ | ||
public yOffset!: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export enum EventTypes { | ||
BACKGROUND = 0, | ||
VIDEO = "Video", | ||
// storyboard | ||
SPRITE = "Sprite", | ||
ANIMATION = "Animation" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {Event} from "./Event"; | ||
import {EventTypes} from "./EventTypes"; | ||
|
||
export class EventVideo extends Event { | ||
public eventType = EventTypes.VIDEO; | ||
public startTime = 0; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {Event} from "./Event"; | ||
|
||
/** | ||
* Beatmap and storyboard graphic events | ||
*/ | ||
export class EventsData { | ||
public Events: Event[] = []; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Util/Beatmap/Data/Sections/Events/Storyboard/EventSprite.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {EventStoryboard} from "./EventStoryboard"; | ||
import {EventTypes} from "../EventTypes"; | ||
|
||
export class EventSprite extends EventStoryboard { | ||
public eventType = EventTypes.SPRITE; | ||
|
||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/Util/Beatmap/Data/Sections/Events/Storyboard/EventStoryboard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {StoryboardCommand} from "./StoryboardCommand"; | ||
import {Event} from "../Event"; | ||
import {Layer} from "./Layer"; | ||
import {Origin} from "./Origin"; | ||
|
||
export class EventStoryboard extends Event { | ||
public startTime = -1; | ||
/** | ||
* Each <a href="https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Objects">object declaration</a> | ||
* is followed by one or more commands. These tell the object to do something, called an event, | ||
* such as move or change colour. You can think of each command as affecting a variable | ||
* (or set of variables) for that object; once a command is finished, the object keeps those values until | ||
* another command changes it. Objects who don't have a particular type of | ||
* command used will use the default value for that variable. | ||
*/ | ||
public Commands: StoryboardCommand[] = []; | ||
/** | ||
* (layer) is the <a href="https://osu.ppy.sh/wiki/en/Storyboard/Scripting/General_Rules">layer</a> | ||
* the object appears on. | ||
*/ | ||
public layer!: Layer; | ||
/** | ||
* (origin) is where on the image should osu! consider that image's origin (coordinate) | ||
* to be. This affects the (x) and (y) values, as well as several other command-specific | ||
* behaviours. For example, choosing (origin) = TopLeft will let the (x),(y) values determine, | ||
* where the top left corner of the image itself should be on the screen. The valid values are listed below. | ||
*/ | ||
public origin!: Origin; | ||
/** | ||
* (filepath) is, in laymans terms, the filename of the image you want. But it's not always quite that simple: | ||
* - If you have a subfolder inside your Song Folder, you need to include that, as well. | ||
* - Example: "backgrounds/sky.jpg" if you have a subfolder called "backgrounds" with an image called "sky.jpg" in it. | ||
* Start listing directories only from the Song Folder, where the .osu or .osb file is (i.e., a relative filepath). | ||
* It should not have something like "C:" anywhere in it. | ||
* - Animations are referred to without their number. So if you have "sample0.png" and "sample1.png" as two frames | ||
* to make a single animation, you want to refer to it as "sample.png". | ||
* - The ""s are technically optional, but they're required if your filename or subfolder name has spaces. | ||
* - Example: "SB/J_K.jpg" rather than SB/J_K.jpg. The prior will find in SB folder for J_K.jpg while the later will | ||
* null the instance (it finds SB/J, an invalid variable). | ||
*/ | ||
public filepath!: string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export enum Layer { | ||
Background = 0, | ||
Fail = 1, | ||
Pass = 2, | ||
Foreground = 3 | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Util/Beatmap/Data/Sections/Events/Storyboard/Origin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export enum Origin { | ||
TopLeft = 0, | ||
Centre = 1, | ||
CentreLeft = 2, | ||
TopRight = 3, | ||
BottomCentre = 4, | ||
TopCentre = 5, | ||
/** | ||
* (same effect as TopLeft, but should not be used) | ||
*/ | ||
Custom = 6, | ||
CentreRight = 7, | ||
BottomLeft = 8, | ||
BottomRight = 9 | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Util/Beatmap/Data/Sections/Events/Storyboard/StoryboardCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {StoryboardCompoundCommand} from "./StoryboardCompoundCommand"; | ||
|
||
export class StoryboardCommand { | ||
public CompoundCommands: StoryboardCompoundCommand[] = []; | ||
} |
3 changes: 3 additions & 0 deletions
3
src/Util/Beatmap/Data/Sections/Events/Storyboard/StoryboardCompoundCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class StoryboardCompoundCommand { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters