|
@@ -25,7 +25,17 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
this.data.Num = 1
|
|
|
}
|
|
|
this.data.Properties.Num = this._num
|
|
|
- this.text = `${this.data.Name}${this.data.Num > 1 ? ` × ${this.data.Num}` : ''}`
|
|
|
+ this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`
|
|
|
+ this.update()
|
|
|
+ }
|
|
|
+
|
|
|
+ get text(): string {
|
|
|
+ return this.textItem.text
|
|
|
+ }
|
|
|
+ set text(v: string) {
|
|
|
+ this.name = v
|
|
|
+ this.data.Name = v
|
|
|
+ this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`
|
|
|
this.update()
|
|
|
}
|
|
|
|
|
@@ -55,17 +65,15 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
this.data = data
|
|
|
this.id = data.ID
|
|
|
this.name = data.Name
|
|
|
+ this.text = data.Name
|
|
|
this.moveTo(data.Pos.X, data.Pos.Y)
|
|
|
if (data.Num) {
|
|
|
- this._num = data.Num
|
|
|
+ this.num = data.Num
|
|
|
}
|
|
|
if (data.Size) {
|
|
|
this.width = data.Size.Width
|
|
|
this.height = data.Size.Height
|
|
|
}
|
|
|
- if (data.Num) {
|
|
|
- this.text = `${data.Name}${data.Num > 1 ? ` × ${data.Num}` : ''}`
|
|
|
- }
|
|
|
if (data.Properties && data.Properties.Url) {
|
|
|
this.img.url = data.Properties.Url
|
|
|
}
|