mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-07 00:18:59 +08:00
add message popup
This commit is contained in:
@@ -2,6 +2,7 @@ export default class Achievement extends ui.view.DefaultTheme.AchievementUI {
|
||||
constructor() {
|
||||
super();
|
||||
this.btnBack.on(Laya.Event.CLICK, this, () => $ui.switchView(UI.pages.MAIN));
|
||||
this.btnRank.on(Laya.Event.CLICK, this, $$event, ['message', ['M_NoRank']]);
|
||||
this.listAchievements.renderHandler = new Laya.Handler(this, this.onRenderAchievement);
|
||||
this.listAchievements.scrollBar.elasticDistance = 150;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,9 @@ export default class Property extends ui.view.DefaultTheme.PropertyUI {
|
||||
}
|
||||
|
||||
next() {
|
||||
if (this.total < this.#propertyPoints) {
|
||||
return;
|
||||
const left = this.#propertyPoints - this.total;
|
||||
if (left > 0) {
|
||||
return $$event('message', ['F_PropertyPointLeft', left]);
|
||||
}
|
||||
$ui.switchView(
|
||||
UI.pages.TRAJECTORY,
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class Talent extends ui.view.DefaultTheme.TalentUI {
|
||||
|
||||
onClickNext() {
|
||||
if(this.#selected.size < core.talentSelectLimit) {
|
||||
return;
|
||||
return $$event('message', ['F_TalentSelectNotComplect', core.talentSelectLimit]);
|
||||
}
|
||||
|
||||
const talents = [...this.#selected].map(index => this.listTalents.array[index]);
|
||||
@@ -53,6 +53,16 @@ export default class Talent extends ui.view.DefaultTheme.TalentUI {
|
||||
this.#selected.delete(index);
|
||||
} else {
|
||||
if(this.#selected.size >= core.talentSelectLimit) {
|
||||
return $$event('message', ['F_TalentSelectLimit', core.talentSelectLimit]);
|
||||
}
|
||||
const exclusive = core.exclusive(
|
||||
[...this.#selected].map(index => this.listTalents.array[index].id),
|
||||
this.listTalents.array[index].id
|
||||
);
|
||||
if(exclusive != null) {
|
||||
for(const {name, id} of this.listTalents.array)
|
||||
if(exclusive == id)
|
||||
return $$event('message', ['F_TalentConflict', name]);
|
||||
return;
|
||||
}
|
||||
this.#selected.add(index);
|
||||
|
||||
Reference in New Issue
Block a user