mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-18 18:58:06 +08:00
add thanks
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,6 +0,0 @@
|
||||
export default class CyberThanks extends CyberThanksUI {
|
||||
constructor() {
|
||||
super();
|
||||
this.btnBack.on(Laya.Event.CLICK, this, ()=>$ui.switchView(UI.pages.MAIN));
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,58 @@ export default class Thanks extends ThanksUI {
|
||||
constructor() {
|
||||
super();
|
||||
this.btnBack.on(Laya.Event.CLICK, this, ()=>$ui.switchView(UI.pages.MAIN));
|
||||
this.listSupports.renderHandler = Laya.Handler.create(this, this.renderSupport, null, false);
|
||||
this.panelTopSupports.vScrollBar.elasticDistance = 150;
|
||||
this.listSupports.scrollBar.elasticDistance = 150;
|
||||
this.btnAFD.on(Laya.Event.CLICK, this, goto, ['sponsor_afd']);
|
||||
this.btnDDF.on(Laya.Event.CLICK, this, goto, ['sponsor_ddf']);
|
||||
}
|
||||
|
||||
static #createComponent = plugin.extractComponents(Thanks.uiView, ['boxTopSupport']);
|
||||
#createTopSupportItem() {
|
||||
const item = Thanks.#createComponent('boxTopSupport');
|
||||
item.name = item.getChildByName('name');
|
||||
item.comment = item.getChildByName('comment');
|
||||
$_.deepMapSet(item, $ui.common.topSupportItem);
|
||||
return item;
|
||||
}
|
||||
|
||||
#topSupports;
|
||||
|
||||
init() {
|
||||
const supports = [];
|
||||
this.#topSupports = [];
|
||||
core.specialThanks
|
||||
.sort(()=>0.5-Math.random())
|
||||
.forEach(({group, name, comment, color})=>
|
||||
group == 2
|
||||
? supports.push({name, color})
|
||||
: this.renderTopSupport(name, comment, color)
|
||||
);
|
||||
this.listSupports.array = supports;
|
||||
}
|
||||
|
||||
renderTopSupport(name, comment, color) {
|
||||
const item = this.#createTopSupportItem();
|
||||
item.name.text = name;
|
||||
item.comment.text = comment;
|
||||
item.name.color = color || '#000000';
|
||||
this.vboxTopSupports.addChild(item);
|
||||
this.#topSupports.push(item);
|
||||
this.#topSupports.forEach((item, index) => item.y = index);
|
||||
}
|
||||
|
||||
renderSupport(label) {
|
||||
const {name, color} = label.dataSource;
|
||||
label.text = name;
|
||||
label.color = color || $ui.common.defaultFontColor;
|
||||
}
|
||||
|
||||
close() {
|
||||
this.#topSupports.forEach(item => {
|
||||
item.removeSelf();
|
||||
item.destroy();
|
||||
});
|
||||
this.#topSupports = null;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ const cyber = {
|
||||
[pages.TRAJECTORY]: "cyber/trajectory",
|
||||
[pages.SUMMARY]: "cyber/summary",
|
||||
[pages.ACHIEVEMENT]: "cyber/achievement",
|
||||
[pages.THANKS]: "cyber/thanks",
|
||||
[pages.THANKS]: "default/thanks",
|
||||
},
|
||||
popups: {
|
||||
[popups.ACHIEVEMENT]: "cyber/popup/achievementPopup",
|
||||
@@ -30,6 +30,13 @@ const cyber = {
|
||||
configs: {
|
||||
bgColor: '#04131f',
|
||||
common: {
|
||||
topSupportItem: {
|
||||
defaultColor: '#ffa500',
|
||||
defaultStroke: '#ffa500',
|
||||
hoverColor: '#ffc500',
|
||||
hoverStroke: '#ffa500',
|
||||
},
|
||||
defaultFontColor: '#cccccc',
|
||||
grade: [
|
||||
'#cccccc',
|
||||
'#55fffe',
|
||||
@@ -43,6 +50,40 @@ const cyber = {
|
||||
'#ffce45ff',
|
||||
],
|
||||
},
|
||||
pages: {
|
||||
[pages.THANKS]: {
|
||||
vars: {
|
||||
btnBack: {
|
||||
defaultColor: '#5865f2',
|
||||
defaultStroke: '#eeeeee',
|
||||
defaultLabel: '#eeeeee',
|
||||
hoverColor: '#1160b0',
|
||||
hoverStroke: '#eeeeee',
|
||||
hoverLabel: '#eeeeee',
|
||||
lineWidth: 0,
|
||||
radius: 4,
|
||||
},
|
||||
btnAFD: {
|
||||
defaultColor: '#8764de',
|
||||
defaultStroke: '#8764de',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#9774ee',
|
||||
hoverStroke: '#9774ee',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
},
|
||||
btnDDF: {
|
||||
defaultColor: '#cc6699',
|
||||
defaultStroke: '#cc6699',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#dc76a9',
|
||||
hoverStroke: '#dc76a9',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,15 +109,19 @@ const dark = {
|
||||
box: {
|
||||
defaultColor: '#4a5361',
|
||||
defaultStroke: '#4a5361',
|
||||
defaultLabel: '#eeeeee',
|
||||
hoverColor: '#4a5361',
|
||||
hoverStroke: '#4a5361',
|
||||
hoverLabel: '#eeeeee',
|
||||
filters: ()=>[new Laya.GlowFilter("#eeeeee", 8, 0, 0)],
|
||||
},
|
||||
ageColor: '#ffffee',
|
||||
contentColor: '#eeeeee',
|
||||
},
|
||||
topSupportItem: {
|
||||
defaultColor: '#ffa500',
|
||||
defaultStroke: '#ffa500',
|
||||
hoverColor: '#ffc500',
|
||||
hoverStroke: '#ffa500',
|
||||
},
|
||||
grade: [
|
||||
'#cccccc',
|
||||
'#55fffe',
|
||||
@@ -381,6 +426,24 @@ const dark = {
|
||||
[pages.THANKS]: {
|
||||
vars: {
|
||||
btnBack: 'btn_small',
|
||||
btnAFD: {
|
||||
defaultColor: '#8764de',
|
||||
defaultStroke: '#8764de',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#9774ee',
|
||||
hoverStroke: '#9774ee',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
},
|
||||
btnDDF: {
|
||||
defaultColor: '#cc6699',
|
||||
defaultStroke: '#cc6699',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#dc76a9',
|
||||
hoverStroke: '#dc76a9',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -419,19 +482,17 @@ const light = {
|
||||
defaultFontColor: '#000000',
|
||||
trajectoryItem: {
|
||||
box: {
|
||||
defaultColor: '#ffffff',
|
||||
defaultStroke: '#ffffff',
|
||||
defaultLabel: '#000000',
|
||||
hoverColor: '#ffffff',
|
||||
hoverStroke: '#ffffff',
|
||||
hoverLabel: '#000000',
|
||||
lineWidth: 0,
|
||||
radius: 0,
|
||||
filters: ()=>[new Laya.GlowFilter("#b1b1b1", 8, 0, 0)],
|
||||
},
|
||||
ageColor: '#000000',
|
||||
contentColor: '#000000',
|
||||
},
|
||||
topSupportItem: {
|
||||
defaultColor: '#ffa500',
|
||||
defaultStroke: '#ffa500',
|
||||
hoverColor: '#ffc500',
|
||||
hoverStroke: '#ffa500',
|
||||
},
|
||||
grade: [
|
||||
'#000000',
|
||||
'#55fffe',
|
||||
@@ -734,6 +795,24 @@ const light = {
|
||||
[pages.THANKS]: {
|
||||
vars: {
|
||||
btnBack: 'btn_small',
|
||||
btnAFD: {
|
||||
defaultColor: '#8764de',
|
||||
defaultStroke: '#8764de',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#9774ee',
|
||||
hoverStroke: '#9774ee',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
},
|
||||
btnDDF: {
|
||||
defaultColor: '#cc6699',
|
||||
defaultStroke: '#cc6699',
|
||||
defaultLabel: '#ffffff',
|
||||
hoverColor: '#dc76a9',
|
||||
hoverStroke: '#dc76a9',
|
||||
hoverLabel: '#ffffff',
|
||||
radius: 4,
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user