调整哈尔滨线路扣车状态

This commit is contained in:
zyy 2020-03-07 11:05:38 +08:00
parent 157a505e72
commit a1416b9a23
3 changed files with 21 additions and 9 deletions

View File

@ -242,7 +242,7 @@ class SkinCode extends defaultStyle {
detainCar: { // 扣车
text: '扣', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -20}, // 扣车偏移量
offset: {x: -8, y: 13}, // 扣车偏移量
trainColor: '#FFFF00', // 车站扣车颜色
centerTrainColor: '#C0C0C0', // 中心扣车颜色
andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色

View File

@ -42,6 +42,7 @@ class EDetain extends Group {
position = -model.width / 4 - gagX;
}
}
console.log(textName);
this.detain = new Text({
zlevel: model.zlevel,
z: model.z,
@ -90,14 +91,13 @@ class EDetain extends Group {
this.detain.hide();
}
show() {
if (this.model.style.StationStand.common.special) {
this.detain.setStyle('text', 'H');
show(nameText) {
if (this.model.style.StationStand.common.special && nameText) {
this.detain.setStyle('text', nameText);
} else {
this.create('H');
this.create();
this.detain.show();
}
}
}

View File

@ -416,19 +416,31 @@ class StationStand extends Group {
/** 车站扣车*/
standDetainTrain() {
this.detain && this.detain.show();
if (this.style.StationStand.common.special) {
this.detain && this.detain.show('H');
} else {
this.detain && this.detain.show();
}
this.detain && this.detain.setColor(this.style.StationStand.detainCar.detainTrainTextColor);
}
/** 中心扣车*/
centerDetainTrain() {
this.detain && this.detain.show();
if (this.style.StationStand.common.special) {
this.detain && this.detain.show('H');
} else {
this.detain && this.detain.show();
}
this.detain && this.detain.setColor(this.style.StationStand.detainCar.centerTrainColor);
}
/** 中心+车站扣车*/
standAndCenterDetainTrain() {
this.detain && this.detain.show();
if (this.style.StationStand.common.special) {
this.detain && this.detain.show('H');
} else {
this.detain && this.detain.show();
}
this.detain && this.detain.setColor(this.style.StationStand.detainCar.andCenterTrainColor);
}