daily update

This commit is contained in:
Vick Scarlet
2021-11-24 23:10:04 +08:00
parent f8dd720d4d
commit 52d6a0ca8f
17 changed files with 251 additions and 964 deletions
+2 -2
View File
@@ -37,11 +37,11 @@ export default class CyberAchievement extends CyberAchievementUI {
this.labRemakeTimes.text = statistics[pt.TMS].value;
this.labRemakeTimesJudge.text = statistics[pt.TMS].judge;
this.labAchievementCountJudge.color = $ui.gradeColor(statistics[pt.TMS].grade);
this.labAchievementCountJudge.color = $ui.common.grade[statistics[pt.TMS].grade];
this.labAchievementCount.text = statistics[pt.CACHV].value;
this.labAchievementCountJudge.text = statistics[pt.CACHV].judge;
this.labAchievementCountJudge.color = $ui.gradeColor(statistics[pt.CACHV].grade);
this.labAchievementCountJudge.color = $ui.common.grade[statistics[pt.CACHV].grade];
this.labEventRate.text = parseInt(statistics[pt.REVT].value*100)+'%';
this.prgEventRate.value = statistics[pt.REVT].value;
+12
View File
@@ -15,6 +15,18 @@ export default class CyberMain extends CyberMainUI {
});
}
static load() {
return [
"fonts/方正像素12.ttf",
"images/atlas/images/accessories.atlas",
"images/atlas/images/border.atlas",
"images/atlas/images/button.atlas",
"images/atlas/images/icons.atlas",
"images/atlas/images/progress.atlas",
"images/atlas/images/slider.atlas",
]
}
init() {
this.btnDiscord.visible =
this.btnAchievement.visible =
@@ -8,7 +8,7 @@ export default class CyberAchievementPopup extends CyberAchievementPopupUI {
Laya.Tween.clearAll(this.boxBg);
this.alpha = 0.8;
this.labName.text = achievement.name;
this.labName.color = $ui.gradeColor(achievement.grade);
this.labName.color = $ui.common.grade[achievement.grade];
this.x = - this.width;
this.boxBg.x = this.boxBg.width;
await Promise.all([
+2 -12
View File
@@ -15,18 +15,8 @@ export default class CyberSummary extends CyberSummaryUI {
init({talents}) {
const {summary, lastExtendTalent} = core;
const gradeFilters = [
$ui.common.grade0,
$ui.common.grade1,
$ui.common.grade2,
$ui.common.grade3,
];
const gradeColors = [
$ui.common.filter0,
$ui.common.filter1,
$ui.common.filter2,
$ui.common.filter3,
];
const gradeFilters = $ui.common.filter;
const gradeColors = $ui.common.grade;
const age = summary[core.PropertyTypes.HAGE];
this.labAge.text = ''+age.value;
+2 -2
View File
@@ -37,11 +37,11 @@ export default class Achievement extends AchievementUI {
this.labRemakeTimes.text = statistics[pt.TMS].value;
this.labRemakeTimesJudge.text = statistics[pt.TMS].judge;
this.labAchievementCountJudge.color = $ui.gradeColor(statistics[pt.TMS].grade);
this.labAchievementCountJudge.color = $ui.common.grade[statistics[pt.TMS].grade];
this.labAchievementCount.text = statistics[pt.CACHV].value;
this.labAchievementCountJudge.text = statistics[pt.CACHV].judge;
this.labAchievementCountJudge.color = $ui.gradeColor(statistics[pt.CACHV].grade);
this.labAchievementCountJudge.color = $ui.common.grade[statistics[pt.CACHV].grade];
this.labEventRate.text = parseInt(statistics[pt.REVT].value*100)+'%';
this.prgEventRate.value = statistics[pt.REVT].value;
+6
View File
@@ -8,6 +8,12 @@ export default class Main extends MainUI {
this.btnDiscord.on(Laya.Event.CLICK, this, goto, ['discord']);
}
static load() {
return [
"images/atlas/images/icons.atlas",
]
}
init() {
this.btnDiscord.visible =
this.btnAchievement.visible =
@@ -8,7 +8,7 @@ export default class achievementPopup extends AchievementPopupUI {
Laya.Tween.clearAll(this.boxBg);
this.alpha = 0.8;
this.labName.text = achievement.name;
this.labName.color = $ui.gradeColor(achievement.grade);
this.labName.color = $ui.common.grade[achievement.grade];
this.x = - this.width;
this.boxBg.x = this.boxBg.width;
await Promise.all([
+5 -54
View File
@@ -5,19 +5,9 @@ export default class Talent extends TalentUI {
this.btnNext.on(Laya.Event.CLICK, this, this.onClickNext);
this.listTalents.renderHandler = Laya.Handler.create(this, this.renderTalent, null, false);
this.listTalents.scrollBar.elasticDistance = 150;
this.on(Laya.Event.RESIZE, this, () => {
const renderWidth = this.listTalents?._itemRender?.props?.width;
if(renderWidth) {
const col = Math.max(Math.floor((this.width - 40) / renderWidth), 1);
this.listTalents.width = col * renderWidth + (col - 1) * (this.listTalents.spaceY || 0);
}
});
}
#selected = new Set();
static load() {
return ['images/background/background_2@3x.png'];
}
init() {
this.pageDrawCard.visible = true;
@@ -46,51 +36,11 @@ export default class Talent extends TalentUI {
renderTalent(box, index) {
const dataSource = box.dataSource;
const hboxTitle = box.getChildByName("hboxTitle");
const labTitle = hboxTitle.getChildByName("labTitle");
const grades = hboxTitle.getChildByName("grades");
const grade1 = grades.getChildByName("grade1");
const grade2 = grades.getChildByName("grade2");
const grade3 = grades.getChildByName("grade3");
const labDescription = box.getChildByName("labDescription");
const unselected = box.getChildByName("unselected");
const selected = box.getChildByName("selected");
box.label = `${dataSource.name}(${dataSource.description})`;
const style = $ui.common.card[dataSource.grade];
$_.mapSet(box, this.#selected.has(index)? style.selected: style.normal);
switch (dataSource.grade) {
case 1:
grades.x = 0;
labTitle.x = 1;
grade1.visible = true;
grade2.visible = false;
grade3.visible = false;
break;
case 2:
grades.x = 0;
labTitle.x = 1;
grade1.visible = false;
grade2.visible = true;
grade3.visible = false;
break;
case 3:
grades.x = 0;
labTitle.x = 1;
grade1.visible = false;
grade2.visible = false;
grade3.visible = true;
break;
default:
grades.x = 1;
labTitle.x = 0;
grade1.visible = false;
grade2.visible = false;
grade3.visible = false;
break;
}
labTitle.text = dataSource.name;
labTitle.event(Laya.Event.RESIZE);
labDescription.text = dataSource.description;
unselected.visible = !( selected.visible = this.#selected.has(index) );
box.offAll(Laya.Event.CLICK);
box.on(Laya.Event.CLICK, this, () => {
if(this.#selected.has(index)) {
@@ -105,7 +55,8 @@ export default class Talent extends TalentUI {
this.btnNext.label = this.#selected.size === core.talentSelectLimit
? 'UI_Next'
: 'UI_Talent_Select_Uncomplete';
unselected.visible = !( selected.visible = this.#selected.has(index) );
$_.mapSet(box, this.#selected.has(index)? style.selected: style.normal);
});
}
}
+2 -2
View File
@@ -59,9 +59,9 @@ export default class Trajectory extends TrajectoryUI {
return ['images/slider/vslider_1@3x$bar.png'];
}
static #createComponent = plugin.extractComponents(CyberTrajectory.uiView, ['boxTrajectoryItem']);
static #createComponent = plugin.extractComponents(Trajectory.uiView, ['boxTrajectoryItem']);
#createTrajectoryItem() {
const item = CyberTrajectory.#createComponent('boxTrajectoryItem');
const item = Trajectory.#createComponent('boxTrajectoryItem');
item.labContent = item.getChildByName('labContent');
item.labAge = item.getChildByName('hboxAge').getChildByName('labAge');
return item;
+114 -8
View File
@@ -62,14 +62,108 @@ const def = {
configs: {
bgColor: '#222831',
common: {
grade0: '#cccccc',
grade1: '#55fffe',
grade2: '#b17cff',
grade3: '#ffce45',
filter0: '#ccccccff',
filter0: '#55fffeff',
filter0: '#b17cffff',
filter0: '#ffce45ff',
grade: [
'#cccccc',
'#55fffe',
'#b17cff',
'#ffce45',
],
filter: [
'#ccccccff',
'#55fffeff',
'#b17cffff',
'#ffce45ff',
],
card: [
{
normal: {
defaultColor: '#464646',
defaultStroke: '#f8f8f8',
defaultLabel: '#eeeeee',
hoverColor: '#c0c0c0',
hoverStroke: '#f8f8f8',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#c0c0c0',
defaultStroke: '#a5ff88',
defaultLabel: '#3b3b3b',
hoverColor: '#c0c0c0',
hoverStroke: '#a5ff88',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#6495ed',
defaultStroke: '#f8f8f8',
defaultLabel: '#eeeeee',
hoverColor: '#87cefa',
hoverStroke: '#f8f8f8',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#87cefa',
defaultStroke: '#a5ff88',
defaultLabel: '#3b3b3b',
hoverColor: '#87cefa',
hoverStroke: '#a5ff88',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#e2a7ff',
defaultStroke: '#f8f8f8',
defaultLabel: '#eeeeee',
hoverColor: '#e7beff',
hoverStroke: '#f8f8f8',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#e7beff',
defaultStroke: '#a5ff88',
defaultLabel: '#3b3b3b',
hoverColor: '#e7beff',
hoverStroke: '#a5ff88',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#ffa07a',
defaultStroke: '#f8f8f8',
defaultLabel: '#eeeeee',
hoverColor: '#f7a989',
hoverStroke: '#f8f8f8',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#f8f8f8',
defaultStroke: '#a5ff88',
defaultLabel: '#eeeeee',
hoverColor: '#3b3b3b',
hoverStroke: '#a5ff88',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 4,
}
}
]
},
class: {
btn_main: {
@@ -91,6 +185,9 @@ const def = {
hoverLabel: '#eeeeee',
lineWidth: 0,
radius: 4,
},
title: {
color: '#ffffff',
}
},
pages: {
@@ -103,6 +200,15 @@ const def = {
names: {
btnSmall: 'btn_small',
}
},
[pages.TALENT]: {
vars: {
btnDrawCard: 'btn_main',
btnNext: 'btn_main',
},
names: {
title: 'title',
}
}
},
popups: {