DatingEventViewImpl.ts
2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { CCPureView } from "../../../../common/classbase/CCViewBase";
import { RegView } from "../../PresenterCCViewFactory";
import { DatingEventViewType, DatingEventViewProps, DatingEventView } from "../type/DatingEventView";
import { DummyLabel, DummyNode } from "../../../../common/CCDummyObjects";
import { GameRecord } from "../../../../avg/AVG";
const { ccclass, property } = cc._decorator;
@ccclass
@RegView(DatingEventViewType, "prefab/ui/DatingEventView")
export class DatingEventViewImpl extends CCPureView<DatingEventViewProps> implements DatingEventView {
@property(cc.Node)
private arrowGuideNode = DummyNode;
@property(cc.Label)
private roleLikeLabel = DummyLabel;
@property(cc.Label)
private maskLabel = DummyLabel;
onLoad() {
}
showArrowGuide = (isShow: boolean, wordPos?: cc.Vec3) => {
this.arrowGuideNode.active = isShow;
if (isShow && wordPos) {
this.arrowGuideNode.position = this.node.convertToNodeSpaceAR(wordPos);
this.arrowGuideNode.angle = wordPos.y > this.node.height / 2 ? 180 : 0;
}
}
showRoleLikeLabel = () => {
this.roleLikeLabel.string = "艾尔好感:" + this.getRoleLikeByRoleId(3).toString() + "," + "该隐好感:" + this.getRoleLikeByRoleId(4).toString()
+ "," + "系统好感:" + this.getRoleLikeByRoleId(5).toString() + "," + "芙好感:" + this.getRoleLikeByRoleId(8).toString()
+ "," + "布鲁斯好感:" + this.getRoleLikeByRoleId(22).toString();
}
showMaskLabel = () => {
this.maskLabel.string =
"armask:" + this.getMaskValue("armask") + "," + "msmask:" + this.getMaskValue("msmask") + "," + "jsmask:" + this.getMaskValue("jsmask")
+ "," + "bymask:" + this.getMaskValue("bymask") + "," + "gymask:" + this.getMaskValue("gymask")
+ "," + "barmask:" + this.getMaskValue("barmask") + "," + "harmask:" + this.getMaskValue("harmask")
+ "," + "hsmask:" + this.getMaskValue("hsmask") + "," + "szmask:" + this.getMaskValue("szmask")
+ "," + "bzf:" + this.getMaskValue("bzf") + "," + "xs:" + this.getMaskValue("xs") + "," + "fhh:" + this.getMaskValue("fhh")
+ "," + "fyhh:" + this.getMaskValue("fyhh") + "," + "aryc:" + this.getMaskValue("aryc");
}
getMaskValue(maskName: string): number {
let r = GameRecord.recordVariables[maskName] as number;
r = r ? r : 0;
return r;
}
getRoleLikeByRoleId(id: number): number {
let g = GameRecord.globalVariables["like" + id];
g = g ? g : 0;
let r = GameRecord.recordVariables["like" + id];
r = r ? r : 0;
let l = g + r;
return l;
}
}