Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fixed #739, added outModes instead of a single out mode, every …
…edge now can be customized
- Loading branch information
1 parent
cdb380c
commit 67194dc
Showing
10 changed files
with
224 additions
and
65 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
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,6 @@ | ||
export enum OutModeDirection { | ||
bottom = "bottom", | ||
left = "left", | ||
right = "right", | ||
top = "top", | ||
} |
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
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,31 @@ | ||
import type { IOutModes } from "../../../Interfaces/Particles/Move/IOutModes"; | ||
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader"; | ||
import { OutMode, OutModeAlt } from "../../../../Enums/Modes"; | ||
import type { RecursivePartial } from "../../../../Types"; | ||
|
||
export class OutModes implements IOutModes, IOptionLoader<IOutModes> { | ||
public bottom?: OutMode | keyof typeof OutMode | OutModeAlt; | ||
public default: OutMode | keyof typeof OutMode | OutModeAlt; | ||
public left?: OutMode | keyof typeof OutMode | OutModeAlt; | ||
public right?: OutMode | keyof typeof OutMode | OutModeAlt; | ||
public top?: OutMode | keyof typeof OutMode | OutModeAlt; | ||
|
||
constructor() { | ||
this.default = OutMode.out; | ||
} | ||
|
||
public load(data?: RecursivePartial<IOutModes>): void { | ||
if (!data) { | ||
return; | ||
} | ||
|
||
if (data.default !== undefined) { | ||
this.default = data.default; | ||
} | ||
|
||
this.bottom = data.bottom ?? data.default; | ||
this.left = data.left ?? data.default; | ||
this.right = data.right ?? data.default; | ||
this.top = data.top ?? data.default; | ||
} | ||
} |
Oops, something went wrong.