Commit 00056735 by 张树文

删除

1 parent 7caf4b12
Showing with 55 additions and 1412 deletions
...@@ -85,21 +85,18 @@ ...@@ -85,21 +85,18 @@
}, },
{ {
"__id__": 35 "__id__": 35
},
{
"__id__": 37
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 39 "__id__": 37
}, },
{ {
"__id__": 40 "__id__": 38
}, },
{ {
"__id__": 41 "__id__": 39
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -189,7 +186,7 @@ ...@@ -189,7 +186,7 @@
"array": [ "array": [
0, 0,
0, 0,
731.7914661978507, 513.5530644441722,
0, 0,
0, 0,
0, 0,
...@@ -1418,80 +1415,6 @@ ...@@ -1418,80 +1415,6 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "touchEffect",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 34
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3cGlGRwm5Pm4yzPEtaE0G4"
},
{
"__type__": "b96c8PkrHNC8aetxvcDIrfF",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"isWidget": true,
"_widgetTarget": null,
"_id": "3afTENgN1ALotmh82PBYgd"
},
{
"__type__": "cc.Node",
"_name": "ToastRoot", "_name": "ToastRoot",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
...@@ -1501,7 +1424,7 @@ ...@@ -1501,7 +1424,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 34
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1557,7 +1480,7 @@ ...@@ -1557,7 +1480,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1590,7 +1513,7 @@ ...@@ -1590,7 +1513,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 38 "__id__": 36
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1646,7 +1569,7 @@ ...@@ -1646,7 +1569,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 35
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1730,7 +1653,7 @@ ...@@ -1730,7 +1653,7 @@
"__id__": 29 "__id__": 29
}, },
"toastParentNode": { "toastParentNode": {
"__id__": 35 "__id__": 33
}, },
"loadingNode": { "loadingNode": {
"__id__": 5 "__id__": 5
...@@ -1746,7 +1669,7 @@ ...@@ -1746,7 +1669,7 @@
"__id__": 25 "__id__": 25
}, },
"hotUpdateNode": { "hotUpdateNode": {
"__id__": 37 "__id__": 35
}, },
"bgSpr": { "bgSpr": {
"__id__": 7 "__id__": 7
......
const { ccclass, property } = cc._decorator;
@ccclass
export default class FireComponent extends cc.Component {
@property
isWidget: boolean = false;
@property(cc.Node)
_widgetTarget: cc.Node = null;
// @property(cc.Node)
/** 烟火数量 */
private fire_count = 35;// 原始100个
/** 烟火衰减速度 */
private gap_alpha = 0.02;// 原始0.005
public get widgetTarget() {
return this._widgetTarget;
}
public set widgetTarget(value) {
this._widgetTarget = value;
this.isWidget = !!this._widgetTarget;
if (!CC_EDITOR) {
this.initWidgit();
}
}
private gfx: cc.Graphics = null;
private particles: any[] = [];
onLoad() {
this.gfx = this.node.getComponent(cc.Graphics) || this.node.addComponent(cc.Graphics);
// widgit
this.initWidgit();
// touch
// this.initTouch();
this.InitTouch();
}
private initWidgit() {
// 全屏适配
if (!this.isWidget) return;
let canvas = cc.find("Canvas");
let widget = this.node.addComponent(cc.Widget);
widget.target = this.widgetTarget || canvas;
widget.isAlignTop = true;
widget.isAlignLeft = true;
widget.isAlignRight = true;
widget.isAlignBottom = true;
widget.left = 0;
widget.right = 0;
widget.top = 0;
widget.bottom = 0;
widget.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE;
}
private initTouch() {
// 点击事件
// this.node.on(cc.Node.EventType.TOUCH_END, (event: cc.Event.EventTouch) => {
// let wpos = event.getLocation();
// let npos = this.node.convertToNodeSpaceAR(wpos);
// this.fire(npos.x, npos.y);
// })
}
private ClickCall(event) {
let wpos = event.getLocation();
let npos = this.node.convertToNodeSpaceAR(wpos);
this.fire(npos.x, npos.y);
}
private fire(x, y) {
// 生成烟花
this.gfx.clear();
this.createFireworks(x, y);
}
private tick() {
this.gfx.fillColor = cc.color(255, 255, 255, 0);//0, 0, 0, 26
this.gfx.fillRect(-this.node.width / 2, -this.node.height / 2, this.node.width, this.node.height);
this.drawFireworks();
}
private createFireworks(sx, sy) {
this.particles = [];
var hue = Math.floor(Math.random() * 51) + 150;
var hueVariance = 60;// 30
for (var i = 0; i < this.fire_count; i++) {
var angle = Math.floor(Math.random() * 360);
var p = {
radians: angle * Math.PI / 180,
x: sx,
y: sy,
speed: (Math.random() * 5) + .4,
radius: 0,
size: Math.floor(Math.random() * 3) + 1,
hue: Math.floor(Math.random() * 2 * hueVariance) + (hue - hueVariance),
brightness: Math.floor(Math.random() * 31) + 50,
alpha: (Math.floor(Math.random() * 61) + 40) / 100
};
p.radius = p.speed;
this.particles.push(p);
}
}
private drawFireworks() {
// this.gfx.clear();
let isDraw = false;
for (var i = 0; i < this.particles.length; i++) {
var p = this.particles[i];
var vx = Math.cos(p.radians) * p.radius;
var vy = Math.sin(p.radians) * p.radius + 0.4;
p.x -= vx;
p.y -= vy;
p.radius *= 1 - p.speed / 100;
p.alpha -= this.gap_alpha;// 0.005
if (p.alpha > 0) {
isDraw = true;
this.gfx.arc(p.x, p.y, p.size, 0, Math.PI * 2, false);
this.gfx.fillColor = this.hsla2rgba('hsla(' + p.hue + ', 100%, ' + p.brightness + '%)', p.alpha);
this.gfx.fill();
}
}
if (!isDraw) {
this.gfx.clear();
}
}
private hsla2rgba(str, alpha): cc.Color {
const colorArr = str.match(/\d+/g);
let [h, s, l] = colorArr;
h = parseFloat(h) / 360;
s = parseFloat(s) / 100;
l = parseFloat(l) / 100;
if (s === 0) {
l = Math.round(l * 255);
return cc.color(l, l, l, Math.round(alpha * 255));
}
const getRGB = num => {
let q = l >= 0.5 ? l + s - l * s : l * (1 + s); // 注意是数字1加上s,不是字母l
let p = 2 * l - q;
if (num < 0) {
num += 1;
}
if (num > 1) {
num -= 1;
}
switch (true) {
case num > 2 / 3:
num = p;
break;
case num >= 1 / 2:
num = p + (q - p) * 6 * (2 / 3 - num);
break;
case num >= 1 / 6:
num = q;
break;
default:
num = p + (q - p) * 6 * num;
break;
}
return Math.round(num * 255);
};
let r = getRGB(h + 1 / 3);
let g = getRGB(h);
let b = getRGB(h - 1 / 3);
return cc.color(r, g, b, Math.round(alpha * 255));
}
update() {
this.tick();
}
///////////////// 自定义触摸监听 /////////////////
private _eventManager = cc["internal"]["eventManager"];
private _touchListener: any;
private InitTouch() {
const EventListener = cc["EventListener"];
this._touchListener = EventListener.create({
event: EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: false,//是否吞噬touch事件
owner: this.node,
mask: null,
onTouchBegan: this.onTouchStart.bind(this),
onTouchMoved: null,
onTouchEnded: this.onTouchEnded.bind(this),
onTouchCancelled: null,
});
this._eventManager.addListener(this._touchListener, this.node);
}
private onTouchStart(touch: cc.Touch, event: cc.Event.EventTouch): boolean {
// cc.log("touch start");
//此处必须返回true(表示接触到了节点),否则TOUCH_MOVE,TOUCH_END,TOUCH_CANCEL不触发。
return true;
}
private onTouchEnded(touch: cc.Touch, event: cc.Event.EventTouch): void {
// cc.log("touch end");
this.ClickCall(touch);
}
protected onDestroy(): void {
// super.onDestroy();
this._eventManager.removeListener(this._touchListener, this.node);
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "b96c83e4-ac73-42f1-a7ad-c6f70322b7c5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -282,8 +282,6 @@ export enum MainTabs { ...@@ -282,8 +282,6 @@ export enum MainTabs {
messageTab, messageTab,
/**约会 */ /**约会 */
datingEventTab, datingEventTab,
/**卧室 */
bedroomTab,
/**发现 */ /**发现 */
discoverTab discoverTab
} }
......
...@@ -48,7 +48,6 @@ import { SDK } from "simba-sdk"; ...@@ -48,7 +48,6 @@ import { SDK } from "simba-sdk";
const TabPresenterFactory: ({ new(): Presenter } & { uuid: string })[] = [ const TabPresenterFactory: ({ new(): Presenter } & { uuid: string })[] = [
MessageViewPresenter, MessageViewPresenter,
DatingEventViewPresenter, DatingEventViewPresenter,
BedroomViewPresenter,
DiscoverViewPresenter DiscoverViewPresenter
]; ];
/**主线剧情的下标 */ /**主线剧情的下标 */
...@@ -73,14 +72,9 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -73,14 +72,9 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
selectedTab: 0, selectedTab: 0,
messageRedDot: false, messageRedDot: false,
datingEventRedDot: false, datingEventRedDot: false,
waitRedDot: false,
discoverRedDot: false, discoverRedDot: false,
onTabClick: this.onTabClick, onTabClick: this.onTabClick,
onDebugClick: this.onDebugClickCallback, onDebugClick: this.onDebugClickCallback,
onUrgentNoticeClick: this.onUrgentNoticeClickCallback,
onGoToShopClick: this.onGoToShopClickCallback,
onCommonProblemClick: this.onCommonProblemClickCallback,
onRewardBtnClickCallback: this.onRewardBtnClickCallback,
}; };
} }
...@@ -192,8 +186,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -192,8 +186,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager.dealAutoResumeFullEnergy(); GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
this.view.showWaitingView(false); this.view.showWaitingView(false);
...@@ -283,8 +275,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -283,8 +275,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
onEnterBackground() { onEnterBackground() {
super.onEnterBackground(); super.onEnterBackground();
this.view.updateBedRoomRedDot();//更新卧室界面红点
this.updateRewardBtnRedDot();
if (this._subPresenters[this._currentTab]) if (this._subPresenters[this._currentTab])
this._subPresenters[this._currentTab].onEnterBackground(); this._subPresenters[this._currentTab].onEnterBackground();
} }
...@@ -302,8 +292,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -302,8 +292,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
if (!GameConfig.isVerb) { if (!GameConfig.isVerb) {
GameModelManager.checkAutoPopView(); GameModelManager.checkAutoPopView();
} }
this.view.updateBedRoomRedDot();//更新卧室界面红点
this.updateRewardBtnRedDot();
} }
onShow() { onShow() {
...@@ -315,15 +303,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -315,15 +303,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
if (!this._tabClickAble) { if (!this._tabClickAble) {
return; return;
} }
// if (isDot != false) {
// let uiName = ["click_message", "click_event", "click_wait", "click_finding"];
// GameDotMgr.getInstance().dotClickUI(uiName[index]);
// }
this.view.updateBedRoomRedDot();//更新卧室界面红点
this.updateRewardBtnRedDot();
this._view.showRewardBtn(index !== MainTabs.bedroomTab);
this._view.showBottonsNode(index !== MainTabs.bedroomTab);
this._view.showSubGameNode(index !== MainTabs.bedroomTab);
this.dealTabGuide(index); this.dealTabGuide(index);
let uuid = TabPresenterFactory[index].uuid; let uuid = TabPresenterFactory[index].uuid;
if (!GameModelManager.checkFuncUnloced(uuid)) { if (!GameModelManager.checkFuncUnloced(uuid)) {
...@@ -351,7 +330,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -351,7 +330,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== MainTabs.bedroomTab);
}); });
} else { } else {
if (this._subPresenters[this._currentTab]) { if (this._subPresenters[this._currentTab]) {
...@@ -360,7 +338,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -360,7 +338,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== MainTabs.bedroomTab);
} }
} else { } else {
if (callback) { if (callback) {
...@@ -385,7 +362,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -385,7 +362,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
let index = GameModelManager.getMainTabGuideIndex(); let index = GameModelManager.getMainTabGuideIndex();
if (index !== -1) { if (index !== -1) {
//attention //attention
let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.waitRedDot, this._viewProps.discoverRedDot]; let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.discoverRedDot];
if (!redDotArr[index] || this._currentTab === index) { if (!redDotArr[index] || this._currentTab === index) {
return; return;
} }
...@@ -575,23 +552,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -575,23 +552,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager.dealAutoResumeFullEnergy(); GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
}
updateRewardBtnRedDot() {
for (let i = 1; i < 4; i++) {
let catRewardStatus = BedRoomCatModelManager.getCatRewardStatus(i);
for (let j = 0; j < catRewardStatus.length; j++) {
if (catRewardStatus[j] == 1) {
this.view.getRewardRedDotNode().active = true;
return;
} else {
this.view.getRewardRedDotNode().active = false;
}
}
}
} }
/** /**
...@@ -609,10 +569,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -609,10 +569,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
tab = MainTabs.datingEventTab tab = MainTabs.datingEventTab
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
break; break;
case PageIndex.BedroomView:
tab = MainTabs.bedroomTab
this._view.onTabButtonClick(null, `${tab}`);
break;
case PageIndex.ExtraPlotView: case PageIndex.ExtraPlotView:
tab = MainTabs.datingEventTab tab = MainTabs.datingEventTab
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
......
import { DummyLabel, DummyNode, DummySprite } from "../../../../common/CCDummyObjects"; import { DummyLabel, DummyNode, DummySprite } from "../../../../common/CCDummyObjects";
import { CCPureView, CCView } from "../../../../common/classbase/CCViewBase"; import { CCPureView, CCView } from "../../../../common/classbase/CCViewBase";
import { View } from "../../../../common/classbase/ViewBase"; import { View } from "../../../../common/classbase/ViewBase";
import CCGameCenterNodeFactory from "../../../../cooperation/script/CCGameCenterNodeFactory";
import { channel, GameConfig } from "../../../../GameConfig"; import { channel, GameConfig } from "../../../../GameConfig";
import { DirectionType, MainTabs } from "../../../Enums"; import { DirectionType, MainTabs } from "../../../Enums";
import { UnlockItemModelManager } from "../../../model/UnlockItemModelManager";
import UnlockSpecialPlotEventManager from "../../../model/UnlockSpecialPlotEventManager";
import { GuideViewParamModel } from "../../presenter/GuideViewPresenter"; import { GuideViewParamModel } from "../../presenter/GuideViewPresenter";
import { RegView } from "../../PresenterCCViewFactory"; import { RegView } from "../../PresenterCCViewFactory";
import { MainView, MainViewProps, MainViewType } from "../type/MainView"; import { MainView, MainViewProps, MainViewType } from "../type/MainView";
...@@ -20,8 +17,6 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -20,8 +17,6 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
@property({ type: cc.Sprite }) @property({ type: cc.Sprite })
private titleSprite: cc.Sprite = DummySprite; private titleSprite: cc.Sprite = DummySprite;
@property({ type: cc.Node })
private buttonLayout: cc.Node = DummyNode;
@property({ type: [cc.Button], displayName: "Tabbar Buttons" }) @property({ type: [cc.Button], displayName: "Tabbar Buttons" })
private tabbarButtons: cc.Button[] = []; private tabbarButtons: cc.Button[] = [];
@property({ type: [cc.SpriteFrame], displayName: "Tabbar Spriteframes" }) @property({ type: [cc.SpriteFrame], displayName: "Tabbar Spriteframes" })
...@@ -34,43 +29,18 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -34,43 +29,18 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
@property(cc.Node) @property(cc.Node)
debugbtn: cc.Node = DummyNode; debugbtn: cc.Node = DummyNode;
@property(cc.Node)
gameCenterBtn: cc.Node = DummyNode;
@property(cc.Node)
urgentNoticeBtn: cc.Node = DummyNode;
@property(cc.Node)
goToShopBtn: cc.Node = DummyNode;
@property(cc.Node)
commonProblemBtn: cc.Node = DummyNode;
@property(cc.Node)
rewardBtn: cc.Node = DummyNode;
@property(cc.Node)
rewardRedDotNode: cc.Node = DummyNode;
@property(cc.Node) @property(cc.Node)
waitNode: cc.Node = DummyNode; waitNode: cc.Node = DummyNode;
@property(cc.Node)
subGameNode: cc.Node = DummyNode;
@property(cc.Label) @property(cc.Label)
loadingLabel: cc.Label = DummyLabel; loadingLabel: cc.Label = DummyLabel;
@property(cc.Node)
downButton: cc.Node = DummyNode;
@property(cc.Node)
buttonsNode: cc.Node = DummyNode;
onTabButtonClick(event, index: string) { onTabButtonClick(event, index: string) {
// this.showTabBar(false); this._props.onTabClick(parseInt(index), () => {});
this._props.onTabClick(parseInt(index), () => {
// this.showTabBar(true);
});
this.hideClickAniByIndex(parseInt(index)); this.hideClickAniByIndex(parseInt(index));
} }
private _tabContentContainer: View; private _tabContentContainer: View;
private _dotNumber = 1; private _dotNumber = 1;
private _isdown = true;
onLoad() { onLoad() {
...@@ -94,27 +64,12 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -94,27 +64,12 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
} }
}); });
this.bindProp("waitRedDot", (value) => {
this.tabbarButtons[MainTabs.bedroomTab].node.getChildByName("RedDot").active = value;
});
//修改主界面发现按钮为永久显示红点 //修改主界面发现按钮为永久显示红点
//this.bindProp("discoverRedDot", this.tabbarButtons[MainTabs.discoverTab].node.getChildByName("RedDot"), "active");
this.bindProp("discoverRedDot", (value) => { this.bindProp("discoverRedDot", (value) => {
this.tabbarButtons[MainTabs.discoverTab].node.getChildByName("RedDot").active = true; this.tabbarButtons[MainTabs.discoverTab].node.getChildByName("RedDot").active = true;
}); });
this.debugbtn.active = GameConfig.debug; this.debugbtn.active = GameConfig.debug;
if (channel !== "android") {
this.gameCenterBtn.active = true;
this.subGameNode.active = true;
CCGameCenterNodeFactory.getInstance().registerMainUISubGameNode(this.subGameNode);
} else {
this.gameCenterBtn.active = false;
this.subGameNode.active = false;
}
this.urgentNoticeBtn.active = false;
} }
getTabContentContainer(): View { getTabContentContainer(): View {
...@@ -164,7 +119,7 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -164,7 +119,7 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
if (index < 0 || index > this.clickAniArr.length) { if (index < 0 || index > this.clickAniArr.length) {
return; return;
} }
let limitArr: MainTabs[] = [MainTabs.messageTab, MainTabs.datingEventTab, MainTabs.bedroomTab]; let limitArr: MainTabs[] = [MainTabs.messageTab, MainTabs.datingEventTab];
let contrlArr: boolean[] = [this._props.messageRedDot, this._props.datingEventRedDot]; let contrlArr: boolean[] = [this._props.messageRedDot, this._props.datingEventRedDot];
let exist = limitArr.findIndex((v) => v === index) !== (-1); let exist = limitArr.findIndex((v) => v === index) !== (-1);
if (exist) { if (exist) {
...@@ -178,66 +133,6 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -178,66 +133,6 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
} }
} }
showRewardBtn = (isShow: boolean) => {
// this.urgentNoticeBtn.active = isShow;
this.goToShopBtn.active = isShow;
if (!this._isdown) {
this.downButton.active = isShow;
}
}
showBottonsNode = (isShow: boolean) => {
this.buttonsNode.active = isShow;
if (this._isdown) {
this.buttonsNode.active = isShow;
}
}
showSubGameNode = (isShow: boolean) => {
if (channel !== "android") {
this.subGameNode.active = isShow;
} else {
this.subGameNode.active = false;
}
}
getRewardRedDotNode(): cc.Node {
return this.rewardRedDotNode;
}
onUrgentNoticeClickCallback(event) {
this._props.onUrgentNoticeClick();
}
onGoToShopClickCallback(event) {
this._props.onGoToShopClick();
}
onCommonProblemClickCallback(event) {
this._props.onCommonProblemClick();
}
onRewardBtnClickCallback(event) {
this._props.onRewardBtnClickCallback();
}
updateBedRoomRedDot() {
let showRedDot = false;
let allItemIds: Array<number> = [];
allItemIds = UnlockItemModelManager.unlockItems;
for (let i = 0; i < allItemIds.length; i++) {
if (UnlockSpecialPlotEventManager.getInstance().isShowBedRoomRedDotStatus(allItemIds[i])) {
showRedDot = true;
break;
}
}
this.tabbarButtons[MainTabs.bedroomTab].node.getChildByName("RedDot").active = showRedDot;
}
showTabBar(isShow: boolean) {
this.node.getChildByName("TabBar").active = isShow;
}
showWaitingView(isShow: boolean) { showWaitingView(isShow: boolean) {
this.waitNode.active = isShow; this.waitNode.active = isShow;
} }
...@@ -256,26 +151,4 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView ...@@ -256,26 +151,4 @@ export class MainViewImpl extends CCPureView<MainViewProps> implements MainView
this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot; this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot;
}, 0.5); }, 0.5);
} }
onDownButtonClick() {
this._isdown = true;
this.downButton.active = false;
this.buttonsNode.active = true;
this.buttonsNode.scaleY = 0;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 1 })
.call(() => {
})
.start();
}
onUpButtonClick() {
this._isdown = false;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 0 })
.call(() => {
this.downButton.active = true;
})
.start();
}
} }
\ No newline at end of file
...@@ -10,13 +10,8 @@ type onRewardBtnClickCallback = () => void; ...@@ -10,13 +10,8 @@ type onRewardBtnClickCallback = () => void;
export interface MainViewProps extends TabViewProps { export interface MainViewProps extends TabViewProps {
messageRedDot: boolean; messageRedDot: boolean;
datingEventRedDot: boolean; datingEventRedDot: boolean;
waitRedDot: boolean; //商城红点
discoverRedDot: boolean; //任务红点 discoverRedDot: boolean; //任务红点
onDebugClick: onDebugClickCallback; onDebugClick: onDebugClickCallback;
onUrgentNoticeClick: onUrgentNoticeClickCallback;
onGoToShopClick: onGoToShopClickCallback;
onCommonProblemClick: onCommonProblemClickCallback;
onRewardBtnClickCallback: onRewardBtnClickCallback;
} }
type MainViewBase = PureView<MainViewProps> & TabView; type MainViewBase = PureView<MainViewProps> & TabView;
...@@ -24,14 +19,8 @@ type MainViewBase = PureView<MainViewProps> & TabView; ...@@ -24,14 +19,8 @@ type MainViewBase = PureView<MainViewProps> & TabView;
export interface MainView extends MainViewBase { export interface MainView extends MainViewBase {
getGuideTabParam(index: number): GuideViewParamModel | undefined; getGuideTabParam(index: number): GuideViewParamModel | undefined;
hideClickAniByIndex: (index: number) => void; hideClickAniByIndex: (index: number) => void;
showRewardBtn: (isShow: boolean) => void;
showBottonsNode: (isShow: boolean) => void;
showSubGameNode: (isShow: boolean) => void;
updateBedRoomRedDot: () => void;
onTabButtonClick: (event: any, index: string) => void; onTabButtonClick: (event: any, index: string) => void;
showTabBar: (isShow: boolean) => void;
showWaitingView: (isShow: boolean) => void; showWaitingView: (isShow: boolean) => void;
getRewardRedDotNode: () => cc.Node;
} }
export const MainViewType = "MainView"; export const MainViewType = "MainView";
\ No newline at end of file
...@@ -86,21 +86,18 @@ ...@@ -86,21 +86,18 @@
}, },
{ {
"__id__": 35 "__id__": 35
},
{
"__id__": 37
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 39 "__id__": 37
}, },
{ {
"__id__": 40 "__id__": 38
}, },
{ {
"__id__": 41 "__id__": 39
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -190,7 +187,7 @@ ...@@ -190,7 +187,7 @@
"array": [ "array": [
0, 0,
0, 0,
731.7914661978507, 513.5530644441722,
0, 0,
0, 0,
0, 0,
...@@ -1419,80 +1416,6 @@ ...@@ -1419,80 +1416,6 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "touchEffect",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 34
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3cGlGRwm5Pm4yzPEtaE0G4"
},
{
"__type__": "b96c8PkrHNC8aetxvcDIrfF",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"isWidget": true,
"_widgetTarget": null,
"_id": "3afTENgN1ALotmh82PBYgd"
},
{
"__type__": "cc.Node",
"_name": "ToastRoot", "_name": "ToastRoot",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
...@@ -1502,7 +1425,7 @@ ...@@ -1502,7 +1425,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 34
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1558,7 +1481,7 @@ ...@@ -1558,7 +1481,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 35 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1591,7 +1514,7 @@ ...@@ -1591,7 +1514,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 38 "__id__": 36
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1647,7 +1570,7 @@ ...@@ -1647,7 +1570,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 35
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1731,7 +1654,7 @@ ...@@ -1731,7 +1654,7 @@
"__id__": 29 "__id__": 29
}, },
"toastParentNode": { "toastParentNode": {
"__id__": 35 "__id__": 33
}, },
"loadingNode": { "loadingNode": {
"__id__": 5 "__id__": 5
...@@ -1747,7 +1670,7 @@ ...@@ -1747,7 +1670,7 @@
"__id__": 25 "__id__": 25
}, },
"hotUpdateNode": { "hotUpdateNode": {
"__id__": 37 "__id__": 35
}, },
"bgSpr": { "bgSpr": {
"__id__": 7 "__id__": 7
......
{"version":3,"sources":["assets/script/game/ui/view/type/MainView.ts"],"names":[],"mappings":";;;;;;;AAoCa,QAAA,YAAY,GAAG,UAAU,CAAC","file":"","sourceRoot":"/","sourcesContent":["import { TabViewProps, TabView } from \"./TabView\";\nimport { PureView } from \"../../../../common/classbase/ViewBase\";\nimport { GuideViewParamModel } from \"../../presenter/GuideViewPresenter\";\n\ntype onDebugClickCallback = () => void;\ntype onUrgentNoticeClickCallback = () => void;\ntype onGoToShopClickCallback = () => void;\ntype onCommonProblemClickCallback = () => void;\ntype onRewardBtnClickCallback = () => void;\nexport interface MainViewProps extends TabViewProps {\n messageRedDot: boolean;\n datingEventRedDot: boolean;\n waitRedDot: boolean; //商城红点\n discoverRedDot: boolean; //任务红点 \n onDebugClick: onDebugClickCallback;\n onUrgentNoticeClick: onUrgentNoticeClickCallback;\n onGoToShopClick: onGoToShopClickCallback;\n onCommonProblemClick: onCommonProblemClickCallback;\n onRewardBtnClickCallback: onRewardBtnClickCallback;\n}\n\ntype MainViewBase = PureView<MainViewProps> & TabView;\n\nexport interface MainView extends MainViewBase {\n getGuideTabParam(index: number): GuideViewParamModel | undefined;\n hideClickAniByIndex: (index: number) => void;\n showRewardBtn: (isShow: boolean) => void;\n showBottonsNode: (isShow: boolean) => void;\n showSubGameNode: (isShow: boolean) => void;\n updateBedRoomRedDot: () => void;\n onTabButtonClick: (event: any, index: string) => void;\n showTabBar: (isShow: boolean) => void;\n showWaitingView: (isShow: boolean) => void;\n getRewardRedDotNode: () => cc.Node;\n}\n\nexport const MainViewType = \"MainView\";"]} {"version":3,"sources":["assets/script/game/ui/view/type/MainView.ts"],"names":[],"mappings":";;;;;;;AAyBa,QAAA,YAAY,GAAG,UAAU,CAAC","file":"","sourceRoot":"/","sourcesContent":["import { TabViewProps, TabView } from \"./TabView\";\nimport { PureView } from \"../../../../common/classbase/ViewBase\";\nimport { GuideViewParamModel } from \"../../presenter/GuideViewPresenter\";\n\ntype onDebugClickCallback = () => void;\ntype onUrgentNoticeClickCallback = () => void;\ntype onGoToShopClickCallback = () => void;\ntype onCommonProblemClickCallback = () => void;\ntype onRewardBtnClickCallback = () => void;\nexport interface MainViewProps extends TabViewProps {\n messageRedDot: boolean;\n datingEventRedDot: boolean;\n discoverRedDot: boolean; //任务红点 \n onDebugClick: onDebugClickCallback;\n}\n\ntype MainViewBase = PureView<MainViewProps> & TabView;\n\nexport interface MainView extends MainViewBase {\n getGuideTabParam(index: number): GuideViewParamModel | undefined;\n hideClickAniByIndex: (index: number) => void;\n onTabButtonClick: (event: any, index: string) => void;\n showWaitingView: (isShow: boolean) => void;\n}\n\nexport const MainViewType = \"MainView\";"]}
\ No newline at end of file \ No newline at end of file
...@@ -35,13 +35,11 @@ const PlotStopViewPresenter_1 = require("./PlotStopViewPresenter"); ...@@ -35,13 +35,11 @@ const PlotStopViewPresenter_1 = require("./PlotStopViewPresenter");
const simba_cc_audio_manager_1 = require("simba-cc-audio-manager"); const simba_cc_audio_manager_1 = require("simba-cc-audio-manager");
const simba_cc_resutils_1 = require("simba-cc-resutils"); const simba_cc_resutils_1 = require("simba-cc-resutils");
const GameConstData_1 = require("../../../common/gameplay/gamedata/GameConstData"); const GameConstData_1 = require("../../../common/gameplay/gamedata/GameConstData");
const BedroomViewPresenter_1 = require("./bedroom/BedroomViewPresenter");
const UnlockItemModelManager_1 = require("../../model/UnlockItemModelManager"); const UnlockItemModelManager_1 = require("../../model/UnlockItemModelManager");
const ItemTbl_1 = require("../../../config/ItemTbl"); const ItemTbl_1 = require("../../../config/ItemTbl");
const GameConfig_1 = require("../../../GameConfig"); const GameConfig_1 = require("../../../GameConfig");
const simba_httpclient_1 = require("simba-httpclient"); const simba_httpclient_1 = require("simba-httpclient");
const BedroomCatRewardViewPresenter_1 = require("./bedroom/BedroomCatRewardViewPresenter"); const BedroomCatRewardViewPresenter_1 = require("./bedroom/BedroomCatRewardViewPresenter");
const BedRoomCatModelManager_1 = require("../../model/BedRoomCatModelManager");
const PromptAlertDialogViewPresenter_1 = require("./bedroom/PromptAlertDialogViewPresenter"); const PromptAlertDialogViewPresenter_1 = require("./bedroom/PromptAlertDialogViewPresenter");
const UnlockSpecialPlotModelManager_1 = require("../../model/UnlockSpecialPlotModelManager"); const UnlockSpecialPlotModelManager_1 = require("../../model/UnlockSpecialPlotModelManager");
const EditorEnums_1 = require("../../../avg/EditorEnums"); const EditorEnums_1 = require("../../../avg/EditorEnums");
...@@ -53,7 +51,6 @@ const simba_sdk_1 = require("simba-sdk"); ...@@ -53,7 +51,6 @@ const simba_sdk_1 = require("simba-sdk");
const TabPresenterFactory = [ const TabPresenterFactory = [
MessageViewPresenter_1.default, MessageViewPresenter_1.default,
DatingEventViewPresenter_1.default, DatingEventViewPresenter_1.default,
BedroomViewPresenter_1.default,
DiscoverViewPresenter_1.default DiscoverViewPresenter_1.default
]; ];
/**主线剧情的下标 */ /**主线剧情的下标 */
...@@ -150,15 +147,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -150,15 +147,6 @@ let MainViewPresenter = /** @class */ (() => {
if (!this._tabClickAble) { if (!this._tabClickAble) {
return; return;
} }
// if (isDot != false) {
// let uiName = ["click_message", "click_event", "click_wait", "click_finding"];
// GameDotMgr.getInstance().dotClickUI(uiName[index]);
// }
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
this._view.showRewardBtn(index !== Enums_1.MainTabs.bedroomTab);
this._view.showBottonsNode(index !== Enums_1.MainTabs.bedroomTab);
this._view.showSubGameNode(index !== Enums_1.MainTabs.bedroomTab);
this.dealTabGuide(index); this.dealTabGuide(index);
let uuid = TabPresenterFactory[index].uuid; let uuid = TabPresenterFactory[index].uuid;
if (!GameModelManager_1.GameModelManager.checkFuncUnloced(uuid)) { if (!GameModelManager_1.GameModelManager.checkFuncUnloced(uuid)) {
...@@ -187,7 +175,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -187,7 +175,6 @@ let MainViewPresenter = /** @class */ (() => {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== Enums_1.MainTabs.bedroomTab);
}); });
} }
else { else {
...@@ -197,7 +184,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -197,7 +184,6 @@ let MainViewPresenter = /** @class */ (() => {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== Enums_1.MainTabs.bedroomTab);
} }
} }
else { else {
...@@ -214,7 +200,7 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -214,7 +200,7 @@ let MainViewPresenter = /** @class */ (() => {
let index = GameModelManager_1.GameModelManager.getMainTabGuideIndex(); let index = GameModelManager_1.GameModelManager.getMainTabGuideIndex();
if (index !== -1) { if (index !== -1) {
//attention //attention
let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.waitRedDot, this._viewProps.discoverRedDot]; let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.discoverRedDot];
if (!redDotArr[index] || this._currentTab === index) { if (!redDotArr[index] || this._currentTab === index) {
return; return;
} }
...@@ -378,9 +364,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -378,9 +364,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy(); GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
}; };
/** /**
* 卧室返回点击UI事件 * 卧室返回点击UI事件
...@@ -397,10 +380,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -397,10 +380,6 @@ let MainViewPresenter = /** @class */ (() => {
tab = Enums_1.MainTabs.datingEventTab; tab = Enums_1.MainTabs.datingEventTab;
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
break; break;
case EditorEnums_1.PageIndex.BedroomView:
tab = Enums_1.MainTabs.bedroomTab;
this._view.onTabButtonClick(null, `${tab}`);
break;
case EditorEnums_1.PageIndex.ExtraPlotView: case EditorEnums_1.PageIndex.ExtraPlotView:
tab = Enums_1.MainTabs.datingEventTab; tab = Enums_1.MainTabs.datingEventTab;
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
...@@ -416,14 +395,9 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -416,14 +395,9 @@ let MainViewPresenter = /** @class */ (() => {
selectedTab: 0, selectedTab: 0,
messageRedDot: false, messageRedDot: false,
datingEventRedDot: false, datingEventRedDot: false,
waitRedDot: false,
discoverRedDot: false, discoverRedDot: false,
onTabClick: this.onTabClick, onTabClick: this.onTabClick,
onDebugClick: this.onDebugClickCallback, onDebugClick: this.onDebugClickCallback,
onUrgentNoticeClick: this.onUrgentNoticeClickCallback,
onGoToShopClick: this.onGoToShopClickCallback,
onCommonProblemClick: this.onCommonProblemClickCallback,
onRewardBtnClickCallback: this.onRewardBtnClickCallback,
}; };
} }
async start() { async start() {
...@@ -456,8 +430,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -456,8 +430,6 @@ let MainViewPresenter = /** @class */ (() => {
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy(); GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
this.view.showWaitingView(false); this.view.showWaitingView(false);
...@@ -534,8 +506,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -534,8 +506,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
onEnterBackground() { onEnterBackground() {
super.onEnterBackground(); super.onEnterBackground();
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
if (this._subPresenters[this._currentTab]) if (this._subPresenters[this._currentTab])
this._subPresenters[this._currentTab].onEnterBackground(); this._subPresenters[this._currentTab].onEnterBackground();
} }
...@@ -552,8 +522,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -552,8 +522,6 @@ let MainViewPresenter = /** @class */ (() => {
if (!GameConfig_1.GameConfig.isVerb) { if (!GameConfig_1.GameConfig.isVerb) {
GameModelManager_1.GameModelManager.checkAutoPopView(); GameModelManager_1.GameModelManager.checkAutoPopView();
} }
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
} }
onShow() { onShow() {
super.onShow(); super.onShow();
...@@ -581,20 +549,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -581,20 +549,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
return cfg; return cfg;
} }
updateRewardBtnRedDot() {
for (let i = 1; i < 4; i++) {
let catRewardStatus = BedRoomCatModelManager_1.BedRoomCatModelManager.getCatRewardStatus(i);
for (let j = 0; j < catRewardStatus.length; j++) {
if (catRewardStatus[j] == 1) {
this.view.getRewardRedDotNode().active = true;
return;
}
else {
this.view.getRewardRedDotNode().active = false;
}
}
}
}
}; };
MainViewPresenter.uuid = "MainViewPresenter"; MainViewPresenter.uuid = "MainViewPresenter";
MainViewPresenter.tabIndex = -1; MainViewPresenter.tabIndex = -1;
......
...@@ -13,11 +13,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -13,11 +13,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.MainViewImpl = void 0; exports.MainViewImpl = void 0;
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects"); const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const CCViewBase_1 = require("../../../../common/classbase/CCViewBase"); const CCViewBase_1 = require("../../../../common/classbase/CCViewBase");
const CCGameCenterNodeFactory_1 = require("../../../../cooperation/script/CCGameCenterNodeFactory");
const GameConfig_1 = require("../../../../GameConfig"); const GameConfig_1 = require("../../../../GameConfig");
const Enums_1 = require("../../../Enums"); const Enums_1 = require("../../../Enums");
const UnlockItemModelManager_1 = require("../../../model/UnlockItemModelManager");
const UnlockSpecialPlotEventManager_1 = require("../../../model/UnlockSpecialPlotEventManager");
const PresenterCCViewFactory_1 = require("../../PresenterCCViewFactory"); const PresenterCCViewFactory_1 = require("../../PresenterCCViewFactory");
const MainView_1 = require("../type/MainView"); const MainView_1 = require("../type/MainView");
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -27,30 +24,19 @@ let MainViewImpl = /** @class */ (() => { ...@@ -27,30 +24,19 @@ let MainViewImpl = /** @class */ (() => {
super(...arguments); super(...arguments);
this.contentParent = CCDummyObjects_1.DummyNode; this.contentParent = CCDummyObjects_1.DummyNode;
this.titleSprite = CCDummyObjects_1.DummySprite; this.titleSprite = CCDummyObjects_1.DummySprite;
this.buttonLayout = CCDummyObjects_1.DummyNode;
this.tabbarButtons = []; this.tabbarButtons = [];
this.tabbarSpriteFrames = []; this.tabbarSpriteFrames = [];
this.titleSpriteFrames = []; this.titleSpriteFrames = [];
this.clickAniArr = []; this.clickAniArr = [];
this.debugbtn = CCDummyObjects_1.DummyNode; this.debugbtn = CCDummyObjects_1.DummyNode;
this.gameCenterBtn = CCDummyObjects_1.DummyNode;
this.urgentNoticeBtn = CCDummyObjects_1.DummyNode;
this.goToShopBtn = CCDummyObjects_1.DummyNode;
this.commonProblemBtn = CCDummyObjects_1.DummyNode;
this.rewardBtn = CCDummyObjects_1.DummyNode;
this.rewardRedDotNode = CCDummyObjects_1.DummyNode;
this.waitNode = CCDummyObjects_1.DummyNode; this.waitNode = CCDummyObjects_1.DummyNode;
this.subGameNode = CCDummyObjects_1.DummyNode;
this.loadingLabel = CCDummyObjects_1.DummyLabel; this.loadingLabel = CCDummyObjects_1.DummyLabel;
this.downButton = CCDummyObjects_1.DummyNode;
this.buttonsNode = CCDummyObjects_1.DummyNode;
this._dotNumber = 1; this._dotNumber = 1;
this._isdown = true;
this.hideClickAniByIndex = (index) => { this.hideClickAniByIndex = (index) => {
if (index < 0 || index > this.clickAniArr.length) { if (index < 0 || index > this.clickAniArr.length) {
return; return;
} }
let limitArr = [Enums_1.MainTabs.messageTab, Enums_1.MainTabs.datingEventTab, Enums_1.MainTabs.bedroomTab]; let limitArr = [Enums_1.MainTabs.messageTab, Enums_1.MainTabs.datingEventTab];
let contrlArr = [this._props.messageRedDot, this._props.datingEventRedDot]; let contrlArr = [this._props.messageRedDot, this._props.datingEventRedDot];
let exist = limitArr.findIndex((v) => v === index) !== (-1); let exist = limitArr.findIndex((v) => v === index) !== (-1);
if (exist) { if (exist) {
...@@ -64,33 +50,9 @@ let MainViewImpl = /** @class */ (() => { ...@@ -64,33 +50,9 @@ let MainViewImpl = /** @class */ (() => {
} }
} }
}; };
this.showRewardBtn = (isShow) => {
// this.urgentNoticeBtn.active = isShow;
this.goToShopBtn.active = isShow;
if (!this._isdown) {
this.downButton.active = isShow;
}
};
this.showBottonsNode = (isShow) => {
this.buttonsNode.active = isShow;
if (this._isdown) {
this.buttonsNode.active = isShow;
}
};
this.showSubGameNode = (isShow) => {
if (GameConfig_1.channel !== "android") {
this.subGameNode.active = isShow;
}
else {
this.subGameNode.active = false;
}
};
} }
onTabButtonClick(event, index) { onTabButtonClick(event, index) {
// this.showTabBar(false); this._props.onTabClick(parseInt(index), () => { });
this._props.onTabClick(parseInt(index), () => {
// this.showTabBar(true);
});
this.hideClickAniByIndex(parseInt(index)); this.hideClickAniByIndex(parseInt(index));
} }
onLoad() { onLoad() {
...@@ -114,25 +76,11 @@ let MainViewImpl = /** @class */ (() => { ...@@ -114,25 +76,11 @@ let MainViewImpl = /** @class */ (() => {
this.clickAniArr[Enums_1.MainTabs.datingEventTab].node.active = false; this.clickAniArr[Enums_1.MainTabs.datingEventTab].node.active = false;
} }
}); });
this.bindProp("waitRedDot", (value) => {
this.tabbarButtons[Enums_1.MainTabs.bedroomTab].node.getChildByName("RedDot").active = value;
});
//修改主界面发现按钮为永久显示红点 //修改主界面发现按钮为永久显示红点
//this.bindProp("discoverRedDot", this.tabbarButtons[MainTabs.discoverTab].node.getChildByName("RedDot"), "active");
this.bindProp("discoverRedDot", (value) => { this.bindProp("discoverRedDot", (value) => {
this.tabbarButtons[Enums_1.MainTabs.discoverTab].node.getChildByName("RedDot").active = true; this.tabbarButtons[Enums_1.MainTabs.discoverTab].node.getChildByName("RedDot").active = true;
}); });
this.debugbtn.active = GameConfig_1.GameConfig.debug; this.debugbtn.active = GameConfig_1.GameConfig.debug;
if (GameConfig_1.channel !== "android") {
this.gameCenterBtn.active = true;
this.subGameNode.active = true;
CCGameCenterNodeFactory_1.default.getInstance().registerMainUISubGameNode(this.subGameNode);
}
else {
this.gameCenterBtn.active = false;
this.subGameNode.active = false;
}
this.urgentNoticeBtn.active = false;
} }
getTabContentContainer() { getTabContentContainer() {
return this._tabContentContainer; return this._tabContentContainer;
...@@ -171,36 +119,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -171,36 +119,6 @@ let MainViewImpl = /** @class */ (() => {
}; };
return m; return m;
} }
getRewardRedDotNode() {
return this.rewardRedDotNode;
}
onUrgentNoticeClickCallback(event) {
this._props.onUrgentNoticeClick();
}
onGoToShopClickCallback(event) {
this._props.onGoToShopClick();
}
onCommonProblemClickCallback(event) {
this._props.onCommonProblemClick();
}
onRewardBtnClickCallback(event) {
this._props.onRewardBtnClickCallback();
}
updateBedRoomRedDot() {
let showRedDot = false;
let allItemIds = [];
allItemIds = UnlockItemModelManager_1.UnlockItemModelManager.unlockItems;
for (let i = 0; i < allItemIds.length; i++) {
if (UnlockSpecialPlotEventManager_1.default.getInstance().isShowBedRoomRedDotStatus(allItemIds[i])) {
showRedDot = true;
break;
}
}
this.tabbarButtons[Enums_1.MainTabs.bedroomTab].node.getChildByName("RedDot").active = showRedDot;
}
showTabBar(isShow) {
this.node.getChildByName("TabBar").active = isShow;
}
showWaitingView(isShow) { showWaitingView(isShow) {
this.waitNode.active = isShow; this.waitNode.active = isShow;
} }
...@@ -219,26 +137,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -219,26 +137,6 @@ let MainViewImpl = /** @class */ (() => {
this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot; this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot;
}, 0.5); }, 0.5);
} }
onDownButtonClick() {
this._isdown = true;
this.downButton.active = false;
this.buttonsNode.active = true;
this.buttonsNode.scaleY = 0;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 1 })
.call(() => {
})
.start();
}
onUpButtonClick() {
this._isdown = false;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 0 })
.call(() => {
this.downButton.active = true;
})
.start();
}
}; };
__decorate([ __decorate([
property({ type: cc.Node }) property({ type: cc.Node })
...@@ -247,9 +145,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -247,9 +145,6 @@ let MainViewImpl = /** @class */ (() => {
property({ type: cc.Sprite }) property({ type: cc.Sprite })
], MainViewImpl.prototype, "titleSprite", void 0); ], MainViewImpl.prototype, "titleSprite", void 0);
__decorate([ __decorate([
property({ type: cc.Node })
], MainViewImpl.prototype, "buttonLayout", void 0);
__decorate([
property({ type: [cc.Button], displayName: "Tabbar Buttons" }) property({ type: [cc.Button], displayName: "Tabbar Buttons" })
], MainViewImpl.prototype, "tabbarButtons", void 0); ], MainViewImpl.prototype, "tabbarButtons", void 0);
__decorate([ __decorate([
...@@ -266,37 +161,10 @@ let MainViewImpl = /** @class */ (() => { ...@@ -266,37 +161,10 @@ let MainViewImpl = /** @class */ (() => {
], MainViewImpl.prototype, "debugbtn", void 0); ], MainViewImpl.prototype, "debugbtn", void 0);
__decorate([ __decorate([
property(cc.Node) property(cc.Node)
], MainViewImpl.prototype, "gameCenterBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "urgentNoticeBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "goToShopBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "commonProblemBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "rewardBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "rewardRedDotNode", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "waitNode", void 0); ], MainViewImpl.prototype, "waitNode", void 0);
__decorate([ __decorate([
property(cc.Node)
], MainViewImpl.prototype, "subGameNode", void 0);
__decorate([
property(cc.Label) property(cc.Label)
], MainViewImpl.prototype, "loadingLabel", void 0); ], MainViewImpl.prototype, "loadingLabel", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "downButton", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "buttonsNode", void 0);
MainViewImpl = __decorate([ MainViewImpl = __decorate([
ccclass, ccclass,
PresenterCCViewFactory_1.RegView(MainView_1.MainViewType, "prefab/ui/MainView") PresenterCCViewFactory_1.RegView(MainView_1.MainViewType, "prefab/ui/MainView")
......
"use strict";
cc._RF.push(module, 'b96c8PkrHNC8aetxvcDIrfF', 'FireComponent');
// script/common/components/FireComponent.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const { ccclass, property } = cc._decorator;
let FireComponent = /** @class */ (() => {
let FireComponent = class FireComponent extends cc.Component {
constructor() {
super(...arguments);
this.isWidget = false;
this._widgetTarget = null;
// @property(cc.Node)
/** 烟火数量 */
this.fire_count = 35; // 原始100个
/** 烟火衰减速度 */
this.gap_alpha = 0.02; // 原始0.005
this.gfx = null;
this.particles = [];
///////////////// 自定义触摸监听 /////////////////
this._eventManager = cc["internal"]["eventManager"];
}
get widgetTarget() {
return this._widgetTarget;
}
set widgetTarget(value) {
this._widgetTarget = value;
this.isWidget = !!this._widgetTarget;
if (!CC_EDITOR) {
this.initWidgit();
}
}
onLoad() {
this.gfx = this.node.getComponent(cc.Graphics) || this.node.addComponent(cc.Graphics);
// widgit
this.initWidgit();
// touch
// this.initTouch();
this.InitTouch();
}
initWidgit() {
// 全屏适配
if (!this.isWidget)
return;
let canvas = cc.find("Canvas");
let widget = this.node.addComponent(cc.Widget);
widget.target = this.widgetTarget || canvas;
widget.isAlignTop = true;
widget.isAlignLeft = true;
widget.isAlignRight = true;
widget.isAlignBottom = true;
widget.left = 0;
widget.right = 0;
widget.top = 0;
widget.bottom = 0;
widget.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE;
}
initTouch() {
// 点击事件
// this.node.on(cc.Node.EventType.TOUCH_END, (event: cc.Event.EventTouch) => {
// let wpos = event.getLocation();
// let npos = this.node.convertToNodeSpaceAR(wpos);
// this.fire(npos.x, npos.y);
// })
}
ClickCall(event) {
let wpos = event.getLocation();
let npos = this.node.convertToNodeSpaceAR(wpos);
this.fire(npos.x, npos.y);
}
fire(x, y) {
// 生成烟花
this.gfx.clear();
this.createFireworks(x, y);
}
tick() {
this.gfx.fillColor = cc.color(255, 255, 255, 0); //0, 0, 0, 26
this.gfx.fillRect(-this.node.width / 2, -this.node.height / 2, this.node.width, this.node.height);
this.drawFireworks();
}
createFireworks(sx, sy) {
this.particles = [];
var hue = Math.floor(Math.random() * 51) + 150;
var hueVariance = 60; // 30
for (var i = 0; i < this.fire_count; i++) {
var angle = Math.floor(Math.random() * 360);
var p = {
radians: angle * Math.PI / 180,
x: sx,
y: sy,
speed: (Math.random() * 5) + .4,
radius: 0,
size: Math.floor(Math.random() * 3) + 1,
hue: Math.floor(Math.random() * 2 * hueVariance) + (hue - hueVariance),
brightness: Math.floor(Math.random() * 31) + 50,
alpha: (Math.floor(Math.random() * 61) + 40) / 100
};
p.radius = p.speed;
this.particles.push(p);
}
}
drawFireworks() {
// this.gfx.clear();
let isDraw = false;
for (var i = 0; i < this.particles.length; i++) {
var p = this.particles[i];
var vx = Math.cos(p.radians) * p.radius;
var vy = Math.sin(p.radians) * p.radius + 0.4;
p.x -= vx;
p.y -= vy;
p.radius *= 1 - p.speed / 100;
p.alpha -= this.gap_alpha; // 0.005
if (p.alpha > 0) {
isDraw = true;
this.gfx.arc(p.x, p.y, p.size, 0, Math.PI * 2, false);
this.gfx.fillColor = this.hsla2rgba('hsla(' + p.hue + ', 100%, ' + p.brightness + '%)', p.alpha);
this.gfx.fill();
}
}
if (!isDraw) {
this.gfx.clear();
}
}
hsla2rgba(str, alpha) {
const colorArr = str.match(/\d+/g);
let [h, s, l] = colorArr;
h = parseFloat(h) / 360;
s = parseFloat(s) / 100;
l = parseFloat(l) / 100;
if (s === 0) {
l = Math.round(l * 255);
return cc.color(l, l, l, Math.round(alpha * 255));
}
const getRGB = num => {
let q = l >= 0.5 ? l + s - l * s : l * (1 + s); // 注意是数字1加上s,不是字母l
let p = 2 * l - q;
if (num < 0) {
num += 1;
}
if (num > 1) {
num -= 1;
}
switch (true) {
case num > 2 / 3:
num = p;
break;
case num >= 1 / 2:
num = p + (q - p) * 6 * (2 / 3 - num);
break;
case num >= 1 / 6:
num = q;
break;
default:
num = p + (q - p) * 6 * num;
break;
}
return Math.round(num * 255);
};
let r = getRGB(h + 1 / 3);
let g = getRGB(h);
let b = getRGB(h - 1 / 3);
return cc.color(r, g, b, Math.round(alpha * 255));
}
update() {
this.tick();
}
InitTouch() {
const EventListener = cc["EventListener"];
this._touchListener = EventListener.create({
event: EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: false,
owner: this.node,
mask: null,
onTouchBegan: this.onTouchStart.bind(this),
onTouchMoved: null,
onTouchEnded: this.onTouchEnded.bind(this),
onTouchCancelled: null,
});
this._eventManager.addListener(this._touchListener, this.node);
}
onTouchStart(touch, event) {
// cc.log("touch start");
//此处必须返回true(表示接触到了节点),否则TOUCH_MOVE,TOUCH_END,TOUCH_CANCEL不触发。
return true;
}
onTouchEnded(touch, event) {
// cc.log("touch end");
this.ClickCall(touch);
}
onDestroy() {
// super.onDestroy();
this._eventManager.removeListener(this._touchListener, this.node);
}
};
__decorate([
property
], FireComponent.prototype, "isWidget", void 0);
__decorate([
property(cc.Node)
], FireComponent.prototype, "_widgetTarget", void 0);
FireComponent = __decorate([
ccclass
], FireComponent);
return FireComponent;
})();
exports.default = FireComponent;
cc._RF.pop();
\ No newline at end of file
...@@ -283,10 +283,8 @@ var MainTabs; ...@@ -283,10 +283,8 @@ var MainTabs;
MainTabs[MainTabs["messageTab"] = 0] = "messageTab"; MainTabs[MainTabs["messageTab"] = 0] = "messageTab";
/**约会 */ /**约会 */
MainTabs[MainTabs["datingEventTab"] = 1] = "datingEventTab"; MainTabs[MainTabs["datingEventTab"] = 1] = "datingEventTab";
/**卧室 */
MainTabs[MainTabs["bedroomTab"] = 2] = "bedroomTab";
/**发现 */ /**发现 */
MainTabs[MainTabs["discoverTab"] = 3] = "discoverTab"; MainTabs[MainTabs["discoverTab"] = 2] = "discoverTab";
})(MainTabs = exports.MainTabs || (exports.MainTabs = {})); })(MainTabs = exports.MainTabs || (exports.MainTabs = {}));
var WorkSpaceTaskState; var WorkSpaceTaskState;
(function (WorkSpaceTaskState) { (function (WorkSpaceTaskState) {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
"main": true, "main": true,
"url": "app://editor/index.html", "url": "app://editor/index.html",
"windowType": "dockable", "windowType": "dockable",
"x": -1899, "x": -1920,
"y": 197, "y": 25,
"width": 1920, "width": 1920,
"height": 1055, "height": 1055,
"layout": { "layout": {
...@@ -88,8 +88,7 @@ ...@@ -88,8 +88,7 @@
"inspector", "inspector",
"cocos-services" "cocos-services"
] ]
}, }
"worker": {}
}, },
"panels": { "panels": {
"store": { "store": {
......
...@@ -72,13 +72,13 @@ ...@@ -72,13 +72,13 @@
"b35e3080-aef7-4819-927e-f391cc85d8fa", "b35e3080-aef7-4819-927e-f391cc85d8fa",
"e0b242f1-c53c-4b8e-91fe-268c053b2d8f", "e0b242f1-c53c-4b8e-91fe-268c053b2d8f",
"e7c677eb-d529-4890-b7fa-cc433fe3d902", "e7c677eb-d529-4890-b7fa-cc433fe3d902",
"4cec8901-8eab-4765-9ec8-af64f3931bf5",
"445430f5-896b-46f2-8d76-7bf942178061", "445430f5-896b-46f2-8d76-7bf942178061",
"6ad1c32a-e62c-4cd3-b2c6-f1c1b30a4660", "6ad1c32a-e62c-4cd3-b2c6-f1c1b30a4660",
"d38ffd80-2c0c-4865-993b-d8ce9f6fe21d", "d38ffd80-2c0c-4865-993b-d8ce9f6fe21d",
"b779c231-722a-4460-ac43-333651f1de42", "b779c231-722a-4460-ac43-333651f1de42",
"fa82047f-ca46-4900-b016-1cbc6fb8dc8a", "fa82047f-ca46-4900-b016-1cbc6fb8dc8a",
"9d521361-150a-4693-a6c3-867dd716037f", "9d521361-150a-4693-a6c3-867dd716037f",
"ece3e714-af31-46df-98f2-b7f0cb6b5bb7" "ece3e714-af31-46df-98f2-b7f0cb6b5bb7",
"4cec8901-8eab-4765-9ec8-af64f3931bf5"
] ]
} }
{ {
"nodeFoldStates": [ "nodeFoldStates": [
"22tXbRqeZNxLi/X0YGeKYj",
"7b5DQy5UxK54pZjyG2rzwl",
"b9wlMZuo9PY7sjerrqIgcX",
"d2UyDsm59NBL8U4G9ELHAD",
"18J2tGR2RGkKVwZlglJmOj",
"fcFWXLhc9JwLl3cub5f7vf",
"f0lSuHIMlA6omA5BTE7GbG",
"f28nX+w1xL7KiB4KK+9z3b",
"3ah+kGpTdLZqDmKAvhkFn7",
"f3L654bTVNjL0Vj6L92Mm9",
"1a4HfJdfdGgY3UAz91M3Nl",
"4d2iQ3vf1OkbjwLx9TaGVo",
"f2GGWWcn1NOJ0YE0Inn+fj",
"78m9WVnNlJR5XYhWnAosVN",
"c5IfByPCVBv6TjZDIIrzpx",
"d5vEQlLGZFkqWyZu8n1lY7",
"0dPOamjS9AGrdUeaZO6qVN",
"1enAjGimxNeIjcCjNECPws",
"2d1xyYvQlC7ZccmMSR7qJb",
"ccVtmkLwlLOJYpFg4DhvTX",
"9aqoI4W9NBs730ziBROCzm",
"3fzjWgqLVCYoLdKajHIR9p",
"dayJ7w6GFJAbyGKx/49e8e",
"a150jGk0RLcaflRvNQtjSC", "a150jGk0RLcaflRvNQtjSC",
"acWc6QviFMCIySLqnhs/5C", "acWc6QviFMCIySLqnhs/5C",
"05fdfTlOlD4YRcOkemc8S4", "05fdfTlOlD4YRcOkemc8S4",
...@@ -499,6 +476,19 @@ ...@@ -499,6 +476,19 @@
"71ALuTSMNMULgxYqEmJ6vj", "71ALuTSMNMULgxYqEmJ6vj",
"0bh8Pf/jlB9LSck5+z/AEM", "0bh8Pf/jlB9LSck5+z/AEM",
"7cRsStCC5Ltp++uZsneFS1", "7cRsStCC5Ltp++uZsneFS1",
"24FDezDSdLObktgzxmV/Mj" "24FDezDSdLObktgzxmV/Mj",
"cfTs3NPqZBWobNp1spId1h",
"a9DV1n2F9PtIaOaRpGznN5",
"3eAnRfPENMHZgigXlUbGwT",
"ba0/yd8OZEra97d7jj9Oyj",
"4fMSGy7a9NYKn0MJZKSDHn",
"25CXZZVHhLs4ENPwGRqln8",
"2etnzOG6pHW6JnFOzVbk1N",
"fc8nNGAUhDjq0jGD7jQ/0v",
"55b8FsKzZEIogxLyIT8Rv/",
"a5Oy9LByhKrpENK/68vo3p",
"3cp4GhKxhAQoHfMFcKkpu8",
"51XD4NMmZLGZKkT3npIvUq",
"89wRMmWVFGm45XLo5gXHRW"
] ]
} }
This diff could not be displayed because it is too large.
...@@ -23,7 +23,6 @@ require('./assets/script/common/classbase/CCViewBase'); ...@@ -23,7 +23,6 @@ require('./assets/script/common/classbase/CCViewBase');
require('./assets/script/common/classbase/PresenterBase'); require('./assets/script/common/classbase/PresenterBase');
require('./assets/script/common/classbase/ViewBase'); require('./assets/script/common/classbase/ViewBase');
require('./assets/script/common/components/AlterAnim'); require('./assets/script/common/components/AlterAnim');
require('./assets/script/common/components/FireComponent');
require('./assets/script/common/components/FrameAnimation'); require('./assets/script/common/components/FrameAnimation');
require('./assets/script/common/components/PortraitFixComponent'); require('./assets/script/common/components/PortraitFixComponent');
require('./assets/script/common/components/SVButton'); require('./assets/script/common/components/SVButton');
......
This diff could not be displayed because it is too large.
...@@ -29,4 +29,4 @@ cc._RF.pop(); ...@@ -29,4 +29,4 @@ cc._RF.pop();
}); });
} }
})(); })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvZ2FtZS91aS92aWV3L3R5cGUvTWFpblZpZXcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0NhLFFBQUEsWUFBWSxHQUFHLFVBQVUsQ0FBQyIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRhYlZpZXdQcm9wcywgVGFiVmlldyB9IGZyb20gXCIuL1RhYlZpZXdcIjtcbmltcG9ydCB7IFB1cmVWaWV3IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2NvbW1vbi9jbGFzc2Jhc2UvVmlld0Jhc2VcIjtcbmltcG9ydCB7IEd1aWRlVmlld1BhcmFtTW9kZWwgfSBmcm9tIFwiLi4vLi4vcHJlc2VudGVyL0d1aWRlVmlld1ByZXNlbnRlclwiO1xuXG50eXBlIG9uRGVidWdDbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25VcmdlbnROb3RpY2VDbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25Hb1RvU2hvcENsaWNrQ2FsbGJhY2sgPSAoKSA9PiB2b2lkO1xudHlwZSBvbkNvbW1vblByb2JsZW1DbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25SZXdhcmRCdG5DbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbmV4cG9ydCBpbnRlcmZhY2UgTWFpblZpZXdQcm9wcyBleHRlbmRzIFRhYlZpZXdQcm9wcyB7XG4gICAgbWVzc2FnZVJlZERvdDogYm9vbGVhbjtcbiAgICBkYXRpbmdFdmVudFJlZERvdDogYm9vbGVhbjtcbiAgICB3YWl0UmVkRG90OiBib29sZWFuOyAgICAgICAvL+WVhuWfjue6oueCuVxuICAgIGRpc2NvdmVyUmVkRG90OiBib29sZWFuOyAgICAgICAvL+S7u+WKoee6oueCuSBcbiAgICBvbkRlYnVnQ2xpY2s6IG9uRGVidWdDbGlja0NhbGxiYWNrO1xuICAgIG9uVXJnZW50Tm90aWNlQ2xpY2s6IG9uVXJnZW50Tm90aWNlQ2xpY2tDYWxsYmFjaztcbiAgICBvbkdvVG9TaG9wQ2xpY2s6IG9uR29Ub1Nob3BDbGlja0NhbGxiYWNrO1xuICAgIG9uQ29tbW9uUHJvYmxlbUNsaWNrOiBvbkNvbW1vblByb2JsZW1DbGlja0NhbGxiYWNrO1xuICAgIG9uUmV3YXJkQnRuQ2xpY2tDYWxsYmFjazogb25SZXdhcmRCdG5DbGlja0NhbGxiYWNrO1xufVxuXG50eXBlIE1haW5WaWV3QmFzZSA9IFB1cmVWaWV3PE1haW5WaWV3UHJvcHM+ICYgVGFiVmlldztcblxuZXhwb3J0IGludGVyZmFjZSBNYWluVmlldyBleHRlbmRzIE1haW5WaWV3QmFzZSB7XG4gICAgZ2V0R3VpZGVUYWJQYXJhbShpbmRleDogbnVtYmVyKTogR3VpZGVWaWV3UGFyYW1Nb2RlbCB8IHVuZGVmaW5lZDtcbiAgICBoaWRlQ2xpY2tBbmlCeUluZGV4OiAoaW5kZXg6IG51bWJlcikgPT4gdm9pZDtcbiAgICBzaG93UmV3YXJkQnRuOiAoaXNTaG93OiBib29sZWFuKSA9PiB2b2lkO1xuICAgIHNob3dCb3R0b25zTm9kZTogKGlzU2hvdzogYm9vbGVhbikgPT4gdm9pZDtcbiAgICBzaG93U3ViR2FtZU5vZGU6IChpc1Nob3c6IGJvb2xlYW4pID0+IHZvaWQ7XG4gICAgdXBkYXRlQmVkUm9vbVJlZERvdDogKCkgPT4gdm9pZDtcbiAgICBvblRhYkJ1dHRvbkNsaWNrOiAoZXZlbnQ6IGFueSwgaW5kZXg6IHN0cmluZykgPT4gdm9pZDtcbiAgICBzaG93VGFiQmFyOiAoaXNTaG93OiBib29sZWFuKSA9PiB2b2lkO1xuICAgIHNob3dXYWl0aW5nVmlldzogKGlzU2hvdzogYm9vbGVhbikgPT4gdm9pZDtcbiAgICBnZXRSZXdhcmRSZWREb3ROb2RlOiAoKSA9PiBjYy5Ob2RlO1xufVxuXG5leHBvcnQgY29uc3QgTWFpblZpZXdUeXBlID0gXCJNYWluVmlld1wiOyJdfQ== //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvZ2FtZS91aS92aWV3L3R5cGUvTWFpblZpZXcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBeUJhLFFBQUEsWUFBWSxHQUFHLFVBQVUsQ0FBQyIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRhYlZpZXdQcm9wcywgVGFiVmlldyB9IGZyb20gXCIuL1RhYlZpZXdcIjtcbmltcG9ydCB7IFB1cmVWaWV3IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2NvbW1vbi9jbGFzc2Jhc2UvVmlld0Jhc2VcIjtcbmltcG9ydCB7IEd1aWRlVmlld1BhcmFtTW9kZWwgfSBmcm9tIFwiLi4vLi4vcHJlc2VudGVyL0d1aWRlVmlld1ByZXNlbnRlclwiO1xuXG50eXBlIG9uRGVidWdDbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25VcmdlbnROb3RpY2VDbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25Hb1RvU2hvcENsaWNrQ2FsbGJhY2sgPSAoKSA9PiB2b2lkO1xudHlwZSBvbkNvbW1vblByb2JsZW1DbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbnR5cGUgb25SZXdhcmRCdG5DbGlja0NhbGxiYWNrID0gKCkgPT4gdm9pZDtcbmV4cG9ydCBpbnRlcmZhY2UgTWFpblZpZXdQcm9wcyBleHRlbmRzIFRhYlZpZXdQcm9wcyB7XG4gICAgbWVzc2FnZVJlZERvdDogYm9vbGVhbjtcbiAgICBkYXRpbmdFdmVudFJlZERvdDogYm9vbGVhbjtcbiAgICBkaXNjb3ZlclJlZERvdDogYm9vbGVhbjsgICAgICAgLy/ku7vliqHnuqLngrkgXG4gICAgb25EZWJ1Z0NsaWNrOiBvbkRlYnVnQ2xpY2tDYWxsYmFjaztcbn1cblxudHlwZSBNYWluVmlld0Jhc2UgPSBQdXJlVmlldzxNYWluVmlld1Byb3BzPiAmIFRhYlZpZXc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTWFpblZpZXcgZXh0ZW5kcyBNYWluVmlld0Jhc2Uge1xuICAgIGdldEd1aWRlVGFiUGFyYW0oaW5kZXg6IG51bWJlcik6IEd1aWRlVmlld1BhcmFtTW9kZWwgfCB1bmRlZmluZWQ7XG4gICAgaGlkZUNsaWNrQW5pQnlJbmRleDogKGluZGV4OiBudW1iZXIpID0+IHZvaWQ7XG4gICAgb25UYWJCdXR0b25DbGljazogKGV2ZW50OiBhbnksIGluZGV4OiBzdHJpbmcpID0+IHZvaWQ7XG4gICAgc2hvd1dhaXRpbmdWaWV3OiAoaXNTaG93OiBib29sZWFuKSA9PiB2b2lkO1xufVxuXG5leHBvcnQgY29uc3QgTWFpblZpZXdUeXBlID0gXCJNYWluVmlld1wiOyJdfQ==
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,6 @@ require('./assets/script/common/classbase/CCViewBase'); ...@@ -12,7 +12,6 @@ require('./assets/script/common/classbase/CCViewBase');
require('./assets/script/common/classbase/PresenterBase'); require('./assets/script/common/classbase/PresenterBase');
require('./assets/script/common/classbase/ViewBase'); require('./assets/script/common/classbase/ViewBase');
require('./assets/script/common/components/AlterAnim'); require('./assets/script/common/components/AlterAnim');
require('./assets/script/common/components/FireComponent');
require('./assets/script/common/components/FrameAnimation'); require('./assets/script/common/components/FrameAnimation');
require('./assets/script/common/components/PortraitFixComponent'); require('./assets/script/common/components/PortraitFixComponent');
require('./assets/script/common/components/SVButton'); require('./assets/script/common/components/SVButton');
......
"use strict";
cc._RF.push(module, 'b96c8PkrHNC8aetxvcDIrfF', 'FireComponent');
// script/common/components/FireComponent.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const { ccclass, property } = cc._decorator;
let FireComponent = /** @class */ (() => {
let FireComponent = class FireComponent extends cc.Component {
constructor() {
super(...arguments);
this.isWidget = false;
this._widgetTarget = null;
// @property(cc.Node)
/** 烟火数量 */
this.fire_count = 35; // 原始100个
/** 烟火衰减速度 */
this.gap_alpha = 0.02; // 原始0.005
this.gfx = null;
this.particles = [];
///////////////// 自定义触摸监听 /////////////////
this._eventManager = cc["internal"]["eventManager"];
}
get widgetTarget() {
return this._widgetTarget;
}
set widgetTarget(value) {
this._widgetTarget = value;
this.isWidget = !!this._widgetTarget;
if (!CC_EDITOR) {
this.initWidgit();
}
}
onLoad() {
this.gfx = this.node.getComponent(cc.Graphics) || this.node.addComponent(cc.Graphics);
// widgit
this.initWidgit();
// touch
// this.initTouch();
this.InitTouch();
}
initWidgit() {
// 全屏适配
if (!this.isWidget)
return;
let canvas = cc.find("Canvas");
let widget = this.node.addComponent(cc.Widget);
widget.target = this.widgetTarget || canvas;
widget.isAlignTop = true;
widget.isAlignLeft = true;
widget.isAlignRight = true;
widget.isAlignBottom = true;
widget.left = 0;
widget.right = 0;
widget.top = 0;
widget.bottom = 0;
widget.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE;
}
initTouch() {
// 点击事件
// this.node.on(cc.Node.EventType.TOUCH_END, (event: cc.Event.EventTouch) => {
// let wpos = event.getLocation();
// let npos = this.node.convertToNodeSpaceAR(wpos);
// this.fire(npos.x, npos.y);
// })
}
ClickCall(event) {
let wpos = event.getLocation();
let npos = this.node.convertToNodeSpaceAR(wpos);
this.fire(npos.x, npos.y);
}
fire(x, y) {
// 生成烟花
this.gfx.clear();
this.createFireworks(x, y);
}
tick() {
this.gfx.fillColor = cc.color(255, 255, 255, 0); //0, 0, 0, 26
this.gfx.fillRect(-this.node.width / 2, -this.node.height / 2, this.node.width, this.node.height);
this.drawFireworks();
}
createFireworks(sx, sy) {
this.particles = [];
var hue = Math.floor(Math.random() * 51) + 150;
var hueVariance = 60; // 30
for (var i = 0; i < this.fire_count; i++) {
var angle = Math.floor(Math.random() * 360);
var p = {
radians: angle * Math.PI / 180,
x: sx,
y: sy,
speed: (Math.random() * 5) + .4,
radius: 0,
size: Math.floor(Math.random() * 3) + 1,
hue: Math.floor(Math.random() * 2 * hueVariance) + (hue - hueVariance),
brightness: Math.floor(Math.random() * 31) + 50,
alpha: (Math.floor(Math.random() * 61) + 40) / 100
};
p.radius = p.speed;
this.particles.push(p);
}
}
drawFireworks() {
// this.gfx.clear();
let isDraw = false;
for (var i = 0; i < this.particles.length; i++) {
var p = this.particles[i];
var vx = Math.cos(p.radians) * p.radius;
var vy = Math.sin(p.radians) * p.radius + 0.4;
p.x -= vx;
p.y -= vy;
p.radius *= 1 - p.speed / 100;
p.alpha -= this.gap_alpha; // 0.005
if (p.alpha > 0) {
isDraw = true;
this.gfx.arc(p.x, p.y, p.size, 0, Math.PI * 2, false);
this.gfx.fillColor = this.hsla2rgba('hsla(' + p.hue + ', 100%, ' + p.brightness + '%)', p.alpha);
this.gfx.fill();
}
}
if (!isDraw) {
this.gfx.clear();
}
}
hsla2rgba(str, alpha) {
const colorArr = str.match(/\d+/g);
let [h, s, l] = colorArr;
h = parseFloat(h) / 360;
s = parseFloat(s) / 100;
l = parseFloat(l) / 100;
if (s === 0) {
l = Math.round(l * 255);
return cc.color(l, l, l, Math.round(alpha * 255));
}
const getRGB = num => {
let q = l >= 0.5 ? l + s - l * s : l * (1 + s); // 注意是数字1加上s,不是字母l
let p = 2 * l - q;
if (num < 0) {
num += 1;
}
if (num > 1) {
num -= 1;
}
switch (true) {
case num > 2 / 3:
num = p;
break;
case num >= 1 / 2:
num = p + (q - p) * 6 * (2 / 3 - num);
break;
case num >= 1 / 6:
num = q;
break;
default:
num = p + (q - p) * 6 * num;
break;
}
return Math.round(num * 255);
};
let r = getRGB(h + 1 / 3);
let g = getRGB(h);
let b = getRGB(h - 1 / 3);
return cc.color(r, g, b, Math.round(alpha * 255));
}
update() {
this.tick();
}
InitTouch() {
const EventListener = cc["EventListener"];
this._touchListener = EventListener.create({
event: EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: false,
owner: this.node,
mask: null,
onTouchBegan: this.onTouchStart.bind(this),
onTouchMoved: null,
onTouchEnded: this.onTouchEnded.bind(this),
onTouchCancelled: null,
});
this._eventManager.addListener(this._touchListener, this.node);
}
onTouchStart(touch, event) {
// cc.log("touch start");
//此处必须返回true(表示接触到了节点),否则TOUCH_MOVE,TOUCH_END,TOUCH_CANCEL不触发。
return true;
}
onTouchEnded(touch, event) {
// cc.log("touch end");
this.ClickCall(touch);
}
onDestroy() {
// super.onDestroy();
this._eventManager.removeListener(this._touchListener, this.node);
}
};
__decorate([
property
], FireComponent.prototype, "isWidget", void 0);
__decorate([
property(cc.Node)
], FireComponent.prototype, "_widgetTarget", void 0);
FireComponent = __decorate([
ccclass
], FireComponent);
return FireComponent;
})();
exports.default = FireComponent;
cc._RF.pop();
\ No newline at end of file
...@@ -283,10 +283,8 @@ var MainTabs; ...@@ -283,10 +283,8 @@ var MainTabs;
MainTabs[MainTabs["messageTab"] = 0] = "messageTab"; MainTabs[MainTabs["messageTab"] = 0] = "messageTab";
/**约会 */ /**约会 */
MainTabs[MainTabs["datingEventTab"] = 1] = "datingEventTab"; MainTabs[MainTabs["datingEventTab"] = 1] = "datingEventTab";
/**卧室 */
MainTabs[MainTabs["bedroomTab"] = 2] = "bedroomTab";
/**发现 */ /**发现 */
MainTabs[MainTabs["discoverTab"] = 3] = "discoverTab"; MainTabs[MainTabs["discoverTab"] = 2] = "discoverTab";
})(MainTabs = exports.MainTabs || (exports.MainTabs = {})); })(MainTabs = exports.MainTabs || (exports.MainTabs = {}));
var WorkSpaceTaskState; var WorkSpaceTaskState;
(function (WorkSpaceTaskState) { (function (WorkSpaceTaskState) {
......
...@@ -35,13 +35,11 @@ const PlotStopViewPresenter_1 = require("./PlotStopViewPresenter"); ...@@ -35,13 +35,11 @@ const PlotStopViewPresenter_1 = require("./PlotStopViewPresenter");
const simba_cc_audio_manager_1 = require("simba-cc-audio-manager"); const simba_cc_audio_manager_1 = require("simba-cc-audio-manager");
const simba_cc_resutils_1 = require("simba-cc-resutils"); const simba_cc_resutils_1 = require("simba-cc-resutils");
const GameConstData_1 = require("../../../common/gameplay/gamedata/GameConstData"); const GameConstData_1 = require("../../../common/gameplay/gamedata/GameConstData");
const BedroomViewPresenter_1 = require("./bedroom/BedroomViewPresenter");
const UnlockItemModelManager_1 = require("../../model/UnlockItemModelManager"); const UnlockItemModelManager_1 = require("../../model/UnlockItemModelManager");
const ItemTbl_1 = require("../../../config/ItemTbl"); const ItemTbl_1 = require("../../../config/ItemTbl");
const GameConfig_1 = require("../../../GameConfig"); const GameConfig_1 = require("../../../GameConfig");
const simba_httpclient_1 = require("simba-httpclient"); const simba_httpclient_1 = require("simba-httpclient");
const BedroomCatRewardViewPresenter_1 = require("./bedroom/BedroomCatRewardViewPresenter"); const BedroomCatRewardViewPresenter_1 = require("./bedroom/BedroomCatRewardViewPresenter");
const BedRoomCatModelManager_1 = require("../../model/BedRoomCatModelManager");
const PromptAlertDialogViewPresenter_1 = require("./bedroom/PromptAlertDialogViewPresenter"); const PromptAlertDialogViewPresenter_1 = require("./bedroom/PromptAlertDialogViewPresenter");
const UnlockSpecialPlotModelManager_1 = require("../../model/UnlockSpecialPlotModelManager"); const UnlockSpecialPlotModelManager_1 = require("../../model/UnlockSpecialPlotModelManager");
const EditorEnums_1 = require("../../../avg/EditorEnums"); const EditorEnums_1 = require("../../../avg/EditorEnums");
...@@ -53,7 +51,6 @@ const simba_sdk_1 = require("simba-sdk"); ...@@ -53,7 +51,6 @@ const simba_sdk_1 = require("simba-sdk");
const TabPresenterFactory = [ const TabPresenterFactory = [
MessageViewPresenter_1.default, MessageViewPresenter_1.default,
DatingEventViewPresenter_1.default, DatingEventViewPresenter_1.default,
BedroomViewPresenter_1.default,
DiscoverViewPresenter_1.default DiscoverViewPresenter_1.default
]; ];
/**主线剧情的下标 */ /**主线剧情的下标 */
...@@ -150,15 +147,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -150,15 +147,6 @@ let MainViewPresenter = /** @class */ (() => {
if (!this._tabClickAble) { if (!this._tabClickAble) {
return; return;
} }
// if (isDot != false) {
// let uiName = ["click_message", "click_event", "click_wait", "click_finding"];
// GameDotMgr.getInstance().dotClickUI(uiName[index]);
// }
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
this._view.showRewardBtn(index !== Enums_1.MainTabs.bedroomTab);
this._view.showBottonsNode(index !== Enums_1.MainTabs.bedroomTab);
this._view.showSubGameNode(index !== Enums_1.MainTabs.bedroomTab);
this.dealTabGuide(index); this.dealTabGuide(index);
let uuid = TabPresenterFactory[index].uuid; let uuid = TabPresenterFactory[index].uuid;
if (!GameModelManager_1.GameModelManager.checkFuncUnloced(uuid)) { if (!GameModelManager_1.GameModelManager.checkFuncUnloced(uuid)) {
...@@ -187,7 +175,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -187,7 +175,6 @@ let MainViewPresenter = /** @class */ (() => {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== Enums_1.MainTabs.bedroomTab);
}); });
} }
else { else {
...@@ -197,7 +184,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -197,7 +184,6 @@ let MainViewPresenter = /** @class */ (() => {
if (callback) { if (callback) {
callback(); callback();
} }
this._view.showTabBar(index !== Enums_1.MainTabs.bedroomTab);
} }
} }
else { else {
...@@ -214,7 +200,7 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -214,7 +200,7 @@ let MainViewPresenter = /** @class */ (() => {
let index = GameModelManager_1.GameModelManager.getMainTabGuideIndex(); let index = GameModelManager_1.GameModelManager.getMainTabGuideIndex();
if (index !== -1) { if (index !== -1) {
//attention //attention
let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.waitRedDot, this._viewProps.discoverRedDot]; let redDotArr = [this._viewProps.messageRedDot, this._viewProps.datingEventRedDot, this._viewProps.discoverRedDot];
if (!redDotArr[index] || this._currentTab === index) { if (!redDotArr[index] || this._currentTab === index) {
return; return;
} }
...@@ -378,9 +364,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -378,9 +364,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy(); GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
}; };
/** /**
* 卧室返回点击UI事件 * 卧室返回点击UI事件
...@@ -397,10 +380,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -397,10 +380,6 @@ let MainViewPresenter = /** @class */ (() => {
tab = Enums_1.MainTabs.datingEventTab; tab = Enums_1.MainTabs.datingEventTab;
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
break; break;
case EditorEnums_1.PageIndex.BedroomView:
tab = Enums_1.MainTabs.bedroomTab;
this._view.onTabButtonClick(null, `${tab}`);
break;
case EditorEnums_1.PageIndex.ExtraPlotView: case EditorEnums_1.PageIndex.ExtraPlotView:
tab = Enums_1.MainTabs.datingEventTab; tab = Enums_1.MainTabs.datingEventTab;
this._view.onTabButtonClick(null, `${tab}`); this._view.onTabButtonClick(null, `${tab}`);
...@@ -416,14 +395,9 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -416,14 +395,9 @@ let MainViewPresenter = /** @class */ (() => {
selectedTab: 0, selectedTab: 0,
messageRedDot: false, messageRedDot: false,
datingEventRedDot: false, datingEventRedDot: false,
waitRedDot: false,
discoverRedDot: false, discoverRedDot: false,
onTabClick: this.onTabClick, onTabClick: this.onTabClick,
onDebugClick: this.onDebugClickCallback, onDebugClick: this.onDebugClickCallback,
onUrgentNoticeClick: this.onUrgentNoticeClickCallback,
onGoToShopClick: this.onGoToShopClickCallback,
onCommonProblemClick: this.onCommonProblemClickCallback,
onRewardBtnClickCallback: this.onRewardBtnClickCallback,
}; };
} }
async start() { async start() {
...@@ -456,8 +430,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -456,8 +430,6 @@ let MainViewPresenter = /** @class */ (() => {
this._tabClickAble = true; this._tabClickAble = true;
GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy(); GameModelManager_1.GameModelManager.dealAutoResumeFullEnergy();
//进入主界面更新红点状态 //进入主界面更新红点状态
this.view.updateBedRoomRedDot();
this.updateRewardBtnRedDot();
setTimeout(() => { setTimeout(() => {
//关闭等待界面 //关闭等待界面
this.view.showWaitingView(false); this.view.showWaitingView(false);
...@@ -534,8 +506,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -534,8 +506,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
onEnterBackground() { onEnterBackground() {
super.onEnterBackground(); super.onEnterBackground();
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
if (this._subPresenters[this._currentTab]) if (this._subPresenters[this._currentTab])
this._subPresenters[this._currentTab].onEnterBackground(); this._subPresenters[this._currentTab].onEnterBackground();
} }
...@@ -552,8 +522,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -552,8 +522,6 @@ let MainViewPresenter = /** @class */ (() => {
if (!GameConfig_1.GameConfig.isVerb) { if (!GameConfig_1.GameConfig.isVerb) {
GameModelManager_1.GameModelManager.checkAutoPopView(); GameModelManager_1.GameModelManager.checkAutoPopView();
} }
this.view.updateBedRoomRedDot(); //更新卧室界面红点
this.updateRewardBtnRedDot();
} }
onShow() { onShow() {
super.onShow(); super.onShow();
...@@ -581,20 +549,6 @@ let MainViewPresenter = /** @class */ (() => { ...@@ -581,20 +549,6 @@ let MainViewPresenter = /** @class */ (() => {
} }
return cfg; return cfg;
} }
updateRewardBtnRedDot() {
for (let i = 1; i < 4; i++) {
let catRewardStatus = BedRoomCatModelManager_1.BedRoomCatModelManager.getCatRewardStatus(i);
for (let j = 0; j < catRewardStatus.length; j++) {
if (catRewardStatus[j] == 1) {
this.view.getRewardRedDotNode().active = true;
return;
}
else {
this.view.getRewardRedDotNode().active = false;
}
}
}
}
}; };
MainViewPresenter.uuid = "MainViewPresenter"; MainViewPresenter.uuid = "MainViewPresenter";
MainViewPresenter.tabIndex = -1; MainViewPresenter.tabIndex = -1;
......
...@@ -13,11 +13,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -13,11 +13,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.MainViewImpl = void 0; exports.MainViewImpl = void 0;
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects"); const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const CCViewBase_1 = require("../../../../common/classbase/CCViewBase"); const CCViewBase_1 = require("../../../../common/classbase/CCViewBase");
const CCGameCenterNodeFactory_1 = require("../../../../cooperation/script/CCGameCenterNodeFactory");
const GameConfig_1 = require("../../../../GameConfig"); const GameConfig_1 = require("../../../../GameConfig");
const Enums_1 = require("../../../Enums"); const Enums_1 = require("../../../Enums");
const UnlockItemModelManager_1 = require("../../../model/UnlockItemModelManager");
const UnlockSpecialPlotEventManager_1 = require("../../../model/UnlockSpecialPlotEventManager");
const PresenterCCViewFactory_1 = require("../../PresenterCCViewFactory"); const PresenterCCViewFactory_1 = require("../../PresenterCCViewFactory");
const MainView_1 = require("../type/MainView"); const MainView_1 = require("../type/MainView");
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -27,30 +24,19 @@ let MainViewImpl = /** @class */ (() => { ...@@ -27,30 +24,19 @@ let MainViewImpl = /** @class */ (() => {
super(...arguments); super(...arguments);
this.contentParent = CCDummyObjects_1.DummyNode; this.contentParent = CCDummyObjects_1.DummyNode;
this.titleSprite = CCDummyObjects_1.DummySprite; this.titleSprite = CCDummyObjects_1.DummySprite;
this.buttonLayout = CCDummyObjects_1.DummyNode;
this.tabbarButtons = []; this.tabbarButtons = [];
this.tabbarSpriteFrames = []; this.tabbarSpriteFrames = [];
this.titleSpriteFrames = []; this.titleSpriteFrames = [];
this.clickAniArr = []; this.clickAniArr = [];
this.debugbtn = CCDummyObjects_1.DummyNode; this.debugbtn = CCDummyObjects_1.DummyNode;
this.gameCenterBtn = CCDummyObjects_1.DummyNode;
this.urgentNoticeBtn = CCDummyObjects_1.DummyNode;
this.goToShopBtn = CCDummyObjects_1.DummyNode;
this.commonProblemBtn = CCDummyObjects_1.DummyNode;
this.rewardBtn = CCDummyObjects_1.DummyNode;
this.rewardRedDotNode = CCDummyObjects_1.DummyNode;
this.waitNode = CCDummyObjects_1.DummyNode; this.waitNode = CCDummyObjects_1.DummyNode;
this.subGameNode = CCDummyObjects_1.DummyNode;
this.loadingLabel = CCDummyObjects_1.DummyLabel; this.loadingLabel = CCDummyObjects_1.DummyLabel;
this.downButton = CCDummyObjects_1.DummyNode;
this.buttonsNode = CCDummyObjects_1.DummyNode;
this._dotNumber = 1; this._dotNumber = 1;
this._isdown = true;
this.hideClickAniByIndex = (index) => { this.hideClickAniByIndex = (index) => {
if (index < 0 || index > this.clickAniArr.length) { if (index < 0 || index > this.clickAniArr.length) {
return; return;
} }
let limitArr = [Enums_1.MainTabs.messageTab, Enums_1.MainTabs.datingEventTab, Enums_1.MainTabs.bedroomTab]; let limitArr = [Enums_1.MainTabs.messageTab, Enums_1.MainTabs.datingEventTab];
let contrlArr = [this._props.messageRedDot, this._props.datingEventRedDot]; let contrlArr = [this._props.messageRedDot, this._props.datingEventRedDot];
let exist = limitArr.findIndex((v) => v === index) !== (-1); let exist = limitArr.findIndex((v) => v === index) !== (-1);
if (exist) { if (exist) {
...@@ -64,33 +50,9 @@ let MainViewImpl = /** @class */ (() => { ...@@ -64,33 +50,9 @@ let MainViewImpl = /** @class */ (() => {
} }
} }
}; };
this.showRewardBtn = (isShow) => {
// this.urgentNoticeBtn.active = isShow;
this.goToShopBtn.active = isShow;
if (!this._isdown) {
this.downButton.active = isShow;
}
};
this.showBottonsNode = (isShow) => {
this.buttonsNode.active = isShow;
if (this._isdown) {
this.buttonsNode.active = isShow;
}
};
this.showSubGameNode = (isShow) => {
if (GameConfig_1.channel !== "android") {
this.subGameNode.active = isShow;
}
else {
this.subGameNode.active = false;
}
};
} }
onTabButtonClick(event, index) { onTabButtonClick(event, index) {
// this.showTabBar(false); this._props.onTabClick(parseInt(index), () => { });
this._props.onTabClick(parseInt(index), () => {
// this.showTabBar(true);
});
this.hideClickAniByIndex(parseInt(index)); this.hideClickAniByIndex(parseInt(index));
} }
onLoad() { onLoad() {
...@@ -114,25 +76,11 @@ let MainViewImpl = /** @class */ (() => { ...@@ -114,25 +76,11 @@ let MainViewImpl = /** @class */ (() => {
this.clickAniArr[Enums_1.MainTabs.datingEventTab].node.active = false; this.clickAniArr[Enums_1.MainTabs.datingEventTab].node.active = false;
} }
}); });
this.bindProp("waitRedDot", (value) => {
this.tabbarButtons[Enums_1.MainTabs.bedroomTab].node.getChildByName("RedDot").active = value;
});
//修改主界面发现按钮为永久显示红点 //修改主界面发现按钮为永久显示红点
//this.bindProp("discoverRedDot", this.tabbarButtons[MainTabs.discoverTab].node.getChildByName("RedDot"), "active");
this.bindProp("discoverRedDot", (value) => { this.bindProp("discoverRedDot", (value) => {
this.tabbarButtons[Enums_1.MainTabs.discoverTab].node.getChildByName("RedDot").active = true; this.tabbarButtons[Enums_1.MainTabs.discoverTab].node.getChildByName("RedDot").active = true;
}); });
this.debugbtn.active = GameConfig_1.GameConfig.debug; this.debugbtn.active = GameConfig_1.GameConfig.debug;
if (GameConfig_1.channel !== "android") {
this.gameCenterBtn.active = true;
this.subGameNode.active = true;
CCGameCenterNodeFactory_1.default.getInstance().registerMainUISubGameNode(this.subGameNode);
}
else {
this.gameCenterBtn.active = false;
this.subGameNode.active = false;
}
this.urgentNoticeBtn.active = false;
} }
getTabContentContainer() { getTabContentContainer() {
return this._tabContentContainer; return this._tabContentContainer;
...@@ -171,36 +119,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -171,36 +119,6 @@ let MainViewImpl = /** @class */ (() => {
}; };
return m; return m;
} }
getRewardRedDotNode() {
return this.rewardRedDotNode;
}
onUrgentNoticeClickCallback(event) {
this._props.onUrgentNoticeClick();
}
onGoToShopClickCallback(event) {
this._props.onGoToShopClick();
}
onCommonProblemClickCallback(event) {
this._props.onCommonProblemClick();
}
onRewardBtnClickCallback(event) {
this._props.onRewardBtnClickCallback();
}
updateBedRoomRedDot() {
let showRedDot = false;
let allItemIds = [];
allItemIds = UnlockItemModelManager_1.UnlockItemModelManager.unlockItems;
for (let i = 0; i < allItemIds.length; i++) {
if (UnlockSpecialPlotEventManager_1.default.getInstance().isShowBedRoomRedDotStatus(allItemIds[i])) {
showRedDot = true;
break;
}
}
this.tabbarButtons[Enums_1.MainTabs.bedroomTab].node.getChildByName("RedDot").active = showRedDot;
}
showTabBar(isShow) {
this.node.getChildByName("TabBar").active = isShow;
}
showWaitingView(isShow) { showWaitingView(isShow) {
this.waitNode.active = isShow; this.waitNode.active = isShow;
} }
...@@ -219,26 +137,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -219,26 +137,6 @@ let MainViewImpl = /** @class */ (() => {
this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot; this.loadingLabel.string = "正在努力加载(ง ˙o˙)ว!请耐心等待" + dot;
}, 0.5); }, 0.5);
} }
onDownButtonClick() {
this._isdown = true;
this.downButton.active = false;
this.buttonsNode.active = true;
this.buttonsNode.scaleY = 0;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 1 })
.call(() => {
})
.start();
}
onUpButtonClick() {
this._isdown = false;
cc.tween(this.buttonsNode)
.to(0.2, { scaleY: 0 })
.call(() => {
this.downButton.active = true;
})
.start();
}
}; };
__decorate([ __decorate([
property({ type: cc.Node }) property({ type: cc.Node })
...@@ -247,9 +145,6 @@ let MainViewImpl = /** @class */ (() => { ...@@ -247,9 +145,6 @@ let MainViewImpl = /** @class */ (() => {
property({ type: cc.Sprite }) property({ type: cc.Sprite })
], MainViewImpl.prototype, "titleSprite", void 0); ], MainViewImpl.prototype, "titleSprite", void 0);
__decorate([ __decorate([
property({ type: cc.Node })
], MainViewImpl.prototype, "buttonLayout", void 0);
__decorate([
property({ type: [cc.Button], displayName: "Tabbar Buttons" }) property({ type: [cc.Button], displayName: "Tabbar Buttons" })
], MainViewImpl.prototype, "tabbarButtons", void 0); ], MainViewImpl.prototype, "tabbarButtons", void 0);
__decorate([ __decorate([
...@@ -266,37 +161,10 @@ let MainViewImpl = /** @class */ (() => { ...@@ -266,37 +161,10 @@ let MainViewImpl = /** @class */ (() => {
], MainViewImpl.prototype, "debugbtn", void 0); ], MainViewImpl.prototype, "debugbtn", void 0);
__decorate([ __decorate([
property(cc.Node) property(cc.Node)
], MainViewImpl.prototype, "gameCenterBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "urgentNoticeBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "goToShopBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "commonProblemBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "rewardBtn", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "rewardRedDotNode", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "waitNode", void 0); ], MainViewImpl.prototype, "waitNode", void 0);
__decorate([ __decorate([
property(cc.Node)
], MainViewImpl.prototype, "subGameNode", void 0);
__decorate([
property(cc.Label) property(cc.Label)
], MainViewImpl.prototype, "loadingLabel", void 0); ], MainViewImpl.prototype, "loadingLabel", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "downButton", void 0);
__decorate([
property(cc.Node)
], MainViewImpl.prototype, "buttonsNode", void 0);
MainViewImpl = __decorate([ MainViewImpl = __decorate([
ccclass, ccclass,
PresenterCCViewFactory_1.RegView(MainView_1.MainViewType, "prefab/ui/MainView") PresenterCCViewFactory_1.RegView(MainView_1.MainViewType, "prefab/ui/MainView")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!