|
|
@ -5,9 +5,11 @@ import { SceneManager } from "src/app/babylon/controller/scene-manager"; |
|
|
|
import { UIManager } from "src/app/babylon/controller/ui-manager"; |
|
|
|
import { UIManager } from "src/app/babylon/controller/ui-manager"; |
|
|
|
import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; |
|
|
|
import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; |
|
|
|
import { TsTool } from "src/app/babylon/tool/ts-tool"; |
|
|
|
import { TsTool } from "src/app/babylon/tool/ts-tool"; |
|
|
|
|
|
|
|
import { BuildingWindow } from "src/app/babylon/view/building-window/building-window"; |
|
|
|
import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window"; |
|
|
|
import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window"; |
|
|
|
import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; |
|
|
|
import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; |
|
|
|
import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window"; |
|
|
|
import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window"; |
|
|
|
|
|
|
|
import { PropertyData_XYKG } from "../../data/institution/facility/property-data/in/property-data-xykg"; |
|
|
|
import { ModelData } from "../../data/model-data/model-data"; |
|
|
|
import { ModelData } from "../../data/model-data/model-data"; |
|
|
|
import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; |
|
|
|
import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; |
|
|
|
import { BuildingInfo } from "../building/building-info"; |
|
|
|
import { BuildingInfo } from "../building/building-info"; |
|
|
@ -30,6 +32,9 @@ export class ModelInfo_facility extends ModelInfo { |
|
|
|
nameUIRoot: Rectangle; |
|
|
|
nameUIRoot: Rectangle; |
|
|
|
nameText: TextBlock; |
|
|
|
nameText: TextBlock; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//卸油口盖
|
|
|
|
|
|
|
|
bg_xykg: Rectangle; |
|
|
|
|
|
|
|
btn_xykg: Button; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
key: string, |
|
|
|
key: string, |
|
|
@ -47,15 +52,45 @@ export class ModelInfo_facility extends ModelInfo { |
|
|
|
|
|
|
|
|
|
|
|
onCreateFollowUI() { |
|
|
|
onCreateFollowUI() { |
|
|
|
let facilityData = this.modelData as ModelData_facility; |
|
|
|
let facilityData = this.modelData as ModelData_facility; |
|
|
|
|
|
|
|
let instance = this; |
|
|
|
super.onCreateFollowUI(); |
|
|
|
super.onCreateFollowUI(); |
|
|
|
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px"); |
|
|
|
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (facilityData.facilityType == FacilityType.JY_XYKG) { |
|
|
|
|
|
|
|
let l_propertyData = facilityData.propertyData as PropertyData_XYKG; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.bg_xykg = new Rectangle("bg_xykg"); |
|
|
|
|
|
|
|
this.bg_xykg.thickness = 0; |
|
|
|
|
|
|
|
this.bg_xykg.background = BabylonUIStyleTool.c_color_blueBtnBg; |
|
|
|
|
|
|
|
this.bg_xykg.color = BabylonUIStyleTool.c_color_blue;//"#0CB7F7";
|
|
|
|
|
|
|
|
this.bg_xykg.alpha = 0.9; |
|
|
|
|
|
|
|
UIManager.Instance.uiRoot.addControl(this.bg_xykg); |
|
|
|
|
|
|
|
this.bg_xykg.width = '100px'; |
|
|
|
|
|
|
|
this.bg_xykg.height = '26px'; |
|
|
|
|
|
|
|
this.bg_xykg.thickness = 2; |
|
|
|
|
|
|
|
this.bg_xykg.linkWithMesh(this.head); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.btn_xykg = Button.CreateSimpleButton("btn_xykg", "卸油口盖") |
|
|
|
|
|
|
|
this.bg_xykg.addControl(this.btn_xykg); |
|
|
|
|
|
|
|
this.btn_xykg.color = "white"; |
|
|
|
|
|
|
|
this.btn_xykg.top = "2px"; |
|
|
|
|
|
|
|
this.btn_xykg.fontSize = 16; |
|
|
|
|
|
|
|
this.btn_xykg.thickness = 0 |
|
|
|
|
|
|
|
this.btn_xykg.onPointerClickObservable.add(() => { |
|
|
|
|
|
|
|
instance.changeXYKG(undefined) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.bg_xykg.linkWithMesh(this.modelBox) |
|
|
|
|
|
|
|
this.bg_xykg.linkOffsetY = "-30px" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.modelBox.setEnabled(l_propertyData.isClose)
|
|
|
|
|
|
|
|
// instance.changeXYKG(l_propertyData.isClose)
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) { |
|
|
|
if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let instance = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let posType = ConfigManager.getPosType(facilityData.facilityType); |
|
|
|
let posType = ConfigManager.getPosType(facilityData.facilityType); |
|
|
|
let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType); |
|
|
|
let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType); |
|
|
|
|
|
|
|
|
|
|
@ -220,6 +255,9 @@ export class ModelInfo_facility extends ModelInfo { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
playShowAnim(play: boolean) { |
|
|
|
playShowAnim(play: boolean) { |
|
|
|
this.showFollowUI(play); |
|
|
|
this.showFollowUI(play); |
|
|
|
|
|
|
|
if (this.bg_xykg != null) { |
|
|
|
|
|
|
|
this.bg_xykg.isVisible = play; |
|
|
|
|
|
|
|
} |
|
|
|
if (this.modelBox != null) { |
|
|
|
if (this.modelBox != null) { |
|
|
|
let facilityType = (this.modelData as ModelData_facility).facilityType; |
|
|
|
let facilityType = (this.modelData as ModelData_facility).facilityType; |
|
|
|
//消防 或 阀门 持续高亮
|
|
|
|
//消防 或 阀门 持续高亮
|
|
|
@ -245,6 +283,25 @@ export class ModelInfo_facility extends ModelInfo { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 改变卸油口盖 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
changeXYKG(isClose: boolean | undefined) { |
|
|
|
|
|
|
|
// let facilityData = this.modelData as ModelData_facility;
|
|
|
|
|
|
|
|
// let properData = facilityData.propertyData as PropertyData_XYKG
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (isClose == undefined) {
|
|
|
|
|
|
|
|
// isClose = !properData.isClose;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// properData.isClose = isClose;
|
|
|
|
|
|
|
|
// this.modelBox.setEnabled(isClose);
|
|
|
|
|
|
|
|
if (isClose == undefined) { |
|
|
|
|
|
|
|
isClose = !BuildingWindow.instance.currentCloseXYKG; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// console.log("改变卸油口" + isClose)
|
|
|
|
|
|
|
|
BuildingWindow.instance.closeXYKG(isClose) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dispose(disposeMesh?: boolean) { |
|
|
|
dispose(disposeMesh?: boolean) { |
|
|
|
if (this.areaInfo != null) { |
|
|
|
if (this.areaInfo != null) { |
|
|
@ -258,6 +315,10 @@ export class ModelInfo_facility extends ModelInfo { |
|
|
|
this.nameText = null; |
|
|
|
this.nameText = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.bg_xykg != null) { |
|
|
|
|
|
|
|
this.bg_xykg.dispose(); |
|
|
|
|
|
|
|
this.bg_xykg = null; |
|
|
|
|
|
|
|
} |
|
|
|
super.dispose(disposeMesh); |
|
|
|
super.dispose(disposeMesh); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|