|
|
|
@ -288,7 +288,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
console.log(this.backgroundImage.toLocal(this.mousePosition)); |
|
|
|
|
break; |
|
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
|
console.log(this.canvasData.selectStorey); |
|
|
|
|
const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); |
|
|
|
|
const list = []; |
|
|
|
|
json.forEach(element => { |
|
|
|
|
const property = new PropertyInfo(element); |
|
|
|
|
list.push(property); |
|
|
|
|
}); |
|
|
|
|
const assetData = { |
|
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
@ -306,16 +311,14 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
MultiPoint : null, |
|
|
|
|
Point: new PIXI.Point(this.previewSinglePointIcon.x, this.previewSinglePointIcon.y), |
|
|
|
|
Name : this.canvasData.selectTemplateData.name, |
|
|
|
|
PropertyInfos: JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)), |
|
|
|
|
PropertyInfos: list, |
|
|
|
|
Border : this.canvasData.selectTemplateData.border, |
|
|
|
|
DrawMode : this.canvasData.selectTemplateData.drawMode, |
|
|
|
|
Thickness : this.canvasData.selectTemplateData.thickness, |
|
|
|
|
IsFromBuilding : this.canvasData.selectTemplateData.isFromBuilding, |
|
|
|
|
GameMode : GameMode.BasicInformation |
|
|
|
|
}; |
|
|
|
|
console.log(assetData); |
|
|
|
|
const singleIcon = new SinglePointIcon(assetData, this); |
|
|
|
|
// this.createSinglePointIcon(this.canvasData.selectTemplateData.imageUrl, this.previewSinglePointIcon.x, this.previewSinglePointIcon.y, 32, 32, 1, this.canvasData.selectTemplateData.name);
|
|
|
|
|
break; |
|
|
|
|
case PaintMode.lineIcon: |
|
|
|
|
this.previewLineSegment.visible = true; |
|
|
|
@ -329,14 +332,44 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
if (this.paintingIcon !== null) { |
|
|
|
|
this.backgroundImage.removeChild(this.paintingIcon); |
|
|
|
|
} |
|
|
|
|
const jsonObject = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); |
|
|
|
|
const propertyList = []; |
|
|
|
|
jsonObject.forEach(element => { |
|
|
|
|
const property = new PropertyInfo(element); |
|
|
|
|
propertyList.push(property); |
|
|
|
|
}); |
|
|
|
|
const assetData1 = { |
|
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
|
Point: new PIXI.Point(0, 0), |
|
|
|
|
Width: 32, |
|
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
|
|
Color: this.canvasData.selectTemplateData.color, |
|
|
|
|
Enabled: this.canvasData.selectTemplateData.enabled, |
|
|
|
|
FillMode: this.canvasData.selectTemplateData.fillMode, |
|
|
|
|
FireElementId: this.canvasData.selectTemplateData.fireElementId, |
|
|
|
|
FixedSize: this.canvasData.selectTemplateData.fixedSize, |
|
|
|
|
Height: 32, |
|
|
|
|
Width: 32, |
|
|
|
|
Id: Guid.NewGuid().ToString(), |
|
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
|
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode, |
|
|
|
|
MultiPoint: this.paintPoints, |
|
|
|
|
Name: this.canvasData.selectTemplateData.name |
|
|
|
|
Point: new PIXI.Point(0, 0), |
|
|
|
|
Name: this.canvasData.selectTemplateData.name, |
|
|
|
|
PropertyInfos: propertyList, |
|
|
|
|
Border: this.canvasData.selectTemplateData.border, |
|
|
|
|
DrawMode: this.canvasData.selectTemplateData.drawMode, |
|
|
|
|
Thickness: this.canvasData.selectTemplateData.thickness, |
|
|
|
|
IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, |
|
|
|
|
GameMode: GameMode.BasicInformation |
|
|
|
|
}; |
|
|
|
|
// const assetData1 = {
|
|
|
|
|
// ImageUrl: this.canvasData.selectTemplateData.imageUrl,
|
|
|
|
|
// Point: new PIXI.Point(0, 0),
|
|
|
|
|
// Width: 32,
|
|
|
|
|
// Height: 32,
|
|
|
|
|
// MultiPoint: this.paintPoints,
|
|
|
|
|
// Name: this.canvasData.selectTemplateData.name
|
|
|
|
|
// };
|
|
|
|
|
this.paintingIcon = new MultipointIcon(assetData1, this); |
|
|
|
|
// this.paintingIcon = new MultipointIcon(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this,
|
|
|
|
|
// this.canvasData.selectTemplateData.name);
|
|
|
|
@ -561,10 +594,35 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
|
|
|
|
|
case PaintMode.polygonIcon: |
|
|
|
|
this.paintingLine.clear(); |
|
|
|
|
if (this.paintPoints.length >= 3) { |
|
|
|
|
const jsonList = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); |
|
|
|
|
const propertyList = []; |
|
|
|
|
jsonList.forEach(element => { |
|
|
|
|
const property = new PropertyInfo(element); |
|
|
|
|
propertyList.push(property); |
|
|
|
|
}); |
|
|
|
|
const assetData = { |
|
|
|
|
Point: new PIXI.Point(0, 0), |
|
|
|
|
TemplateId: this.canvasData.selectTemplateData.id, |
|
|
|
|
FloorId: this.canvasData.selectStorey.id, |
|
|
|
|
Angle: this.canvasData.selectTemplateData.angle, |
|
|
|
|
Color: this.canvasData.selectTemplateData.color, |
|
|
|
|
Enabled: this.canvasData.selectTemplateData.enabled, |
|
|
|
|
FillMode: this.canvasData.selectTemplateData.fillMode, |
|
|
|
|
FireElementId: this.canvasData.selectTemplateData.fireElementId, |
|
|
|
|
FixedSize: this.canvasData.selectTemplateData.fixedSize, |
|
|
|
|
Height: 32, |
|
|
|
|
Width: 32, |
|
|
|
|
Id: Guid.NewGuid().ToString(), |
|
|
|
|
ImageUrl: this.canvasData.selectTemplateData.imageUrl, |
|
|
|
|
InteractiveMode: this.canvasData.selectTemplateData.interactiveMode, |
|
|
|
|
MultiPoint: this.paintPoints, |
|
|
|
|
Name: this.canvasData.selectTemplateData.name |
|
|
|
|
Point: new PIXI.Point(0, 0), |
|
|
|
|
Name: this.canvasData.selectTemplateData.name, |
|
|
|
|
PropertyInfos: propertyList, |
|
|
|
|
Border: this.canvasData.selectTemplateData.border, |
|
|
|
|
DrawMode: this.canvasData.selectTemplateData.drawMode, |
|
|
|
|
Thickness: this.canvasData.selectTemplateData.thickness, |
|
|
|
|
IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, |
|
|
|
|
GameMode: GameMode.BasicInformation |
|
|
|
|
}; |
|
|
|
|
const polygonIcon = new PolygonIcon(assetData, this); |
|
|
|
|
} |
|
|
|
@ -1048,10 +1106,72 @@ export class Guid {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 游戏状态
|
|
|
|
|
/// </summary>
|
|
|
|
|
/** |
|
|
|
|
* 游戏状态 |
|
|
|
|
*/ |
|
|
|
|
enum GameMode { |
|
|
|
|
BasicInformation, |
|
|
|
|
Assignment |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 属性 |
|
|
|
|
*/ |
|
|
|
|
export class PropertyInfo { |
|
|
|
|
constructor(instanceData: any) { |
|
|
|
|
this.Tag = instanceData.tag; |
|
|
|
|
this.Order = instanceData.order; |
|
|
|
|
this.Enabled = instanceData.enabled; |
|
|
|
|
this.Visible = instanceData.visible; |
|
|
|
|
this.Required = instanceData.required; |
|
|
|
|
this.RuleName = instanceData.ruleName; |
|
|
|
|
this.RuleValue = instanceData.ruleValue; |
|
|
|
|
this.PhysicalUnit = instanceData.physicalUnit; |
|
|
|
|
this.PropertyName = instanceData.propertyName; |
|
|
|
|
this.PropertyType = instanceData.propertyType; |
|
|
|
|
this.PropertyValue = instanceData.propertyValue; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 标记位,用于扩展 |
|
|
|
|
*/ |
|
|
|
|
public Tag: string; |
|
|
|
|
/** |
|
|
|
|
* 属性书序 |
|
|
|
|
*/ |
|
|
|
|
public Order: number; |
|
|
|
|
/** |
|
|
|
|
* 是否启用 |
|
|
|
|
*/ |
|
|
|
|
public Enabled: boolean; |
|
|
|
|
/** |
|
|
|
|
* 是否可见 |
|
|
|
|
*/ |
|
|
|
|
public Visible: boolean; |
|
|
|
|
/** |
|
|
|
|
* 必填 |
|
|
|
|
*/ |
|
|
|
|
public Required: boolean; |
|
|
|
|
/** |
|
|
|
|
* 验证规则名称 |
|
|
|
|
*/ |
|
|
|
|
public RuleName: string; |
|
|
|
|
/** |
|
|
|
|
* 验证规则值 |
|
|
|
|
*/ |
|
|
|
|
public RuleValue: string; |
|
|
|
|
/** |
|
|
|
|
* 物理单位 |
|
|
|
|
*/ |
|
|
|
|
public PhysicalUnit: string; |
|
|
|
|
/** |
|
|
|
|
* 属性名称 |
|
|
|
|
*/ |
|
|
|
|
public PropertyName: string; |
|
|
|
|
/** |
|
|
|
|
* 属性类型 |
|
|
|
|
*/ |
|
|
|
|
public PropertyType: number; |
|
|
|
|
/** |
|
|
|
|
* 属性值 |
|
|
|
|
*/ |
|
|
|
|
public PropertyValue: string; |
|
|
|
|
} |
|
|
|
|