fix: set correct inventory name for floor, wallpapers and landscapes

This commit is contained in:
Niklas 2023-03-19 17:07:56 +01:00
parent 48c22e0a75
commit c44382e619
1 changed files with 21 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import {IObjectData, IRoomEngine, TraxSongInfoMessageEvent} from "@nitro/renderer";
import {IObjectData, IRoomEngine, SongDataEntry, TraxSongInfoMessageEvent} from "@nitro/renderer";
import {GetNitroInstance} from "../nitro";
import {LocalizeText} from "../utils";
@ -302,6 +302,15 @@ export class GroupItem {
this.clearTraxSongInfoEvent();
this._name = songInfo.creator;
return;
case FurniCategory.FLOOR:
key = "inventory.furni.item.floor.name";
break;
case FurniCategory.WALL_PAPER:
key = "inventory.furni.item.wallpaper.name";
break;
case FurniCategory.LANDSCAPE:
key = "inventory.furni.item.landscape.name";
break;
default:
if (this.isWallItem) {
key = "wallItem.name." + k.type;
@ -322,6 +331,7 @@ export class GroupItem {
return;
}
let key = "";
switch (this._category) {
case FurniCategory.TRAX_SONG:
const songInfo = GetNitroInstance().soundManager.musicController.getSongInfo(k.extra) as SongDataEntry;
@ -330,11 +340,20 @@ export class GroupItem {
this.clearTraxSongInfoEvent();
this._description = songInfo.name;
return;
case FurniCategory.FLOOR:
key = "inventory.furni.item.floor.desc";
break;
case FurniCategory.WALL_PAPER:
key = "inventory.furni.item.wallpaper.desc";
break;
case FurniCategory.LANDSCAPE:
key = "inventory.furni.item.landscape.desc";
break;
default:
break;
}
this._description = "";
this._description = LocalizeText(key);
}
private setIcon(): void {