mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-22 23:50:52 +01:00
Furniture fix..
This commit is contained in:
parent
3316f6f7b1
commit
bb1381c6db
@ -69,8 +69,8 @@ export default class FurniJsonMapper {
|
|||||||
furniAsset.source = SpriteSheetConverter.imageSource.get(asset.name) as string;
|
furniAsset.source = SpriteSheetConverter.imageSource.get(asset.name) as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
furniAsset.x = parseFloat(asset.x.toString());
|
furniAsset.x = parseInt(asset.x.toString());
|
||||||
furniAsset.y = parseFloat(asset.y.toString());
|
furniAsset.y = parseInt(asset.y.toString());
|
||||||
furniAsset.flipH = asset.flipH as any;
|
furniAsset.flipH = asset.flipH as any;
|
||||||
assets[asset.name] = furniAsset;
|
assets[asset.name] = furniAsset;
|
||||||
}
|
}
|
||||||
@ -89,9 +89,9 @@ export default class FurniJsonMapper {
|
|||||||
|
|
||||||
private static mapLogicXML(logicXML: LogicXML, output: FurniJson) {
|
private static mapLogicXML(logicXML: LogicXML, output: FurniJson) {
|
||||||
output.dimensions = {
|
output.dimensions = {
|
||||||
x: parseFloat(logicXML.model.dimensions.x.toString()),
|
x: parseInt(logicXML.model.dimensions.x.toString()),
|
||||||
y: parseFloat(logicXML.model.dimensions.y.toString()),
|
y: parseInt(logicXML.model.dimensions.y.toString()),
|
||||||
z: parseFloat(logicXML.model.dimensions.z.toString())
|
z: parseInt(logicXML.model.dimensions.z.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
const directions: Array<number> = [];
|
const directions: Array<number> = [];
|
||||||
@ -99,7 +99,7 @@ export default class FurniJsonMapper {
|
|||||||
directions.push(0);
|
directions.push(0);
|
||||||
} else {
|
} else {
|
||||||
for (const direction of logicXML.model.directions) {
|
for (const direction of logicXML.model.directions) {
|
||||||
directions.push(parseFloat(direction.id.toString()));
|
directions.push(parseInt(direction.id.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,9 +128,9 @@ export default class FurniJsonMapper {
|
|||||||
for (const visualization of visualizationData.visualizations) {
|
for (const visualization of visualizationData.visualizations) {
|
||||||
if (visualization.size == FurniJsonMapper.VISUALIZATION_DEFAULT_SIZE || visualization.size == FurniJsonMapper.VISUALIZATION_ICON_SIZE) {
|
if (visualization.size == FurniJsonMapper.VISUALIZATION_DEFAULT_SIZE || visualization.size == FurniJsonMapper.VISUALIZATION_ICON_SIZE) {
|
||||||
const visualizationJson: Visualization = {} as any;
|
const visualizationJson: Visualization = {} as any;
|
||||||
visualizationJson.angle = parseFloat(visualization.angle.toString());
|
visualizationJson.angle = parseInt(visualization.angle.toString());
|
||||||
visualizationJson.layerCount = parseFloat(visualization.layerCount.toString());
|
visualizationJson.layerCount = parseInt(visualization.layerCount.toString());
|
||||||
visualizationJson.size = parseFloat(visualization.size.toString());
|
visualizationJson.size = parseInt(visualization.size.toString());
|
||||||
|
|
||||||
FurniJsonMapper.mapVisualizationLayerXML(visualization, visualizationJson);
|
FurniJsonMapper.mapVisualizationLayerXML(visualization, visualizationJson);
|
||||||
FurniJsonMapper.mapVisualizationDirectionXML(visualization, visualizationJson);
|
FurniJsonMapper.mapVisualizationDirectionXML(visualization, visualizationJson);
|
||||||
@ -159,9 +159,13 @@ export default class FurniJsonMapper {
|
|||||||
layer.alpha = layerXML.alpha;
|
layer.alpha = layerXML.alpha;
|
||||||
layer.ink = layerXML.ink;
|
layer.ink = layerXML.ink;
|
||||||
layer.tag = layerXML.tag;
|
layer.tag = layerXML.tag;
|
||||||
layer.x = parseFloat(layerXML.x.toString());
|
|
||||||
layer.y = parseFloat(layerXML.y.toString());
|
if (layerXML.x !== undefined)
|
||||||
layer.z = parseFloat(layerXML.z.toString());
|
layer.x = parseInt(layerXML.x.toString());
|
||||||
|
if (layerXML.y !== undefined)
|
||||||
|
layer.y = parseInt(layerXML.y.toString());
|
||||||
|
if (layerXML.z !== undefined)
|
||||||
|
layer.z = parseInt(layerXML.z.toString());
|
||||||
layer.ignoreMouse = layerXML.ignoreMouse as any;
|
layer.ignoreMouse = layerXML.ignoreMouse as any;
|
||||||
|
|
||||||
layers[layerXML.id] = layer;
|
layers[layerXML.id] = layer;
|
||||||
@ -224,8 +228,11 @@ export default class FurniJsonMapper {
|
|||||||
for (const animationXML of visXML.animations) {
|
for (const animationXML of visXML.animations) {
|
||||||
if (animationXML.layers.length > 0) {
|
if (animationXML.layers.length > 0) {
|
||||||
const animation: Animation = {} as any;
|
const animation: Animation = {} as any;
|
||||||
animation.transitionTo = animationXML.transitionTo;
|
|
||||||
animation.transitionFrom = animationXML.transitionFrom;
|
if (animationXML.transitionTo !== undefined)
|
||||||
|
animation.transitionTo = parseInt(animationXML.transitionTo.toString());
|
||||||
|
if (animationXML.transitionFrom !== undefined)
|
||||||
|
animation.transitionFrom = parseInt(animationXML.transitionFrom.toString());
|
||||||
animation.immediateChangeFrom = animationXML.immediateChangeFrom;
|
animation.immediateChangeFrom = animationXML.immediateChangeFrom;
|
||||||
|
|
||||||
animation.layers = FurniJsonMapper.mapVisualizationAnimationLayerXML(animationXML);
|
animation.layers = FurniJsonMapper.mapVisualizationAnimationLayerXML(animationXML);
|
||||||
|
@ -63,6 +63,8 @@ export default class FurnitureDownloader {
|
|||||||
async extractFurniture(revision: string, className: string, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>) {
|
async extractFurniture(revision: string, className: string, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>) {
|
||||||
//if (className !== "rare_dragonlamp" && className !== "tiki_bflies" && className !== "room_wl15_ele") return;
|
//if (className !== "rare_dragonlamp" && className !== "tiki_bflies" && className !== "room_wl15_ele") return;
|
||||||
|
|
||||||
|
//if (className !== 'scifidoor') return;
|
||||||
|
|
||||||
const url = this._config.getValue("dynamic.download.url.furniture").replace("%revision%", revision).replace("%className%", className);
|
const url = this._config.getValue("dynamic.download.url.furniture").replace("%revision%", revision).replace("%className%", className);
|
||||||
const file = new File(url);
|
const file = new File(url);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user