mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-22 15:40:52 +01:00
Added nopitch
This commit is contained in:
parent
b817561a85
commit
7303e35076
@ -5,6 +5,7 @@ import { IAssetDimension } from './IAssetDimension';
|
||||
import { IAssetPalette } from './IAssetPalette';
|
||||
import { ISpritesheetData } from './spritesheet';
|
||||
import { IAssetVisualizationData } from './visualization';
|
||||
import {ISoundSample} from "./ISoundSample";
|
||||
|
||||
export interface IAssetData {
|
||||
type?: string;
|
||||
@ -13,7 +14,7 @@ export interface IAssetData {
|
||||
logicType?: string;
|
||||
maskType?: string;
|
||||
credits?: string;
|
||||
soundSample?: number;
|
||||
soundSample?: ISoundSample;
|
||||
action?: { link?: string, startState?: number };
|
||||
spritesheet?: ISpritesheetData;
|
||||
dimensions?: IAssetDimension;
|
||||
|
4
src/mapping/json/asset/ISoundSample.ts
Normal file
4
src/mapping/json/asset/ISoundSample.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface ISoundSample {
|
||||
id?: number,
|
||||
noPitch?: boolean
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import { IAssetData } from '../../json';
|
||||
import { LogicXML } from '../../xml';
|
||||
import { Mapper } from './Mapper';
|
||||
import {IAssetData} from '../../json';
|
||||
import {LogicXML} from '../../xml';
|
||||
import {Mapper} from './Mapper';
|
||||
import {ISoundSample} from "../../json/asset/ISoundSample";
|
||||
|
||||
export class LogicMapper extends Mapper
|
||||
{
|
||||
@ -64,6 +65,12 @@ export class LogicMapper extends Mapper
|
||||
|
||||
if(xml.credits !== undefined) output.credits = xml.credits.value;
|
||||
|
||||
if(xml.soundSample !== undefined) output.soundSample = xml.soundSample.id;
|
||||
if(xml.soundSample !== undefined)
|
||||
{
|
||||
output.soundSample = {
|
||||
id: xml.soundSample.id,
|
||||
noPitch: xml.soundSample.noPitch
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
export class SoundSampleXML
|
||||
{
|
||||
private readonly _id: number;
|
||||
private readonly _noPitch: boolean;
|
||||
|
||||
constructor(xml: any)
|
||||
{
|
||||
@ -9,6 +10,7 @@ export class SoundSampleXML
|
||||
if(attributes !== undefined)
|
||||
{
|
||||
if(attributes.id !== undefined) this._id = parseInt(attributes.id);
|
||||
if(attributes.nopitch !== undefined) this._noPitch = attributes.nopitch === 'true';
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,4 +18,9 @@ export class SoundSampleXML
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
get noPitch(): boolean
|
||||
{
|
||||
return this._noPitch;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user