mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-26 17:30:52 +01:00
Sound samples
This commit is contained in:
parent
f37a028fc1
commit
fe3c695156
@ -13,6 +13,7 @@ export interface IAssetData {
|
||||
logicType?: string;
|
||||
maskType?: string;
|
||||
credits?: string;
|
||||
soundSample: number;
|
||||
action?: { link?: string, startState?: number };
|
||||
spritesheet?: ISpritesheetData;
|
||||
dimensions?: IAssetDimension;
|
||||
|
@ -63,5 +63,7 @@ export class LogicMapper extends Mapper
|
||||
if(xml.mask !== undefined) output.maskType = xml.mask.type;
|
||||
|
||||
if(xml.credits !== undefined) output.credits = xml.credits.value;
|
||||
|
||||
if(xml.soundSample !== undefined) output.soundSample = xml.soundSample.id;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { ActionXML } from './ActionXML';
|
||||
import { CreditsXML } from './CreditsXML';
|
||||
import { MaskXML } from './MaskXML';
|
||||
import { ModelXML } from './model/ModelXML';
|
||||
import {SoundSampleXML} from "./SoundSampleXML";
|
||||
|
||||
export class LogicXML
|
||||
{
|
||||
@ -10,6 +11,7 @@ export class LogicXML
|
||||
private readonly _action: ActionXML;
|
||||
private readonly _mask: MaskXML;
|
||||
private readonly _credits: CreditsXML;
|
||||
private readonly _soundSample: SoundSampleXML;
|
||||
|
||||
constructor(xml: any)
|
||||
{
|
||||
@ -39,6 +41,11 @@ export class LogicXML
|
||||
{
|
||||
if(xml.credits[0] !== undefined) this._credits = new CreditsXML(xml.credits[0]);
|
||||
}
|
||||
|
||||
if(xml.sound !== undefined)
|
||||
{
|
||||
if(xml.sound[0] !== undefined) this._soundSample = new SoundSampleXML(xml.sound[0].sample);
|
||||
}
|
||||
}
|
||||
|
||||
public get type(): string
|
||||
@ -65,4 +72,9 @@ export class LogicXML
|
||||
{
|
||||
return this._credits;
|
||||
}
|
||||
|
||||
public get soundSample(): SoundSampleXML | undefined
|
||||
{
|
||||
return this._soundSample;
|
||||
}
|
||||
}
|
||||
|
19
src/mapping/xml/asset/logic/SoundSampleXML.ts
Normal file
19
src/mapping/xml/asset/logic/SoundSampleXML.ts
Normal file
@ -0,0 +1,19 @@
|
||||
export class SoundSampleXML
|
||||
{
|
||||
private readonly _id: number;
|
||||
|
||||
constructor(xml: any)
|
||||
{
|
||||
const attributes = xml[0].$;
|
||||
|
||||
if(attributes !== undefined)
|
||||
{
|
||||
if(attributes.id !== undefined) this._id = parseInt(attributes.id);
|
||||
}
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
}
|
@ -3,3 +3,4 @@ export * from './CreditsXML';
|
||||
export * from './LogicXML';
|
||||
export * from './MaskXML';
|
||||
export * from './model';
|
||||
export * from './SoundSampleXML';
|
||||
|
Loading…
Reference in New Issue
Block a user